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


    <sql id = "BaseSql">
    PSSLBT.TRA_ID,
    PSSLBT.OPERATION_TYPE,
    PSSLBT.OPERATION_USER,
    PSSLBT.OPERATION_TIME,
    PSSLBT.PSSLB_ID,
    PSSLBT.SLAB_THICK_FROM,
    PSSLBT.SLAB_THICK_TO,
    PSSLBT.SLAB_WIDTH_FROM,
    PSSLBT.SLAB_WIDTH_TO,
    PSSLBT.SLAB_MIN_LEN,
    PSSLBT.SLAB_MAX_LEN,
    PSSLBT.CAN_SCRAP_LEN,
    PSSLBT.ROLL_LINE_NO,
    PSSLBT.TENANT_ID,
    PSSLBT.creation_date,    PSSLBT.created_by,    PSSLBT.last_updated_by,    PSSLBT.last_update_date,    PSSLBT.object_version_number
    </sql>

    <select id = "selectList" resultType = "com.xisc.pm.domain.entity.PmSlabScrapLenBtTra">
        select
        <include refid = "BaseSql"/>
        from PM_SLAB_SCRAP_LEN_BT_TRA PSSLBT
        <where>
            <if test="traId !=null">
                and PSSLBT.TRA_ID = #{traId,jdbcType = INTEGER}
            </if>
            <if test="operationType !=null">
                and PSSLBT.OPERATION_TYPE = #{operationType,jdbcType = VARCHAR}
            </if>
            <if test="operationUser !=null">
                and PSSLBT.OPERATION_USER = #{operationUser,jdbcType = VARCHAR}
            </if>
            <if test="operationTime !=null">
                and PSSLBT.OPERATION_TIME = #{operationTime,jdbcType = OTHER}
            </if>
            <if test="psslbId !=null">
                and PSSLBT.PSSLB_ID = #{psslbId,jdbcType = INTEGER}
            </if>
            <if test="slabThickFrom !=null">
                and PSSLBT.SLAB_THICK_FROM = #{slabThickFrom,jdbcType = INTEGER}
            </if>
            <if test="slabThickTo !=null">
                and PSSLBT.SLAB_THICK_TO = #{slabThickTo,jdbcType = INTEGER}
            </if>
            <if test="slabWidthFrom !=null">
                and PSSLBT.SLAB_WIDTH_FROM = #{slabWidthFrom,jdbcType = INTEGER}
            </if>
            <if test="slabWidthTo !=null">
                and PSSLBT.SLAB_WIDTH_TO = #{slabWidthTo,jdbcType = INTEGER}
            </if>
            <if test="slabMinLen !=null">
                and PSSLBT.SLAB_MIN_LEN = #{slabMinLen,jdbcType = INTEGER}
            </if>
            <if test="slabMaxLen !=null">
                and PSSLBT.SLAB_MAX_LEN = #{slabMaxLen,jdbcType = INTEGER}
            </if>
            <if test="canScrapLen !=null">
                and PSSLBT.CAN_SCRAP_LEN = #{canScrapLen,jdbcType = INTEGER}
            </if>
            <if test="rollLineNo !=null">
                and PSSLBT.ROLL_LINE_NO = #{rollLineNo,jdbcType = VARCHAR}
            </if>
            <if test="tenantId !=null">
                and PSSLBT.TENANT_ID = #{tenantId,jdbcType = INTEGER}
            </if>
        </where>
    </select>
</mapper>

