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

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


    <select id="getList" parameterType="BizNoCurrentReject" resultMap="BizNonCurrentRejectResult">
        SELECT * FROM biz_no_current_reject
        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
            deleted = 0
            <if test="companyAlias != null  and companyAlias != ''"> AND company_alias = #{companyAlias}</if>
            <if test="lotCode != null  and lotCode != ''"> AND lot_code like concat('%', #{lotCode}, '%')</if>
            <if test="deptName != null  and deptName != ''"> AND dept_name like concat('%', #{deptName}, '%')</if>
            <if test="technologicalProcessName != null  and technologicalProcessName != ''"> AND technological_process_name like concat('%', #{technologicalProcessName}, '%')</if>
            <if test="findTechnologicalProcessName != null "> AND find_technological_process_name like concat('%', #{findTechnologicalProcessName}, '%')</if>
            <if test="findDeptName != null  and findDeptName != ''"> AND find_dept_name like concat('%', #{findDeptName}, '%')</if>
            <if test="findUserName != null  and findUserName != ''"> AND find_user_name like concat('%', #{findUserName}, '%')</if>
            <if test="productionQuantity != null "> AND production_quantity = #{productionQuantity}</if>
            <if test="prodNum != null "> AND prod_num = #{prodNum}</if>
            <if test="productionPlanNo != null  and productionPlanNo != ''"> AND production_plan_no = #{productionPlanNo}</if>
            <if test="productDescription != null  and productDescription != ''"> AND product_description like concat('%', #{productDescription}, '%')</if>
            <if test="fillName != null  and fillName != ''"> AND fill_name like concat('%', #{fillName}, '%')</if>
            <if test="fillDate != null "> AND fill_date = #{fillDate}</if>
            <if test="endTime != null "> AND fill_date  &lt;= #{endTime}</if>
            <if test="startTime != null "> AND fill_date  &gt;= #{startTime}</if>
            <if test="technologyVersion != null  and technologyVersion != ''"> AND technology_version = #{technologyVersion}</if>
            <if test="nowDeptName != null  and nowDeptName != ''"> AND now_dept_name like concat('%', #{nowDeptName}, '%')</if>
            <if test="issueDate != null "> AND issue_date = #{issueDate}</if>
        </trim>
        ORDER BY create_time DESC
    </select>

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