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


    <sql id = "BaseSql">
    PITB.PITB_ID,
    PITB.INGOT_TYPE,
    PITB.INGOT_LEN,
    PITB.INGOT_WT,
    PITB.INGOT_HEAD_THICK,
    PITB.INGOT_HEAD_WIDTH,
    PITB.INGOT_BOTT_THICK,
    PITB.INGOT_BOTT_WIDTH,
    PITB.TENANT_ID,
    PITB.ATTRIBUTE1,
    PITB.ATTRIBUTE2,
    PITB.ATTRIBUTE3,
    PITB.ATTRIBUTE4,
    PITB.ATTRIBUTE5,
    PITB.creation_date,    PITB.created_by,    PITB.last_updated_by,    PITB.last_update_date,    PITB.object_version_number
    </sql>

    <select id = "selectList" resultType = "com.xisc.pm.domain.entity.PmIngotTypeBt">
        select
        <include refid = "BaseSql"/>
        from PM_INGOT_TYPE_BT PITB
        <where>
            <if test="pitbId !=null">
                and PITB.PITB_ID = #{pitbId,jdbcType = INTEGER}
            </if>
            <if test="ingotType !=null">
                and PITB.INGOT_TYPE = #{ingotType,jdbcType = VARCHAR}
            </if>
            <if test="ingotLen !=null">
                and PITB.INGOT_LEN = #{ingotLen,jdbcType = INTEGER}
            </if>
            <if test="ingotWt !=null">
                and PITB.INGOT_WT = #{ingotWt,jdbcType = INTEGER}
            </if>
            <if test="ingotHeadThick !=null">
                and PITB.INGOT_HEAD_THICK = #{ingotHeadThick,jdbcType = INTEGER}
            </if>
            <if test="ingotHeadWidth !=null">
                and PITB.INGOT_HEAD_WIDTH = #{ingotHeadWidth,jdbcType = INTEGER}
            </if>
            <if test="ingotBottThick !=null">
                and PITB.INGOT_BOTT_THICK = #{ingotBottThick,jdbcType = INTEGER}
            </if>
            <if test="ingotBottWidth !=null">
                and PITB.INGOT_BOTT_WIDTH = #{ingotBottWidth,jdbcType = INTEGER}
            </if>
            <if test="tenantId !=null">
                and PITB.TENANT_ID = #{tenantId,jdbcType = INTEGER}
            </if>
            <if test="attribute1 !=null">
                and PITB.ATTRIBUTE1 = #{attribute1,jdbcType = VARCHAR}
            </if>
            <if test="attribute2 !=null">
                and PITB.ATTRIBUTE2 = #{attribute2,jdbcType = VARCHAR}
            </if>
            <if test="attribute3 !=null">
                and PITB.ATTRIBUTE3 = #{attribute3,jdbcType = VARCHAR}
            </if>
            <if test="attribute4 !=null">
                and PITB.ATTRIBUTE4 = #{attribute4,jdbcType = VARCHAR}
            </if>
            <if test="attribute5 !=null">
                and PITB.ATTRIBUTE5 = #{attribute5,jdbcType = VARCHAR}
            </if>
        </where>
    </select>
</mapper>

