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


    <sql id = "BaseSql">
    PPTYB.PPTYB_ID,
    PPTYB.CC_TYPE,
    PPTYB.PROD_CODE_HP,
    PPTYB.WITH_SIDE_FLAG,
    PPTYB.SLAB_THICK_FROM,
    PPTYB.SLAB_THICK_TO,
    PPTYB.SLAB_WIDTH_FROM,
    PPTYB.SLAB_WIDTH_TO,
    PPTYB.PLATE_THICK_FROM,
    PPTYB.PLATE_THICK_TO,
    PPTYB.TMP_YIELD,
    PPTYB.ROLL_LINE_NO,
    PPTYB.TENANT_ID,
    PPTYB.ATTRIBUTE1,
    PPTYB.ATTRIBUTE2,
    PPTYB.ATTRIBUTE3,
    PPTYB.ATTRIBUTE4,
    PPTYB.ATTRIBUTE5,
    PPTYB.creation_date,    PPTYB.created_by,    PPTYB.last_updated_by,    PPTYB.last_update_date,    PPTYB.object_version_number
    </sql>

    <select id = "selectList" resultType = "com.xisc.pm.domain.entity.PmPdTmpYieldBt">
        select
        <include refid = "BaseSql"/>
        from PM_PD_TMP_YIELD_BT PPTYB
        <where>
            <if test="pptybId !=null">
                and PPTYB.PPTYB_ID = #{pptybId,jdbcType = INTEGER}
            </if>
            <if test="ccType !=null">
                and PPTYB.CC_TYPE = #{ccType,jdbcType = VARCHAR}
            </if>
            <if test="prodCodeHp !=null">
                and PPTYB.PROD_CODE_HP = #{prodCodeHp,jdbcType = VARCHAR}
            </if>
            <if test="withSideFlag !=null">
                and PPTYB.WITH_SIDE_FLAG = #{withSideFlag,jdbcType = VARCHAR}
            </if>
            <if test="slabThickFrom !=null">
                and PPTYB.SLAB_THICK_FROM <![CDATA[ <= ]]> #{slabThickFrom,jdbcType = INTEGER}
            </if>
            <if test="slabThickTo !=null">
                and PPTYB.SLAB_THICK_FROM <![CDATA[ <= ]]> #{slabThickTo,jdbcType = INTEGER}
            </if>
            <if test="slabThickTo !=null">
                and PPTYB.SLAB_THICK_TO <![CDATA[ >= ]]> #{slabThickTo,jdbcType = INTEGER}
            </if>
            <if test="slabThickFrom !=null">
                and PPTYB.SLAB_THICK_TO <![CDATA[ >= ]]> #{slabThickFrom,jdbcType = INTEGER}
            </if>
            <if test="slabWidthFrom !=null">
                and PPTYB.SLAB_WIDTH_FROM <![CDATA[ <= ]]> #{slabWidthFrom,jdbcType = INTEGER}
            </if>
            <if test="slabWidthTo !=null">
                and PPTYB.SLAB_WIDTH_FROM <![CDATA[ <= ]]> #{slabWidthTo,jdbcType = INTEGER}
            </if>
            <if test="slabWidthTo !=null">
                and PPTYB.SLAB_WIDTH_TO <![CDATA[ >= ]]> #{slabWidthTo,jdbcType = INTEGER}
            </if>
            <if test="slabWidthFrom !=null">
                and PPTYB.SLAB_WIDTH_TO <![CDATA[ >= ]]> #{slabWidthFrom,jdbcType = INTEGER}
            </if>
            <if test="plateThickFrom !=null">
                and PPTYB.PLATE_THICK_FROM <![CDATA[ <= ]]> #{plateThickFrom,jdbcType = INTEGER}
            </if>
            <if test="plateThickTo !=null">
                and PPTYB.PLATE_THICK_FROM <![CDATA[ <= ]]> #{plateThickTo,jdbcType = INTEGER}
            </if>
            <if test="plateThickTo !=null">
                and PPTYB.PLATE_THICK_TO <![CDATA[ >= ]]> #{plateThickTo,jdbcType = INTEGER}
            </if>
            <if test="plateThickFrom !=null">
                and PPTYB.PLATE_THICK_TO <![CDATA[ >= ]]> #{plateThickFrom,jdbcType = INTEGER}
            </if>
            <if test="tmpYield !=null">
                and PPTYB.TMP_YIELD = #{tmpYield,jdbcType = INTEGER}
            </if>
            <if test="rollLineNo !=null">
                and PPTYB.ROLL_LINE_NO = #{rollLineNo,jdbcType = VARCHAR}
            </if>
            <if test="tenantId !=null">
                and PPTYB.TENANT_ID = #{tenantId,jdbcType = INTEGER}
            </if>
            <if test="attribute1 !=null">
                and PPTYB.ATTRIBUTE1 = #{attribute1,jdbcType = VARCHAR}
            </if>
            <if test="attribute2 !=null">
                and PPTYB.ATTRIBUTE2 = #{attribute2,jdbcType = VARCHAR}
            </if>
            <if test="attribute3 !=null">
                and PPTYB.ATTRIBUTE3 = #{attribute3,jdbcType = VARCHAR}
            </if>
            <if test="attribute4 !=null">
                and PPTYB.ATTRIBUTE4 = #{attribute4,jdbcType = VARCHAR}
            </if>
            <if test="attribute5 !=null">
                and PPTYB.ATTRIBUTE5 = #{attribute5,jdbcType = VARCHAR}
            </if>
        </where>
    </select>
</mapper>

