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


    <sql id = "BaseSql">
    PPSYBT.TRA_ID,
    PPSYBT.OPERATION_TYPE,
    PPSYBT.OPERATION_USER,
    PPSYBT.OPERATION_TIME,
    PPSYBT.PPSYB_ID,
    PPSYBT.APN,
    PPSYBT.ST_NO,
    PPSYBT.CC_TYPE,
    PPSYBT.PLATE_THICK_FROM,
    PPSYBT.PLATE_THICK_TO,
    PPSYBT.COMBINE_PLATE_WIDTH_FROM,
    PPSYBT.COMBINE_PLATE_WIDTH_TO,
    PPSYBT.YIELD,
    PPSYBT.MAX_YIELD,
    PPSYBT.TENANT_ID,
    PPSYBT.ATTRIBUTE1,
    PPSYBT.ATTRIBUTE2,
    PPSYBT.ATTRIBUTE3,
    PPSYBT.ATTRIBUTE4,
    PPSYBT.ATTRIBUTE5,
    PPSYBT.creation_date,    PPSYBT.created_by,    PPSYBT.last_updated_by,    PPSYBT.last_update_date,    PPSYBT.object_version_number
    </sql>

    <select id = "selectList" resultType = "com.xisc.pm.domain.entity.PmPlateSpecYieldBtTra">
        select
        <include refid = "BaseSql"/>
        from PM_PLATE_SPEC_YIELD_BT_TRA PPSYBT
        <where>
            <if test="traId !=null">
                and PPSYBT.TRA_ID = #{traId,jdbcType = INTEGER}
            </if>
            <if test="operationType !=null">
                and PPSYBT.OPERATION_TYPE = #{operationType,jdbcType = VARCHAR}
            </if>
            <if test="operationUser !=null">
                and PPSYBT.OPERATION_USER = #{operationUser,jdbcType = VARCHAR}
            </if>
            <if test="operationTime !=null">
                and PPSYBT.OPERATION_TIME = #{operationTime,jdbcType = OTHER}
            </if>
            <if test="ppsybId !=null">
                and PPSYBT.PPSYB_ID = #{ppsybId,jdbcType = INTEGER}
            </if>
            <if test="apn !=null">
                and PPSYBT.APN = #{apn,jdbcType = VARCHAR}
            </if>
            <if test="stNo !=null">
                and PPSYBT.ST_NO = #{stNo,jdbcType = VARCHAR}
            </if>
            <if test="ccType !=null">
                and PPSYBT.CC_TYPE = #{ccType,jdbcType = VARCHAR}
            </if>
            <if test="plateThickFrom !=null">
                and PPSYBT.PLATE_THICK_FROM = #{plateThickFrom,jdbcType = INTEGER}
            </if>
            <if test="plateThickTo !=null">
                and PPSYBT.PLATE_THICK_TO = #{plateThickTo,jdbcType = INTEGER}
            </if>
            <if test="combinePlateWidthFrom !=null">
                and PPSYBT.COMBINE_PLATE_WIDTH_FROM = #{combinePlateWidthFrom,jdbcType = INTEGER}
            </if>
            <if test="combinePlateWidthTo !=null">
                and PPSYBT.COMBINE_PLATE_WIDTH_TO = #{combinePlateWidthTo,jdbcType = INTEGER}
            </if>
            <if test="yield !=null">
                and PPSYBT.YIELD = #{yield,jdbcType = INTEGER}
            </if>
            <if test="maxYield !=null">
                and PPSYBT.MAX_YIELD = #{maxYield,jdbcType = INTEGER}
            </if>
            <if test="tenantId !=null">
                and PPSYBT.TENANT_ID = #{tenantId,jdbcType = INTEGER}
            </if>
            <if test="attribute1 !=null">
                and PPSYBT.ATTRIBUTE1 = #{attribute1,jdbcType = VARCHAR}
            </if>
            <if test="attribute2 !=null">
                and PPSYBT.ATTRIBUTE2 = #{attribute2,jdbcType = VARCHAR}
            </if>
            <if test="attribute3 !=null">
                and PPSYBT.ATTRIBUTE3 = #{attribute3,jdbcType = VARCHAR}
            </if>
            <if test="attribute4 !=null">
                and PPSYBT.ATTRIBUTE4 = #{attribute4,jdbcType = VARCHAR}
            </if>
            <if test="attribute5 !=null">
                and PPSYBT.ATTRIBUTE5 = #{attribute5,jdbcType = VARCHAR}
            </if>
        </where>
    </select>
</mapper>

