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


    <sql id = "BaseSql">
    PPSM.POLICY_SLAB_METHOD_ID,
    PPSM.POLICY_ID,
    PPSM.COMBO_SLAB_METHOD,
    PPSM.PRIORITY,
    PPSM.TENANT_ID,
    PPSM.ATTRIBUTE1,
    PPSM.ATTRIBUTE2,
    PPSM.ATTRIBUTE3,
    PPSM.ATTRIBUTE4,
    PPSM.ATTRIBUTE5,
    PPSM.creation_date,    PPSM.created_by,    PPSM.last_updated_by,    PPSM.last_update_date,    PPSM.object_version_number
    </sql>

    <select id = "selectList" resultType = "com.xisc.pm.domain.entity.PmPolicySlabMethod">
        select
        <include refid = "BaseSql"/>
        from PM_POLICY_SLAB_METHOD PPSM
        <where>
            <if test="policySlabMethodId !=null">
                and PPSM.POLICY_SLAB_METHOD_ID = #{policySlabMethodId,jdbcType = INTEGER}
            </if>
            <if test="policyId !=null">
                and PPSM.POLICY_ID = #{policyId,jdbcType = INTEGER}
            </if>
            <if test="comboSlabMethod !=null">
                and PPSM.COMBO_SLAB_METHOD = #{comboSlabMethod,jdbcType = VARCHAR}
            </if>
            <if test="priority !=null">
                and PPSM.PRIORITY = #{priority,jdbcType = INTEGER}
            </if>
            <if test="tenantId !=null">
                and PPSM.TENANT_ID = #{tenantId,jdbcType = INTEGER}
            </if>
            <if test="attribute1 !=null">
                and PPSM.ATTRIBUTE1 = #{attribute1,jdbcType = VARCHAR}
            </if>
            <if test="attribute2 !=null">
                and PPSM.ATTRIBUTE2 = #{attribute2,jdbcType = VARCHAR}
            </if>
            <if test="attribute3 !=null">
                and PPSM.ATTRIBUTE3 = #{attribute3,jdbcType = VARCHAR}
            </if>
            <if test="attribute4 !=null">
                and PPSM.ATTRIBUTE4 = #{attribute4,jdbcType = VARCHAR}
            </if>
            <if test="attribute5 !=null">
                and PPSM.ATTRIBUTE5 = #{attribute5,jdbcType = VARCHAR}
            </if>
        </where>
    </select>
</mapper>

