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


    <sql id = "BaseSql">
    PSRB.PSRB_ID,
    PSRB.BETTER_TO_WORSE_SEQ,
    PSRB.CUR_ST_NO,
    PSRB.REPL_ST_NO,
    PSRB.VALID_FLAG,
    PSRB.REMARK,
    PSRB.TENANT_ID,
    PSRB.ATTRIBUTE1,
    PSRB.ATTRIBUTE2,
    PSRB.ATTRIBUTE3,
    PSRB.ATTRIBUTE4,
    PSRB.ATTRIBUTE5,
    PSRB.creation_date,    PSRB.created_by,    PSRB.last_updated_by,    PSRB.last_update_date,    PSRB.object_version_number
    </sql>

    <select id = "selectList" resultType = "com.xisc.pm.domain.entity.PmSlabReplBt">
        select
        <include refid = "BaseSql"/>
        from PM_SLAB_REPL_BT PSRB
        <where>
            <if test="psrbId !=null">
                and PSRB.PSRB_ID = #{psrbId,jdbcType = INTEGER}
            </if>
            <if test="betterToWorseSeq !=null">
                and PSRB.BETTER_TO_WORSE_SEQ = #{betterToWorseSeq,jdbcType = INTEGER}
            </if>
            <if test="curStNo !=null">
                and PSRB.CUR_ST_NO = #{curStNo,jdbcType = VARCHAR}
            </if>
            <if test="replStNo !=null">
                and PSRB.REPL_ST_NO = #{replStNo,jdbcType = VARCHAR}
            </if>
            <if test="validFlag !=null">
                and PSRB.VALID_FLAG = #{validFlag,jdbcType = VARCHAR}
            </if>
            <if test="remark !=null">
                and PSRB.REMARK = #{remark,jdbcType = VARCHAR}
            </if>
            <if test="tenantId !=null">
                and PSRB.TENANT_ID = #{tenantId,jdbcType = INTEGER}
            </if>
            <if test="attribute1 !=null">
                and PSRB.ATTRIBUTE1 = #{attribute1,jdbcType = VARCHAR}
            </if>
            <if test="attribute2 !=null">
                and PSRB.ATTRIBUTE2 = #{attribute2,jdbcType = VARCHAR}
            </if>
            <if test="attribute3 !=null">
                and PSRB.ATTRIBUTE3 = #{attribute3,jdbcType = VARCHAR}
            </if>
            <if test="attribute4 !=null">
                and PSRB.ATTRIBUTE4 = #{attribute4,jdbcType = VARCHAR}
            </if>
            <if test="attribute5 !=null">
                and PSRB.ATTRIBUTE5 = #{attribute5,jdbcType = VARCHAR}
            </if>
        </where>
    </select>
</mapper>

