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


    <sql id = "BaseSql">
    PITAB.PITAB_ID,
    PITAB.INGOT_TYPE,
    PITAB.PLATE_THICK_FROM,
    PITAB.PLATE_THICK_TO,
    PITAB.COMBINE_PLATE_WIDTH_FROM,
    PITAB.COMBINE_PLATE_WIDTH_TO,
    PITAB.HEAT_TREAT_MODE,
    PITAB.ROLL_MODE,
    PITAB.ROLL_DIRECT_CODE,
    PITAB.THICK_ADDV,
    PITAB.TENANT_ID,
    PITAB.ATTRIBUTE1,
    PITAB.ATTRIBUTE2,
    PITAB.ATTRIBUTE3,
    PITAB.ATTRIBUTE4,
    PITAB.ATTRIBUTE5,
    PITAB.creation_date,    PITAB.created_by,    PITAB.last_updated_by,    PITAB.last_update_date,    PITAB.object_version_number
    </sql>

    <select id = "selectList" resultType = "com.xisc.pm.domain.entity.PmIngotThickAddvBt">
        select
        <include refid = "BaseSql"/>
        from PM_INGOT_THICK_ADDV_BT PITAB
        <where>
            <if test="pitabId !=null">
                and PITAB.PITAB_ID = #{pitabId,jdbcType = INTEGER}
            </if>
            <if test="ingotType !=null">
                and PITAB.INGOT_TYPE = #{ingotType,jdbcType = VARCHAR}
            </if>
            <if test="plateThickFrom !=null">
                and PITAB.PLATE_THICK_FROM <![CDATA[ <= ]]> #{plateThickFrom}
            </if>
            <if test="plateThickTo !=null">
                and PITAB.PLATE_THICK_FROM <![CDATA[ <= ]]> #{plateThickTo}
            </if>
            <if test="plateThickTo !=null">
                and PITAB.PLATE_THICK_TO <![CDATA[ >= ]]> #{plateThickTo}
            </if>
            <if test="plateThickFrom !=null">
                and PITAB.PLATE_THICK_TO <![CDATA[ >= ]]> #{plateThickFrom}
            </if>
            <if test="combinePlateWidthFrom !=null">
                and PITAB.COMBINE_PLATE_WIDTH_FROM <![CDATA[ <= ]]> #{combinePlateWidthFrom}
            </if>
            <if test="combinePlateWidthTo !=null">
                and PITAB.COMBINE_PLATE_WIDTH_FROM <![CDATA[ <= ]]> #{combinePlateWidthTo}
            </if>
            <if test="combinePlateWidthTo !=null">
                and PITAB.COMBINE_PLATE_WIDTH_TO <![CDATA[ >= ]]> #{combinePlateWidthTo}
            </if>
            <if test="combinePlateWidthFrom !=null">
                and PITAB.COMBINE_PLATE_WIDTH_TO <![CDATA[ >= ]]> #{combinePlateWidthFrom}
            </if>
            <if test="heatTreatMode !=null">
                and PITAB.HEAT_TREAT_MODE = #{heatTreatMode,jdbcType = VARCHAR}
            </if>
            <if test="rollMode !=null">
                and PITAB.ROLL_MODE = #{rollMode,jdbcType = VARCHAR}
            </if>
            <if test="rollDirectCode !=null">
                and PITAB.ROLL_DIRECT_CODE = #{rollDirectCode,jdbcType = VARCHAR}
            </if>
            <if test="thickAddv !=null">
                and PITAB.THICK_ADDV = #{thickAddv,jdbcType = INTEGER}
            </if>
            <if test="tenantId !=null">
                and PITAB.TENANT_ID = #{tenantId,jdbcType = INTEGER}
            </if>
            <if test="attribute1 !=null">
                and PITAB.ATTRIBUTE1 = #{attribute1,jdbcType = VARCHAR}
            </if>
            <if test="attribute2 !=null">
                and PITAB.ATTRIBUTE2 = #{attribute2,jdbcType = VARCHAR}
            </if>
            <if test="attribute3 !=null">
                and PITAB.ATTRIBUTE3 = #{attribute3,jdbcType = VARCHAR}
            </if>
            <if test="attribute4 !=null">
                and PITAB.ATTRIBUTE4 = #{attribute4,jdbcType = VARCHAR}
            </if>
            <if test="attribute5 !=null">
                and PITAB.ATTRIBUTE5 = #{attribute5,jdbcType = VARCHAR}
            </if>
        </where>
    </select>
</mapper>
