IndexMapper.xml 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.liang.dao.IndexMapper">
  4. <!--查询一个用户-->
  5. <select id="findAccountByUserId" parameterType="java.lang.String" resultType="map">
  6. select password
  7. from sys_user_info
  8. where user_id = #{_parameter}
  9. </select>
  10. <!--修改密码-->
  11. <update id="doUpdatePassword" parameterType="map">
  12. update sys_user_info
  13. set password = #{passwordnew}
  14. where user_id = #{userId}
  15. </update>
  16. <!-- 查询所有菜单 -->
  17. <select id="menuInit" resultType="map">
  18. select a.permission_id,
  19. a.parent_id,
  20. a.name as title,
  21. a.icon,
  22. a.href,
  23. a.type,
  24. a.target
  25. from sys_permission_info a
  26. where a.del_flag = '0'
  27. and a.status = '0'
  28. and a.type &lt; 3
  29. and exists(
  30. select rp.permission_id
  31. from sys_role_permission rp
  32. left join sys_role_info ri on (rp.role_id = ri.role_id)
  33. where ri.del_flag = '0'
  34. and ri.status = '0'
  35. and exists(select ur.role_id
  36. from sys_user_role ur
  37. where ur.user_id = #{userId} and rp.role_id = ur.role_id)
  38. and a.permission_id = rp.permission_id
  39. )
  40. order by a.type,
  41. a.sort,
  42. a.permission_id
  43. </select>
  44. </mapper>