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


    <sql id = "BaseSql">
    PSSLB.PSSLB_ID,
    PSSLB.ST_NO,
    PSSLB.SG_SIGN,
    PSSLB.VALID_FLAG,
    PSSLB.REMARK,
    PSSLB.TENANT_ID,
    PSSLB.ATTRIBUTE1,
    PSSLB.ATTRIBUTE2,
    PSSLB.ATTRIBUTE3,
    PSSLB.ATTRIBUTE4,
    PSSLB.ATTRIBUTE5,
    PSSLB.SLAB_THICK_FROM,
    PSSLB.SLAB_THICK_TO,
    PSSLB.SLAB_WIDTH_FROM,
    PSSLB.SLAB_WIDTH_TO,
    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.PmSdivStLimitBt">
        select
        <include refid = "BaseSql"/>
        from PM_SDIV_ST_LIMIT_BT PSSLB
        <where>
            <if test="psslbId !=null">
                and PSSLB.PSSLB_ID = #{psslbId,jdbcType = INTEGER}
            </if>
            <if test="stNo !=null">
                and PSSLB.ST_NO = #{stNo,jdbcType = VARCHAR}
            </if>
            <if test="sgSign !=null">
                and PSSLB.SG_SIGN = #{sgSign,jdbcType = VARCHAR}
            </if>
            <if test="validFlag !=null">
                and PSSLB.VALID_FLAG = #{validFlag,jdbcType = VARCHAR}
            </if>
            <if test="remark !=null">
                and PSSLB.REMARK = #{remark,jdbcType = VARCHAR}
            </if>
            <if test="tenantId !=null">
                and PSSLB.TENANT_ID = #{tenantId,jdbcType = INTEGER}
            </if>
            <if test="attribute1 !=null">
                and PSSLB.ATTRIBUTE1 = #{attribute1,jdbcType = VARCHAR}
            </if>
            <if test="attribute2 !=null">
                and PSSLB.ATTRIBUTE2 = #{attribute2,jdbcType = VARCHAR}
            </if>
            <if test="attribute3 !=null">
                and PSSLB.ATTRIBUTE3 = #{attribute3,jdbcType = VARCHAR}
            </if>
            <if test="attribute4 !=null">
                and PSSLB.ATTRIBUTE4 = #{attribute4,jdbcType = VARCHAR}
            </if>
            <if test="attribute5 !=null">
                and PSSLB.ATTRIBUTE5 = #{attribute5,jdbcType = VARCHAR}
            </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 <![CDATA[ <= ]]> #{slabWidthFrom,jdbcType = INTEGER}
            </if>
            <if test="slabWidthTo !=null">
                and PSSLB.SLAB_WIDTH_FROM <![CDATA[ <= ]]> #{slabWidthTo,jdbcType = INTEGER}
            </if>
            <if test="slabWidthTo !=null">
                and PSSLB.SLAB_WIDTH_TO <![CDATA[ >= ]]> #{slabWidthTo,jdbcType = INTEGER}
            </if>
            <if test="slabWidthFrom !=null">
                and PSSLB.SLAB_WIDTH_TO <![CDATA[ >= ]]> #{slabWidthFrom,jdbcType = INTEGER}
            </if>
        </where>
    </select>
</mapper>

