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


    <sql id = "BaseSql">
    PPTAB.PPTAB_ID,
    PPTAB.ST_CODE,
    PPTAB.FORM_PLATE_MODE,
    PPTAB.AD_TYPE_MODE,
    PPTAB.ROLL_DIRECT_CODE,
    PPTAB.ROLL_MODE,
    PPTAB.HEAT_TREAT_MODE,
    PPTAB.ROLL_LINE_NO,
    PPTAB.PLATE_THICK_FROM,
    PPTAB.PLATE_THICK_TO,
    PPTAB.COMBINE_PLATE_WIDTH_FROM,
    PPTAB.COMBINE_PLATE_WIDTH_TO,
    PPTAB.TENANT_ID,
    PPTAB.ATTRIBUTE1,
    PPTAB.ATTRIBUTE2,
    PPTAB.ATTRIBUTE3,
    PPTAB.ATTRIBUTE4,
    PPTAB.ATTRIBUTE5,
    PPTAB.COMBINE_PLATE_LEN_MIN,
    PPTAB.COMBINE_PLATE_LEN_MAX,
    PPTAB.THICK_ADDV,
    PPTAB.REMARK,
    PPTAB.creation_date,    PPTAB.created_by,    PPTAB.last_updated_by,    PPTAB.last_update_date,    PPTAB.object_version_number
    </sql>

    <select id = "selectList" resultType = "com.xisc.pm.domain.entity.PmPlateThickAddvBt">
        select
        <include refid = "BaseSql"/>
        from PM_PLATE_THICK_ADDV_BT PPTAB
        <where>
            <if test="pptabId !=null">
                and PPTAB.PPTAB_ID = #{pptabId,jdbcType = INTEGER}
            </if>
            <if test="stCode !=null">
                and PPTAB.ST_CODE = #{stCode,jdbcType = VARCHAR}
            </if>
            <if test="formPlateMode !=null">
                and PPTAB.FORM_PLATE_MODE = #{formPlateMode,jdbcType = VARCHAR}
            </if>
            <if test="adTypeMode !=null">
                and PPTAB.AD_TYPE_MODE = #{adTypeMode,jdbcType = VARCHAR}
            </if>
            <if test="rollDirectCode !=null">
                and PPTAB.ROLL_DIRECT_CODE = #{rollDirectCode,jdbcType = VARCHAR}
            </if>
            <if test="rollMode !=null">
                and PPTAB.ROLL_MODE = #{rollMode,jdbcType = VARCHAR}
            </if>
            <if test="heatTreatMode !=null">
                and PPTAB.HEAT_TREAT_MODE = #{heatTreatMode,jdbcType = VARCHAR}
            </if>
            <if test="rollLineNo !=null">
                and PPTAB.ROLL_LINE_NO = #{rollLineNo,jdbcType = VARCHAR}
            </if>
            <if test="plateThickFrom !=null">
                and PPTAB.PLATE_THICK_FROM <![CDATA[ >= ]]> #{plateThickFrom,jdbcType = INTEGER}
            </if>
            <if test="plateThickTo !=null">
                and PPTAB.PLATE_THICK_TO <![CDATA[ <= ]]> #{plateThickTo,jdbcType = INTEGER}
            </if>
            <if test="combinePlateWidthFrom !=null">
                and PPTAB.COMBINE_PLATE_WIDTH_FROM <![CDATA[ >= ]]> #{combinePlateWidthFrom,jdbcType = INTEGER}
            </if>
            <if test="combinePlateWidthTo !=null">
                and PPTAB.COMBINE_PLATE_WIDTH_TO <![CDATA[ <= ]]> #{combinePlateWidthTo,jdbcType = INTEGER}
            </if>
            <if test="tenantId !=null">
                and PPTAB.TENANT_ID = #{tenantId,jdbcType = INTEGER}
            </if>
            <if test="attribute1 !=null">
                and PPTAB.ATTRIBUTE1 = #{attribute1,jdbcType = VARCHAR}
            </if>
            <if test="attribute2 !=null">
                and PPTAB.ATTRIBUTE2 = #{attribute2,jdbcType = VARCHAR}
            </if>
            <if test="attribute3 !=null">
                and PPTAB.ATTRIBUTE3 = #{attribute3,jdbcType = VARCHAR}
            </if>
            <if test="attribute4 !=null">
                and PPTAB.ATTRIBUTE4 = #{attribute4,jdbcType = VARCHAR}
            </if>
            <if test="attribute5 !=null">
                and PPTAB.ATTRIBUTE5 = #{attribute5,jdbcType = VARCHAR}
            </if>
            <if test="combinePlateLenMin !=null">
                and PPTAB.COMBINE_PLATE_LEN_MIN = #{combinePlateLenMin,jdbcType = INTEGER}
            </if>
            <if test="combinePlateLenMax !=null">
                and PPTAB.COMBINE_PLATE_LEN_MAX = #{combinePlateLenMax,jdbcType = INTEGER}
            </if>
            <if test="thickAddv !=null">
                and PPTAB.THICK_ADDV = #{thickAddv,jdbcType = INTEGER}
            </if>
            <if test="remark !=null">
                <bind name="remarkLike" value="'%' + remark + '%'"/>
                and PPTAB.REMARK  like #{remarkLike}
            </if>
        </where>
    </select>
</mapper>

