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


    <sql id = "BaseSql">
    PMSAB.PMSAB_ID,
    PMSAB.ROLL_LINE_NO,
    PMSAB.ST_NO,
    PMSAB.SG_SIGN,
    PMSAB.PLATE_THICK_FROM,
    PMSAB.PLATE_THICK_TO,
    PMSAB.LEN_WIDTH_DIFF,
    PMSAB.TENANT_ID,
    PMSAB.ATTRIBUTE1,
    PMSAB.ATTRIBUTE2,
    PMSAB.ATTRIBUTE3,
    PMSAB.ATTRIBUTE4,
    PMSAB.ATTRIBUTE5,
    PMSAB.START_ROLL_TEMP2_AIM,
    PMSAB.creation_date,    PMSAB.created_by,    PMSAB.last_updated_by,    PMSAB.last_update_date,    PMSAB.object_version_number
    </sql>

    <select id = "selectList" resultType = "com.xisc.pm.domain.entity.PmMidSlabAddvBt">
        select
        <include refid = "BaseSql"/>
        from PM_MID_SLAB_ADDV_BT PMSAB
        <where>
            <if test="pmsabId !=null">
                and PMSAB.PMSAB_ID = #{pmsabId,jdbcType = INTEGER}
            </if>
            <if test="rollLineNo !=null">
                and PMSAB.ROLL_LINE_NO = #{rollLineNo,jdbcType = VARCHAR}
            </if>
            <if test="stNo !=null">
                and PMSAB.ST_NO = #{stNo,jdbcType = VARCHAR}
            </if>
            <if test="sgSign !=null">
                and PMSAB.SG_SIGN = #{sgSign,jdbcType = VARCHAR}
            </if>
            <if test="plateThickFrom !=null">
                and PMSAB.PLATE_THICK_FROM <![CDATA[ <= ]]> #{plateThickFrom,jdbcType = INTEGER}
            </if>
            <if test="plateThickTo !=null">
                and PMSAB.PLATE_THICK_FROM <![CDATA[ <= ]]> #{plateThickTo,jdbcType = INTEGER}
            </if>
            <if test="plateThickTo !=null">
                and PMSAB.PLATE_THICK_TO <![CDATA[ >= ]]> #{plateThickTo,jdbcType = INTEGER}
            </if>
            <if test="plateThickFrom !=null">
                and PMSAB.PLATE_THICK_TO <![CDATA[ >= ]]> #{plateThickFrom,jdbcType = INTEGER}
            </if>
            <if test="lenWidthDiff !=null">
                and PMSAB.LEN_WIDTH_DIFF = #{lenWidthDiff,jdbcType = INTEGER}
            </if>
            <if test="tenantId !=null">
                and PMSAB.TENANT_ID = #{tenantId,jdbcType = INTEGER}
            </if>
            <if test="attribute1 !=null">
                and PMSAB.ATTRIBUTE1 = #{attribute1,jdbcType = VARCHAR}
            </if>
            <if test="attribute2 !=null">
                and PMSAB.ATTRIBUTE2 = #{attribute2,jdbcType = VARCHAR}
            </if>
            <if test="attribute3 !=null">
                and PMSAB.ATTRIBUTE3 = #{attribute3,jdbcType = VARCHAR}
            </if>
            <if test="attribute4 !=null">
                and PMSAB.ATTRIBUTE4 = #{attribute4,jdbcType = VARCHAR}
            </if>
            <if test="attribute5 !=null">
                and PMSAB.ATTRIBUTE5 = #{attribute5,jdbcType = VARCHAR}
            </if>
            <if test="startRollTemp2Aim !=null">
                and PMSAB.START_ROLL_TEMP2_AIM = #{startRollTemp2Aim,jdbcType = VARCHAR}
            </if>
        </where>
    </select>
</mapper>

