Commit ebef5eb7 authored by wujipeng's avatar wujipeng
Browse files

设备资产列表优化

parent ed9270c8
......@@ -4,17 +4,21 @@
<mapper namespace="org.example.blg.mapper.EquipmentMapper">
<select id="list" resultType="org.example.blg.pojo.vo.EquipmentVO">
select
id,
name,
code
e.id,
e.name,
e.code,
IF(COUNT(CASE WHEN ep.status = 1 THEN 1 END) > 0, TRUE, FALSE) AS hasAlarm
from
equipment
equipment e
JOIN equipment_param ep
ON e.id = ep.equipment_id
<where>
<if test="conditions != null and conditions != ''">
(name like concat('%', #{conditions}, '%') or
code like concat('%', #{conditions}, '%'))
(e.name like concat('%', #{conditions}, '%') or
e.code like concat('%', #{conditions}, '%'))
</if>
</where>
GROUP BY e.id, e.name, e.code
</select>
<select id="detail" resultType="org.example.blg.pojo.vo.EquipmentVO">
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