Commit ebef5eb7 authored by wujipeng's avatar wujipeng
Browse files

设备资产列表优化

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