Commit 329e44f5 authored by suhuiguang's avatar suhuiguang

1.变更按钮增加约束,做过后续业务移转变更、改造变更、更名变更、单位变更【使用单位未提交、已作废不包括统计内】后,不可编辑设备信息

parent 48e60d9b
......@@ -2447,4 +2447,63 @@
where record = #{record}
</if>
</update>
<select id="countBizNumAfterUseReg" resultType="java.lang.Integer">
select
sum(inUseNumber)
from (
select
count(1) as inUseNumber
from
tzs_jg_change_registration_reform a,
tzs_jg_change_registration_reform_eq b
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = #{record}
and (a.audit_status <![CDATA[ <> ]]> '使用单位待提交' and a.audit_status <![CDATA[ <> ]]> '已作废')
UNION all
select
count(1) as inUseNumber
from
tzs_jg_change_registration_transfer a,
tzs_jg_change_registration_transfer_eq b
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = #{record}
and (a.audit_status <![CDATA[ <> ]]> '使用单位待提交' and a.audit_status <![CDATA[ <> ]]> '已作废')
UNION all
select
count(1) as inUseNumber
from
tzs_jg_change_registration_unit a,
tzs_jg_change_registration_unit_eq b
where
a.sequence_nbr = b.unit_change_registration_id
and b.equ_id = #{record}
and (a.status <![CDATA[ <> ]]> '使用单位待提交' and a.status <![CDATA[ <> ]]> '已作废')
UNION all
select
count(1) as inUseNumber
from
tzs_jg_scrap_cancel a,
tzs_jg_scrap_cancel_eq b
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = #{record}
and (a.audit_status <![CDATA[ <> ]]> '使用单位待提交' and a.audit_status <![CDATA[ <> ]]> '已作废')
UNION all
select
count(1) as inUseNumber
from
(SELECT
json_array_elements(e.equip_info)->>'SEQUENCE_NBR' AS record
FROM
tzs_jg_change_registration_name_eq e,
tzs_jg_change_registration_name n
where
n.sequence_nbr = e.name_change_registration_id
and n.audit_status <![CDATA[ <> ]]> '使用单位待提交' and n.audit_status <![CDATA[ <> ]]> '已作废') ne
where
ne.record = #{record}
)
</select>
</mapper>
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