| | |
| | | ), 0) |
| | | from ja_fw_area_divide ad |
| | | where ad.is_deleted = 0 |
| | | and ad.id = ANY(string_to_array(ds.area_divide_ids, ',')::bigint[]) |
| | | and ad.id::VARCHAR = ANY(string_to_array(ds.area_divide_ids, ',')) |
| | | ) as device_count |
| | | from ja_fw_defense_scene_manage dsm |
| | | left join ja_fw_defense_scene ds on ds.id::VARCHAR = dsm.defense_scene_id::VARCHAR and ds.is_deleted = 0 |
| | | <where> |
| | | dsm.is_deleted = 0 |
| | | <if test="time != null"> |
| | | and (dsm.effective_date_start is null or dsm.effective_date_start <= #{time}) |
| | | and (dsm.effective_date_end is null or dsm.effective_date_end >= #{time}) |
| | | and (dsm.effective_date_start is null or dsm.effective_date_start <= #{time}::timestamp) |
| | | and (dsm.effective_date_end is null or dsm.effective_date_end >= #{time}::timestamp) |
| | | </if> |
| | | </where> |
| | | </select> |