Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 
 

318 linhas
14 KiB

  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.iformall.mapper.WxAuthorizerInfoMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxAuthorizerInfo">
  5. <id column="id" jdbcType="BIGINT" property="id"/>
  6. <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
  7. <result column="type" jdbcType="INTEGER" property="type"/>
  8. <result column="authorizer_appid" jdbcType="VARCHAR" property="authorizerAppid"/>
  9. <result column="head_img" jdbcType="VARCHAR" property="headImg"/>
  10. <result column="alias" jdbcType="VARCHAR" property="alias"/>
  11. <result column="qrcode_url" jdbcType="VARCHAR" property="qrcodeUrl"/>
  12. <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
  13. <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
  14. <result column="authorization_status" jdbcType="INTEGER" property="authorizationStatus"/>
  15. <result column="auth_time" jdbcType="TIMESTAMP" property="authTime"/>
  16. <result column="base_status" jdbcType="INTEGER" property="baseStatus"/>
  17. <result column="base_time" jdbcType="TIMESTAMP" property="baseTime"/>
  18. <result column="domain_status" jdbcType="INTEGER" property="domainStatus"/>
  19. <result column="domain_time" jdbcType="TIMESTAMP" property="domainTime"/>
  20. <result column="webdomain_status" jdbcType="INTEGER" property="webdomainStatus"/>
  21. <result column="webdomain_time" jdbcType="TIMESTAMP" property="webdomainTime"/>
  22. <result column="template_status" jdbcType="INTEGER" property="templateStatus"/>
  23. <result column="template_time" jdbcType="TIMESTAMP" property="templateTime"/>
  24. <result column="current_version" jdbcType="VARCHAR" property="currentVersion"/>
  25. <result column="current_desc" jdbcType="VARCHAR" property="currentDesc"/>
  26. <result column="release_time" jdbcType="TIMESTAMP" property="releaseTime"/>
  27. <result column="open_appid" jdbcType="VARCHAR" property="openAppid"/>
  28. <result column="bind_open_time" jdbcType="TIMESTAMP" property="bindOpenTime"/>
  29. <result column="refresh_token" jdbcType="VARCHAR" property="refreshToken"/>
  30. <result column="access_token" jdbcType="VARCHAR" property="accessToken"/>
  31. <result column="access_token_expire" jdbcType="TIMESTAMP" property="accessTokenExpire"/>
  32. <!-- <result column="group_support" jdbcType="INTEGER" property="groupSupport"/>-->
  33. <result column="enable" jdbcType="INTEGER" property="enable"/>
  34. </resultMap>
  35. <sql id="allColumns">
  36. `id`,`tenant_id`,`type`,`authorizer_appid`,`head_img`,`alias`,`qrcode_url`,`create_time`,`authorization_status`,`auth_time`,
  37. `base_status`, `base_time`, `domain_status`, `domain_time`, `webdomain_status`, `webdomain_time`, `template_status`, `template_time`,
  38. `current_version`,`current_desc`,`release_time`,
  39. `open_appid`,`bind_open_time`,`refresh_token`,
  40. `access_token`,`access_token_expire`,`enable`
  41. </sql>
  42. <sql id="dynamicWhereConditions">
  43. where 1 = 1
  44. <if test=" null != id ">
  45. and `id` = #{id}
  46. </if>
  47. <if test=" null != tenantId ">
  48. and `tenant_id` = #{tenantId}
  49. </if>
  50. <if test=" null != type ">
  51. and `type` = #{type}
  52. </if>
  53. <if test=" null != authorizerAppid ">
  54. and `authorizer_appid` = #{authorizerAppid}
  55. </if>
  56. <if test=" null != headImg ">
  57. and `head_img` like concat('%', #{headImg},'%')
  58. </if>
  59. <if test=" null != alias ">
  60. and `alias` like concat('%', #{alias},'%')
  61. </if>
  62. <if test=" null != qrcodeUrl ">
  63. and `qrcode_url` like concat('%', #{qrcodeUrl},'%')
  64. </if>
  65. <if test=" null != createTime ">
  66. and `create_time` = #{createTime}
  67. </if>
  68. <if test=" null != updateTime ">
  69. and `update_time` = #{updateTime}
  70. </if>
  71. <if test=" null != authorizationStatus ">
  72. and `authorization_status` = #{authorizationStatus}
  73. </if>
  74. <if test=" null != authTime ">
  75. and `auth_time` = #{authTime}
  76. </if>
  77. <if test=" null != baseStatus ">
  78. and `base_status` = #{baseStatus}
  79. </if>
  80. <if test=" null != baseTime ">
  81. and `base_time` = #{baseTime}
  82. </if>
  83. <if test=" null != domainStatus ">
  84. and `domain_status` = #{domainStatus}
  85. </if>
  86. <if test=" null != domainTime ">
  87. and `domain_time` = #{domainTime}
  88. </if>
  89. <if test=" null != webdomainStatus ">
  90. and `webdomain_status` = #{webdomainStatus}
  91. </if>
  92. <if test=" null != webdomainTime ">
  93. and `webdomain_time` = #{webdomainTime}
  94. </if>
  95. <if test=" null != templateStatus ">
  96. and `template_status` = #{templateStatus}
  97. </if>
  98. <if test=" null != templateTime ">
  99. and `template_time` = #{templateTime}
  100. </if>
  101. <if test=" null != currentVersion ">
  102. and `current_version` = #{currentVersion}
  103. </if>
  104. <if test=" null != currentDesc ">
  105. and `current_desc` like concat('%', #{currentDesc},'%')
  106. </if>
  107. <if test=" null != releaseTime ">
  108. and `release_time` = #{releaseTime}
  109. </if>
  110. <if test=" null != openAppid ">
  111. and `open_appid` = #{openAppid}
  112. </if>
  113. <if test=" null != bindOpenTime ">
  114. and `bind_open_time` = #{bindOpenTime}
  115. </if>
  116. <if test=" null != enable ">
  117. and `enable` = #{enable}
  118. </if>
  119. <if test=" null != ids ">
  120. and id in
  121. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  122. #{idItem}
  123. </foreach>
  124. </if>
  125. <if test=" null != sortColumns">order by ${sortColumns}</if>
  126. </sql>
  127. <select id="findList" parameterType="com.iformall.domain.po.WxAuthorizerInfo" resultMap="BaseResultMap">
  128. select
  129. <include refid="allColumns"/>
  130. from wx_authorizer_info
  131. <include refid="dynamicWhereConditions"/>
  132. </select>
  133. <update id="updateReleaseInfo" parameterType="com.iformall.domain.po.WxAuthorizerInfo">
  134. update wx_authorizer_info
  135. set `current_version` = #{currentVersion}, `current_desc` = #{currentDesc}, `release_time` = #{releaseTime}, `update_time` = #{updateTime}
  136. where `authorizer_appid` = #{authorizerAppid}
  137. </update>
  138. <update id="updateRefreshToken" parameterType="com.iformall.domain.po.WxAuthorizerInfo">
  139. update wx_authorizer_info
  140. set `refresh_token` = #{refreshToken}
  141. where `authorizer_appid` = #{authorizerAppid}
  142. </update>
  143. <update id="updateAccessToken" parameterType="com.iformall.domain.po.WxAuthorizerInfo">
  144. update wx_authorizer_info
  145. set `access_token` = #{accessToken}, `access_token_expire` = #{accessTokenExpire}
  146. where `authorizer_appid` = #{authorizerAppid}
  147. </update>
  148. <update id="updateAuthBackInfo" parameterType="com.iformall.domain.po.WxAuthorizerInfo">
  149. update wx_authorizer_info
  150. set `auth_back_num` = `auth_back_num` + 1, `auth_back_time` = #{authBackTime}
  151. where `authorizer_appid` = #{authorizerAppid}
  152. </update>
  153. <update id="removeOpenAppId" parameterType="com.iformall.domain.po.WxAuthorizerInfo">
  154. update wx_authorizer_info
  155. set `open_appid` = null, `bind_open_time` = null
  156. where `authorizer_appid` = #{authorizerAppid}
  157. </update>
  158. <select id="findMp" parameterType="com.iformall.domain.po.WxAuthorizerInfo" resultMap="BaseResultMap">
  159. select
  160. <include refid="allColumns"/>
  161. FROM wx_authorizer_info
  162. where open_appid = (select open_appid from wx_authorizer_info where authorizer_appid = #{authorizerAppid})
  163. and `type` = 3 and `tenant_id` = #{tenantId}
  164. </select>
  165. <select id="findWeChatMp" parameterType="com.iformall.domain.po.WxAuthorizerInfo" resultMap="BaseResultMap">
  166. select
  167. <include refid="allColumns"/>
  168. from wx_authorizer_info
  169. where `authorizer_appid` = #{authorizerAppid}
  170. </select>
  171. <select id="findByAppid" parameterType="string" resultMap="BaseResultMap">
  172. select
  173. <include refid="allColumns"/>
  174. from wx_authorizer_info
  175. where `authorizer_appid` = #{value}
  176. </select>
  177. <resultMap id="VBaseResultMap" type="com.iformall.domain.vo.WxWeappInfo">
  178. <id column="id" jdbcType="BIGINT" property="id"/>
  179. <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
  180. <result column="type" jdbcType="INTEGER" property="type"/>
  181. <result column="authorizer_appid" jdbcType="VARCHAR" property="authorizerAppid"/>
  182. <result column="head_img" jdbcType="VARCHAR" property="headImg"/>
  183. <result column="alias" jdbcType="VARCHAR" property="alias"/>
  184. <result column="qrcode_url" jdbcType="VARCHAR" property="qrcodeUrl"/>
  185. <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
  186. <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
  187. <result column="authorization_status" jdbcType="INTEGER" property="authorizationStatus"/>
  188. <result column="auth_time" jdbcType="TIMESTAMP" property="authTime"/>
  189. <result column="base_status" jdbcType="INTEGER" property="baseStatus"/>
  190. <result column="base_time" jdbcType="TIMESTAMP" property="baseTime"/>
  191. <result column="domain_status" jdbcType="INTEGER" property="domainStatus"/>
  192. <result column="domain_time" jdbcType="TIMESTAMP" property="domainTime"/>
  193. <result column="webdomain_status" jdbcType="INTEGER" property="webdomainStatus"/>
  194. <result column="webdomain_time" jdbcType="TIMESTAMP" property="webdomainTime"/>
  195. <result column="template_status" jdbcType="INTEGER" property="templateStatus"/>
  196. <result column="template_time" jdbcType="TIMESTAMP" property="templateTime"/>
  197. <result column="current_version" jdbcType="VARCHAR" property="currentVersion"/>
  198. <result column="current_desc" jdbcType="VARCHAR" property="currentDesc"/>
  199. <result column="release_time" jdbcType="TIMESTAMP" property="releaseTime"/>
  200. <result column="open_appid" jdbcType="VARCHAR" property="openAppid"/>
  201. <result column="bind_open_time" jdbcType="TIMESTAMP" property="bindOpenTime"/>
  202. <result column="name" jdbcType="VARCHAR" property="name"/>
  203. </resultMap>
  204. <sql id="allVColumns">
  205. ai.`id`,ai.`tenant_id`,ai.`type`,ai.`authorizer_appid`,ai.`head_img`,ai.`alias`,ai.`qrcode_url`,ai.`create_time`,ai.`update_time`,
  206. ai.`authorization_status`,ai.`auth_time`,
  207. ai.`base_status`,ai.`base_time`,
  208. ai.`domain_status`,ai.`domain_time`,
  209. ai.`webdomain_status`,ai.`webdomain_time`,
  210. ai.`template_status`,ai.`template_time`,
  211. ai.`current_version`,ai.`current_desc`,ai.`release_time`,
  212. ai.`open_appid`,ai.`bind_open_time`,
  213. a.`name`
  214. </sql>
  215. <sql id="dynamicVWhereConditions">
  216. where 1 = 1
  217. <if test=" null != id ">
  218. and ai.`id` = #{id}
  219. </if>
  220. <if test=" null != name ">
  221. and a.`name` like concat('%', #{name},'%')
  222. </if>
  223. <if test=" null != tenantId ">
  224. and ai.`tenant_id` = #{tenantId}
  225. </if>
  226. <if test=" null != type ">
  227. and ai.`type` = #{type}
  228. </if>
  229. <if test=" null != authorizerAppid ">
  230. and ai.`authorizer_appid` = #{authorizerAppid}
  231. </if>
  232. <if test=" null != authorizationStatus ">
  233. and ai.`authorization_status` = #{authorizationStatus}
  234. </if>
  235. <if test=" null != authTime ">
  236. and ai.`auth_time` = #{authTime}
  237. </if>
  238. <if test=" null != baseStatus ">
  239. and ai.`base_status` = #{baseStatus}
  240. </if>
  241. <if test=" null != baseTime ">
  242. and ai.`base_time` = #{baseTime}
  243. </if>
  244. <if test=" null != domainStatus ">
  245. and ai.`domain_status` = #{domainStatus}
  246. </if>
  247. <if test=" null != domainTime ">
  248. and ai.`domain_time` = #{domainTime}
  249. </if>
  250. <if test=" null != webdomainStatus ">
  251. and ai.`webdomain_status` = #{webdomainStatus}
  252. </if>
  253. <if test=" null != webdomainTime ">
  254. and ai.`webdomain_time` = #{webdomainTime}
  255. </if>
  256. <if test=" null != templateStatus ">
  257. and ai.`template_status` = #{templateStatus}
  258. </if>
  259. <if test=" null != templateTime ">
  260. and ai.`template_time` = #{templateTime}
  261. </if>
  262. <if test=" null != currentVersion ">
  263. and ai.`current_version` = #{currentVersion}
  264. </if>
  265. <if test=" null != openAppid ">
  266. and ai.`open_appid` = #{openAppid}
  267. </if>
  268. <if test=" null != ids ">
  269. and ai.id in
  270. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  271. #{idItem}
  272. </foreach>
  273. </if>
  274. <if test=" null != sortColumns">order by ${sortColumns}</if>
  275. </sql>
  276. <select id="findVoList" parameterType="com.iformall.domain.vo.WxWeappInfo" resultMap="VBaseResultMap">
  277. select
  278. <include refid="allVColumns"/>
  279. from wx_authorizer_info ai
  280. left join wx_appinfo a on ai.`authorizer_appid` = a.app_id
  281. <include refid="dynamicVWhereConditions"/>
  282. </select>
  283. <select id="findWeappList" resultMap="VBaseResultMap">
  284. select
  285. <include refid="allVColumns"/>
  286. from wx_authorizer_info ai
  287. left join wx_appinfo a on ai.`authorizer_appid` = a.app_id
  288. where a.type = 1 or a.type = 2
  289. </select>
  290. <select id="findWxMpList" resultMap="VBaseResultMap">
  291. select
  292. <include refid="allVColumns"/>
  293. from wx_authorizer_info ai
  294. left join wx_appinfo a on ai.`authorizer_appid` = a.app_id
  295. where a.type = 3 or a.type = 4
  296. </select>
  297. </mapper>