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


    <sql id = "BaseSql">
        PSPPT.TRA_ID,
        PSPPT.OPERATION_TYPE,
        PSPPT.OPERATION_USER,
        PSPPT.OPERATION_TIME,
        PSPPT.PSPP_ID,
        PSPPT.PD_MAT_NO,
        PSPPT.SMALL_PLATE_DIV_NO,
        PSPPT.ORDER_NO,
        PSPPT.PRO_CONT_ID,
        PSPPT.ORDER_SEQ_NO,
        PSPPT.SLAB_NO,
        PSPPT.PLATE_NO,
        PSPPT.PICK_MODE_WID_DIR,
        PSPPT.PICK_MODE_LEN_DIR,
        PSPPT.ORDER_THICK,
        PSPPT.ORDER_WIDTH,
        PSPPT.ORDER_LEN,
        PSPPT.ORDER_LEN_MIN,
        PSPPT.ORDER_LEN_MAX,
        PSPPT.SMALL_PLATE_THICK,
        PSPPT.SMALL_PLATE_WIDTH,
        PSPPT.SMALL_PLATE_LEN,
        PSPPT.TENANT_ID,
        PSPPT.ATTRIBUTE1,
        PSPPT.ATTRIBUTE2,
        PSPPT.ATTRIBUTE3,
        PSPPT.ATTRIBUTE4,
        PSPPT.ATTRIBUTE5,
        PSPPT.creation_date,        PSPPT.created_by,        PSPPT.last_updated_by,        PSPPT.last_update_date,        PSPPT.object_version_number
    </sql>

    <select id = "selectList" resultType = "com.xisc.pm.domain.entity.PmSmallPltPosTra">
        select
        <include refid = "BaseSql"/>
        from PM_SMALL_PLT_POS_TRA PSPPT
        <where>
            <if test="traId !=null">
                and PSPPT.TRA_ID = #{traId,jdbcType = INTEGER}
            </if>
            <if test="operationType !=null">
                and PSPPT.OPERATION_TYPE = #{operationType,jdbcType = VARCHAR}
            </if>
            <if test="operationUser !=null">
                and PSPPT.OPERATION_USER = #{operationUser,jdbcType = VARCHAR}
            </if>
            <if test="operationTime !=null">
                and PSPPT.OPERATION_TIME = #{operationTime,jdbcType = OTHER}
            </if>
            <if test="psppId !=null">
                and PSPPT.PSPP_ID = #{psppId,jdbcType = INTEGER}
            </if>
            <if test="pdMatNo !=null">
                and PSPPT.PD_MAT_NO = #{pdMatNo,jdbcType = VARCHAR}
            </if>
            <if test="smallPlateDivNo !=null">
                and PSPPT.SMALL_PLATE_DIV_NO = #{smallPlateDivNo,jdbcType = VARCHAR}
            </if>
            <if test="orderNo !=null">
                and PSPPT.ORDER_NO = #{orderNo,jdbcType = VARCHAR}
            </if>
            <if test="proContId !=null">
                and PSPPT.PRO_CONT_ID = #{proContId,jdbcType = INTEGER}
            </if>
            <if test="orderSeqNo !=null">
                and PSPPT.ORDER_SEQ_NO = #{orderSeqNo,jdbcType = INTEGER}
            </if>
            <if test="slabNo !=null">
                and PSPPT.SLAB_NO = #{slabNo,jdbcType = VARCHAR}
            </if>
            <if test="plateNo !=null">
                and PSPPT.PLATE_NO = #{plateNo,jdbcType = VARCHAR}
            </if>
            <if test="pickModeWidDir !=null">
                and PSPPT.PICK_MODE_WID_DIR = #{pickModeWidDir,jdbcType = INTEGER}
            </if>
            <if test="pickModeLenDir !=null">
                and PSPPT.PICK_MODE_LEN_DIR = #{pickModeLenDir,jdbcType = INTEGER}
            </if>
            <if test="orderThick !=null">
                and PSPPT.ORDER_THICK = #{orderThick,jdbcType = INTEGER}
            </if>
            <if test="orderWidth !=null">
                and PSPPT.ORDER_WIDTH = #{orderWidth,jdbcType = INTEGER}
            </if>
            <if test="orderLen !=null">
                and PSPPT.ORDER_LEN = #{orderLen,jdbcType = INTEGER}
            </if>
            <if test="orderLenMin !=null">
                and PSPPT.ORDER_LEN_MIN = #{orderLenMin,jdbcType = INTEGER}
            </if>
            <if test="orderLenMax !=null">
                and PSPPT.ORDER_LEN_MAX = #{orderLenMax,jdbcType = INTEGER}
            </if>
            <if test="smallPlateThick !=null">
                and PSPPT.SMALL_PLATE_THICK = #{smallPlateThick,jdbcType = INTEGER}
            </if>
            <if test="smallPlateWidth !=null">
                and PSPPT.SMALL_PLATE_WIDTH = #{smallPlateWidth,jdbcType = INTEGER}
            </if>
            <if test="smallPlateLen !=null">
                and PSPPT.SMALL_PLATE_LEN = #{smallPlateLen,jdbcType = INTEGER}
            </if>
            <if test="tenantId !=null">
                and PSPPT.TENANT_ID = #{tenantId,jdbcType = INTEGER}
            </if>
            <if test="attribute1 !=null">
                and PSPPT.ATTRIBUTE1 = #{attribute1,jdbcType = VARCHAR}
            </if>
            <if test="attribute2 !=null">
                and PSPPT.ATTRIBUTE2 = #{attribute2,jdbcType = VARCHAR}
            </if>
            <if test="attribute3 !=null">
                and PSPPT.ATTRIBUTE3 = #{attribute3,jdbcType = VARCHAR}
            </if>
            <if test="attribute4 !=null">
                and PSPPT.ATTRIBUTE4 = #{attribute4,jdbcType = VARCHAR}
            </if>
            <if test="attribute5 !=null">
                and PSPPT.ATTRIBUTE5 = #{attribute5,jdbcType = VARCHAR}
            </if>
        </where>
    </select>
</mapper>

