| | |
| | | deviceNumber |
| | | ) alarm ON alarm.deviceN = equipment.deviceNumber |
| | | where 1=1 |
| | | |
| | | <if test="equipment.deviceName!=null"> |
| | | and (deviceName like concat('%',#{equipment.deviceName},'%') or deviceNumber like |
| | | concat('%',#{equipment.deviceName},'%')) |
| | | </if> |
| | | |
| | | <if test="equipment.beginTime!=null and equipment.beginTime!=''"> |
| | | and expireTime>=#{equipment.beginTime} |
| | | </if> |
| | | <if test="equipment.endTime!=null and equipment.endTime!=''"> |
| | | and expireTime<=#{equipment.endTime} |
| | | </if> |
| | | |
| | | <if test="equipment.district!=null"> |
| | | and district like concat('%',#{equipment.district},'%') |
| | | </if> |
| | |
| | | <if test="equipment.manufacturers!=null and equipment.manufacturers!=''"> |
| | | and manufacturers = #{equipment.manufacturers} |
| | | </if> |
| | | |
| | | <if test="equipment.devicestate!=null"> |
| | | and devicestate =#{equipment.devicestate} |
| | | </if> |
| | | |
| | | <if test="equipment.dtype!=null"> |
| | | and dtype=#{equipment.dtype} |
| | | </if> |
| | | |
| | | <if test="dxtype!=null and dxtype == 0"> |
| | | and heartbeat < DATE_SUB(NOW(),INTERVAL 1 DAY) |
| | | and heartbeat < DATE_SUB(NOW(),INTERVAL 1 DAY) and dtype=0 |
| | | </if> |
| | | <if test="dxtype!=null and dxtype == 1"> |
| | | and heartbeat >= DATE_SUB(NOW(),INTERVAL 1 DAY) |
| | | and heartbeat >= DATE_SUB(NOW(),INTERVAL 1 DAY) and dtype=1 |
| | | </if> |
| | | <if test="dxtype!=null and dxtype == 2"> |
| | | and alarm.jtype IS NOT NULL |
| | | and heartbeat >= DATE_SUB(NOW(),INTERVAL 1 DAY) and dtype=2 |
| | | </if> |
| | | <if test="dxtype!=null and dxtype == 3"> |
| | | and heartbeat >= DATE_SUB(NOW(),INTERVAL 1 DAY) and state!=null |
| | | and heartbeat >= DATE_SUB(NOW(),INTERVAL 1 DAY) and dtype=3 |
| | | </if> |
| | | <if test="pid!=null and pid!=''"> |
| | | and deptId like concat('%',#{pid},'%') |
| | | </if> |
| | | |
| | | order by ( |
| | | case |
| | | when dtype=2 then 1 |
| | | when dtype=3 then 2 |
| | | when dtype=0 then 3 |
| | | when dtype=1 then 4 |
| | | END) |
| | | </select> |
| | | |
| | | <!--新增--> |