and b.supervise_org_code like CONCAT(#{orgCode}, '%')
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 ('%', #{dto.cityCode}, '%')))
and a.status != '6610' and a.status != '6615'
and a.status != '6610' and a.status != '6615'
and date_ge(CAST(a.application_date as date),#{dto.beginDate})
and date_ge(CAST(a.application_date as date),#{dto.beginDate})
and date_le(CAST(a.application_date as date),#{dto.endDate})
and date_le(CAST(a.application_date as date),#{dto.endDate})
...
@@ -240,7 +240,8 @@
...
@@ -240,7 +240,8 @@
tz_base_enterprise_info b
tz_base_enterprise_info b
where
where
a.inspection_unit_code= b.use_unit_code
a.inspection_unit_code= b.use_unit_code
and b.supervise_org_code like CONCAT(#{orgCode}, '%') and a.status = '6616'
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 ('%', #{dto.cityCode}, '%')))
and a.status = '6616'
and EXISTS (select 1 from tz_jyjc_inspection_result r where r.result_status='1' and a.application_no = r.application_no)
and EXISTS (select 1 from tz_jyjc_inspection_result r where r.result_status='1' and a.application_no = r.application_no)
and date_ge(CAST(a.accept_date as date),#{dto.beginDate}) and date_le(CAST(a.accept_date as date),#{dto.endDate})
and date_ge(CAST(a.accept_date as date),#{dto.beginDate}) and date_le(CAST(a.accept_date as date),#{dto.endDate})
group by a.inspection_type
group by a.inspection_type
...
@@ -256,7 +257,8 @@
...
@@ -256,7 +257,8 @@
tz_base_enterprise_info b
tz_base_enterprise_info b
where
where
a.inspection_unit_code= b.use_unit_code
a.inspection_unit_code= b.use_unit_code
and b.supervise_org_code like CONCAT(#{orgCode}, '%') and a.status = '6616'
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 ('%', #{dto.cityCode}, '%')))
and a.status = '6616'
and EXISTS (select 1 from tz_jyjc_inspection_result r where r.result_status='1' and a.application_no = r.application_no)
and EXISTS (select 1 from tz_jyjc_inspection_result r where r.result_status='1' and a.application_no = r.application_no)
and date_ge(CAST(a.accept_date as date),#{dto.beginDate}) and date_le(CAST(a.accept_date as date),#{dto.endDate})
and date_ge(CAST(a.accept_date as date),#{dto.beginDate}) and date_le(CAST(a.accept_date as date),#{dto.endDate})
GROUP BY a.equip_classify
GROUP BY a.equip_classify
...
@@ -271,7 +273,8 @@
...
@@ -271,7 +273,8 @@
tz_base_enterprise_info b
tz_base_enterprise_info b
where
where
a.inspection_unit_code= b.use_unit_code
a.inspection_unit_code= b.use_unit_code
and b.supervise_org_code like CONCAT(#{orgCode}, '%') and a.status != '6610' and a.status != '6615'
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 ('%', #{dto.cityCode}, '%')))
and a.status != '6610' and a.status != '6615'
and date_ge(CAST(a.application_date as date),#{dto.beginDate}) and date_le(CAST(a.application_date as date),#{dto.endDate})
and date_ge(CAST(a.application_date as date),#{dto.beginDate}) and date_le(CAST(a.application_date as date),#{dto.endDate})
GROUP BY a.equip_classify
GROUP BY a.equip_classify
</select>
</select>
...
@@ -284,8 +287,8 @@
...
@@ -284,8 +287,8 @@
where
where
a.inspection_unit_code= b.use_unit_code
a.inspection_unit_code= b.use_unit_code
and a.status != '6610' and a.status != '6615'
and a.status != '6610' and a.status != '6615'
and b.supervise_org_code like CONCAT(#{orgCode}, '%')
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 ('%', #{dto.cityCode}, '%')))
<iftest="dto.beginDate !=null and dto.beginDate !=''">
<iftest="dto.beginDate !=null and dto.beginDate !=''">
and date_ge(CAST(a.application_date as date),#{dto.beginDate})
and date_ge(CAST(a.application_date as date),#{dto.beginDate})
</if>
</if>
<iftest="dto.endDate !=null and dto.endDate !=''">
<iftest="dto.endDate !=null and dto.endDate !=''">
AND b.supervise_org_code like CONCAT(#{orgCode}, '%')
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 ('%', #{dto.cityCode}, '%')))
and b.supervise_org_code like CONCAT(#{orgCode}, '%')
and b.supervise_org_code like CONCAT(#{orgCode}, '%')
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 ('%', #{dto.cityCode}, '%')))
and bi.supervise_org_code LIKE CONCAT ( #{orgCode}, '%' )
and ((bi.supervise_org_code != '50' and bi.supervise_org_code LIKE CONCAT (#{orgCode}, '%')) or (bi.supervise_org_code = '50' and bi.office_region LIKE CONCAT ('%', #{regionCode}, '%')))