13693261870
2025-07-08 810ad9dbaa8553299a4516790a9f546a9b84905e
se-system/src/main/resources/mapper/sys/RoleResMapper.xml
@@ -1,6 +1,12 @@
<?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.terra.system.mapper.sys.RoleResMapper">
    <select id="selectResByRole" resultType="com.terra.system.entity.sys.RoleResEntity">
        with rs as (select id, resid from lf.sys_role_res where roleid = #{roleid})
        select (select id from rs b where b.resid = a.id) "id", a.id "resid", a.cn_name, a.en_name, a.type, a.data, a.tab
        from lf.sys_res a;
    </select>
    <select id="selectCount" resultType="java.lang.Integer">
        select count(*) from lf.sys_role_res
        <where>
@@ -11,14 +17,14 @@
    </select>
    <select id="selectByPage" resultType="com.terra.system.entity.sys.RoleResEntity">
        select a.*,b.name as resName  from lf.sys_role_res a inner join lf.sys_res b
        on a.resid = b.id
        select a.*
        from lf.sys_role_res a
        <where>
            <if test="roleid != null">
                a.roleid = #{roleid}
            </if>
        </where>
        order by id
        order by a.id
        limit #{limit} offset #{offset}
    </select>
@@ -27,7 +33,7 @@
    </select>
    <select id="selectById" resultType="com.terra.system.entity.sys.RoleResEntity">
        select * from lf.sys_role_res where id = #{id}
        select * from lf.sys_role_res where id = #{id};
    </select>
    <insert id="insert" parameterType="com.terra.system.entity.sys.RoleResEntity">