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


    <sql id = "BaseSql">
    PIYB.PIYB_ID,
    PIYB.INGOT_TYPE,
    PIYB.YIELD,
    PIYB.TENANT_ID,
    PIYB.ATTRIBUTE1,
    PIYB.ATTRIBUTE2,
    PIYB.ATTRIBUTE3,
    PIYB.ATTRIBUTE4,
    PIYB.ATTRIBUTE5,
    PIYB.creation_date,    PIYB.created_by,    PIYB.last_updated_by,    PIYB.last_update_date,    PIYB.object_version_number
    </sql>

    <select id = "selectList" resultType = "com.xisc.pm.domain.entity.PmIngotYieldBt">
        select
        <include refid = "BaseSql"/>
        from PM_INGOT_YIELD_BT PIYB
        <where>
            <if test="piybId !=null">
                and PIYB.PIYB_ID = #{piybId,jdbcType = INTEGER}
            </if>
            <if test="ingotType !=null">
                and PIYB.INGOT_TYPE = #{ingotType,jdbcType = VARCHAR}
            </if>
            <if test="yield !=null">
                and PIYB.YIELD = #{yield}
            </if>
            <if test="tenantId !=null">
                and PIYB.TENANT_ID = #{tenantId,jdbcType = INTEGER}
            </if>
            <if test="attribute1 !=null">
                and PIYB.ATTRIBUTE1 = #{attribute1,jdbcType = VARCHAR}
            </if>
            <if test="attribute2 !=null">
                and PIYB.ATTRIBUTE2 = #{attribute2,jdbcType = VARCHAR}
            </if>
            <if test="attribute3 !=null">
                and PIYB.ATTRIBUTE3 = #{attribute3,jdbcType = VARCHAR}
            </if>
            <if test="attribute4 !=null">
                and PIYB.ATTRIBUTE4 = #{attribute4,jdbcType = VARCHAR}
            </if>
            <if test="attribute5 !=null">
                and PIYB.ATTRIBUTE5 = #{attribute5,jdbcType = VARCHAR}
            </if>
        </where>
    </select>
</mapper>
