SystemMapper.xml 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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.tofly.base.mapper.SystemMapper">
  4. <resultMap id="systemMap" type="com.tofly.base.entity.System">
  5. <id property="id" column="ID"/>
  6. <result property="systemName" column="SYSTEM_NAME"/>
  7. <result property="notes" column="NOTES"/>
  8. <result property="createTime" column="CREATE_TIME"/>
  9. <result property="createUser" column="CREATE_USER"/>
  10. <result property="code" column="CODE"/>
  11. <result property="icon" column="ICON"/>
  12. <result property="mouseIcon" column="MOUSE_ICON"/>
  13. <result property="sort" column="SORT"/>
  14. <result property="systemType" column="SYSTEM_TYPE"/>
  15. <result property="statusFlag" column="STATUS_FLAG"/>
  16. <result property="loginIcon" column="LOGIN_ICON"/>
  17. <result property="loginMouseIcon" column="LOGIN_MOUSE_ICON"/>
  18. <result property="platform" column="PLATFORM"/>
  19. </resultMap>
  20. <select id="getSystemListByUser" resultMap="systemMap">
  21. select *
  22. from TF_SMPN_SYSTEM_X s
  23. where s.status_flag = '1'
  24. and exists (select 1
  25. from TF_SMPN_USER_X u,
  26. TF_SMPN_USERROLE_X ur,
  27. TF_SMPN_ROLE_X r,
  28. TF_SMPN_MENU_X m,
  29. TF_SMPN_ROLEMENU_X rm
  30. where u.id = ur.user_id
  31. and ur.role_id = r.id
  32. and rm.role_id = r.id
  33. and rm.menu_id = m.id
  34. and m.sys_id = s.id
  35. and u.status_flag = '1'
  36. and r.status_flag = '1'
  37. and m.status_flag = '1'
  38. and u.id=#{id})
  39. and s.platform=#{platform}
  40. order by sort
  41. </select>
  42. <select id="listSystemPage" resultType="map" databaseId="oracle">
  43. select s.*,
  44. (select notes from tf_smpn_code_x where key='0014' and value=s.platform) platform_nammeame,
  45. (select notes from tf_smpn_code_x where key='0011' and value=s.STATUS_FLAG) status_flag_name
  46. from TF_SMPN_SYSTEM_X s
  47. order by sort
  48. </select>
  49. <select id="listSystemPage" resultType="map" databaseId="mysql">
  50. select s.*,
  51. (select notes from TF_SMPN_CODE_X where `key`='0014' and `value`=s.platform) platform_nammeame,
  52. (select notes from TF_SMPN_CODE_X where `key`='0011' and `value`=s.STATUS_FLAG) status_flag_name
  53. from TF_SMPN_SYSTEM_X s
  54. order by sort
  55. </select>
  56. </mapper>