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


    <sql id = "BaseSql">
        PPSIT.TRA_ID,
        PPSIT.OPERATION_TYPE,
        PPSIT.OPERATION_USER,
        PPSIT.OPERATION_TIME,
        PPSIT.PM_PD_SLAB_INFO_TRA_ID,
        PPSIT.SLAB_NO,
        PPSIT.WHOLE_BACKLOG_SEQ,
        PPSIT.WHOLE_BACKLOG_CODE,
        PPSIT.NEXT_WHOLE_BACKLOG_SEQ,
        PPSIT.NEXT_WHOLE_BACKLOG_CODE,
        PPSIT.OU_BACKLOG_SEQ,
        PPSIT.OU_BACKLOG_CODE,
        PPSIT.PONO,
        PPSIT.MAT_STATUS,
        PPSIT.SLAB_FLAG,
        PPSIT.PD_STATUS_HP,
        PPSIT.AUTO_MANUAL_FLAG,
        PPSIT.PD_BEGIN_TIME,
        PPSIT.PD_END_TIME,
        PPSIT.PD_PROGRAM,
        PPSIT.PD_RESP,
        PPSIT.STOCK_CODE,
        PPSIT.SG_SIGN,
        PPSIT.ST_NO,
        PPSIT.PREC_ST_NO,
        PPSIT.DECI_ST_NO,
        PPSIT.FIN_ST_NO,
        PPSIT.PSC,
        PPSIT.APN,
        PPSIT.MSC,
        PPSIT.MSC_LINE_NO,
        PPSIT.OLD_PSC,
        PPSIT.OLD_APN,
        PPSIT.OLD_MSC,
        PPSIT.OLD_MSC_LINE,
        PPSIT.CAN_ASSIGN_FLAG,
        PPSIT.REMAIN_CAUSE_CODE,
        PPSIT.COMPLEX_DECIDE_CODE,
        PPSIT.MAT_ACT_THICK,
        PPSIT.MAT_ACT_WIDTH,
        PPSIT.MAT_ACT_LEN,
        PPSIT.MAT_ACT_WT,
        PPSIT.MAT_THEORY_WT,
        PPSIT.SLAB_PLACE_CODE,
        PPSIT.TWO_ROLL_INTERIM_FLAG,
        PPSIT.CC_TYPE,
        PPSIT.PD_RESP_AUTO,
        PPSIT.PD_TIME_AUTO,
        PPSIT.PD_AUTO_FLAG,
        PPSIT.INGOT_TYPE,
        PPSIT.TENANT_ID,
        PPSIT.ATTRIBUTE1,
        PPSIT.ATTRIBUTE2,
        PPSIT.ATTRIBUTE3,
        PPSIT.ATTRIBUTE4,
        PPSIT.ATTRIBUTE5,
        PPSIT.COMPOSITE_SLAB_NO,
        PPSIT.SLAB_TYPE,
        PPSIT.creation_date,        PPSIT.created_by,        PPSIT.last_updated_by,        PPSIT.last_update_date,        PPSIT.object_version_number
    </sql>

    <select id = "selectList" resultType = "com.xisc.pm.domain.entity.PmPdSlabInfoTra">
        select
        <include refid = "BaseSql"/>
        from PM_PD_SLAB_INFO_TRA PPSIT
        <where>
            <if test="traId !=null">
                and PPSIT.TRA_ID = #{traId,jdbcType = INTEGER}
            </if>
            <if test="operationType !=null">
                and PPSIT.OPERATION_TYPE = #{operationType,jdbcType = VARCHAR}
            </if>
            <if test="operationUser !=null">
                and PPSIT.OPERATION_USER = #{operationUser,jdbcType = VARCHAR}
            </if>
            <if test="operationTime !=null">
                and PPSIT.OPERATION_TIME = #{operationTime,jdbcType = OTHER}
            </if>
            <if test="pmPdSlabInfoTraId !=null">
                and PPSIT.PM_PD_SLAB_INFO_TRA_ID = #{pmPdSlabInfoTraId,jdbcType = INTEGER}
            </if>
            <if test="slabNo !=null">
                and PPSIT.SLAB_NO = #{slabNo,jdbcType = VARCHAR}
            </if>
            <if test="wholeBacklogSeq !=null">
                and PPSIT.WHOLE_BACKLOG_SEQ = #{wholeBacklogSeq,jdbcType = INTEGER}
            </if>
            <if test="wholeBacklogCode !=null">
                and PPSIT.WHOLE_BACKLOG_CODE = #{wholeBacklogCode,jdbcType = VARCHAR}
            </if>
            <if test="nextWholeBacklogSeq !=null">
                and PPSIT.NEXT_WHOLE_BACKLOG_SEQ = #{nextWholeBacklogSeq,jdbcType = INTEGER}
            </if>
            <if test="nextWholeBacklogCode !=null">
                and PPSIT.NEXT_WHOLE_BACKLOG_CODE = #{nextWholeBacklogCode,jdbcType = VARCHAR}
            </if>
            <if test="ouBacklogSeq !=null">
                and PPSIT.OU_BACKLOG_SEQ = #{ouBacklogSeq,jdbcType = INTEGER}
            </if>
            <if test="ouBacklogCode !=null">
                and PPSIT.OU_BACKLOG_CODE = #{ouBacklogCode,jdbcType = VARCHAR}
            </if>
            <if test="pono !=null">
                and PPSIT.PONO = #{pono,jdbcType = VARCHAR}
            </if>
            <if test="matStatus !=null">
                and PPSIT.MAT_STATUS = #{matStatus,jdbcType = VARCHAR}
            </if>
            <if test="slabFlag !=null">
                and PPSIT.SLAB_FLAG = #{slabFlag,jdbcType = VARCHAR}
            </if>
            <if test="pdStatusHp !=null">
                and PPSIT.PD_STATUS_HP = #{pdStatusHp,jdbcType = VARCHAR}
            </if>
            <if test="autoManualFlag !=null">
                and PPSIT.AUTO_MANUAL_FLAG = #{autoManualFlag,jdbcType = VARCHAR}
            </if>
            <if test="pdBeginTime !=null">
                and PPSIT.PD_BEGIN_TIME = #{pdBeginTime,jdbcType = OTHER}
            </if>
            <if test="pdEndTime !=null">
                and PPSIT.PD_END_TIME = #{pdEndTime,jdbcType = OTHER}
            </if>
            <if test="pdProgram !=null">
                and PPSIT.PD_PROGRAM = #{pdProgram,jdbcType = VARCHAR}
            </if>
            <if test="pdResp !=null">
                and PPSIT.PD_RESP = #{pdResp,jdbcType = VARCHAR}
            </if>
            <if test="stockCode !=null">
                and PPSIT.STOCK_CODE = #{stockCode,jdbcType = VARCHAR}
            </if>
            <if test="sgSign !=null">
                and PPSIT.SG_SIGN = #{sgSign,jdbcType = VARCHAR}
            </if>
            <if test="stNo !=null">
                and PPSIT.ST_NO = #{stNo,jdbcType = VARCHAR}
            </if>
            <if test="precStNo !=null">
                and PPSIT.PREC_ST_NO = #{precStNo,jdbcType = VARCHAR}
            </if>
            <if test="deciStNo !=null">
                and PPSIT.DECI_ST_NO = #{deciStNo,jdbcType = VARCHAR}
            </if>
            <if test="finStNo !=null">
                and PPSIT.FIN_ST_NO = #{finStNo,jdbcType = VARCHAR}
            </if>
            <if test="psc !=null">
                and PPSIT.PSC = #{psc,jdbcType = VARCHAR}
            </if>
            <if test="apn !=null">
                and PPSIT.APN = #{apn,jdbcType = VARCHAR}
            </if>
            <if test="msc !=null">
                and PPSIT.MSC = #{msc,jdbcType = VARCHAR}
            </if>
            <if test="mscLineNo !=null">
                and PPSIT.MSC_LINE_NO = #{mscLineNo,jdbcType = VARCHAR}
            </if>
            <if test="oldPsc !=null">
                and PPSIT.OLD_PSC = #{oldPsc,jdbcType = VARCHAR}
            </if>
            <if test="oldApn !=null">
                and PPSIT.OLD_APN = #{oldApn,jdbcType = VARCHAR}
            </if>
            <if test="oldMsc !=null">
                and PPSIT.OLD_MSC = #{oldMsc,jdbcType = VARCHAR}
            </if>
            <if test="oldMscLine !=null">
                and PPSIT.OLD_MSC_LINE = #{oldMscLine,jdbcType = VARCHAR}
            </if>
            <if test="canAssignFlag !=null">
                and PPSIT.CAN_ASSIGN_FLAG = #{canAssignFlag,jdbcType = VARCHAR}
            </if>
            <if test="remainCauseCode !=null">
                and PPSIT.REMAIN_CAUSE_CODE = #{remainCauseCode,jdbcType = VARCHAR}
            </if>
            <if test="complexDecideCode !=null">
                and PPSIT.COMPLEX_DECIDE_CODE = #{complexDecideCode,jdbcType = VARCHAR}
            </if>
            <if test="matActThick !=null">
                and PPSIT.MAT_ACT_THICK = #{matActThick,jdbcType = INTEGER}
            </if>
            <if test="matActWidth !=null">
                and PPSIT.MAT_ACT_WIDTH = #{matActWidth,jdbcType = INTEGER}
            </if>
            <if test="matActLen !=null">
                and PPSIT.MAT_ACT_LEN = #{matActLen,jdbcType = INTEGER}
            </if>
            <if test="matActWt !=null">
                and PPSIT.MAT_ACT_WT = #{matActWt,jdbcType = INTEGER}
            </if>
            <if test="matTheoryWt !=null">
                and PPSIT.MAT_THEORY_WT = #{matTheoryWt,jdbcType = INTEGER}
            </if>
            <if test="slabPlaceCode !=null">
                and PPSIT.SLAB_PLACE_CODE = #{slabPlaceCode,jdbcType = VARCHAR}
            </if>
            <if test="twoRollInterimFlag !=null">
                and PPSIT.TWO_ROLL_INTERIM_FLAG = #{twoRollInterimFlag,jdbcType = INTEGER}
            </if>
            <if test="ccType !=null">
                and PPSIT.CC_TYPE = #{ccType,jdbcType = VARCHAR}
            </if>
            <if test="pdRespAuto !=null">
                and PPSIT.PD_RESP_AUTO = #{pdRespAuto,jdbcType = VARCHAR}
            </if>
            <if test="pdTimeAuto !=null">
                and PPSIT.PD_TIME_AUTO = #{pdTimeAuto,jdbcType = OTHER}
            </if>
            <if test="pdAutoFlag !=null">
                and PPSIT.PD_AUTO_FLAG = #{pdAutoFlag,jdbcType = VARCHAR}
            </if>
            <if test="ingotType !=null">
                and PPSIT.INGOT_TYPE = #{ingotType,jdbcType = VARCHAR}
            </if>
            <if test="tenantId !=null">
                and PPSIT.TENANT_ID = #{tenantId,jdbcType = INTEGER}
            </if>
            <if test="attribute1 !=null">
                and PPSIT.ATTRIBUTE1 = #{attribute1,jdbcType = VARCHAR}
            </if>
            <if test="attribute2 !=null">
                and PPSIT.ATTRIBUTE2 = #{attribute2,jdbcType = VARCHAR}
            </if>
            <if test="attribute3 !=null">
                and PPSIT.ATTRIBUTE3 = #{attribute3,jdbcType = VARCHAR}
            </if>
            <if test="attribute4 !=null">
                and PPSIT.ATTRIBUTE4 = #{attribute4,jdbcType = VARCHAR}
            </if>
            <if test="attribute5 !=null">
                and PPSIT.ATTRIBUTE5 = #{attribute5,jdbcType = VARCHAR}
            </if>
            <if test="compositeSlabNo !=null">
                and PPSIT.COMPOSITE_SLAB_NO = #{compositeSlabNo,jdbcType = VARCHAR}
            </if>
            <if test="slabType !=null">
                and PPSIT.SLAB_TYPE = #{slabType,jdbcType = VARCHAR}
            </if>
        </where>
    </select>
</mapper>

