管道基础大数据平台系统开发-【后端】-Server
13693261870
2024-03-25 1c285b38777e9f37ee8d112e994443d3640b78c1
src/main/resources/mapper/sys/AuthMapper.xml
@@ -1,7 +1,7 @@
<?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.lf.server.mapper.sys.AuthMapper">
    <select id="selectCount" resultType="java.lang.Integer" parameterType="java.lang.String">
    <select id="selectCount" resultType="java.lang.Integer">
        select count(*) from lf.sys_auth
        <where>
            <if test="name != null">
@@ -11,7 +11,7 @@
    </select>
    <select id="selectByPage" resultType="com.lf.server.entity.sys.AuthEntity">
        select * from lf.sys_auth
        select a.*, fn_uname(create_user) createName, fn_uname(update_user) updateName from lf.sys_auth a
        <where>
            <if test="name != null">
                name = #{name}
@@ -21,7 +21,7 @@
        limit #{limit} offset #{offset}
    </select>
    <select id="selectCountForMenu" resultType="java.lang.Integer" parameterType="java.lang.String">
    <select id="selectCountForMenu" resultType="java.lang.Integer">
        select count(a.*) from lf.sys_auth a where not exists (select b.id from lf.sys_menu_auth b
        <where>
            b.authid = a.id
@@ -33,7 +33,8 @@
    </select>
    <select id="selectByPageForMenu" resultType="com.lf.server.entity.sys.AuthEntity">
        select a.* from lf.sys_auth a where not exists (select b.id from lf.sys_menu_auth b
        select a.*, fn_uname(create_user) createName, fn_uname(update_user) updateName
        from lf.sys_auth a where not exists (select b.id from lf.sys_menu_auth b
        <where>
            b.authid = a.id
            <if test="menuid != null">
@@ -46,39 +47,52 @@
    </select>
    <select id="selectAuthAll" resultType="com.lf.server.entity.sys.AuthEntity">
        select * from lf.sys_auth order by id
        select a.*, fn_uname(create_user) createName, fn_uname(update_user) updateName
        from lf.sys_auth a
        order by id
    </select>
    <select id="selectAuth" resultType="com.lf.server.entity.sys.AuthEntity">
        select * from lf.sys_auth where id = #{id}
        select a.*, fn_uname(create_user) createName, fn_uname(update_user) updateName
        from lf.sys_auth a
        where id = #{id}
    </select>
    <insert id="insertAuth"   parameterType="com.lf.server.entity.sys.AuthEntity">
    <insert id="insertAuth" parameterType="com.lf.server.entity.sys.AuthEntity">
       insert into lf.sys_auth
       (name,tag,create_user,create_time,bak)
       values
       (#{name},#{tag},#{createUser},now(),#{bak});
    </insert>
    <insert id="insertAuths"   >
    <insert id="insertAuths">
       insert into lf.sys_auth
        (name,tag,create_user,create_time,bak)
       values
        <foreach collection="list"   item="item" index="index" separator=","  >
        <foreach collection="list" item="item" index="index" separator=","  >
            (#{item.name},#{item.tag},#{item.createUser},now(),#{item.bak})
        </foreach>
    </insert>
    <delete id="deleteAuth"  >
        delete from lf.sys_auth where id = #{id}
    <delete id="deleteAuth">
        delete from lf.sys_role_menu_auth where menu_auth_id in (select id from lf.sys_menu_auth where authid = #{id});
        delete from lf.sys_menu_auth where authid = #{id};
        delete from lf.sys_auth where id = #{id};
    </delete>
    <delete id="deleteAuths"  >
        delete from lf.sys_role_menu_auth where menu_auth_id in (select id from lf.sys_menu_auth where authid in
        <foreach item="id" collection="ids" index="index" open="(" separator="," close=")">
            #{id}
        </foreach>);
        delete from lf.sys_menu_auth where authid in
        <foreach item="id" collection="ids" index="index" open="(" separator="," close=")">
            #{id}
        </foreach>;
        delete from lf.sys_auth where id in
        <foreach item="ids" collection="list" index="index" open="("
                 separator="," close=")">
            #{ids}
        </foreach>
        <foreach item="id" collection="ids" index="index" open="(" separator="," close=")">
            #{id}
        </foreach>;
    </delete>
    <update id="updateAuth">