SysRoleDeptMapper.xml 1.1 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.slibra.system.mapper.SysRoleDeptMapper">
  6. <resultMap type="SysRoleDept" id="SysRoleDeptResult">
  7. <result property="roleId" column="role_id" />
  8. <result property="deptId" column="dept_id" />
  9. </resultMap>
  10. <delete id="deleteRoleDeptByRoleId" parameterType="Long">
  11. delete from sys_role_dept where role_id=#{roleId}
  12. </delete>
  13. <select id="selectCountRoleDeptByDeptId" resultType="Integer">
  14. select count(1) from sys_role_dept where dept_id=#{deptId}
  15. </select>
  16. <delete id="deleteRoleDept" parameterType="Long">
  17. delete from sys_role_dept where role_id in
  18. <foreach collection="array" item="roleId" open="(" separator="," close=")">
  19. #{roleId}
  20. </foreach>
  21. </delete>
  22. <insert id="batchRoleDept">
  23. insert into sys_role_dept(role_id, dept_id) values
  24. <foreach item="item" index="index" collection="list" separator=",">
  25. (#{item.roleId},#{item.deptId})
  26. </foreach>
  27. </insert>
  28. </mapper>