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


    <sql id = "BaseSql">
    PPLSS.PROD_LINE_SECTION_ID,
    PPLSS.PROD_LINE_SECTION_SPEC_ID,
    PPLSS.THICK_FROM,
    PPLSS.THICK_TO,
    PPLSS.WID_FROM,
    PPLSS.WID_TO,
    PPLSS.LENGTH_FROM,
    PPLSS.LENGTH_TO,
    PPLSS.STEEL_SPECIFICATION_WEIGHT,
    PPLSS.VALID_FLAG,
    PPLSS.TENANT_ID,
    PPLSS.ATTRIBUTE1,
    PPLSS.ATTRIBUTE2,
    PPLSS.ATTRIBUTE3,
    PPLSS.ATTRIBUTE4,
    PPLSS.ATTRIBUTE5,
    PPLSS.creation_date,    PPLSS.created_by,    PPLSS.last_updated_by,    PPLSS.last_update_date,    PPLSS.object_version_number
    </sql>

    <select id = "selectList" resultType = "com.xisc.pm.domain.entity.PmProdLineSectionSpec">
        select
        <include refid = "BaseSql"/>
        from PM_PROD_LINE_SECTION_SPEC PPLSS
        <where>
            <if test="prodLineSectionId !=null">
                and PPLSS.PROD_LINE_SECTION_ID = #{prodLineSectionId,jdbcType = INTEGER}
            </if>
            <if test="prodLineSectionSpecId !=null">
                and PPLSS.PROD_LINE_SECTION_SPEC_ID = #{prodLineSectionSpecId,jdbcType = INTEGER}
            </if>
            <if test="thickFrom !=null">
                and PPLSS.THICK_FROM = #{thickFrom,jdbcType = INTEGER}
            </if>
            <if test="thickTo !=null">
                and PPLSS.THICK_TO = #{thickTo,jdbcType = INTEGER}
            </if>
            <if test="widFrom !=null">
                and PPLSS.WID_FROM = #{widFrom,jdbcType = INTEGER}
            </if>
            <if test="widTo !=null">
                and PPLSS.WID_TO = #{widTo,jdbcType = INTEGER}
            </if>
            <if test="lengthFrom !=null">
                and PPLSS.LENGTH_FROM = #{lengthFrom,jdbcType = INTEGER}
            </if>
            <if test="lengthTo !=null">
                and PPLSS.LENGTH_TO = #{lengthTo,jdbcType = INTEGER}
            </if>
            <if test="steelSpecificationWeight !=null">
                and PPLSS.STEEL_SPECIFICATION_WEIGHT = #{steelSpecificationWeight,jdbcType = INTEGER}
            </if>
            <if test="validFlag !=null">
                and PPLSS.VALID_FLAG = #{validFlag,jdbcType = INTEGER}
            </if>
            <if test="tenantId !=null">
                and PPLSS.TENANT_ID = #{tenantId,jdbcType = INTEGER}
            </if>
            <if test="attribute1 !=null">
                and PPLSS.ATTRIBUTE1 = #{attribute1,jdbcType = VARCHAR}
            </if>
            <if test="attribute2 !=null">
                and PPLSS.ATTRIBUTE2 = #{attribute2,jdbcType = VARCHAR}
            </if>
            <if test="attribute3 !=null">
                and PPLSS.ATTRIBUTE3 = #{attribute3,jdbcType = VARCHAR}
            </if>
            <if test="attribute4 !=null">
                and PPLSS.ATTRIBUTE4 = #{attribute4,jdbcType = VARCHAR}
            </if>
            <if test="attribute5 !=null">
                and PPLSS.ATTRIBUTE5 = #{attribute5,jdbcType = VARCHAR}
            </if>
        </where>
    </select>
</mapper>

