AuthorizeMapper.xml 11 KB

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