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


    <sql id = "BaseSql">
    PRPP.ID,
    PRPP.PREC_PONO,
    PRPP.EVENT,
    PRPP.REASON,
    PRPP.TENANT_ID,
    PRPP.ATTRIBUTE1,
    PRPP.ATTRIBUTE2,
    PRPP.ATTRIBUTE3,
    PRPP.ATTRIBUTE4,
    PRPP.ATTRIBUTE5,
    PRPP.creation_date,    PRPP.created_by,    PRPP.last_updated_by,    PRPP.last_update_date,    PRPP.object_version_number
    </sql>

    <select id = "selectList" resultType = "com.xisc.pm.domain.entity.PmRecordPonoProc">
        select
        <include refid = "BaseSql"/>
        from PM_RECORD_PONO_PROC PRPP
        <where>
            <if test="id !=null">
                and PRPP.ID = #{id,jdbcType = INTEGER}
            </if>
            <if test="precPono !=null">
                and PRPP.PREC_PONO = #{precPono,jdbcType = VARCHAR}
            </if>
            <if test="event !=null">
                and PRPP.EVENT = #{event,jdbcType = VARCHAR}
            </if>
            <if test="reason !=null">
                and PRPP.REASON = #{reason,jdbcType = VARCHAR}
            </if>
            <if test="tenantId !=null">
                and PRPP.TENANT_ID = #{tenantId,jdbcType = INTEGER}
            </if>
            <if test="attribute1 !=null">
                and PRPP.ATTRIBUTE1 = #{attribute1,jdbcType = VARCHAR}
            </if>
            <if test="attribute2 !=null">
                and PRPP.ATTRIBUTE2 = #{attribute2,jdbcType = VARCHAR}
            </if>
            <if test="attribute3 !=null">
                and PRPP.ATTRIBUTE3 = #{attribute3,jdbcType = VARCHAR}
            </if>
            <if test="attribute4 !=null">
                and PRPP.ATTRIBUTE4 = #{attribute4,jdbcType = VARCHAR}
            </if>
            <if test="attribute5 !=null">
                and PRPP.ATTRIBUTE5 = #{attribute5,jdbcType = VARCHAR}
            </if>
        </where>
    </select>
</mapper>

