<?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.ximai.mes.pro.mapper.prototypeMake.ProPrototypeMakeProcessQcindexMapper">

    <resultMap type="ProPrototypeMakeProcessQcindex" id="ProPrototypeMakeProcessQcindexResult">
        <result property="prototypeMakeProcessQcindexId"    column="prototype_make_process_qcindex_id"    />
        <result property="prototypeMakeId"    column="prototype_make_id"    />
        <result property="prototypeMakeProcessId"    column="prototype_make_process_id"    />
        <result property="qcindexId"    column="qcindex_id"    />
        <result property="remark"    column="remark"    />
    </resultMap>

    <sql id="selectProPrototypeMakeProcessQcindexVo">
        select prototype_make_process_qcindex_id, prototype_make_id, prototype_make_process_id, qcindex_id, remark from pro_prototype_make_process_qcindex
    </sql>

    <select id="selectProPrototypeMakeProcessQcindexList" parameterType="ProPrototypeMakeProcessQcindex" resultMap="ProPrototypeMakeProcessQcindexResult">
        <include refid="selectProPrototypeMakeProcessQcindexVo"/>
        <where>
            <if test="prototypeMakeId != null ">and prototype_make_id =
                #{prototypeMakeId}
            </if>
            <if test="prototypeMakeProcessId != null ">and prototype_make_process_id =
                #{prototypeMakeProcessId}
            </if>
            <if test="prototypeMakeProcessQcindexId != null ">and prototype_make_process_qcindex_id = #{prototypeMakeProcessQcindexId}</if>
        </where>
    </select>

    <select id="selectProPrototypeMakeProcessQcindexByPrototypeMakeProcessQcindexId" parameterType="Long" resultMap="ProPrototypeMakeProcessQcindexResult">
        <include refid="selectProPrototypeMakeProcessQcindexVo"/>
        where prototype_make_process_qcindex_id = #{prototypeMakeProcessQcindexId}
    </select>

    <insert id="insertProPrototypeMakeProcessQcindex" parameterType="ProPrototypeMakeProcessQcindex" useGeneratedKeys="true" keyProperty="prototypeMakeProcessQcindexId">
        insert into pro_prototype_make_process_qcindex
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="prototypeMakeId != null">prototype_make_id,</if>
            <if test="prototypeMakeProcessId != null">prototype_make_process_id,</if>
            <if test="qcindexId != null">qcindex_id,</if>
            <if test="remark != null">remark,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="prototypeMakeId != null">#{prototypeMakeId},</if>
            <if test="prototypeMakeProcessId != null">#{prototypeMakeProcessId},</if>
            <if test="qcindexId != null">#{qcindexId},</if>
            <if test="remark != null">#{remark},</if>
         </trim>
    </insert>

    <update id="updateProPrototypeMakeProcessQcindex" parameterType="ProPrototypeMakeProcessQcindex">
        update pro_prototype_make_process_qcindex
        <trim prefix="SET" suffixOverrides=",">
            <if test="prototypeMakeId != null">prototype_make_id = #{prototypeMakeId},</if>
            <if test="prototypeMakeProcessId != null">prototype_make_process_id = #{prototypeMakeProcessId},</if>
            <if test="qcindexId != null">qcindex_id = #{qcindexId},</if>
            <if test="remark != null">remark = #{remark},</if>
        </trim>
        where prototype_make_process_qcindex_id = #{prototypeMakeProcessQcindexId}
    </update>

    <delete id="deleteProPrototypeMakeProcessQcindexByPrototypeMakeProcessQcindexId" parameterType="Long">
        delete from pro_prototype_make_process_qcindex where prototype_make_process_qcindex_id = #{prototypeMakeProcessQcindexId}
    </delete>

    <delete id="deleteProPrototypeMakeProcessQcindexByPrototypeMakeProcessQcindexIds" parameterType="String">
        delete from pro_prototype_make_process_qcindex where prototype_make_process_qcindex_id in
        <foreach item="prototypeMakeProcessQcindexId" collection="array" open="(" separator="," close=")">
            #{prototypeMakeProcessQcindexId}
        </foreach>
    </delete>
</mapper>
