| | |
| | | left join ja_fw_police_station ps on ps.id = ad.police_station_id and ps.is_deleted = 0 |
| | | <where> |
| | | ad.is_deleted = 0 |
| | | <if test="flyTime != null"> |
| | | and (ad.fly_date_start is null or ad.fly_date_start <= #{flyTime}) |
| | | and (ad.fly_date_end is null or ad.fly_date_end >= #{flyTime}) |
| | | </if> |
| | | <if test="isSetSceneManage != null and isSetSceneManage == 1"> |
| | | and exists ( |
| | | select 1 |
| | |
| | | and find_in_set(ad.id, replace(ds.area_divide_ids, ' ', '')) |
| | | ) |
| | | </if> |
| | | <if test="isSetSceneManage != null and isSetSceneManage == 1 and flyTime != null"> |
| | | and exists ( |
| | | select 1 |
| | | from ja_fw_defense_scene ds |
| | | join ja_fw_defense_scene_manage dsm on dsm.defense_scene_id = ds.id and dsm.is_deleted = 0 |
| | | where ds.is_deleted = 0 |
| | | and ds.area_divide_ids is not null |
| | | and ds.area_divide_ids != '' |
| | | and find_in_set(ad.id, replace(ds.area_divide_ids, ' ', '')) |
| | | and (dsm.effective_date_start is null or dsm.effective_date_start <= #{flyTime}) |
| | | and (dsm.effective_date_end is null or dsm.effective_date_end >= #{flyTime}) |
| | | ) |
| | | </if> |
| | | <if test="filterSelected != null and filterSelected == 1"> |
| | | and ( |
| | | not exists ( |