<?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.supplier.mapper.BizSupplierProductProcessMapper">

    <resultMap type="cn.ezhizao.project.business.supplier.domain.BizSupplierProductProcess" id="BizSupplierProductProcessResult">
        <id column="id" property="id"/>
    </resultMap>

    <select id="getList" resultMap="BizSupplierProductProcessResult" parameterType="cn.ezhizao.project.business.supplier.domain.BizSupplierProductProcess">
        SELECT t1.*, CONCAT(t1.price, '') AS priceLabel
        FROM biz_supplier_product_process t1
        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
            deleted = 0
            <if test="supplierId != null and supplierId != ''"> AND supplier_id = #{supplierId}</if>
            <if test="productId != null "> AND product_id = #{productId}</if>
            <if test="supplierProductId != null and supplierProductId != ''"> AND supplier_product_id = #{supplierProductId}</if>
        </trim>

    </select>

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