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


    <sql id = "BaseSql">
        PPCST.TRA_ID,
        PPCST.OPERATION_TYPE,
        PPCST.OPERATION_USER,
        PPCST.OPERATION_TIME,
        PPCST.PPCS_ID,
        PPCST.PRO_CONT_ID,
        PPCST.PD_MAT_NO,
        PPCST.ORDER_NO,
        PPCST.ORDER_SEQ_NO,
        PPCST.ORDER_PLATE_NUM,
        PPCST.PD_MAT_TYPE,
        PPCST.SLAB_NO,
        PPCST.PLATE_NO,
        PPCST.PD_STATUS,
        PPCST.AXIS_FLAG,
        PPCST.ORDER_THICK,
        PPCST.ORDER_WIDTH,
        PPCST.ORDER_LEN,
        PPCST.ORDER_LEN_MIN,
        PPCST.ORDER_LEN_MAX,
        PPCST.SMALL_PLATE_THICK,
        PPCST.SMALL_PLATE_WIDTH,
        PPCST.SMALL_PLATE_LEN,
        PPCST.TENANT_ID,
        PPCST.ATTRIBUTE1,
        PPCST.ATTRIBUTE2,
        PPCST.ATTRIBUTE3,
        PPCST.ATTRIBUTE4,
        PPCST.ATTRIBUTE5,
        PPCST.creation_date,        PPCST.created_by,        PPCST.last_updated_by,        PPCST.last_update_date,        PPCST.object_version_number
    </sql>

    <select id = "selectList" resultType = "com.xisc.pm.domain.entity.PmPdContSumTra">
        select
        <include refid = "BaseSql"/>
        from PM_PD_CONT_SUM_TRA PPCST
        <where>
            <if test="traId !=null">
                and PPCST.TRA_ID = #{traId,jdbcType = INTEGER}
            </if>
            <if test="operationType !=null">
                and PPCST.OPERATION_TYPE = #{operationType,jdbcType = VARCHAR}
            </if>
            <if test="operationUser !=null">
                and PPCST.OPERATION_USER = #{operationUser,jdbcType = VARCHAR}
            </if>
            <if test="operationTime !=null">
                and PPCST.OPERATION_TIME = #{operationTime,jdbcType = OTHER}
            </if>
            <if test="ppcsId !=null">
                and PPCST.PPCS_ID = #{ppcsId,jdbcType = INTEGER}
            </if>
            <if test="proContId !=null">
                and PPCST.PRO_CONT_ID = #{proContId,jdbcType = INTEGER}
            </if>
            <if test="pdMatNo !=null">
                and PPCST.PD_MAT_NO = #{pdMatNo,jdbcType = VARCHAR}
            </if>
            <if test="orderNo !=null">
                and PPCST.ORDER_NO = #{orderNo,jdbcType = VARCHAR}
            </if>
            <if test="orderSeqNo !=null">
                and PPCST.ORDER_SEQ_NO = #{orderSeqNo,jdbcType = INTEGER}
            </if>
            <if test="orderPlateNum !=null">
                and PPCST.ORDER_PLATE_NUM = #{orderPlateNum,jdbcType = INTEGER}
            </if>
            <if test="pdMatType !=null">
                and PPCST.PD_MAT_TYPE = #{pdMatType,jdbcType = VARCHAR}
            </if>
            <if test="slabNo !=null">
                and PPCST.SLAB_NO = #{slabNo,jdbcType = VARCHAR}
            </if>
            <if test="plateNo !=null">
                and PPCST.PLATE_NO = #{plateNo,jdbcType = VARCHAR}
            </if>
            <if test="pdStatus !=null">
                and PPCST.PD_STATUS = #{pdStatus,jdbcType = VARCHAR}
            </if>
            <if test="axisFlag !=null">
                and PPCST.AXIS_FLAG = #{axisFlag,jdbcType = INTEGER}
            </if>
            <if test="orderThick !=null">
                and PPCST.ORDER_THICK = #{orderThick,jdbcType = INTEGER}
            </if>
            <if test="orderWidth !=null">
                and PPCST.ORDER_WIDTH = #{orderWidth,jdbcType = INTEGER}
            </if>
            <if test="orderLen !=null">
                and PPCST.ORDER_LEN = #{orderLen,jdbcType = INTEGER}
            </if>
            <if test="orderLenMin !=null">
                and PPCST.ORDER_LEN_MIN = #{orderLenMin,jdbcType = INTEGER}
            </if>
            <if test="orderLenMax !=null">
                and PPCST.ORDER_LEN_MAX = #{orderLenMax,jdbcType = INTEGER}
            </if>
            <if test="smallPlateThick !=null">
                and PPCST.SMALL_PLATE_THICK = #{smallPlateThick,jdbcType = INTEGER}
            </if>
            <if test="smallPlateWidth !=null">
                and PPCST.SMALL_PLATE_WIDTH = #{smallPlateWidth,jdbcType = INTEGER}
            </if>
            <if test="smallPlateLen !=null">
                and PPCST.SMALL_PLATE_LEN = #{smallPlateLen,jdbcType = INTEGER}
            </if>
            <if test="tenantId !=null">
                and PPCST.TENANT_ID = #{tenantId,jdbcType = INTEGER}
            </if>
            <if test="attribute1 !=null">
                and PPCST.ATTRIBUTE1 = #{attribute1,jdbcType = VARCHAR}
            </if>
            <if test="attribute2 !=null">
                and PPCST.ATTRIBUTE2 = #{attribute2,jdbcType = VARCHAR}
            </if>
            <if test="attribute3 !=null">
                and PPCST.ATTRIBUTE3 = #{attribute3,jdbcType = VARCHAR}
            </if>
            <if test="attribute4 !=null">
                and PPCST.ATTRIBUTE4 = #{attribute4,jdbcType = VARCHAR}
            </if>
            <if test="attribute5 !=null">
                and PPCST.ATTRIBUTE5 = #{attribute5,jdbcType = VARCHAR}
            </if>
        </where>
    </select>
</mapper>

