<?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="cn.ezhizao.project.business.mapper.BizLotTechnologicalProcessMapper">

    <resultMap type="cn.ezhizao.project.business.domain.BizLotTechnologicalProcess" id="BizTechnologicalAmendResult">
        <id column="id" property="id"/>
    </resultMap>


    <select id="getList" parameterType="BizLotTechnologicalProcess" resultMap="BizTechnologicalAmendResult">
        SELECT * FROM biz_lot_technological_process
        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
            deleted = 0
            AND is_stop = 0
            <if test="lotCode != null  and lotCode != ''"> AND lot_code = #{lotCode}</if>
            <if test="technologyVersion != null  and technologyVersion != ''"> AND technology_version = #{technologyVersion}</if>
        </trim>
    </select>

    <select id="getById" parameterType="Long" resultMap="BizTechnologicalAmendResult">
        SELECT * FROM biz_lot_technological_process
        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
            <if test="id != null">
                id = #{id} AND
            </if>
        </trim>
    </select>

    <select id="selectUpdateList" parameterType="Long" resultMap="BizTechnologicalAmendResult">
        SELECT * FROM biz_lot_technological_process
        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
            <if test="lotId != null">
                lot_id = #{lotId} AND
            </if>
        </trim>
    </select>


    <delete id="physicalDelete">
        DELETE FROM biz_lot_technological_process
        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
            <if test="id != null">
                id = #{id} AND
            </if>
       <!-- 删除条件为其他外键可以在这里加 -->
        </trim>
    </delete>
</mapper>
