后台服务
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.

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