提交 770e5a67 authored 作者: 朱运伟's avatar 朱运伟

数字公路

上级 fe581b97
......@@ -9,6 +9,7 @@ import com.elephant.framework.galaxy.aroad.module.szgl.service.SzglGsdGczService
import com.elephant.framework.galaxy.aroad.response.R;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
......@@ -55,5 +56,9 @@ public class SzglGsdGczController extends BaseController {
return new R<>(szglGsdGczService.list(queryWrapper));
}
@GetMapping("/getGczFroQS/{lxbh}/{zxzh}")
public R getGczForQS(@PathVariable String lxbh,@PathVariable double zxzh){
return new R<>(szglGsdGczService.getGczForQS(lxbh,zxzh));
}
}
......@@ -11,6 +11,8 @@ import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
import com.elephant.framework.galaxy.aroad.module.common.controller.BaseController;
import java.util.List;
/**
* 数字公路-视频点
......@@ -68,7 +70,7 @@ public class SzglGsdSpdwController extends BaseController {
* @param lat 维度
* @return
*/
@GetMapping("getZbjk/{radius}/{lng}/{lat}")
@GetMapping("getZbjkForQS/{radius}/{lng}/{lat}")
public R getZbjkForQS(@PathVariable double radius, @PathVariable double lng, @PathVariable double lat) {
//先计算查询点的经纬度范围  
......@@ -82,12 +84,13 @@ public class SzglGsdSpdwController extends BaseController {
double minlng = lng -dlng;
double maxlng = lng + dlng;
QueryWrapper<SzglGsdSpdw> queryWrapper = new QueryWrapper<>();
// queryWrapper.lambda()
// .ge("jd",minlng);
return null;
queryWrapper.lambda()
.ge(SzglGsdSpdw::getJd,minlng)
.le(SzglGsdSpdw::getJd,maxlng)
.ge(SzglGsdSpdw::getWd,minlat)
.le(SzglGsdSpdw::getWd,maxlat);
List<SzglGsdSpdw> list = szglGsdSpdwService.list(queryWrapper);
return new R(list);
}
}
......@@ -3,10 +3,13 @@ package com.elephant.framework.galaxy.aroad.module.szgl.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.elephant.framework.galaxy.aroad.module.traffic.entity.TrafficRoadsection;
import com.elephant.framework.galaxy.aroad.module.traffic.entity.TrafficRoute;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;
/**
* 数字公路-观测站
......@@ -125,5 +128,9 @@ private static final long serialVersionUID = 1L;
*
*/
private Integer nian;
/**
* 路段交通量
*/
private List<TrafficRoadsection> trfList;
}
......@@ -2,6 +2,9 @@ package com.elephant.framework.galaxy.aroad.module.szgl.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.elephant.framework.galaxy.aroad.module.szgl.entity.SzglGsdGcz;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 数字公路-观测站
......@@ -10,5 +13,11 @@ import com.elephant.framework.galaxy.aroad.module.szgl.entity.SzglGsdGcz;
* @date 2019-05-13 11:08:50
*/
public interface SzglGsdGczMapper extends BaseMapper<SzglGsdGcz> {
/**
* 根据路线编号与中心桩号查询观测站及交通量
* @param lxbh
* @param zxzh
* @return
*/
List<SzglGsdGcz> getGczJtl (@Param("lxbh") String lxbh, @Param("zxzh") Double zxzh);
}
......@@ -10,5 +10,11 @@ import com.elephant.framework.galaxy.aroad.module.szgl.entity.SzglGsdGcz;
* @date 2019-05-13 11:08:50
*/
public interface SzglGsdGczService extends IService<SzglGsdGcz> {
/***
* 根据路线与中心桩号查询交通量
* @param lxbh
* @param zxzh
* @return
*/
Object getGczForQS(String lxbh, double zxzh);
}
......@@ -15,4 +15,11 @@ import org.springframework.stereotype.Service;
@Service
public class SzglGsdGczServiceImpl extends ServiceImpl<SzglGsdGczMapper, SzglGsdGcz> implements SzglGsdGczService {
@Override
public Object getGczForQS(String lxbh, double zxzh) {
return null;
}
}
......@@ -31,5 +31,36 @@
<result property="wd" column="wd"/>
<result property="gs" column="gs"/>
<result property="nian" column="nian"/>
<collection property="trfList"
ofType="com.elephant.framework.galaxy.aroad.module.traffic.entity.TrafficRoadsection">
<result property="jdcCurrentAmount" column="jdcCurrentAmount"/>
<result property="jdcNaturalAmount" column="jdcNaturalAmount"/>
<result property="year" column="year"/>
</collection>
</resultMap>
<select id="getGczJtl" resultType="com.elephant.framework.galaxy.aroad.module.szgl.entity.SzglGsdGcz">
select gcz.*,
jtl.JDC_current_amount as jdcCurrentAmount,
jtl.JDC_natural_amount as jdcNaturalAmount,
jtl.year
from t_szgl_gsd_gcz gcz
left join v_traffic_roadsection jtl on gcz.gczbh =jtl.spot_code
<where>
<if test="lxbh !=null and lxbh !''">
gcz.lxbh =#{lxbh}
</if>
<if test="zxzh !=null">
gcz.qdzh <![CDATA[ <= ]]>#{zxzh} and gcz.zdzh <![CDATA[ >= ]]>#{zxzh}
</if>
</where>
</select>
</mapper>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论