| | |
| | | d.is_deleted = 0 |
| | | AND d.is_enabled = 1 |
| | | AND d.final_outbound_area IS NOT NULL |
| | | <if test="regionCode != null and regionCode != ''"> |
| | | and ( d.final_outbound_area_code like concat(#{regionCode},'%') |
| | | <if test="currentDeptId != null and currentDeptId != '' "> |
| | | <if test="fwBaseInfo.regionCode != null and fwBaseInfo.regionCode != ''"> |
| | | and ( d.final_outbound_area_code like concat(#{fwBaseInfo.regionCode},'%') |
| | | <if test="fwBaseInfo.currentDeptId != null and fwBaseInfo.currentDeptId != '' "> |
| | | or d.id in ( |
| | | SELECT device_id FROM ja_fw_device_per_share |
| | | WHERE loan_to_dept_id = #{currentDeptId} |
| | | WHERE loan_to_dept_id = #{fwBaseInfo.currentDeptId} |
| | | AND is_deleted = 0 |
| | | ) |
| | | </if> |
| | |
| | | ) dd on find_in_set(dd.id, ad.device_ids) |
| | | <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}) |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |