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


    <sql id = "BaseSql">
    PPCLBT.TRA_ID,
    PPCLBT.OPERATION_TYPE,
    PPCLBT.OPERATION_USER,
    PPCLBT.OPERATION_TIME,
    PPCLBT.PPCLB_ID,
    PPCLBT.PLATE_THICK_FROM,
    PPCLBT.PLATE_THICK_TO,
    PPCLBT.COMBINE_PLATE_WIDTH_FROM,
    PPCLBT.COMBINE_PLATE_WIDTH_TO,
    PPCLBT.BRR_NEED,
    PPCLBT.ROLL_MODE,
    PPCLBT.ROLL_DIRECT_CODE,
    PPCLBT.MSC_LINE_NO,
    PPCLBT.PLATE_CUT_WIDTH,
    PPCLBT.CUT_HEAD_TAIL_LEN,
    PPCLBT.HEAD_CUT,
    PPCLBT.TAIL_CUT,
    PPCLBT.TENANT_ID,
    PPCLBT.ATTRIBUTE1,
    PPCLBT.ATTRIBUTE2,
    PPCLBT.ATTRIBUTE3,
    PPCLBT.ATTRIBUTE4,
    PPCLBT.ATTRIBUTE5,
    PPCLBT.SLAB_THICK_FROM,
    PPCLBT.SLAB_THICK_TO,
    PPCLBT.creation_date,    PPCLBT.created_by,    PPCLBT.last_updated_by,    PPCLBT.last_update_date,    PPCLBT.object_version_number
    </sql>

    <select id = "selectList" resultType = "com.xisc.pm.domain.entity.PmPlateCutLenBtTra">
        select
        <include refid = "BaseSql"/>
        from PM_PLATE_CUT_LEN_BT_TRA PPCLBT
        <where>
            <if test="traId !=null">
                and PPCLBT.TRA_ID = #{traId,jdbcType = INTEGER}
            </if>
            <if test="operationType !=null">
                and PPCLBT.OPERATION_TYPE = #{operationType,jdbcType = VARCHAR}
            </if>
            <if test="operationUser !=null">
                and PPCLBT.OPERATION_USER = #{operationUser,jdbcType = VARCHAR}
            </if>
            <if test="operationTime !=null">
                and PPCLBT.OPERATION_TIME = #{operationTime,jdbcType = OTHER}
            </if>
            <if test="ppclbId !=null">
                and PPCLBT.PPCLB_ID = #{ppclbId,jdbcType = INTEGER}
            </if>
            <if test="plateThickFrom !=null">
                and PPCLBT.PLATE_THICK_FROM = #{plateThickFrom,jdbcType = INTEGER}
            </if>
            <if test="plateThickTo !=null">
                and PPCLBT.PLATE_THICK_TO = #{plateThickTo,jdbcType = INTEGER}
            </if>
            <if test="combinePlateWidthFrom !=null">
                and PPCLBT.COMBINE_PLATE_WIDTH_FROM = #{combinePlateWidthFrom,jdbcType = INTEGER}
            </if>
            <if test="combinePlateWidthTo !=null">
                and PPCLBT.COMBINE_PLATE_WIDTH_TO = #{combinePlateWidthTo,jdbcType = INTEGER}
            </if>
            <if test="brrNeed !=null">
                and PPCLBT.BRR_NEED = #{brrNeed,jdbcType = VARCHAR}
            </if>
            <if test="rollMode !=null">
                and PPCLBT.ROLL_MODE = #{rollMode,jdbcType = VARCHAR}
            </if>
            <if test="rollDirectCode !=null">
                and PPCLBT.ROLL_DIRECT_CODE = #{rollDirectCode,jdbcType = VARCHAR}
            </if>
            <if test="mscLineNo !=null">
                and PPCLBT.MSC_LINE_NO = #{mscLineNo,jdbcType = VARCHAR}
            </if>
            <if test="plateCutWidth !=null">
                and PPCLBT.PLATE_CUT_WIDTH = #{plateCutWidth,jdbcType = INTEGER}
            </if>
            <if test="cutHeadTailLen !=null">
                and PPCLBT.CUT_HEAD_TAIL_LEN = #{cutHeadTailLen,jdbcType = INTEGER}
            </if>
            <if test="headCut !=null">
                and PPCLBT.HEAD_CUT = #{headCut,jdbcType = INTEGER}
            </if>
            <if test="tailCut !=null">
                and PPCLBT.TAIL_CUT = #{tailCut,jdbcType = INTEGER}
            </if>
            <if test="tenantId !=null">
                and PPCLBT.TENANT_ID = #{tenantId,jdbcType = INTEGER}
            </if>
            <if test="attribute1 !=null">
                and PPCLBT.ATTRIBUTE1 = #{attribute1,jdbcType = VARCHAR}
            </if>
            <if test="attribute2 !=null">
                and PPCLBT.ATTRIBUTE2 = #{attribute2,jdbcType = VARCHAR}
            </if>
            <if test="attribute3 !=null">
                and PPCLBT.ATTRIBUTE3 = #{attribute3,jdbcType = VARCHAR}
            </if>
            <if test="attribute4 !=null">
                and PPCLBT.ATTRIBUTE4 = #{attribute4,jdbcType = VARCHAR}
            </if>
            <if test="attribute5 !=null">
                and PPCLBT.ATTRIBUTE5 = #{attribute5,jdbcType = VARCHAR}
            </if>
            <if test="slabThickFrom !=null">
                and PPCLBT.SLAB_THICK_FROM = #{slabThickFrom,jdbcType = INTEGER}
            </if>
            <if test="slabThickTo !=null">
                and PPCLBT.SLAB_THICK_TO = #{slabThickTo,jdbcType = INTEGER}
            </if>
        </where>
    </select>
</mapper>

