<?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.tuoheng.admin.mapper.InspectionFileHandleMapper">
    
    <resultMap type="com.tuoheng.admin.entity.InspectionFileHandle" id="InspectionFileHandleResult">
        <result property="id"    column="id"    />
        <result property="tenantId"    column="tenant_id"    />
        <result property="inspectionFileId"    column="inspection_file_id"    />
        <result property="handlerUser"    column="handler_user"    />
        <result property="handlerImage"    column="handler_image"    />
        <result property="handlerResult"    column="handler_result"    />
        <result property="handlerTime"    column="handler_time"    />
        <result property="createUser"    column="create_user"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateUser"    column="update_user"    />
        <result property="updateTime"    column="update_time"    />
        <result property="mark"    column="mark"    />
    </resultMap>

    <sql id="selectInspectionFileHandleVo">
        select id, tenant_id, inspection_file_id, handler_user, handler_image, handler_result, handler_time, create_user, create_time, update_user, update_time, mark from th_inspection_file_handle
    </sql>

    <update id="deleteLogicByMap" parameterType="hashmap">
        update th_inspection_file_handle
        <trim prefix="SET" suffixOverrides=",">
            <if test="updateUser != null and updateUser != ''"> update_user = #{updateUser}, </if>
            <if test="updateTime != null"> update_time = #{updateTime}, </if>
            <if test="mark != null"> mark = #{mark},</if>
        </trim>
        <where>
            <if test="inspectionFileId != null and inspectionId != ''">
                and inspection_file_id in
                <foreach collection="inspectionFileIdList" item="inspectionFileId" separator="," open="(" close=")">
                    #{inspectionFileId}
                </foreach>
            </if>
        </where>
    </update>

    <delete id="deleteByInspectionFileIdList" parameterType="list">
        delete from th_inspection_file_handle
        <where>
            <if test="list != null and list.size() > 0">
                and inspection_file_id in
                <foreach collection="list" item="inspectionFileId" separator="," open="(" close=")">
                    #{inspectionFileId}
                </foreach>
            </if>
        </where>
    </delete>

</mapper>