You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

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