<?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.bootdo.datas.dao.GyDataDao">

    <sql id="selectSql">
        b.ID as id,
        a.REPORTER_UNIT as reporterUnit,
        a.STATUS as status,
        a.CREDIT_CODE as creditCode,
        a.UNIT_CHARACTER as unitCharacter,
        a.INDUSTRY_TYPE_ONE as industryTypeOne,
        a.INDUSTRY_TYPE_TWO as industryTypeTwo,
        a.UNIT_PROVINCE as unitProvince,
        a.UNIT_CITY as unitCity,
        a.SUPERVISORY_ORG as supervisoryOrg,
        a.UNIT_MAN as unitMan,
        a.UNIT_OFFICE as unitOffice,
        a.DATA_SECURITY_MAN as dataSecurityMan,
        a.DATA_SECURITY_OFFICE as dataSecurityOffice,
        a.DATA_SECURITY_WAY as dataSecurityWay,
        b.DATA_NAME as dataName,
        b.DATA_TYPE_BASE as dataTypeBase,
        b.DATA_TYPE_ROOT as dataTypeROOT,
        b.DATA_TYPE_ONE as dataTypeOne,
        b.DATA_TYPE_TWO as dataTypeTwo,
        b.DATA_TYPE_THREE as dataTypeThree,
        b.DATA_TYPE_FOUR as dataTypeFour,
        b.DATA_LEVEL as dataLevel,
        b.DATA_CARRIER as dataCarrier,
        b.DATA_SOURCE as dataSource,
        b.DATA_NUM as dataNum,
        b.DATA_NUM_GB as dataNumGb,
        b.DATA_SCOPE as dataScope,
        b.DATA_PROPORTION as dataProportion,
        b.DATA_PRECISION as dataPrecision,
        b.DATA_PRECISION_DES as dataPrecisionDes,
        b.DATA_HANDLE_TYPE as dataHandleType,
        b.DATA_RESULT as dataResult,
        b.IS_ALGORITHM_HANDLE as isAlgorithmHandle,
        b.IS_CROSS as isCross,
        b.CROSS_ACCEPT_NAME as crossAcceptName,
        b.DATA_CROSS_RESULT as dataCrossResult,
        b.DATA_CROSS_TYPE as dataCrossType,
        b.IS_SECURITY_ASS as isSecurityAss,
        b.ASSESS_RESULT as assessResult,
        b.IS_CROSS_MAIN as isCrossMain,
        b.CROSSMAIN_ACCEPT_NAME as crossmainAcceptName,
        b.DATA_CROSSMAIN_RESULT as dataCrossmainResult,
        b.DATA_CROSSMAIN_TYPE as dataCrossmainType,
        b.IS_CROSSMAIN_FLOW as isCrossmainFlow,
        b.IS_FOREIGN_DATA as isForeignData,
        b.INFO_SYSTEM_NAME as infoSystemName,
        b.INFO_SYSTEM_TYPE as infoSystemType,
        b.INFO_SYSTEM_IPADDRESS as infoSystemIpAddress,
        b.INFO_SYSTEM_DOMAINNAME as infoSystemDomainName,
        b.SECURITY_COGNIZANCE as securityCognizance,
        b.COM_SECURITY_COGNIZANCE as comSecurityCognizance,
        b.IS_KET_SYSTEM as isKetSystem,
        b.IS_KEYDATA_ASS as isKeydataAss,
        b.ASSESS_ORG as assessOrg,
        b.ASSESS_BASE as assessBase,
        b.ASSESS_TIME as assessTime,
        b.DATA_ASSESS_RESULT as dataAssessResult,
        b.DATA_STATUS as dataStatus,
        b.UPLOAD_TIME as uploadTime,
        b.UPDATE_TIME as updateTime,
        b.GY_NUIT_ID as gyUnitId,
        b.ROLE_ID as roleId,
        b.next_verify_dept as nextVerifyDept,
        b.SEND_VERIFY as sendVerify,
        b.DELETE_STATUS as deleteStatus,
        b.DATA_DESC as dataDesc
    </sql>
    <select id="get" resultType="com.bootdo.datas.dto.GyDataImportDTO">
        select
            <include refid="selectSql"/>
        FROM gy_unit a,gy_data b
        where b.ID = #{value} and
        a.CREDIT_CODE = b.GY_NUIT_ID
        AND a.STATUS = '0'
    </select>
    <select id="getRecoverUnit" resultType="com.bootdo.datas.dto.GyDataImportDTO">
        select
        <include refid="selectSql"/>
        FROM gy_unit a,gy_data b
        where b.ID = #{value} and
        a.CREDIT_CODE = b.GY_NUIT_ID
    </select>

    <select id="getDataExcel" resultType="com.bootdo.datas.domain.GyDataExcelDO">
        select
        <include refid="selectSql"/>
        FROM gy_unit a,gy_data b
        where b.ID = #{value} and
        a.CREDIT_CODE = b.GY_NUIT_ID
        AND a.STATUS = '0'
    </select>

    <select id="getGbDataExcel" resultType="com.bootdo.datas.domain.GbDataExcelDO">
        select
        <include refid="selectSql"/>
        FROM gy_unit a,gy_data b
        where b.ID = #{value} and
        a.CREDIT_CODE = b.GY_NUIT_ID
        AND a.STATUS = '0'
    </select>

    <select id="count" resultType="int">
        select count(*)
        FROM gy_unit a,gy_data b
        where
            a.CREDIT_CODE = b.GY_NUIT_ID
            and b.DELETE_STATUS = '0'
            AND a.STATUS = '0'
            AND b.DATA_STATUS != '4'
            and b.GY_NUIT_ID = #{gyUnitId}
            and b.DATA_NAME = #{dataName}
    </select>

    <select id="getGyDataDO" resultType="com.bootdo.datas.domain.GyDataDO">
        SELECT
        <include refid="selectSql"/>
        FROM gy_unit a,gy_data b
        where
        a.CREDIT_CODE = b.GY_NUIT_ID
        and b.DELETE_STATUS = '0'
        AND a.STATUS = '0'
        AND b.DATA_STATUS != '4'
        <if test="dataName != null and dataName != ''">and b.DATA_NAME = #{dataName}</if>
        <if test="gyUnitId != null and gyUnitId != ''">and b.GY_NUIT_ID = #{gyUnitId}</if>
        <if test="roleId != null and roleId != ''">and b.role_id = #{roleId}</if>
    </select>

    <select id="list" resultType="com.bootdo.datas.dto.GyDataImportDTO">
        SELECT
            <include refid="selectSql"/>
        FROM gy_unit a,gy_data b
        <where>
            a.CREDIT_CODE = b.GY_NUIT_ID
            AND b.DELETE_STATUS = '0'
            AND b.DATA_STATUS != '4'
            AND a.STATUS = '0'
            <if test="industryTypeOne != null and industryTypeOne != ''">and a.INDUSTRY_TYPE_ONE like CONCAT('%',#{industryTypeOne},'%')</if>
            <if test="dataName != null and dataName != ''">and b.DATA_NAME like CONCAT('%',#{dataName},'%')</if>
            <if test="dataLevel != null and dataLevel != ''">and b.DATA_LEVEL = #{dataLevel}</if>
            <if test="reporterUnit != null and reporterUnit != ''">and a.REPORTER_UNIT like
                CONCAT('%',#{reporterUnit},'%')
            </if>
            <if test="nextVerifyDept != null and nextVerifyDept != ''">and a.next_verify_dept  = #{nextVerifyDept}</if>
            <if test="unitCity != null and unitCity != ''">and a.UNIT_CITY = #{unitCity}</if>
<!--            <if test="unitProvince != null and unitProvince != ''">and a.UNIT_PROVINCE = #{unitProvince}</if>-->
            <if test="creditCode != null and creditCode != ''">and a.CREDIT_CODE = #{creditCode}</if>
            <if test="gyUnitId != null and gyUnitId != ''">and b.GY_NUIT_ID = #{gyUnitId}</if>
<!--            <if test="roleId != null and roleId != ''">and b.role_id = #{roleId}</if>-->
            <choose>
                <when test="unitProvince != null and unitProvince.trim() != '' and roleId != null and roleId.trim() != ''">
                    and (a.UNIT_PROVINCE = #{unitProvince} or b.role_id = #{roleId})
                </when>
                <when test="unitProvince != null and unitProvince.trim() != ''">
                    and a.UNIT_PROVINCE = #{unitProvince}
                </when>
                <when test="roleId != null and roleId.trim() != ''">
                    and b.role_id = #{roleId}
                </when>
            </choose>

            <if test="dataStatus != null and dataStatus != ''">and b.DATA_STATUS = #{dataStatus}</if>
            <if test="sendVerify != null and sendVerify != ''">
                and b.SEND_VERIFY = #{sendVerify}
<!--                <if test="sendVerify == 0">-->
<!--                    and b.SEND_VERIFY = '0'-->
<!--                </if>-->
<!--                <if test="sendVerify == 1">-->
<!--                    and b.SEND_VERIFY IN('1','2')-->
<!--                </if>-->
<!--                <if test="sendVerify == 2">-->
<!--                    and b.SEND_VERIFY = '2'-->
<!--                </if>-->
            </if>
        </where>
        <choose>
            <when test="sort != null and sort.trim() != ''">
                order by ${sort} ${order}
            </when>
            <otherwise>
                order by ID desc
            </otherwise>
        </choose>
        <if test="offset != null and limit != null">
            limit #{offset}, #{limit}
        </if>
    </select>

    <select id="examineList" resultType="com.bootdo.datas.dto.GyDataImportDTO">
        SELECT
        <include refid="selectSql"/>
        FROM gy_unit a,gy_data b
        <where>
            a.CREDIT_CODE = b.GY_NUIT_ID
            AND b.DELETE_STATUS = '0'
            AND a.STATUS = '0'
            <if test="industryTypeOne != null and industryTypeOne != ''">and a.INDUSTRY_TYPE_ONE like CONCAT('%',#{industryTypeOne},'%')</if>
            <if test="dataName != null and dataName != ''">and b.DATA_NAME like CONCAT('%',#{dataName},'%')</if>
            <if test="dataLevel != null and dataLevel != ''">and b.DATA_LEVEL = #{dataLevel}</if>
            <if test="reporterUnit != null and reporterUnit != ''">and a.REPORTER_UNIT like
                CONCAT('%',#{reporterUnit},'%')
            </if>
            <if test="nextVerifyDept != null and nextVerifyDept != ''">and a.next_verify_dept  = #{nextVerifyDept}</if>
            <if test="unitCity != null and unitCity != ''">and a.UNIT_CITY = #{unitCity}</if>
            <!--            <if test="unitProvince != null and unitProvince != ''">and a.UNIT_PROVINCE = #{unitProvince}</if>-->
            <if test="creditCode != null and creditCode != ''">and a.CREDIT_CODE = #{creditCode}</if>
            <if test="gyUnitId != null and gyUnitId != ''">and b.GY_NUIT_ID = #{gyUnitId}</if>
            <!--            <if test="roleId != null and roleId != ''">and b.role_id = #{roleId}</if>-->
            <choose>
                <when test="unitProvince != null and unitProvince.trim() != '' and roleId != null and roleId.trim() != ''">
                    and (a.UNIT_PROVINCE = #{unitProvince} or b.role_id = #{roleId})
                </when>
                <when test="unitProvince != null and unitProvince.trim() != ''">
                    and a.UNIT_PROVINCE = #{unitProvince}
                </when>
                <when test="roleId != null and roleId.trim() != ''">
                    and b.role_id = #{roleId}
                </when>
            </choose>


            <if test="dataStatusArrs != null and dataStatusArrs.size > 0">and b.DATA_STATUS in
                <foreach item="id" collection="dataStatusArrs" open="(" separator="," close=")">
                    #{id}
                </foreach>
            </if>

            <if test="sendVerify != null and sendVerify != ''">
                and b.SEND_VERIFY = #{sendVerify}
                <!--                <if test="sendVerify == 0">-->
                <!--                    and b.SEND_VERIFY = '0'-->
                <!--                </if>-->
                <!--                <if test="sendVerify == 1">-->
                <!--                    and b.SEND_VERIFY IN('1','2')-->
                <!--                </if>-->
                <!--                <if test="sendVerify == 2">-->
                <!--                    and b.SEND_VERIFY = '2'-->
                <!--                </if>-->
            </if>
        </where>
        <choose>
            <when test="sort != null and sort.trim() != ''">
                order by ${sort} ${order}
            </when>
            <otherwise>
                order by ID desc
            </otherwise>
        </choose>
        <if test="offset != null and limit != null">
            limit #{offset}, #{limit}
        </if>
    </select>

    <select id="listId" resultType="com.bootdo.datas.dto.GyDataImportDTO">
        SELECT
            b.ID as id
        FROM gy_unit a,gy_data b
        <where>
            a.CREDIT_CODE = b.GY_NUIT_ID
            AND b.DELETE_STATUS = '0'
            and b.DATA_NAME = #{dataName}
            and b.GY_NUIT_ID = #{gyUnitId}
        </where>
    </select>

    <select id="countTotal" resultType="int">
        SELECT
            count(*)
        FROM gy_unit a,gy_data b
        <where>
            a.CREDIT_CODE = b.GY_NUIT_ID
            AND b.DELETE_STATUS = '0'
            AND b.DATA_STATUS != '4'
            AND a.STATUS = '0'
            <if test="industryTypeOne != null and industryTypeOne != ''">and a.INDUSTRY_TYPE_ONE like CONCAT('%',#{industryTypeOne},'%')</if>
            <if test="dataName != null and dataName != ''">and b.DATA_NAME like CONCAT('%',#{dataName},'%')</if>
            <if test="dataLevel != null and dataLevel != ''">and b.DATA_LEVEL = #{dataLevel}</if>
            <if test="reporterUnit != null and reporterUnit != ''">and a.REPORTER_UNIT like
                CONCAT('%',#{reporterUnit},'%')
            </if>
            <if test="nextVerifyDept != null and nextVerifyDept != ''">and a.next_verify_dept  = #{nextVerifyDept}</if>
            <if test="unitCity != null and unitCity != ''">and a.UNIT_CITY = #{unitCity}</if>
<!--            <if test="unitProvince != null and unitProvince != ''">and a.UNIT_PROVINCE = #{unitProvince}</if>-->
            <if test="creditCode != null and creditCode != ''">and a.CREDIT_CODE = #{creditCode}</if>
            <if test="gyUnitId != null and gyUnitId != ''">and b.GY_NUIT_ID = #{gyUnitId}</if>
<!--            <if test="roleId != null and roleId != ''">and b.role_id = #{roleId}</if>-->
            <choose>
                <when test="unitProvince != null and unitProvince.trim() != '' and roleId != null and roleId.trim() != ''">
                    and (a.UNIT_PROVINCE = #{unitProvince} and b.role_id = #{roleId})
                </when>
                <when test="unitProvince != null and unitProvince.trim() != ''">
                    and a.UNIT_PROVINCE = #{unitProvince}
                </when>
                <when test="roleId != null and roleId.trim() != ''">
                    and b.role_id = #{roleId}
                </when>
            </choose>
            <if test="dataStatus != null and dataStatus != ''">and b.DATA_STATUS = #{dataStatus}</if>
            <if test="sendVerify != null and sendVerify != ''">
                and b.SEND_VERIFY = #{sendVerify}
                <!--                <if test="sendVerify == 0">-->
                <!--                    and b.SEND_VERIFY = '0'-->
                <!--                </if>-->
                <!--                <if test="sendVerify == 1">-->
                <!--                    and b.SEND_VERIFY IN('1','2')-->
                <!--                </if>-->
                <!--                <if test="sendVerify == 2">-->
                <!--                    and b.SEND_VERIFY = '2'-->
                <!--                </if>-->
            </if>
        </where>
    </select>

    <select id="listRecover" resultType="com.bootdo.datas.dto.GyDataImportDTO">
        SELECT
        <include refid="selectSql"/>
        FROM gy_unit a,gy_data b
        <where>
            a.CREDIT_CODE = b.GY_NUIT_ID
            AND (b.DELETE_STATUS = '1'
            or b.DATA_STATUS = '4')
            AND DATE_SUB(CURDATE(), INTERVAL 30 DAY) &lt;= date(b.UPDATE_TIME)
            <if test="industryTypeOne != null and industryTypeOne != ''">and a.INDUSTRY_TYPE_ONE = #{industryTypeOne}</if>
            <if test="dataName != null and dataName != ''">and b.DATA_NAME like CONCAT('%',#{dataName},'%')</if>
            <if test="dataLevel != null and dataLevel != ''">and b.DATA_LEVEL = #{dataLevel}</if>
            <if test="reporterUnit != null and reporterUnit != ''">and a.REPORTER_UNIT like
                CONCAT('%',#{reporterUnit},'%')
            </if>
            <if test="nextVerifyDept != null and nextVerifyDept != ''">and b.next_verify_dept  = #{nextVerifyDept}</if>
            <if test="unitCity != null and unitCity != ''">and (a.UNIT_CITY = #{unitCity})</if>
            <if test="roleId != null and roleId != ''">and b.role_id = #{roleId}</if>
            <if test="sendVerify != null and sendVerify != ''">
                <if test="sendVerify == 0">
                    and b.SEND_VERIFY = '0'
                </if>
                <if test="sendVerify == 1">
                    and b.SEND_VERIFY IN('1','2')
                </if>
                <if test="sendVerify == 2">
                    and b.SEND_VERIFY = '2'
                </if>
            </if>
        </where>
        <choose>
            <when test="sort != null and sort.trim() != ''">
                order by ${sort} ${order}
            </when>
            <otherwise>
                order by ID desc
            </otherwise>
        </choose>
        <if test="offset != null and limit != null">
            limit #{offset}, #{limit}
        </if>
    </select>

    <select id="countRecover" resultType="int">
        SELECT
        count(*)
        FROM gy_unit a,gy_data b
        <where>
            a.CREDIT_CODE = b.GY_NUIT_ID
            AND (b.DELETE_STATUS = '1'
            or b.DATA_STATUS = '4')
            AND DATE_SUB(CURDATE(), INTERVAL 30 DAY) &lt;= date(b.UPDATE_TIME)
            <if test="industryTypeOne != null and industryTypeOne != ''">and a.INDUSTRY_TYPE_ONE = #{industryTypeOne}</if>
            <if test="dataName != null and dataName != ''">and b.DATA_NAME like CONCAT('%',#{dataName},'%')</if>
            <if test="dataLevel != null and dataLevel != ''">and b.DATA_LEVEL = #{dataLevel}</if>
            <if test="reporterUnit != null and reporterUnit != ''">and a.REPORTER_UNIT like
                CONCAT('%',#{reporterUnit},'%')
            </if>
            <if test="nextVerifyDept != null and nextVerifyDept != ''">and b.next_verify_dept  = #{nextVerifyDept}</if>
            <if test="unitCity != null and unitCity != ''">and (a.UNIT_CITY = #{unitCity})</if>
            <if test="roleId != null and roleId != ''">and b.role_id = #{roleId}</if>
            <if test="sendVerify != null and sendVerify != ''">
                <if test="sendVerify == 0">
                    and b.SEND_VERIFY = '0'
                </if>
                <if test="sendVerify == 1">
                    and b.SEND_VERIFY IN('1','2')
                </if>
                <if test="sendVerify == 2">
                    and b.SEND_VERIFY = '2'
                </if>
            </if>
        </where>
    </select>

    <insert id="batchSave">
        insert into gy_data
        (
            DATA_NAME,
            DATA_TYPE_BASE,
            DATA_TYPE_ONE,
            DATA_TYPE_TWO,
            DATA_TYPE_THREE,
            DATA_TYPE_FOUR,
            DATA_LEVEL,
            DATA_CARRIER,
            DATA_SOURCE,
            DATA_NUM,
            DATA_NUM_GB,
            DATA_SCOPE,
            DATA_PROPORTION,
            DATA_PRECISION,
            DATA_PRECISION_DES,
            DATA_HANDLE_TYPE,
            DATA_RESULT,
            IS_ALGORITHM_HANDLE,
            IS_CROSS,
            CROSS_ACCEPT_NAME,
            DATA_CROSS_RESULT,
            DATA_CROSS_TYPE,
            IS_SECURITY_ASS,
            ASSESS_RESULT,
            IS_CROSS_MAIN,
            CROSSMAIN_ACCEPT_NAME,
            DATA_CROSSMAIN_RESULT,
            DATA_CROSSMAIN_TYPE,
            IS_CROSSMAIN_FLOW,
            IS_FOREIGN_DATA,
            INFO_SYSTEM_NAME,
            INFO_SYSTEM_TYPE,
            INFO_SYSTEM_IPADDRESS,
            INFO_SYSTEM_DOMAINNAME,
            SECURITY_COGNIZANCE,
            COM_SECURITY_COGNIZANCE,
            IS_KET_SYSTEM,
            IS_KEYDATA_ASS,
            ASSESS_ORG,
            ASSESS_BASE,
            ASSESS_TIME,
            DATA_ASSESS_RESULT,
            DATA_STATUS,
            UPLOAD_TIME,
            UPDATE_TIME,
            GY_NUIT_ID,
            ROLE_ID,
            next_verify_dept,
            SEND_VERIFY,
            DELETE_STATUS,
            DATA_DESC
        )
        values
        <foreach item="item" index="index" collection="list"
                 separator=",">
            (
            #{item.dataName},
            #{item.dataTypeBase},
            #{item.dataTypeOne},
            #{item.dataTypeTwo},
            #{item.dataTypeThree},
            #{item.dataTypeFour},
            #{item.dataLevel},
            #{item.dataCarrier},
            #{item.dataSource},
            #{item.dataNum},
            #{item.dataNumGb},
            #{item.dataScope},
            #{item.dataProportion},
            #{item.dataPrecision},
            #{item.dataPrecisionDes},
            #{item.dataHandleType},
            #{item.dataResult},
            #{item.isAlgorithmHandle},
            #{item.isCross},
            #{item.crossAcceptName},
            #{item.dataCrossResult},
            #{item.dataCrossType},
            #{item.isSecurityAss},
            #{item.assessResult},
            #{item.isCrossMain},
            #{item.crossmainAcceptName},
            #{item.dataCrossmainResult},
            #{item.dataCrossmainType},
            #{item.isCrossmainFlow},
            #{item.isForeignData},
            #{item.infoSystemName},
            #{item.infoSystemType},
            #{item.infoSystemIpAddress},
            #{item.infoSystemDomainName},
            #{item.securityCognizance},
            #{item.comSecurityCognizance},
            #{item.isKetSystem},
            #{item.isKeydataAss},
            #{item.assessOrg},
            #{item.assessBase},
            #{item.assessTime},
            #{item.dataAssessResult},
            #{item.dataStatus},
            #{item.uploadTime},
            #{item.updateTime},
            #{item.gyUnitId},
            #{item.roleId},
            #{item.nextVerifyDept},
            #{item.sendVerify},
            #{item.deleteStatus},
            #{item.dataDesc}
            )
        </foreach>

    </insert>

    <insert id="save" parameterType="com.bootdo.datas.domain.DataDO" useGeneratedKeys="true" keyProperty="id">
        insert into tf_data
        (`DATA_SOURCE`,
         `DATA_NAME`,
         `DATA_LEVEL`,
         `DATA_TYPE`,
         `DATA_SUB`,
         `DATA_ADJ_SUB`,
         `DATA_SCOPE`,
         `DATA_RESULT`,
         `DATA_LOCATION`,
         `DATA_RANGE`,
         `DATA_RULER`,
         `SHARE_RANGE`,
         `CROSS_RANGE`,
         `DATA_SAFETY`,
         `DATA_DESC`,
         `DATA_STATUS`,
         `UPLOAD_USER`,
         `UPLOAD_USERID`,
         `UPLOAD_TIME`,
         `UPDATE_TIME`,
         `LIAISE_MAN`,
         `LIAISE_WAY`,
         `dept_id`,
         `next_verify_dept`,
         `REPORTER_UNIT`,
         `UNIT_PROVINCE`,
         `UNIT_CITY`,
         `UNIT_OTHER`,
         `DATA_INDUSTRY`,
         `INDUSTRY_TYPE`,
         `SEND_VERIFY`,
         `DATA_MANAGER`,
         `DATA_PRECISION`
        )
        values (#{dataSource},
                #{dataName},
                #{dataLevel},
                #{dataType},
                #{dataSub},
                #{dataAdjSub},
                #{dataScope},
                #{dataResult},
                #{dataLocation},
                #{dataRange},
                #{dataRuler},
                #{shareRange},
                #{crossRange},
                #{dataSafety},
                #{dataDesc},
                #{dataStatus},
                #{uploadUser},
                #{uploadUserid},
                now(),
                #{updateTime},
                #{liaiseMan},
                #{liaiseWay},
                #{deptId},
                #{nextVerifyDept},
                #{reporterUnit},
                #{unitProvince},
                #{unitCity},
                #{unitOther},
                #{dataIndustry},
                #{industryType},
                #{item.sendVerify},
                #{item.dataManager},
                #{item.dataPrecision})
    </insert>

    <update id="recover">
        UPDATE gy_data
        SET DELETE_STATUS = 0,
            DATA_STATUS = 0,
            SEND_VERIFY = 0,
            UPDATE_TIME = NOW()
        WHERE
            ID = #{value}
    </update>

    <update id="updateStatus" parameterType="com.bootdo.datas.dto.GyDataImportDTO">
        update gy_data
        <set>
            <if test="dataStatus != null">DATA_STATUS = #{dataStatus},</if>
            <if test="sendVerify != null">SEND_VERIFY = #{sendVerify},</if>
            <if test="nextVerifyDept != null">NEXT_VERIFY_DEPT = #{nextVerifyDept},</if>
            <if test="roleId != null">ROLE_ID = #{roleId},</if>
            UPDATE_TIME = NOW()
        </set>
        where ID = #{id}
    </update>

    <update id="batchRemove">
        UPDATE gy_data
        SET DELETE_STATUS = 1,
        UPDATE_TIME = NOW()
        WHERE ID IN
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </update>

    <update id="remove">
        UPDATE gy_data
        SET DELETE_STATUS = 1,
            UPDATE_TIME = NOW()
        WHERE
            ID = #{value}
    </update>

    <delete id="batchPhysicalDeletion">
        DELETE FROM gy_data
        WHERE ID IN
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>