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


    <sql id = "BaseSql">
    PSSAB.PSSAB_ID,
    PSSAB.MSC_LINE_NO,
    PSSAB.ST_NO,
    PSSAB.SG_SIGN,
    PSSAB.SLAB_THICK_FROM,
    PSSAB.SLAB_THICK_TO,
    PSSAB.PLATE_THICK_FROM,
    PSSAB.PLATE_THICK_TO,
    PSSAB.SLAB_ADDV,
    PSSAB.TENANT_ID,
    PSSAB.ATTRIBUTE1,
    PSSAB.ATTRIBUTE2,
    PSSAB.ATTRIBUTE3,
    PSSAB.ATTRIBUTE4,
    PSSAB.ATTRIBUTE5,
    PSSAB.VALID_FLAG,
    PSSAB.creation_date,    PSSAB.created_by,    PSSAB.last_updated_by,    PSSAB.last_update_date,    PSSAB.object_version_number
    </sql>

    <select id = "selectList" resultType = "com.xisc.pm.domain.entity.PmSpeStAddvBt">
        select
        <include refid = "BaseSql"/>
        from PM_SPE_ST_ADDV_BT PSSAB
        <where>
            <if test="pssabId !=null">
                and PSSAB.PSSAB_ID = #{pssabId,jdbcType = INTEGER}
            </if>
            <if test="mscLineNo !=null">
                and PSSAB.MSC_LINE_NO = #{mscLineNo,jdbcType = VARCHAR}
            </if>
            <if test="stNo !=null">
                and PSSAB.ST_NO = #{stNo,jdbcType = VARCHAR}
            </if>
            <if test="sgSign !=null">
                and PSSAB.SG_SIGN = #{sgSign,jdbcType = INTEGER}
            </if>
            <if test="slabThickFrom !=null">
                and PSSAB.SLAB_THICK_FROM <![CDATA[ <= ]]> #{slabThickFrom,jdbcType = INTEGER}
            </if>
            <if test="slabThickTo !=null">
                and PSSAB.SLAB_THICK_FROM <![CDATA[ <= ]]> #{slabThickTo,jdbcType = INTEGER}
            </if>
            <if test="slabThickTo !=null">
                and PSSAB.SLAB_THICK_TO <![CDATA[ >= ]]> #{slabThickTo,jdbcType = INTEGER}
            </if>
            <if test="slabThickFrom !=null">
                and PSSAB.SLAB_THICK_TO <![CDATA[ >= ]]> #{slabThickFrom,jdbcType = INTEGER}
            </if>
            <if test="plateThickFrom !=null">
                and PSSAB.PLATE_THICK_FROM <![CDATA[ <= ]]> #{plateThickFrom,jdbcType = INTEGER}
            </if>
            <if test="plateThickTo !=null">
                and PSSAB.PLATE_THICK_FROM <![CDATA[ <= ]]> #{plateThickTo,jdbcType = INTEGER}
            </if>
            <if test="plateThickTo !=null">
                and PSSAB.PLATE_THICK_TO <![CDATA[ >= ]]> #{plateThickTo,jdbcType = INTEGER}
            </if>
            <if test="plateThickFrom !=null">
                and PSSAB.PLATE_THICK_TO <![CDATA[ >= ]]> #{plateThickFrom,jdbcType = INTEGER}
            </if>
            <if test="slabAddv !=null">
                and PSSAB.SLAB_ADDV = #{slabAddv,jdbcType = INTEGER}
            </if>
            <if test="tenantId !=null">
                and PSSAB.TENANT_ID = #{tenantId,jdbcType = INTEGER}
            </if>
            <if test="attribute1 !=null">
                and PSSAB.ATTRIBUTE1 = #{attribute1,jdbcType = VARCHAR}
            </if>
            <if test="attribute2 !=null">
                and PSSAB.ATTRIBUTE2 = #{attribute2,jdbcType = VARCHAR}
            </if>
            <if test="attribute3 !=null">
                and PSSAB.ATTRIBUTE3 = #{attribute3,jdbcType = VARCHAR}
            </if>
            <if test="attribute4 !=null">
                and PSSAB.ATTRIBUTE4 = #{attribute4,jdbcType = VARCHAR}
            </if>
            <if test="attribute5 !=null">
                and PSSAB.ATTRIBUTE5 = #{attribute5,jdbcType = VARCHAR}
            </if>
        </where>
    </select>
</mapper>

