Commit 271af9fd authored by maoying's avatar maoying

优化报警脚本查询语法

parent 65534e57
......@@ -213,7 +213,7 @@
LEFT JOIN wl_equipment we ON wled.equipment_id = we.id
) d
<where>
<if test="param.warehouseStructureName != null and param.warehouseStructureName != ''">and
<if test="param.warehouseStructureName != null and param.warehouseStructureName != ''">
d.warehouseStructureName like
concat(concat("%",#{param.warehouseStructureName}),"%")
</if>
......@@ -270,7 +270,7 @@
left join wl_equipment_specific wles ON wlesa.equipment_specific_id = wles.id
) d
<where>
<if test="warehouseStructureName != null and warehouseStructureName != ''">and d.warehouseStructureName like
<if test="warehouseStructureName != null and warehouseStructureName != ''"> d.warehouseStructureName like
concat(concat("%",#{warehouseStructureName}),"%")
</if>
<if test="equipCode != null and equipCode != ''">AND d.fireEquipmentCode like
......@@ -348,8 +348,8 @@
wl_equipment_specific_alarm_log wlesal
LEFT JOIN wl_equipment we ON wlesal.equipment_code = we.code
LEFT JOIN wl_equipment_specific_alarm wlesa ON wlesa.id = wlesal.equipment_specific_alarm_id) d
WHERE
<if test="param.warehouseStructureName != null and param.warehouseStructureName != ''">and
<where>
<if test="param.warehouseStructureName != null and param.warehouseStructureName != ''">
d.warehouseStructureName like
concat(concat("%",#{param.warehouseStructureName}),"%")
</if>
......@@ -389,6 +389,8 @@
<if test="param.cleanStatus != null and param.cleanStatus != '' and param.cleanStatus == 2">AND
d.cleanStatus = '未消除'
</if>
</where>
ORDER BY d.createDate DESC
</select>
<select id="getAlarmList" resultType="java.util.HashMap">
......@@ -459,7 +461,7 @@
) d
<where>
<if test="warehouseStructureName != null and warehouseStructureName != ''">
and d.warehouseStructureName like
d.warehouseStructureName like
concat(concat("%",#{warehouseStructureName}),"%")
</if>
<if test="equipCode != null and equipCode != ''">AND d.fireEquipmentCode like
......@@ -515,9 +517,8 @@
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 1=1
AND d.fireEquipmentName IS NOT NULL
AND d.id = #{id}
WHERE
d.id = #{id}
AND d.type = #{alarmType}
ORDER BY d.createDate DESC
</select>
......@@ -554,9 +555,7 @@
LEFT JOIN wl_equipment we ON wled.equipment_id = we.id
) d
WHERE
1 = 1
AND d.fireEquipmentName IS NOT NULL
AND d.equipmentSpecificId = #{id}
d.equipmentSpecificId = #{id}
AND d.type = #{alarmType}
</select>
<select id="getEquipmentAlarmCount" resultType="int">
......@@ -577,9 +576,7 @@
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
d.fireEquipmentName <![CDATA[<>]]> ''
AND d.equipmentSpecificId = #{id}
WHERE d.equipmentSpecificId = #{id}
AND d.type = #{alarmType}
</select>
<select id="findByTypeAndDate" resultMap="resultMapDto">
......@@ -659,7 +656,6 @@
</where>
) d
<where>
d.fireEquipmentName IS NOT NULL
<choose>
<when test="dto.type != null and dto.type != ''">
AND d.type = #{dto.type}
......@@ -797,7 +793,6 @@
</where>
) d
<where>
d.fireEquipmentName IS NOT NULL
<choose>
<when test="dto.type != null and dto.type != ''">
AND d.type = #{dto.type}
......@@ -958,7 +953,6 @@
</where>
) d
<where>
d.fireEquipmentName IS NOT NULL
<choose>
<when test="dto.type != null and dto.type != ''">
AND d.type = #{dto.type}
......@@ -1011,7 +1005,7 @@
)m
<where>
<if test="dto.status != null and dto.status != ''">
AND `status`= #{dto.status}
`status`= #{dto.status}
</if>
<if test="dto.warehouseStructureName != null and dto.warehouseStructureName != ''">
AND warehouseStructureName LIKE CONCAT('%', #{dto.warehouseStructureName}, '%' )
......
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