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


    <sql id = "BaseSql">
        PICLB.PICLB_ID,
    PICLB.PLATE_THICK_FROM,
    PICLB.PLATE_THICK_TO,
    PICLB.PLATE_CUT_WIDTH,
    PICLB.TENANT_ID,
    PICLB.ATTRIBUTE1,
    PICLB.ATTRIBUTE2,
    PICLB.ATTRIBUTE3,
    PICLB.ATTRIBUTE4,
    PICLB.ATTRIBUTE5,
    PICLB.creation_date,    PICLB.created_by,    PICLB.last_updated_by,    PICLB.last_update_date,    PICLB.object_version_number
    </sql>

    <select id = "selectList" resultType = "com.xisc.pm.domain.entity.PmIngotCutLenBt">
        select
        <include refid = "BaseSql"/>
        from PM_INGOT_CUT_LEN_BT PICLB
        <where>
            <if test="piclbId !=null">
                and PICLB.PICLB_ID = #{piclbId,jdbcType = INTEGER}
            </if>
            <if test="plateThickFrom !=null">
                and PICLB.PLATE_THICK_FROM <![CDATA[ <= ]]> #{plateThickFrom,jdbcType = INTEGER}
            </if>
            <if test="plateThickTo !=null">
                and PICLB.PLATE_THICK_FROM <![CDATA[ <= ]]> #{plateThickTo,jdbcType = INTEGER}
            </if>
            <if test="plateThickTo !=null">
                and PICLB.PLATE_THICK_TO <![CDATA[ >= ]]> #{plateThickTo,jdbcType = INTEGER}
            </if>
            <if test="plateThickFrom !=null">
                and PICLB.PLATE_THICK_TO <![CDATA[ >= ]]> #{plateThickFrom,jdbcType = INTEGER}
            </if>
            <if test="plateCutWidth !=null">
                and PICLB.PLATE_CUT_WIDTH = #{plateCutWidth,jdbcType = INTEGER}
            </if>
            <if test="tenantId !=null">
                and PICLB.TENANT_ID = #{tenantId,jdbcType = INTEGER}
            </if>
            <if test="attribute1 !=null">
                and PICLB.ATTRIBUTE1 = #{attribute1,jdbcType = VARCHAR}
            </if>
            <if test="attribute2 !=null">
                and PICLB.ATTRIBUTE2 = #{attribute2,jdbcType = VARCHAR}
            </if>
            <if test="attribute3 !=null">
                and PICLB.ATTRIBUTE3 = #{attribute3,jdbcType = VARCHAR}
            </if>
            <if test="attribute4 !=null">
                and PICLB.ATTRIBUTE4 = #{attribute4,jdbcType = VARCHAR}
            </if>
            <if test="attribute5 !=null">
                and PICLB.ATTRIBUTE5 = #{attribute5,jdbcType = VARCHAR}
            </if>
        </where>
    </select>
</mapper>
