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


    <sql id = "BaseSql">
    PSTG.STEEL_GROUP_ID,
    PSTG.STEEL_GROUP_CODE,
    PSTG.VALID_FLAG,
    PSTG.ST_NO,
    PSTG.TENANT_ID,
    PSTG.ATTRIBUTE1,
    PSTG.ATTRIBUTE2,
    PSTG.ATTRIBUTE3,
    PSTG.ATTRIBUTE4,
    PSTG.ATTRIBUTE5,
    PSTG.creation_date,    PSTG.created_by,    PSTG.last_updated_by,    PSTG.last_update_date,    PSTG.object_version_number
    </sql>

    <select id = "selectList" resultType = "com.xisc.pm.domain.entity.PmSteelTypeGroup">
        select
        <include refid = "BaseSql"/>
        from PM_STEEL_TYPE_GROUP PSTG
        <where>
            <if test="steelGroupId !=null">
                and PSTG.STEEL_GROUP_ID = #{steelGroupId,jdbcType = INTEGER}
            </if>
            <if test="steelGroupCode !=null">
                and PSTG.STEEL_GROUP_CODE = #{steelGroupCode,jdbcType = VARCHAR}
            </if>
            <if test="validFlag !=null">
                and PSTG.VALID_FLAG = #{validFlag,jdbcType = INTEGER}
            </if>
            <if test="stNo !=null">
                and PSTG.ST_NO = #{stNo,jdbcType = VARCHAR}
            </if>
            <if test="tenantId !=null">
                and PSTG.TENANT_ID = #{tenantId,jdbcType = INTEGER}
            </if>
            <if test="attribute1 !=null">
                and PSTG.ATTRIBUTE1 = #{attribute1,jdbcType = VARCHAR}
            </if>
            <if test="attribute2 !=null">
                and PSTG.ATTRIBUTE2 = #{attribute2,jdbcType = VARCHAR}
            </if>
            <if test="attribute3 !=null">
                and PSTG.ATTRIBUTE3 = #{attribute3,jdbcType = VARCHAR}
            </if>
            <if test="attribute4 !=null">
                and PSTG.ATTRIBUTE4 = #{attribute4,jdbcType = VARCHAR}
            </if>
            <if test="attribute5 !=null">
                and PSTG.ATTRIBUTE5 = #{attribute5,jdbcType = VARCHAR}
            </if>
        </where>
    </select>
</mapper>

