Commit f1d203b0 authored by tianbo's avatar tianbo

Merge branch 'develop_tzs_bugfix' into develop_tzs_register_test

parents a4c6730f 8a9b12dc
...@@ -1282,7 +1282,7 @@ ...@@ -1282,7 +1282,7 @@
and date_ge(CAST(handle_date as date),#{dto.beginDate}) and date_ge(CAST(handle_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(handle_date as date),#{dto.endDate}) and date_le(CAST(handle_date as date),#{dto.endDate})
</if> </if>
<if test="dto.companyName != null and dto.companyName != ''"> <if test="dto.companyName != null and dto.companyName != ''">
and install_unit_name like CONCAT('%', #{dto.companyName}, '%') and install_unit_name like CONCAT('%', #{dto.companyName}, '%')
...@@ -1323,12 +1323,12 @@ ...@@ -1323,12 +1323,12 @@
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.status = '6616' 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 != ''"> <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>
...@@ -1365,38 +1365,38 @@ ...@@ -1365,38 +1365,38 @@
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,status,'sydj' as tplType,'sydj' as bType FROM "tzs_jg_use_registration" where receive_company_org_code like CONCAT(#{orgCode}, '%') and status = '已完成' and is_delete = 0 SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,'sydj' as tplType,'sydj' as bType, status FROM "tzs_jg_use_registration" where receive_company_org_code like CONCAT(#{orgCode}, '%') and status = '已完成' and is_delete = 0
<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}) 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}, '%')
</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,'sydj' as tplType,'vehicle' as bType 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,'sydj' as tplType,'vehicle' as bType, 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>
<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}) 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}, '%')
</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 * 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,'sydj' as tplType,'sydj' as bType FROM "tzs_jg_use_registration" where receive_company_org_code like CONCAT(#{orgCode}, '%') and status != '使用单位待提交' and status != '使用单位已撤回' and status != '已作废' and status != '已完成' and is_delete = 0 SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,'sydj' as tplType,'sydj' as bType, status FROM "tzs_jg_use_registration" where receive_company_org_code like CONCAT(#{orgCode}, '%') and status != '使用单位待提交' and status != '使用单位已撤回' and status != '已作废' and status != '已完成' and is_delete = 0
<if test="dto.beginDate != null and dto.beginDate != ''"> <if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(reg_date as date),#{dto.beginDate}) and date_ge(CAST(reg_date as date),#{dto.beginDate})
</if> </if>
...@@ -1410,7 +1410,7 @@ ...@@ -1410,7 +1410,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,'sydj' as tplType,'vehicle' as bType FROM "tzs_jg_vehicle_information" where org_branch_code like CONCAT(#{orgCode}, '%') and status != '使用单位待提交' and status != '使用单位已撤回' and status != '已作废' 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,'sydj' as tplType,'vehicle' as bType, 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 != ''"> <if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(reg_date as date),#{dto.beginDate}) and date_ge(CAST(reg_date as date),#{dto.beginDate})
</if> </if>
...@@ -1427,30 +1427,30 @@ ...@@ -1427,30 +1427,30 @@
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,
'dqjy' as tplType,'dqjy' as bType, 'dqjy' as tplType,'dqjy' as bType,
CASE when a.status = 0 then '已完成' CASE when a.status = 0 then '已完成'
ELSE '进行中' ELSE '进行中'
END as status 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.inspection_type = 'DQJY' and a.status = '6616' 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>
<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 != ''"> <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>
<if test="dto.superviseUnitName != null and dto.superviseUnitName != ''"> <if test="dto.superviseUnitName != null and dto.superviseUnitName != ''">
and inspection_unit_name like CONCAT('%', #{dto.superviseUnitName}, '%') and inspection_unit_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if> </if>
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,
...@@ -1480,79 +1480,79 @@ ...@@ -1480,79 +1480,79 @@
</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,a.audit_status as status,'bgdj' as tplType,'gm' as bType 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,'bgdj' as tplType,'gm' as bType, 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>
<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}) and date_le(CAST(a.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}, '%')
</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,audit_status as status,'bgdj' as tplType,'gz' as bType 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,'bgdj' as tplType,'gz' as bType, 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>
<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}) 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}, '%')
</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,audit_status as status,'bgdj' as tplType,'yz' as bType 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,'bgdj' as tplType,'yz' as bType, 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>
<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}) 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}, '%')
</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,'bgdj' as tplType,'dw' as bType 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,'bgdj' as tplType,'dw' as bType, 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>
<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}) 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}, '%')
</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,'bgdj' as tplType,'cyqp' as bType 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,'bgdj' as tplType,'cyqp' as bType, 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>
<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}) 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}, '%')
</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 * 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,'bgdj' as tplType,'gm' as bType 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 !='已完成' 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,'bgdj' as tplType,'gm' as bType, 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.apply_date as date),#{dto.beginDate}) and date_ge(CAST(a.apply_date as date),#{dto.beginDate})
</if> </if>
...@@ -1566,7 +1566,7 @@ ...@@ -1566,7 +1566,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,'bgdj' as tplType,'gz' as bType 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 sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,'bgdj' as tplType,'gz' as bType, 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 != ''"> <if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(reg_date as date),#{dto.beginDate}) and date_ge(CAST(reg_date as date),#{dto.beginDate})
</if> </if>
...@@ -1580,7 +1580,7 @@ ...@@ -1580,7 +1580,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,'bgdj' as tplType,'yz' as bType 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 sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,'bgdj' as tplType,'yz' as bType ,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 != ''"> <if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(reg_date as date),#{dto.beginDate}) and date_ge(CAST(reg_date as date),#{dto.beginDate})
</if> </if>
...@@ -1594,7 +1594,7 @@ ...@@ -1594,7 +1594,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,'bgdj' as tplType,'dw' as bType FROM "tzs_jg_change_registration_unit" where receive_company_org_code like CONCAT(#{orgCode}, '%') and status != '使用单位待提交' and status != '使用单位已撤回' and status != '已作废' 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,'bgdj' as tplType,'dw' as bType ,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 != ''"> <if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(apply_date as date),#{dto.beginDate}) and date_ge(CAST(apply_date as date),#{dto.beginDate})
</if> </if>
...@@ -1609,7 +1609,7 @@ ...@@ -1609,7 +1609,7 @@
</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,'bgdj' as tplType,'cyqp' as bType FROM "tzs_jg_change_vehicle_registration_unit" where org_branch_code like CONCAT(#{orgCode}, '%') and status != '使用单位待提交' and status != '使用单位已撤回' and status != '已作废' 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,'bgdj' as tplType,'cyqp' as bType ,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 != ''"> <if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(apply_date as date),#{dto.beginDate}) and date_ge(CAST(apply_date as date),#{dto.beginDate})
</if> </if>
...@@ -1625,21 +1625,21 @@ ...@@ -1625,21 +1625,21 @@
) )
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,'zxbf' as tplType,'zxbf' as bType 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,'zxbf' as tplType,'zxbf' as bType, 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>
<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}) and date_le(CAST(a.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}, '%')
</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 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,'zxbf' as tplType,'zxbf' as bType 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 != '已完成' 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,'zxbf' as tplType,'zxbf' as bType, 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.create_date as date),#{dto.beginDate}) and date_ge(CAST(a.create_date as date),#{dto.beginDate})
</if> </if>
......
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