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


    <sql id = "BaseSql">
    PSSB.PSSB_ID,
    PSSB.ROLL_DIRECT_CODE,
    PSSB.SLAB_THICK_FROM,
    PSSB.SLAB_THICK_TO,
    PSSB.SLAB_WIDTH_FROM,
    PSSB.SLAB_WIDTH_TO,
    PSSB.CC_TYPE,
    PSSB.ROLL_LINE_NO,
    PSSB.BROAD_RATIO_MAX,
    PSSB.MIN_ROLL_THICK,
    PSSB.SLAB_MIN_LEN,
    PSSB.SLAB_MAX_LEN,
    PSSB.FUR_TYPE,
    PSSB.SLAB_GRAVITY,
    PSSB.CAST_SPEED,
    PSSB.CAN_ROLL_WIDTH_MIN,
    PSSB.DZ_FLAG,
    PSSB.TENANT_ID,
    PSSB.ATTRIBUTE1,
    PSSB.ATTRIBUTE2,
    PSSB.ATTRIBUTE3,
    PSSB.ATTRIBUTE4,
    PSSB.ATTRIBUTE5,
    PSSB.creation_date,    PSSB.created_by,    PSSB.last_updated_by,    PSSB.last_update_date,    PSSB.object_version_number
    </sql>

    <select id = "selectList" resultType = "com.xisc.pm.domain.entity.PmSlabSpecBt">
        select
        <include refid = "BaseSql"/>
        from PM_SLAB_SPEC_BT PSSB
        <where>
            <if test="pssbId !=null">
                and PSSB.PSSB_ID = #{pssbId,jdbcType = INTEGER}
            </if>
            <if test="rollDirectCode !=null">
                and PSSB.ROLL_DIRECT_CODE = #{rollDirectCode,jdbcType = VARCHAR}
            </if>
            <if test="slabThickFrom !=null">
                and PSSB.SLAB_THICK_FROM <![CDATA[ <= ]]> #{slabThickFrom,jdbcType = INTEGER}
            </if>
            <if test="slabThickTo !=null">
                and PSSB.SLAB_THICK_FROM <![CDATA[ <= ]]> #{slabThickTo,jdbcType = INTEGER}
            </if>
            <if test="slabThickTo !=null">
                and PSSB.SLAB_THICK_TO <![CDATA[ >= ]]> #{slabThickTo,jdbcType = INTEGER}
            </if>
            <if test="slabThickFrom !=null">
                and PSSB.SLAB_THICK_TO <![CDATA[ >= ]]> #{slabThickFrom,jdbcType = INTEGER}
            </if>
            <if test="slabWidthFrom !=null">
                and PSSB.SLAB_WIDTH_FROM <![CDATA[ <= ]]> #{slabWidthFrom,jdbcType = INTEGER}
            </if>
            <if test="slabWidthTo !=null">
                and PSSB.SLAB_WIDTH_FROM <![CDATA[ <= ]]> #{slabWidthTo,jdbcType = INTEGER}
            </if>
            <if test="slabWidthTo !=null">
                and PSSB.SLAB_WIDTH_TO <![CDATA[ >= ]]> #{slabWidthTo,jdbcType = INTEGER}
            </if>
            <if test="slabWidthFrom !=null">
                and PSSB.SLAB_WIDTH_TO <![CDATA[ >= ]]> #{slabWidthFrom,jdbcType = INTEGER}
            </if>
            <if test="ccType !=null">
                and PSSB.CC_TYPE = #{ccType,jdbcType = VARCHAR}
            </if>
            <if test="rollLineNo !=null">
                and PSSB.ROLL_LINE_NO = #{rollLineNo,jdbcType = VARCHAR}
            </if>
            <if test="broadRatioMax !=null">
                and PSSB.BROAD_RATIO_MAX = #{broadRatioMax,jdbcType = INTEGER}
            </if>
            <if test="minRollThick !=null">
                and PSSB.MIN_ROLL_THICK = #{minRollThick,jdbcType = INTEGER}
            </if>
            <if test="slabMinLen !=null">
                and PSSB.SLAB_MIN_LEN <![CDATA[ <= ]]> #{slabMinLen,jdbcType = INTEGER}
            </if>
            <if test="slabMaxLen !=null">
                and PSSB.SLAB_MIN_LEN <![CDATA[ <= ]]> #{slabMaxLen,jdbcType = INTEGER}
            </if>
            <if test="slabMaxLen !=null">
                and PSSB.SLAB_MAX_LEN <![CDATA[ >= ]]> #{slabMaxLen,jdbcType = INTEGER}
            </if>
            <if test="slabMinLen !=null">
                and PSSB.SLAB_MAX_LEN <![CDATA[ >= ]]> #{slabMinLen,jdbcType = INTEGER}
            </if>
            <if test="furType !=null">
                and PSSB.FUR_TYPE = #{furType,jdbcType = VARCHAR}
            </if>
            <if test="slabGravity !=null">
                and PSSB.SLAB_GRAVITY = #{slabGravity,jdbcType = INTEGER}
            </if>
            <if test="castSpeed !=null">
                and PSSB.CAST_SPEED = #{castSpeed,jdbcType = INTEGER}
            </if>
            <if test="canRollWidthMin !=null">
                and PSSB.CAN_ROLL_WIDTH_MIN <![CDATA[ <= ]]> #{canRollWidthMin,jdbcType = INTEGER}
            </if>
            <if test="dzFlag !=null">
                and PSSB.DZ_FLAG = #{dzFlag,jdbcType = VARCHAR}
            </if>
            <if test="tenantId !=null">
                and PSSB.TENANT_ID = #{tenantId,jdbcType = INTEGER}
            </if>
            <if test="attribute1 !=null">
                and PSSB.ATTRIBUTE1 = #{attribute1,jdbcType = VARCHAR}
            </if>
            <if test="attribute2 !=null">
                and PSSB.ATTRIBUTE2 = #{attribute2,jdbcType = VARCHAR}
            </if>
            <if test="attribute3 !=null">
                and PSSB.ATTRIBUTE3 = #{attribute3,jdbcType = VARCHAR}
            </if>
            <if test="attribute4 !=null">
                and PSSB.ATTRIBUTE4 = #{attribute4,jdbcType = VARCHAR}
            </if>
            <if test="attribute5 !=null">
                and PSSB.ATTRIBUTE5 = #{attribute5,jdbcType = VARCHAR}
            </if>
        </where>
    </select>
</mapper>

