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


    <sql id = "BaseSql">
    PPLS.PROD_LINE_SECTION_ID,
    PPLS.PROD_LINE_ID,
    PPLS.MOLD_THICK,
    PPLS.MOLD_WID,
    PPLS.PRIORITY,
    PPLS.VALID_FLAG,
    PPLS.TENANT_ID,
    PPLS.ATTRIBUTE1,
    PPLS.ATTRIBUTE2,
    PPLS.ATTRIBUTE3,
    PPLS.ATTRIBUTE4,
    PPLS.ATTRIBUTE5,
    PPLS.creation_date,    PPLS.created_by,    PPLS.last_updated_by,    PPLS.last_update_date,    PPLS.object_version_number
    </sql>

    <select id = "selectList" resultType = "com.xisc.pm.domain.entity.PmProdLineSection">
        select
        <include refid = "BaseSql"/>
        from PM_PROD_LINE_SECTION PPLS
        <where>
            <if test="prodLineSectionId !=null">
                and PPLS.PROD_LINE_SECTION_ID = #{prodLineSectionId,jdbcType = INTEGER}
            </if>
            <if test="prodLineId !=null">
                and PPLS.PROD_LINE_ID = #{prodLineId,jdbcType = INTEGER}
            </if>
            <if test="moldThick !=null">
                and PPLS.MOLD_THICK = #{moldThick,jdbcType = INTEGER}
            </if>
            <if test="moldWid !=null">
                and PPLS.MOLD_WID = #{moldWid,jdbcType = INTEGER}
            </if>
            <if test="priority !=null">
                and PPLS.PRIORITY = #{priority,jdbcType = INTEGER}
            </if>
            <if test="validFlag !=null">
                and PPLS.VALID_FLAG = #{validFlag,jdbcType = INTEGER}
            </if>
            <if test="tenantId !=null">
                and PPLS.TENANT_ID = #{tenantId,jdbcType = INTEGER}
            </if>
            <if test="attribute1 !=null">
                and PPLS.ATTRIBUTE1 = #{attribute1,jdbcType = VARCHAR}
            </if>
            <if test="attribute2 !=null">
                and PPLS.ATTRIBUTE2 = #{attribute2,jdbcType = VARCHAR}
            </if>
            <if test="attribute3 !=null">
                and PPLS.ATTRIBUTE3 = #{attribute3,jdbcType = VARCHAR}
            </if>
            <if test="attribute4 !=null">
                and PPLS.ATTRIBUTE4 = #{attribute4,jdbcType = VARCHAR}
            </if>
            <if test="attribute5 !=null">
                and PPLS.ATTRIBUTE5 = #{attribute5,jdbcType = VARCHAR}
            </if>
        </where>
    </select>
</mapper>

