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


    <sql id = "BaseSql">
    PPCLB.PPCLB_ID,
    PPCLB.PLATE_THICK_FROM,
    PPCLB.PLATE_THICK_TO,
    PPCLB.COMBINE_PLATE_WIDTH_FROM,
    PPCLB.COMBINE_PLATE_WIDTH_TO,
    PPCLB.BRR_NEED,
    PPCLB.ROLL_MODE,
    PPCLB.ROLL_DIRECT_CODE,
    PPCLB.MSC_LINE_NO,
    PPCLB.PLATE_CUT_WIDTH,
    PPCLB.HEAD_CUT,
    PPCLB.TAIL_CUT,
    PPCLB.TENANT_ID,
    PPCLB.ATTRIBUTE1,
    PPCLB.ATTRIBUTE2,
    PPCLB.ATTRIBUTE3,
    PPCLB.ATTRIBUTE4,
    PPCLB.ATTRIBUTE5,
    PPCLB.SLAB_THICK_FROM,
    PPCLB.SLAB_THICK_TO,
    PPCLB.creation_date,    PPCLB.created_by,    PPCLB.last_updated_by,    PPCLB.last_update_date,    PPCLB.object_version_number
    </sql>

    <select id = "selectList" resultType = "com.xisc.pm.domain.entity.PmPlateCutLenBt">
        select
        <include refid = "BaseSql"/>
        from PM_PLATE_CUT_LEN_BT PPCLB
        <where>
            <if test="ppclbId !=null">
                and PPCLB.PPCLB_ID = #{ppclbId,jdbcType = INTEGER}
            </if>
            <if test="plateThickFrom !=null">
                and PPCLB.PLATE_THICK_FROM <![CDATA[ <= ]]> #{plateThickFrom,jdbcType = INTEGER}
            </if>
            <if test="plateThickTo !=null">
                and PPCLB.PLATE_THICK_FROM <![CDATA[ <= ]]> #{plateThickTo,jdbcType = INTEGER}
            </if>
            <if test="plateThickTo !=null">
                and PPCLB.PLATE_THICK_TO <![CDATA[ >= ]]> #{plateThickTo,jdbcType = INTEGER}
            </if>
            <if test="plateThickFrom !=null">
                and PPCLB.PLATE_THICK_TO <![CDATA[ >= ]]> #{plateThickFrom,jdbcType = INTEGER}
            </if>
            <if test="combinePlateWidthFrom !=null">
                and PPCLB.COMBINE_PLATE_WIDTH_FROM <![CDATA[ <= ]]> #{combinePlateWidthFrom,jdbcType = INTEGER}
            </if>
            <if test="combinePlateWidthTo !=null">
                and PPCLB.COMBINE_PLATE_WIDTH_FROM <![CDATA[ <= ]]> #{combinePlateWidthTo,jdbcType = INTEGER}
            </if>
            <if test="combinePlateWidthTo !=null">
                and PPCLB.COMBINE_PLATE_WIDTH_TO <![CDATA[ >= ]]> #{combinePlateWidthTo,jdbcType = INTEGER}
            </if>
            <if test="combinePlateWidthFrom !=null">
                and PPCLB.COMBINE_PLATE_WIDTH_TO <![CDATA[ >= ]]> #{combinePlateWidthFrom,jdbcType = INTEGER}
            </if>
            <if test="brrNeed !=null">
                and PPCLB.BRR_NEED = #{brrNeed,jdbcType = VARCHAR}
            </if>
            <if test="rollMode !=null">
                and PPCLB.ROLL_MODE = #{rollMode,jdbcType = VARCHAR}
            </if>
            <if test="rollDirectCode !=null">
                and PPCLB.ROLL_DIRECT_CODE = #{rollDirectCode,jdbcType = VARCHAR}
            </if>
            <if test="mscLineNo !=null">
                and PPCLB.MSC_LINE_NO = #{mscLineNo,jdbcType = VARCHAR}
            </if>
            <if test="plateCutWidth !=null">
                and PPCLB.PLATE_CUT_WIDTH = #{plateCutWidth,jdbcType = INTEGER}
            </if>
            <if test="headCut !=null">
                and PPCLB.HEAD_CUT = #{headCut,jdbcType = INTEGER}
            </if>
            <if test="tailCut !=null">
                and PPCLB.TAIL_CUT = #{tailCut,jdbcType = INTEGER}
            </if>
            <if test="tenantId !=null">
                and PPCLB.TENANT_ID = #{tenantId,jdbcType = INTEGER}
            </if>
            <if test="attribute1 !=null">
                and PPCLB.ATTRIBUTE1 = #{attribute1,jdbcType = VARCHAR}
            </if>
            <if test="attribute2 !=null">
                and PPCLB.ATTRIBUTE2 = #{attribute2,jdbcType = VARCHAR}
            </if>
            <if test="attribute3 !=null">
                and PPCLB.ATTRIBUTE3 = #{attribute3,jdbcType = VARCHAR}
            </if>
            <if test="attribute4 !=null">
                and PPCLB.ATTRIBUTE4 = #{attribute4,jdbcType = VARCHAR}
            </if>
            <if test="attribute5 !=null">
                and PPCLB.ATTRIBUTE5 = #{attribute5,jdbcType = VARCHAR}
            </if>
            <if test="slabThickFrom !=null">
                and PPCLB.SLAB_THICK_FROM <![CDATA[ <= ]]> #{slabThickFrom,jdbcType = INTEGER}
            </if>
            <if test="slabThickTo !=null">
                and PPCLB.SLAB_THICK_FROM <![CDATA[ <= ]]> #{slabThickTo,jdbcType = INTEGER}
            </if>
            <if test="slabThickTo !=null">
                and PPCLB.SLAB_THICK_TO <![CDATA[ >= ]]> #{slabThickTo,jdbcType = INTEGER}
            </if>
            <if test="slabThickFrom !=null">
                and PPCLB.SLAB_THICK_TO <![CDATA[ >= ]]> #{slabThickFrom,jdbcType = INTEGER}
            </if>
        </where>
    </select>
</mapper>

