and (ibjpc.project_contraption_parent_id is null or ibjpc.project_contraption_parent_id = '')
AND EXISTS (
SELECT 1
FROM idx_biz_jg_use_info ui
WHERE ui."PROJECT_CONTRAPTION_ID" = ibjpc.sequence_nbr
AND (ui."EQU_STATE" is null or ui."EQU_STATE" <![CDATA[<>]]> '3' )
and (ibjpc.EQU_STATE <![CDATA[<>]]> '3' or ibjpc."EQU_STATE" is null)
and not exists
(
select 1 from tzs_jg_change_registration_reform a where (a.audit_status
<![CDATA[ <> ]]>
'使用单位待提交' and a.audit_status
<![CDATA[ <> ]]>
'一级受理已驳回' and a.audit_status
<![CDATA[ <> ]]>
'使用单位已撤回' and a.audit_status
<![CDATA[ <> ]]>
'已作废')
and a.use_unit_credit_code = #{dto.originalUseUnitCreditCode}
and a.project_contraption_id = ibjpc.sequence_nbr
UNION
select b.project_contraption_id from tzs_jg_change_registration_unit a, tzs_jg_change_registration_unit_eq b where a.sequence_nbr = b.unit_change_registration_id and ((a.status
<![CDATA[ <> ]]>
'使用单位待提交' and a.status
<![CDATA[ <> ]]>
'一级受理已驳回' and a.status
<![CDATA[ <> ]]>
'使用单位已撤回' and a.status
<![CDATA[ <> ]]>
'已作废')
or a.status = '已完成')
and a.use_unit_credit_code =#{dto.originalUseUnitCreditCode}
and b.project_contraption_id = ibjpc.sequence_nbr
UNION select project_contraption_id from tzs_jg_enable_disable a where (a.audit_status
<![CDATA[ <> ]]>
'已驳回' and a.audit_status
<![CDATA[ <> ]]>
'已撤回' and a.audit_status
<![CDATA[ <> ]]>
'待提交' and a.audit_status
<![CDATA[ <> ]]>
'已作废')
and a.use_unit_credit_code = #{dto.originalUseUnitCreditCode}
and a.project_contraption_id = ibjpc.sequence_nbr
UNION select project_contraption_id from tzs_jg_maintain_notice a where (a.notice_status
<![CDATA[ <> ]]>
'6614' and a.notice_status
<![CDATA[ <> ]]>
'6615' and a.notice_status
<![CDATA[ <> ]]>
'6610' and a.notice_status
<![CDATA[ <> ]]>
'6617')
and a.use_unit_credit_code = #{dto.originalUseUnitCreditCode}
and a.project_contraption_id = ibjpc.sequence_nbr
UNION select project_contraption_id from tzs_jg_reform_notice a where (a.notice_status
<![CDATA[ <> ]]>
'6614' and a.notice_status
<![CDATA[ <> ]]>
'6615' and a.notice_status
<![CDATA[ <> ]]>
'6610' and a.notice_status
<![CDATA[ <> ]]>
'6617')
and a.use_unit_credit_code = #{dto.originalUseUnitCreditCode}
and a.project_contraption_id = ibjpc.sequence_nbr
UNION
select project_contraption_id from tzs_jg_scrap_cancel a where (a.audit_status
<![CDATA[ <> ]]>
'使用单位已撤回' and a.audit_status
<![CDATA[ <> ]]>
'一级受理已驳回' and a.audit_status
<![CDATA[ <> ]]>
'使用单位待提交' and a.audit_status
<![CDATA[ <> ]]>
'已作废')
and a.use_unit_code = #{dto.originalUseUnitCreditCode}
and a.project_contraption_id = ibjpc.sequence_nbr
)
<iftest="dto.equList != null and dto.equList != ''">