<?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.BizTransferCodeMapper">

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


    <select id="getList" parameterType="BizTransferCode" resultMap="BizTransferCodeResult">
        SELECT * FROM biz_transfer_code
        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
            deleted = 0
            <if test="qcCode != null  and qcCode != ''"> AND qc_code = #{qcCode}</if>
            <if test="deptId != null  and deptId != ''"> AND dept_id = #{deptId}</if>
            <if test="code != null  and code != ''"> AND code like concat('%',#{code},'%')</if>
            <if test="startCode != null  and startCode != ''"> AND start_code = #{startCode}</if>
            <if test="serialNumber != null "> AND serial_number = #{serialNumber}</if>
        </trim>
        order by code
    </select>

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