|
|
@ -152,6 +152,41 @@ |
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
<select id="listStatusByTypes" parameterType="com.zc.business.domain.Status" resultMap="BaseResultMap"> |
|
|
|
select s.id, s.device_no, s.device_name, s.device_status,s.time, |
|
|
|
d.device_ip,s.success_rate,s.lost_rate,d.direction,e.manufacturer,e.model,d.facilities_type,d.remark,COALESCE(d.child_type, |
|
|
|
d.device_type) AS type |
|
|
|
from dc_device d |
|
|
|
LEFT JOIN status s on (s.device_id=d.id) |
|
|
|
LEFT JOIN dc_product e on e.id=d.product_id |
|
|
|
<where> |
|
|
|
<if test="status.time != null"> |
|
|
|
AND s.time BETWEEN #{status.startTime,jdbcType=DATE} AND #{status.time,jdbcType=DATE} |
|
|
|
</if> |
|
|
|
<if test="status.deviceNo != null"> |
|
|
|
AND s.device_no = #{status.deviceNo} |
|
|
|
</if> |
|
|
|
<if test="status.type != null"> |
|
|
|
AND (d.device_type in |
|
|
|
<foreach item="typeItem" collection="status.types" open="(" separator="," close=")"> |
|
|
|
#{typeItem} |
|
|
|
</foreach> |
|
|
|
or d.child_type in |
|
|
|
<foreach item="typeItem" collection="status.types" open="(" separator="," close=")"> |
|
|
|
#{typeItem} |
|
|
|
</foreach> |
|
|
|
) |
|
|
|
</if> |
|
|
|
<if test="status.deviceId != null"> |
|
|
|
AND s.device_id = #{status.deviceId} |
|
|
|
</if> |
|
|
|
<if test="status.useState != null and status.useState != 0"> |
|
|
|
AND d.use_state = #{status.useState} |
|
|
|
</if> |
|
|
|
</where> |
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
<select id="listStatusBySection" parameterType="com.zc.business.domain.Status" resultMap="BaseResultMap"> |
|
|
|
select s.id, s.device_no, s.device_name, s.device_status,s.time, |
|
|
|
d.device_ip,s.success_rate,s.lost_rate,d.direction,e.manufacturer,e.model,d.facilities_type,m.section_id,d.remark,COALESCE(d.child_type, |
|
|
|