<?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="org.dromara.system.mapper.SysAreaMapper">

    <resultMap type="org.dromara.system.domain.vo.SysAreaVo" id="SysAreaResult">
    </resultMap>

    <select id="selectAreaList" resultMap="SysAreaResult">
        select
        <if test="ew.getSqlSelect != null">
            ${ew.getSqlSelect}
        </if>
        <if test="ew.getSqlSelect == null">
            *
        </if>
        from sys_area ${ew.getCustomSqlSegment}
    </select>

    <select id="countAreaById" resultType="Long">
        select count(*) from sys_area where del_flag = '0' and area_id = #{areaId}
    </select>

<!--    <select id="selectAreaListByRoleId" resultType="Long">-->
<!--        select d.area_id-->
<!--        from sys_area d-->
<!--            left join sys_role_dept rd on d.dept_id = rd.dept_id-->
<!--        where rd.role_id = #{roleId}-->
<!--            <if test="deptCheckStrictly">-->
<!--                and d.dept_id not in (select d.parent_id from sys_dept d inner join sys_role_dept rd on d.dept_id = rd.dept_id and rd.role_id = #{roleId})-->
<!--            </if>-->
<!--        order by d.parent_id, d.order_num-->
<!--    </select>-->

</mapper>
