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


    <sql id = "BaseSql">
        PSM.ID,
        PSM.MERGE_SLAB_NO,
        PSM.TMP_SLAB_NO,
        PSM.VIRTUAL_SLAB_NO,
        PSM.TENANT_ID,
        PSM.ATTRIBUTE1,
        PSM.ATTRIBUTE2,
        PSM.ATTRIBUTE3,
        PSM.ATTRIBUTE4,
        PSM.ATTRIBUTE5,
        PSM.PREC_SLAB_NO,
        PSM.PONO_SLAB_NO,
        PSM.creation_date,
        PSM.created_by,
        PSM.last_updated_by,
        PSM.last_update_date,
        PSM.object_version_number
    </sql>

    <select id = "selectList" resultType = "com.xisc.pm.domain.entity.PmSlabMerge">
        select
        <include refid = "BaseSql"/>
        from PM_SLAB_MERGE PSM
        <where>
            <if test="id !=null">
                and PSM.ID = #{id,jdbcType = INTEGER}
            </if>
            <if test="mergeSlabNo !=null">
                and PSM.MERGE_SLAB_NO = #{mergeSlabNo,jdbcType = VARCHAR}
            </if>
            <if test="tmpSlabNo !=null">
                and PSM.TMP_SLAB_NO = #{tmpSlabNo,jdbcType = VARCHAR}
            </if>
            <if test="virtualSlabNo !=null">
                and PSM.VIRTUAL_SLAB_NO = #{virtualSlabNo,jdbcType = VARCHAR}
            </if>
            <if test="tenantId !=null">
                and PSM.TENANT_ID = #{tenantId,jdbcType = INTEGER}
            </if>
            <if test="attribute1 !=null">
                and PSM.ATTRIBUTE1 = #{attribute1,jdbcType = VARCHAR}
            </if>
            <if test="attribute2 !=null">
                and PSM.ATTRIBUTE2 = #{attribute2,jdbcType = VARCHAR}
            </if>
            <if test="attribute3 !=null">
                and PSM.ATTRIBUTE3 = #{attribute3,jdbcType = VARCHAR}
            </if>
            <if test="attribute4 !=null">
                and PSM.ATTRIBUTE4 = #{attribute4,jdbcType = VARCHAR}
            </if>
            <if test="attribute5 !=null">
                and PSM.ATTRIBUTE5 = #{attribute5,jdbcType = VARCHAR}
            </if>
            <if test="precSlabNo !=null">
                and PSM.PREC_SLAB_NO = #{precSlabNo,jdbcType = VARCHAR}
            </if>
            <if test="ponoSlabNo !=null">
                and PSM.PONO_SLAB_NO = #{ponoSlabNo,jdbcType = VARCHAR}
            </if>
        </where>
    </select>
</mapper>

