<?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.InspectionHistoryMapper">
    
    <resultMap type="com.tuoheng.admin.entity.domain.InspectionHistory" id="InspectionHistoryResult">
        <result property="id"    column="id"    />
        <result property="tenantId"    column="tenant_id"    />
        <result property="inspectionId"    column="inspection_id"    />
        <result property="historyName"    column="history_name"    />
        <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="selectThInspectionHistoryVo">
        select id, tenant_id, inspection_id, history_name, create_user, create_time, update_user, update_time, mark from th_inspection_history
    </sql>

    <update id="deleteLogicByMap" parameterType="hashmap">
        update th_inspection_history
        <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="inspectionId != null and inspectionId != ''"> inspection_id = #{inspectionId} </if>
        </where>
    </update>

    <delete id="deleteByInspectionId" parameterType="String">
        delete from th_inspection_history where inspection_id = #{id}
    </delete>

</mapper>