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


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

    <select id = "selectList" resultType = "com.xisc.pm.domain.entity.PmHtolStatic">
        select
        <include refid = "BaseSql"/>
        from PM_HTOL_STATIC PHS
        <where>
            <if test="pmHtolStaticId !=null">
                and PHS.PM_HTOL_STATIC_ID = #{pmHtolStaticId,jdbcType = INTEGER}
            </if>
            <if test="mainBacklogCode !=null">
                and PHS.MAIN_BACKLOG_CODE = #{mainBacklogCode,jdbcType = VARCHAR}
            </if>
            <if test="betterStNo !=null">
                and PHS.BETTER_ST_NO = #{betterStNo,jdbcType = VARCHAR}
            </if>
            <if test="worseStNo !=null">
                and PHS.WORSE_ST_NO = #{worseStNo,jdbcType = VARCHAR}
            </if>
            <if test="betterToWorseSeq !=null">
                and PHS.BETTER_TO_WORSE_SEQ = #{betterToWorseSeq,jdbcType = INTEGER}
            </if>
            <if test="validFlag !=null">
                and PHS.VALID_FLAG = #{validFlag,jdbcType = VARCHAR}
            </if>
            <if test="remark !=null">
                and PHS.REMARK = #{remark,jdbcType = VARCHAR}
            </if>
            <if test="tenantId !=null">
                and PHS.TENANT_ID = #{tenantId,jdbcType = INTEGER}
            </if>
            <if test="attribute1 !=null">
                and PHS.ATTRIBUTE1 = #{attribute1,jdbcType = VARCHAR}
            </if>
            <if test="attribute2 !=null">
                and PHS.ATTRIBUTE2 = #{attribute2,jdbcType = VARCHAR}
            </if>
            <if test="attribute3 !=null">
                and PHS.ATTRIBUTE3 = #{attribute3,jdbcType = VARCHAR}
            </if>
            <if test="attribute4 !=null">
                and PHS.ATTRIBUTE4 = #{attribute4,jdbcType = VARCHAR}
            </if>
            <if test="attribute5 !=null">
                and PHS.ATTRIBUTE5 = #{attribute5,jdbcType = VARCHAR}
            </if>
        </where>
    </select>
</mapper>

