Commit 5b006114 by YANGYANG

热力图检索整体提交

parent c11ed492
......@@ -40,4 +40,20 @@ public class JsParams {
@ApiModelProperty("类型/区分机场、火车站")
private String type;
private int begin;
private int end;
private int rownum = 10;
public void setPagePara(Integer rows){
if(rows != null){
this.begin = (this.page - 1) * rows;
this.end = this.page * rows;
}else{
this.begin = (this.page - 1) * rownum;
this.end = this.page * rownum;
}
}
}
......@@ -80,8 +80,13 @@ public class JsController {
@PostMapping(value = "/trainStation")
public MapRestResult trainStation(JsParams jsParams) throws Exception {
jsParams.setType("1");
jsParams.setPagePara(jsParams.getPageSize());
List<JsResult> list = gjMapper.getHczOrJc(jsParams);
return MapRestResult.build(200,"成功获取火车站信息",list.size(),list);
Integer total = 0;
if(list.size()>0){
total = gjMapper.getHczOrJcCount(jsParams);
}
return MapRestResult.build(200,"成功获取火车站信息",total,list);
}
@OperLog(message = "客运站",operation = OperationType.QUERY)
......@@ -97,16 +102,26 @@ public class JsController {
@PostMapping(value = "/airport")
public MapRestResult airport(JsParams jsParams) throws Exception {
jsParams.setType("2");
jsParams.setPagePara(jsParams.getPageSize());
List<JsResult> list = gjMapper.getHczOrJc(jsParams);
return MapRestResult.build(200,"成功获取机场信息",list.size(),list);
Integer total = 0;
if(list.size()>0){
total = gjMapper.getHczOrJcCount(jsParams);
}
return MapRestResult.build(200,"成功获取机场信息",total,list);
}
@OperLog(message = "卡口",operation = OperationType.QUERY)
@ApiOperation(value = "卡口")
@PostMapping(value = "/bayonet")
public MapRestResult bayonet(JsParams jsParams) throws Exception {
jsParams.setPagePara(jsParams.getPageSize());
List<JsResult> list = gjMapper.getKkInfoByQsJwd(jsParams);
return MapRestResult.build(200,"成功获取卡口信息",list.size(),list);
Integer total = 0;
if(list.size()>0){
total = gjMapper.getKkInfoByQsJwdCount(jsParams);
}
return MapRestResult.build(200,"成功获取卡口信息",total,list);
}
@OperLog(message = "电子围栏",operation = OperationType.QUERY)
......
......@@ -26,4 +26,8 @@ public interface GjMapper {
List<JsResult> getHczOrJc(JsParams jsParams);
List<JsResult> getKkInfoByQsJwd(JsParams jsParams);
Integer getHczOrJcCount(JsParams jsParams);
Integer getKkInfoByQsJwdCount(JsParams jsParams);
}
......@@ -53,6 +53,9 @@
</select>
<!-- 根据起始经纬度获取火车站或者机场-->
<select id="getHczOrJc" parameterType="com.founder.commonutils.publicEntity.JsParams" resultType="com.founder.commonutils.publicEntity.JsResult">
select t2.* from(
select t1.*,rownum as rn from
(
SELECT
BSM as name,
BSMC as address,
......@@ -70,9 +73,20 @@
<if test="type!=null and type!=''">
AND type = #{type,jdbcType=VARCHAR}
</if>
) t1
<where>
rownum<![CDATA[ <= ]]> #{ end , jdbcType=VARCHAR }
</where>
)t2
<where>
rn<![CDATA[ > ]]> #{ begin, jdbcType=VARCHAR }
</where>
</select>
<!--根据起始经纬度获取卡口点位数据-->
<select id="getKkInfoByQsJwd" parameterType="com.founder.commonutils.publicEntity.JsParams" resultType="com.founder.commonutils.publicEntity.JsResult">
select t2.* from(
select t1.*,rownum as rn from
(
select
SBMC as name,
SBBH as bh,
......@@ -88,6 +102,43 @@
AND JD<![CDATA[>=]]>#{startLng,jdbcType=VARCHAR} AND JD<![CDATA[<=]]>#{endLng,jdbcType=VARCHAR}
AND WD<![CDATA[>=]]>#{startLat,jdbcType=VARCHAR} AND WD<![CDATA[<=]]>#{endLat,jdbcType=VARCHAR}
</if>
) t1
<where>
rownum<![CDATA[ <= ]]> #{ end , jdbcType=VARCHAR }
</where>
)t2
<where>
rn<![CDATA[ > ]]> #{ begin, jdbcType=VARCHAR }
</where>
</select>
<!-- 根据起始经纬度获取火车站或者机场-->
<select id="getHczOrJcCount" parameterType="com.founder.commonutils.publicEntity.JsParams" resultType="java.lang.Integer">
SELECT
count(*)
FROM
SYS_DICTITEM_JT
WHERE
SCBZ = '0'
<if test="startLng!=null and startLng!='' and endLng!=null and endLng!='' and startLat!=null and startLat!='' and endLat!=null and endLat!=''">
AND JD <![CDATA[>=]]>#{startLng,jdbcType=VARCHAR} AND JD <![CDATA[<=]]>#{endLng,jdbcType=VARCHAR}
AND WD <![CDATA[>=]]>#{startLat,jdbcType=VARCHAR} AND WD <![CDATA[<=]]>#{endLat,jdbcType=VARCHAR}
</if>
<if test="type!=null and type!=''">
AND type = #{type,jdbcType=VARCHAR}
</if>
</select>
<!--根据起始经纬度获取卡口点位数据-->
<select id="getKkInfoByQsJwdCount" parameterType="com.founder.commonutils.publicEntity.JsParams" resultType="java.lang.Integer">
select
count(*)
from
tb_m_jj_kkdwxx
where
1=1
<if test="startLng!=null and startLng!='' and endLng!=null and endLng!='' and startLat!=null and startLat!='' and endLat!=null and endLat!=''">
AND JD<![CDATA[>=]]>#{startLng,jdbcType=VARCHAR} AND JD<![CDATA[<=]]>#{endLng,jdbcType=VARCHAR}
AND WD<![CDATA[>=]]>#{startLat,jdbcType=VARCHAR} AND WD<![CDATA[<=]]>#{endLat,jdbcType=VARCHAR}
</if>
</select>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment