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


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

    <select id = "selectList" resultType = "com.xisc.pm.domain.entity.PmStCodeBt">
        select
        <include refid = "BaseSql"/>
        from PM_ST_CODE_BT PSCB
        <where>
            <if test="pscbId !=null">
                and PSCB.PSCB_ID = #{pscbId,jdbcType = INTEGER}
            </if>
            <if test="stCode !=null">
                and PSCB.ST_CODE = #{stCode,jdbcType = VARCHAR}
            </if>
            <if test="stNo !=null">
                and PSCB.ST_NO = #{stNo,jdbcType = VARCHAR}
            </if>
            <if test="stDesc !=null">
                and PSCB.ST_DESC = #{stDesc,jdbcType = VARCHAR}
            </if>
            <if test="rollLineNo !=null">
                and PSCB.ROLL_LINE_NO = #{rollLineNo,jdbcType = VARCHAR}
            </if>
            <if test="tenantId !=null">
                and PSCB.TENANT_ID = #{tenantId,jdbcType = INTEGER}
            </if>
            <if test="attribute1 !=null">
                and PSCB.ATTRIBUTE1 = #{attribute1,jdbcType = VARCHAR}
            </if>
            <if test="attribute2 !=null">
                and PSCB.ATTRIBUTE2 = #{attribute2,jdbcType = VARCHAR}
            </if>
            <if test="attribute3 !=null">
                and PSCB.ATTRIBUTE3 = #{attribute3,jdbcType = VARCHAR}
            </if>
            <if test="attribute4 !=null">
                and PSCB.ATTRIBUTE4 = #{attribute4,jdbcType = VARCHAR}
            </if>
            <if test="attribute5 !=null">
                and PSCB.ATTRIBUTE5 = #{attribute5,jdbcType = VARCHAR}
            </if>
        </where>
    </select>
</mapper>

