Commit 817badf3 authored by 麻笑宇's avatar 麻笑宇

修改总揽大屏右侧办结率接口bug

parent 2bdd34a8
...@@ -1191,7 +1191,7 @@ ...@@ -1191,7 +1191,7 @@
END as status END as status
FROM "tzs_jg_installation_notice" FROM "tzs_jg_installation_notice"
where where
receive_company_org_code like CONCAT(#{orgCode}, '%') receive_company_org_code like CONCAT(#{orgCode}, '%') and notice_status = '6616'
<if test="dto.beginDate != null and dto.beginDate != ''"> <if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(handle_date as date),#{dto.beginDate}) and date_ge(CAST(handle_date as date),#{dto.beginDate})
</if> </if>
...@@ -1205,6 +1205,25 @@ ...@@ -1205,6 +1205,25 @@
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%') and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if> </if>
union all union all
SELECT sequence_nbr as sequenceNbr,install_unit_name as unitName,receive_org_name as
receiveOrgName,create_date as createDate,handle_date as handleDate,
CASE when notice_status = 0 then '已完成'
ELSE '进行中'
END as status FROM "tzs_jg_installation_notice" where receive_company_org_code like CONCAT(#{orgCode}, '%') and notice_status != '6610' and notice_status != '6615' and notice_status != '6617' and notice_status != '6616'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(notice_date as date),#{dto.beginDate})
</if>
<if test="dto.endDate != null and dto.endDate != ''">
and date_le(CAST(notice_date as date),#{dto.endDate})
</if>
<if test="dto.companyName != null and dto.companyName != ''">
and install_unit_name like CONCAT('%', #{dto.companyName}, '%')
</if>
<if test="dto.superviseUnitName != null and dto.superviseUnitName != ''">
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if>
union all
SELECT SELECT
a.sequence_nbr as sequenceNbr,application_unit_name as unitName,inspection_unit_name as a.sequence_nbr as sequenceNbr,application_unit_name as unitName,inspection_unit_name as
receiveOrgName,application_date as createDate,accept_date as handleDate, receiveOrgName,application_date as createDate,accept_date as handleDate,
...@@ -1217,7 +1236,7 @@ ...@@ -1217,7 +1236,7 @@
where where
a.inspection_unit_code= b.use_unit_code a.inspection_unit_code= b.use_unit_code
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 != '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.biz_type = 'supervise' and a.biz_type = 'supervise' and a.status = '6616'
<if test="dto.beginDate != null and dto.beginDate != ''"> <if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(a.accept_date as date),#{dto.beginDate}) and date_ge(CAST(a.accept_date as date),#{dto.beginDate})
</if> </if>
...@@ -1231,8 +1250,36 @@ ...@@ -1231,8 +1250,36 @@
and inspection_unit_name like CONCAT('%', #{dto.superviseUnitName}, '%') and inspection_unit_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if> </if>
union all union all
SELECT
a.sequence_nbr as sequenceNbr,application_unit_name as unitName,inspection_unit_name as
receiveOrgName,application_date as createDate,accept_date as handleDate,
CASE when a.status = 0 then '已完成'
ELSE '进行中'
END as status
FROM
"tz_jyjc_inspection_application" a,
tz_base_enterprise_info b
where
a.inspection_unit_code= b.use_unit_code
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 != '6617' and a.status != '6616'
and a.biz_type = 'supervise'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(a.application_date as date),#{dto.beginDate})
</if>
<if test="dto.endDate != null and dto.endDate != ''">
and date_le(CAST(a.application_date as date),#{dto.endDate})
</if>
<if test="dto.companyName != null and dto.companyName != ''">
and application_unit_name like CONCAT('%', #{dto.companyName}, '%')
</if>
<if test="dto.superviseUnitName != null and dto.superviseUnitName != ''">
and inspection_unit_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if>
union all
SELECT * FROM ( SELECT * FROM (
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status FROM "tzs_jg_use_registration" where receive_company_org_code like CONCAT(#{orgCode}, '%') SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status FROM "tzs_jg_use_registration" where receive_company_org_code like CONCAT(#{orgCode}, '%') and status = '已完成'
<if test="dto.beginDate != null and dto.beginDate != ''"> <if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(audit_pass_date as date),#{dto.beginDate}) and date_ge(CAST(audit_pass_date as date),#{dto.beginDate})
</if> </if>
...@@ -1247,7 +1294,7 @@ ...@@ -1247,7 +1294,7 @@
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%') and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if> </if>
union all union all
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status FROM "tzs_jg_vehicle_information" where org_branch_code like CONCAT(#{orgCode}, '%') SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status FROM "tzs_jg_vehicle_information" where org_branch_code like CONCAT(#{orgCode}, '%') and status = '已完成'
<if test="dto.beginDate != null and dto.beginDate != ''"> <if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(audit_pass_date as date),#{dto.beginDate}) and date_ge(CAST(audit_pass_date as date),#{dto.beginDate})
</if> </if>
...@@ -1262,6 +1309,37 @@ ...@@ -1262,6 +1309,37 @@
</if> </if>
) )
union all union all
SELECT * FROM (
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status FROM "tzs_jg_use_registration" where receive_company_org_code like CONCAT(#{orgCode}, '%') and status != '使用单位待提交' and status != '使用单位已撤回' and status != '已作废' and status != '已完成'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(reg_date as date),#{dto.beginDate})
</if>
<if test="dto.endDate != null and dto.endDate != ''">
and date_le(CAST(reg_date as date),#{dto.endDate})
</if>
<if test="dto.companyName != null and dto.companyName != ''">
and use_unit_name like CONCAT('%', #{dto.companyName}, '%')
</if>
<if test="dto.superviseUnitName != null and dto.superviseUnitName != ''">
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if>
union all
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status FROM "tzs_jg_vehicle_information" where org_branch_code like CONCAT(#{orgCode}, '%') and status != '使用单位待提交' and status != '使用单位已撤回' and status != '已作废' and status != '已完成'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(reg_date as date),#{dto.beginDate})
</if>
<if test="dto.endDate != null and dto.endDate != ''">
and date_le(CAST(reg_date as date),#{dto.endDate})
</if>
<if test="dto.companyName != null and dto.companyName != ''">
and use_unit_name like CONCAT('%', #{dto.companyName}, '%')
</if>
<if test="dto.superviseUnitName != null and dto.superviseUnitName != ''">
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if>
)
union all
SELECT SELECT
a.sequence_nbr as sequenceNbr,application_unit_name as unitName,inspection_unit_name as receiveOrgName,application_date as createDate,accept_date as handleDate, a.sequence_nbr as sequenceNbr,application_unit_name as unitName,inspection_unit_name as receiveOrgName,application_date as createDate,accept_date as handleDate,
CASE when a.status = 0 then '已完成' CASE when a.status = 0 then '已完成'
...@@ -1273,7 +1351,7 @@ ...@@ -1273,7 +1351,7 @@
where where
a.inspection_unit_code= b.use_unit_code a.inspection_unit_code= b.use_unit_code
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 != '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.inspection_type = 'DQJY' AND a.inspection_type = 'DQJY' and a.status = '6616'
<if test="dto.beginDate != null and dto.beginDate != ''"> <if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(a.accept_date as date),#{dto.beginDate}) and date_ge(CAST(a.accept_date as date),#{dto.beginDate})
</if> </if>
...@@ -1287,8 +1365,34 @@ ...@@ -1287,8 +1365,34 @@
and inspection_unit_name like CONCAT('%', #{dto.superviseUnitName}, '%') and inspection_unit_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if> </if>
union all union all
SELECT
a.sequence_nbr as sequenceNbr,application_unit_name as unitName,inspection_unit_name as receiveOrgName,application_date as createDate,accept_date as handleDate,
CASE when a.status = 0 then '已完成'
ELSE '进行中'
END as status
FROM
"tz_jyjc_inspection_application" a,
tz_base_enterprise_info b
where
a.inspection_unit_code= b.use_unit_code
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 != '6617' and a.status != '6616'
and a.inspection_type = 'DQJY'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(a.application_date as date),#{dto.beginDate})
</if>
<if test="dto.endDate != null and dto.endDate != ''">
and date_le(CAST(a.application_date as date),#{dto.endDate})
</if>
<if test="dto.companyName != null and dto.companyName != ''">
and application_unit_name like CONCAT('%', #{dto.companyName}, '%')
</if>
<if test="dto.superviseUnitName != null and dto.superviseUnitName != ''">
and inspection_unit_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if>
union all
SELECT * FROM ( SELECT * FROM (
SELECT a.sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,a.audit_status as status FROM tzs_jg_change_registration_name a, privilege_company b where a.receive_org_code= b.company_code and b.org_code like CONCAT(#{orgCode}, '%') SELECT a.sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,a.audit_status as status FROM tzs_jg_change_registration_name a, privilege_company b where a.receive_org_code= b.company_code and b.org_code like CONCAT(#{orgCode}, '%') and a.audit_status ='已完成'
<if test="dto.beginDate != null and dto.beginDate != ''"> <if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(a.audit_pass_date as date),#{dto.beginDate}) and date_ge(CAST(a.audit_pass_date as date),#{dto.beginDate})
</if> </if>
...@@ -1302,7 +1406,7 @@ ...@@ -1302,7 +1406,7 @@
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%') and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if> </if>
union all union all
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,audit_status as status FROM "tzs_jg_change_registration_reform" where receive_company_org_code like CONCAT(#{orgCode}, '%') SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,audit_status as status FROM "tzs_jg_change_registration_reform" where receive_company_org_code like CONCAT(#{orgCode}, '%') and audit_status ='已完成'
<if test="dto.beginDate != null and dto.beginDate != ''"> <if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(audit_pass_date as date),#{dto.beginDate}) and date_ge(CAST(audit_pass_date as date),#{dto.beginDate})
</if> </if>
...@@ -1316,7 +1420,7 @@ ...@@ -1316,7 +1420,7 @@
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%') and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if> </if>
union all union all
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,audit_status as status FROM "tzs_jg_change_registration_transfer" where receive_company_org_code like CONCAT(#{orgCode}, '%') SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,audit_status as status FROM "tzs_jg_change_registration_transfer" where receive_company_org_code like CONCAT(#{orgCode}, '%') and audit_status ='已完成'
<if test="dto.beginDate != null and dto.beginDate != ''"> <if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(audit_pass_date as date),#{dto.beginDate}) and date_ge(CAST(audit_pass_date as date),#{dto.beginDate})
</if> </if>
...@@ -1330,7 +1434,7 @@ ...@@ -1330,7 +1434,7 @@
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%') and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if> </if>
union all union all
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status FROM "tzs_jg_change_registration_unit" where receive_company_org_code like CONCAT(#{orgCode}, '%') SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status FROM "tzs_jg_change_registration_unit" where receive_company_org_code like CONCAT(#{orgCode}, '%') and status ='已完成'
<if test="dto.beginDate != null and dto.beginDate != ''"> <if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(audit_pass_date as date),#{dto.beginDate}) and date_ge(CAST(audit_pass_date as date),#{dto.beginDate})
</if> </if>
...@@ -1344,7 +1448,7 @@ ...@@ -1344,7 +1448,7 @@
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%') and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if> </if>
union all union all
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status FROM "tzs_jg_change_vehicle_registration_unit" where org_branch_code like CONCAT(#{orgCode}, '%') SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status FROM "tzs_jg_change_vehicle_registration_unit" where org_branch_code like CONCAT(#{orgCode}, '%') and status ='已完成'
<if test="dto.beginDate != null and dto.beginDate != ''"> <if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(audit_pass_date as date),#{dto.beginDate}) and date_ge(CAST(audit_pass_date as date),#{dto.beginDate})
</if> </if>
...@@ -1359,7 +1463,81 @@ ...@@ -1359,7 +1463,81 @@
</if> </if>
) )
union all union all
select a.sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,a.status as status from tzs_jg_scrap_cancel a, privilege_company b where a.receive_org_code= b.company_code and b.org_code like CONCAT(#{orgCode}, '%') select * from (
select a.sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,a.audit_status as status from tzs_jg_change_registration_name a, privilege_company b where a.receive_org_code= b.company_code and b.org_code like CONCAT(#{orgCode}, '%') and a.audit_status != '使用单位已撤回' and a.audit_status != '使用单位待提交' and a.audit_status !='已作废' and a.audit_status !='已完成'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(a.apply_date as date),#{dto.beginDate})
</if>
<if test="dto.endDate != null and dto.endDate != ''">
and date_le(CAST(a.apply_date as date),#{dto.endDate})
</if>
<if test="dto.companyName != null and dto.companyName != ''">
and use_unit_name like CONCAT('%', #{dto.companyName}, '%')
</if>
<if test="dto.superviseUnitName != null and dto.superviseUnitName != ''">
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if>
union all
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,audit_status as status FROM "tzs_jg_change_registration_reform" where receive_company_org_code like CONCAT(#{orgCode}, '%') and audit_status != '使用单位待提交' and audit_status != '使用单位已撤回' and audit_status != '已作废' and audit_status != '已完成'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(reg_date as date),#{dto.beginDate})
</if>
<if test="dto.endDate != null and dto.endDate != ''">
and date_le(CAST(reg_date as date),#{dto.endDate})
</if>
<if test="dto.companyName != null and dto.companyName != ''">
and use_unit_name like CONCAT('%', #{dto.companyName}, '%')
</if>
<if test="dto.superviseUnitName != null and dto.superviseUnitName != ''">
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if>
union all
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,audit_status as status FROM "tzs_jg_change_registration_transfer" where receive_company_org_code like CONCAT(#{orgCode}, '%') and audit_status != '使用单位待提交' and audit_status != '使用单位已撤回' and audit_status != '已作废' and audit_status != '已完成'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(reg_date as date),#{dto.beginDate})
</if>
<if test="dto.endDate != null and dto.endDate != ''">
and date_le(CAST(reg_date as date),#{dto.endDate})
</if>
<if test="dto.companyName != null and dto.companyName != ''">
and use_unit_name like CONCAT('%', #{dto.companyName}, '%')
</if>
<if test="dto.superviseUnitName != null and dto.superviseUnitName != ''">
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if>
union all
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status FROM "tzs_jg_change_registration_unit" where receive_company_org_code like CONCAT(#{orgCode}, '%') and status != '使用单位待提交' and status != '使用单位已撤回' and status != '已作废' and status != '已完成'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(apply_date as date),#{dto.beginDate})
</if>
<if test="dto.endDate != null and dto.endDate != ''">
and date_le(CAST(apply_date as date),#{dto.endDate})
</if>
<if test="dto.companyName != null and dto.companyName != ''">
and use_unit_name like CONCAT('%', #{dto.companyName}, '%')
</if>
<if test="dto.superviseUnitName != null and dto.superviseUnitName != ''">
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if>
union all
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status FROM "tzs_jg_change_vehicle_registration_unit" where org_branch_code like CONCAT(#{orgCode}, '%') and status != '使用单位待提交' and status != '使用单位已撤回' and status != '已作废' and status != '已完成'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(apply_date as date),#{dto.beginDate})
</if>
<if test="dto.endDate != null and dto.endDate != ''">
and date_le(CAST(apply_date as date),#{dto.endDate})
</if>
<if test="dto.companyName != null and dto.companyName != ''">
and use_unit_name like CONCAT('%', #{dto.companyName}, '%')
</if>
<if test="dto.superviseUnitName != null and dto.superviseUnitName != ''">
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if>
)
union all
select a.sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,a.status as status from tzs_jg_scrap_cancel a, privilege_company b where a.receive_org_code= b.company_code and b.org_code like CONCAT(#{orgCode}, '%') and a.audit_status = '已完成'
<if test="dto.beginDate != null and dto.beginDate != ''"> <if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(a.audit_pass_date as date),#{dto.beginDate}) and date_ge(CAST(a.audit_pass_date as date),#{dto.beginDate})
</if> </if>
...@@ -1372,6 +1550,20 @@ ...@@ -1372,6 +1550,20 @@
<if test="dto.superviseUnitName != null and dto.superviseUnitName != ''"> <if test="dto.superviseUnitName != null and dto.superviseUnitName != ''">
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%') and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if> </if>
union all
select a.sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,a.status as status from tzs_jg_scrap_cancel a, privilege_company b where a.receive_org_code= b.company_code and b.org_code like CONCAT(#{orgCode}, '%') and a.audit_status != '使用单位待提交' and a.audit_status != '使用单位已撤回' and a.audit_status != '已作废' and a.audit_status != '已完成'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(a.create_date as date),#{dto.beginDate})
</if>
<if test="dto.endDate != null and dto.endDate != ''">
and date_le(CAST(a.create_date as date),#{dto.endDate})
</if>
<if test="dto.companyName != null and dto.companyName != ''">
and use_unit_name like CONCAT('%', #{dto.companyName}, '%')
</if>
<if test="dto.superviseUnitName != null and dto.superviseUnitName != ''">
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if>
) )
</select> </select>
<select id="countBizFinishedNumForDPAZGZ" resultType="java.lang.Long"> <select id="countBizFinishedNumForDPAZGZ" resultType="java.lang.Long">
...@@ -1607,10 +1799,14 @@ ...@@ -1607,10 +1799,14 @@
</if> </if>
</select> </select>
<select id="countBizFinishedNumForDPListAZGZ" resultType="java.util.Map"> <select id="countBizFinishedNumForDPListAZGZ" resultType="java.util.Map">
SELECT sequence_nbr as sequenceNbr,install_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,handle_date as handleDate, SELECT sequence_nbr as sequenceNbr,install_unit_name as unitName,receive_org_name as
receiveOrgName,create_date as createDate,handle_date as handleDate,
CASE when notice_status = 0 then '已完成' CASE when notice_status = 0 then '已完成'
ELSE '进行中' ELSE '进行中'
END as status FROM "tzs_jg_installation_notice" where receive_company_org_code like CONCAT(#{orgCode}, '%') END as status
FROM "tzs_jg_installation_notice"
where
receive_company_org_code like CONCAT(#{orgCode}, '%') and notice_status = '6616'
<if test="dto.beginDate != null and dto.beginDate != ''"> <if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(handle_date as date),#{dto.beginDate}) and date_ge(CAST(handle_date as date),#{dto.beginDate})
</if> </if>
...@@ -1623,10 +1819,29 @@ ...@@ -1623,10 +1819,29 @@
<if test="dto.superviseUnitName != null and dto.superviseUnitName != ''"> <if test="dto.superviseUnitName != null and dto.superviseUnitName != ''">
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%') and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if> </if>
union all
SELECT sequence_nbr as sequenceNbr,install_unit_name as unitName,receive_org_name as
receiveOrgName,create_date as createDate,handle_date as handleDate,
CASE when notice_status = 0 then '已完成'
ELSE '进行中'
END as status FROM "tzs_jg_installation_notice" where receive_company_org_code like CONCAT(#{orgCode}, '%') and notice_status != '6610' and notice_status != '6615' and notice_status != '6617' and notice_status != '6616'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(notice_date as date),#{dto.beginDate})
</if>
<if test="dto.endDate != null and dto.endDate != ''">
and date_le(CAST(notice_date as date),#{dto.endDate})
</if>
<if test="dto.companyName != null and dto.companyName != ''">
and install_unit_name like CONCAT('%', #{dto.companyName}, '%')
</if>
<if test="dto.superviseUnitName != null and dto.superviseUnitName != ''">
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if>
</select> </select>
<select id="countBizFinishedNumForDPListJDJY" resultType="java.util.Map"> <select id="countBizFinishedNumForDPListJDJY" resultType="java.util.Map">
SELECT SELECT
a.sequence_nbr as sequenceNbr,application_unit_name as unitName,inspection_unit_name as receiveOrgName,application_date as createDate,accept_date as handleDate, a.sequence_nbr as sequenceNbr,application_unit_name as unitName,inspection_unit_name as
receiveOrgName,application_date as createDate,accept_date as handleDate,
CASE when a.status = 0 then '已完成' CASE when a.status = 0 then '已完成'
ELSE '进行中' ELSE '进行中'
END as status END as status
...@@ -1636,13 +1851,40 @@ ...@@ -1636,13 +1851,40 @@
where where
a.inspection_unit_code= b.use_unit_code a.inspection_unit_code= b.use_unit_code
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 != '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.biz_type = 'supervise' and a.biz_type = 'supervise' and a.status = '6616'
<if test="dto.beginDate != null and dto.beginDate != ''"> <if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(a.accept_date as date),#{dto.beginDate}) and date_ge(CAST(a.accept_date as date),#{dto.beginDate})
</if> </if>
<if test="dto.endDate != null and dto.endDate != ''"> <if test="dto.endDate != null and dto.endDate != ''">
and date_le(CAST(a.accept_date as date),#{dto.endDate}) and date_le(CAST(a.accept_date as date),#{dto.endDate})
</if> </if>
<if test="dto.companyName != null and dto.companyName != ''">
and application_unit_name like CONCAT('%', #{dto.companyName}, '%')
</if>
<if test="dto.superviseUnitName != null and dto.superviseUnitName != ''">
and inspection_unit_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if>
union all
SELECT
a.sequence_nbr as sequenceNbr,application_unit_name as unitName,inspection_unit_name as
receiveOrgName,application_date as createDate,accept_date as handleDate,
CASE when a.status = 0 then '已完成'
ELSE '进行中'
END as status
FROM
"tz_jyjc_inspection_application" a,
tz_base_enterprise_info b
where
a.inspection_unit_code= b.use_unit_code
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 != '6617' and a.status != '6616'
and a.biz_type = 'supervise'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(a.application_date as date),#{dto.beginDate})
</if>
<if test="dto.endDate != null and dto.endDate != ''">
and date_le(CAST(a.application_date as date),#{dto.endDate})
</if>
<if test="dto.companyName != null and dto.companyName != ''"> <if test="dto.companyName != null and dto.companyName != ''">
and application_unit_name like CONCAT('%', #{dto.companyName}, '%') and application_unit_name like CONCAT('%', #{dto.companyName}, '%')
</if> </if>
...@@ -1652,20 +1894,22 @@ ...@@ -1652,20 +1894,22 @@
</select> </select>
<select id="countBizFinishedNumForDPListSYDJ" resultType="java.util.Map"> <select id="countBizFinishedNumForDPListSYDJ" resultType="java.util.Map">
SELECT * FROM ( SELECT * FROM (
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status FROM "tzs_jg_use_registration" where receive_company_org_code like CONCAT(#{orgCode}, '%') SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status FROM "tzs_jg_use_registration" where receive_company_org_code like CONCAT(#{orgCode}, '%') and status = '已完成'
<if test="dto.beginDate != null and dto.beginDate != ''"> <if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(audit_pass_date as date),#{dto.beginDate}) and date_ge(CAST(audit_pass_date as date),#{dto.beginDate})
</if> </if>
<if test="dto.endDate != null and dto.endDate != ''"> <if test="dto.endDate != null and dto.endDate != ''">
and date_le(CAST(audit_pass_date as date),#{dto.endDate}) </if> and date_le(CAST(audit_pass_date as date),#{dto.endDate})
</if>
<if test="dto.companyName != null and dto.companyName != ''"> <if test="dto.companyName != null and dto.companyName != ''">
and use_unit_name like CONCAT('%', #{dto.companyName}, '%') and use_unit_name like CONCAT('%',#{dto.companyName}, '%')
</if> </if>
<if test="dto.superviseUnitName != null and dto.superviseUnitName != ''"> <if test="dto.superviseUnitName != null and dto.superviseUnitName != ''">
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%') and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if> </if>
union all union all
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status FROM "tzs_jg_vehicle_information" where org_branch_code like CONCAT(#{orgCode}, '%') SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status FROM "tzs_jg_vehicle_information" where org_branch_code like CONCAT(#{orgCode}, '%') and status = '已完成'
<if test="dto.beginDate != null and dto.beginDate != ''"> <if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(audit_pass_date as date),#{dto.beginDate}) and date_ge(CAST(audit_pass_date as date),#{dto.beginDate})
</if> </if>
...@@ -1679,6 +1923,36 @@ ...@@ -1679,6 +1923,36 @@
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%') and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if> </if>
) )
union all
SELECT * FROM (
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status FROM "tzs_jg_use_registration" where receive_company_org_code like CONCAT(#{orgCode}, '%') and status != '使用单位待提交' and status != '使用单位已撤回' and status != '已作废' and status != '已完成'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(reg_date as date),#{dto.beginDate})
</if>
<if test="dto.endDate != null and dto.endDate != ''">
and date_le(CAST(reg_date as date),#{dto.endDate})
</if>
<if test="dto.companyName != null and dto.companyName != ''">
and use_unit_name like CONCAT('%', #{dto.companyName}, '%')
</if>
<if test="dto.superviseUnitName != null and dto.superviseUnitName != ''">
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if>
union all
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status FROM "tzs_jg_vehicle_information" where org_branch_code like CONCAT(#{orgCode}, '%') and status != '使用单位待提交' and status != '使用单位已撤回' and status != '已作废' and status != '已完成'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(reg_date as date),#{dto.beginDate})
</if>
<if test="dto.endDate != null and dto.endDate != ''">
and date_le(CAST(reg_date as date),#{dto.endDate})
</if>
<if test="dto.companyName != null and dto.companyName != ''">
and use_unit_name like CONCAT('%', #{dto.companyName}, '%')
</if>
<if test="dto.superviseUnitName != null and dto.superviseUnitName != ''">
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if>
)
</select> </select>
<select id="countBizFinishedNumForDPListDQJY" resultType="java.util.Map"> <select id="countBizFinishedNumForDPListDQJY" resultType="java.util.Map">
SELECT SELECT
...@@ -1692,13 +1966,39 @@ ...@@ -1692,13 +1966,39 @@
where where
a.inspection_unit_code= b.use_unit_code a.inspection_unit_code= b.use_unit_code
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 != '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.inspection_type = 'DQJY' and a.status = '6616'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(a.accept_date as date),#{dto.beginDate})
</if>
<if test="dto.endDate != null and dto.endDate != ''">
and date_le(CAST(a.accept_date as date),#{dto.endDate})
</if>
<if test="dto.companyName != null and dto.companyName != ''">
and application_unit_name like CONCAT('%', #{dto.companyName}, '%')
</if>
<if test="dto.superviseUnitName != null and dto.superviseUnitName != ''">
and inspection_unit_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if>
union all
SELECT
a.sequence_nbr as sequenceNbr,application_unit_name as unitName,inspection_unit_name as receiveOrgName,application_date as createDate,accept_date as handleDate,
CASE when a.status = 0 then '已完成'
ELSE '进行中'
END as status
FROM
"tz_jyjc_inspection_application" a,
tz_base_enterprise_info b
where
a.inspection_unit_code= b.use_unit_code
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 != '6617' and a.status != '6616'
and a.inspection_type = 'DQJY' and a.inspection_type = 'DQJY'
<if test="dto.beginDate != null and dto.beginDate != ''"> <if test="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>
<if test="dto.endDate != null and dto.endDate != ''"> <if test="dto.endDate != null and dto.endDate != ''">
and date_le(CAST(a.application_date as date),#{dto.endDate}) and date_le(CAST(a.application_date as date),#{dto.endDate})
</if> </if>
<if test="dto.companyName != null and dto.companyName != ''"> <if test="dto.companyName != null and dto.companyName != ''">
and application_unit_name like CONCAT('%', #{dto.companyName}, '%') and application_unit_name like CONCAT('%', #{dto.companyName}, '%')
</if> </if>
...@@ -1708,12 +2008,26 @@ ...@@ -1708,12 +2008,26 @@
</select> </select>
<select id="countBizFinishedNumForDPListBGDJ" resultType="java.util.Map"> <select id="countBizFinishedNumForDPListBGDJ" resultType="java.util.Map">
SELECT * FROM ( SELECT * FROM (
SELECT a.sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,a.audit_status as status FROM tzs_jg_change_registration_name a, privilege_company b where a.receive_org_code= b.company_code and b.org_code like CONCAT(#{orgCode}, '%') SELECT a.sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,a.audit_status as status FROM tzs_jg_change_registration_name a, privilege_company b where a.receive_org_code= b.company_code and b.org_code like CONCAT(#{orgCode}, '%') and a.audit_status ='已完成'
<if test="dto.beginDate != null and dto.beginDate != ''"> <if test="dto.beginDate != null and dto.beginDate != ''">
and (date_ge(CAST(a.audit_pass_date as date),#{dto.beginDate}) or date_ge(CAST(a.create_date as date),#{dto.beginDate})) and date_ge(CAST(a.audit_pass_date as date),#{dto.beginDate})
</if> </if>
<if test="dto.endDate != null and dto.endDate != ''"> <if test="dto.endDate != null and dto.endDate != ''">
and (date_le(CAST(a.audit_pass_date as date),#{dto.endDate}) or date_le(CAST(a.create_date as date),#{dto.endDate})) and date_le(CAST(a.audit_pass_date as date),#{dto.endDate})
</if>
<if test="dto.companyName != null and dto.companyName != ''">
and use_unit_name like CONCAT('%', #{dto.companyName}, '%')
</if>
<if test="dto.superviseUnitName != null and dto.superviseUnitName != ''">
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if>
union all
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,audit_status as status FROM "tzs_jg_change_registration_reform" where receive_company_org_code like CONCAT(#{orgCode}, '%') and audit_status ='已完成'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(audit_pass_date as date),#{dto.beginDate})
</if>
<if test="dto.endDate != null and dto.endDate != ''">
and date_le(CAST(audit_pass_date as date),#{dto.endDate})
</if> </if>
<if test="dto.companyName != null and dto.companyName != ''"> <if test="dto.companyName != null and dto.companyName != ''">
and use_unit_name like CONCAT('%', #{dto.companyName}, '%') and use_unit_name like CONCAT('%', #{dto.companyName}, '%')
...@@ -1722,12 +2036,12 @@ ...@@ -1722,12 +2036,12 @@
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%') and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if> </if>
union all union all
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,audit_status as status FROM "tzs_jg_change_registration_reform" a where receive_company_org_code like CONCAT(#{orgCode}, '%') SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,audit_status as status FROM "tzs_jg_change_registration_transfer" where receive_company_org_code like CONCAT(#{orgCode}, '%') and audit_status ='已完成'
<if test="dto.beginDate != null and dto.beginDate != ''"> <if test="dto.beginDate != null and dto.beginDate != ''">
and (date_ge(CAST(a.audit_pass_date as date),#{dto.beginDate}) or date_ge(CAST(a.create_date as date),#{dto.beginDate})) and date_ge(CAST(audit_pass_date as date),#{dto.beginDate})
</if> </if>
<if test="dto.endDate != null and dto.endDate != ''"> <if test="dto.endDate != null and dto.endDate != ''">
and (date_le(CAST(a.audit_pass_date as date),#{dto.endDate}) or date_le(CAST(a.create_date as date),#{dto.endDate})) and date_le(CAST(audit_pass_date as date),#{dto.endDate})
</if> </if>
<if test="dto.companyName != null and dto.companyName != ''"> <if test="dto.companyName != null and dto.companyName != ''">
and use_unit_name like CONCAT('%', #{dto.companyName}, '%') and use_unit_name like CONCAT('%', #{dto.companyName}, '%')
...@@ -1736,12 +2050,12 @@ ...@@ -1736,12 +2050,12 @@
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%') and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if> </if>
union all union all
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,audit_status as status FROM "tzs_jg_change_registration_transfer" a where receive_company_org_code like CONCAT(#{orgCode}, '%') SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status FROM "tzs_jg_change_registration_unit" where receive_company_org_code like CONCAT(#{orgCode}, '%') and status ='已完成'
<if test="dto.beginDate != null and dto.beginDate != ''"> <if test="dto.beginDate != null and dto.beginDate != ''">
and (date_ge(CAST(a.audit_pass_date as date),#{dto.beginDate}) or date_ge(CAST(a.create_date as date),#{dto.beginDate})) and date_ge(CAST(audit_pass_date as date),#{dto.beginDate})
</if> </if>
<if test="dto.endDate != null and dto.endDate != ''"> <if test="dto.endDate != null and dto.endDate != ''">
and (date_le(CAST(a.audit_pass_date as date),#{dto.endDate}) or date_le(CAST(a.create_date as date),#{dto.endDate})) and date_le(CAST(audit_pass_date as date),#{dto.endDate})
</if> </if>
<if test="dto.companyName != null and dto.companyName != ''"> <if test="dto.companyName != null and dto.companyName != ''">
and use_unit_name like CONCAT('%', #{dto.companyName}, '%') and use_unit_name like CONCAT('%', #{dto.companyName}, '%')
...@@ -1750,12 +2064,12 @@ ...@@ -1750,12 +2064,12 @@
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%') and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if> </if>
union all union all
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status FROM "tzs_jg_change_registration_unit" a where receive_company_org_code like CONCAT(#{orgCode}, '%') SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status FROM "tzs_jg_change_vehicle_registration_unit" where org_branch_code like CONCAT(#{orgCode}, '%') and status ='已完成'
<if test="dto.beginDate != null and dto.beginDate != ''"> <if test="dto.beginDate != null and dto.beginDate != ''">
and (date_ge(CAST(a.audit_pass_date as date),#{dto.beginDate}) or date_ge(CAST(a.create_date as date),#{dto.beginDate})) and date_ge(CAST(audit_pass_date as date),#{dto.beginDate})
</if> </if>
<if test="dto.endDate != null and dto.endDate != ''"> <if test="dto.endDate != null and dto.endDate != ''">
and (date_le(CAST(a.audit_pass_date as date),#{dto.endDate}) or date_le(CAST(a.create_date as date),#{dto.endDate})) and date_le(CAST(audit_pass_date as date),#{dto.endDate})
</if> </if>
<if test="dto.companyName != null and dto.companyName != ''"> <if test="dto.companyName != null and dto.companyName != ''">
and use_unit_name like CONCAT('%', #{dto.companyName}, '%') and use_unit_name like CONCAT('%', #{dto.companyName}, '%')
...@@ -1763,13 +2077,15 @@ ...@@ -1763,13 +2077,15 @@
<if test="dto.superviseUnitName != null and dto.superviseUnitName != ''"> <if test="dto.superviseUnitName != null and dto.superviseUnitName != ''">
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%') and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if> </if>
)
union all union all
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status FROM "tzs_jg_change_vehicle_registration_unit" a where org_branch_code like CONCAT(#{orgCode}, '%') select * from (
select a.sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,a.audit_status as status from tzs_jg_change_registration_name a, privilege_company b where a.receive_org_code= b.company_code and b.org_code like CONCAT(#{orgCode}, '%') and a.audit_status != '使用单位已撤回' and a.audit_status != '使用单位待提交' and a.audit_status !='已作废' and a.audit_status !='已完成'
<if test="dto.beginDate != null and dto.beginDate != ''"> <if test="dto.beginDate != null and dto.beginDate != ''">
and (date_ge(CAST(a.audit_pass_date as date),#{dto.beginDate}) or date_ge(CAST(a.create_date as date),#{dto.beginDate})) and date_ge(CAST(a.apply_date as date),#{dto.beginDate})
</if> </if>
<if test="dto.endDate != null and dto.endDate != ''"> <if test="dto.endDate != null and dto.endDate != ''">
and (date_le(CAST(a.audit_pass_date as date),#{dto.endDate}) or date_le(CAST(a.create_date as date),#{dto.endDate})) and date_le(CAST(a.apply_date as date),#{dto.endDate})
</if> </if>
<if test="dto.companyName != null and dto.companyName != ''"> <if test="dto.companyName != null and dto.companyName != ''">
and use_unit_name like CONCAT('%', #{dto.companyName}, '%') and use_unit_name like CONCAT('%', #{dto.companyName}, '%')
...@@ -1777,16 +2093,86 @@ ...@@ -1777,16 +2093,86 @@
<if test="dto.superviseUnitName != null and dto.superviseUnitName != ''"> <if test="dto.superviseUnitName != null and dto.superviseUnitName != ''">
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%') and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if> </if>
) b where b.status != '使用单位待提交' and b.status != '使用单位已撤回' union all
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,audit_status as status FROM "tzs_jg_change_registration_reform" where receive_company_org_code like CONCAT(#{orgCode}, '%') and audit_status != '使用单位待提交' and audit_status != '使用单位已撤回' and audit_status != '已作废' and audit_status != '已完成'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(reg_date as date),#{dto.beginDate})
</if>
<if test="dto.endDate != null and dto.endDate != ''">
and date_le(CAST(reg_date as date),#{dto.endDate})
</if>
<if test="dto.companyName != null and dto.companyName != ''">
and use_unit_name like CONCAT('%', #{dto.companyName}, '%')
</if>
<if test="dto.superviseUnitName != null and dto.superviseUnitName != ''">
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if>
union all
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,audit_status as status FROM "tzs_jg_change_registration_transfer" where receive_company_org_code like CONCAT(#{orgCode}, '%') and audit_status != '使用单位待提交' and audit_status != '使用单位已撤回' and audit_status != '已作废' and audit_status != '已完成'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(reg_date as date),#{dto.beginDate})
</if>
<if test="dto.endDate != null and dto.endDate != ''">
and date_le(CAST(reg_date as date),#{dto.endDate})
</if>
<if test="dto.companyName != null and dto.companyName != ''">
and use_unit_name like CONCAT('%', #{dto.companyName}, '%')
</if>
<if test="dto.superviseUnitName != null and dto.superviseUnitName != ''">
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if>
union all
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status FROM "tzs_jg_change_registration_unit" where receive_company_org_code like CONCAT(#{orgCode}, '%') and status != '使用单位待提交' and status != '使用单位已撤回' and status != '已作废' and status != '已完成'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(apply_date as date),#{dto.beginDate})
</if>
<if test="dto.endDate != null and dto.endDate != ''">
and date_le(CAST(apply_date as date),#{dto.endDate})
</if>
<if test="dto.companyName != null and dto.companyName != ''">
and use_unit_name like CONCAT('%', #{dto.companyName}, '%')
</if>
<if test="dto.superviseUnitName != null and dto.superviseUnitName != ''">
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if>
union all
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status FROM "tzs_jg_change_vehicle_registration_unit" where org_branch_code like CONCAT(#{orgCode}, '%') and status != '使用单位待提交' and status != '使用单位已撤回' and status != '已作废' and status != '已完成'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(apply_date as date),#{dto.beginDate})
</if>
<if test="dto.endDate != null and dto.endDate != ''">
and date_le(CAST(apply_date as date),#{dto.endDate})
</if>
<if test="dto.companyName != null and dto.companyName != ''">
and use_unit_name like CONCAT('%', #{dto.companyName}, '%')
</if>
<if test="dto.superviseUnitName != null and dto.superviseUnitName != ''">
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if>
)
</select> </select>
<select id="countBizFinishedNumForDPListZXBX" resultType="java.util.Map"> <select id="countBizFinishedNumForDPListZXBX" resultType="java.util.Map">
select a.sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,a.audit_status as status from tzs_jg_scrap_cancel a, privilege_company b where a.receive_org_code= b.company_code and b.org_code like CONCAT(#{orgCode}, '%') select a.sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,a.status as status from tzs_jg_scrap_cancel a, privilege_company b where a.receive_org_code= b.company_code and b.org_code like CONCAT(#{orgCode}, '%') and a.audit_status = '已完成'
and audit_status != '使用单位待提交' <if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(a.audit_pass_date as date),#{dto.beginDate})
</if>
<if test="dto.endDate != null and dto.endDate != ''">
and date_le(CAST(a.audit_pass_date as date),#{dto.endDate})
</if>
<if test="dto.companyName != null and dto.companyName != ''">
and use_unit_name like CONCAT('%', #{dto.companyName}, '%')
</if>
<if test="dto.superviseUnitName != null and dto.superviseUnitName != ''">
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if>
union all
select a.sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,a.status as status from tzs_jg_scrap_cancel a, privilege_company b where a.receive_org_code= b.company_code and b.org_code like CONCAT(#{orgCode}, '%') and a.audit_status != '使用单位待提交' and a.audit_status != '使用单位已撤回' and a.audit_status != '已作废' and a.audit_status != '已完成'
<if test="dto.beginDate != null and dto.beginDate != ''"> <if test="dto.beginDate != null and dto.beginDate != ''">
and (date_ge(CAST(a.audit_pass_date as date),#{dto.beginDate}) or date_ge(CAST(a.create_date as date),#{dto.beginDate})) and date_ge(CAST(a.create_date as date),#{dto.beginDate})
</if> </if>
<if test="dto.endDate != null and dto.endDate != ''"> <if test="dto.endDate != null and dto.endDate != ''">
and (date_le(CAST(a.audit_pass_date as date),#{dto.endDate}) or date_le(CAST(a.create_date as date),#{dto.endDate})) and date_le(CAST(a.create_date as date),#{dto.endDate})
</if> </if>
<if test="dto.companyName != null and dto.companyName != ''"> <if test="dto.companyName != null and dto.companyName != ''">
and use_unit_name like CONCAT('%', #{dto.companyName}, '%') and use_unit_name like CONCAT('%', #{dto.companyName}, '%')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment