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


    <sql id = "BaseSql">
    PSCS.STEEL_CAST_SLAB_ID,
    PSCS.MAIN_BACKLOG_CODE,
    PSCS.SLAB_NO,
    PSCS.CAST_LOT_NO,
    PSCS.PONO,
    PSCS.BILLET_TYPE,
    PSCS.SLAB_GROUP_NO,
    PSCS.YEAR_ID,
    PSCS.SLAB_NUM,
    PSCS.SLAB_PLACE_CODE,
    PSCS.SLAB_SEQ_HEAT,
    PSCS.VARIETY_CODE,
    PSCS.STEEL_CODE,
    PSCS.SLAB_THICK,
    PSCS.SLAB_WIDTH,
    PSCS.SLAB_LEN,
    PSCS.SLAB_MAX_LEN,
    PSCS.SLAB_MIN_LEN,
    PSCS.SLAB_WT,
    PSCS.SLAB_MAX_WT,
    PSCS.SLAB_MIN_WT,
    PSCS.ORDER_LEN_MAX,
    PSCS.ORDER_LEN_MIN,
    PSCS.ORDER_SHORT_MAX,
    PSCS.ORDER_SHORT_MIN,
    PSCS.ORDER_SHORT_RATE,
    PSCS.INFUR_SLAB_WID,
    PSCS.INFUR_SLAB_LEN,
    PSCS.INFUR_SLAB_MAX_LEN,
    PSCS.INFUR_SLAB_MIN_LEN,
    PSCS.INFUR_SLAB_WT,
    PSCS.INFUR_SLAB_MAX_WT,
    PSCS.INFUR_SLAB_MIN_WT,
    PSCS.ORDER_NO,
    PSCS.PLAN_TYPE,
    PSCS.SLAB_DEST,
    PSCS.HOT_SEND_FLAG,
    PSCS.HOT_CHARGE_FLAG,
    PSCS.MEND_FLAG,
    PSCS.SLAB_FINISH_CODE,
    PSCS.FLAME_CLEAN_DIV,
    PSCS.NEW_TEST_NO,
    PSCS.SHORT_CUT_FLAG,
    PSCS.PREC_ROLL_PLAN_NO,
    PSCS.PREC_ROLL_SEQ_NO,
    PSCS.SLAB_COOL_CODE,
    PSCS.ORDER_REMAIN_DIV,
    PSCS.STEEL_LATEST_DATE,
    PSCS.TENANT_ID,
    PSCS.ATTRIBUTE1,
    PSCS.ATTRIBUTE2,
    PSCS.ATTRIBUTE3,
    PSCS.ATTRIBUTE4,
    PSCS.ATTRIBUTE5,
    PSCS.MSC_LINE_NO,
    PSCS.REP_MAT_FLAG,
    PSCS.SG_SIGN,
    PSCS.STRAND_NO,
    PSCS.INGOT_TYPE,
    PSCS.creation_date,    PSCS.created_by,    PSCS.last_updated_by,    PSCS.last_update_date,    PSCS.object_version_number
    </sql>

    <select id = "selectList" resultType = "com.xisc.pm.domain.entity.PmSteelCastSlab">
        select
        <include refid = "BaseSql"/>
        from PM_STEEL_CAST_SLAB PSCS
        <where>
            <if test="steelCastSlabId !=null">
                and PSCS.STEEL_CAST_SLAB_ID = #{steelCastSlabId,jdbcType = INTEGER}
            </if>
            <if test="mainBacklogCode !=null">
                and PSCS.MAIN_BACKLOG_CODE = #{mainBacklogCode,jdbcType = VARCHAR}
            </if>
            <if test="slabNo !=null">
                and PSCS.SLAB_NO = #{slabNo,jdbcType = VARCHAR}
            </if>
            <if test="castLotNo !=null">
                and PSCS.CAST_LOT_NO = #{castLotNo,jdbcType = VARCHAR}
            </if>
            <if test="pono !=null">
                and PSCS.PONO = #{pono,jdbcType = VARCHAR}
            </if>
            <if test="billetType !=null">
                and PSCS.BILLET_TYPE = #{billetType,jdbcType = VARCHAR}
            </if>
            <if test="slabGroupNo !=null">
                and PSCS.SLAB_GROUP_NO = #{slabGroupNo,jdbcType = INTEGER}
            </if>
            <if test="yearId !=null">
                and PSCS.YEAR_ID = #{yearId,jdbcType = INTEGER}
            </if>
            <if test="slabNum !=null">
                and PSCS.SLAB_NUM = #{slabNum,jdbcType = INTEGER}
            </if>
            <if test="slabPlaceCode !=null">
                and PSCS.SLAB_PLACE_CODE = #{slabPlaceCode,jdbcType = VARCHAR}
            </if>
            <if test="slabSeqHeat !=null">
                and PSCS.SLAB_SEQ_HEAT = #{slabSeqHeat,jdbcType = INTEGER}
            </if>
            <if test="varietyCode !=null">
                and PSCS.VARIETY_CODE = #{varietyCode,jdbcType = VARCHAR}
            </if>
            <if test="steelCode !=null">
                and PSCS.STEEL_CODE = #{steelCode,jdbcType = VARCHAR}
            </if>
            <if test="slabThick !=null">
                and PSCS.SLAB_THICK = #{slabThick,jdbcType = INTEGER}
            </if>
            <if test="slabWidth !=null">
                and PSCS.SLAB_WIDTH = #{slabWidth,jdbcType = INTEGER}
            </if>
            <if test="slabLen !=null">
                and PSCS.SLAB_LEN = #{slabLen,jdbcType = INTEGER}
            </if>
            <if test="slabMaxLen !=null">
                and PSCS.SLAB_MAX_LEN = #{slabMaxLen,jdbcType = INTEGER}
            </if>
            <if test="slabMinLen !=null">
                and PSCS.SLAB_MIN_LEN = #{slabMinLen,jdbcType = INTEGER}
            </if>
            <if test="slabWt !=null">
                and PSCS.SLAB_WT = #{slabWt,jdbcType = INTEGER}
            </if>
            <if test="slabMaxWt !=null">
                and PSCS.SLAB_MAX_WT = #{slabMaxWt,jdbcType = INTEGER}
            </if>
            <if test="slabMinWt !=null">
                and PSCS.SLAB_MIN_WT = #{slabMinWt,jdbcType = INTEGER}
            </if>
            <if test="orderLenMax !=null">
                and PSCS.ORDER_LEN_MAX = #{orderLenMax,jdbcType = INTEGER}
            </if>
            <if test="orderLenMin !=null">
                and PSCS.ORDER_LEN_MIN = #{orderLenMin,jdbcType = INTEGER}
            </if>
            <if test="orderShortMax !=null">
                and PSCS.ORDER_SHORT_MAX = #{orderShortMax,jdbcType = INTEGER}
            </if>
            <if test="orderShortMin !=null">
                and PSCS.ORDER_SHORT_MIN = #{orderShortMin,jdbcType = INTEGER}
            </if>
            <if test="orderShortRate !=null">
                and PSCS.ORDER_SHORT_RATE = #{orderShortRate,jdbcType = INTEGER}
            </if>
            <if test="infurSlabWid !=null">
                and PSCS.INFUR_SLAB_WID = #{infurSlabWid,jdbcType = INTEGER}
            </if>
            <if test="infurSlabLen !=null">
                and PSCS.INFUR_SLAB_LEN = #{infurSlabLen,jdbcType = INTEGER}
            </if>
            <if test="infurSlabMaxLen !=null">
                and PSCS.INFUR_SLAB_MAX_LEN = #{infurSlabMaxLen,jdbcType = INTEGER}
            </if>
            <if test="infurSlabMinLen !=null">
                and PSCS.INFUR_SLAB_MIN_LEN = #{infurSlabMinLen,jdbcType = INTEGER}
            </if>
            <if test="infurSlabWt !=null">
                and PSCS.INFUR_SLAB_WT = #{infurSlabWt,jdbcType = INTEGER}
            </if>
            <if test="infurSlabMaxWt !=null">
                and PSCS.INFUR_SLAB_MAX_WT = #{infurSlabMaxWt,jdbcType = INTEGER}
            </if>
            <if test="infurSlabMinWt !=null">
                and PSCS.INFUR_SLAB_MIN_WT = #{infurSlabMinWt,jdbcType = INTEGER}
            </if>
            <if test="orderNo !=null">
                and PSCS.ORDER_NO = #{orderNo,jdbcType = VARCHAR}
            </if>
            <if test="planType !=null">
                and PSCS.PLAN_TYPE = #{planType,jdbcType = VARCHAR}
            </if>
            <if test="slabDest !=null">
                and PSCS.SLAB_DEST = #{slabDest,jdbcType = VARCHAR}
            </if>
            <if test="hotSendFlag !=null">
                and PSCS.HOT_SEND_FLAG = #{hotSendFlag,jdbcType = VARCHAR}
            </if>
            <if test="hotChargeFlag !=null">
                and PSCS.HOT_CHARGE_FLAG = #{hotChargeFlag,jdbcType = VARCHAR}
            </if>
            <if test="mendFlag !=null">
                and PSCS.MEND_FLAG = #{mendFlag,jdbcType = INTEGER}
            </if>
            <if test="slabFinishCode !=null">
                and PSCS.SLAB_FINISH_CODE = #{slabFinishCode,jdbcType = VARCHAR}
            </if>
            <if test="flameCleanDiv !=null">
                and PSCS.FLAME_CLEAN_DIV = #{flameCleanDiv,jdbcType = VARCHAR}
            </if>
            <if test="newTestNo !=null">
                and PSCS.NEW_TEST_NO = #{newTestNo,jdbcType = VARCHAR}
            </if>
            <if test="shortCutFlag !=null">
                and PSCS.SHORT_CUT_FLAG = #{shortCutFlag,jdbcType = VARCHAR}
            </if>
            <if test="precRollPlanNo !=null">
                and PSCS.PREC_ROLL_PLAN_NO = #{precRollPlanNo,jdbcType = VARCHAR}
            </if>
            <if test="precRollSeqNo !=null">
                and PSCS.PREC_ROLL_SEQ_NO = #{precRollSeqNo,jdbcType = INTEGER}
            </if>
            <if test="slabCoolCode !=null">
                and PSCS.SLAB_COOL_CODE = #{slabCoolCode,jdbcType = VARCHAR}
            </if>
            <if test="orderRemainDiv !=null">
                and PSCS.ORDER_REMAIN_DIV = #{orderRemainDiv,jdbcType = VARCHAR}
            </if>
            <if test="steelLatestDate !=null">
                and PSCS.STEEL_LATEST_DATE = #{steelLatestDate,jdbcType = OTHER}
            </if>
            <if test="tenantId !=null">
                and PSCS.TENANT_ID = #{tenantId,jdbcType = INTEGER}
            </if>
            <if test="attribute1 !=null">
                and PSCS.ATTRIBUTE1 = #{attribute1,jdbcType = VARCHAR}
            </if>
            <if test="attribute2 !=null">
                and PSCS.ATTRIBUTE2 = #{attribute2,jdbcType = VARCHAR}
            </if>
            <if test="attribute3 !=null">
                and PSCS.ATTRIBUTE3 = #{attribute3,jdbcType = VARCHAR}
            </if>
            <if test="attribute4 !=null">
                and PSCS.ATTRIBUTE4 = #{attribute4,jdbcType = VARCHAR}
            </if>
            <if test="attribute5 !=null">
                and PSCS.ATTRIBUTE5 = #{attribute5,jdbcType = VARCHAR}
            </if>
            <if test="mscLineNo !=null">
                and PSCS.MSC_LINE_NO = #{mscLineNo,jdbcType = VARCHAR}
            </if>
            <if test="repMatFlag !=null">
                and PSCS.REP_MAT_FLAG = #{repMatFlag,jdbcType = VARCHAR}
            </if>
            <if test="sgSign !=null">
                and PSCS.SG_SIGN = #{sgSign,jdbcType = VARCHAR}
            </if>
            <if test="strandNo !=null">
                and PSCS.STRAND_NO = #{strandNo,jdbcType = VARCHAR}
            </if>
            <if test="ingotType !=null">
                and PSCS.INGOT_TYPE = #{ingotType,jdbcType = VARCHAR}
            </if>
        </where>
    </select>
</mapper>

