<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zcloud.mapper.dsno1.corp.AllWorkItemMapper">

	<!-- 删除有限空间审批单（pro端，公司试用结束时使用） -->
	<delete id="deleteProLimitspace" parameterType="pd">
		UPDATE
			BUS_LIMITSPACEAPPROVE
		SET
			ISDELETE = '1'
		WHERE
			CORPINFO_ID = #{CORPINFO_ID}
			AND ISDELETE ='0'
	</delete>

	<!-- 删除有限空间审批单记录（yjb端，公司试用结束时使用） -->
	<delete id="deleteYjbConLog" parameterType="pd">
		DELETE FROM
			BUS_CONFINEDSPACEWORKCHECKLOG
		WHERE
			CONFINEDSPACEWORKCHECK_ID IN (
			SELECT
				CONFINEDSPACEWORKCHECK_ID
			FROM
				BUS_CONFINEDSPACEWORKCHECK
			WHERE
				CORPINFO_ID = #{CORPINFO_ID}
				AND ISDELETE = '0'
			)

	</delete>

	<!-- 删除有限空间审批单安全措施（yjb端，公司试用结束时使用） -->
	<update id="deleteYjbConMeth" parameterType="pd">
		UPDATE
			BUS_CONFINEDSPACEWORKSAFETYMETHODRECORD
		SET
			ISDELETE = '1'
		WHERE
			CORPINFO_ID = #{CORPINFO_ID}
			AND ISDELETE = '0'
	</update>

	<!-- 删除有限空间审批单审核记录（yjb端，公司试用结束时使用） -->
	<update id="deleteYjbConAudit" parameterType="pd">
		UPDATE
			BUS_CONFINEDSPACEWORKAUDITRECORD
		SET
			ISDELETE = '1'
		WHERE
			CORPINFO_ID = #{CORPINFO_ID}
			AND ISDELETE = '0'
	</update>

	<!-- 删除有限空间审批单审核记录（yjb端，公司试用结束时使用） -->
	<update id="deleteYjbConGas" parameterType="pd">
		UPDATE
			BUS_CONFINEDSPACEWORKGASRECORD
		SET
			ISDELETE = '1'
		WHERE
			CORPINFO_ID = #{CORPINFO_ID}
			AND ISDELETE = '0'
	</update>

	<!-- 删除有限空间审批单（yjb端，公司试用结束时使用） -->
	<update id="deleteYjbCon" parameterType="pd">
		UPDATE
			BUS_CONFINEDSPACEWORKCHECK
		SET
			ISDELETE = '1'
		WHERE
			CORPINFO_ID = #{CORPINFO_ID}
			AND ISDELETE = '0'
	</update>

	<!-- 删除高空审批单记录（yjb端，公司试用结束时使用） -->
	<delete id="deleteYjbHighLog" parameterType="pd">
		DELETE FROM
			BUS_HIGHWORKCHECKLOG
		WHERE
			HIGHWORKCHECK_ID IN (
			SELECT
				HIGHWORKCHECK_ID
			FROM
				BUS_HIGHWORKCHECK
			WHERE
				CORPINFO_ID = #{CORPINFO_ID}
				AND ISDELETE = '0'
			)
	</delete>

	<!-- 删除高空审批单安全措施（yjb端，公司试用结束时使用） -->
	<update id="deleteYjbHighAudit" parameterType="pd">
		UPDATE
			BUS_HIGHWORKCHECKAUDITRECORD
		SET
			ISDELETE = '1'
		WHERE
			CORPINFO_ID = #{CORPINFO_ID}
			AND ISDELETE = '0'
	</update>

	<!-- 删除高空审批单安全措施（yjb端，公司试用结束时使用） -->
	<update id="deleteYjbHighApprove" parameterType="pd">
		UPDATE
			BUS_HIGHWORKCHECKAPPROVERECORD
		SET
			ISDELETE = '1'
		WHERE
			CORPINFO_ID = #{CORPINFO_ID}
			AND ISDELETE = '0'
	</update>

	<!-- 删除有限空间审批单安全措施（yjb端，公司试用结束时使用） -->
	<update id="deleteYjbHighCheck " parameterType="pd">
		UPDATE
			BUS_HIGHWORKCHECK
		SET
			ISDELETE = '1'
		WHERE
			CORPINFO_ID = #{CORPINFO_ID}
			AND ISDELETE = '0'
	</update>


	<!-- 删除高空审批单记录（yjb端，公司试用结束时使用） -->
	<delete id="deleteYjbHotLog" parameterType="pd">
		DELETE FROM
			bus_hotworkchecklog
		WHERE
			HOTWORKCHECK_ID IN (
			SELECT
				HOTWORKCHECK_ID
			FROM
				bus_hotworkcheck
			WHERE
				CORPINFO_ID = #{CORPINFO_ID}
				AND ISDELETE = '0'
			)
	</delete>

	<!-- 删除高空审批单安全措施（yjb端，公司试用结束时使用） -->
	<update id="deleteYjbHotAudit" parameterType="pd">
		UPDATE
			bus_hotworkcheckauditrecord
		SET
			ISDELETE = '1'
		WHERE
			CORPINFO_ID = #{CORPINFO_ID}
			AND ISDELETE = '0'
	</update>

	<!-- 删除高空审批单安全措施（yjb端，公司试用结束时使用） -->
	<update id="deleteYjbHotGas" parameterType="pd">
		UPDATE
			bus_hotworkgasrecord
		SET
			ISDELETE = '1'
		WHERE
			CORPINFO_ID = #{CORPINFO_ID}
			AND ISDELETE = '0'
	</update>

	<!-- 删除高空审批单安全措施（yjb端，公司试用结束时使用） -->
	<update id="deleteYjbHotMeth" parameterType="pd">
		UPDATE
			bus_hotworksafetymethodrecord
		SET
			ISDELETE = '1'
		WHERE
			CORPINFO_ID = #{CORPINFO_ID}
			AND ISDELETE = '0'
	</update>

	<!-- 删除有限空间审批单安全措施（yjb端，公司试用结束时使用） -->
	<update id="deleteYjbHotCheck " parameterType="pd">
		UPDATE
			bus_hotworkcheck
		SET
			ISDELETE = '1'
		WHERE
			CORPINFO_ID = #{CORPINFO_ID}
			AND ISDELETE = '0'
	</update>


	<!-- 删除高空审批单记录（yjb端，公司试用结束时使用） -->
	<delete id="deleteYjbBlindLog" parameterType="pd">
		DELETE FROM
			bus_blindplatechecklog
		WHERE
			BLINDPLATE_ID IN (
			SELECT
				BLINDPLATE_ID
			FROM
				bus_blindplate
			WHERE
				CORPINFO_ID = #{CORPINFO_ID}
				AND ISDELETE = '0'
			)
	</delete>

	<!-- 删除高空审批单安全措施（yjb端，公司试用结束时使用） -->
	<update id="deleteYjbBlindAudit" parameterType="pd">
		UPDATE
			bus_blindplatecheckauditrecord
		SET
			ISDELETE = '1'
		WHERE
			CORPINFO_ID = #{CORPINFO_ID}
			AND ISDELETE = '0'
	</update>

	<!-- 删除高空审批单安全措施（yjb端，公司试用结束时使用） -->
	<update id="deleteYjbBlindUnit" parameterType="pd">
		UPDATE
			bus_blindplatenotifyunit
		SET
			ISDELETE = '1'
		WHERE
			CORPINFO_ID = #{CORPINFO_ID}
			AND ISDELETE = '0'
	</update>

	<!-- 删除高空审批单安全措施（yjb端，公司试用结束时使用） -->
	<update id="deleteYjbBlindMeth" parameterType="pd">
		UPDATE
			bus_blindplatesafetymethodrecord
		SET
			ISDELETE = '1'
		WHERE
			CORPINFO_ID = #{CORPINFO_ID}
			AND ISDELETE = '0'
	</update>

	<!-- 删除有限空间审批单安全措施（yjb端，公司试用结束时使用） -->
	<update id="deleteYjbBlindCheck " parameterType="pd">
		UPDATE
			bus_blindplate
		SET
			ISDELETE = '1'
		WHERE
			CORPINFO_ID = #{CORPINFO_ID}
			AND ISDELETE = '0'
	</update>
</mapper>
