RoleMenuMapper.xml 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.juxiao.xchat.module.system.mapper.RoleMenuMapper">
  6. <resultMap type="com.juxiao.xchat.module.system.domain.RoleMenu" id="RoleMenuResult">
  7. <result property="roleId" column="role_id" />
  8. <result property="menuId" column="menu_id" />
  9. </resultMap>
  10. <delete id="deleteRoleMenuByRoleId" parameterType="java.lang.Long">
  11. delete from sys_role_menu where role_id=#{roleId}
  12. </delete>
  13. <select id="selectCountRoleMenuByMenuId" resultType="java.lang.Integer">
  14. select count(1) from sys_role_menu where menu_id=#{menuId}
  15. </select>
  16. <delete id="deleteRoleMenu" parameterType="java.lang.Long">
  17. delete from sys_role_menu where role_id in
  18. <foreach collection="array" item="roleId" open="(" separator="," close=")">
  19. #{roleId}
  20. </foreach>
  21. </delete>
  22. <insert id="batchRoleMenu">
  23. insert into sys_role_menu(role_id, menu_id) values
  24. <foreach item="item" index="index" collection="list" separator=",">
  25. (#{item.roleId},#{item.menuId})
  26. </foreach>
  27. </insert>
  28. </mapper>