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


    <sql id = "BaseSql">
    PICLBT.TRA_ID,
    PICLBT.OPERATION_TYPE,
    PICLBT.OPERATION_USER,
    PICLBT.OPERATION_TIME,
    PICLBT.PICLB_ID,
    PICLBT.PLATE_THICK_FROM,
    PICLBT.PLATE_THICK_TO,
    PICLBT.PLATE_CUT_WIDTH,
    PICLBT.TENANT_ID,
    PICLBT.ATTRIBUTE1,
    PICLBT.ATTRIBUTE2,
    PICLBT.ATTRIBUTE3,
    PICLBT.ATTRIBUTE4,
    PICLBT.ATTRIBUTE5,
    PICLBT.creation_date,    PICLBT.created_by,    PICLBT.last_updated_by,    PICLBT.last_update_date,    PICLBT.object_version_number
    </sql>

    <select id = "selectList" resultType = "com.xisc.pm.domain.entity.PmIngotCutLenBtTra">
        select
        <include refid = "BaseSql"/>
        from PM_INGOT_CUT_LEN_BT_TRA PICLBT
        <where>
            <if test="traId !=null">
                and PICLBT.TRA_ID = #{traId,jdbcType = INTEGER}
            </if>
            <if test="operationType !=null">
                and PICLBT.OPERATION_TYPE = #{operationType,jdbcType = VARCHAR}
            </if>
            <if test="operationUser !=null">
                and PICLBT.OPERATION_USER = #{operationUser,jdbcType = VARCHAR}
            </if>
            <if test="operationTime !=null">
                and PICLBT.OPERATION_TIME = #{operationTime,jdbcType = OTHER}
            </if>
            <if test="piclbId !=null">
                and PICLBT.PICLB_ID = #{piclbId,jdbcType = INTEGER}
            </if>
            <if test="plateThickFrom !=null">
                and PICLBT.PLATE_THICK_FROM = #{plateThickFrom,jdbcType = INTEGER}
            </if>
            <if test="plateThickTo !=null">
                and PICLBT.PLATE_THICK_TO = #{plateThickTo,jdbcType = INTEGER}
            </if>
            <if test="plateCutWidth !=null">
                and PICLBT.PLATE_CUT_WIDTH = #{plateCutWidth,jdbcType = INTEGER}
            </if>
            <if test="tenantId !=null">
                and PICLBT.TENANT_ID = #{tenantId,jdbcType = INTEGER}
            </if>
            <if test="attribute1 !=null">
                and PICLBT.ATTRIBUTE1 = #{attribute1,jdbcType = VARCHAR}
            </if>
            <if test="attribute2 !=null">
                and PICLBT.ATTRIBUTE2 = #{attribute2,jdbcType = VARCHAR}
            </if>
            <if test="attribute3 !=null">
                and PICLBT.ATTRIBUTE3 = #{attribute3,jdbcType = VARCHAR}
            </if>
            <if test="attribute4 !=null">
                and PICLBT.ATTRIBUTE4 = #{attribute4,jdbcType = VARCHAR}
            </if>
            <if test="attribute5 !=null">
                and PICLBT.ATTRIBUTE5 = #{attribute5,jdbcType = VARCHAR}
            </if>
        </where>
    </select>
</mapper>

