接警信息--定位查

develop
Angel 9 months ago
parent 83611666d1
commit de41501855

@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
/** /**
@ -783,4 +784,13 @@ public class JcjJjxxViewMysql implements Serializable {
@TableField(value = "STATUS") @TableField(value = "STATUS")
private String STATUS; private String STATUS;
@TableField(exist = false)
private String LEFTTOPLONGITUDE;
@TableField(exist = false)
private String RIGHTBOTTOMLONGITUDE;
@TableField(exist = false)
private String RIGHTBOTTOMLATITUDE;
@TableField(exist = false)
private String LEFTTOPLATITUDE;
} }

@ -15,4 +15,6 @@ public interface JcjJxxViewMysqlMapper extends BaseMapper<JcjJjxxViewMysql> {
public JcjJjxxViewMysql selectRecordOrderByRksj(); public JcjJjxxViewMysql selectRecordOrderByRksj();
public int countJjxx(); public int countJjxx();
public JcjJjxxViewMysql selectloaction(JcjJjxxViewMysql bean);
} }

@ -19,4 +19,6 @@ public interface JcjJjxxViewMysqlService extends IService<JcjJjxxViewMysql>{
public int countJjxx(); public int countJjxx();
public JcjJjxxViewMysql selectloaction(JcjJjxxViewMysql bean);
} }

@ -7,6 +7,7 @@ import com.ssf.mysqloracletest.mapper.JcjJxxViewMysqlMapper;
import com.ssf.mysqloracletest.service.JcjJjxxViewMysqlService; import com.ssf.mysqloracletest.service.JcjJjxxViewMysqlService;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/** /**
* @author 10503 * @author 10503
@ -44,6 +45,12 @@ public class JcjJjxxViewMysqlServiceImpl extends ServiceImpl<JcjJxxViewMysqlMapp
public int countJjxx() { public int countJjxx() {
return jcxxMapper.countJjxx(); return jcxxMapper.countJjxx();
} }
@Override
public JcjJjxxViewMysql selectloaction(JcjJjxxViewMysql bean) {
return jcxxMapper.selectloaction(bean);
}
} }

@ -47,7 +47,6 @@ public class AlarmInfoTask {
return; return;
} }
try { try {
QueryWrapper<JcjJjxxViewMysql> queryWrapper = new QueryWrapper<>(); QueryWrapper<JcjJjxxViewMysql> queryWrapper = new QueryWrapper<>();
queryWrapper.isNull("STATUS"); queryWrapper.isNull("STATUS");
@ -80,34 +79,38 @@ public class AlarmInfoTask {
private void cleanJjxx(JcjJjxxViewMysql bean) { private void cleanJjxx(JcjJjxxViewMysql bean) {
JcjJjxxViewMysql jjxxViewMysqlCp = new JcjJjxxViewMysql(); JcjJjxxViewMysql jjxxViewMysqlCp = new JcjJjxxViewMysql();
jjxxViewMysqlCp.setLEFTTOPLONGITUDE("120.423914");
jjxxViewMysqlCp.setRIGHTBOTTOMLONGITUDE("120.439581");
jjxxViewMysqlCp.setRIGHTBOTTOMLATITUDE("33.823756");
jjxxViewMysqlCp.setLEFTTOPLATITUDE("33.833082");
JcjJjxxViewMysql selectloaction = jjxxViewMysqlService.selectloaction(jjxxViewMysqlCp);
try { try {
BeanUtils.copyProperties(bean, jjxxViewMysqlCp); BeanUtils.copyProperties(bean, selectloaction);
JcjJjxxViewMysql jwd = jjxxViewMysqlService.selectJcjJxxByJJBH(bean.getJJBH()); JcjJjxxViewMysql jwd = jjxxViewMysqlService.selectJcjJxxByJJBH(selectloaction.getJJBH());
MetaAlarmInfo alarmInfo = new MetaAlarmInfo(); MetaAlarmInfo alarmInfo = new MetaAlarmInfo();
//设置目标字段的值 //设置目标字段的值
//alarm_code<-----JJBH 接警编号 //alarm_code<-----JJBH 接警编号
alarmInfo.setAlarmCode(jjxxViewMysqlCp.getJJBH()); alarmInfo.setAlarmCode(selectloaction.getJJBH());
//police_receiver_name<-----JJRXM接警人姓名 //police_receiver_name<-----JJRXM接警人姓名
alarmInfo.setPoliceReceiverName(jjxxViewMysqlCp.getJJRXM()); alarmInfo.setPoliceReceiverName(selectloaction.getJJRXM());
//alarm_response_time<-----JJRQSJ接警日期时间 //alarm_response_time<-----JJRQSJ接警日期时间
alarmInfo.setAlarmResponseTime(jjxxViewMysqlCp.getJJRQSJ()); alarmInfo.setAlarmResponseTime(selectloaction.getJJRQSJ());
//alarm_response_content<-----BJNR接警报警内容 //alarm_response_content<-----BJNR接警报警内容
alarmInfo.setAlarmResponseContent(jjxxViewMysqlCp.getBJNR()); alarmInfo.setAlarmResponseContent(selectloaction.getBJNR());
//informant_name<-----BJR接警报警人 //informant_name<-----BJR接警报警人
alarmInfo.setInformantName(jjxxViewMysqlCp.getBJR()); alarmInfo.setInformantName(selectloaction.getBJR());
//informant_time<-----BJDHSJ接警报警时间 //informant_time<-----BJDHSJ接警报警时间
alarmInfo.setInformantTime(jjxxViewMysqlCp.getBJDHSJ()); alarmInfo.setInformantTime(selectloaction.getBJDHSJ());
//informant_phone<-----LXDH接警报警人联系电话 //informant_phone<-----LXDH接警报警人联系电话
alarmInfo.setInformantPhone(jjxxViewMysqlCp.getLXDH()); alarmInfo.setInformantPhone(selectloaction.getLXDH());
//alarm_response_type<-----BJLXMC报警类型名称 //alarm_response_type<-----BJLXMC报警类型名称
alarmInfo.setAlarmResponseTypeName(jjxxViewMysqlCp.getBJLXMC()); alarmInfo.setAlarmResponseTypeName(selectloaction.getBJLXMC());
//alarm_address<-----SFDD接警事发地址 //alarm_address<-----SFDD接警事发地址
alarmInfo.setAlarmAddress(jjxxViewMysqlCp.getSFDD()); alarmInfo.setAlarmAddress(selectloaction.getSFDD());
//alarm_response_unit<-----JJDWMC接警单位名称 //alarm_response_unit<-----JJDWMC接警单位名称
alarmInfo.setAlarmResponseUnit(jjxxViewMysqlCp.getJJDWMC()); alarmInfo.setAlarmResponseUnit(selectloaction.getJJDWMC());
if (jwd.getGIS_Y() != null) { if (jwd.getGIS_Y() != null) {
//latitude(纬度)<-----WDZB纬度坐标 //latitude(纬度)<-----WDZB纬度坐标
alarmInfo.setLatitude(NumKit.checkBigDecimal(jwd.getGIS_Y())); alarmInfo.setLatitude(NumKit.checkBigDecimal(jwd.getGIS_Y()));
} }
@ -120,14 +123,14 @@ public class AlarmInfoTask {
boolean b = alarmInfoService.save(alarmInfo); boolean b = alarmInfoService.save(alarmInfo);
if (b) { if (b) {
jjxxViewMysqlCp.setSTATUS("1"); selectloaction.setSTATUS("1");
jjxxViewMysqlService.updateJjxxByJJBH(jjxxViewMysqlCp); jjxxViewMysqlService.updateJjxxByJJBH(selectloaction);
logger.info("状态修改为1"); logger.info("状态修改为1");
} }
} catch (Exception e) { } catch (Exception e) {
logger.info(StringKit.getTrace(e)); logger.info(StringKit.getTrace(e));
jjxxViewMysqlCp.setSTATUS("2"); selectloaction.setSTATUS("2");
jjxxViewMysqlService.updateJjxxByJJBH(jjxxViewMysqlCp); jjxxViewMysqlService.updateJjxxByJJBH(selectloaction);
logger.info("状态修改为2"); logger.info("状态修改为2");
} }
} }

@ -134,6 +134,10 @@
<result property="JDZB" column="JDZB" jdbcType="VARCHAR"/> <result property="JDZB" column="JDZB" jdbcType="VARCHAR"/>
<result property="WDZB" column="WDZB" jdbcType="VARCHAR"/> <result property="WDZB" column="WDZB" jdbcType="VARCHAR"/>
<result property="STATUS" column="STATUS" jdbcType="VARCHAR"/> <result property="STATUS" column="STATUS" jdbcType="VARCHAR"/>
<result property="LEFTTOPLONGITUDE" column="LEFTTOPLONGITUDE" jdbcType="VARCHAR"/>
<result property="RIGHTBOTTOMLONGITUDE" column="RIGHTBOTTOMLONGITUDE" jdbcType="VARCHAR"/>
<result property="RIGHTBOTTOMLATITUDE" column="RIGHTBOTTOMLATITUDE" jdbcType="VARCHAR"/>
<result property="LEFTTOPLATITUDE" column="LEFTTOPLATITUDE" jdbcType="VARCHAR"/>
</resultMap> </resultMap>
<select id="selectJcjJxxByJJBH" parameterType="java.lang.String" resultMap="BaseResultMap"> <select id="selectJcjJxxByJJBH" parameterType="java.lang.String" resultMap="BaseResultMap">
@ -276,7 +280,10 @@
<if test="JDZB != null and JDZB != '' ">JDZB ,</if> <if test="JDZB != null and JDZB != '' ">JDZB ,</if>
<if test="WDZB != null and WDZB != '' ">WDZB ,</if> <if test="WDZB != null and WDZB != '' ">WDZB ,</if>
<if test="STATUS != null and STATUS != '' ">STATUS ,</if> <if test="STATUS != null and STATUS != '' ">STATUS ,</if>
<if test="LEFTTOPLONGITUDE != null and LEFTTOPLONGITUDE != '' ">LEFTTOPLONGITUDE ,</if>
<if test="RIGHTBOTTOMLONGITUDE != null and RIGHTBOTTOMLONGITUDE != '' ">RIGHTBOTTOMLONGITUDE ,</if>
<if test="RIGHTBOTTOMLATITUDE != null and RIGHTBOTTOMLATITUDE != '' ">RIGHTBOTTOMLATITUDE ,</if>
<if test="LEFTTOPLATITUDE != null and LEFTTOPLATITUDE != '' ">LEFTTOPLATITUDE ,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="JJBH != null and JJBH != '' ">#{JJBH },</if> <if test="JJBH != null and JJBH != '' ">#{JJBH },</if>
@ -408,6 +415,10 @@
<if test="JDZB != null and JDZB != '' ">#{JDZB },</if> <if test="JDZB != null and JDZB != '' ">#{JDZB },</if>
<if test="WDZB != null and WDZB != '' ">#{WDZB },</if> <if test="WDZB != null and WDZB != '' ">#{WDZB },</if>
<if test="STATUS != null and STATUS != '' ">#{STATUS },</if> <if test="STATUS != null and STATUS != '' ">#{STATUS },</if>
<if test="LEFTTOPLONGITUDE != null and LEFTTOPLONGITUDE != '' ">#{LEFTTOPLONGITUDE },</if>
<if test="RIGHTBOTTOMLONGITUDE != null and RIGHTBOTTOMLONGITUDE != '' ">#{RIGHTBOTTOMLONGITUDE },</if>
<if test="RIGHTBOTTOMLATITUDE != null and RIGHTBOTTOMLATITUDE != '' ">#{RIGHTBOTTOMLONGITUDE },</if>
<if test="LEFTTOPLATITUDE != null and LEFTTOPLATITUDE != '' ">#{LEFTTOPLATITUDE },</if>
</trim> </trim>
</insert> </insert>
@ -545,20 +556,34 @@
<if test="JDZB != null and JDZB != '' ">JDZB =#{JDZB },</if> <if test="JDZB != null and JDZB != '' ">JDZB =#{JDZB },</if>
<if test="WDZB != null and WDZB != '' ">WDZB =#{WDZB },</if> <if test="WDZB != null and WDZB != '' ">WDZB =#{WDZB },</if>
<if test="STATUS != null and STATUS != '' ">STATUS =#{STATUS },</if> <if test="STATUS != null and STATUS != '' ">STATUS =#{STATUS },</if>
<if test="LEFTTOPLONGITUDE != null and LEFTTOPLONGITUDE != '' ">LEFTTOPLONGITUDE =#{LEFTTOPLONGITUDE },</if>
<if test="RIGHTBOTTOMLONGITUDE != null and RIGHTBOTTOMLONGITUDE != '' ">RIGHTBOTTOMLONGITUDE =#{RIGHTBOTTOMLONGITUDE },</if>
<if test="RIGHTBOTTOMLATITUDE != null and RIGHTBOTTOMLATITUDE != '' ">RIGHTBOTTOMLATITUDE =#{RIGHTBOTTOMLONGITUDE },</if>
<if test="LEFTTOPLATITUDE != null and LEFTTOPLATITUDE != '' ">LEFTTOPLATITUDE =#{LEFTTOPLATITUDE },</if>
</trim> </trim>
where JJBH = #{JJBH} where JJBH = #{JJBH}
</update> </update>
<select id="selectRecordOrderByRksj" parameterType="java.lang.String" resultMap="BaseResultMap"> <select id="selectRecordOrderByRksj" parameterType="java.lang.String" resultMap="BaseResultMap">
select * select *
from jcj_jjxx_view order by ws_rksj desc limit 1; from jcj_jjxx_view
order by ws_rksj desc
limit 1;
</select> </select>
<select id="countJjxx" resultType="int"> <select id="countJjxx" resultType="int">
select count(*) select count(*)
from jcj_jjxx_view limit 1 from jcj_jjxx_view
limit 1
</select>
<select id="selectloaction" parameterMap="map" resultMap="BaseResultMap">
select *
from jcj_jjxx_view
where JDZB BETWEEN #{leftTopLongitude} AND #{rightBottomLongitude}
AND WDZB BETWEEN #{rightBottomLatitude} AND #{leftTopLatitude};
</select> </select>
</mapper> </mapper>

Loading…
Cancel
Save