接警信息--定位查

develop
Angel 11 months ago
parent 83611666d1
commit de41501855

@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.io.Serializable;
/**
@ -783,4 +784,13 @@ public class JcjJjxxViewMysql implements Serializable {
@TableField(value = "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 int countJjxx();
public JcjJjxxViewMysql selectloaction(JcjJjxxViewMysql bean);
}

@ -19,4 +19,6 @@ public interface JcjJjxxViewMysqlService extends IService<JcjJjxxViewMysql>{
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 lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* @author 10503
@ -16,7 +17,7 @@ import org.springframework.stereotype.Service;
@Service
@DS("mysql")
@RequiredArgsConstructor
public class JcjJjxxViewMysqlServiceImpl extends ServiceImpl<JcjJxxViewMysqlMapper,JcjJjxxViewMysql> implements JcjJjxxViewMysqlService {
public class JcjJjxxViewMysqlServiceImpl extends ServiceImpl<JcjJxxViewMysqlMapper, JcjJjxxViewMysql> implements JcjJjxxViewMysqlService {
private final JcjJxxViewMysqlMapper jcxxMapper;
@ -44,6 +45,12 @@ public class JcjJjxxViewMysqlServiceImpl extends ServiceImpl<JcjJxxViewMysqlMapp
public int countJjxx() {
return jcxxMapper.countJjxx();
}
@Override
public JcjJjxxViewMysql selectloaction(JcjJjxxViewMysql bean) {
return jcxxMapper.selectloaction(bean);
}
}

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

@ -134,6 +134,10 @@
<result property="JDZB" column="JDZB" jdbcType="VARCHAR"/>
<result property="WDZB" column="WDZB" 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>
<select id="selectJcjJxxByJJBH" parameterType="java.lang.String" resultMap="BaseResultMap">
@ -276,7 +280,10 @@
<if test="JDZB != null and JDZB != '' ">JDZB ,</if>
<if test="WDZB != null and WDZB != '' ">WDZB ,</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 prefix="values (" suffix=")" suffixOverrides=",">
<if test="JJBH != null and JJBH != '' ">#{JJBH },</if>
@ -408,6 +415,10 @@
<if test="JDZB != null and JDZB != '' ">#{JDZB },</if>
<if test="WDZB != null and WDZB != '' ">#{WDZB },</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>
</insert>
@ -545,20 +556,34 @@
<if test="JDZB != null and JDZB != '' ">JDZB =#{JDZB },</if>
<if test="WDZB != null and WDZB != '' ">WDZB =#{WDZB },</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>
where JJBH = #{JJBH}
</update>
<select id="selectRecordOrderByRksj" parameterType="java.lang.String" resultMap="BaseResultMap">
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 id="countJjxx" resultType="int">
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>
</mapper>

Loading…
Cancel
Save