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


    <sql id = "BaseSql">
    PPRS.RULE_SET_ID,
    PPRS.RULE_SET_NO,
    PPRS.RULE_SEQ_NO,
    PPRS.RULE_NO,
    PPRS.VALID_FLAG,
    PPRS.TENANT_ID,
    PPRS.ATTRIBUTE1,
    PPRS.ATTRIBUTE2,
    PPRS.ATTRIBUTE3,
    PPRS.ATTRIBUTE4,
    PPRS.ATTRIBUTE5,
    PPRS.creation_date,    PPRS.created_by,    PPRS.last_updated_by,    PPRS.last_update_date,    PPRS.object_version_number
    </sql>

    <select id = "selectList" resultType = "com.xisc.pm.domain.entity.PmPdRuleSet">
        select
        <include refid = "BaseSql"/>
        from PM_PD_RULE_SET PPRS
        <where>
            <if test="ruleSetId !=null">
                and PPRS.RULE_SET_ID = #{ruleSetId,jdbcType = INTEGER}
            </if>
            <if test="ruleSetNo !=null">
                and PPRS.RULE_SET_NO = #{ruleSetNo,jdbcType = VARCHAR}
            </if>
            <if test="ruleSeqNo !=null">
                and PPRS.RULE_SEQ_NO = #{ruleSeqNo,jdbcType = INTEGER}
            </if>
            <if test="ruleNo !=null">
                and PPRS.RULE_NO = #{ruleNo,jdbcType = INTEGER}
            </if>
            <if test="validFlag !=null">
                and PPRS.VALID_FLAG = #{validFlag,jdbcType = INTEGER}
            </if>
            <if test="tenantId !=null">
                and PPRS.TENANT_ID = #{tenantId,jdbcType = INTEGER}
            </if>
            <if test="attribute1 !=null">
                and PPRS.ATTRIBUTE1 = #{attribute1,jdbcType = VARCHAR}
            </if>
            <if test="attribute2 !=null">
                and PPRS.ATTRIBUTE2 = #{attribute2,jdbcType = VARCHAR}
            </if>
            <if test="attribute3 !=null">
                and PPRS.ATTRIBUTE3 = #{attribute3,jdbcType = VARCHAR}
            </if>
            <if test="attribute4 !=null">
                and PPRS.ATTRIBUTE4 = #{attribute4,jdbcType = VARCHAR}
            </if>
            <if test="attribute5 !=null">
                and PPRS.ATTRIBUTE5 = #{attribute5,jdbcType = VARCHAR}
            </if>
        </where>
    </select>
</mapper>

