|
@@ -167,5 +167,286 @@
|
|
|
</foreach>
|
|
|
</if>
|
|
|
</select>
|
|
|
+
|
|
|
+ <select id="getLampAlarmListByVO" resultType="AllAlarmInfoLogDTO" parameterType="AllAlarmInfoLogVO">
|
|
|
+ select
|
|
|
+ a.id,a.updatetime as updateTime,a.stralarmtype as strAlarmType,
|
|
|
+ s.name as section,a.devType,l.number,l.longitude,l.latitude,l.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 lampinfo l on a.lampid = l.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="limit >= 0 and offset > 0">
|
|
|
+ limit #{limit},#{offset}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getLampPoleAlarmListByVO" resultType="AllAlarmInfoLogDTO" parameterType="AllAlarmInfoLogVO">
|
|
|
+ select
|
|
|
+ a.id,a.updatetime as updateTime,a.stralarmtype as strAlarmType,
|
|
|
+ s.name as section,a.devType,l.number,l.longitude,l.latitude,l.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 lamp_pole l on a.lampid = l.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="limit >= 0 and offset > 0">
|
|
|
+ limit #{limit},#{offset}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getWaterImmersionAlarmListByVO" resultType="AllAlarmInfoLogDTO" parameterType="AllAlarmInfoLogVO">
|
|
|
+ select
|
|
|
+ a.id,a.updatetime as updateTime,a.stralarmtype as strAlarmType,
|
|
|
+ s.name as section,a.devType,w.number,lp.longitude,lp.latitude,w.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 lamp_pole lp on a.lampid = lp.id
|
|
|
+ left join water_immersion_dev_info w on w.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="limit >= 0 and offset > 0">
|
|
|
+ limit #{limit},#{offset}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getElectricBoxAlarmListByVO" resultType="AllAlarmInfoLogDTO" parameterType="AllAlarmInfoLogVO">
|
|
|
+ select
|
|
|
+ a.id,a.updatetime as updateTime,a.stralarmtype as strAlarmType,
|
|
|
+ s.name as section,a.devType,e.address as `number`,e.longitude,e.latitude,e.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 electric_box e on a.lampid = e.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="limit >= 0 and offset > 0">
|
|
|
+ limit #{limit},#{offset}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
|
|
|
</mapper>
|