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


    <sql id = "BaseSql">
    PTH.ID,
    PTH.PONO,
    PTH.HOT_MODE,
    PTH.DEFAULT_DEST,
    PTH.STATUS,
    PTH.INS_FLAG,
    PTH.TENANT_ID,
    PTH.ATTRIBUTE1,
    PTH.ATTRIBUTE2,
    PTH.ATTRIBUTE3,
    PTH.ATTRIBUTE4,
    PTH.ATTRIBUTE5,
    PTH.creation_date,    PTH.created_by,    PTH.last_updated_by,    PTH.last_update_date,    PTH.object_version_number
    </sql>

    <select id = "selectList" resultType = "com.xisc.pm.domain.entity.PmHotDest">
        select
        <include refid = "BaseSql"/>
        from PM_HOT_DEST PTH
        <where>
            <if test="id !=null">
                and PTH.ID = #{id,jdbcType = INTEGER}
            </if>
            <if test="pono !=null">
                and PTH.PONO = #{pono,jdbcType = VARCHAR}
            </if>
            <if test="hotMode !=null">
                and PTH.HOT_MODE = #{hotMode,jdbcType = VARCHAR}
            </if>
            <if test="defaultDest !=null">
                and PTH.DEFAULT_DEST = #{defaultDest,jdbcType = VARCHAR}
            </if>
            <if test="status !=null">
                and PTH.STATUS = #{status,jdbcType = VARCHAR}
            </if>
            <if test="insFlag !=null">
                and PTH.INS_FLAG = #{insFlag,jdbcType = VARCHAR}
            </if>
            <if test="tenantId !=null">
                and PTH.TENANT_ID = #{tenantId,jdbcType = INTEGER}
            </if>
            <if test="attribute1 !=null">
                and PTH.ATTRIBUTE1 = #{attribute1,jdbcType = VARCHAR}
            </if>
            <if test="attribute2 !=null">
                and PTH.ATTRIBUTE2 = #{attribute2,jdbcType = VARCHAR}
            </if>
            <if test="attribute3 !=null">
                and PTH.ATTRIBUTE3 = #{attribute3,jdbcType = VARCHAR}
            </if>
            <if test="attribute4 !=null">
                and PTH.ATTRIBUTE4 = #{attribute4,jdbcType = VARCHAR}
            </if>
            <if test="attribute5 !=null">
                and PTH.ATTRIBUTE5 = #{attribute5,jdbcType = VARCHAR}
            </if>
        </where>
    </select>
</mapper>

