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


    <sql id = "BaseSql">
        PSRBT.TRA_ID,
        PSRBT.OPERATION_TYPE,
        PSRBT.OPERATION_USER,
        PSRBT.OPERATION_TIME,
        PSRBT.PSRB_ID,
        PSRBT.ST_NO,
        PSRBT.SAMPLE_LEN_HEAD,
        PSRBT.SAMPLE_LEN_TAIL,
        PSRBT.TENANT_ID,
        PSRBT.ATTRIBUTE1,
        PSRBT.ATTRIBUTE2,
        PSRBT.ATTRIBUTE3,
        PSRBT.ATTRIBUTE4,
        PSRBT.ATTRIBUTE5,
        PSRBT.creation_date,        PSRBT.created_by,        PSRBT.last_updated_by,        PSRBT.last_update_date,        PSRBT.object_version_number
    </sql>

    <select id = "selectList" resultType = "com.xisc.pm.domain.entity.PmSampleReserveBtTra">
        select
        <include refid = "BaseSql"/>
        from PM_SAMPLE_RESERVE_BT_TRA PSRBT
        <where>
            <if test="traId !=null">
                and PSRBT.TRA_ID = #{traId,jdbcType = INTEGER}
            </if>
            <if test="operationType !=null">
                and PSRBT.OPERATION_TYPE = #{operationType,jdbcType = VARCHAR}
            </if>
            <if test="operationUser !=null">
                and PSRBT.OPERATION_USER = #{operationUser,jdbcType = VARCHAR}
            </if>
            <if test="operationTime !=null">
                and PSRBT.OPERATION_TIME = #{operationTime,jdbcType = OTHER}
            </if>
            <if test="psrbId !=null">
                and PSRBT.PSRB_ID = #{psrbId,jdbcType = INTEGER}
            </if>
            <if test="stNo !=null">
                and PSRBT.ST_NO = #{stNo,jdbcType = VARCHAR}
            </if>
            <if test="sampleLenHead !=null">
                and PSRBT.SAMPLE_LEN_HEAD = #{sampleLenHead,jdbcType = INTEGER}
            </if>
            <if test="sampleLenTail !=null">
                and PSRBT.SAMPLE_LEN_TAIL = #{sampleLenTail,jdbcType = INTEGER}
            </if>
            <if test="tenantId !=null">
                and PSRBT.TENANT_ID = #{tenantId,jdbcType = INTEGER}
            </if>
            <if test="attribute1 !=null">
                and PSRBT.ATTRIBUTE1 = #{attribute1,jdbcType = VARCHAR}
            </if>
            <if test="attribute2 !=null">
                and PSRBT.ATTRIBUTE2 = #{attribute2,jdbcType = VARCHAR}
            </if>
            <if test="attribute3 !=null">
                and PSRBT.ATTRIBUTE3 = #{attribute3,jdbcType = VARCHAR}
            </if>
            <if test="attribute4 !=null">
                and PSRBT.ATTRIBUTE4 = #{attribute4,jdbcType = VARCHAR}
            </if>
            <if test="attribute5 !=null">
                and PSRBT.ATTRIBUTE5 = #{attribute5,jdbcType = VARCHAR}
            </if>
        </where>
    </select>
</mapper>

