|
@@ -170,7 +170,7 @@
|
|
|
|
|
|
<select id="getLampAlarmListByVO" resultType="AllAlarmInfoLogDTO" parameterType="AllAlarmInfoLogVO">
|
|
|
select
|
|
|
- a.id,a.updatetime as updateTime,a.stralarmtype as strAlarmType,
|
|
|
+ a.id,a.updatetime as updateTime,a.stralarmtype as strAlarmType,a.status,
|
|
|
s.name as section,a.devType,l.number,l.longitude,l.latitude,l.name
|
|
|
<choose>
|
|
|
<when test="version == 0">
|
|
@@ -233,6 +233,9 @@
|
|
|
<if test="alarmType != null and alarmType != ''">
|
|
|
and a.stralarmtype like '%${alarmType}%'
|
|
|
</if>
|
|
|
+ <if test="keyword != null and keyword != ''">
|
|
|
+ and l.number like '%${keyword}%'
|
|
|
+ </if>
|
|
|
<if test="limit >= 0 and offset > 0">
|
|
|
limit #{limit},#{offset}
|
|
|
</if>
|
|
@@ -240,7 +243,7 @@
|
|
|
|
|
|
<select id="getLampPoleAlarmListByVO" resultType="AllAlarmInfoLogDTO" parameterType="AllAlarmInfoLogVO">
|
|
|
select
|
|
|
- a.id,a.updatetime as updateTime,a.stralarmtype as strAlarmType,
|
|
|
+ a.id,a.updatetime as updateTime,a.stralarmtype as strAlarmType,a.status,
|
|
|
s.name as section,a.devType,l.number,l.longitude,l.latitude,l.name
|
|
|
<choose>
|
|
|
<when test="version == 0">
|
|
@@ -303,6 +306,9 @@
|
|
|
<if test="alarmType != null and alarmType != ''">
|
|
|
and a.stralarmtype like '%${alarmType}%'
|
|
|
</if>
|
|
|
+ <if test="keyword != null and keyword != ''">
|
|
|
+ and l.number like '%${keyword}%'
|
|
|
+ </if>
|
|
|
<if test="limit >= 0 and offset > 0">
|
|
|
limit #{limit},#{offset}
|
|
|
</if>
|
|
@@ -310,7 +316,7 @@
|
|
|
|
|
|
<select id="getWaterImmersionAlarmListByVO" resultType="AllAlarmInfoLogDTO" parameterType="AllAlarmInfoLogVO">
|
|
|
select
|
|
|
- a.id,a.updatetime as updateTime,a.stralarmtype as strAlarmType,
|
|
|
+ a.id,a.updatetime as updateTime,a.stralarmtype as strAlarmType,a.status,
|
|
|
s.name as section,a.devType,w.number,lp.longitude,lp.latitude,w.name
|
|
|
<choose>
|
|
|
<when test="version == 0">
|
|
@@ -374,6 +380,9 @@
|
|
|
<if test="alarmType != null and alarmType != ''">
|
|
|
and a.stralarmtype like '%${alarmType}%'
|
|
|
</if>
|
|
|
+ <if test="keyword != null and keyword != ''">
|
|
|
+ and w.number like '%${keyword}%'
|
|
|
+ </if>
|
|
|
<if test="limit >= 0 and offset > 0">
|
|
|
limit #{limit},#{offset}
|
|
|
</if>
|
|
@@ -381,7 +390,7 @@
|
|
|
|
|
|
<select id="getElectricBoxAlarmListByVO" resultType="AllAlarmInfoLogDTO" parameterType="AllAlarmInfoLogVO">
|
|
|
select
|
|
|
- a.id,a.updatetime as updateTime,a.stralarmtype as strAlarmType,
|
|
|
+ a.id,a.updatetime as updateTime,a.stralarmtype as strAlarmType,a.status,
|
|
|
s.name as section,a.devType,e.address as `number`,e.longitude,e.latitude,e.name
|
|
|
<choose>
|
|
|
<when test="version == 0">
|
|
@@ -444,6 +453,82 @@
|
|
|
<if test="alarmType != null and alarmType != ''">
|
|
|
and a.stralarmtype like '%${alarmType}%'
|
|
|
</if>
|
|
|
+ <if test="keyword != null and keyword != ''">
|
|
|
+ and e.address like '%${keyword}%'
|
|
|
+ </if>
|
|
|
+ <if test="limit >= 0 and offset > 0">
|
|
|
+ limit #{limit},#{offset}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getManholeAlarmListByVO" resultType="AllAlarmInfoLogDTO" parameterType="AllAlarmInfoLogVO">
|
|
|
+ select
|
|
|
+ a.id,a.updatetime as updateTime,a.stralarmtype as strAlarmType,a.status,
|
|
|
+ s.name as section,a.devType,m.address as `number`,m.longitude,m.latitude,m.name
|
|
|
+ <choose>
|
|
|
+ <when test="version == 0">
|
|
|
+ ,gl.chinese_name as area
|
|
|
+ </when>
|
|
|
+ <when test="version == 1">
|
|
|
+ ,gl.english_name as area
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ ,gl.ru_name as area
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+ <choose>
|
|
|
+ <when test="version == 0">
|
|
|
+ ,gl1.chinese_name as city
|
|
|
+ </when>
|
|
|
+ <when test="version == 1">
|
|
|
+ ,gl1.english_name as city
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ ,gl1.ru_name as city
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+ <choose>
|
|
|
+ <when test="version == 0">
|
|
|
+ ,gl2.chinese_name as province
|
|
|
+ </when>
|
|
|
+ <when test="version == 1">
|
|
|
+ ,gl2.english_name as province
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ ,gl2.ru_name as province
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+ from all_alarm_info_log a
|
|
|
+ left join section s on a.sectionId = s.id
|
|
|
+ left join global_location gl on s.pid = gl.id
|
|
|
+ left join global_location gl1 on gl.pid = gl1.id
|
|
|
+ left join global_location gl2 on gl1.pid = gl2.id
|
|
|
+ left join manhole m on a.lampid = m.id
|
|
|
+ where a.devType = 2
|
|
|
+ <if test="sectionList != null and !sectionList.isEmpty()">
|
|
|
+ and a.sectionId in
|
|
|
+ <foreach collection="sectionList" item="item" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="sectionId != null and sectionId != 0">
|
|
|
+ and s.id = #{sectionId}
|
|
|
+ </if>
|
|
|
+ <if test="areaId != null and areaId != 0">
|
|
|
+ and gl.id = #{areaId}
|
|
|
+ </if>
|
|
|
+ <if test="cityId != null and cityId != 0">
|
|
|
+ and gl1.id = #{cityId}
|
|
|
+ </if>
|
|
|
+ <if test="provinceId != null and provinceId != 0">
|
|
|
+ and gl2.id = #{provinceId}
|
|
|
+ </if>
|
|
|
+ <if test="alarmType != null and alarmType != ''">
|
|
|
+ and a.stralarmtype like '%${alarmType}%'
|
|
|
+ </if>
|
|
|
+ <if test="keyword != null and keyword != ''">
|
|
|
+ and m.address like '%${keyword}%'
|
|
|
+ </if>
|
|
|
<if test="limit >= 0 and offset > 0">
|
|
|
limit #{limit},#{offset}
|
|
|
</if>
|
|
@@ -540,4 +625,221 @@
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
|
+ <select id="getManholeAlarmTotal" resultType="Integer">
|
|
|
+ select count(*)
|
|
|
+ from all_alarm_info_log a
|
|
|
+ left join section s on a.sectionId = s.id
|
|
|
+ left join global_location gl on s.pid = gl.id
|
|
|
+ left join global_location gl1 on gl.pid = gl1.id
|
|
|
+ left join global_location gl2 on gl1.pid = gl2.id
|
|
|
+ left join manhole m on a.lampid = m.id
|
|
|
+ where a.devType = 2
|
|
|
+ <if test="sectionList != null and !sectionList.isEmpty()">
|
|
|
+ and a.sectionId in
|
|
|
+ <foreach collection="sectionList" item="item" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="sectionId != null and sectionId != 0">
|
|
|
+ and s.id = #{sectionId}
|
|
|
+ </if>
|
|
|
+ <if test="areaId != null and areaId != 0">
|
|
|
+ and gl.id = #{areaId}
|
|
|
+ </if>
|
|
|
+ <if test="cityId != null and cityId != 0">
|
|
|
+ and gl1.id = #{cityId}
|
|
|
+ </if>
|
|
|
+ <if test="provinceId != null and provinceId != 0">
|
|
|
+ and gl2.id = #{provinceId}
|
|
|
+ </if>
|
|
|
+ <if test="alarmType != null and alarmType != ''">
|
|
|
+ and a.stralarmtype like '%${alarmType}%'
|
|
|
+ </if>
|
|
|
+ <if test="keyword != null and keyword != ''">
|
|
|
+ and m.address like '%${keyword}%'
|
|
|
+ </if>
|
|
|
+ <if test="limit >= 0 and offset > 0">
|
|
|
+ limit #{limit},#{offset}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getLampAlarmTotal" resultType="Integer">
|
|
|
+ select count(*)
|
|
|
+ from all_alarm_info_log a
|
|
|
+ left join section s on a.sectionId = s.id
|
|
|
+ left join global_location gl on s.pid = gl.id
|
|
|
+ left join global_location gl1 on gl.pid = gl1.id
|
|
|
+ left join global_location gl2 on gl1.pid = gl2.id
|
|
|
+ left join lampinfo m on a.lampid = m.id
|
|
|
+ where a.devType = 0
|
|
|
+ <if test="sectionList != null and !sectionList.isEmpty()">
|
|
|
+ and a.sectionId in
|
|
|
+ <foreach collection="sectionList" item="item" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="sectionId != null and sectionId != 0">
|
|
|
+ and s.id = #{sectionId}
|
|
|
+ </if>
|
|
|
+ <if test="areaId != null and areaId != 0">
|
|
|
+ and gl.id = #{areaId}
|
|
|
+ </if>
|
|
|
+ <if test="cityId != null and cityId != 0">
|
|
|
+ and gl1.id = #{cityId}
|
|
|
+ </if>
|
|
|
+ <if test="provinceId != null and provinceId != 0">
|
|
|
+ and gl2.id = #{provinceId}
|
|
|
+ </if>
|
|
|
+ <if test="alarmType != null and alarmType != ''">
|
|
|
+ and a.stralarmtype like '%${alarmType}%'
|
|
|
+ </if>
|
|
|
+ <if test="keyword != null and keyword != ''">
|
|
|
+ and m.number like '%${keyword}%'
|
|
|
+ </if>
|
|
|
+ <if test="limit >= 0 and offset > 0">
|
|
|
+ limit #{limit},#{offset}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getLampPoleAlarmTotal" resultType="Integer">
|
|
|
+ select count(*)
|
|
|
+ from all_alarm_info_log a
|
|
|
+ left join section s on a.sectionId = s.id
|
|
|
+ left join global_location gl on s.pid = gl.id
|
|
|
+ left join global_location gl1 on gl.pid = gl1.id
|
|
|
+ left join global_location gl2 on gl1.pid = gl2.id
|
|
|
+ left join lamp_pole m on a.lampid = m.id
|
|
|
+ where a.devType = 1
|
|
|
+ <if test="sectionList != null and !sectionList.isEmpty()">
|
|
|
+ and a.sectionId in
|
|
|
+ <foreach collection="sectionList" item="item" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="sectionId != null and sectionId != 0">
|
|
|
+ and s.id = #{sectionId}
|
|
|
+ </if>
|
|
|
+ <if test="areaId != null and areaId != 0">
|
|
|
+ and gl.id = #{areaId}
|
|
|
+ </if>
|
|
|
+ <if test="cityId != null and cityId != 0">
|
|
|
+ and gl1.id = #{cityId}
|
|
|
+ </if>
|
|
|
+ <if test="provinceId != null and provinceId != 0">
|
|
|
+ and gl2.id = #{provinceId}
|
|
|
+ </if>
|
|
|
+ <if test="alarmType != null and alarmType != ''">
|
|
|
+ and a.stralarmtype like '%${alarmType}%'
|
|
|
+ </if>
|
|
|
+ <if test="keyword != null and keyword != ''">
|
|
|
+ and m.number like '%${keyword}%'
|
|
|
+ </if>
|
|
|
+ <if test="limit >= 0 and offset > 0">
|
|
|
+ limit #{limit},#{offset}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getEleBoxAlarmTotal" resultType="Integer">
|
|
|
+ select count(*)
|
|
|
+ from all_alarm_info_log a
|
|
|
+ left join section s on a.sectionId = s.id
|
|
|
+ left join global_location gl on s.pid = gl.id
|
|
|
+ left join global_location gl1 on gl.pid = gl1.id
|
|
|
+ left join global_location gl2 on gl1.pid = gl2.id
|
|
|
+ left join electric_box m on a.lampid = m.id
|
|
|
+ where a.devType = 4
|
|
|
+ <if test="sectionList != null and !sectionList.isEmpty()">
|
|
|
+ and a.sectionId in
|
|
|
+ <foreach collection="sectionList" item="item" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="sectionId != null and sectionId != 0">
|
|
|
+ and s.id = #{sectionId}
|
|
|
+ </if>
|
|
|
+ <if test="areaId != null and areaId != 0">
|
|
|
+ and gl.id = #{areaId}
|
|
|
+ </if>
|
|
|
+ <if test="cityId != null and cityId != 0">
|
|
|
+ and gl1.id = #{cityId}
|
|
|
+ </if>
|
|
|
+ <if test="provinceId != null and provinceId != 0">
|
|
|
+ and gl2.id = #{provinceId}
|
|
|
+ </if>
|
|
|
+ <if test="alarmType != null and alarmType != ''">
|
|
|
+ and a.stralarmtype like '%${alarmType}%'
|
|
|
+ </if>
|
|
|
+ <if test="keyword != null and keyword != ''">
|
|
|
+ and m.address like '%${keyword}%'
|
|
|
+ </if>
|
|
|
+ <if test="limit >= 0 and offset > 0">
|
|
|
+ limit #{limit},#{offset}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getWaterAlarmTotal" resultType="Integer">
|
|
|
+ select count(*)
|
|
|
+ from all_alarm_info_log a
|
|
|
+ left join section s on a.sectionId = s.id
|
|
|
+ left join global_location gl on s.pid = gl.id
|
|
|
+ left join global_location gl1 on gl.pid = gl1.id
|
|
|
+ left join global_location gl2 on gl1.pid = gl2.id
|
|
|
+ left join lamp_pole lp on a.lampid = lp.id
|
|
|
+ left join water_immersion_dev_info m on m.lamp_pole_id = lp.id
|
|
|
+ where a.devType = 3
|
|
|
+ <if test="sectionList != null and !sectionList.isEmpty()">
|
|
|
+ and a.sectionId in
|
|
|
+ <foreach collection="sectionList" item="item" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="sectionId != null and sectionId != 0">
|
|
|
+ and s.id = #{sectionId}
|
|
|
+ </if>
|
|
|
+ <if test="areaId != null and areaId != 0">
|
|
|
+ and gl.id = #{areaId}
|
|
|
+ </if>
|
|
|
+ <if test="cityId != null and cityId != 0">
|
|
|
+ and gl1.id = #{cityId}
|
|
|
+ </if>
|
|
|
+ <if test="provinceId != null and provinceId != 0">
|
|
|
+ and gl2.id = #{provinceId}
|
|
|
+ </if>
|
|
|
+ <if test="alarmType != null and alarmType != ''">
|
|
|
+ and a.stralarmtype like '%${alarmType}%'
|
|
|
+ </if>
|
|
|
+ <if test="keyword != null and keyword != ''">
|
|
|
+ and m.number like '%${keyword}%'
|
|
|
+ </if>
|
|
|
+ <if test="limit >= 0 and offset > 0">
|
|
|
+ limit #{limit},#{offset}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getAlarmInfoDTOById" resultType="AllAlarmInfoLogDTO">
|
|
|
+ select
|
|
|
+ a.id,a.devType,a.lampid,s.name as section,a.alarmtype as alarmType,a.status
|
|
|
+ <choose>
|
|
|
+ <when test="version == 0">
|
|
|
+ ,gl.chinese_name as area
|
|
|
+ </when>
|
|
|
+ <when test="version == 1">
|
|
|
+ ,gl.english_name as area
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ ,gl.ru_name as area
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+ from all_alarm_info_log a
|
|
|
+ left join section s on s.id = a.sectionId
|
|
|
+ left join global_location gl on s.pid = gl.id
|
|
|
+ where a.id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <delete id="deleteAlarmData">
|
|
|
+ delete
|
|
|
+ from all_alarm_info_log
|
|
|
+ where id = #{id};
|
|
|
+ </delete>
|
|
|
+
|
|
|
</mapper>
|