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


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

    <select id = "selectList" resultType = "com.xisc.pm.domain.entity.PmIngotYieldBtTra">
        select
        <include refid = "BaseSql"/>
        from PM_INGOT_YIELD_BT_TRA PIYBT
        <where>
            <if test="traId !=null">
                and PIYBT.TRA_ID = #{traId,jdbcType = INTEGER}
            </if>
            <if test="operationType !=null">
                and PIYBT.OPERATION_TYPE = #{operationType,jdbcType = VARCHAR}
            </if>
            <if test="operationUser !=null">
                and PIYBT.OPERATION_USER = #{operationUser,jdbcType = VARCHAR}
            </if>
            <if test="operationTime !=null">
                and PIYBT.OPERATION_TIME = #{operationTime,jdbcType = OTHER}
            </if>
            <if test="piybId !=null">
                and PIYBT.PIYB_ID = #{piybId,jdbcType = INTEGER}
            </if>
            <if test="ingotType !=null">
                and PIYBT.INGOT_TYPE = #{ingotType,jdbcType = VARCHAR}
            </if>
            <if test="yield !=null">
                and PIYBT.YIELD = #{yield,jdbcType = INTEGER}
            </if>
            <if test="tenantId !=null">
                and PIYBT.TENANT_ID = #{tenantId,jdbcType = INTEGER}
            </if>
            <if test="attribute1 !=null">
                and PIYBT.ATTRIBUTE1 = #{attribute1,jdbcType = VARCHAR}
            </if>
            <if test="attribute2 !=null">
                and PIYBT.ATTRIBUTE2 = #{attribute2,jdbcType = VARCHAR}
            </if>
            <if test="attribute3 !=null">
                and PIYBT.ATTRIBUTE3 = #{attribute3,jdbcType = VARCHAR}
            </if>
            <if test="attribute4 !=null">
                and PIYBT.ATTRIBUTE4 = #{attribute4,jdbcType = VARCHAR}
            </if>
            <if test="attribute5 !=null">
                and PIYBT.ATTRIBUTE5 = #{attribute5,jdbcType = VARCHAR}
            </if>
        </where>
    </select>
</mapper>

