Commit e68f67b8 authored by maoying's avatar maoying

优化告警列表查询

parent 9bca8915
......@@ -163,10 +163,7 @@
iot_code = #{iotCode}
</select>
<select id="page" resultType="java.util.HashMap">
SELECT
d.*
FROM
(
SELECT
wlesal.id,
wlesal.org_code,
......@@ -205,33 +202,32 @@
left join wl_warehouse_structure as ware on wsd.warehouse_structure_id = ware.id
LEFT JOIN wl_equipment_detail wled ON wles.equipment_detail_id = wled.id
LEFT JOIN wl_equipment we ON wled.equipment_id = we.id
) d
<where>
<if test="param.warehouseStructureName != null and param.warehouseStructureName != ''">and d.warehouseStructureName like
<where>
<if test="param.warehouseStructureName != null and param.warehouseStructureName != ''">and CONCAT_WS(' ',ware.full_name,wsd.description) like
concat(concat("%",#{param.warehouseStructureName}),"%")
</if>
<if test="param.equipCode != null and param.equipCode != ''">AND d.fireEquipmentCode like
<if test="param.equipCode != null and param.equipCode != ''">AND wles.code like
concat(concat("%",#{param.equipCode}),"%")
</if>
<if test="param.beginDate!=null">AND d.createDate <![CDATA[>=]]> #{param.beginDate}</if>
<if test="param.endDate!=null">AND d.createDate <![CDATA[<=]]> #{param.endDate}</if>
<if test="param.alarmType == 'BREAKDOWN'">AND d.type = #{param.alarmType}</if>
<if test="param.alarmType == 'FIREALARM'">AND d.type = #{param.alarmType}</if>
<if test="param.orgCode != null and param.orgCode != ''">AND d.org_code = #{param.orgCode}</if>
<if test="param.type != null and param.type != ''">AND d.type = #{param.type}</if>
<if test="param.handleStatus != null and param.handleStatus != '' and param.handleStatus == 1">AND d.handleStatus = '已处理' </if>
<if test="param.handleStatus != null and param.handleStatus != '' and param.handleStatus == 2">AND d.handleStatus = '未处理' </if>
<if test="param.beginDate!=null">AND wlesal.create_date <![CDATA[>=]]> #{param.beginDate}</if>
<if test="param.endDate!=null">AND wlesal.create_date <![CDATA[<=]]> #{param.endDate}</if>
<if test="param.alarmType == 'BREAKDOWN'">AND wlesal.type = #{param.alarmType}</if>
<if test="param.alarmType == 'FIREALARM'">AND wlesal.type = #{param.alarmType}</if>
<if test="param.orgCode != null and param.orgCode != ''">AND wlesal.org_code = #{param.orgCode}</if>
<if test="param.type != null and param.type != ''">AND wlesal.type = #{param.type}</if>
<if test="param.handleStatus != null and param.handleStatus != '' and param.handleStatus == 1">AND wlesal.confirm_type IS NOT NULL </if>
<if test="param.handleStatus != null and param.handleStatus != '' and param.handleStatus == 2">AND wlesal.confirm_type IS NULL </if>
<if test="param.system != null and param.system != ''">
AND find_in_set(#{param.system},d.systemId)
AND find_in_set(#{param.system},wles.system_id)
</if>
<if test="param.buildIds!=null">
AND d.buildId IN
AND wlesal.build_id IN
<foreach item="item" collection="param.buildIds" separator=","
open="(" close=")" index=""> #{item}
</foreach>
</if>
</where>
ORDER BY d.createDate DESC
ORDER BY wlesal.create_date DESC
</select>
<select id="count" resultType="java.lang.Integer">
SELECT
......
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