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


    <sql id = "BaseSql">
    PSSLB.PSSLB_ID,
    PSSLB.SLAB_THICK_FROM,
    PSSLB.SLAB_THICK_TO,
    PSSLB.SLAB_WIDTH_FROM,
    PSSLB.SLAB_WIDTH_TO,
    PSSLB.SLAB_MIN_LEN,
    PSSLB.SLAB_MAX_LEN,
    PSSLB.CAN_SCRAP_LEN,
    PSSLB.ROLL_LINE_NO,
    PSSLB.TENANT_ID,
    PSSLB.creation_date,    PSSLB.created_by,    PSSLB.last_updated_by,    PSSLB.last_update_date,    PSSLB.object_version_number
    </sql>

    <select id = "selectList" resultType = "com.xisc.pm.domain.entity.PmSlabScrapLenBt">
        select
        <include refid = "BaseSql"/>
        from PM_SLAB_SCRAP_LEN_BT PSSLB
        <where>
            <if test="psslbId !=null">
                and PSSLB.PSSLB_ID = #{psslbId,jdbcType = INTEGER}
            </if>
            <if test="slabThickFrom !=null">
                and PSSLB.SLAB_THICK_FROM <![CDATA[ <= ]]> #{slabThickFrom,jdbcType = INTEGER}
            </if>
            <if test="slabThickTo !=null">
                and PSSLB.SLAB_THICK_FROM <![CDATA[ <= ]]> #{slabThickTo,jdbcType = INTEGER}
            </if>
            <if test="slabThickTo !=null">
                and PSSLB.SLAB_THICK_TO <![CDATA[ >= ]]> #{slabThickTo,jdbcType = INTEGER}
            </if>
            <if test="slabThickFrom !=null">
                and PSSLB.SLAB_THICK_TO <![CDATA[ >= ]]> #{slabThickFrom,jdbcType = INTEGER}
            </if>
            <if test="slabWidthFrom !=null">
                and PSSLB.SLAB_WIDTH_FROM = #{slabWidthFrom,jdbcType = INTEGER}
            </if>
            <if test="slabWidthTo !=null">
                and PSSLB.SLAB_WIDTH_TO = #{slabWidthTo,jdbcType = INTEGER}
            </if>
            <if test="slabMinLen !=null">
                and PSSLB.SLAB_MIN_LEN = #{slabMinLen,jdbcType = INTEGER}
            </if>
            <if test="slabMaxLen !=null">
                and PSSLB.SLAB_MAX_LEN = #{slabMaxLen,jdbcType = INTEGER}
            </if>
            <if test="canScrapLen !=null">
                and PSSLB.CAN_SCRAP_LEN = #{canScrapLen,jdbcType = INTEGER}
            </if>
            <if test="rollLineNo !=null">
                and PSSLB.ROLL_LINE_NO = #{rollLineNo,jdbcType = VARCHAR}
            </if>
            <if test="tenantId !=null">
                and PSSLB.TENANT_ID = #{tenantId,jdbcType = INTEGER}
            </if>
        </where>
    </select>
</mapper>

