<?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.xisc.pm.infra.mapper.MmPlateSmallProMapper">


    <sql id = "BaseSql">
    MPSP.PRO_PLATE_ID,
    MPSP.MAT_NO,
    MPSP.STOCK_CODE,
    MPSP.SUB_BACKLOG_SEQ,
    MPSP.SUB_BACKLOG_CODE,
    MPSP.BACKLOG_ADD_DIV,
    MPSP.BACKLOG_ADD_CAUSE_CODE,
    MPSP.BACKLOG_ADD_TIME,
    MPSP.BACKLOG_ADD_EMP_ID,
    MPSP.BACKLOG_PASS_TIME,
    MPSP.BACKLOG_PASS_EMP_ID,
    MPSP.BACKLOG_DECIDE_CODE,
    MPSP.ORDER_NO,
    MPSP.MAT_ACT_THK,
    MPSP.MAT_ACT_WID,
    MPSP.MAT_ACT_LEN,
    MPSP.MAT_ACT_WGT,
    MPSP.ST_NO,
    MPSP.SG_STD,
    MPSP.SPECIAL_ASK,
    MPSP.IF_EXIST_FILE,
    MPSP.REMARK1,
    MPSP.SPARE_FIELD1,
    MPSP.SPARE_FIELD2,
    MPSP.SPARE_FIELD3,
    MPSP.SPARE_FIELD4,
    MPSP.SPARE_FIELD5,
    MPSP.SPARE_FIELD6,
    MPSP.SPARE_FIELD7,
    MPSP.SPARE_FIELD8,
    MPSP.SPARE_FIELD9,
    MPSP.SPARE_FIELD10,
    MPSP.TENANT_ID,
    MPSP.REMARK2,
    MPSP.REMARK3,
    MPSP.creation_date,    MPSP.created_by,    MPSP.last_updated_by,    MPSP.last_update_date,    MPSP.object_version_number
    </sql>

    <select id = "selectList" resultType = "com.xisc.pm.domain.entity.MmPlateSmallPro">
        select
        <include refid = "BaseSql"/>
        from MM_PLATE_SMALL_PRO MPSP
        <where>
            <if test="proPlateId !=null">
                and MPSP.PRO_PLATE_ID = #{proPlateId,jdbcType = INTEGER}
            </if>
            <if test="matNo !=null">
                and MPSP.MAT_NO = #{matNo,jdbcType = VARCHAR}
            </if>
            <if test="stockCode !=null">
                and MPSP.STOCK_CODE = #{stockCode,jdbcType = VARCHAR}
            </if>
            <if test="subBacklogSeq !=null">
                and MPSP.SUB_BACKLOG_SEQ = #{subBacklogSeq,jdbcType = INTEGER}
            </if>
            <if test="subBacklogCode !=null">
                and MPSP.SUB_BACKLOG_CODE = #{subBacklogCode,jdbcType = VARCHAR}
            </if>
            <if test="backlogAddDiv !=null">
                and MPSP.BACKLOG_ADD_DIV = #{backlogAddDiv,jdbcType = VARCHAR}
            </if>
            <if test="backlogAddCauseCode !=null">
                and MPSP.BACKLOG_ADD_CAUSE_CODE = #{backlogAddCauseCode,jdbcType = VARCHAR}
            </if>
            <if test="backlogAddTime !=null">
                and MPSP.BACKLOG_ADD_TIME = #{backlogAddTime,jdbcType = OTHER}
            </if>
            <if test="backlogAddEmpId !=null">
                and MPSP.BACKLOG_ADD_EMP_ID = #{backlogAddEmpId,jdbcType = VARCHAR}
            </if>
            <if test="backlogPassTime !=null">
                and MPSP.BACKLOG_PASS_TIME = #{backlogPassTime,jdbcType = OTHER}
            </if>
            <if test="backlogPassEmpId !=null">
                and MPSP.BACKLOG_PASS_EMP_ID = #{backlogPassEmpId,jdbcType = VARCHAR}
            </if>
            <if test="backlogDecideCode !=null">
                and MPSP.BACKLOG_DECIDE_CODE = #{backlogDecideCode,jdbcType = VARCHAR}
            </if>
            <if test="orderNo !=null">
                and MPSP.ORDER_NO = #{orderNo,jdbcType = VARCHAR}
            </if>
            <if test="matActThk !=null">
                and MPSP.MAT_ACT_THK = #{matActThk,jdbcType = INTEGER}
            </if>
            <if test="matActWid !=null">
                and MPSP.MAT_ACT_WID = #{matActWid,jdbcType = INTEGER}
            </if>
            <if test="matActLen !=null">
                and MPSP.MAT_ACT_LEN = #{matActLen,jdbcType = INTEGER}
            </if>
            <if test="matActWgt !=null">
                and MPSP.MAT_ACT_WGT = #{matActWgt,jdbcType = INTEGER}
            </if>
            <if test="stNo !=null">
                and MPSP.ST_NO = #{stNo,jdbcType = VARCHAR}
            </if>
            <if test="sgStd !=null">
                and MPSP.SG_STD = #{sgStd,jdbcType = VARCHAR}
            </if>
            <if test="specialAsk !=null">
                and MPSP.SPECIAL_ASK = #{specialAsk,jdbcType = VARCHAR}
            </if>
            <if test="ifExistFile !=null">
                and MPSP.IF_EXIST_FILE = #{ifExistFile,jdbcType = VARCHAR}
            </if>
            <if test="remark1 !=null">
                and MPSP.REMARK1 = #{remark1,jdbcType = VARCHAR}
            </if>
            <if test="spareField1 !=null">
                and MPSP.SPARE_FIELD1 = #{spareField1,jdbcType = VARCHAR}
            </if>
            <if test="spareField2 !=null">
                and MPSP.SPARE_FIELD2 = #{spareField2,jdbcType = VARCHAR}
            </if>
            <if test="spareField3 !=null">
                and MPSP.SPARE_FIELD3 = #{spareField3,jdbcType = VARCHAR}
            </if>
            <if test="spareField4 !=null">
                and MPSP.SPARE_FIELD4 = #{spareField4,jdbcType = VARCHAR}
            </if>
            <if test="spareField5 !=null">
                and MPSP.SPARE_FIELD5 = #{spareField5,jdbcType = VARCHAR}
            </if>
            <if test="spareField6 !=null">
                and MPSP.SPARE_FIELD6 = #{spareField6,jdbcType = INTEGER}
            </if>
            <if test="spareField7 !=null">
                and MPSP.SPARE_FIELD7 = #{spareField7,jdbcType = INTEGER}
            </if>
            <if test="spareField8 !=null">
                and MPSP.SPARE_FIELD8 = #{spareField8,jdbcType = INTEGER}
            </if>
            <if test="spareField9 !=null">
                and MPSP.SPARE_FIELD9 = #{spareField9,jdbcType = INTEGER}
            </if>
            <if test="spareField10 !=null">
                and MPSP.SPARE_FIELD10 = #{spareField10,jdbcType = INTEGER}
            </if>
            <if test="tenantId !=null">
                and MPSP.TENANT_ID = #{tenantId,jdbcType = INTEGER}
            </if>
            <if test="remark2 !=null">
                and MPSP.REMARK2 = #{remark2,jdbcType = VARCHAR}
            </if>
            <if test="remark3 !=null">
                and MPSP.REMARK3 = #{remark3,jdbcType = VARCHAR}
            </if>
        </where>
    </select>
</mapper>
