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


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

    <select id = "selectList" resultType = "com.xisc.pm.domain.entity.PmSlabReplBtTra">
        select
        <include refid = "BaseSql"/>
        from PM_SLAB_REPL_BT_TRA PSRBT
        <where>
            <if test="traId !=null">
                and PSRBT.TRA_ID = #{traId,jdbcType = INTEGER}
            </if>
            <if test="operationType !=null">
                and PSRBT.OPERATION_TYPE = #{operationType,jdbcType = VARCHAR}
            </if>
            <if test="operationUser !=null">
                and PSRBT.OPERATION_USER = #{operationUser,jdbcType = VARCHAR}
            </if>
            <if test="operationTime !=null">
                and PSRBT.OPERATION_TIME = #{operationTime,jdbcType = OTHER}
            </if>
            <if test="psrbId !=null">
                and PSRBT.PSRB_ID = #{psrbId,jdbcType = INTEGER}
            </if>
            <if test="betterToWorseSeq !=null">
                and PSRBT.BETTER_TO_WORSE_SEQ = #{betterToWorseSeq,jdbcType = INTEGER}
            </if>
            <if test="curStNo !=null">
                and PSRBT.CUR_ST_NO = #{curStNo,jdbcType = VARCHAR}
            </if>
            <if test="replStNo !=null">
                and PSRBT.REPL_ST_NO = #{replStNo,jdbcType = VARCHAR}
            </if>
            <if test="validFlag !=null">
                and PSRBT.VALID_FLAG = #{validFlag,jdbcType = VARCHAR}
            </if>
            <if test="remark !=null">
                and PSRBT.REMARK = #{remark,jdbcType = VARCHAR}
            </if>
            <if test="tenantId !=null">
                and PSRBT.TENANT_ID = #{tenantId,jdbcType = INTEGER}
            </if>
            <if test="attribute1 !=null">
                and PSRBT.ATTRIBUTE1 = #{attribute1,jdbcType = VARCHAR}
            </if>
            <if test="attribute2 !=null">
                and PSRBT.ATTRIBUTE2 = #{attribute2,jdbcType = VARCHAR}
            </if>
            <if test="attribute3 !=null">
                and PSRBT.ATTRIBUTE3 = #{attribute3,jdbcType = VARCHAR}
            </if>
            <if test="attribute4 !=null">
                and PSRBT.ATTRIBUTE4 = #{attribute4,jdbcType = VARCHAR}
            </if>
            <if test="attribute5 !=null">
                and PSRBT.ATTRIBUTE5 = #{attribute5,jdbcType = VARCHAR}
            </if>
        </where>
    </select>
</mapper>

