<?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.hzs.system.config.mapper.BdGradeScopeMapper">

    <!--查询等级范围-->
    <select id="selectGradeScopeList" parameterType="com.hzs.common.domain.system.ext.BdGradeScopeExt"
            resultType="com.hzs.common.domain.system.ext.BdGradeScopeExt">
        select a.PK_ID,
        a.PK_GRADE,
        a.PK_SCOPE,
        a.DEL_FLAG,
        a.PK_COUNTRY,
        a.CREATION_TIME,
        a.MODIFIED_TIME,
        a.PK_CREATOR,
        a.PK_MODIFIED
        from BD_GRADE_SCOPE a
        where a.DEL_FLAG = 0
        <if test="pkCountry != null and pkCountry != 0">
            AND a.PK_COUNTRY = #{pkCountry}
        </if>
        <if test="pkGrade != null ">
            AND a.PK_GRADE = #{pkGrade}
        </if>
        order by a.PK_GRADE,a.PK_SCOPE,a.CREATION_TIME desc
    </select>

</mapper>
