<?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.tofly.gpsboot.mapper.build.BulidclearMapper">

    <resultMap id="bulidclearMap" type="com.tofly.pojo.build.Bulidclear">
        <id property="id" column="ID"/>
        <result property="submitUser" column="SUBMIT_USER"/>
        <result property="auditResult" column="AUDIT_RESULT"/>
        <result property="auditTime" column="AUDIT_TIME"/>
        <result property="auditUser" column="AUDIT_USER"/>
        <result property="auditNotes" column="AUDIT_NOTES"/>
        <result property="buildId" column="BUILD_ID"/>
        <result property="notes" column="NOTES"/>
        <result property="clearFileids" column="CLEAR_FILEIDS"/>
        <result property="isread" column="ISREAD"/>
        <result property="isSubmit" column="IS_SUBMIT"/>
        <result property="submitTime" column="SUBMIT_TIME"/>
    </resultMap>

    <update id="clearBuildUserTaskPlan">
        update TF_XRTY_NEW_UDB.TF_YWPN_USERTASK_W
        set ishandle = '1'
        where table_id in(
            select PLAN_ID
            from TF_YWPN_BUILD_W t1 left join TF_YWPN_BUILDPLAN_W t2 on t1.id = t2.BUILD_ID
            where t1.id = #{buildId}
        )
          and tkty = '3'
          and tknm = '工地监护任务'
    </update>
</mapper>
