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


    <sql id = "BaseSql">
    PHTFBT.TRA_ID,
    PHTFBT.OPERATION_TYPE,
    PHTFBT.OPERATION_USER,
    PHTFBT.OPERATION_TIME,
    PHTFBT.PHTFB_ID,
    PHTFBT.HEAT_TREAT_FURNACE_NO,
    PHTFBT.HEAT_TREAT_LEN_FROM,
    PHTFBT.HEAT_TREAT_LEN_TO,
    PHTFBT.HEAT_TREAT_WIDTH_FROM,
    PHTFBT.HEAT_TREAT_WIDTH_TO,
    PHTFBT.HEAT_TREAT_WT,
    PHTFBT.TENANT_ID,
    PHTFBT.ATTRIBUTE1,
    PHTFBT.ATTRIBUTE2,
    PHTFBT.ATTRIBUTE3,
    PHTFBT.ATTRIBUTE4,
    PHTFBT.ATTRIBUTE5,
    PHTFBT.creation_date,    PHTFBT.created_by,    PHTFBT.last_updated_by,    PHTFBT.last_update_date,    PHTFBT.object_version_number
    </sql>

    <select id = "selectList" resultType = "com.xisc.pm.domain.entity.PmHeatTreatFurnaceBtTra">
        select
        <include refid = "BaseSql"/>
        from PM_HEAT_TREAT_FURNACE_BT_TRA PHTFBT
        <where>
            <if test="traId !=null">
                and PHTFBT.TRA_ID = #{traId,jdbcType = INTEGER}
            </if>
            <if test="operationType !=null">
                and PHTFBT.OPERATION_TYPE = #{operationType,jdbcType = VARCHAR}
            </if>
            <if test="operationUser !=null">
                and PHTFBT.OPERATION_USER = #{operationUser,jdbcType = VARCHAR}
            </if>
            <if test="operationTime !=null">
                and PHTFBT.OPERATION_TIME = #{operationTime,jdbcType = OTHER}
            </if>
            <if test="phtfbId !=null">
                and PHTFBT.PHTFB_ID = #{phtfbId,jdbcType = INTEGER}
            </if>
            <if test="heatTreatFurnaceNo !=null">
                and PHTFBT.HEAT_TREAT_FURNACE_NO = #{heatTreatFurnaceNo,jdbcType = VARCHAR}
            </if>
            <if test="heatTreatLenFrom !=null">
                and PHTFBT.HEAT_TREAT_LEN_FROM = #{heatTreatLenFrom,jdbcType = INTEGER}
            </if>
            <if test="heatTreatLenTo !=null">
                and PHTFBT.HEAT_TREAT_LEN_TO = #{heatTreatLenTo,jdbcType = INTEGER}
            </if>
            <if test="heatTreatWidthFrom !=null">
                and PHTFBT.HEAT_TREAT_WIDTH_FROM = #{heatTreatWidthFrom,jdbcType = INTEGER}
            </if>
            <if test="heatTreatWidthTo !=null">
                and PHTFBT.HEAT_TREAT_WIDTH_TO = #{heatTreatWidthTo,jdbcType = INTEGER}
            </if>
            <if test="heatTreatWt !=null">
                and PHTFBT.HEAT_TREAT_WT = #{heatTreatWt,jdbcType = INTEGER}
            </if>
            <if test="tenantId !=null">
                and PHTFBT.TENANT_ID = #{tenantId,jdbcType = INTEGER}
            </if>
            <if test="attribute1 !=null">
                and PHTFBT.ATTRIBUTE1 = #{attribute1,jdbcType = VARCHAR}
            </if>
            <if test="attribute2 !=null">
                and PHTFBT.ATTRIBUTE2 = #{attribute2,jdbcType = VARCHAR}
            </if>
            <if test="attribute3 !=null">
                and PHTFBT.ATTRIBUTE3 = #{attribute3,jdbcType = VARCHAR}
            </if>
            <if test="attribute4 !=null">
                and PHTFBT.ATTRIBUTE4 = #{attribute4,jdbcType = VARCHAR}
            </if>
            <if test="attribute5 !=null">
                and PHTFBT.ATTRIBUTE5 = #{attribute5,jdbcType = VARCHAR}
            </if>
        </where>
    </select>
</mapper>

