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


    <sql id = "BaseSql">
        PSPIH.TRA_ID,
        PSPIH.SLAB_POOL_IN_ID,
        PSPIH.VIRTUAL_SLAB_NO,
        PSPIH.MAIN_BACKLOG_CODE,
        PSPIH.MSC_LINE_NO,
        PSPIH.USER_ID,
        PSPIH.WHOLE_BACKLOG_CODE,
        PSPIH.ORDER_NO,
        PSPIH.ST_NO,
        PSPIH.STEEL_PLAN_DATE,
        PSPIH.ROLL_PLAN_DATE,
        PSPIH.ESTA_STATUS,
        PSPIH.SLAB_DEST,
        PSPIH.NOM_SLAB_THICK,
        PSPIH.NOM_SLAB_WIDTH,
        PSPIH.NOM_SLAB_LEN,
        PSPIH.SLAB_MAX_NOM_LEN,
        PSPIH.SLAB_MIN_NOM_LEN,
        PSPIH.CC_TYPE,
        PSPIH.NOM_SLAB_WT,
        PSPIH.SLAB_MAX_NOM_WT,
        PSPIH.SLAB_MIN_NOM_WT,
        PSPIH.SLAB_PLACE_CODE,
        PSPIH.NOM_ROLL_WIDTH,
        PSPIH.NOM_ROLL_THICK,
        PSPIH.WHOLE_BACKLOG,
        PSPIH.URG_ORDER_FLAG,
        PSPIH.IG_MAT_DESIGN_KIND,
        PSPIH.INGOT_TYPE,
        PSPIH.ORDER_TYPE_CODE,
        PSPIH.ORDER_DELAY_FLAG,
        PSPIH.SG_SIGN,
        PSPIH.NOM_HOT_SEND_FLAG,
        PSPIH.DELIVY_DATE,
        PSPIH.CONSIGN_CUST_CNAME,
        PSPIH.DELIVY_PLACE_NAME,
        PSPIH.ORDER_HOT_CHARGE_FLAG,
        PSPIH.PRESS_USE_CODE,
        PSPIH.RF_PATH,
        PSPIH.SG_CODE,
        PSPIH.TENANT_ID,
        PSPIH.ATTRIBUTE1,
        PSPIH.ATTRIBUTE2,
        PSPIH.ATTRIBUTE3,
        PSPIH.ATTRIBUTE4,
        PSPIH.ATTRIBUTE5,
        PSPIH.creation_date,        PSPIH.created_by,        PSPIH.last_updated_by,        PSPIH.last_update_date,        PSPIH.object_version_number
    </sql>

    <select id = "selectList" resultType = "com.xisc.pm.domain.entity.PmSlabPoolInHis">
        select
        <include refid = "BaseSql"/>
        from PM_SLAB_POOL_IN_HIS PSPIH
        <where>
            <if test="traId !=null">
                and PSPIH.TRA_ID = #{traId,jdbcType = INTEGER}
            </if>
            <if test="slabPoolInId !=null">
                and PSPIH.SLAB_POOL_IN_ID = #{slabPoolInId,jdbcType = INTEGER}
            </if>
            <if test="virtualSlabNo !=null">
                and PSPIH.VIRTUAL_SLAB_NO = #{virtualSlabNo,jdbcType = VARCHAR}
            </if>
            <if test="mainBacklogCode !=null">
                and PSPIH.MAIN_BACKLOG_CODE = #{mainBacklogCode,jdbcType = VARCHAR}
            </if>
            <if test="mscLineNo !=null">
                and PSPIH.MSC_LINE_NO = #{mscLineNo,jdbcType = VARCHAR}
            </if>
            <if test="userId !=null">
                and PSPIH.USER_ID = #{userId,jdbcType = VARCHAR}
            </if>
            <if test="wholeBacklogCode !=null">
                and PSPIH.WHOLE_BACKLOG_CODE = #{wholeBacklogCode,jdbcType = VARCHAR}
            </if>
            <if test="orderNo !=null">
                and PSPIH.ORDER_NO = #{orderNo,jdbcType = VARCHAR}
            </if>
            <if test="stNo !=null">
                and PSPIH.ST_NO = #{stNo,jdbcType = VARCHAR}
            </if>
            <if test="steelPlanDate !=null">
                and PSPIH.STEEL_PLAN_DATE = #{steelPlanDate,jdbcType = OTHER}
            </if>
            <if test="rollPlanDate !=null">
                and PSPIH.ROLL_PLAN_DATE = #{rollPlanDate,jdbcType = OTHER}
            </if>
            <if test="estaStatus !=null">
                and PSPIH.ESTA_STATUS = #{estaStatus,jdbcType = VARCHAR}
            </if>
            <if test="slabDest !=null">
                and PSPIH.SLAB_DEST = #{slabDest,jdbcType = VARCHAR}
            </if>
            <if test="nomSlabThick !=null">
                and PSPIH.NOM_SLAB_THICK = #{nomSlabThick,jdbcType = INTEGER}
            </if>
            <if test="nomSlabWidth !=null">
                and PSPIH.NOM_SLAB_WIDTH = #{nomSlabWidth,jdbcType = INTEGER}
            </if>
            <if test="nomSlabLen !=null">
                and PSPIH.NOM_SLAB_LEN = #{nomSlabLen,jdbcType = INTEGER}
            </if>
            <if test="slabMaxNomLen !=null">
                and PSPIH.SLAB_MAX_NOM_LEN = #{slabMaxNomLen,jdbcType = INTEGER}
            </if>
            <if test="slabMinNomLen !=null">
                and PSPIH.SLAB_MIN_NOM_LEN = #{slabMinNomLen,jdbcType = INTEGER}
            </if>
            <if test="ccType !=null">
                and PSPIH.CC_TYPE = #{ccType,jdbcType = VARCHAR}
            </if>
            <if test="nomSlabWt !=null">
                and PSPIH.NOM_SLAB_WT = #{nomSlabWt,jdbcType = INTEGER}
            </if>
            <if test="slabMaxNomWt !=null">
                and PSPIH.SLAB_MAX_NOM_WT = #{slabMaxNomWt,jdbcType = INTEGER}
            </if>
            <if test="slabMinNomWt !=null">
                and PSPIH.SLAB_MIN_NOM_WT = #{slabMinNomWt,jdbcType = INTEGER}
            </if>
            <if test="slabPlaceCode !=null">
                and PSPIH.SLAB_PLACE_CODE = #{slabPlaceCode,jdbcType = VARCHAR}
            </if>
            <if test="nomRollWidth !=null">
                and PSPIH.NOM_ROLL_WIDTH = #{nomRollWidth,jdbcType = INTEGER}
            </if>
            <if test="nomRollThick !=null">
                and PSPIH.NOM_ROLL_THICK = #{nomRollThick,jdbcType = INTEGER}
            </if>
            <if test="wholeBacklog !=null">
                and PSPIH.WHOLE_BACKLOG = #{wholeBacklog,jdbcType = VARCHAR}
            </if>
            <if test="urgOrderFlag !=null">
                and PSPIH.URG_ORDER_FLAG = #{urgOrderFlag,jdbcType = VARCHAR}
            </if>
            <if test="igMatDesignKind !=null">
                and PSPIH.IG_MAT_DESIGN_KIND = #{igMatDesignKind,jdbcType = VARCHAR}
            </if>
            <if test="ingotType !=null">
                and PSPIH.INGOT_TYPE = #{ingotType,jdbcType = VARCHAR}
            </if>
            <if test="orderTypeCode !=null">
                and PSPIH.ORDER_TYPE_CODE = #{orderTypeCode,jdbcType = VARCHAR}
            </if>
            <if test="orderDelayFlag !=null">
                and PSPIH.ORDER_DELAY_FLAG = #{orderDelayFlag,jdbcType = VARCHAR}
            </if>
            <if test="sgSign !=null">
                and PSPIH.SG_SIGN = #{sgSign,jdbcType = VARCHAR}
            </if>
            <if test="nomHotSendFlag !=null">
                and PSPIH.NOM_HOT_SEND_FLAG = #{nomHotSendFlag,jdbcType = VARCHAR}
            </if>
            <if test="delivyDate !=null">
                and PSPIH.DELIVY_DATE = #{delivyDate,jdbcType = OTHER}
            </if>
            <if test="consignCustCname !=null">
                and PSPIH.CONSIGN_CUST_CNAME = #{consignCustCname,jdbcType = VARCHAR}
            </if>
            <if test="delivyPlaceName !=null">
                and PSPIH.DELIVY_PLACE_NAME = #{delivyPlaceName,jdbcType = VARCHAR}
            </if>
            <if test="orderHotChargeFlag !=null">
                and PSPIH.ORDER_HOT_CHARGE_FLAG = #{orderHotChargeFlag,jdbcType = VARCHAR}
            </if>
            <if test="pressUseCode !=null">
                and PSPIH.PRESS_USE_CODE = #{pressUseCode,jdbcType = VARCHAR}
            </if>
            <if test="rfPath !=null">
                and PSPIH.RF_PATH = #{rfPath,jdbcType = VARCHAR}
            </if>
            <if test="sgCode !=null">
                and PSPIH.SG_CODE = #{sgCode,jdbcType = VARCHAR}
            </if>
            <if test="tenantId !=null">
                and PSPIH.TENANT_ID = #{tenantId,jdbcType = INTEGER}
            </if>
            <if test="attribute1 !=null">
                and PSPIH.ATTRIBUTE1 = #{attribute1,jdbcType = VARCHAR}
            </if>
            <if test="attribute2 !=null">
                and PSPIH.ATTRIBUTE2 = #{attribute2,jdbcType = VARCHAR}
            </if>
            <if test="attribute3 !=null">
                and PSPIH.ATTRIBUTE3 = #{attribute3,jdbcType = VARCHAR}
            </if>
            <if test="attribute4 !=null">
                and PSPIH.ATTRIBUTE4 = #{attribute4,jdbcType = VARCHAR}
            </if>
            <if test="attribute5 !=null">
                and PSPIH.ATTRIBUTE5 = #{attribute5,jdbcType = VARCHAR}
            </if>
        </where>
    </select>
</mapper>

