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


    <sql id = "BaseSql">
    PTABT.TRA_ID,
    PTABT.OPERATION_TYPE,
    PTABT.OPERATION_USER,
    PTABT.OPERATION_TIME,
    PTABT.PPTAB_ID,
    PTABT.TOL_TYPE_CODE,
    PTABT.WHOLE_HEAT_TREATMENT_TYPE,
    PTABT.MSC_LINE_NO,
    PTABT.PLATE_THICK_FROM,
    PTABT.PLATE_THICK_TO,
    PTABT.COMBINE_PLATE_WIDTH_FROM,
    PTABT.COMBINE_PLATE_WIDTH_TO,
    PTABT.THICK_ADDV,
    PTABT.TENANT_ID,
    PTABT.ATTRIBUTE1,
    PTABT.ATTRIBUTE2,
    PTABT.ATTRIBUTE3,
    PTABT.ATTRIBUTE4,
    PTABT.ATTRIBUTE5,
    PTABT.creation_date,    PTABT.created_by,    PTABT.last_updated_by,    PTABT.last_update_date,    PTABT.object_version_number
    </sql>

    <select id = "selectList" resultType = "com.xisc.pm.domain.entity.PmThickAddvBtTra">
        select
        <include refid = "BaseSql"/>
        from PM_THICK_ADDV_BT_TRA PTABT
        <where>
            <if test="traId !=null">
                and PTABT.TRA_ID = #{traId,jdbcType = INTEGER}
            </if>
            <if test="operationType !=null">
                and PTABT.OPERATION_TYPE = #{operationType,jdbcType = VARCHAR}
            </if>
            <if test="operationUser !=null">
                and PTABT.OPERATION_USER = #{operationUser,jdbcType = VARCHAR}
            </if>
            <if test="operationTime !=null">
                and PTABT.OPERATION_TIME = #{operationTime,jdbcType = OTHER}
            </if>
            <if test="pptabId !=null">
                and PTABT.PPTAB_ID = #{pptabId,jdbcType = INTEGER}
            </if>
            <if test="tolTypeCode !=null">
                and PTABT.TOL_TYPE_CODE = #{tolTypeCode,jdbcType = VARCHAR}
            </if>
            <if test="wholeHeatTreatmentType !=null">
                and PTABT.WHOLE_HEAT_TREATMENT_TYPE = #{wholeHeatTreatmentType,jdbcType = VARCHAR}
            </if>
            <if test="mscLineNo !=null">
                and PTABT.MSC_LINE_NO = #{mscLineNo,jdbcType = VARCHAR}
            </if>
            <if test="plateThickFrom !=null">
                and PTABT.PLATE_THICK_FROM = #{plateThickFrom,jdbcType = INTEGER}
            </if>
            <if test="plateThickTo !=null">
                and PTABT.PLATE_THICK_TO = #{plateThickTo,jdbcType = INTEGER}
            </if>
            <if test="combinePlateWidthFrom !=null">
                and PTABT.COMBINE_PLATE_WIDTH_FROM = #{combinePlateWidthFrom,jdbcType = INTEGER}
            </if>
            <if test="combinePlateWidthTo !=null">
                and PTABT.COMBINE_PLATE_WIDTH_TO = #{combinePlateWidthTo,jdbcType = INTEGER}
            </if>
            <if test="thickAddv !=null">
                and PTABT.THICK_ADDV = #{thickAddv,jdbcType = INTEGER}
            </if>
            <if test="tenantId !=null">
                and PTABT.TENANT_ID = #{tenantId,jdbcType = INTEGER}
            </if>
            <if test="attribute1 !=null">
                and PTABT.ATTRIBUTE1 = #{attribute1,jdbcType = VARCHAR}
            </if>
            <if test="attribute2 !=null">
                and PTABT.ATTRIBUTE2 = #{attribute2,jdbcType = VARCHAR}
            </if>
            <if test="attribute3 !=null">
                and PTABT.ATTRIBUTE3 = #{attribute3,jdbcType = VARCHAR}
            </if>
            <if test="attribute4 !=null">
                and PTABT.ATTRIBUTE4 = #{attribute4,jdbcType = VARCHAR}
            </if>
            <if test="attribute5 !=null">
                and PTABT.ATTRIBUTE5 = #{attribute5,jdbcType = VARCHAR}
            </if>
        </where>
    </select>
</mapper>
