<?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.foreverwin.mesnac.common.mapper.InspectionTaskDetailMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.foreverwin.mesnac.common.model.InspectionTaskDetail">
        <id column="HANDLE" property="handle" />
        <result column="SITE" property="site" />
        <result column="TASK_BO" property="taskBo" />
        <result column="INSPECTION_ITEM_DETAIL_BO" property="inspectionItemDetailBo" />
        <result column="CHECK_VALUES" property="checkValues" />
        <result column="RESULT" property="result" />
        <result column="CHECK_DATE" property="checkDate" />
        <result column="CHECK_USER" property="checkUser" />
        <result column="REMARK" property="remark" />
        <result column="PICTURE_NO" property="pictureNo" />
        <result column="SFC" property="sfc" />
        <result column="PICTURE_QTY" property="pictureQty" />
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        HANDLE, SITE, TASK_BO, INSPECTION_ITEM_DETAIL_BO, CHECK_VALUES, RESULT, CHECK_DATE, CHECK_USER, REMARK, PICTURE_NO, SFC, PICTURE_QTY
    </sql>

    <!-- BaseMapper标准查询/修改/删除 -->
    <select id="selectById" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List"></include> FROM Z_INSPECTION_TASK_DETAIL WHERE HANDLE=#{handle}
    </select>

    <select id="selectByMap" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List"></include>
        FROM Z_INSPECTION_TASK_DETAIL
        <if test="cm!=null and !cm.isEmpty">
            <where>
                <foreach collection="cm.keys" item="k" separator="AND">
                    <if test="cm[k] != null">
                        ${k} = #{cm[${k}]}
                    </if>
                </foreach>
            </where>
        </if>
    </select>

    <select id="selectBatchIds" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List"></include>
        FROM Z_INSPECTION_TASK_DETAIL WHERE HANDLE IN (
        <foreach item="item" index="index" collection="coll" separator=",">#{item}
        </foreach>)
    </select>

    <select id="selectOne" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List"></include> FROM Z_INSPECTION_TASK_DETAIL
        <where>
            <if test="ew.entity.handle!=null">
              HANDLE=#{ew.handle}
            </if>
            <if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
            <if test="ew.entity.taskBo!=null"> AND TASK_BO=#{ew.entity.taskBo}</if>
            <if test="ew.entity.inspectionItemDetailBo!=null"> AND INSPECTION_ITEM_DETAIL_BO=#{ew.entity.inspectionItemDetailBo}</if>
            <if test="ew.entity.checkValues!=null"> AND CHECK_VALUES=#{ew.entity.checkValues}</if>
            <if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
            <if test="ew.entity.checkDate!=null"> AND CHECK_DATE=#{ew.entity.checkDate}</if>
            <if test="ew.entity.checkUser!=null"> AND CHECK_USER=#{ew.entity.checkUser}</if>
            <if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
            <if test="ew.entity.pictureNo!=null"> AND PICTURE_NO=#{ew.entity.pictureNo}</if>
            <if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
            <if test="ew.entity.pictureQty!=null"> AND PICTURE_QTY=#{ew.entity.pictureQty}</if>
        </where>
    </select>

    <select id="selectCount" resultType="Integer">
        SELECT COUNT(1) FROM Z_INSPECTION_TASK_DETAIL
        <where>
            <if test="ew!=null">
                <if test="ew.entity!=null">
                <if test="ew.entity.handle!=null">
                    HANDLE=#{ew.entity.handle}
                </if>
                <if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
                <if test="ew.entity.taskBo!=null"> AND TASK_BO=#{ew.entity.taskBo}</if>
                <if test="ew.entity.inspectionItemDetailBo!=null"> AND INSPECTION_ITEM_DETAIL_BO=#{ew.entity.inspectionItemDetailBo}</if>
                <if test="ew.entity.checkValues!=null"> AND CHECK_VALUES=#{ew.entity.checkValues}</if>
                <if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
                <if test="ew.entity.checkDate!=null"> AND CHECK_DATE=#{ew.entity.checkDate}</if>
                <if test="ew.entity.checkUser!=null"> AND CHECK_USER=#{ew.entity.checkUser}</if>
                <if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
                <if test="ew.entity.pictureNo!=null"> AND PICTURE_NO=#{ew.entity.pictureNo}</if>
                <if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
                <if test="ew.entity.pictureQty!=null"> AND PICTURE_QTY=#{ew.entity.pictureQty}</if>
                </if>
                <if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
                    ${ew.sqlSegment}
                </if>
            </if>
        </where>
        <if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
            ${ew.sqlSegment}
        </if>
    </select>

    <select id="selectList" resultMap="BaseResultMap">
        SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_INSPECTION_TASK_DETAIL
        <where>
            <if test="ew!=null">
                <if test="ew.entity!=null">
                    <if test="ew.entity.handle!=null">
                        HANDLE=#{ew.entity.handle}
                    </if>
                    <if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
                    <if test="ew.entity.taskBo!=null"> AND TASK_BO=#{ew.entity.taskBo}</if>
                    <if test="ew.entity.inspectionItemDetailBo!=null"> AND INSPECTION_ITEM_DETAIL_BO=#{ew.entity.inspectionItemDetailBo}</if>
                    <if test="ew.entity.checkValues!=null"> AND CHECK_VALUES=#{ew.entity.checkValues}</if>
                    <if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
                    <if test="ew.entity.checkDate!=null"> AND CHECK_DATE=#{ew.entity.checkDate}</if>
                    <if test="ew.entity.checkUser!=null"> AND CHECK_USER=#{ew.entity.checkUser}</if>
                    <if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
                    <if test="ew.entity.pictureNo!=null"> AND PICTURE_NO=#{ew.entity.pictureNo}</if>
                    <if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
                    <if test="ew.entity.pictureQty!=null"> AND PICTURE_QTY=#{ew.entity.pictureQty}</if>
                </if>
                <if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
                    ${ew.sqlSegment}
                </if>
            </if>
        </where>
        <if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
            ${ew.sqlSegment}
        </if>
    </select>

    <select id="selectMaps" resultType="HashMap">
        SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_INSPECTION_TASK_DETAIL
        <where>
            <if test="ew!=null">
                <if test="ew.entity!=null">
                    <if test="ew.entity.handle!=null">
                        HANDLE=#{ew.entity.handle}
                    </if>
                    <if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
                    <if test="ew.entity.taskBo!=null"> AND TASK_BO=#{ew.entity.taskBo}</if>
                    <if test="ew.entity.inspectionItemDetailBo!=null"> AND INSPECTION_ITEM_DETAIL_BO=#{ew.entity.inspectionItemDetailBo}</if>
                    <if test="ew.entity.checkValues!=null"> AND CHECK_VALUES=#{ew.entity.checkValues}</if>
                    <if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
                    <if test="ew.entity.checkDate!=null"> AND CHECK_DATE=#{ew.entity.checkDate}</if>
                    <if test="ew.entity.checkUser!=null"> AND CHECK_USER=#{ew.entity.checkUser}</if>
                    <if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
                    <if test="ew.entity.pictureNo!=null"> AND PICTURE_NO=#{ew.entity.pictureNo}</if>
                    <if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
                    <if test="ew.entity.pictureQty!=null"> AND PICTURE_QTY=#{ew.entity.pictureQty}</if>
                </if>
                <if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
                    ${ew.sqlSegment}
                </if>
            </if>
        </where>
        <if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
            ${ew.sqlSegment}
        </if>
    </select>

    <select id="selectObjs" resultType="Object">
        SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_INSPECTION_TASK_DETAIL
        <where>
            <if test="ew!=null">
                <if test="ew.entity!=null">
                    <if test="ew.entity.handle!=null">
                        HANDLE=#{ew.entity.handle}
                    </if>
                    <if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
                    <if test="ew.entity.taskBo!=null"> AND TASK_BO=#{ew.entity.taskBo}</if>
                    <if test="ew.entity.inspectionItemDetailBo!=null"> AND INSPECTION_ITEM_DETAIL_BO=#{ew.entity.inspectionItemDetailBo}</if>
                    <if test="ew.entity.checkValues!=null"> AND CHECK_VALUES=#{ew.entity.checkValues}</if>
                    <if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
                    <if test="ew.entity.checkDate!=null"> AND CHECK_DATE=#{ew.entity.checkDate}</if>
                    <if test="ew.entity.checkUser!=null"> AND CHECK_USER=#{ew.entity.checkUser}</if>
                    <if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
                    <if test="ew.entity.pictureNo!=null"> AND PICTURE_NO=#{ew.entity.pictureNo}</if>
                    <if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
                    <if test="ew.entity.pictureQty!=null"> AND PICTURE_QTY=#{ew.entity.pictureQty}</if>
                </if>
                <if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
                    ${ew.sqlSegment}
                </if>
            </if>
        </where>
        <if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
            ${ew.sqlSegment}
        </if>
    </select>

    <select id="selectPage" resultMap="BaseResultMap">
        SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_INSPECTION_TASK_DETAIL
        <where>
            <if test="ew!=null">
                <if test="ew.entity!=null">
                    <if test="ew.entity.handle!=null">
                        HANDLE=#{ew.entity.handle}
                    </if>
                    <if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
                    <if test="ew.entity.taskBo!=null"> AND TASK_BO=#{ew.entity.taskBo}</if>
                    <if test="ew.entity.inspectionItemDetailBo!=null"> AND INSPECTION_ITEM_DETAIL_BO=#{ew.entity.inspectionItemDetailBo}</if>
                    <if test="ew.entity.checkValues!=null"> AND CHECK_VALUES=#{ew.entity.checkValues}</if>
                    <if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
                    <if test="ew.entity.checkDate!=null"> AND CHECK_DATE=#{ew.entity.checkDate}</if>
                    <if test="ew.entity.checkUser!=null"> AND CHECK_USER=#{ew.entity.checkUser}</if>
                    <if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
                    <if test="ew.entity.pictureNo!=null"> AND PICTURE_NO=#{ew.entity.pictureNo}</if>
                    <if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
                    <if test="ew.entity.pictureQty!=null"> AND PICTURE_QTY=#{ew.entity.pictureQty}</if>
                </if>
                <if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
                    ${ew.sqlSegment}
                </if>
            </if>
        </where>
        <if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
            ${ew.sqlSegment}
        </if>
    </select>

    <select id="selectMapsPage" resultType="HashMap">
        SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_INSPECTION_TASK_DETAIL
        <where>
            <if test="ew!=null">
                <if test="ew.entity!=null">
                    <if test="ew.entity.handle!=null">
                        HANDLE=#{ew.entity.handle}
                    </if>
                    <if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
                    <if test="ew.entity.taskBo!=null"> AND TASK_BO=#{ew.entity.taskBo}</if>
                    <if test="ew.entity.inspectionItemDetailBo!=null"> AND INSPECTION_ITEM_DETAIL_BO=#{ew.entity.inspectionItemDetailBo}</if>
                    <if test="ew.entity.checkValues!=null"> AND CHECK_VALUES=#{ew.entity.checkValues}</if>
                    <if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
                    <if test="ew.entity.checkDate!=null"> AND CHECK_DATE=#{ew.entity.checkDate}</if>
                    <if test="ew.entity.checkUser!=null"> AND CHECK_USER=#{ew.entity.checkUser}</if>
                    <if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
                    <if test="ew.entity.pictureNo!=null"> AND PICTURE_NO=#{ew.entity.pictureNo}</if>
                    <if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
                    <if test="ew.entity.pictureQty!=null"> AND PICTURE_QTY=#{ew.entity.pictureQty}</if>
                </if>
                <if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
                    ${ew.sqlSegment}
                </if>
            </if>
        </where>
        <if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
            ${ew.sqlSegment}
        </if>
    </select>

    <insert id="insert" parameterType="com.foreverwin.mesnac.common.model.InspectionTaskDetail">
        INSERT INTO Z_INSPECTION_TASK_DETAIL
        <trim prefix="(" suffix=")" suffixOverrides=",">
            HANDLE,
            <if test="site!=null">SITE,</if>
            <if test="taskBo!=null">TASK_BO,</if>
            <if test="inspectionItemDetailBo!=null">INSPECTION_ITEM_DETAIL_BO,</if>
            <if test="checkValues!=null">CHECK_VALUES,</if>
            <if test="result!=null">RESULT,</if>
            <if test="checkDate!=null">CHECK_DATE,</if>
            <if test="checkUser!=null">CHECK_USER,</if>
            <if test="remark!=null">REMARK,</if>
            <if test="pictureNo!=null">PICTURE_NO,</if>
            <if test="sfc!=null">SFC,</if>
            <if test="pictureQty!=null">PICTURE_QTY,</if>
        </trim> VALUES
        <trim prefix="(" suffix=")" suffixOverrides=",">
            #{handle},
            <if test="site!=null">#{site},</if>
            <if test="taskBo!=null">#{taskBo},</if>
            <if test="inspectionItemDetailBo!=null">#{inspectionItemDetailBo},</if>
            <if test="checkValues!=null">#{checkValues},</if>
            <if test="result!=null">#{result},</if>
            <if test="checkDate!=null">#{checkDate},</if>
            <if test="checkUser!=null">#{checkUser},</if>
            <if test="remark!=null">#{remark},</if>
            <if test="pictureNo!=null">#{pictureNo},</if>
            <if test="sfc!=null">#{sfc},</if>
            <if test="pictureQty!=null">#{pictureQty},</if>
        </trim>
    </insert>

    <insert id="insertAllColumn" parameterType="com.foreverwin.mesnac.common.model.InspectionTaskDetail">
        INSERT INTO Z_INSPECTION_TASK_DETAIL
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <include refid="Base_Column_List"></include>
        </trim> VALUES
        <trim prefix="(" suffix=")" suffixOverrides=",">
            #{handle},
            #{site},
            #{taskBo},
            #{inspectionItemDetailBo},
            #{checkValues},
            #{result},
            #{checkDate},
            #{checkUser},
            #{remark},
            #{pictureNo},
            #{sfc},
            #{pictureQty},
        </trim>
    </insert>


    <update id="updateById">
        UPDATE Z_INSPECTION_TASK_DETAIL <trim prefix="SET" suffixOverrides=",">
        <if test="et.site!=null">SITE=#{et.site},</if>
        <if test="et.taskBo!=null">TASK_BO=#{et.taskBo},</if>
        <if test="et.inspectionItemDetailBo!=null">INSPECTION_ITEM_DETAIL_BO=#{et.inspectionItemDetailBo},</if>
        <if test="et.checkValues!=null">CHECK_VALUES=#{et.checkValues},</if>
        <if test="et.result!=null">RESULT=#{et.result},</if>
        <if test="et.checkDate!=null">CHECK_DATE=#{et.checkDate},</if>
        <if test="et.checkUser!=null">CHECK_USER=#{et.checkUser},</if>
        <if test="et.remark!=null">REMARK=#{et.remark},</if>
        <if test="et.pictureNo!=null">PICTURE_NO=#{et.pictureNo},</if>
        <if test="et.sfc!=null">SFC=#{et.sfc},</if>
        <if test="et.pictureQty!=null">PICTURE_QTY=#{et.pictureQty},</if>
        </trim> WHERE HANDLE=#{et.handle} <if test="et instanceof java.util.Map"><if test="et.MP_OPTLOCK_VERSION_ORIGINAL!=null">and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL}</if></if>
    </update>


    <update id="updateAllColumnById">
        UPDATE Z_INSPECTION_TASK_DETAIL <trim prefix="SET" suffixOverrides=",">
        SITE=#{et.site},
        TASK_BO=#{et.taskBo},
        INSPECTION_ITEM_DETAIL_BO=#{et.inspectionItemDetailBo},
        CHECK_VALUES=#{et.checkValues},
        RESULT=#{et.result},
        CHECK_DATE=#{et.checkDate},
        CHECK_USER=#{et.checkUser},
        REMARK=#{et.remark},
        PICTURE_NO=#{et.pictureNo},
        SFC=#{et.sfc},
        PICTURE_QTY=#{et.pictureQty},
     </trim> WHERE HANDLE=#{et.handle} <if test="et instanceof java.util.Map"><if test="et.MP_OPTLOCK_VERSION_ORIGINAL!=null">and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL}</if></if>
    </update>


    <update id="update">
        UPDATE Z_INSPECTION_TASK_DETAIL <trim prefix="SET" suffixOverrides=",">
        <if test="et.site!=null">SITE=#{et.site},</if>
        <if test="et.taskBo!=null">TASK_BO=#{et.taskBo},</if>
        <if test="et.inspectionItemDetailBo!=null">INSPECTION_ITEM_DETAIL_BO=#{et.inspectionItemDetailBo},</if>
        <if test="et.checkValues!=null">CHECK_VALUES=#{et.checkValues},</if>
        <if test="et.result!=null">RESULT=#{et.result},</if>
        <if test="et.checkDate!=null">CHECK_DATE=#{et.checkDate},</if>
        <if test="et.checkUser!=null">CHECK_USER=#{et.checkUser},</if>
        <if test="et.remark!=null">REMARK=#{et.remark},</if>
        <if test="et.pictureNo!=null">PICTURE_NO=#{et.pictureNo},</if>
        <if test="et.sfc!=null">SFC=#{et.sfc},</if>
        <if test="et.pictureQty!=null">PICTURE_QTY=#{et.pictureQty},</if>
    </trim>
        <where>
            <if test="ew!=null">
                <if test="ew.entity!=null">
                    HANDLE=#{ew.entity.handle}
                    <if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
                    <if test="ew.entity.taskBo!=null"> AND TASK_BO=#{ew.entity.taskBo}</if>
                    <if test="ew.entity.inspectionItemDetailBo!=null"> AND INSPECTION_ITEM_DETAIL_BO=#{ew.entity.inspectionItemDetailBo}</if>
                    <if test="ew.entity.checkValues!=null"> AND CHECK_VALUES=#{ew.entity.checkValues}</if>
                    <if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
                    <if test="ew.entity.checkDate!=null"> AND CHECK_DATE=#{ew.entity.checkDate}</if>
                    <if test="ew.entity.checkUser!=null"> AND CHECK_USER=#{ew.entity.checkUser}</if>
                    <if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
                    <if test="ew.entity.pictureNo!=null"> AND PICTURE_NO=#{ew.entity.pictureNo}</if>
                    <if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
                    <if test="ew.entity.pictureQty!=null"> AND PICTURE_QTY=#{ew.entity.pictureQty}</if>
                </if>
                <if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
                    ${ew.sqlSegment}
                </if>
            </if>
        </where>
        <if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
            ${ew.sqlSegment}
        </if>
    </update>

    <delete id="deleteById">
        DELETE FROM Z_INSPECTION_TASK_DETAIL WHERE HANDLE=#{handle}
    </delete>

    <delete id="deleteByMap">
        DELETE FROM Z_INSPECTION_TASK_DETAIL
        <if test="cm!=null and !cm.isEmpty">
            <where>
                <foreach collection="cm.keys" item="k" separator="AND">
                    <if test="cm[k] != null">
                        ${k} = #{cm[${k}]}
                    </if>
                </foreach>
            </where>
        </if>
    </delete>

    <delete id="delete">
        DELETE FROM Z_INSPECTION_TASK_DETAIL
        <where>
            <if test="ew!=null">
                <if test="ew.entity!=null">
                    <if test="ew.entity.handle!=null">
                        HANDLE=#{ew.entity.handle}
                    </if>
                    <if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
                    <if test="ew.entity.taskBo!=null"> AND TASK_BO=#{ew.entity.taskBo}</if>
                    <if test="ew.entity.inspectionItemDetailBo!=null"> AND INSPECTION_ITEM_DETAIL_BO=#{ew.entity.inspectionItemDetailBo}</if>
                    <if test="ew.entity.checkValues!=null"> AND CHECK_VALUES=#{ew.entity.checkValues}</if>
                    <if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
                    <if test="ew.entity.checkDate!=null"> AND CHECK_DATE=#{ew.entity.checkDate}</if>
                    <if test="ew.entity.checkUser!=null"> AND CHECK_USER=#{ew.entity.checkUser}</if>
                    <if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
                    <if test="ew.entity.pictureNo!=null"> AND PICTURE_NO=#{ew.entity.pictureNo}</if>
                    <if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
                    <if test="ew.entity.pictureQty!=null"> AND PICTURE_QTY=#{ew.entity.pictureQty}</if>
                </if>
                <if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
                    ${ew.sqlSegment}
                </if>
            </if>
        </where>
        <if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
            ${ew.sqlSegment}
        </if>
    </delete>

    <delete id="deleteBatchIds">
        DELETE FROM Z_INSPECTION_TASK_DETAIL WHERE HANDLE IN (
        <foreach item="item" index="index" collection="coll" separator=",">#{item}
        </foreach>)
    </delete>
    <!-- BaseMapper标准查询/修改/删除 -->

</mapper>
