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


    <sql id = "BaseSql">
    PMSBT.TRA_ID,
    PMSBT.OPERATION_TYPE,
    PMSBT.OPERATION_USER,
    PMSBT.OPERATION_TIME,
    PMSBT.PMSB_ID,
    PMSBT.CC_TYPE,
    PMSBT.CC_DESC,
    PMSBT.CAST_THICK,
    PMSBT.CAST_WIDTH,
    PMSBT.MSC_LINE_NO,
    PMSBT.TENANT_ID,
    PMSBT.ATTRIBUTE1,
    PMSBT.ATTRIBUTE2,
    PMSBT.ATTRIBUTE3,
    PMSBT.ATTRIBUTE4,
    PMSBT.ATTRIBUTE5,
    PMSBT.creation_date,    PMSBT.created_by,    PMSBT.last_updated_by,    PMSBT.last_update_date,    PMSBT.object_version_number
    </sql>

    <select id = "selectList" resultType = "com.xisc.pm.domain.entity.PmMoldSpecBtTra">
        select
        <include refid = "BaseSql"/>
        from PM_MOLD_SPEC_BT_TRA PMSBT
        <where>
            <if test="traId !=null">
                and PMSBT.TRA_ID = #{traId,jdbcType = INTEGER}
            </if>
            <if test="operationType !=null">
                and PMSBT.OPERATION_TYPE = #{operationType,jdbcType = VARCHAR}
            </if>
            <if test="operationUser !=null">
                and PMSBT.OPERATION_USER = #{operationUser,jdbcType = VARCHAR}
            </if>
            <if test="operationTime !=null">
                and PMSBT.OPERATION_TIME = #{operationTime,jdbcType = OTHER}
            </if>
            <if test="pmsbId !=null">
                and PMSBT.PMSB_ID = #{pmsbId,jdbcType = INTEGER}
            </if>
            <if test="ccType !=null">
                and PMSBT.CC_TYPE = #{ccType,jdbcType = VARCHAR}
            </if>
            <if test="ccDesc !=null">
                and PMSBT.CC_DESC = #{ccDesc,jdbcType = VARCHAR}
            </if>
            <if test="castThick !=null">
                and PMSBT.CAST_THICK = #{castThick,jdbcType = INTEGER}
            </if>
            <if test="castWidth !=null">
                and PMSBT.CAST_WIDTH = #{castWidth,jdbcType = INTEGER}
            </if>
            <if test="mscLineNo !=null">
                and PMSBT.MSC_LINE_NO = #{mscLineNo,jdbcType = VARCHAR}
            </if>
            <if test="tenantId !=null">
                and PMSBT.TENANT_ID = #{tenantId,jdbcType = INTEGER}
            </if>
            <if test="attribute1 !=null">
                and PMSBT.ATTRIBUTE1 = #{attribute1,jdbcType = VARCHAR}
            </if>
            <if test="attribute2 !=null">
                and PMSBT.ATTRIBUTE2 = #{attribute2,jdbcType = VARCHAR}
            </if>
            <if test="attribute3 !=null">
                and PMSBT.ATTRIBUTE3 = #{attribute3,jdbcType = VARCHAR}
            </if>
            <if test="attribute4 !=null">
                and PMSBT.ATTRIBUTE4 = #{attribute4,jdbcType = VARCHAR}
            </if>
            <if test="attribute5 !=null">
                and PMSBT.ATTRIBUTE5 = #{attribute5,jdbcType = VARCHAR}
            </if>
        </where>
    </select>
</mapper>

