后台服务
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

580 рядки
22 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.WxCUserBasicInfoMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxCUserBasicInfo">
  5. <id column="id" jdbcType="BIGINT" property="id"/>
  6. <result column="phone" jdbcType="VARCHAR" property="phone"/>
  7. <result column="birthdate" jdbcType="TIMESTAMP" property="birthdate"/>
  8. <result column="education" jdbcType="VARCHAR" property="education"/>
  9. <result column="sex" jdbcType="INTEGER" property="sex"/>
  10. <result column="height" jdbcType="VARCHAR" property="height"/>
  11. <result column="weight" jdbcType="VARCHAR" property="weight"/>
  12. <result column="id_card" jdbcType="VARCHAR" property="idCard"/>
  13. <result column="email" jdbcType="VARCHAR" property="email"/>
  14. <result column="address" jdbcType="VARCHAR" property="address"/>
  15. <result column="poins" jdbcType="INTEGER" property="poins"/>
  16. <result column="tag_id" jdbcType="BIGINT" property="tagId"/>
  17. <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
  18. <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
  19. <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
  20. <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId"/>
  21. <result column="final_tenant_id" jdbcType="VARCHAR" property="finalTenantId"/>
  22. <result column="name" jdbcType="VARCHAR" property="name"/>
  23. <result column="level" jdbcType="VARCHAR" property="level"/>
  24. <result column="nick_name" jdbcType="VARCHAR" property="nickName"/>
  25. <result column="avatar_url" jdbcType="VARCHAR" property="avatarUrl"/>
  26. <result column="credit" jdbcType="INTEGER" property="credit"/>
  27. <result column="active_time" jdbcType="TIMESTAMP" property="activeTime"/>
  28. <result column="login_count" jdbcType="INTEGER" property="loginCount"/>
  29. <result column="act_record" jdbcType="INTEGER" property="actRecord"/>
  30. <result column="score_date" jdbcType="TIMESTAMP" property="scoreDate"/>
  31. <result column="status" jdbcType="INTEGER" property="status"/>
  32. </resultMap>
  33. <sql id="allColumns">
  34. wcubi.`id`,wcubi.`phone`,wcubi.`birthdate`,wcubi.`education`,wcubi.`sex`,wcubi.`height`,wcubi.`weight`,wcubi.`id_card`,wcubi.`email`,
  35. wcubi.`address`,wcubi.`poins`,wcubi.`tag_id`,wcubi.`create_date`,wcubi.`update_date`,
  36. wcubi.`final_tenant_id`,wcubi.`tenant_id`,wcubi.`parent_tenant_id`,wcubi.`name`,wcubi.`nick_name`,
  37. wcubi.`avatar_url`,wcubi.`credit`,wcubi.`active_time`,wcubi.`login_count`,wcubi.`act_record`,
  38. wcubi.score_date,wcubi.status
  39. </sql>
  40. <sql id="dynamicWhereConditions">
  41. where wcubi.`final_tenant_id` = #{finalTenantId}
  42. <if test=" null != tenantId and '' != tenantId">
  43. and wcubi.`tenant_id` like concat('%,', #{tenantId},',%')
  44. </if>
  45. <if test=" null != id ">
  46. and wcubi.`id` = #{id}
  47. </if>
  48. <if test=" null != phone ">
  49. and wcubi.`phone` like concat('%', #{phone},'%')
  50. </if>
  51. <if test=" null != birthdate ">
  52. and wcubi.`birthdate` = #{birthdate}
  53. </if>
  54. <if test=" null != education ">
  55. and wcubi.`education` like concat('%', #{education},'%')
  56. </if>
  57. <if test=" null != sex ">
  58. and wcubi.`sex` = #{sex}
  59. </if>
  60. <if test=" null != email ">
  61. and wcubi.`email` like concat('%', #{email},'%')
  62. </if>
  63. <if test=" null != address ">
  64. and wcubi.`address` like concat('%', #{address},'%')
  65. </if>
  66. <if test=" null != levelStartScore ">
  67. and wcubi.poins &gt;= #{levelStartScore}
  68. </if>
  69. <if test=" null != levelEndScore">
  70. and wcubi.poins &lt; #{levelEndScore}
  71. </if>
  72. <if test=" null != tagId ">
  73. and wcubi.`tag_id` = #{tagId}
  74. </if>
  75. <if test=" null != createDate ">
  76. and wcubi.`create_date` = #{createDate}
  77. </if>
  78. <if test=" null != updateDate ">
  79. and wcubi.`update_date` = #{updateDate}
  80. </if>
  81. <if test=" null != actRecord ">
  82. and wcubi.`act_record` = #{actRecord}
  83. </if>
  84. <if test=" null != name ">
  85. and wcubi.`name` like concat('%', #{name},'%')
  86. </if>
  87. <if test=" null != startTime and null != endTime">
  88. and wcubi.`create_date` between #{startTime} and #{endTime}
  89. </if>
  90. <if test=" null != activeStartTime and null != activeEndTime">
  91. and wcubi.`active_time` between #{activeStartTime} and #{activeEndTime}
  92. </if>
  93. <if test=" null != status ">
  94. and wcubi.`status` = #{status}
  95. </if>
  96. <if test=" null != ids ">
  97. and wcubi.id in
  98. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  99. #{idItem}
  100. </foreach>
  101. </if>
  102. <if test=" null != sortColumns">order by ${sortColumns}</if>
  103. </sql>
  104. <select id="selectById" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  105. select <include refid="allColumns"/>
  106. from wx_c_user_basic_info wcubi
  107. where wcubi.id =#{id}
  108. and wcubi.final_tenant_id = #{finalTenantId}
  109. </select>
  110. <select id="findList" parameterType="com.iformall.domain.po.WxCUserBasicInfo" resultMap="BaseResultMap">
  111. select
  112. <include refid="allColumns"/>
  113. from wx_c_user_basic_info wcubi
  114. <include refid="dynamicWhereConditions"/>
  115. </select>
  116. <select id="findListPhoneAndNameByIds" parameterType="com.iformall.domain.po.WxCUserBasicInfo" resultMap="BaseResultMap">
  117. select id, phone, nick_name, name, sex
  118. from wx_c_user_basic_info wcubi
  119. where wcubi.`final_tenant_id` = #{finalTenantId}
  120. <if test=" null != ids ">
  121. and wcubi.id in
  122. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  123. #{idItem}
  124. </foreach>
  125. </if>
  126. </select>
  127. <select id="findIdList" parameterType="com.iformall.domain.po.WxCUserBasicInfo" resultType="Long">
  128. select id
  129. from wx_c_user_basic_info wcubi
  130. <include refid="dynamicWhereConditions"/>
  131. </select>
  132. <update id="updateScore" parameterType="com.iformall.domain.po.WxCUserBasicInfo">
  133. update wx_c_user_basic_info
  134. set poins = #{poins}
  135. where id = #{id}
  136. </update>
  137. <update id="updateUpScore" parameterType="com.iformall.domain.po.WxCUserBasicInfo">
  138. update wx_c_user_basic_info
  139. set poins = poins+#{poins}
  140. where id = #{id}
  141. </update>
  142. <update id="updateDownScore" parameterType="com.iformall.domain.po.WxCUserBasicInfo">
  143. update wx_c_user_basic_info
  144. set poins = poins-#{poins}
  145. where id = #{id}
  146. </update>
  147. <update id="updateNewId" parameterType="com.iformall.domain.vo.CUserBaseVo">
  148. update wx_c_user_basic_info
  149. set id = #{newId} , credit = #{credit} , poins = #{poins}
  150. where id = #{id}
  151. </update>
  152. <select id="findCountBySex" parameterType="com.iformall.domain.dto.WxCUserBasicInfoDto" resultType="java.lang.Long">
  153. select count(wcubi.id)
  154. from wx_c_user_basic_info wcubi
  155. where wcubi.sex =#{sex}
  156. and wcubi.`final_tenant_id` = #{finalTenantId}
  157. <if test=" null != tenantId and '' != tenantId">
  158. and wcubi.`tenant_id` like concat('%,', #{tenantId},',%')
  159. </if>
  160. <if test=" null != startTime ">
  161. and wcubi.create_date &gt;= #{startTime}
  162. </if>
  163. <if test=" null != endTime">
  164. and wcubi.create_date &lt;= #{endTime}
  165. </if>
  166. </select>
  167. <select id="findCountByAge" parameterType="com.iformall.domain.dto.WxCUserBasicInfoDto" resultType="java.lang.Long">
  168. select count(wcubi.id) from wx_c_user_basic_info wcubi
  169. where wcubi.`final_tenant_id` = #{finalTenantId}
  170. <if test=" null != tenantId and '' != tenantId">
  171. and wcubi.`tenant_id` like concat('%,', #{tenantId},',%')
  172. </if>
  173. <if test=" null != startTime ">
  174. and wcubi.create_date &gt;= #{startTime}
  175. </if>
  176. <if test=" null != endTime">
  177. and wcubi.create_date &lt;= #{endTime}
  178. </if>
  179. <if test=" null != birthStartTime ">
  180. and wcubi.birthdate &gt;= #{birthStartTime}
  181. </if>
  182. <if test=" null != birthEndTime">
  183. and wcubi.birthdate &lt;= #{birthEndTime}
  184. </if>
  185. <if test=" null == birthStartTime and null == birthEndTime">
  186. and wcubi.birthdate is null
  187. </if>
  188. </select>
  189. <select id="findCountByScore" parameterType="com.iformall.domain.dto.WxCUserBasicInfoDto" resultType="java.lang.Long">
  190. select count(wcubi.id)
  191. from wx_c_user_basic_info wcubi
  192. where wcubi.`final_tenant_id` = #{finalTenantId}
  193. <if test=" null != tenantId and '' != tenantId">
  194. and wcubi.`tenant_id` like concat('%,', #{tenantId},',%')
  195. </if>
  196. <if test=" null != startTime ">
  197. and wcubi.create_date &gt;= #{startTime}
  198. </if>
  199. <if test=" null != endTime">
  200. and wcubi.create_date &lt;= #{endTime}
  201. </if>
  202. <if test=" null != levelStartScore ">
  203. and wcubi.poins &gt;= #{levelStartScore}
  204. </if>
  205. <if test=" null != levelEndScore">
  206. and wcubi.poins &lt; #{levelEndScore}
  207. </if>
  208. <if test=" null == levelStartScore and null == levelEndScore">
  209. and wcubi.poins is null
  210. </if>
  211. </select>
  212. <sql id="allColumnsOfScoreList">
  213. wcubi.id,wcubi.phone,wcubi.birthdate,wcubi.education,wcubi.sex,wcubi.`height`,wcubi.`weight`,wcubi.`id_card`,wcubi.email,wcubi.address,wcubi.poins,wcubi.tag_id,
  214. wcubi.create_date,wcubi.update_date,wcubi.name,wcubi.level,wcubi.nick_name,wcubi.score_date,wcubi.final_tenant_id
  215. </sql>
  216. <select id="findListByScore" parameterType="com.iformall.domain.dto.WxCUserBasicInfoDto" resultMap="BaseResultMap">
  217. select <include refid="allColumnsOfScoreList"/>
  218. from wx_c_user_basic_info wcubi
  219. where wcubi.status=0
  220. and wcubi.`final_tenant_id` = #{finalTenantId}
  221. <if test=" null != tenantId and '' != tenantId">
  222. and wcubi.`tenant_id` like concat('%,', #{tenantId},',%')
  223. </if>
  224. <if test=" null != levelStartScore ">
  225. and wcubi.poins &gt;= #{levelStartScore}
  226. </if>
  227. <if test=" null != levelEndScore">
  228. and wcubi.poins &lt;= #{levelEndScore}
  229. </if>
  230. <if test=" null == levelStartScore and null == levelEndScore">
  231. and wcubi.poins is null
  232. </if>
  233. order by wcubi.`active_time` DESC
  234. </select>
  235. <select id="findBirthdayList" resultMap="BaseResultMap">
  236. select <include refid="allColumnsOfScoreList"/>
  237. from wx_c_user_basic_info wcubi
  238. where wcubi.status = 0
  239. and wcubi.`final_tenant_id` = #{finalTenantId}
  240. <if test=" null != tenantId and '' != tenantId">
  241. and wcubi.`tenant_id` like concat('%,', #{tenantId},',%')
  242. </if>
  243. AND DATE_FORMAT(wcubi.birthdate,'%m-%d') &gt;= #{begin}
  244. AND DATE_FORMAT(wcubi.birthdate,'%m-%d') &lt;= #{end}
  245. order by wcubi.`active_time` DESC
  246. </select>
  247. <select id="findCount" parameterType="com.iformall.domain.dto.WxCUserBasicInfoDto" resultType="java.lang.Long">
  248. select count(wcubi.id)
  249. from wx_c_user_basic_info wcubi
  250. where wcubi.`final_tenant_id` = #{finalTenantId}
  251. <if test=" null != tenantId and '' != tenantId">
  252. and wcubi.`tenant_id` like concat('%,', #{tenantId},',%')
  253. </if>
  254. <if test=" null != startTime ">
  255. and wcubi.create_date &gt;= #{startTime}
  256. </if>
  257. <if test=" null != endTime">
  258. and wcubi.create_date &lt; #{endTime}
  259. </if>
  260. <if test="1 == queryImport">
  261. and wcubi.create_date like '%00:00:00'
  262. </if>
  263. <if test=" null != ids ">
  264. and wcubi.id in
  265. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  266. #{idItem}
  267. </foreach>
  268. </if>
  269. </select>
  270. <select id="findCountHistory" parameterType="com.iformall.domain.dto.WxCUserBasicInfoDto" resultType="com.iformall.domain.vo.UserCountVo">
  271. select count(wcubi.id) as incCount,
  272. <if test="1 == reportType ">
  273. date_format(wcubi.create_date, '%Y-%m-%d') as reportTime
  274. </if>
  275. <if test="2 == reportType ">
  276. date_format(wcubi.create_date, '%Y-%m') as reportTime
  277. </if>
  278. <if test="3 == reportType ">
  279. date_format(wcubi.create_date, '%Y') as reportTime
  280. </if>
  281. from wx_c_user_basic_info wcubi
  282. where wcubi.`final_tenant_id` = #{finalTenantId}
  283. <if test=" null != tenantId and '' != tenantId">
  284. and wcubi.`tenant_id` like concat('%,', #{tenantId},',%')
  285. </if>
  286. <if test=" null != startTime ">
  287. and wcubi.create_date &gt;= #{startTime}
  288. </if>
  289. <if test=" null != endTime">
  290. and wcubi.create_date &lt; #{endTime}
  291. </if>
  292. <if test="1 == reportType or 2 == reportType or 3 == reportType">
  293. group by reportTime
  294. </if>
  295. </select>
  296. <resultMap id="VoBaseResultMap" type="com.iformall.domain.vo.WxCUserBasicInfoVo">
  297. <id column="id" jdbcType="BIGINT" property="id"/>
  298. <result column="phone" jdbcType="VARCHAR" property="phone"/>
  299. <result column="birthdate" jdbcType="TIMESTAMP" property="birthdate"/>
  300. <result column="education" jdbcType="VARCHAR" property="education"/>
  301. <result column="sex" jdbcType="INTEGER" property="sex"/>
  302. <result column="height" jdbcType="VARCHAR" property="height"/>
  303. <result column="weight" jdbcType="VARCHAR" property="weight"/>
  304. <result column="id_card" jdbcType="VARCHAR" property="idCard"/>
  305. <result column="email" jdbcType="VARCHAR" property="email"/>
  306. <result column="address" jdbcType="VARCHAR" property="address"/>
  307. <result column="poins" jdbcType="INTEGER" property="poins"/>
  308. <result column="tag_id" jdbcType="BIGINT" property="tagId"/>
  309. <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
  310. <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
  311. <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
  312. <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId"/>
  313. <result column="final_tenant_id" jdbcType="VARCHAR" property="finalTenantId"/>
  314. <result column="name" jdbcType="VARCHAR" property="name"/>
  315. <result column="level" jdbcType="VARCHAR" property="level"/>
  316. <result column="nick_name" jdbcType="VARCHAR" property="nickName"/>
  317. <result column="credit" jdbcType="INTEGER" property="credit"/>
  318. <result column="tags" jdbcType="VARCHAR" property="tags"/>
  319. <result column="active_time" jdbcType="TIMESTAMP" property="activeTime"/>
  320. </resultMap>
  321. <sql id="dynamicVoWhereConditions">
  322. where wcubi.`final_tenant_id` = #{finalTenantId}
  323. <if test=" null != id ">
  324. and wcubi.`id` = #{id}
  325. </if>
  326. <if test=" null != tenantId and '' != tenantId">
  327. and wcubi.`tenant_id` like concat('%,', #{tenantId},',%')
  328. </if>
  329. <if test=" null != phone and '' != phone">
  330. and wcubi.`phone` like concat('%', #{phone},'%')
  331. </if>
  332. <if test=" null != birthdate ">
  333. and wcubi.`birthdate` = #{birthdate}
  334. </if>
  335. <if test=" null != education and '' != education">
  336. and wcubi.`education` like concat('%', #{education},'%')
  337. </if>
  338. <if test=" null != sex ">
  339. and wcubi.`sex` = #{sex}
  340. </if>
  341. <if test=" null != email and '' != email">
  342. and wcubi.`email` like concat('%', #{email},'%')
  343. </if>
  344. <if test=" null != address and '' != address">
  345. and wcubi.`address` like concat('%', #{address},'%')
  346. </if>
  347. <if test=" null != poins ">
  348. and wcubi.`poins` = #{poins}
  349. </if>
  350. <if test=" null != tagId ">
  351. and wcubi.`tag_id` = #{tagId}
  352. </if>
  353. <if test=" null != createDate ">
  354. and wcubi.`create_date` = #{createDate}
  355. </if>
  356. <if test=" null != updateDate ">
  357. and wcubi.`update_date` = #{updateDate}
  358. </if>
  359. <if test=" null != actRecord ">
  360. and wcubi.`act_record` = #{actRecord}
  361. </if>
  362. <if test=" null != name and '' != name">
  363. and wcubi.`name` like concat('%', #{name},'%')
  364. </if>
  365. <if test=" null != startTime and null!=endTime">
  366. and wcubi.`create_date` between #{startTime} and #{endTime}
  367. </if>
  368. <if test=" null != activeStartTime and null!=activeEndTime">
  369. and wcubi.`active_time` between #{activeStartTime} and #{activeEndTime}
  370. </if>
  371. <if test=" null != ids ">
  372. and wcubi.id in
  373. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  374. #{idItem}
  375. </foreach>
  376. </if>
  377. order by wcubi.`active_time` DESC
  378. <!--<if test=" null != sortColumns">order by ${sortColumns}</if>-->
  379. </sql>
  380. <select id="findVoList" parameterType="com.iformall.domain.po.WxCUserBasicInfo" resultMap="VoBaseResultMap">
  381. select
  382. wcubi.`id`,wcubi.`name`,wcubi.`sex`,wcubi.`height`,wcubi.`weight`,wcubi.`id_card`,wcubi.`phone`,wcubi.`nick_name`,wcubi.`education`,wcubi.`birthdate`,wcubi.`address`,
  383. wcubi.`active_time`,wcubi.`create_date`,wcubi.`poins`,wcubi.`credit`,wcubi.`tag_id`
  384. from wx_c_user_basic_info wcubi
  385. <include refid="dynamicVoWhereConditions"/>
  386. <if test=" null != begin ">
  387. limit #{begin}, #{limit}
  388. </if>
  389. </select>
  390. <select id="countVoList" parameterType="com.iformall.domain.po.WxCUserBasicInfo" resultType="java.lang.Integer">
  391. select
  392. count(wcubi.id)
  393. from wx_c_user_basic_info wcubi
  394. <include refid="dynamicVoWhereConditions"/>
  395. </select>
  396. <sql id="filterWhereConditions">
  397. where wcubi.`final_tenant_id` = #{finalTenantId}
  398. <if test=" null != tenantId and '' != tenantId">
  399. and wcubi.`tenant_id` like concat('%,', #{tenantId},',%')
  400. </if>
  401. <if test=" null != startTime ">
  402. and wcubi.create_date &gt;= #{startTime}
  403. </if>
  404. <if test=" null != endTime">
  405. and wcubi.create_date &lt;= #{endTime}
  406. </if>
  407. <if test=" null != birthStartTime ">
  408. and wcubi.birthdate &gt;= #{birthStartTime}
  409. </if>
  410. <if test=" null != birthEndTime">
  411. and wcubi.birthdate &lt; #{birthEndTime}
  412. </if>
  413. <if test=" null != loginStartTime ">
  414. and wcubi.active_time &gt;= #{loginStartTime}
  415. </if>
  416. <if test=" null != loginEndTime">
  417. and wcubi.active_time &lt;= #{loginEndTime}
  418. </if>
  419. <if test=" null != phones">
  420. and wcubi.phone in (${phones})
  421. </if>
  422. <if test=" null != levelStartScore and (0 != levelStartScore and '' != levelStartScore)">
  423. and wcubi.poins &gt;= #{levelStartScore}
  424. <if test=" null != levelEndScore">
  425. and wcubi.poins &lt; #{levelEndScore}
  426. </if>
  427. </if>
  428. <if test=" null != levelStartScore and (0 == levelStartScore or '' == levelStartScore)">
  429. and (wcubi.poins is null or
  430. (wcubi.poins &gt;= #{levelStartScore}
  431. <if test=" null != levelEndScore">
  432. and wcubi.poins &lt; #{levelEndScore}
  433. </if>
  434. ))
  435. </if>
  436. <if test=" null != ids ">
  437. and wcubi.id in
  438. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  439. #{idItem}
  440. </foreach>
  441. </if>
  442. <if test=" null != tagIds ">
  443. and wcubi.`tag_id` in
  444. <foreach collection="tagIds" index="index" item="tagIdItem" open="(" separator="," close=")">
  445. #{tagIdItem}
  446. </foreach>
  447. </if>
  448. <if test=" null != sortColumns">order by ${sortColumns}</if>
  449. </sql>
  450. <select id="findCountByFilter" parameterType="com.iformall.domain.dto.WxCUserBasicInfoDto" resultType="java.lang.Long">
  451. select count(distinct wcubi.id)
  452. from wx_c_user_basic_info wcubi
  453. <include refid="filterWhereConditions"/>
  454. </select>
  455. <select id="findListByFilter" parameterType="com.iformall.domain.dto.WxCUserBasicInfoDto" resultMap="BaseResultMap">
  456. select wcubi.`id`,wcubi.`phone`,wcubi.`email`
  457. from wx_c_user_basic_info wcubi
  458. <include refid="filterWhereConditions"/>
  459. </select>
  460. <select id="findIdByFilter" parameterType="com.iformall.domain.dto.WxCUserBasicInfoDto" resultType="java.lang.Long">
  461. select id
  462. from wx_c_user_basic_info wcubi
  463. <include refid="filterWhereConditions"/>
  464. </select>
  465. <select id="findGrowUserCount" resultType="java.lang.Long">
  466. SELECT count(wcubi.id)
  467. FROM wx_c_user_basic_info wcubi
  468. where wcubi.`final_tenant_id` = #{finalTenantId}
  469. <if test=" null != tenantId and '' != tenantId">
  470. and wcubi.`tenant_id` like concat('%,', #{tenantId},',%')
  471. </if>
  472. </select>
  473. <select id="getTotalCreditAmount" resultType="java.lang.Long">
  474. SELECT IFNULL(SUM(wcubi.credit),0)
  475. FROM wx_c_user_basic_info wcubi
  476. where wcubi.`final_tenant_id` = #{finalTenantId}
  477. <if test=" null != tenantId and '' != tenantId">
  478. and wcubi.`tenant_id` like concat('%,', #{tenantId},',%')
  479. </if>
  480. </select>
  481. <update id="incActRecordById" parameterType="java.util.HashMap">
  482. UPDATE wx_c_user_basic_info set act_record = act_record +1 where id = #{id} and final_tenant_id = #{finalTenantId}
  483. </update>
  484. <!--<select id="selectNotCUserList" resultMap="BaseResultMap">
  485. select id,credit from wx_c_user_basic_info cub where not exists (select * from wx_c_user c where c.user_id=cub.id) and cub.credit is null
  486. </select>-->
  487. <update id="cuserOldToNew" statementType="CALLABLE" >
  488. {call cuser_old_to_new(#{oldCuserId},#{newCuserId},#{tableIndex},#{finalTableIndex})}
  489. </update>
  490. </mapper>