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


    <sql id = "BaseSql">
    PCPB.PCPB_ID,
    PCPB.FORM_PLATE_MODE_FIRST,
    PCPB.PLATE_THICK_FROM,
    PCPB.PLATE_THICK_TO,
    PCPB.NORMAL_CUT_LEN_FROM,
    PCPB.NORMAL_CUT_LEN_TO,
    PCPB.QT_CUT_LEN_FROM,
    PCPB.QT_CUT_LEN_TO,
    PCPB.UNQT_CUT_LEN_FROM,
    PCPB.UNQT_CUT_LEN_TO,
    PCPB.ROLL_LINE_NO,
    PCPB.TENANT_ID,
    PCPB.ATTRIBUTE1,
    PCPB.ATTRIBUTE2,
    PCPB.ATTRIBUTE3,
    PCPB.ATTRIBUTE4,
    PCPB.ATTRIBUTE5,
    PCPB.creation_date,    PCPB.created_by,    PCPB.last_updated_by,    PCPB.last_update_date,    PCPB.object_version_number
    </sql>

    <select id = "selectList" resultType = "com.xisc.pm.domain.entity.PmCutPlaceBt">
        select
        <include refid = "BaseSql"/>
        from PM_CUT_PLACE_BT PCPB
        <where>
            <if test="pcpbId !=null">
                and PCPB.PCPB_ID = #{pcpbId,jdbcType = INTEGER}
            </if>
            <if test="formPlateModeFirst !=null">
                and PCPB.FORM_PLATE_MODE_FIRST = #{formPlateModeFirst,jdbcType = VARCHAR}
            </if>
            <if test="plateThickFrom !=null">
                and PCPB.PLATE_THICK_FROM <![CDATA[ <= ]]> #{plateThickFrom,jdbcType = INTEGER}
            </if>
            <if test="plateThickTo !=null">
                and PCPB.PLATE_THICK_FROM <![CDATA[ <= ]]> #{plateThickTo,jdbcType = INTEGER}
            </if>
            <if test="plateThickTo !=null">
                and PCPB.PLATE_THICK_TO <![CDATA[ >= ]]> #{plateThickTo,jdbcType = INTEGER}
            </if>
            <if test="plateThickFrom !=null">
                and PCPB.PLATE_THICK_TO <![CDATA[ >= ]]> #{plateThickFrom,jdbcType = INTEGER}
            </if>
            <if test="normalCutLenFrom !=null">
                and PCPB.NORMAL_CUT_LEN_FROM = #{normalCutLenFrom,jdbcType = INTEGER}
            </if>
            <if test="normalCutLenTo !=null">
                and PCPB.NORMAL_CUT_LEN_TO = #{normalCutLenTo,jdbcType = INTEGER}
            </if>
            <if test="qtCutLenFrom !=null">
                and PCPB.QT_CUT_LEN_FROM = #{qtCutLenFrom,jdbcType = INTEGER}
            </if>
            <if test="qtCutLenTo !=null">
                and PCPB.QT_CUT_LEN_TO = #{qtCutLenTo,jdbcType = INTEGER}
            </if>
            <if test="unqtCutLenFrom !=null">
                and PCPB.UNQT_CUT_LEN_FROM = #{unqtCutLenFrom,jdbcType = INTEGER}
            </if>
            <if test="unqtCutLenTo !=null">
                and PCPB.UNQT_CUT_LEN_TO = #{unqtCutLenTo,jdbcType = INTEGER}
            </if>
            <if test="rollLineNo !=null">
                and PCPB.ROLL_LINE_NO = #{rollLineNo,jdbcType = VARCHAR}
            </if>
            <if test="tenantId !=null">
                and PCPB.TENANT_ID = #{tenantId,jdbcType = INTEGER}
            </if>
            <if test="attribute1 !=null">
                and PCPB.ATTRIBUTE1 = #{attribute1,jdbcType = VARCHAR}
            </if>
            <if test="attribute2 !=null">
                and PCPB.ATTRIBUTE2 = #{attribute2,jdbcType = VARCHAR}
            </if>
            <if test="attribute3 !=null">
                and PCPB.ATTRIBUTE3 = #{attribute3,jdbcType = VARCHAR}
            </if>
            <if test="attribute4 !=null">
                and PCPB.ATTRIBUTE4 = #{attribute4,jdbcType = VARCHAR}
            </if>
            <if test="attribute5 !=null">
                and PCPB.ATTRIBUTE5 = #{attribute5,jdbcType = VARCHAR}
            </if>
        </where>
    </select>
</mapper>

