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


    <sql id = "BaseSql">
    PPTYBT.TRA_ID,
    PPTYBT.OPERATION_TYPE,
    PPTYBT.OPERATION_USER,
    PPTYBT.OPERATION_TIME,
    PPTYBT.PPTYB_ID,
    PPTYBT.CC_TYPE,
    PPTYBT.PROD_CODE_HP,
    PPTYBT.WITH_SIDE_FLAG,
    PPTYBT.SLAB_THICK_FROM,
    PPTYBT.SLAB_THICK_TO,
    PPTYBT.SLAB_WIDTH_FROM,
    PPTYBT.SLAB_WIDTH_TO,
    PPTYBT.PLATE_THICK_FROM,
    PPTYBT.PLATE_THICK_TO,
    PPTYBT.TMP_YIELD,
    PPTYBT.ROLL_LINE_NO,
    PPTYBT.TENANT_ID,
    PPTYBT.ATTRIBUTE1,
    PPTYBT.ATTRIBUTE2,
    PPTYBT.ATTRIBUTE3,
    PPTYBT.ATTRIBUTE4,
    PPTYBT.ATTRIBUTE5,
    PPTYBT.creation_date,    PPTYBT.created_by,    PPTYBT.last_updated_by,    PPTYBT.last_update_date,    PPTYBT.object_version_number
    </sql>

    <select id = "selectList" resultType = "com.xisc.pm.domain.entity.PmPdTmpYieldBtTra">
        select
        <include refid = "BaseSql"/>
        from PM_PD_TMP_YIELD_BT_TRA PPTYBT
        <where>
            <if test="traId !=null">
                and PPTYBT.TRA_ID = #{traId,jdbcType = INTEGER}
            </if>
            <if test="operationType !=null">
                and PPTYBT.OPERATION_TYPE = #{operationType,jdbcType = VARCHAR}
            </if>
            <if test="operationUser !=null">
                and PPTYBT.OPERATION_USER = #{operationUser,jdbcType = VARCHAR}
            </if>
            <if test="operationTime !=null">
                and PPTYBT.OPERATION_TIME = #{operationTime,jdbcType = OTHER}
            </if>
            <if test="pptybId !=null">
                and PPTYBT.PPTYB_ID = #{pptybId,jdbcType = INTEGER}
            </if>
            <if test="ccType !=null">
                and PPTYBT.CC_TYPE = #{ccType,jdbcType = VARCHAR}
            </if>
            <if test="prodCodeHp !=null">
                and PPTYBT.PROD_CODE_HP = #{prodCodeHp,jdbcType = VARCHAR}
            </if>
            <if test="withSideFlag !=null">
                and PPTYBT.WITH_SIDE_FLAG = #{withSideFlag,jdbcType = VARCHAR}
            </if>
            <if test="slabThickFrom !=null">
                and PPTYBT.SLAB_THICK_FROM = #{slabThickFrom,jdbcType = INTEGER}
            </if>
            <if test="slabThickTo !=null">
                and PPTYBT.SLAB_THICK_TO = #{slabThickTo,jdbcType = INTEGER}
            </if>
            <if test="slabWidthFrom !=null">
                and PPTYBT.SLAB_WIDTH_FROM = #{slabWidthFrom,jdbcType = INTEGER}
            </if>
            <if test="slabWidthTo !=null">
                and PPTYBT.SLAB_WIDTH_TO = #{slabWidthTo,jdbcType = INTEGER}
            </if>
            <if test="plateThickFrom !=null">
                and PPTYBT.PLATE_THICK_FROM = #{plateThickFrom,jdbcType = INTEGER}
            </if>
            <if test="plateThickTo !=null">
                and PPTYBT.PLATE_THICK_TO = #{plateThickTo,jdbcType = INTEGER}
            </if>
            <if test="tmpYield !=null">
                and PPTYBT.TMP_YIELD = #{tmpYield,jdbcType = INTEGER}
            </if>
            <if test="rollLineNo !=null">
                and PPTYBT.ROLL_LINE_NO = #{rollLineNo,jdbcType = VARCHAR}
            </if>
            <if test="tenantId !=null">
                and PPTYBT.TENANT_ID = #{tenantId,jdbcType = INTEGER}
            </if>
            <if test="attribute1 !=null">
                and PPTYBT.ATTRIBUTE1 = #{attribute1,jdbcType = VARCHAR}
            </if>
            <if test="attribute2 !=null">
                and PPTYBT.ATTRIBUTE2 = #{attribute2,jdbcType = VARCHAR}
            </if>
            <if test="attribute3 !=null">
                and PPTYBT.ATTRIBUTE3 = #{attribute3,jdbcType = VARCHAR}
            </if>
            <if test="attribute4 !=null">
                and PPTYBT.ATTRIBUTE4 = #{attribute4,jdbcType = VARCHAR}
            </if>
            <if test="attribute5 !=null">
                and PPTYBT.ATTRIBUTE5 = #{attribute5,jdbcType = VARCHAR}
            </if>
        </where>
    </select>
</mapper>

