and ((b.supervise_org_code != '50' and b.supervise_org_code LIKE CONCAT (#{orgCode}, '%')) or (b.supervise_org_code = '50' and b.office_region LIKE CONCAT ('%', #{dpFilterParamDto.cityCode}, '%')))
and a.status != '6610' and a.status != '6615'
and date_ge(CAST(a.application_date as date),#{dpFilterParamDto.beginDate})
and date_le(CAST(a.application_date as date),#{dpFilterParamDto.endDate})
and ((b.supervise_org_code != '50' and b.supervise_org_code LIKE CONCAT (#{orgCode}, '%')) or (b.supervise_org_code = '50' and b.office_region LIKE CONCAT ('%', #{dpFilterParamDto.cityCode}, '%')))
and a.status = '6616'
and EXISTS (select 1 from tz_jyjc_inspection_result r where ( r.result_status='1' or r.result_status='2') and a.application_no = r.application_no)
and date_ge(CAST(a.accept_date as date),#{dpFilterParamDto.beginDate}) and date_le(CAST(a.accept_date as date),#{dpFilterParamDto.endDate})
and ((b.supervise_org_code != '50' and b.supervise_org_code LIKE CONCAT (#{orgCode}, '%')) or (b.supervise_org_code = '50' and b.office_region LIKE CONCAT ('%', #{dpFilterParamDto.cityCode}, '%')))
and a.status = '6616'
and EXISTS (select 1 from tz_jyjc_inspection_result r where r.result_status='2' and a.application_no = r.application_no)
and date_ge(CAST(a.accept_date as date),#{dpFilterParamDto.beginDate}) and date_le(CAST(a.accept_date as date),#{dpFilterParamDto.endDate})