SELECT * FROM (SELECT sequence_nbr as sequenceNbr,install_unit_name as unitName,receive_org_name as
SELECT * FROM (SELECT sequence_nbr as sequenceNbr,install_unit_name as unitName,receive_org_name as
receiveOrgName,create_date as createDate,handle_date as handleDate FROM "tzs_jg_installation_notice" where
receiveOrgName,create_date as createDate,handle_date as handleDate,
receive_company_org_code like CONCAT(#{orgCode}, '%') and notice_status = '6616'
CASE when notice_status = 0 then '已完成'
ELSE '进行中'
END as status
FROM "tzs_jg_installation_notice"
where
receive_company_org_code like CONCAT(#{orgCode}, '%')
<iftest="dto.beginDate != null and dto.beginDate != ''">
<iftest="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>
...
@@ -1202,14 +1207,17 @@
...
@@ -1202,14 +1207,17 @@
union all
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,
CASE when a.status = 0 then '已完成'
ELSE '进行中'
END as status
FROM
FROM
"tz_jyjc_inspection_application" a,
"tz_jyjc_inspection_application" a,
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 != '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.status = '6616' and a.biz_type = 'supervise'
and a.biz_type = 'supervise'
<iftest="dto.beginDate != null and dto.beginDate != ''">
<iftest="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>
...
@@ -1224,7 +1232,7 @@
...
@@ -1224,7 +1232,7 @@
</if>
</if>
union all
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 FROM "tzs_jg_use_registration" where receive_company_org_code like CONCAT(#{orgCode}, '%') and status = '已完成'
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}, '%')
<iftest="dto.beginDate != null and dto.beginDate != ''">
<iftest="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>
...
@@ -1239,7 +1247,7 @@
...
@@ -1239,7 +1247,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 FROM "tzs_jg_vehicle_information" where org_branch_code like CONCAT(#{orgCode}, '%') and status = '已完成'
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}, '%')
<iftest="dto.beginDate != null and dto.beginDate != ''">
<iftest="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>
...
@@ -1255,14 +1263,17 @@
...
@@ -1255,14 +1263,17 @@
)
)
union all
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 '已完成'
ELSE '进行中'
END as status
FROM
FROM
"tz_jyjc_inspection_application" a,
"tz_jyjc_inspection_application" a,
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 != '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.status = '6616' and a.inspection_type = 'DQJY'
AND a.inspection_type = 'DQJY'
<iftest="dto.beginDate != null and dto.beginDate != ''">
<iftest="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>
...
@@ -1277,7 +1288,7 @@
...
@@ -1277,7 +1288,7 @@
</if>
</if>
union all
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 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 = '已完成'
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}, '%')
<iftest="dto.beginDate != null and dto.beginDate != ''">
<iftest="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>
...
@@ -1291,7 +1302,7 @@
...
@@ -1291,7 +1302,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 FROM "tzs_jg_change_registration_reform" where receive_company_org_code like CONCAT(#{orgCode}, '%') and audit_status = '已完成'
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}, '%')
<iftest="dto.beginDate != null and dto.beginDate != ''">
<iftest="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>
...
@@ -1305,7 +1316,7 @@
...
@@ -1305,7 +1316,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 FROM "tzs_jg_change_registration_transfer" where receive_company_org_code like CONCAT(#{orgCode}, '%') and audit_status = '已完成'
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}, '%')
<iftest="dto.beginDate != null and dto.beginDate != ''">
<iftest="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>
...
@@ -1319,7 +1330,7 @@
...
@@ -1319,7 +1330,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 FROM "tzs_jg_change_registration_unit" where receive_company_org_code like CONCAT(#{orgCode}, '%') and status = '已完成'
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}, '%')
<iftest="dto.beginDate != null and dto.beginDate != ''">
<iftest="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>
...
@@ -1333,7 +1344,7 @@
...
@@ -1333,7 +1344,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 FROM "tzs_jg_change_vehicle_registration_unit" where org_branch_code like CONCAT(#{orgCode}, '%') and status = '已完成'
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}, '%')
<iftest="dto.beginDate != null and dto.beginDate != ''">
<iftest="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>
...
@@ -1348,7 +1359,7 @@
...
@@ -1348,7 +1359,7 @@
</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 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 = '已完成'
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}, '%')
<iftest="dto.beginDate != null and dto.beginDate != ''">
<iftest="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>
...
@@ -1555,34 +1566,34 @@
...
@@ -1555,34 +1566,34 @@
union all
union all
SELECT count(1) as num 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 != '已完成'
SELECT count(1) as num 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 != '已完成'
<iftest="dto.beginDate != null and dto.beginDate != ''">
<iftest="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(a.apply_date as date),#{dto.beginDate})
and date_ge(CAST(create_date as date),#{dto.beginDate})
</if>
</if>
<iftest="dto.endDate != null and dto.endDate != ''">
<iftest="dto.endDate != null and dto.endDate != ''">
and date_le(CAST(a.apply_date as date),#{dto.endDate})
and date_le(CAST(create_date as date),#{dto.endDate})
</if>
</if>
union all
union all
SELECT count(1) as num 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 != '已完成'
SELECT count(1) as num 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 != '已完成'
<iftest="dto.beginDate != null and dto.beginDate != ''">
<iftest="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(a.apply_date as date),#{dto.beginDate})
and date_ge(CAST(create_date as date),#{dto.beginDate})
</if>
</if>
<iftest="dto.endDate != null and dto.endDate != ''">
<iftest="dto.endDate != null and dto.endDate != ''">
and date_le(CAST(a.apply_date as date),#{dto.endDate})
and date_le(CAST(create_date as date),#{dto.endDate})
</if>
</if>
union all
union all
SELECT count(1) as num FROM "tzs_jg_change_registration_unit" where receive_company_org_code like CONCAT(#{orgCode}, '%') and status != '使用单位待提交' and status != '使用单位已撤回' and status != '已作废' and status != '已完成'
SELECT count(1) as num FROM "tzs_jg_change_registration_unit" where receive_company_org_code like CONCAT(#{orgCode}, '%') and status != '使用单位待提交' and status != '使用单位已撤回' and status != '已作废' and status != '已完成'
<iftest="dto.beginDate != null and dto.beginDate != ''">
<iftest="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(a.apply_date as date),#{dto.beginDate})
and date_ge(CAST(apply_date as date),#{dto.beginDate})
</if>
</if>
<iftest="dto.endDate != null and dto.endDate != ''">
<iftest="dto.endDate != null and dto.endDate != ''">
and date_le(CAST(a.apply_date as date),#{dto.endDate})
and date_le(CAST(apply_date as date),#{dto.endDate})
</if>
</if>
union all
union all
SELECT count(1) as num FROM "tzs_jg_change_vehicle_registration_unit" where org_branch_code like CONCAT(#{orgCode}, '%') and status != '使用单位待提交' and status != '使用单位已撤回' and status != '已作废' and status != '已完成'
SELECT count(1) as num FROM "tzs_jg_change_vehicle_registration_unit" where org_branch_code like CONCAT(#{orgCode}, '%') and status != '使用单位待提交' and status != '使用单位已撤回' and status != '已作废' and status != '已完成'
<iftest="dto.beginDate != null and dto.beginDate != ''">
<iftest="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(a.apply_date as date),#{dto.beginDate})
and date_ge(CAST(apply_date as date),#{dto.beginDate})
</if>
</if>
<iftest="dto.endDate != null and dto.endDate != ''">
<iftest="dto.endDate != null and dto.endDate != ''">
and date_le(CAST(a.apply_date as date),#{dto.endDate})
and date_le(CAST(apply_date as date),#{dto.endDate})
SELECT sequence_nbr as sequenceNbr,install_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,handle_date as handleDate FROM "tzs_jg_installation_notice" where receive_company_org_code like CONCAT(#{orgCode}, '%') and notice_status = '6616'
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}, '%')
<iftest="dto.beginDate != null and dto.beginDate != ''">
<iftest="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})
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 '已完成'
ELSE '进行中'
END as status
FROM
FROM
"tz_jyjc_inspection_application" a,
"tz_jyjc_inspection_application" a,
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 != '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.status = '6616' and a.biz_type = 'supervise'
and a.biz_type = 'supervise'
<iftest="dto.beginDate != null and dto.beginDate != ''">
<iftest="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})
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate FROM "tzs_jg_use_registration" where receive_company_org_code like CONCAT(#{orgCode}, '%') and status = '已完成'
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}, '%')
<iftest="dto.beginDate != null and dto.beginDate != ''">
<iftest="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>
...
@@ -1648,7 +1665,7 @@
...
@@ -1648,7 +1665,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 FROM "tzs_jg_vehicle_information" where org_branch_code like CONCAT(#{orgCode}, '%') and status = '已完成'
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}, '%')
<iftest="dto.beginDate != null and dto.beginDate != ''">
<iftest="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})
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 '已完成'
ELSE '进行中'
END as status
FROM
FROM
"tz_jyjc_inspection_application" a,
"tz_jyjc_inspection_application" a,
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 != '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.status = '6616' and a.inspection_type = 'DQJY'
and a.inspection_type = 'DQJY'
<iftest="dto.beginDate != null and dto.beginDate != ''">
<iftest="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(a.accept_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 date_le(CAST(a.accept_date as date),#{dto.endDate})
and date_le(CAST(a.application_date as date),#{dto.endDate})
</if>
</if>
<iftest="dto.companyName != null and dto.companyName != ''">
<iftest="dto.companyName != null and dto.companyName != ''">
and application_unit_name like CONCAT('%', #{dto.companyName}, '%')
and application_unit_name like CONCAT('%', #{dto.companyName}, '%')
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 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 = '已完成'
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}, '%')
<iftest="dto.beginDate != null and dto.beginDate != ''">
<iftest="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}) or date_ge(CAST(a.create_date as date),#{dto.beginDate}))
</if>
</if>
<iftest="dto.endDate != null and dto.endDate != ''">
<iftest="dto.endDate != null and dto.endDate != ''">
and date_le(CAST(a.audit_pass_date as date),#{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}))
</if>
</if>
<iftest="dto.companyName != null and dto.companyName != ''">
<iftest="dto.companyName != null and dto.companyName != ''">
and use_unit_name like CONCAT('%', #{dto.companyName}, '%')
and use_unit_name like CONCAT('%', #{dto.companyName}, '%')
...
@@ -1702,12 +1722,12 @@
...
@@ -1702,12 +1722,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 FROM "tzs_jg_change_registration_reform" where receive_company_org_code like CONCAT(#{orgCode}, '%') and audit_status = '已完成'
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}, '%')
<iftest="dto.beginDate != null and dto.beginDate != ''">
<iftest="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(audit_pass_date as date),#{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}))
</if>
</if>
<iftest="dto.endDate != null and dto.endDate != ''">
<iftest="dto.endDate != null and dto.endDate != ''">
and date_le(CAST(audit_pass_date as date),#{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}))
</if>
</if>
<iftest="dto.companyName != null and dto.companyName != ''">
<iftest="dto.companyName != null and dto.companyName != ''">
and use_unit_name like CONCAT('%', #{dto.companyName}, '%')
and use_unit_name like CONCAT('%', #{dto.companyName}, '%')
...
@@ -1716,12 +1736,12 @@
...
@@ -1716,12 +1736,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 FROM "tzs_jg_change_registration_transfer" where receive_company_org_code like CONCAT(#{orgCode}, '%') and audit_status = '已完成'
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}, '%')
<iftest="dto.beginDate != null and dto.beginDate != ''">
<iftest="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(audit_pass_date as date),#{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}))
</if>
</if>
<iftest="dto.endDate != null and dto.endDate != ''">
<iftest="dto.endDate != null and dto.endDate != ''">
and date_le(CAST(audit_pass_date as date),#{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}))
</if>
</if>
<iftest="dto.companyName != null and dto.companyName != ''">
<iftest="dto.companyName != null and dto.companyName != ''">
and use_unit_name like CONCAT('%', #{dto.companyName}, '%')
and use_unit_name like CONCAT('%', #{dto.companyName}, '%')
...
@@ -1730,12 +1750,12 @@
...
@@ -1730,12 +1750,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 FROM "tzs_jg_change_registration_unit" where receive_company_org_code like CONCAT(#{orgCode}, '%') and status = '已完成'
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}, '%')
<iftest="dto.beginDate != null and dto.beginDate != ''">
<iftest="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(audit_pass_date as date),#{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}))
</if>
</if>
<iftest="dto.endDate != null and dto.endDate != ''">
<iftest="dto.endDate != null and dto.endDate != ''">
and date_le(CAST(audit_pass_date as date),#{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}))
</if>
</if>
<iftest="dto.companyName != null and dto.companyName != ''">
<iftest="dto.companyName != null and dto.companyName != ''">
and use_unit_name like CONCAT('%', #{dto.companyName}, '%')
and use_unit_name like CONCAT('%', #{dto.companyName}, '%')
...
@@ -1744,12 +1764,12 @@
...
@@ -1744,12 +1764,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 FROM "tzs_jg_change_vehicle_registration_unit" where org_branch_code like CONCAT(#{orgCode}, '%') and status = '已完成'
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}, '%')
<iftest="dto.beginDate != null and dto.beginDate != ''">
<iftest="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(audit_pass_date as date),#{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}))
</if>
</if>
<iftest="dto.endDate != null and dto.endDate != ''">
<iftest="dto.endDate != null and dto.endDate != ''">
and date_le(CAST(audit_pass_date as date),#{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}))
</if>
</if>
<iftest="dto.companyName != null and dto.companyName != ''">
<iftest="dto.companyName != null and dto.companyName != ''">
and use_unit_name like CONCAT('%', #{dto.companyName}, '%')
and use_unit_name like CONCAT('%', #{dto.companyName}, '%')
...
@@ -1757,15 +1777,16 @@
...
@@ -1757,15 +1777,16 @@
<iftest="dto.superviseUnitName != null and dto.superviseUnitName != ''">
<iftest="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 != '使用单位已撤回'
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 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 = '已完成'
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}, '%')
and audit_status != '使用单位待提交'
<iftest="dto.beginDate != null and dto.beginDate != ''">
<iftest="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}) or date_ge(CAST(a.create_date as date),#{dto.beginDate}))
</if>
</if>
<iftest="dto.endDate != null and dto.endDate != ''">
<iftest="dto.endDate != null and dto.endDate != ''">
and date_le(CAST(a.audit_pass_date as date),#{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}))
</if>
</if>
<iftest="dto.companyName != null and dto.companyName != ''">
<iftest="dto.companyName != null and dto.companyName != ''">
and use_unit_name like CONCAT('%', #{dto.companyName}, '%')
and use_unit_name like CONCAT('%', #{dto.companyName}, '%')
CONCAT ( T.city_name, T.county_name ) AS location,
T.install_unit_name AS constructionCompany,
T.use_unit_name AS useCompany,
T.use_unit_credit_code AS useUnitCode,
T.install_start_date AS constructionDate
FROM
tzs_jg_installation_notice T
WHERE
install_start_date >= #{time}
<iftest="dto.companyName != null and dto.companyName != ''">
AND (T.install_unit_name like CONCAT(#{dto.companyName},'%') or T.use_unit_name like CONCAT(#{dto.companyName},'%') or T.use_unit_credit_code like CONCAT(#{dto.companyName},'%'))
</if>
<iftest="dto.address != null and dto.address != ''">
AND (T.city_name like CONCAT(#{dto.address},'%') or T.county_name like CONCAT(#{dto.address},'%'))
</if>
AND T.receive_company_org_code LIKE CONCAT ( #{orgCode}, '%' ) UNION ALL
SELECT
CONCAT ( T.city_name, T.county_name ) AS location,
T.install_unit_name AS constructionCompany,
T.use_unit_name AS useCompany,
T.use_unit_credit_code AS useUnitCode,
T.plan_date AS constructionDate
FROM
tzs_jg_maintain_notice T
WHERE
plan_date >= #{time}
<iftest="dto.companyName != null and dto.companyName != ''">
AND (T.install_unit_name like CONCAT(#{dto.companyName},'%') or T.use_unit_name like CONCAT(#{dto.companyName},'%') or T.use_unit_credit_code like CONCAT(#{dto.companyName},'%'))
</if>
<iftest="dto.address != null and dto.address != ''">
AND (T.city_name like CONCAT(#{dto.address},'%') or T.county_name like CONCAT(#{dto.address},'%'))
</if>
AND T.receive_company_org_code LIKE CONCAT ( #{orgCode}, '%' ) UNION ALL
SELECT
CONCAT ( T.city_name, T.county_name ) AS location,
T.install_unit_name AS constructionCompany,
T.use_unit_name AS useCompany,
T.use_unit_credit_code AS useUnitCode,
T.plan_date AS constructionDate
FROM
tzs_jg_reform_notice T
WHERE
plan_date >= #{time}
<iftest="dto.companyName != null and dto.companyName != ''">
AND (T.install_unit_name like CONCAT(#{dto.companyName},'%') or T.use_unit_name like CONCAT(#{dto.companyName},'%') or T.use_unit_credit_code like CONCAT(#{dto.companyName},'%'))
</if>
<iftest="dto.address != null and dto.address != ''">
AND (T.city_name like CONCAT(#{dto.address},'%') or T.county_name like CONCAT(#{dto.address},'%'))
</if>
AND T.receive_company_org_code LIKE CONCAT ( #{orgCode}, '%' ) UNION ALL
SELECT
CONCAT ( T.city_name, T.county_name ) AS location,
T.install_unit_name AS constructionCompany,
T.use_unit_name AS useCompany,
T.use_unit_credit_code AS useUnitCode,
T.plan_date AS constructionDate
FROM
tzs_jg_transfer_notice T
WHERE
plan_date >= #{time}
<iftest="dto.companyName != null and dto.companyName != ''">
AND (T.install_unit_name like CONCAT(#{dto.companyName},'%') or T.use_unit_name like CONCAT(#{dto.companyName},'%') or T.use_unit_credit_code like CONCAT(#{dto.companyName},'%'))
</if>
<iftest="dto.address != null and dto.address != ''">
AND (T.city_name like CONCAT(#{dto.address},'%') or T.county_name like CONCAT(#{dto.address},'%'))
</if>
AND T.receive_company_org_code LIKE CONCAT ( #{orgCode}, '%' )) A
CONCAT ( T.city_name, T.county_name ) AS location,
T.install_unit_name AS constructionCompany,
T.use_unit_name AS useCompany,
T.use_unit_credit_code AS useUnitCode,
T.install_start_date AS constructionDate
FROM
tzs_jg_installation_notice T
WHERE
install_start_date >= #{time}
<iftest="dto.companyName != null and dto.companyName != ''">
AND (T.install_unit_name like CONCAT(#{dto.companyName},'%') or T.use_unit_name like CONCAT(#{dto.companyName},'%') or T.use_unit_credit_code like CONCAT(#{dto.companyName},'%'))
</if>
<iftest="dto.address != null and dto.address != ''">
AND (T.city_name like CONCAT(#{dto.address},'%') or T.county_name like CONCAT(#{dto.address},'%'))
</if>
AND T.receive_company_org_code LIKE CONCAT ( #{orgCode}, '%' )
CONCAT ( T.city_name, T.county_name ) AS location,
T.install_unit_name AS constructionCompany,
T.use_unit_name AS useCompany,
T.use_unit_credit_code AS useUnitCode,
T.plan_date AS constructionDate
FROM
tzs_jg_maintain_notice T
WHERE
plan_date >= #{time}
<iftest="dto.companyName != null and dto.companyName != ''">
AND (T.install_unit_name like CONCAT(#{dto.companyName},'%') or T.use_unit_name like CONCAT(#{dto.companyName},'%') or T.use_unit_credit_code like CONCAT(#{dto.companyName},'%'))
</if>
<iftest="dto.address != null and dto.address != ''">
AND (T.city_name like CONCAT(#{dto.address},'%') or T.county_name like CONCAT(#{dto.address},'%'))
</if>
AND T.receive_company_org_code LIKE CONCAT ( #{orgCode}, '%' )
CONCAT ( T.city_name, T.county_name ) AS location,
T.install_unit_name AS constructionCompany,
T.use_unit_name AS useCompany,
T.use_unit_credit_code AS useUnitCode,
T.plan_date AS constructionDate
FROM
tzs_jg_reform_notice T
WHERE
plan_date >= #{time}
<iftest="dto.companyName != null and dto.companyName != ''">
AND (T.install_unit_name like CONCAT(#{dto.companyName},'%') or T.use_unit_name like CONCAT(#{dto.companyName},'%') or T.use_unit_credit_code like CONCAT(#{dto.companyName},'%'))
</if>
<iftest="dto.address != null and dto.address != ''">
AND (T.city_name like CONCAT(#{dto.address},'%') or T.county_name like CONCAT(#{dto.address},'%'))
</if>
AND T.receive_company_org_code LIKE CONCAT ( #{orgCode}, '%' )
CONCAT ( T.city_name, T.county_name ) AS location,
T.install_unit_name AS constructionCompany,
T.use_unit_name AS useCompany,
T.use_unit_credit_code AS useUnitCode,
T.plan_date AS constructionDate
FROM
tzs_jg_transfer_notice T
WHERE
plan_date >= #{time}
<iftest="dto.companyName != null and dto.companyName != ''">
AND (T.install_unit_name like CONCAT(#{dto.companyName},'%') or T.use_unit_name like CONCAT(#{dto.companyName},'%') or T.use_unit_credit_code like CONCAT(#{dto.companyName},'%'))
</if>
<iftest="dto.address != null and dto.address != ''">
AND (T.city_name like CONCAT(#{dto.address},'%') or T.county_name like CONCAT(#{dto.address},'%'))
</if>
AND T.receive_company_org_code LIKE CONCAT ( #{orgCode}, '%' )
and ((supervise_org_code != '50' and supervise_org_code LIKE CONCAT (#{orgCode}, '%')) or (supervise_org_code = '50' and office_region LIKE CONCAT ('%', #{cityCode}, '%')))
and ((supervise_org_code != '50' and supervise_org_code LIKE CONCAT (#{orgCode}, '%')) or (supervise_org_code = '50' and office_region LIKE CONCAT ('%', #{cityCode}, '%')))