develop
Angel 9 months ago
parent 0112dcd450
commit 571fde613c

@ -224,5 +224,15 @@ public class JcjCjxxViewMysql implements Serializable {
@TableField(value = "RYWKSJ")
private String RYWKSJ;
@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;
}

@ -2,7 +2,11 @@ package com.ssf.mysqloracletest.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ssf.mysqloracletest.domain.JcjCjxxViewMysql;
import com.ssf.mysqloracletest.domain.JcjJjxxViewMysql;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import java.util.List;
/**
* @author 28758
@ -19,6 +23,12 @@ public interface JcjCjxxViewMysqlMapper extends BaseMapper<JcjCjxxViewMysql> {
public int updateCjxxById(JcjCjxxViewMysql bean);
JcjCjxxViewMysql selectRecordOrderByRksj();
@Select(" select * " +
" from jcj_jjxx_view " +
" where JDZB BETWEEN #{LEFTTOPLONGITUDE} AND #{RIGHTBOTTOMLONGITUDE} " +
" AND WDZB BETWEEN #{RIGHTBOTTOMLATITUDE} AND #{LEFTTOPLATITUDE}"+" AND STATUS IS NULL")
public List<JcjCjxxViewMysql> selectloaction(JcjCjxxViewMysql bean);
}

@ -22,6 +22,6 @@ public interface JcjJxxViewMysqlMapper extends BaseMapper<JcjJjxxViewMysql> {
@Select(" select * " +
" from jcj_jjxx_view " +
" where JDZB BETWEEN #{LEFTTOPLONGITUDE} AND #{RIGHTBOTTOMLONGITUDE} " +
" AND WDZB BETWEEN #{RIGHTBOTTOMLATITUDE} AND #{LEFTTOPLATITUDE}")
" AND WDZB BETWEEN #{RIGHTBOTTOMLATITUDE} AND #{LEFTTOPLATITUDE}"+" AND STATUS IS NULL")
public List<JcjJjxxViewMysql> selectloaction(JcjJjxxViewMysql bean);
}

@ -2,6 +2,9 @@ package com.ssf.mysqloracletest.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ssf.mysqloracletest.domain.JcjCjxxViewMysql;
import com.ssf.mysqloracletest.domain.JcjJjxxViewMysql;
import java.util.List;
/**
* @author 28758
@ -16,4 +19,6 @@ public interface JcjCjxxViewMysqlService extends IService<JcjCjxxViewMysql> {
public int updateCjxxById(JcjCjxxViewMysql tjks);
public JcjCjxxViewMysql selectRecordOrderByRksj();
public List<JcjCjxxViewMysql> selectloaction(JcjCjxxViewMysql bean);
}

@ -8,6 +8,8 @@ import com.ssf.mysqloracletest.service.JcjCjxxViewMysqlService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @author 28758
* @description jcj_cjxx_viewService
@ -40,6 +42,11 @@ public class JcjCjxxViewMysqlServiceImpl extends ServiceImpl<JcjCjxxViewMysqlMap
return jcjCjxxViewMysqlMapper.selectRecordOrderByRksj();
}
@Override
public List<JcjCjxxViewMysql> selectloaction(JcjCjxxViewMysql bean) {
return jcjCjxxViewMysqlMapper.selectloaction(bean);
}
}

@ -48,14 +48,16 @@ public class AlarmInfoTask {
}
try {
QueryWrapper<JcjJjxxViewMysql> queryWrapper = new QueryWrapper<>();
queryWrapper.isNull("STATUS");
Page<JcjJjxxViewMysql> page = new Page<>(1, 200);
List<JcjJjxxViewMysql> resultList = jjxxViewMysqlService.page(page, queryWrapper).getRecords();
JcjJjxxViewMysql jjxxViewMysqlCp = new JcjJjxxViewMysql();
jjxxViewMysqlCp.setLEFTTOPLONGITUDE("120.423914");
jjxxViewMysqlCp.setRIGHTBOTTOMLONGITUDE("120.439581");
jjxxViewMysqlCp.setRIGHTBOTTOMLATITUDE("33.823756");
jjxxViewMysqlCp.setLEFTTOPLATITUDE("33.833082");
CountDownLatch latch = new CountDownLatch(resultList.size());
List<JcjJjxxViewMysql> selectloaction = jjxxViewMysqlService.selectloaction(jjxxViewMysqlCp);
CountDownLatch latch = new CountDownLatch(selectloaction.size());
ExecutorService JjxxPool = Executors.newFixedThreadPool(5);
for (JcjJjxxViewMysql bean : resultList) {
for (JcjJjxxViewMysql bean : selectloaction) {
JjxxPool.submit(() -> {
cleanJjxx(bean);
logger.info("清洗完成");
@ -79,60 +81,54 @@ 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");
List<JcjJjxxViewMysql> selectloaction = jjxxViewMysqlService.selectloaction(jjxxViewMysqlCp);
System.out.println();
BeanUtils.copyProperties(bean, jjxxViewMysqlCp);
try {
// BeanUtils.copyProperties(bean, selectloaction);
// JcjJjxxViewMysql jwd = jjxxViewMysqlService.selectJcjJxxByJJBH(selectloaction.getJJBH());
// MetaAlarmInfo alarmInfo = new MetaAlarmInfo();
// //设置目标字段的值
// //alarm_code<-----JJBH 接警编号
// alarmInfo.setAlarmCode(selectloaction.getJJBH());
// //police_receiver_name<-----JJRXM接警人姓名
// alarmInfo.setPoliceReceiverName(selectloaction.getJJRXM());
// //alarm_response_time<-----JJRQSJ接警日期时间
// alarmInfo.setAlarmResponseTime(selectloaction.getJJRQSJ());
// //alarm_response_content<-----BJNR接警报警内容
// alarmInfo.setAlarmResponseContent(selectloaction.getBJNR());
// //informant_name<-----BJR接警报警人
// alarmInfo.setInformantName(selectloaction.getBJR());
// //informant_time<-----BJDHSJ接警报警时间
// alarmInfo.setInformantTime(selectloaction.getBJDHSJ());
// //informant_phone<-----LXDH接警报警人联系电话
// alarmInfo.setInformantPhone(selectloaction.getLXDH());
// //alarm_response_type<-----BJLXMC报警类型名称
// alarmInfo.setAlarmResponseTypeName(selectloaction.getBJLXMC());
// //alarm_address<-----SFDD接警事发地址
// alarmInfo.setAlarmAddress(selectloaction.getSFDD());
// //alarm_response_unit<-----JJDWMC接警单位名称
// alarmInfo.setAlarmResponseUnit(selectloaction.getJJDWMC());
//
// if (jwd.getGIS_Y() != null) {
// //latitude(纬度)<-----WDZB纬度坐标
// alarmInfo.setLatitude(NumKit.checkBigDecimal(jwd.getGIS_Y()));
// }
//
// if (jwd.getGIS_X() != null) {
// //longitude(经度)<-----JDZB经度坐标
// alarmInfo.setLongitude(NumKit.checkBigDecimal(jwd.getGIS_X()));
// }
//
// boolean b = alarmInfoService.save(alarmInfo);
//
// if (b) {
// selectloaction.setSTATUS("1");
// jjxxViewMysqlService.updateJjxxByJJBH(selectloaction);
// logger.info("状态修改为1");
// }
JcjJjxxViewMysql jwd = jjxxViewMysqlService.selectJcjJxxByJJBH(jjxxViewMysqlCp.getJJBH());
MetaAlarmInfo alarmInfo = new MetaAlarmInfo();
//设置目标字段的值
//alarm_code<-----JJBH 接警编号
alarmInfo.setAlarmCode(jjxxViewMysqlCp.getJJBH());
//police_receiver_name<-----JJRXM接警人姓名
alarmInfo.setPoliceReceiverName(jjxxViewMysqlCp.getJJRXM());
//alarm_response_time<-----JJRQSJ接警日期时间
alarmInfo.setAlarmResponseTime(jjxxViewMysqlCp.getJJRQSJ());
//alarm_response_content<-----BJNR接警报警内容
alarmInfo.setAlarmResponseContent(jjxxViewMysqlCp.getBJNR());
//informant_name<-----BJR接警报警人
alarmInfo.setInformantName(jjxxViewMysqlCp.getBJR());
//informant_time<-----BJDHSJ接警报警时间
alarmInfo.setInformantTime(jjxxViewMysqlCp.getBJDHSJ());
//informant_phone<-----LXDH接警报警人联系电话
alarmInfo.setInformantPhone(jjxxViewMysqlCp.getLXDH());
//alarm_response_type<-----BJLXMC报警类型名称
alarmInfo.setAlarmResponseTypeName(jjxxViewMysqlCp.getBJLXMC());
//alarm_address<-----SFDD接警事发地址
alarmInfo.setAlarmAddress(jjxxViewMysqlCp.getSFDD());
//alarm_response_unit<-----JJDWMC接警单位名称
alarmInfo.setAlarmResponseUnit(jjxxViewMysqlCp.getJJDWMC());
if (jwd.getGIS_Y() != null) {
//latitude(纬度)<-----WDZB纬度坐标
alarmInfo.setLatitude(NumKit.checkBigDecimal(jwd.getGIS_Y()));
}
if (jwd.getGIS_X() != null) {
//longitude(经度)<-----JDZB经度坐标
alarmInfo.setLongitude(NumKit.checkBigDecimal(jwd.getGIS_X()));
}
boolean b = alarmInfoService.save(alarmInfo);
if (b) {
jjxxViewMysqlCp.setSTATUS("1");
jjxxViewMysqlService.updateJjxxByJJBH(jjxxViewMysqlCp);
logger.info("状态修改为1");
}
} catch (Exception e) {
// logger.info(StringKit.getTrace(e));
// selectloaction.setSTATUS("2");
// jjxxViewMysqlService.updateJjxxByJJBH(selectloaction);
// logger.info("状态修改为2");
logger.info(StringKit.getTrace(e));
jjxxViewMysqlCp.setSTATUS("2");
jjxxViewMysqlService.updateJjxxByJJBH(jjxxViewMysqlCp);
logger.info("状态修改为2");
}
}
}

@ -181,10 +181,7 @@ public class JcjCjxxTask {
cjxxMysqlService.updateCjxxById(sBean);
logger.info("cjxx-" + cjxx.getJJBH() + ":更新成功");
}
}
} catch (Exception e) {
e.printStackTrace();
}

@ -110,12 +110,18 @@
<result property="JQSXMC" column="JQSXMC" jdbcType="VARCHAR"/>
<result property="RYWKSJ" column="RYWKSJ" 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="selectCjxxById" parameterType="java.lang.String" resultMap="BaseResultMap">
select * from jcj_cjxx_view
where CJBH = #{CJBH} limit 1
select *
from jcj_cjxx_view
where CJBH = #{CJBH}
limit 1
</select>
<insert id="insertCjxx" parameterType="com.ssf.mysqloracletest.domain.JcjCjxxViewMysql" useGeneratedKeys="true"
@ -226,6 +232,12 @@
<if test="WS_YXX != null and WS_YXX != '' ">WS_YXX,</if>
<if test="JQSXMC != null and JQSXMC != '' ">JQSXMC,</if>
<if test="RYWKSJ != null and RYWKSJ != '' ">RYWKSJ,</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="CJBH != null and CJBH != '' ">#{CJBH},</if>
@ -332,6 +344,14 @@
<if test="WS_YXX != null and WS_YXX != '' ">#{WS_YXX},</if>
<if test="JQSXMC != null and JQSXMC != '' ">#{JQSXMC},</if>
<if test="RYWKSJ != null and RYWKSJ != '' ">#{RYWKSJ},</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>
@ -443,14 +463,37 @@
<if test="JQSXMC != null and JQSXMC != '' ">JQSXMC=#{JQSXMC},</if>
<if test="RYWKSJ != null and RYWKSJ != '' ">RYWKSJ=#{RYWKSJ},</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_cjxx_view order by ws_rksj desc limit 1;
from jcj_cjxx_view
order by ws_rksj desc
limit 1;
</select>
<select id="selectloaction" parameterType="com.ssf.mysqloracletest.domain.JcjCjxxViewMysql"
resultMap="BaseResultMap">
select *
from jcj_jjxx_view
where JDZB BETWEEN #{LEFTTOPLONGITUDE} AND #{RIGHTBOTTOMLONGITUDE}
AND WDZB BETWEEN #{RIGHTBOTTOMLATITUDE} AND #{LEFTTOPLATITUDE}
AND STATUS IS NULL
</select>
</mapper>

@ -281,7 +281,8 @@
<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="RIGHTBOTTOMLONGITUDE != null and RIGHTBOTTOMLONGITUDE != '' ">RIGHTBOTTOMLONGITUDE ,
</if>
<if test="RIGHTBOTTOMLATITUDE != null and RIGHTBOTTOMLATITUDE != '' ">RIGHTBOTTOMLATITUDE ,</if>
<if test="LEFTTOPLATITUDE != null and LEFTTOPLATITUDE != '' ">LEFTTOPLATITUDE ,</if>
</trim>
@ -416,8 +417,11 @@
<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="RIGHTBOTTOMLONGITUDE != null and RIGHTBOTTOMLONGITUDE != '' ">
#{RIGHTBOTTOMLONGITUDE },
</if>
<if test="RIGHTBOTTOMLATITUDE != null and RIGHTBOTTOMLATITUDE != '' ">#{RIGHTBOTTOMLONGITUDE },
</if>
<if test="LEFTTOPLATITUDE != null and LEFTTOPLATITUDE != '' ">#{LEFTTOPLATITUDE },</if>
</trim>
@ -556,10 +560,18 @@
<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>
<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}
@ -579,11 +591,13 @@
limit 1
</select>
<select id="selectloaction" parameterType="com.ssf.mysqloracletest.domain.JcjJjxxViewMysql" resultMap="BaseResultMap">
<select id="selectloaction" parameterType="com.ssf.mysqloracletest.domain.JcjJjxxViewMysql"
resultMap="BaseResultMap">
select *
from jcj_jjxx_view
where JDZB BETWEEN #{LEFTTOPLONGITUDE} AND #{RIGHTBOTTOMLONGITUDE}
AND WDZB BETWEEN #{RIGHTBOTTOMLATITUDE} AND #{LEFTTOPLATITUDE}
AND STATUS IS NULL
</select>
</mapper>

Loading…
Cancel
Save