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


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

    <select id = "selectList" resultType = "com.xisc.pm.domain.entity.PmThickAddvBt">
        select
        <include refid = "BaseSql"/>
        from PM_THICK_ADDV_BT PTAB
        <where>
            <if test="pptabId !=null">
                and PTAB.PPTAB_ID = #{pptabId,jdbcType = INTEGER}
            </if>
            <if test="tolTypeCode !=null">
                and PTAB.TOL_TYPE_CODE = #{tolTypeCode,jdbcType = VARCHAR}
            </if>
            <if test="wholeHeatTreatmentType !=null">
                and PTAB.WHOLE_HEAT_TREATMENT_TYPE = #{wholeHeatTreatmentType,jdbcType = VARCHAR}
            </if>
            <if test="mscLineNo !=null">
                and PTAB.MSC_LINE_NO = #{mscLineNo,jdbcType = VARCHAR}
            </if>
            <if test="plateThickFrom !=null">
                and PTAB.PLATE_THICK_FROM &lt;= #{plateThickFrom}
            </if>
            <if test="plateThickTo !=null">
                and PTAB.PLATE_THICK_FROM &lt;= #{plateThickTo}
            </if>
            <if test="plateThickTo !=null">
                and PTAB.PLATE_THICK_TO >= #{plateThickTo}
            </if>
            <if test="plateThickFrom !=null">
                and PTAB.PLATE_THICK_TO >= #{plateThickFrom}
            </if>
            <if test="combinePlateWidthFrom !=null">
                and PTAB.COMBINE_PLATE_WIDTH_FROM &lt;= #{combinePlateWidthFrom}
            </if>
            <if test="combinePlateWidthTo !=null">
                and PTAB.COMBINE_PLATE_WIDTH_FROM &lt;= #{combinePlateWidthTo}
            </if>
            <if test="combinePlateWidthTo !=null">
                and PTAB.COMBINE_PLATE_WIDTH_TO >= #{combinePlateWidthTo}
            </if>
            <if test="combinePlateWidthFrom !=null">
                and PTAB.COMBINE_PLATE_WIDTH_TO >= #{combinePlateWidthFrom}
            </if>
            <if test="thickAddv !=null">
                and PTAB.THICK_ADDV = #{thickAddv,jdbcType = INTEGER}
            </if>
            <if test="tenantId !=null">
                and PTAB.TENANT_ID = #{tenantId,jdbcType = INTEGER}
            </if>
            <if test="attribute1 !=null">
                and PTAB.ATTRIBUTE1 = #{attribute1,jdbcType = VARCHAR}
            </if>
            <if test="attribute2 !=null">
                and PTAB.ATTRIBUTE2 = #{attribute2,jdbcType = VARCHAR}
            </if>
            <if test="attribute3 !=null">
                and PTAB.ATTRIBUTE3 = #{attribute3,jdbcType = VARCHAR}
            </if>
            <if test="attribute4 !=null">
                and PTAB.ATTRIBUTE4 = #{attribute4,jdbcType = VARCHAR}
            </if>
            <if test="attribute5 !=null">
                and PTAB.ATTRIBUTE5 = #{attribute5,jdbcType = VARCHAR}
            </if>
        </where>
    </select>
</mapper>
