| | |
| | | d.status deviceStatus |
| | | from |
| | | ja_fw_drone_alarm_record dar |
| | | left join ja_fw_device d on dar.device_id = d.id::VARCHAR |
| | | left join ja_fw_device d on dar.device_id::VARCHAR = d.id::VARCHAR |
| | | <where> |
| | | dar.is_deleted = 0 |
| | | <if test="ids != null and ids.size() > 0"> |
| | |
| | | </foreach> |
| | | </if> |
| | | <if test="regionCode != null and regionCode != ''"> |
| | | and (d.final_outbound_area_code like CONCAT(#{regionCode}, '%') |
| | | and (d.final_outbound_area_code::VARCHAR like CONCAT(#{regionCode}::VARCHAR, '%') |
| | | <!-- 或者设备是共享给当前部门的 --> |
| | | <if test="currentDeptId != null and currentDeptId != '' "> |
| | | or dar.device_id in ( |
| | | SELECT device_id FROM ja_fw_device_per_share |
| | | WHERE loan_to_dept_id = #{currentDeptId} |
| | | WHERE loan_to_dept_id::VARCHAR = #{currentDeptId}::VARCHAR |
| | | AND is_deleted = 0 |
| | | ) |
| | | </if> |