2
0

MenuMapper.xml 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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.imed.costaccount.mapper.MenuMapper">
  4. <!-- 可根据自己的需求,是否要使用 -->
  5. <resultMap type="com.imed.costaccount.model.Menu" id="menuMap">
  6. <result property="menuId" column="menu_id"/>
  7. <result property="parentId" column="parent_id"/>
  8. <result property="name" column="name"/>
  9. <result property="path" column="path"/>
  10. <result property="url" column="url"/>
  11. <result property="perms" column="perms"/>
  12. <result property="hospId" column="hosp_id"/>
  13. <result property="type" column="type"/>
  14. <result property="icon" column="icon"/>
  15. <result property="orderNum" column="order_num"/>
  16. <result property="modifyUserId" column="modify_user_id"/>
  17. <result property="modifyTime" column="modify_time"/>
  18. </resultMap>
  19. <select id="getNav" resultType="com.imed.costaccount.model.Menu">
  20. select *
  21. from sys_menu sm
  22. where sm.menu_id in (select distinct rm.menu_id
  23. from sys_user_role ur
  24. LEFT JOIN sys_role_menu rm on ur.role_id = rm.role_id
  25. LEFT JOIN sys_user su on ur.user_id = su.id
  26. where su.id = #{id}
  27. and su.hosp_id = #{hospId}
  28. and ur.hosp_id = #{hospId}
  29. and rm.hosp_id = #{hospId})
  30. and sm.type != 3
  31. order by order_num asc
  32. </select>
  33. <select id="getAllParentNav" resultType="com.imed.costaccount.model.vo.NavVO">
  34. select *
  35. from sys_menu sm
  36. where sm.menu_id in (select distinct rm.menu_id
  37. from sys_user_role ur
  38. LEFT JOIN sys_role_menu rm on ur.role_id = rm.role_id
  39. LEFT JOIN sys_user su on ur.user_id = su.id
  40. where su.id = #{id}
  41. and su.hosp_id = #{hospId}
  42. and ur.hosp_id = #{hospId}
  43. and rm.hosp_id = #{hospId})
  44. and sm.type = 0
  45. order by order_num asc
  46. </select>
  47. </mapper>