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


    <sql id = "BaseSql">
    PPWI.PM_PONO_WT_INFO_ID,
    PPWI.MAIN_BACKLOG_CODE,
    PPWI.ST_NO,
    PPWI.CC_TYPE,
    PPWI.ACT_AIM_INIT_WT,
    PPWI.ACT_PONO_WT,
    PPWI.PONO_WT_PLUS,
    PPWI.PONO_WT_MINUS,
    PPWI.PREC_CAST_LOT_NO,
    PPWI.PREC_PONO,
    PPWI.USER_ID,
    PPWI.PONO_YIELD,
    PPWI.TENANT_ID,
    PPWI.ATTRIBUTE1,
    PPWI.ATTRIBUTE2,
    PPWI.ATTRIBUTE3,
    PPWI.ATTRIBUTE4,
    PPWI.ATTRIBUTE5,
    PPWI.creation_date,    PPWI.created_by,    PPWI.last_updated_by,    PPWI.last_update_date,    PPWI.object_version_number
    </sql>

    <select id = "selectList" resultType = "com.xisc.pm.domain.entity.PmPonoWtInfo">
        select
        <include refid = "BaseSql"/>
        from PM_PONO_WT_INFO PPWI
        <where>
            <if test="pmPonoWtInfoId !=null">
                and PPWI.PM_PONO_WT_INFO_ID = #{pmPonoWtInfoId,jdbcType = INTEGER}
            </if>
            <if test="mainBacklogCode !=null">
                and PPWI.MAIN_BACKLOG_CODE = #{mainBacklogCode,jdbcType = VARCHAR}
            </if>
            <if test="stNo !=null">
                and PPWI.ST_NO = #{stNo,jdbcType = VARCHAR}
            </if>
            <if test="ccType !=null">
                and PPWI.CC_TYPE = #{ccType,jdbcType = VARCHAR}
            </if>
            <if test="actAimInitWt !=null">
                and PPWI.ACT_AIM_INIT_WT = #{actAimInitWt,jdbcType = INTEGER}
            </if>
            <if test="actPonoWt !=null">
                and PPWI.ACT_PONO_WT = #{actPonoWt,jdbcType = INTEGER}
            </if>
            <if test="ponoWtPlus !=null">
                and PPWI.PONO_WT_PLUS = #{ponoWtPlus,jdbcType = INTEGER}
            </if>
            <if test="ponoWtMinus !=null">
                and PPWI.PONO_WT_MINUS = #{ponoWtMinus,jdbcType = INTEGER}
            </if>
            <if test="precCastLotNo !=null">
                and PPWI.PREC_CAST_LOT_NO = #{precCastLotNo,jdbcType = VARCHAR}
            </if>
            <if test="precPono !=null">
                and PPWI.PREC_PONO = #{precPono,jdbcType = VARCHAR}
            </if>
            <if test="userId !=null">
                and PPWI.USER_ID = #{userId,jdbcType = VARCHAR}
            </if>
            <if test="ponoYield !=null">
                and PPWI.PONO_YIELD = #{ponoYield,jdbcType = INTEGER}
            </if>
            <if test="tenantId !=null">
                and PPWI.TENANT_ID = #{tenantId,jdbcType = INTEGER}
            </if>
            <if test="attribute1 !=null">
                and PPWI.ATTRIBUTE1 = #{attribute1,jdbcType = VARCHAR}
            </if>
            <if test="attribute2 !=null">
                and PPWI.ATTRIBUTE2 = #{attribute2,jdbcType = VARCHAR}
            </if>
            <if test="attribute3 !=null">
                and PPWI.ATTRIBUTE3 = #{attribute3,jdbcType = VARCHAR}
            </if>
            <if test="attribute4 !=null">
                and PPWI.ATTRIBUTE4 = #{attribute4,jdbcType = VARCHAR}
            </if>
            <if test="attribute5 !=null">
                and PPWI.ATTRIBUTE5 = #{attribute5,jdbcType = VARCHAR}
            </if>
        </where>
    </select>
</mapper>

