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


    <sql id = "BaseSql">
    PPTBT.TRA_ID,
    PPTBT.OPERATION_TYPE,
    PPTBT.OPERATION_USER,
    PPTBT.OPERATION_TIME,
    PPTBT.PPTB_ID,
    PPTBT.PLATE_THICK_FROM,
    PPTBT.PLATE_THICK_TO,
    PPTBT.COMBINE_PLATE_WIDTH_FROM,
    PPTBT.COMBINE_PLATE_WIDTH_TO,
    PPTBT.SMALL_PLATE_LEN_FROM,
    PPTBT.SMALL_PLATE_LEN_TO,
    PPTBT.WITH_SIDE_FLAG,
    PPTBT.TRIM_WIDTH,
    PPTBT.MSC_LINE_NO,
    PPTBT.TENANT_ID,
    PPTBT.ATTRIBUTE1,
    PPTBT.ATTRIBUTE2,
    PPTBT.ATTRIBUTE3,
    PPTBT.ATTRIBUTE4,
    PPTBT.ATTRIBUTE5,
    PPTBT.WIDEN_FROM,
    PPTBT.WIDEN_TO,
    PPTBT.creation_date,    PPTBT.created_by,    PPTBT.last_updated_by,    PPTBT.last_update_date,    PPTBT.object_version_number
    </sql>

    <select id = "selectList" resultType = "com.xisc.pm.domain.entity.PmPlateTrimBtTra">
        select
        <include refid = "BaseSql"/>
        from PM_PLATE_TRIM_BT_TRA PPTBT
        <where>
            <if test="traId !=null">
                and PPTBT.TRA_ID = #{traId,jdbcType = INTEGER}
            </if>
            <if test="operationType !=null">
                and PPTBT.OPERATION_TYPE = #{operationType,jdbcType = VARCHAR}
            </if>
            <if test="operationUser !=null">
                and PPTBT.OPERATION_USER = #{operationUser,jdbcType = VARCHAR}
            </if>
            <if test="operationTime !=null">
                and PPTBT.OPERATION_TIME = #{operationTime,jdbcType = OTHER}
            </if>
            <if test="pptbId !=null">
                and PPTBT.PPTB_ID = #{pptbId,jdbcType = INTEGER}
            </if>
            <if test="plateThickFrom !=null">
                and PPTBT.PLATE_THICK_FROM = #{plateThickFrom,jdbcType = INTEGER}
            </if>
            <if test="plateThickTo !=null">
                and PPTBT.PLATE_THICK_TO = #{plateThickTo,jdbcType = INTEGER}
            </if>
            <if test="combinePlateWidthFrom !=null">
                and PPTBT.COMBINE_PLATE_WIDTH_FROM = #{combinePlateWidthFrom,jdbcType = INTEGER}
            </if>
            <if test="combinePlateWidthTo !=null">
                and PPTBT.COMBINE_PLATE_WIDTH_TO = #{combinePlateWidthTo,jdbcType = INTEGER}
            </if>
            <if test="smallPlateLenFrom !=null">
                and PPTBT.SMALL_PLATE_LEN_FROM = #{smallPlateLenFrom,jdbcType = INTEGER}
            </if>
            <if test="smallPlateLenTo !=null">
                and PPTBT.SMALL_PLATE_LEN_TO = #{smallPlateLenTo,jdbcType = INTEGER}
            </if>
            <if test="withSideFlag !=null">
                and PPTBT.WITH_SIDE_FLAG = #{withSideFlag,jdbcType = VARCHAR}
            </if>
            <if test="rollDirectCode !=null">
                and PPTBT.ROLL_DIRECT_CODE = #{rollDirectCode,jdbcType = VARCHAR}
            </if>
            <if test="trimWidth !=null">
                and PPTBT.TRIM_WIDTH = #{trimWidth,jdbcType = INTEGER}
            </if>
            <if test="mscLineNo !=null">
                and PPTBT.MSC_LINE_NO = #{mscLineNo,jdbcType = VARCHAR}
            </if>
            <if test="tenantId !=null">
                and PPTBT.TENANT_ID = #{tenantId,jdbcType = INTEGER}
            </if>
            <if test="attribute1 !=null">
                and PPTBT.ATTRIBUTE1 = #{attribute1,jdbcType = VARCHAR}
            </if>
            <if test="attribute2 !=null">
                and PPTBT.ATTRIBUTE2 = #{attribute2,jdbcType = VARCHAR}
            </if>
            <if test="attribute3 !=null">
                and PPTBT.ATTRIBUTE3 = #{attribute3,jdbcType = VARCHAR}
            </if>
            <if test="attribute4 !=null">
                and PPTBT.ATTRIBUTE4 = #{attribute4,jdbcType = VARCHAR}
            </if>
            <if test="attribute5 !=null">
                and PPTBT.ATTRIBUTE5 = #{attribute5,jdbcType = VARCHAR}
            </if>
        </where>
    </select>
</mapper>

