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


    <sql id = "BaseSql">
    PPOD.TEST_ID,
    PPOD.POLICY_GROUP_ID,
    PPOD.GROUP_DIMENSION,
    PPOD.GROUP_SEQ,
    PPOD.TENANT_ID,
    PPOD.ATTRIBUTE1,
    PPOD.ATTRIBUTE2,
    PPOD.ATTRIBUTE3,
    PPOD.ATTRIBUTE4,
    PPOD.ATTRIBUTE5,
    PPOD.POLICY_ID,
    PPOD.creation_date,    PPOD.created_by,    PPOD.last_updated_by,    PPOD.last_update_date,    PPOD.object_version_number
    </sql>

    <select id = "selectList" resultType = "com.xisc.pm.domain.entity.PmPolicyOrderDtl">
        select
        <include refid = "BaseSql"/>
        from PM_POLICY_ORDER_DTL PPOD
        <where>
            <if test="testId !=null">
                and PPOD.TEST_ID = #{testId,jdbcType = INTEGER}
            </if>
            <if test="policyGroupId !=null">
                and PPOD.POLICY_GROUP_ID = #{policyGroupId,jdbcType = INTEGER}
            </if>
            <if test="groupDimension !=null">
                and PPOD.GROUP_DIMENSION = #{groupDimension,jdbcType = VARCHAR}
            </if>
            <if test="groupSeq !=null">
                and PPOD.GROUP_SEQ = #{groupSeq,jdbcType = INTEGER}
            </if>
            <if test="tenantId !=null">
                and PPOD.TENANT_ID = #{tenantId,jdbcType = INTEGER}
            </if>
            <if test="attribute1 !=null">
                and PPOD.ATTRIBUTE1 = #{attribute1,jdbcType = VARCHAR}
            </if>
            <if test="attribute2 !=null">
                and PPOD.ATTRIBUTE2 = #{attribute2,jdbcType = VARCHAR}
            </if>
            <if test="attribute3 !=null">
                and PPOD.ATTRIBUTE3 = #{attribute3,jdbcType = VARCHAR}
            </if>
            <if test="attribute4 !=null">
                and PPOD.ATTRIBUTE4 = #{attribute4,jdbcType = VARCHAR}
            </if>
            <if test="attribute5 !=null">
                and PPOD.ATTRIBUTE5 = #{attribute5,jdbcType = VARCHAR}
            </if>
        </where>
    </select>
</mapper>

