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


    <sql id = "BaseSql">
    PPST.POLICY_ST_ID,
    PPST.POLICY_ID,
    PPST.ST_NO,
    PPST.TENANT_ID,
    PPST.ATTRIBUTE1,
    PPST.ATTRIBUTE2,
    PPST.ATTRIBUTE3,
    PPST.ATTRIBUTE4,
    PPST.ATTRIBUTE5,
    PPST.creation_date,    PPST.created_by,    PPST.last_updated_by,    PPST.last_update_date,    PPST.object_version_number
    </sql>

    <select id = "selectList" resultType = "com.xisc.pm.domain.entity.PmPolicySteelType">
        select
        <include refid = "BaseSql"/>
        from PM_POLICY_STEEL_TYPE PPST
        <where>
            <if test="policyStId !=null">
                and PPST.POLICY_ST_ID = #{policyStId,jdbcType = INTEGER}
            </if>
            <if test="policyId !=null">
                and PPST.POLICY_ID = #{policyId,jdbcType = INTEGER}
            </if>
            <if test="stNo !=null">
                and PPST.ST_NO = #{stNo,jdbcType = VARCHAR}
            </if>
            <if test="tenantId !=null">
                and PPST.TENANT_ID = #{tenantId,jdbcType = INTEGER}
            </if>
            <if test="attribute1 !=null">
                and PPST.ATTRIBUTE1 = #{attribute1,jdbcType = VARCHAR}
            </if>
            <if test="attribute2 !=null">
                and PPST.ATTRIBUTE2 = #{attribute2,jdbcType = VARCHAR}
            </if>
            <if test="attribute3 !=null">
                and PPST.ATTRIBUTE3 = #{attribute3,jdbcType = VARCHAR}
            </if>
            <if test="attribute4 !=null">
                and PPST.ATTRIBUTE4 = #{attribute4,jdbcType = VARCHAR}
            </if>
            <if test="attribute5 !=null">
                and PPST.ATTRIBUTE5 = #{attribute5,jdbcType = VARCHAR}
            </if>
        </where>
    </select>
</mapper>

