Commit bdefb497 authored by tangwei's avatar tangwei

修改bug

parent 99e8e9e9
...@@ -43,207 +43,207 @@ ...@@ -43,207 +43,207 @@
ELSE '' END responseLevelCode ELSE '' END responseLevelCode
FROM jc_alert_called a FROM jc_alert_called a
where a.is_delete=0 where a.is_delete=0
AND a.coordinate_x IS NOT NULL <!--AND a.coordinate_x IS NOT NULL
AND a.coordinate_y IS NOT NULL AND a.coordinate_y IS NOT NULL-->
<if test='par.status==0'> <if test='par.status==0'>
and a.alert_status =0 and a.alert_status =0
</if>
<if test='par.status==1'>
and a.alert_status =1
</if>
<if test='par.address!=null and par.address!="" '>
and a.address like CONCAT('%',#{par.address},'%') || a.alert_type like CONCAT('%',#{par.address},'%')
</if>
<if test='par.alertTypeCode!=null and par.alertTypeCode!="" '>
and a.alert_type_code = #{par.alertTypeCode}
</if>
<if test='par.alertId!=null'>
and a.sequence_nbr =#{par.alertId}
</if>
<if test='par.whether24!=false'>
and a.call_time &gt;= (NOW() - interval 24 hour)
</if>
<if test='par.orderTime=="1"'>
ORDER BY a.call_time DESC
</if>
<if test='par.orderTime=="2"'>
ORDER BY a.call_time
</if>
<if test='par.orderTime==null'>
ORDER BY a.call_time DESC
</if>
<if test='pageNum!=null and pageSize !=null'>
limit #{pageNum},#{pageSize}
</if>
</select>
<select id="alertCalledListByAlertStatusCount" resultType="Integer">
SELECT
COUNT(*)
FROM jc_alert_called a
where a.is_delete=0
AND a.coordinate_x IS NOT NULL
AND a.coordinate_y IS NOT NULL
<if test='par.status==0'>
and a.alert_status =0
</if>
<if test='par.status==1'>
and a.alert_status =1
</if>
<if test='par.address!=null and par.address!="" '>
and a.address like CONCAT('%',#{par.address},'%')
</if>
<if test='par.alertTypeCode!=null and par.alertTypeCode!="" '>
and a.alert_type_code = #{par.alertTypeCode}
</if>
<if test='par.whether24!=false'>
and a.call_time &gt;= (NOW() - interval 24 hour)
</if>
</select>
<select id="selectAllPage" resultType="com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled">
SELECT
a.sequence_nbr,
a.alert_status,
a.type,
a.alert_stage,
a.alarm_type,
a.alarm_type_code,
a.call_record_id,
a.father_alert,
a.response_level_code,
a.contact_user,
a.contact_phone,
a.call_time,
a.call_time_num,
a.alert_source,
a.alert_source_code,
a.alert_type,
a.alert_type_code,
a.unit_involved,
a.trapped_num,
a.casualties_num,
a.address,
a.rescue_grid,
a.coordinate_x,
a.coordinate_y,
a.response_level,
a.system_source,
a.system_source_code
FROM
jc_alert_called a
<if test="isFatherAlert!= null and isFatherAlert == 'true' ">
, jc_power_transfer j
</if>
<where>
a.is_delete = 0
<if test="alertStatus!= null ">
and a.alert_status = #{alertStatus}
</if> </if>
<if test='par.status==1'> <if test="startTime!= null and endTime != null and startTime!= '' and endTime != ''">
and a.alert_status =1 and a.call_time between #{startTime} and #{endTime}
</if> </if>
<if test='par.address!=null and par.address!="" '> <if test="alertTypeCode!= null and alertTypeCode!= '' ">
and a.address like CONCAT('%',#{par.address},'%') || a.alert_type like CONCAT('%',#{par.address},'%') and a.alarm_type_code = #{alertTypeCode}
</if> </if>
<if test="alertSourceCode!= null ">
<if test='par.alertTypeCode!=null and par.alertTypeCode!="" '> and a.alert_source_code = #{alertSourceCode}
and a.alert_type_code = #{par.alertTypeCode}
</if> </if>
<if test="systemSourceCode!= null ">
<if test='par.alertId!=null'> and a.system_source_code in (${systemSourceCode})
and a.sequence_nbr =#{par.alertId}
</if> </if>
<if test='par.whether24!=false'> <if test="isFatherAlert != null and isFatherAlert == 'true' ">
and a.call_time &gt;= (NOW() - interval 24 hour) and j.alert_called_id = a.sequence_nbr
GROUP BY a.sequence_nbr
</if> </if>
<if test='par.orderTime=="1"'> <if test="data == 'address' and data != null and lift != null ">
ORDER BY a.call_time DESC order by CONVERT(address USING 'gbk') ${lift} limit #{current},#{size}
</if> </if>
<if test='par.orderTime=="2"'> <if test="data != null and data != 'address' and lift != null ">
ORDER BY a.call_time order by ${data} ${lift} limit #{current},#{size}
</if> </if>
<if test='par.orderTime==null'> <if test="data == null ">
ORDER BY a.call_time DESC order by a.call_time DESC limit #{current},#{size}
</if> </if>
</where>
</select>
<if test='pageNum!=null and pageSize !=null'>
limit #{pageNum},#{pageSize} <select id="selectAllCount" resultType="int">
</if> SELECT
</select> count(b.num)
FROM
(SELECT
<select id="alertCalledListByAlertStatusCount" resultType="Integer"> a.sequence_nbr as num
SELECT FROM
COUNT(*) jc_alert_called a
FROM jc_alert_called a <if test="isFatherAlert!= null and isFatherAlert == 'true' ">
where a.is_delete=0 ,jc_power_transfer j
AND a.coordinate_x IS NOT NULL </if>
AND a.coordinate_y IS NOT NULL <where>a.is_delete = 0
<if test='par.status==0'> <if test="alertStatus!= null ">
and a.alert_status =0 and a.alert_status = #{alertStatus}
</if>
<if test='par.status==1'>
and a.alert_status =1
</if> </if>
<if test='par.address!=null and par.address!="" '> <if test="startTime!= null and endTime != null and startTime!= '' and endTime != ''">
and a.address like CONCAT('%',#{par.address},'%') and a.call_time between #{startTime} and #{endTime}
</if> </if>
<if test='par.alertTypeCode!=null and par.alertTypeCode!="" '> <if test="alertTypeCode!= null and alertTypeCode!= '' ">
and a.alert_type_code = #{par.alertTypeCode} and a.alert_type_code = #{alertTypeCode}
</if> </if>
<if test='par.whether24!=false'> <if test="alertSourceCode!= null ">
and a.call_time &gt;= (NOW() - interval 24 hour) and a.alert_source_code = #{alertSourceCode}
</if> </if>
<if test="systemSourceCode!= null ">
</select> and a.system_source_code in (${systemSourceCode})
<select id="selectAllPage" resultType="com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled">
SELECT
a.sequence_nbr,
a.alert_status,
a.type,
a.alert_stage,
a.alarm_type,
a.alarm_type_code,
a.call_record_id,
a.father_alert,
a.response_level_code,
a.contact_user,
a.contact_phone,
a.call_time,
a.call_time_num,
a.alert_source,
a.alert_source_code,
a.alert_type,
a.alert_type_code,
a.unit_involved,
a.trapped_num,
a.casualties_num,
a.address,
a.rescue_grid,
a.coordinate_x,
a.coordinate_y,
a.response_level,
a.system_source,
a.system_source_code
FROM
jc_alert_called a
<if test="isFatherAlert!= null and isFatherAlert == 'true' ">
, jc_power_transfer j
</if> </if>
<where>
a.is_delete = 0
<if test="alertStatus!= null ">
and a.alert_status = #{alertStatus}
</if>
<if test="startTime!= null and endTime != null and startTime!= '' and endTime != ''">
and a.call_time between #{startTime} and #{endTime}
</if>
<if test="alertTypeCode!= null and alertTypeCode!= '' ">
and a.alarm_type_code = #{alertTypeCode}
</if>
<if test="alertSourceCode!= null ">
and a.alert_source_code = #{alertSourceCode}
</if>
<if test="systemSourceCode!= null ">
and a.system_source_code in (${systemSourceCode})
</if>
<if test="isFatherAlert != null and isFatherAlert == 'true' ">
and j.alert_called_id = a.sequence_nbr
GROUP BY a.sequence_nbr
</if>
<if test="data == 'address' and data != null and lift != null ">
order by CONVERT(address USING 'gbk') ${lift} limit #{current},#{size}
</if>
<if test="data != null and data != 'address' and lift != null ">
order by ${data} ${lift} limit #{current},#{size}
</if>
<if test="data == null ">
order by a.call_time DESC limit #{current},#{size}
</if>
</where>
</select>
<select id="selectAllCount" resultType="int">
SELECT
count(b.num)
FROM
(SELECT
a.sequence_nbr as num
FROM
jc_alert_called a
<if test="isFatherAlert!= null and isFatherAlert == 'true' "> <if test="isFatherAlert!= null and isFatherAlert == 'true' ">
,jc_power_transfer j and j.alert_called_id = a.sequence_nbr
GROUP BY a.sequence_nbr
</if> </if>
<where>a.is_delete = 0 </where>) b
<if test="alertStatus!= null "> </select>
and a.alert_status = #{alertStatus}
</if>
<if test="startTime!= null and endTime != null and startTime!= '' and endTime != ''">
and a.call_time between #{startTime} and #{endTime}
</if>
<if test="alertTypeCode!= null and alertTypeCode!= '' ">
and a.alert_type_code = #{alertTypeCode}
</if>
<if test="alertSourceCode!= null ">
and a.alert_source_code = #{alertSourceCode}
</if>
<if test="systemSourceCode!= null ">
and a.system_source_code in (${systemSourceCode})
</if>
<if test="isFatherAlert!= null and isFatherAlert == 'true' ">
and j.alert_called_id = a.sequence_nbr
GROUP BY a.sequence_nbr
</if>
</where>) b
</select>
<select id="AlertCalledcountTime" resultType="Integer"> <select id="AlertCalledcountTime" resultType="Integer">
select COUNT(*) from jc_alert_called where is_delete=0 select COUNT(*) from jc_alert_called where is_delete=0
<if test='type==1'> <if test='type==1'>
and YEAR(call_time)=YEAR(NOW()) and YEAR(call_time)=YEAR(NOW())
</if> </if>
<if test='type==2'> <if test='type==2'>
and DATE_FORMAT( call_time, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' ) and DATE_FORMAT( call_time, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )
</if> </if>
<if test='type==3'> <if test='type==3'>
and to_days(call_time) = to_days(now()); and to_days(call_time) = to_days(now());
</if> </if>
<if test='type==4'> <if test='type==4'>
and TO_DAYS( NOW( ) ) - TO_DAYS( call_time) = 1 and TO_DAYS( NOW( ) ) - TO_DAYS( call_time) = 1
</if> </if>
</select> </select>
<select id="getTodayAlertCalled" resultType="com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledTodyDto"> <select id="getTodayAlertCalled" resultType="com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledTodyDto">
select jc_alert_called.alert_type alarmType, select jc_alert_called.alert_type alarmType,
jc_alert_called.address, jc_alert_called.address,
jc_alert_called.call_time callTime jc_alert_called.call_time callTime
from jc_alert_called from jc_alert_called
where is_delete = 0 where is_delete = 0
and to_days(call_time) = to_days(now()) and to_days(call_time) = to_days(now())
ORDER BY call_time DESC ORDER BY call_time DESC
</select> </select>
<!--统计未结束的警情数量--> <!--统计未结束的警情数量-->
<select id="AlertCalledcount" resultType="Integer"> <select id="AlertCalledcount" resultType="Integer">
......
...@@ -629,7 +629,7 @@ public class CommandController extends BaseController { ...@@ -629,7 +629,7 @@ public class CommandController extends BaseController {
String time = DateUtil.formatDate(alertCalledZhDto.getCallTime(), "yyyy-MM-dd HH:mm:ss"); String time = DateUtil.formatDate(alertCalledZhDto.getCallTime(), "yyyy-MM-dd HH:mm:ss");
st.append("【").append(alertCalledZhDto.getAlertType()).append("】").append(" ").append(time).append(" ").append(alertCalledZhDto.getAddress()); st.append("【").append(alertCalledZhDto.getAlertType()).append("】").append(" ").append(time).append(" ").append(alertCalledZhDto.getAddress()!=null?alertCalledZhDto.getAddress():"");
SeismometeorologyDto sto = new SeismometeorologyDto(alertCalledZhDto.getSequenceNbr(), "1", "警情通知", null, alertCalledZhDto.getCallTime(), null, st.toString()); SeismometeorologyDto sto = new SeismometeorologyDto(alertCalledZhDto.getSequenceNbr(), "1", "警情通知", null, alertCalledZhDto.getCallTime(), null, st.toString());
li.add(sto); li.add(sto);
......
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