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


    <sql id = "BaseSql">
    PSCL.STEEL_CAST_LOT_ID,
    PSCL.MAIN_BACKLOG_CODE,
    PSCL.CAST_LOT_NO,
    PSCL.ST_NO,
    PSCL.SG_SIGN,
    PSCL.LOT_STATUS,
    PSCL.CC_TYPE,
    PSCL.ORDER_TYPE_CODE,
    PSCL.CC_PLAN_MODE,
    PSCL.URGENCY_ORDER_MARK,
    PSCL.APP_TYPE,
    PSCL.BILLET_TYPE,
    PSCL.SLAB_GROUP_SUM,
    PSCL.SLAB_THICK,
    PSCL.SLAB_NUM,
    PSCL.TENANT_ID,
    PSCL.ATTRIBUTE1,
    PSCL.ATTRIBUTE2,
    PSCL.ATTRIBUTE3,
    PSCL.ATTRIBUTE4,
    PSCL.ATTRIBUTE5,
    PSCL.creation_date,    PSCL.created_by,    PSCL.last_updated_by,    PSCL.last_update_date,    PSCL.object_version_number
    </sql>

    <select id = "selectList" resultType = "com.xisc.pm.domain.entity.PmSteelCastLot">
        select
        <include refid = "BaseSql"/>
        from PM_STEEL_CAST_LOT PSCL
        <where>
            <if test="steelCastLotId !=null">
                and PSCL.STEEL_CAST_LOT_ID = #{steelCastLotId,jdbcType = INTEGER}
            </if>
            <if test="mainBacklogCode !=null">
                and PSCL.MAIN_BACKLOG_CODE = #{mainBacklogCode,jdbcType = VARCHAR}
            </if>
            <if test="castLotNo !=null">
                and PSCL.CAST_LOT_NO = #{castLotNo,jdbcType = VARCHAR}
            </if>
            <if test="stNo !=null">
                and PSCL.ST_NO = #{stNo,jdbcType = VARCHAR}
            </if>
            <if test="sgSign !=null">
                and PSCL.SG_SIGN = #{sgSign,jdbcType = VARCHAR}
            </if>
            <if test="lotStatus !=null">
                and PSCL.LOT_STATUS = #{lotStatus,jdbcType = INTEGER}
            </if>
            <if test="ccType !=null">
                and PSCL.CC_TYPE = #{ccType,jdbcType = VARCHAR}
            </if>
            <if test="orderTypeCode !=null">
                and PSCL.ORDER_TYPE_CODE = #{orderTypeCode,jdbcType = VARCHAR}
            </if>
            <if test="ccPlanMode !=null">
                and PSCL.CC_PLAN_MODE = #{ccPlanMode,jdbcType = VARCHAR}
            </if>
            <if test="urgencyOrderMark !=null">
                and PSCL.URGENCY_ORDER_MARK = #{urgencyOrderMark,jdbcType = VARCHAR}
            </if>
            <if test="appType !=null">
                and PSCL.APP_TYPE = #{appType,jdbcType = VARCHAR}
            </if>
            <if test="billetType !=null">
                and PSCL.BILLET_TYPE = #{billetType,jdbcType = VARCHAR}
            </if>
            <if test="slabGroupSum !=null">
                and PSCL.SLAB_GROUP_SUM = #{slabGroupSum,jdbcType = INTEGER}
            </if>
            <if test="slabThick !=null">
                and PSCL.SLAB_THICK = #{slabThick,jdbcType = INTEGER}
            </if>
            <if test="slabNum !=null">
                and PSCL.SLAB_NUM = #{slabNum,jdbcType = INTEGER}
            </if>
            <if test="tenantId !=null">
                and PSCL.TENANT_ID = #{tenantId,jdbcType = INTEGER}
            </if>
            <if test="attribute1 !=null">
                and PSCL.ATTRIBUTE1 = #{attribute1,jdbcType = VARCHAR}
            </if>
            <if test="attribute2 !=null">
                and PSCL.ATTRIBUTE2 = #{attribute2,jdbcType = VARCHAR}
            </if>
            <if test="attribute3 !=null">
                and PSCL.ATTRIBUTE3 = #{attribute3,jdbcType = VARCHAR}
            </if>
            <if test="attribute4 !=null">
                and PSCL.ATTRIBUTE4 = #{attribute4,jdbcType = VARCHAR}
            </if>
            <if test="attribute5 !=null">
                and PSCL.ATTRIBUTE5 = #{attribute5,jdbcType = VARCHAR}
            </if>
        </where>
    </select>
</mapper>

