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


    <sql id = "BaseSql">
    PSCBT.TRA_ID,
    PSCBT.OPERATION_TYPE,
    PSCBT.OPERATION_USER,
    PSCBT.OPERATION_TIME,
    PSCBT.PSCB_ID,
    PSCBT.ST_CODE,
    PSCBT.ST_NO,
    PSCBT.ST_DESC,
    PSCBT.ROLL_LINE_NO,
    PSCBT.TENANT_ID,
    PSCBT.ATTRIBUTE1,
    PSCBT.ATTRIBUTE2,
    PSCBT.ATTRIBUTE3,
    PSCBT.ATTRIBUTE4,
    PSCBT.ATTRIBUTE5,
    PSCBT.creation_date,    PSCBT.created_by,    PSCBT.last_updated_by,    PSCBT.last_update_date,    PSCBT.object_version_number
    </sql>

    <select id = "selectList" resultType = "com.xisc.pm.domain.entity.PmStCodeBtTra">
        select
        <include refid = "BaseSql"/>
        from PM_ST_CODE_BT_TRA PSCBT
        <where>
            <if test="traId !=null">
                and PSCBT.TRA_ID = #{traId,jdbcType = INTEGER}
            </if>
            <if test="operationType !=null">
                and PSCBT.OPERATION_TYPE = #{operationType,jdbcType = VARCHAR}
            </if>
            <if test="operationUser !=null">
                and PSCBT.OPERATION_USER = #{operationUser,jdbcType = VARCHAR}
            </if>
            <if test="operationTime !=null">
                and PSCBT.OPERATION_TIME = #{operationTime,jdbcType = OTHER}
            </if>
            <if test="pscbId !=null">
                and PSCBT.PSCB_ID = #{pscbId,jdbcType = INTEGER}
            </if>
            <if test="stCode !=null">
                and PSCBT.ST_CODE = #{stCode,jdbcType = VARCHAR}
            </if>
            <if test="stNo !=null">
                and PSCBT.ST_NO = #{stNo,jdbcType = VARCHAR}
            </if>
            <if test="stDesc !=null">
                and PSCBT.ST_DESC = #{stDesc,jdbcType = VARCHAR}
            </if>
            <if test="rollLineNo !=null">
                and PSCBT.ROLL_LINE_NO = #{rollLineNo,jdbcType = VARCHAR}
            </if>
            <if test="tenantId !=null">
                and PSCBT.TENANT_ID = #{tenantId,jdbcType = INTEGER}
            </if>
            <if test="attribute1 !=null">
                and PSCBT.ATTRIBUTE1 = #{attribute1,jdbcType = VARCHAR}
            </if>
            <if test="attribute2 !=null">
                and PSCBT.ATTRIBUTE2 = #{attribute2,jdbcType = VARCHAR}
            </if>
            <if test="attribute3 !=null">
                and PSCBT.ATTRIBUTE3 = #{attribute3,jdbcType = VARCHAR}
            </if>
            <if test="attribute4 !=null">
                and PSCBT.ATTRIBUTE4 = #{attribute4,jdbcType = VARCHAR}
            </if>
            <if test="attribute5 !=null">
                and PSCBT.ATTRIBUTE5 = #{attribute5,jdbcType = VARCHAR}
            </if>
        </where>
    </select>
</mapper>

