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


    <sql id = "BaseSql">
    PP.ID,
    PP.MAIN_BACKLOG_CODE,
    PP.CC_TYPE,
    PP.PRIORITY1,
    PP.PRIORITY2,
    PP.PRIORITY3,
    PP.PRIORITY4,
    PP.PRIORITY5,
    PP.PRIORITY6,
    PP.PRIORITY7,
    PP.PRIORITY8,
    PP.SORT_FLAG,
    PP.VALID_FLAG,
    PP.TENANT_ID,
    PP.ATTRIBUTE1,
    PP.ATTRIBUTE2,
    PP.ATTRIBUTE3,
    PP.ATTRIBUTE4,
    PP.ATTRIBUTE5,
    PP.creation_date,    PP.created_by,    PP.last_updated_by,    PP.last_update_date,    PP.object_version_number
    </sql>

    <select id = "selectList" resultType = "com.xisc.pm.domain.entity.PmPnsort">
        select
        <include refid = "BaseSql"/>
        from PM_PNSORT PP
        <where>
            <if test="id !=null">
                and PP.ID = #{id,jdbcType = INTEGER}
            </if>
            <if test="mainBacklogCode !=null">
                and PP.MAIN_BACKLOG_CODE = #{mainBacklogCode,jdbcType = VARCHAR}
            </if>
            <if test="ccType !=null">
                and PP.CC_TYPE = #{ccType,jdbcType = VARCHAR}
            </if>
            <if test="priority1 !=null">
                and PP.PRIORITY1 = #{priority1,jdbcType = VARCHAR}
            </if>
            <if test="priority2 !=null">
                and PP.PRIORITY2 = #{priority2,jdbcType = VARCHAR}
            </if>
            <if test="priority3 !=null">
                and PP.PRIORITY3 = #{priority3,jdbcType = VARCHAR}
            </if>
            <if test="priority4 !=null">
                and PP.PRIORITY4 = #{priority4,jdbcType = VARCHAR}
            </if>
            <if test="priority5 !=null">
                and PP.PRIORITY5 = #{priority5,jdbcType = VARCHAR}
            </if>
            <if test="priority6 !=null">
                and PP.PRIORITY6 = #{priority6,jdbcType = VARCHAR}
            </if>
            <if test="priority7 !=null">
                and PP.PRIORITY7 = #{priority7,jdbcType = VARCHAR}
            </if>
            <if test="priority8 !=null">
                and PP.PRIORITY8 = #{priority8,jdbcType = VARCHAR}
            </if>
            <if test="sortFlag !=null">
                and PP.SORT_FLAG = #{sortFlag,jdbcType = VARCHAR}
            </if>
            <if test="validFlag !=null">
                and PP.VALID_FLAG = #{validFlag,jdbcType = VARCHAR}
            </if>
            <if test="tenantId !=null">
                and PP.TENANT_ID = #{tenantId,jdbcType = INTEGER}
            </if>
            <if test="attribute1 !=null">
                and PP.ATTRIBUTE1 = #{attribute1,jdbcType = VARCHAR}
            </if>
            <if test="attribute2 !=null">
                and PP.ATTRIBUTE2 = #{attribute2,jdbcType = VARCHAR}
            </if>
            <if test="attribute3 !=null">
                and PP.ATTRIBUTE3 = #{attribute3,jdbcType = VARCHAR}
            </if>
            <if test="attribute4 !=null">
                and PP.ATTRIBUTE4 = #{attribute4,jdbcType = VARCHAR}
            </if>
            <if test="attribute5 !=null">
                and PP.ATTRIBUTE5 = #{attribute5,jdbcType = VARCHAR}
            </if>
        </where>
    </select>
</mapper>

