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


    <sql id = "BaseSql">
    PMTTBT.TRA_ID,
    PMTTBT.OPERATION_TYPE,
    PMTTBT.OPERATION_USER,
    PMTTBT.OPERATION_TIME,
    PMTTBT.PMTTB_ID,
    PMTTBT.PLATE_THICK_FROM,
    PMTTBT.PLATE_THICK_TO,
    PMTTBT.MIN_THICK_TOL,
    PMTTBT.ROLL_LINE_NO,
    PMTTBT.TENANT_ID,
    PMTTBT.creation_date,    PMTTBT.created_by,    PMTTBT.last_updated_by,    PMTTBT.last_update_date,    PMTTBT.object_version_number
    </sql>

    <select id = "selectList" resultType = "com.xisc.pm.domain.entity.PmMinThickTolBtTra">
        select
        <include refid = "BaseSql"/>
        from PM_MIN_THICK_TOL_BT_TRA PMTTBT
        <where>
            <if test="traId !=null">
                and PMTTBT.TRA_ID = #{traId,jdbcType = INTEGER}
            </if>
            <if test="operationType !=null">
                and PMTTBT.OPERATION_TYPE = #{operationType,jdbcType = VARCHAR}
            </if>
            <if test="operationUser !=null">
                and PMTTBT.OPERATION_USER = #{operationUser,jdbcType = VARCHAR}
            </if>
            <if test="operationTime !=null">
                and PMTTBT.OPERATION_TIME = #{operationTime,jdbcType = OTHER}
            </if>
            <if test="pmttbId !=null">
                and PMTTBT.PMTTB_ID = #{pmttbId,jdbcType = INTEGER}
            </if>
            <if test="plateThickFrom !=null">
                and PMTTBT.PLATE_THICK_FROM = #{plateThickFrom,jdbcType = INTEGER}
            </if>
            <if test="plateThickTo !=null">
                and PMTTBT.PLATE_THICK_TO = #{plateThickTo,jdbcType = INTEGER}
            </if>
            <if test="minThickTol !=null">
                and PMTTBT.MIN_THICK_TOL = #{minThickTol,jdbcType = INTEGER}
            </if>
            <if test="rollLineNo !=null">
                and PMTTBT.ROLL_LINE_NO = #{rollLineNo,jdbcType = VARCHAR}
            </if>
            <if test="tenantId !=null">
                and PMTTBT.TENANT_ID = #{tenantId,jdbcType = INTEGER}
            </if>
        </where>
    </select>
</mapper>

