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.product_name,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>
<iftest="status.time != null">
AND s.time BETWEEN #{status.startTime,jdbcType=DATE} AND #{status.time,jdbcType=DATE}
@ -89,7 +97,7 @@
AND s.device_no = #{status.deviceNo}
</if>
<iftest="status.type != null">
AND d.type = #{status.type}
AND (d.device_type = #{status.type} or d.child_type=#{status.type})