You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
spms-java/api-admin/src/main/resources/mybatis/mapper/auth/AuthRoleAdminDao.xml

47 lines
1.6 KiB
XML

<?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.glxp.sale.admin.dao.auth.AuthRoleAdminDao">
<select id="listByAdminId" resultType="com.glxp.sale.admin.entity.auth.AuthRoleAdmin">
SELECT role_id
FROM auth_role_admin
where admin_id = #{adminId}
</select>
<select id="listAdminRole" resultType="com.glxp.sale.admin.entity.auth.AuthRole">
select * from auth_role INNER JOIN auth_role_admin on auth_role.id = auth_role_admin.role_id
WHERE auth_role_admin.admin_id = #{adminId};
</select>
<select id="listByAdminIdIn" resultType="com.glxp.sale.admin.entity.auth.AuthRoleAdmin">
SELECT *
FROM auth_role_admin
where admin_id in
<foreach collection="list" item="id" index="index" open="(" close=")" separator=",">
#{id}
</foreach>
</select>
<select id="listByRoleId" resultType="com.glxp.sale.admin.entity.auth.AuthRoleAdmin">
SELECT admin_id
FROM auth_role_admin
where role_id = #{roleId}
</select>
<insert id="insertAuthRoleAdminAll">
INSERT INTO auth_role_admin
(role_id, admin_id)
VALUES
<foreach collection="list" item="item" separator=",">
<if test="item.role_id != null and item.admin_id != null">
(#{item.role_id}, #{item.admin_id})
</if>
</foreach>
</insert>
<delete id="deleteByAdminId" parameterType="java.lang.Long">
delete from auth_role_admin where admin_id = #{adminId}
</delete>
</mapper>