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


    <sql id = "BaseSql">
    PHST.TRA_ID,
    PHST.OPERATION_TYPE,
    PHST.OPERATION_USER,
    PHST.OPERATION_TIME,
    PHST.PM_HTOL_STATIC_ID,
    PHST.MAIN_BACKLOG_CODE,
    PHST.BETTER_ST_NO,
    PHST.WORSE_ST_NO,
    PHST.BETTER_TO_WORSE_SEQ,
    PHST.VALID_FLAG,
    PHST.REMARK,
    PHST.TENANT_ID,
    PHST.ATTRIBUTE1,
    PHST.ATTRIBUTE2,
    PHST.ATTRIBUTE3,
    PHST.ATTRIBUTE4,
    PHST.ATTRIBUTE5,
    PHST.creation_date,    PHST.created_by,    PHST.last_updated_by,    PHST.last_update_date,    PHST.object_version_number
    </sql>

    <select id = "selectList" resultType = "com.xisc.pm.domain.entity.PmHtolStaticTra">
        select
        <include refid = "BaseSql"/>
        from PM_HTOL_STATIC_TRA PHST
        <where>
            <if test="traId !=null">
                and PHST.TRA_ID = #{traId,jdbcType = INTEGER}
            </if>
            <if test="operationType !=null">
                and PHST.OPERATION_TYPE = #{operationType,jdbcType = VARCHAR}
            </if>
            <if test="operationUser !=null">
                and PHST.OPERATION_USER = #{operationUser,jdbcType = VARCHAR}
            </if>
            <if test="operationTime !=null">
                and PHST.OPERATION_TIME = #{operationTime,jdbcType = OTHER}
            </if>
            <if test="pmHtolStaticId !=null">
                and PHST.PM_HTOL_STATIC_ID = #{pmHtolStaticId,jdbcType = INTEGER}
            </if>
            <if test="mainBacklogCode !=null">
                and PHST.MAIN_BACKLOG_CODE = #{mainBacklogCode,jdbcType = VARCHAR}
            </if>
            <if test="betterStNo !=null">
                and PHST.BETTER_ST_NO = #{betterStNo,jdbcType = VARCHAR}
            </if>
            <if test="worseStNo !=null">
                and PHST.WORSE_ST_NO = #{worseStNo,jdbcType = VARCHAR}
            </if>
            <if test="betterToWorseSeq !=null">
                and PHST.BETTER_TO_WORSE_SEQ = #{betterToWorseSeq,jdbcType = INTEGER}
            </if>
            <if test="validFlag !=null">
                and PHST.VALID_FLAG = #{validFlag,jdbcType = VARCHAR}
            </if>
            <if test="remark !=null">
                and PHST.REMARK = #{remark,jdbcType = VARCHAR}
            </if>
            <if test="tenantId !=null">
                and PHST.TENANT_ID = #{tenantId,jdbcType = INTEGER}
            </if>
            <if test="attribute1 !=null">
                and PHST.ATTRIBUTE1 = #{attribute1,jdbcType = VARCHAR}
            </if>
            <if test="attribute2 !=null">
                and PHST.ATTRIBUTE2 = #{attribute2,jdbcType = VARCHAR}
            </if>
            <if test="attribute3 !=null">
                and PHST.ATTRIBUTE3 = #{attribute3,jdbcType = VARCHAR}
            </if>
            <if test="attribute4 !=null">
                and PHST.ATTRIBUTE4 = #{attribute4,jdbcType = VARCHAR}
            </if>
            <if test="attribute5 !=null">
                and PHST.ATTRIBUTE5 = #{attribute5,jdbcType = VARCHAR}
            </if>
        </where>
    </select>
</mapper>

