BaseAuthorizationMapper.xml 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  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.hcloud.microservice.org.dao.BaseAuthorizationMapper">
  4. <resultMap id="BaseResultMap" type="com.hcloud.microservice.org.facade.entity.BaseAuthorization">
  5. <id column="guid" jdbcType="CHAR" property="guid" />
  6. <result column="parent_guid" jdbcType="CHAR" property="parentGuid" />
  7. <result column="fk_product_guid" jdbcType="CHAR" property="fkProductGuid" />
  8. <result column="fun_name" jdbcType="VARCHAR" property="funName" />
  9. <result column="auth_str" jdbcType="VARCHAR" property="authStr" />
  10. <result column="file_url" jdbcType="VARCHAR" property="fileUrl" />
  11. <result column="ico" jdbcType="VARCHAR" property="ico" />
  12. <result column="remark" jdbcType="VARCHAR" property="remark" />
  13. <result column="orderby" jdbcType="INTEGER" property="orderby" />
  14. <result column="node_type" jdbcType="INTEGER" property="nodeType" />
  15. <result column="is_forbid" jdbcType="INTEGER" property="isForbid" />
  16. <result column="state" jdbcType="INTEGER" property="state" />
  17. <result column="create_user" jdbcType="CHAR" property="createUser" />
  18. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  19. <result column="modified_user" jdbcType="CHAR" property="modifiedUser" />
  20. <result column="modified_time" jdbcType="TIMESTAMP" property="modifiedTime" />
  21. </resultMap>
  22. <sql id="Base_Column_List">
  23. guid, parent_guid, fk_product_guid, fun_name, auth_str, file_url, ico, remark, orderby,
  24. node_type,is_forbid, state, create_user, create_time, modified_user, modified_time
  25. </sql>
  26. <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
  27. select
  28. <include refid="Base_Column_List" />
  29. from t_base_authorization
  30. where guid = #{guid,jdbcType=CHAR}
  31. </select>
  32. <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
  33. delete from t_base_authorization
  34. where guid = #{guid,jdbcType=CHAR}
  35. </delete>
  36. <insert id="insert" parameterType="com.hcloud.microservice.org.facade.entity.BaseAuthorization">
  37. insert into t_base_authorization (guid, parent_guid, fk_product_guid,
  38. fun_name, auth_str, file_url,
  39. ico, remark, orderby, node_type,
  40. is_forbid, state, create_user,
  41. create_time, modified_user, modified_time
  42. )
  43. values (#{guid,jdbcType=CHAR}, #{parentGuid,jdbcType=CHAR}, #{fkProductGuid,jdbcType=CHAR},
  44. #{funName,jdbcType=VARCHAR}, #{authStr,jdbcType=VARCHAR}, #{fileUrl,jdbcType=VARCHAR},
  45. #{ico,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{orderby,jdbcType=INTEGER},
  46. #{nodeType,jdbcType=INTEGER},#{isForbid,jdbcType=INTEGER}, #{state,jdbcType=INTEGER}, #{createUser,jdbcType=CHAR},
  47. #{createTime,jdbcType=TIMESTAMP}, #{modifiedUser,jdbcType=CHAR}, #{modifiedTime,jdbcType=TIMESTAMP}
  48. )
  49. </insert>
  50. <insert id="insertSelective" parameterType="com.hcloud.microservice.org.facade.entity.BaseAuthorization">
  51. insert into t_base_authorization
  52. <trim prefix="(" suffix=")" suffixOverrides=",">
  53. <if test="guid != null">
  54. guid,
  55. </if>
  56. <if test="parentGuid != null">
  57. parent_guid,
  58. </if>
  59. <if test="fkProductGuid != null">
  60. fk_product_guid,
  61. </if>
  62. <if test="funName != null">
  63. fun_name,
  64. </if>
  65. <if test="authStr != null">
  66. auth_str,
  67. </if>
  68. <if test="fileUrl != null">
  69. file_url,
  70. </if>
  71. <if test="ico != null">
  72. ico,
  73. </if>
  74. <if test="remark != null">
  75. remark,
  76. </if>
  77. <if test="orderby != null">
  78. orderby,
  79. </if>
  80. <if test="nodeType != null">
  81. node_type,
  82. </if>
  83. <if test="isForbid != null">
  84. is_forbid,
  85. </if>
  86. <if test="state != null">
  87. state,
  88. </if>
  89. <if test="createUser != null">
  90. create_user,
  91. </if>
  92. <if test="createTime != null">
  93. create_time,
  94. </if>
  95. <if test="modifiedUser != null">
  96. modified_user,
  97. </if>
  98. <if test="modifiedTime != null">
  99. modified_time,
  100. </if>
  101. </trim>
  102. <trim prefix="values (" suffix=")" suffixOverrides=",">
  103. <if test="guid != null">
  104. #{guid,jdbcType=CHAR},
  105. </if>
  106. <if test="parentGuid != null">
  107. #{parentGuid,jdbcType=CHAR},
  108. </if>
  109. <if test="fkProductGuid != null">
  110. #{fkProductGuid,jdbcType=CHAR},
  111. </if>
  112. <if test="funName != null">
  113. #{funName,jdbcType=VARCHAR},
  114. </if>
  115. <if test="authStr != null">
  116. #{authStr,jdbcType=VARCHAR},
  117. </if>
  118. <if test="fileUrl != null">
  119. #{fileUrl,jdbcType=VARCHAR},
  120. </if>
  121. <if test="ico != null">
  122. #{ico,jdbcType=VARCHAR},
  123. </if>
  124. <if test="remark != null">
  125. #{remark,jdbcType=VARCHAR},
  126. </if>
  127. <if test="orderby != null">
  128. #{orderby,jdbcType=INTEGER},
  129. </if>
  130. <if test="nodeType != null">
  131. #{nodeType,jdbcType=INTEGER},
  132. </if>
  133. <if test="isForbid != null">
  134. #{isForbid,jdbcType=INTEGER},
  135. </if>
  136. <if test="state != null">
  137. #{state,jdbcType=INTEGER},
  138. </if>
  139. <if test="createUser != null">
  140. #{createUser,jdbcType=CHAR},
  141. </if>
  142. <if test="createTime != null">
  143. #{createTime,jdbcType=TIMESTAMP},
  144. </if>
  145. <if test="modifiedUser != null">
  146. #{modifiedUser,jdbcType=CHAR},
  147. </if>
  148. <if test="modifiedTime != null">
  149. #{modifiedTime,jdbcType=TIMESTAMP},
  150. </if>
  151. </trim>
  152. </insert>
  153. <update id="updateByPrimaryKeySelective" parameterType="com.hcloud.microservice.org.facade.entity.BaseAuthorization">
  154. update t_base_authorization
  155. <set>
  156. <if test="parentGuid != null">
  157. parent_guid = #{parentGuid,jdbcType=CHAR},
  158. </if>
  159. <if test="fkProductGuid != null">
  160. fk_product_guid = #{fkProductGuid,jdbcType=CHAR},
  161. </if>
  162. <if test="funName != null">
  163. fun_name = #{funName,jdbcType=VARCHAR},
  164. </if>
  165. <if test="authStr != null">
  166. auth_str = #{authStr,jdbcType=VARCHAR},
  167. </if>
  168. <if test="fileUrl != null">
  169. file_url = #{fileUrl,jdbcType=VARCHAR},
  170. </if>
  171. <if test="ico != null">
  172. ico = #{ico,jdbcType=VARCHAR},
  173. </if>
  174. <if test="remark != null">
  175. remark = #{remark,jdbcType=VARCHAR},
  176. </if>
  177. <if test="orderby != null">
  178. orderby = #{orderby,jdbcType=INTEGER},
  179. </if>
  180. <if test="nodeType != null">
  181. node_type=#{nodeType,jdbcType=INTEGER},
  182. </if>
  183. <if test="isForbid != null">
  184. is_forbid = #{isForbid,jdbcType=INTEGER},
  185. </if>
  186. <if test="state != null">
  187. state = #{state,jdbcType=INTEGER},
  188. </if>
  189. <if test="createUser != null">
  190. create_user = #{createUser,jdbcType=CHAR},
  191. </if>
  192. <if test="createTime != null">
  193. create_time = #{createTime,jdbcType=TIMESTAMP},
  194. </if>
  195. <if test="modifiedUser != null">
  196. modified_user = #{modifiedUser,jdbcType=CHAR},
  197. </if>
  198. <if test="modifiedTime != null">
  199. modified_time = #{modifiedTime,jdbcType=TIMESTAMP},
  200. </if>
  201. </set>
  202. where guid = #{guid,jdbcType=CHAR}
  203. </update>
  204. <update id="updateByPrimaryKey" parameterType="com.hcloud.microservice.org.facade.entity.BaseAuthorization">
  205. update t_base_authorization
  206. set parent_guid = #{parentGuid,jdbcType=CHAR},
  207. fk_product_guid = #{fkProductGuid,jdbcType=CHAR},
  208. fun_name = #{funName,jdbcType=VARCHAR},
  209. auth_str = #{authStr,jdbcType=VARCHAR},
  210. file_url = #{fileUrl,jdbcType=VARCHAR},
  211. ico = #{ico,jdbcType=VARCHAR},
  212. remark = #{remark,jdbcType=VARCHAR},
  213. orderby = #{orderby,jdbcType=INTEGER},
  214. node_type = #{nodeType,jdbcType=INTEGER},
  215. is_forbid = #{isForbid,jdbcType=INTEGER},
  216. state = #{state,jdbcType=INTEGER},
  217. create_user = #{createUser,jdbcType=CHAR},
  218. create_time = #{createTime,jdbcType=TIMESTAMP},
  219. modified_user = #{modifiedUser,jdbcType=CHAR},
  220. modified_time = #{modifiedTime,jdbcType=TIMESTAMP}
  221. where guid = #{guid,jdbcType=CHAR}
  222. </update>
  223. <select id="searchBaseAuthInfoByPage" parameterType="com.hcloud.microserver.commoncore.base.PageBean" resultType="com.hcloud.microservice.org.bo.BaseAuthBO">
  224. SELECT
  225. aa.guid,
  226. aa.fun_name AS funName,
  227. aa.file_url AS fileUrl,
  228. aa.auth_str AS authStr,
  229. aa.ico,
  230. aa.orderby,
  231. aa.is_forbid AS isForbid,
  232. aa.node_type AS nodeType,
  233. aa.create_time AS createTime
  234. FROM
  235. t_base_authorization aa
  236. <where>
  237. <if test="data.funName!=null and data.funName!=''">
  238. aa.fun_name LIKE CONCAT(#{data.funName},'%')
  239. </if>
  240. <if test="data.fileUrl!=null and data.fileUrl!=''">
  241. AND aa.file_url = #{data.fileUrl}
  242. </if>
  243. </where>
  244. </select>
  245. <select id="searchMenuAuthInfo" resultType="com.hcloud.microservice.org.bo.BaseAuthBO">
  246. SELECT
  247. aa.guid,
  248. aa.parent_guid AS parentGuid,
  249. aa.fun_name AS funName,
  250. aa.file_url AS fileUrl,
  251. aa.auth_str AS authStr,
  252. aa.ico,
  253. aa.orderby,
  254. aa.is_forbid AS isForbid,
  255. aa.create_time AS createTime
  256. FROM
  257. t_base_authorization aa
  258. WHERE
  259. aa.is_forbid=0
  260. AND aa.node_type = 0
  261. </select>
  262. <select id="searchAllBaseAuthInfo" resultType="com.hcloud.microservice.org.bo.BaseAuthBO">
  263. SELECT
  264. aa.guid,
  265. aa.fk_product_guid AS fkProductGuid,
  266. aa.parent_guid AS parentGuid,
  267. aa.fun_name AS funName,
  268. aa.file_url AS fileUrl,
  269. aa.auth_str AS authStr,
  270. aa.ico,
  271. aa.orderby,
  272. aa.is_forbid AS isForbid,
  273. aa.node_type AS nodeType,
  274. aa.create_time AS createTime
  275. FROM
  276. t_base_authorization aa
  277. WHERE
  278. aa.is_forbid=0
  279. </select>
  280. </mapper>