AuthorizeMapper.xml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  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="jnpf.permission.mapper.AuthorizeMapper">
  4. <resultMap id="ModuleVO" type="jnpf.base.model.module.ModuleModel">
  5. <id column="f_id" property="id"/>
  6. <result column="f_parent_id" property="parentId"/>
  7. <result column="f_full_name" property="fullName"/>
  8. <result column="f_en_code" property="enCode"/>
  9. <result column="f_type" property="type"/>
  10. <result column="f_url_address" property="urlAddress"/>
  11. <result column="f_page_address" property="pageAddress"/>
  12. <result column="f_link_target" property="linkTarget"/>
  13. <result column="f_category" property="category"/>
  14. <result column="f_icon" property="icon"/>
  15. <result column="f_sort_code" property="sortCode"/>
  16. <result column="f_property_json" property="propertyJson"/>
  17. <result column="f_module_id" property="moduleId"/>
  18. <result column="f_system_id" property="systemId"/>
  19. <result column="f_description" property="description"/>
  20. <result column="f_creator_time" property="creatorTimes"/>
  21. </resultMap>
  22. <resultMap id="ButtonVO" type="jnpf.base.model.button.ButtonModel">
  23. <id column="f_id" property="id"/>
  24. <result column="f_parent_id" property="parentId"/>
  25. <result column="f_full_name" property="fullName"/>
  26. <result column="f_en_code" property="enCode"/>
  27. <result column="f_icon" property="icon"/>
  28. <result column="f_url_address" property="urlAddress"/>
  29. <result column="f_module_id" property="moduleId"/>
  30. <result column="f_creator_time" property="creatorTimes"/>
  31. <result column="f_sort_code" property="sortCode"/>
  32. </resultMap>
  33. <resultMap id="ColumnVO" type="jnpf.base.model.column.ColumnModel">
  34. <id column="f_id" property="id"/>
  35. <result column="f_parent_id" property="parentId"/>
  36. <result column="f_full_name" property="fullName"/>
  37. <result column="f_en_code" property="enCode"/>
  38. <result column="f_bind_table" property="bindTable"/>
  39. <result column="f_bind_table_name" property="bindTableName"/>
  40. <result column="f_module_id" property="moduleId"/>
  41. <result column="f_creator_time" property="creatorTimes"/>
  42. <result column="f_sort_code" property="sortCode"/>
  43. </resultMap>
  44. <resultMap id="ResourceVO" type="jnpf.base.model.resource.ResourceModel">
  45. <id column="f_id" property="id"/>
  46. <result column="f_full_name" property="fullName"/>
  47. <result column="f_en_code" property="enCode"/>
  48. <result column="f_condition_json" property="conditionJson"/>
  49. <result column="f_condition_text" property="conditionText"/>
  50. <result column="f_module_id" property="moduleId"/>
  51. <result column="f_match_logic" property="matchLogic"/>
  52. <result column="f_object_id" property="objectId"/>
  53. <result column="f_creator_time" property="creatorTimes"/>
  54. <result column="f_sort_code" property="sortCode"/>
  55. </resultMap>
  56. <resultMap id="FormVO" type="jnpf.base.model.form.ModuleFormModel">
  57. <id column="f_id" property="id"/>
  58. <result column="f_parent_id" property="parentId"/>
  59. <result column="f_full_name" property="fullName"/>
  60. <result column="f_en_code" property="enCode"/>
  61. <result column="f_module_id" property="moduleId"/>
  62. <result column="f_creator_time" property="creatorTimes"/>
  63. <result column="f_sort_code" property="sortCode"/>
  64. </resultMap>
  65. <resultMap id="SystemVO" type="jnpf.base.model.base.SystemBaeModel">
  66. <id column="f_id" property="id"/>
  67. <result column="f_full_name" property="fullName"/>
  68. <result column="f_en_code" property="enCode"/>
  69. <result column="f_icon" property="icon"/>
  70. <result column="f_property_json" property="propertyJson"/>
  71. <result column="f_description" property="description"/>
  72. <result column="f_sort_code" property="sortCode"/>
  73. <result column="f_enabled_mark" property="enabledMark"/>
  74. <result column="f_workflow_enabled" property="workflowEnabled"/>
  75. <result column="f_navigation_icon" property="navigationIcon"/>
  76. <result column="f_work_logo_icon" property="workLogoIcon"/>
  77. <result column="f_creator_time" property="creatorTimes"/>
  78. </resultMap>
  79. <select id="findModule" parameterType="String" resultMap="ModuleVO">
  80. SELECT * FROM base_module WHERE 1=1
  81. AND (f_id IN
  82. <trim suffixOverrides=" OR f_id IN()">
  83. <foreach collection="objectId" item="id" index="index" open="(" close=")" >
  84. <if test="index != 0">
  85. <choose>
  86. <when test="index % 1000 == 999">) OR f_id IN (</when>
  87. <otherwise>,</otherwise>
  88. </choose>
  89. </if>
  90. #{id}
  91. </foreach>
  92. </trim>
  93. )
  94. <if test="mark == 1">
  95. and f_enabled_mark = #{mark}
  96. </if>
  97. <if test="systemId != null and systemId.size > 0">
  98. and f_system_id in
  99. <foreach collection="systemId" item="id" open="(" close=")" separator=",">
  100. #{id}
  101. </foreach>
  102. </if>
  103. <if test="moduleAuthorize != null and moduleAuthorize.size > 0">
  104. and f_id not in
  105. <foreach collection="moduleAuthorize" item="moduleId" open="(" close=")" separator=",">
  106. #{moduleId}
  107. </foreach>
  108. </if>
  109. <if test="moduleUrlAddressAuthorize != null and moduleUrlAddressAuthorize.size > 0">
  110. and
  111. ((f_url_address not in
  112. <foreach collection="moduleUrlAddressAuthorize" item="urlAddress" open="(" close=")" separator=",">
  113. #{urlAddress}
  114. </foreach>
  115. )
  116. or f_url_address is null
  117. )
  118. </if>
  119. Order by f_sort_code asc,f_creator_time desc
  120. </select>
  121. <select id="findButton" parameterType="String" resultMap="ButtonVO">
  122. SELECT * FROM base_module_button WHERE 1=1
  123. AND (f_id IN
  124. <trim suffixOverrides=" OR f_id IN()">
  125. <foreach collection="objectId" item="id" index="index" open="(" close=")">
  126. <if test="index != 0">
  127. <choose>
  128. <when test="index % 1000 == 999">) OR f_id IN (</when>
  129. <otherwise>,</otherwise>
  130. </choose>
  131. </if>
  132. #{id}
  133. </foreach>
  134. </trim>
  135. )
  136. and f_enabled_mark = 1 Order by f_sort_code asc,f_creator_time desc
  137. </select>
  138. <select id="findColumn" parameterType="String" resultMap="ColumnVO">
  139. SELECT * FROM base_module_column WHERE 1=1
  140. AND (f_id IN
  141. <trim suffixOverrides=" OR f_id IN()">
  142. <foreach collection="objectId" item="id" index="index" open="(" close=")">
  143. <if test="index != 0">
  144. <choose>
  145. <when test="index % 1000 == 999">) OR f_id IN (</when>
  146. <otherwise>,</otherwise>
  147. </choose>
  148. </if>
  149. #{id}
  150. </foreach>
  151. </trim>
  152. )
  153. and f_enabled_mark = 1 Order by f_sort_code asc,f_creator_time desc
  154. </select>
  155. <select id="findForms" parameterType="String" resultMap="FormVO">
  156. SELECT * FROM base_module_form WHERE 1=1
  157. AND (f_id IN
  158. <trim suffixOverrides=" OR f_id IN()">
  159. <foreach collection="objectId" item="id" index="index" open="(" close=")">
  160. <if test="index != 0">
  161. <choose>
  162. <when test="index % 1000 == 999">) OR f_id IN (</when>
  163. <otherwise>,</otherwise>
  164. </choose>
  165. </if>
  166. #{id}
  167. </foreach>
  168. </trim>
  169. )
  170. and f_enabled_mark = 1 Order by f_sort_code asc,f_creator_time desc
  171. </select>
  172. <select id="findSystem" parameterType="String" resultMap="SystemVO">
  173. SELECT * FROM base_system WHERE f_id IN
  174. <foreach collection="objectId" item="id" open="(" close=")" separator=",">
  175. #{id}
  176. </foreach>
  177. <if test="mark == 1">
  178. and f_enabled_mark = #{mark}
  179. </if>
  180. <if test="enCode != null and enCode != ''">
  181. and f_en_code != #{enCode}
  182. </if>
  183. <if test="moduleAuthorize != null and moduleAuthorize.size > 0">
  184. and f_id not in
  185. <foreach collection="moduleAuthorize" item="moduleId" open="(" close=")" separator=",">
  186. #{moduleId}
  187. </foreach>
  188. </if>
  189. Order by f_sort_code asc,f_creator_time desc
  190. </select>
  191. <select id="findResource" parameterType="String" resultMap="ResourceVO">
  192. select s.*, a.f_object_id from base_module_scheme s
  193. LEFT JOIN base_authorize a on s.f_id = a.f_item_id
  194. where 1=1
  195. AND (s.f_id IN
  196. <trim suffixOverrides=" OR s.f_id IN()">
  197. <foreach collection="objectId" item="id" index="index" open="(" close=")">
  198. <if test="index != 0">
  199. <choose>
  200. <when test="index % 1000 == 999">) OR s.f_id IN (</when>
  201. <otherwise>,</otherwise>
  202. </choose>
  203. </if>
  204. #{id}
  205. </foreach>
  206. </trim>
  207. )
  208. and s.f_enabled_mark = 1 Order by s.f_sort_code asc,s.f_creator_time desc
  209. </select>
  210. <select id="findButtonAdmin" parameterType="Integer" resultMap="ButtonVO">
  211. SELECT * FROM base_module_button WHERE f_enabled_mark = #{mark} Order by f_sort_code asc,f_creator_time desc
  212. </select>
  213. <select id="findColumnAdmin" parameterType="Integer" resultMap="ColumnVO">
  214. SELECT * FROM base_module_column WHERE f_enabled_mark = #{mark} Order by f_sort_code asc,f_creator_time desc
  215. </select>
  216. <select id="findFormsAdmin" parameterType="Integer" resultMap="FormVO">
  217. SELECT * FROM base_module_form WHERE f_enabled_mark = #{mark} Order by f_sort_code asc,f_creator_time desc
  218. </select>
  219. <select id="findResourceAdmin" parameterType="Integer" resultMap="ResourceVO">
  220. SELECT * FROM base_module_scheme WHERE f_enabled_mark = #{mark} Order by f_sort_code asc,f_creator_time desc
  221. </select>
  222. </mapper>