Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 
 
 

1129 righe
43 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. <result column="qr_code" jdbcType="INTEGER" property="qrCode"/>
  33. </resultMap>
  34. <sql id="allColumns">
  35. wcubi.`id`,wcubi.`phone`,wcubi.`birthdate`,wcubi.`education`,wcubi.`sex`,wcubi.`height`,wcubi.`weight`,wcubi.`id_card`,wcubi.`email`,
  36. wcubi.`address`,wcubi.`poins`,wcubi.`tag_id`,wcubi.`create_date`,wcubi.`update_date`,
  37. wcubi.`final_tenant_id`,wcubi.`tenant_id`,wcubi.`parent_tenant_id`,wcubi.`name`,wcubi.`nick_name`,
  38. wcubi.`avatar_url`,wcubi.`credit`,wcubi.`active_time`,wcubi.`login_count`,wcubi.`act_record`,wcubi.`qr_code`
  39. ,(select level from wx_level_config
  40. where poins >= points and tenant_id=wcubi.final_tenant_id
  41. order by points desc limit 1 ) level,wcubi.score_date,wcubi.status
  42. </sql>
  43. <sql id="allSimpleColumns">
  44. `id`,`phone`,`birthdate`,`education`,`sex`,`height`,`weight`,`id_card`,`email`,`address`,`poins`,`tag_id`,
  45. `create_date`,`update_date`,`tenant_id`,`parent_tenant_id`,`name`,`nick_name`,`credit`,`active_time`,`act_record`
  46. </sql>
  47. <sql id="dynamicWhereConditions">
  48. where 1 = 1
  49. <if test=" null != id ">
  50. and wcubi.`id` = #{id}
  51. </if>
  52. <if test=" null != finalTenantId and '' != finalTenantId">
  53. and wcubi.`final_tenant_id` = #{finalTenantId}
  54. </if>
  55. <if test=" null != phone ">
  56. and wcubi.`phone` like concat('%', #{phone},'%')
  57. </if>
  58. <if test=" null != birthdate ">
  59. and wcubi.`birthdate` = #{birthdate}
  60. </if>
  61. <if test=" null != education ">
  62. and wcubi.`education` like concat('%', #{education},'%')
  63. </if>
  64. <if test=" null != sex ">
  65. and wcubi.`sex` = #{sex}
  66. </if>
  67. <if test=" null != email ">
  68. and wcubi.`email` like concat('%', #{email},'%')
  69. </if>
  70. <if test=" null != address ">
  71. and wcubi.`address` like concat('%', #{address},'%')
  72. </if>
  73. <if test=" null != poins ">
  74. and wcubi.`poins` = #{poins}
  75. </if>
  76. <if test=" null != credit ">
  77. and wcubi.`credit` = #{credit}
  78. </if>
  79. <if test=" null != tagId ">
  80. and wcubi.`tag_id` = #{tagId}
  81. </if>
  82. <if test=" null != createDate ">
  83. and wcubi.`create_date` = #{createDate}
  84. </if>
  85. <if test=" null != updateDate ">
  86. and wcubi.`update_date` = #{updateDate}
  87. </if>
  88. <if test=" null != actRecord ">
  89. and wcubi.`act_record` = #{actRecord}
  90. </if>
  91. <if test=" null != name ">
  92. and wcubi.`name` like concat('%', #{name},'%')
  93. </if>
  94. <if test=" null != startTime and null!=endTime">
  95. and wcubi.`create_date` between #{startTime} and #{endTime}
  96. </if>
  97. <if test=" null != activeStartTime and null!=activeEndTime">
  98. and wcubi.`active_time` between #{activeStartTime} and #{activeEndTime}
  99. </if>
  100. <if test=" null != status ">
  101. and wcubi.`status` = #{status}
  102. </if>
  103. <if test=" null != carNumber and '' != carNumber">
  104. and wcubi.id in (select c_user_id from wx_c_user_car
  105. where (`tenant_id` = #{finalTenantId} or `parent_tenant_id` = #{finalTenantId})
  106. and car_number like concat('%', #{carNumber},'%'))
  107. </if>
  108. <if test=" null != ids ">
  109. and wcubi.id in
  110. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  111. #{idItem}
  112. </foreach>
  113. </if>
  114. <if test=" null != sortColumns">order by ${sortColumns}</if>
  115. </sql>
  116. <select id="selectById" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  117. select <include refid="allColumns"/> from wx_c_user_basic_info wcubi where wcubi.id =#{id} and wcubi.final_tenant_id = #{finalTenantId}
  118. </select>
  119. <select id="findList" parameterType="com.iformall.domain.po.WxCUserBasicInfo" resultMap="BaseResultMap">
  120. select r.* from (
  121. select
  122. <include refid="allColumns"/>
  123. from wx_c_user_basic_info wcubi
  124. <include refid="dynamicWhereConditions"/>
  125. ) r where 1=1
  126. <if test="null != level and '' != level">
  127. and r.level =#{level}
  128. </if>
  129. </select>
  130. <sql id="dynamicWhereConditions1">
  131. where 1 = 1
  132. <if test=" null != basicInfo.id ">
  133. and wcubi.`id` = #{basicInfo.id}
  134. </if>
  135. <if test=" null != tenantInfo.tenantId and '' != tenantInfo.tenantId">
  136. and wcubi.`tenant_id` like concat('%,', #{tenantInfo.tenantId},',%')
  137. </if>
  138. <if test=" null != basicInfo.phone ">
  139. and wcubi.`phone` like concat('%', #{basicInfo.phone},'%')
  140. </if>
  141. <if test=" null != basicInfo.birthdate ">
  142. and wcubi.`birthdate` = #{basicInfo.birthdate}
  143. </if>
  144. <if test=" null != basicInfo.education ">
  145. and wcubi.`education` like concat('%', #{basicInfo.education},'%')
  146. </if>
  147. <if test=" null != basicInfo.sex ">
  148. and wcubi.`sex` = #{basicInfo.sex}
  149. </if>
  150. <if test=" null != basicInfo.email ">
  151. and wcubi.`email` like concat('%', #{basicInfo.email},'%')
  152. </if>
  153. <if test=" null != basicInfo.address ">
  154. and wcubi.`address` like concat('%', #{basicInfo.address},'%')
  155. </if>
  156. <if test=" null != basicInfo.poins ">
  157. and wcubi.`poins` = #{basicInfo.poins}
  158. </if>
  159. <if test=" null != basicInfo.credit ">
  160. and wcubi.`credit` = #{basicInfo.credit}
  161. </if>
  162. <if test=" null != basicInfo.tagId ">
  163. and wcubi.`tag_id` = #{basicInfo.tagId}
  164. </if>
  165. <if test=" null != basicInfo.createDate ">
  166. and wcubi.`create_date` = #{basicInfo.createDate}
  167. </if>
  168. <if test=" null != basicInfo.updateDate ">
  169. and wcubi.`update_date` = #{basicInfo.updateDate}
  170. </if>
  171. <if test=" null != basicInfo.actRecord ">
  172. and wcubi.`act_record` = #{basicInfo.actRecord}
  173. </if>
  174. <if test=" null != basicInfo.name ">
  175. and wcubi.`name` like concat('%', #{basicInfo.name},'%')
  176. </if>
  177. <if test=" null != basicInfo.startTime and null != basicInfo.endTime">
  178. and wcubi.`create_date` between #{basicInfo.startTime} and #{basicInfo.endTime}
  179. </if>
  180. <if test=" null != basicInfo.activeStartTime and null!=basicInfo.activeEndTime">
  181. and wcubi.`active_time` between #{basicInfo.activeStartTime} and #{basicInfo.activeEndTime}
  182. </if>
  183. <if test=" null != basicInfo.status ">
  184. and wcubi.`status` = #{basicInfo.status}
  185. </if>
  186. <if test=" null != basicInfo.carNumber and '' != basicInfo.carNumber">
  187. and wcubi.id in (select c_user_id from wx_c_user_car
  188. where 1=1
  189. <if test=" null != tenantInfo.tenantId and '' != tenantInfo.tenantId">
  190. and `tenant_id` = #{tenantInfo.tenantId}
  191. </if>
  192. <if test=" null != tenantInfo.parentTenantId and '' != tenantInfo.parentTenantId">
  193. and `parent_tenant_id` = #{tenantInfo.parentTenantId}
  194. </if>
  195. and car_number like concat('%', #{basicInfo.carNumber},'%'))
  196. </if>
  197. <if test=" null != basicInfo.ids ">
  198. and wcubi.id in
  199. <foreach collection="basicInfo.ids" index="index" item="idItem" open="(" separator="," close=")">
  200. #{idItem}
  201. </foreach>
  202. </if>
  203. <if test=" null != basicInfo.sortColumns">order by ${basicInfo.sortColumns}</if>
  204. </sql>
  205. <select id="findList1" resultMap="BaseResultMap">
  206. select r.* from (
  207. select
  208. <include refid="allColumns"/>
  209. from wx_c_user_basic_info wcubi
  210. <include refid="dynamicWhereConditions1"/>
  211. ) r where 1=1
  212. <if test="null != basicInfo.level and '' != basicInfo.level">
  213. and r.level =#{basicInfo.level}
  214. </if>
  215. </select>
  216. <update id="updateScore" parameterType="com.iformall.domain.po.WxCUserBasicInfo">
  217. update wx_c_user_basic_info set poins=#{poins}
  218. where id=#{id}
  219. </update>
  220. <update id="updateQrCode" parameterType="com.iformall.domain.po.WxCUserBasicInfo">
  221. update wx_c_user_basic_info set qr_code=#{qrCode}
  222. where id=#{id}
  223. </update>
  224. <update id="updateUpScore" parameterType="com.iformall.domain.po.WxCUserBasicInfo">
  225. update wx_c_user_basic_info set poins=poins+#{poins}
  226. where id=#{id}
  227. </update>
  228. <update id="updateDownScore" parameterType="com.iformall.domain.po.WxCUserBasicInfo">
  229. update wx_c_user_basic_info set poins=poins-#{poins}
  230. where id=#{id}
  231. </update>
  232. <update id="updateNewId" parameterType="com.iformall.domain.vo.CUserBaseVo">
  233. update wx_c_user_basic_info set id=#{newId} , credit=#{credit} , poins=#{poins}
  234. where id = #{id}
  235. </update>
  236. <select id="findCountBySex" parameterType="com.iformall.domain.dto.WxCUserBasicInfoDto" resultType="java.lang.Long">
  237. select count(wcubi.id) from wx_c_user_basic_info wcubi
  238. where wcubi.sex =#{sex}
  239. <if test=" null != finalTenantId and '' != finalTenantId">
  240. and wcubi.`final_tenant_id` = #{finalTenantId}
  241. </if>
  242. <if test=" null != startTime ">
  243. and wcubi.create_date &gt;= #{startTime}
  244. </if>
  245. <if test=" null != endTime">
  246. and wcubi.create_date &lt;= #{endTime}
  247. </if>
  248. </select>
  249. <select id="findCountBySex1" resultType="java.lang.Long">
  250. select count(wcubi.id) from wx_c_user_basic_info wcubi
  251. where wcubi.sex =#{basicInfo.sex}
  252. <if test=" null != basicInfo.startTime ">
  253. and wcubi.create_date &gt;= #{basicInfo.startTime}
  254. </if>
  255. <if test=" null != basicInfo.endTime">
  256. and wcubi.create_date &lt;= #{basicInfo.endTime}
  257. </if>
  258. <if test=" null != tenantInfo.tenantId and '' != tenantInfo.tenantId">
  259. and wcubi.`tenant_id` like concat('%,', #{tenantInfo.tenantId},',%')
  260. </if>
  261. </select>
  262. <select id="findCountByAge" parameterType="com.iformall.domain.dto.WxCUserBasicInfoDto" resultType="java.lang.Long">
  263. select count(wcubi.id) from wx_c_user_basic_info wcubi
  264. where 1=1
  265. <if test=" null != finalTenantId and '' != finalTenantId">
  266. and wcubi.`final_tenant_id` = #{finalTenantId}
  267. </if>
  268. <if test=" null != startTime ">
  269. and wcubi.create_date &gt;= #{startTime}
  270. </if>
  271. <if test=" null != endTime">
  272. and wcubi.create_date &lt;= #{endTime}
  273. </if>
  274. <if test=" null != birthStartTime ">
  275. and wcubi.birthdate &gt;= #{birthStartTime}
  276. </if>
  277. <if test=" null != birthEndTime">
  278. and wcubi.birthdate &lt;= #{birthEndTime}
  279. </if>
  280. <if test=" null == birthStartTime and null == birthEndTime">
  281. and wcubi.birthdate is null
  282. </if>
  283. </select>
  284. <select id="findCountByAge1" resultType="java.lang.Long">
  285. select count(wcubi.id) from wx_c_user_basic_info wcubi
  286. where 1=1
  287. <if test=" null != basicInfo.startTime ">
  288. and wcubi.create_date &gt;= #{basicInfo.startTime}
  289. </if>
  290. <if test=" null != basicInfo.endTime">
  291. and wcubi.create_date &lt;= #{basicInfo.endTime}
  292. </if>
  293. <if test=" null != basicInfo.birthStartTime ">
  294. and wcubi.birthdate &gt;= #{basicInfo.birthStartTime}
  295. </if>
  296. <if test=" null != basicInfo.birthEndTime">
  297. and wcubi.birthdate &lt;= #{basicInfo.birthEndTime}
  298. </if>
  299. <if test=" null == basicInfo.birthStartTime and null == basicInfo.birthEndTime">
  300. and wcubi.birthdate is null
  301. </if>
  302. <if test=" null != tenantInfo.tenantId and '' != tenantInfo.tenantId">
  303. and wcubi.`tenant_id` like concat('%,', #{tenantInfo.tenantId},',%')
  304. </if>
  305. </select>
  306. <select id="findCountByScore" parameterType="com.iformall.domain.dto.WxCUserBasicInfoDto" resultType="java.lang.Long">
  307. select count(wcubi.id) from wx_c_user_basic_info wcubi
  308. where 1=1
  309. <if test=" null != finalTenantId and '' != finalTenantId">
  310. and wcubi.`final_tenant_id` = #{finalTenantId}
  311. </if>
  312. <if test=" null != startTime ">
  313. and wcubi.create_date &gt;= #{startTime}
  314. </if>
  315. <if test=" null != endTime">
  316. and wcubi.create_date &lt;= #{endTime}
  317. </if>
  318. <if test=" null != levelStartScore ">
  319. and wcubi.poins &gt;= #{levelStartScore}
  320. </if>
  321. <if test=" null != levelEndScore">
  322. and wcubi.poins &lt; #{levelEndScore}
  323. </if>
  324. <if test=" null == levelStartScore and null == levelEndScore">
  325. and wcubi.poins is null
  326. </if>
  327. </select>
  328. <select id="findCountByScore1" resultType="java.lang.Long">
  329. select count(wcubi.id) from wx_c_user_basic_info wcubi
  330. where 1=1
  331. <if test=" null != basicInfo.startTime ">
  332. and wcubi.create_date &gt;= #{basicInfo.startTime}
  333. </if>
  334. <if test=" null != basicInfo.endTime">
  335. and wcubi.create_date &lt;= #{basicInfo.endTime}
  336. </if>
  337. <if test=" null != basicInfo.levelStartScore ">
  338. and wcubi.poins &gt;= #{basicInfo.levelStartScore}
  339. </if>
  340. <if test=" null != basicInfo.levelEndScore">
  341. and wcubi.poins &lt; #{basicInfo.levelEndScore}
  342. </if>
  343. <if test=" null == basicInfo.levelStartScore and null == basicInfo.levelEndScore">
  344. and wcubi.poins is null
  345. </if>
  346. <if test=" null != tenantInfo.tenantId and '' != tenantInfo.tenantId">
  347. and wcubi.`tenant_id` like concat('%,', #{tenantInfo.tenantId},',%')
  348. </if>
  349. </select>
  350. <sql id="allColumnsOfScoreList">
  351. cub.id,cub.phone,cub.birthdate,cub.education,cub.sex,cub.`height`,cub.`weight`,cub.`id_card`,cub.email,cub.address,cub.poins,cub.tag_id,
  352. cub.create_date,cub.update_date,cub.name,cub.level,cub.nick_name,cub.score_date,cub.final_tenant_id
  353. </sql>
  354. <select id="findListByScore" parameterType="com.iformall.domain.dto.WxCUserBasicInfoDto" resultMap="BaseResultMap">
  355. select <include refid="allColumnsOfScoreList"/>
  356. from wx_c_user_basic_info cub
  357. where cub.status=0
  358. <if test=" null != finalTenantId and '' != finalTenantId">
  359. and cub.`final_tenant_id` = #{finalTenantId}
  360. </if>
  361. <if test=" null != levelStartScore ">
  362. and cub.poins &gt;= #{levelStartScore}
  363. </if>
  364. <if test=" null != levelEndScore">
  365. and cub.poins &lt;= #{levelEndScore}
  366. </if>
  367. <if test=" null == levelStartScore and null == levelEndScore">
  368. and cub.poins is null
  369. </if>
  370. order by cub.`active_time` DESC
  371. </select>
  372. <select id="findListByScore1" resultMap="BaseResultMap">
  373. select <include refid="allColumnsOfScoreList"/>
  374. from wx_c_user_basic_info cub
  375. where cub.status=0
  376. <if test=" null != basicInfo.levelStartScore ">
  377. and cub.poins &gt;= #{basicInfo.levelStartScore}
  378. </if>
  379. <if test=" null != basicInfo.levelEndScore">
  380. and cub.poins &lt;= #{basicInfo.levelEndScore}
  381. </if>
  382. <if test=" null == basicInfo.levelStartScore and null == basicInfo.levelEndScore">
  383. and cub.poins is null
  384. </if>
  385. <if test=" null != tenantInfo.tenantId and '' != tenantInfo.tenantId">
  386. and cub.`tenant_id` like concat('%,', #{tenantInfo.tenantId},',%')
  387. </if>
  388. order by cub.`active_time` DESC
  389. </select>
  390. <select id="findBirthdayList" resultMap="BaseResultMap">
  391. select <include refid="allColumnsOfScoreList"/>
  392. from wx_c_user_basic_info cub
  393. where cub.status = 0
  394. AND DATE_FORMAT(cub.birthdate,'%m-%d') &gt;= #{begin}
  395. AND DATE_FORMAT(cub.birthdate,'%m-%d') &lt;= #{end}
  396. <if test=" null != finalTenantId and '' != finalTenantId">
  397. and cub.`final_tenant_id` = #{finalTenantId}
  398. </if>
  399. order by cub.`active_time` DESC
  400. </select>
  401. <select id="findBirthdayList1" resultMap="BaseResultMap">
  402. select <include refid="allColumnsOfScoreList"/>
  403. from wx_c_user_basic_info cub
  404. where cub.status = 0
  405. and cub.final_tenant_id = #{finalTenantId}
  406. AND DATE_FORMAT(cub.birthdate,'%m-%d') &gt;= #{begin}
  407. AND DATE_FORMAT(cub.birthdate,'%m-%d') &lt;= #{end}
  408. <if test=" null != tenantId and '' != tenantId">
  409. and cub.`tenant_id` like concat('%,', #{tenantInfo.tenantId},',%')
  410. </if>
  411. order by cub.`active_time` DESC
  412. </select>
  413. <select id="findCount" parameterType="com.iformall.domain.dto.WxCUserBasicInfoDto" resultType="java.lang.Long">
  414. select count(wcubi.id) from wx_c_user_basic_info wcubi
  415. where 1=1
  416. <if test=" null != finalTenantId and '' != finalTenantId">
  417. and wcubi.`final_tenant_id` = #{finalTenantId}
  418. </if>
  419. <if test=" null != startTime ">
  420. and wcubi.create_date &gt;= #{startTime}
  421. </if>
  422. <if test=" null != endTime">
  423. and wcubi.create_date &lt; #{endTime}
  424. </if>
  425. <if test="1 == queryImport">
  426. and wcubi.create_date like '%00:00:00'
  427. </if>
  428. </select>
  429. <select id="findCount1" resultType="java.lang.Long">
  430. select count(wcubi.id) from wx_c_user_basic_info wcubi
  431. where 1=1
  432. <if test=" null != basicInfo.startTime ">
  433. and wcubi.create_date &gt;= #{basicInfo.startTime}
  434. </if>
  435. <if test=" null != basicInfo.endTime">
  436. and wcubi.create_date &lt; #{basicInfo.endTime}
  437. </if>
  438. <if test=" null != tenantInfo.tenantId and '' != tenantInfo.tenantId">
  439. and wcubi.`tenant_id` like concat('%,', #{tenantInfo.tenantId},',%')
  440. </if>
  441. <if test="1 == basicInfo.queryImport">
  442. and wcubi.create_date like '%00:00:00'
  443. </if>
  444. </select>
  445. <select id="findCountHistory" parameterType="com.iformall.domain.dto.WxCUserBasicInfoDto" resultType="com.iformall.domain.vo.UserCountVo">
  446. select count(wcubi.id) as incCount,
  447. <if test="1 == reportType ">
  448. date_format(wcubi.create_date, '%Y-%m-%d') as reportTime,
  449. </if>
  450. <if test="2 == reportType ">
  451. date_format(wcubi.create_date, '%Y-%m') as reportTime,
  452. </if>
  453. <if test="3 == reportType ">
  454. date_format(wcubi.create_date, '%Y') as reportTime,
  455. </if>
  456. <if test="1 == reportType or 2 == reportType or 3 == reportType">
  457. (select count(wcubi.id) from wx_c_user_basic_info wcubi
  458. where
  459. <if test="1 == reportType ">
  460. date_format(wcubi.create_date, '%Y-%m-%d') &lt;= reportTime
  461. </if>
  462. <if test="2 == reportType ">
  463. date_format(wcubi.create_date, '%Y-%m') &lt;= reportTime
  464. </if>
  465. <if test="3 == reportType ">
  466. date_format(wcubi.create_date, '%Y') &lt;= reportTime
  467. </if>
  468. <if test=" null != finalTenantId and '' != finalTenantId">
  469. and wcubi.`final_tenant_id` = #{finalTenantId}
  470. </if>
  471. ) as totalCount
  472. </if>
  473. from wx_c_user_basic_info wcubi
  474. where 1=1
  475. <if test=" null != finalTenantId and '' != finalTenantId">
  476. and wcubi.`final_tenant_id` = #{finalTenantId}
  477. </if>
  478. <if test=" null != startTime ">
  479. and wcubi.create_date &gt;= #{startTime}
  480. </if>
  481. <if test=" null != endTime">
  482. and wcubi.create_date &lt; #{endTime}
  483. </if>
  484. <if test="1 == reportType or 2 == reportType or 3 == reportType">
  485. group by reportTime
  486. </if>
  487. </select>
  488. <select id="findCountHistory1" resultType="com.iformall.domain.vo.UserCountVo">
  489. select count(wcubi.id) as incCount,
  490. <if test="1 == basicInfo.reportType ">
  491. date_format(wcubi.create_date, '%Y-%m-%d') as reportTime,
  492. </if>
  493. <if test="2 == basicInfo.reportType ">
  494. date_format(wcubi.create_date, '%Y-%m') as reportTime,
  495. </if>
  496. <if test="3 == basicInfo.reportType ">
  497. date_format(wcubi.create_date, '%Y') as reportTime,
  498. </if>
  499. <if test="1 == basicInfo.reportType or 2 == basicInfo.reportType or 3 == basicInfo.reportType">
  500. (select count(wcubi.id) from wx_c_user_basic_info wcubi
  501. where
  502. <if test="1 == basicInfo.reportType ">
  503. date_format(wcubi.create_date, '%Y-%m-%d') &lt;= reportTime
  504. </if>
  505. <if test="2 == basicInfo.reportType ">
  506. date_format(wcubi.create_date, '%Y-%m') &lt;= reportTime
  507. </if>
  508. <if test="3 == basicInfo.reportType ">
  509. date_format(wcubi.create_date, '%Y') &lt;= reportTime
  510. </if>
  511. <if test=" null != tenantInfo.tenantId and '' != tenantInfo.tenantId">
  512. and wcubi.`tenant_id` like concat('%,', #{tenantInfo.tenantId},',%')
  513. </if>
  514. ) as totalCount
  515. </if>
  516. from wx_c_user_basic_info wcubi
  517. where 1=1
  518. <if test=" null != tenantInfo.tenantId and '' != tenantInfo.tenantId">
  519. and wcubi.`tenant_id` like concat('%,', #{tenantInfo.tenantId},',%')
  520. </if>
  521. <if test=" null != basicInfo.startTime ">
  522. and wcubi.create_date &gt;= #{basicInfo.startTime}
  523. </if>
  524. <if test=" null != basicInfo.endTime">
  525. and wcubi.create_date &lt; #{basicInfo.endTime}
  526. </if>
  527. <if test="1 == basicInfo.reportType or 2 == basicInfo.reportType or 3 == basicInfo.reportType">
  528. group by reportTime
  529. </if>
  530. </select>
  531. <resultMap id="VoBaseResultMap" type="com.iformall.domain.vo.WxCUserBasicInfoVo">
  532. <id column="id" jdbcType="BIGINT" property="id"/>
  533. <result column="phone" jdbcType="VARCHAR" property="phone"/>
  534. <result column="birthdate" jdbcType="TIMESTAMP" property="birthdate"/>
  535. <result column="education" jdbcType="VARCHAR" property="education"/>
  536. <result column="sex" jdbcType="INTEGER" property="sex"/>
  537. <result column="height" jdbcType="VARCHAR" property="height"/>
  538. <result column="weight" jdbcType="VARCHAR" property="weight"/>
  539. <result column="id_card" jdbcType="VARCHAR" property="idCard"/>
  540. <result column="email" jdbcType="VARCHAR" property="email"/>
  541. <result column="address" jdbcType="VARCHAR" property="address"/>
  542. <result column="poins" jdbcType="INTEGER" property="poins"/>
  543. <result column="tag_id" jdbcType="BIGINT" property="tagId"/>
  544. <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
  545. <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
  546. <!-- <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>-->
  547. <!-- <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId"/>-->
  548. <result column="final_tenant_id" jdbcType="VARCHAR" property="finalTenantId"/>
  549. <result column="name" jdbcType="VARCHAR" property="name"/>
  550. <result column="level" jdbcType="VARCHAR" property="level"/>
  551. <result column="nick_name" jdbcType="VARCHAR" property="nickName"/>
  552. <result column="credit" jdbcType="INTEGER" property="credit"/>
  553. <result column="tags" jdbcType="VARCHAR" property="tags"/>
  554. <result column="active_time" jdbcType="TIMESTAMP" property="activeTime"/>
  555. <result column="addCredit" jdbcType="INTEGER" property="addCredit"/>
  556. <result column="lesCredit" jdbcType="INTEGER" property="lesCredit"/>
  557. </resultMap>
  558. <sql id="allVoColumns">
  559. cu.`id`,cu.`phone`,cu.`birthdate`,cu.`education`,cu.`sex`,cu.`height`,cu.`weight`,cu.`id_card`,cu.`email`,cu.`address`,cu.`poins`,cu.`tag_id`,
  560. cu.`create_date`,cu.`update_date`,cu.`name`,cu.`level`,cu.`nick_name`,
  561. cut.`tags`,
  562. cu.`credit`,cu.`active_time`,cu.`act_record`,cu.`final_tenant_id`
  563. </sql>
  564. <sql id="dynamicVoWhereConditions">
  565. where 1 = 1
  566. <if test=" null != id ">
  567. and cu.`id` = #{id}
  568. </if>
  569. <if test=" null != finalTenantId and '' != finalTenantId">
  570. and cu.`final_tenant_id` = #{finalTenantId}
  571. </if>
  572. <if test=" null != phone and '' != phone">
  573. and cu.`phone` like concat('%', #{phone},'%')
  574. </if>
  575. <if test=" null != birthdate ">
  576. and cu.`birthdate` = #{birthdate}
  577. </if>
  578. <if test=" null != education and '' != education">
  579. and cu.`education` like concat('%', #{education},'%')
  580. </if>
  581. <if test=" null != sex ">
  582. and cu.`sex` = #{sex}
  583. </if>
  584. <if test=" null != email and '' != email">
  585. and cu.`email` like concat('%', #{email},'%')
  586. </if>
  587. <if test=" null != address and '' != address">
  588. and cu.`address` like concat('%', #{address},'%')
  589. </if>
  590. <if test=" null != poins ">
  591. and cu.`poins` = #{poins}
  592. </if>
  593. <if test=" null != tagId ">
  594. and cu.`tag_id` = #{tagId}
  595. </if>
  596. <if test=" null != createDate ">
  597. and cu.`create_date` = #{createDate}
  598. </if>
  599. <if test=" null != updateDate ">
  600. and cu.`update_date` = #{updateDate}
  601. </if>
  602. <if test=" null != actRecord ">
  603. and cu.`act_record` = #{actRecord}
  604. </if>
  605. <if test=" null != name and '' != name">
  606. and cu.`name` like concat('%', #{name},'%')
  607. </if>
  608. <if test=" null != startTime and null!=endTime">
  609. and cu.`create_date` between #{startTime} and #{endTime}
  610. </if>
  611. <if test=" null != activeStartTime and null!=activeEndTime">
  612. and wcubi.`active_time` between #{activeStartTime} and #{activeEndTime}
  613. </if>
  614. <if test=" null != ids ">
  615. and cu.id in
  616. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  617. #{idItem}
  618. </foreach>
  619. </if>
  620. order by cu.`active_time` DESC
  621. <!--<if test=" null != sortColumns">order by ${sortColumns}</if>-->
  622. </sql>
  623. <sql id="dynamicVoWhereConditions1">
  624. where 1 = 1
  625. <if test=" null != basicInfo.id ">
  626. and cu.`id` = #{basicInfo.id}
  627. </if>
  628. <if test=" null != tenantInfo.tenantId and '' != tenantInfo.tenantId">
  629. and cu.`tenant_id` like concat('%,', #{tenantInfo.tenantId},',%')
  630. </if>
  631. <if test=" null != basicInfo.phone and '' != basicInfo.phone">
  632. and cu.`phone` like concat('%', #{basicInfo.phone},'%')
  633. </if>
  634. <if test=" null != basicInfo.birthdate ">
  635. and cu.`birthdate` = #{basicInfo.birthdate}
  636. </if>
  637. <if test=" null != basicInfo.education and '' != basicInfo.education">
  638. and cu.`education` like concat('%', #{basicInfo.education},'%')
  639. </if>
  640. <if test=" null != basicInfo.sex ">
  641. and cu.`sex` = #{basicInfo.sex}
  642. </if>
  643. <if test=" null != basicInfo.email and '' != basicInfo.email">
  644. and cu.`email` like concat('%', #{basicInfo.email},'%')
  645. </if>
  646. <if test=" null != basicInfo.address and '' != basicInfo.address">
  647. and cu.`address` like concat('%', #{basicInfo.address},'%')
  648. </if>
  649. <if test=" null != basicInfo.poins ">
  650. and cu.`poins` = #{basicInfo.poins}
  651. </if>
  652. <if test=" null != basicInfo.tagId ">
  653. and cu.`tag_id` = #{basicInfo.tagId}
  654. </if>
  655. <if test=" null != basicInfo.createDate ">
  656. and cu.`create_date` = #{basicInfo.createDate}
  657. </if>
  658. <if test=" null != basicInfo.updateDate ">
  659. and cu.`update_date` = #{basicInfo.updateDate}
  660. </if>
  661. <if test=" null != basicInfo.actRecord ">
  662. and cu.`act_record` = #{basicInfo.actRecord}
  663. </if>
  664. <if test=" null != basicInfo.name and '' != basicInfo.name ">
  665. and cu.`name` like concat('%', #{basicInfo.name},'%')
  666. </if>
  667. <if test=" null != basicInfo.startTime and null != basicInfo.endTime">
  668. and cu.`create_date` between #{basicInfo.startTime} and #{basicInfo.endTime}
  669. </if>
  670. <if test=" null != basicInfo.activeStartTime and null!=basicInfo.activeEndTime">
  671. and wcubi.`active_time` between #{basicInfo.activeStartTime} and #{basicInfo.activeEndTime}
  672. </if>
  673. <if test=" null != basicInfo.ids ">
  674. and cu.id in
  675. <foreach collection="basicInfo.ids" index="index" item="idItem" open="(" separator="," close=")">
  676. #{idItem}
  677. </foreach>
  678. </if>
  679. order by cu.`active_time` DESC
  680. <!-- <if test=" null != sortColumns">order by ${sortColumns}</if>-->
  681. </sql>
  682. <select id="findVoList" parameterType="com.iformall.domain.po.WxCUserBasicInfo" resultMap="VoBaseResultMap">
  683. select
  684. <include refid="allSimpleColumns"/>
  685. from wx_c_user_basic_info cu
  686. <include refid="dynamicVoWhereConditions"/>
  687. <if test=" null != begin ">
  688. limit #{begin}, #{limit}
  689. </if>
  690. </select>
  691. <select id="findVoIdsList" parameterType="com.iformall.domain.po.WxCUserBasicInfo" resultType="java.lang.Long">
  692. select id
  693. from wx_c_user_basic_info cu
  694. <include refid="dynamicVoWhereConditions"/>
  695. <if test=" null != begin ">
  696. limit #{begin}, #{limit}
  697. </if>
  698. </select>
  699. <select id="findVoList1" resultMap="VoBaseResultMap">
  700. select
  701. cu.`id`,cu.`name`,cu.`sex`,cu.`height`,cu.`weight`,cu.`id_card`,cu.`phone`,cu.`nick_name`,cu.`education`,cu.`birthdate`,cu.`address`,
  702. cu.`active_time`,cu.`create_date`,cu.`poins`,cu.`credit`,
  703. cut.`tags`
  704. <!-- ,(select ifnull(sum(credit.credit_num),0) amount from wx_credit_history${basicInfo.shardFinalTableSuffix} credit-->
  705. <!-- where credit.`tenant_id` = #{basicInfo.finalTenantId}-->
  706. <!-- and credit.credit_num &gt; 0 and credit.c_user_id = cu.id-->
  707. <!-- <if test=" null != basicInfo.creditStartTime ">-->
  708. <!-- and credit.create_date &gt;= #{basicInfo.creditStartTime}-->
  709. <!-- </if>-->
  710. <!-- <if test=" null != basicInfo.creditEndTime">-->
  711. <!-- and credit.create_date &lt; #{basicInfo.creditEndTime}-->
  712. <!-- </if>) as addCredit,-->
  713. <!-- (select ifnull(sum(credit.credit_num),0) amount from wx_credit_history${basicInfo.shardFinalTableSuffix} credit-->
  714. <!-- where credit.`tenant_id` = #{basicInfo.finalTenantId}-->
  715. <!-- and credit.credit_num &lt; 0 and credit.c_user_id = cu.id-->
  716. <!-- <if test=" null != basicInfo.creditStartTime ">-->
  717. <!-- and credit.create_date &gt;= #{basicInfo.creditStartTime}-->
  718. <!-- </if>-->
  719. <!-- <if test=" null != basicInfo.creditEndTime">-->
  720. <!-- and credit.create_date &lt; #{basicInfo.creditEndTime}-->
  721. <!-- </if>) as lesCredit-->
  722. from wx_c_user_basic_info cu
  723. left join wx_c_user_tags${basicInfo.shardFinalTableSuffix} cut on cut.`id` = cu.`tag_id`
  724. <include refid="dynamicVoWhereConditions1"/>
  725. <if test=" null != basicInfo.begin ">
  726. limit #{basicInfo.begin}, #{basicInfo.limit}
  727. </if>
  728. </select>
  729. <select id="findVoIdsList1" resultType="java.lang.Long">
  730. select id
  731. from wx_c_user_basic_info cu
  732. <include refid="dynamicVoWhereConditions1"/>
  733. <if test=" null != basicInfo.begin ">
  734. limit #{basicInfo.begin}, #{basicInfo.limit}
  735. </if>
  736. </select>
  737. <select id="countVoList" parameterType="com.iformall.domain.po.WxCUserBasicInfo" resultType="java.lang.Integer">
  738. select
  739. count(cu.id)
  740. from wx_c_user_basic_info cu
  741. <include refid="dynamicVoWhereConditions"/>
  742. </select>
  743. <select id="countVoList1" resultType="java.lang.Integer">
  744. select
  745. count(cu.id)
  746. from wx_c_user_basic_info cu
  747. left join wx_c_user_tags cut on cut.`id` = cu.`tag_id`
  748. <include refid="dynamicVoWhereConditions1"/>
  749. </select>
  750. <sql id="msgColumns">
  751. cu.`id`,cu.`phone`,cu.`email`
  752. </sql>
  753. <sql id="filterWhereConditions">
  754. where 1=1
  755. <if test=" null != finalTenantId and '' != finalTenantId">
  756. and cu.`final_tenant_id` = #{finalTenantId}
  757. </if>
  758. <if test=" null != startTime ">
  759. and cu.create_date &gt;= #{startTime}
  760. </if>
  761. <if test=" null != endTime">
  762. and cu.create_date &lt;= #{endTime}
  763. </if>
  764. <if test=" null != birthStartTime ">
  765. and cu.birthdate &gt;= #{birthStartTime}
  766. </if>
  767. <if test=" null != birthEndTime">
  768. and cu.birthdate &lt; #{birthEndTime}
  769. </if>
  770. <if test=" null != loginStartTime ">
  771. and cu.active_time &gt;= #{loginStartTime}
  772. </if>
  773. <if test=" null != loginEndTime">
  774. and cu.active_time &lt;= #{loginEndTime}
  775. </if>
  776. <if test=" null != verifiedStartTime and null != verifiedEndTime ">
  777. and 0&lt;
  778. (select count(*) from wx_coupon_order co
  779. where cu.id = co.c_user_id
  780. and co.coupon_order_status = 1
  781. and co.update_date &gt;= #{verifiedStartTime}
  782. and co.update_date &lt;= #{verifiedEndTime})
  783. </if>
  784. <if test=" null != phones">
  785. and cu.phone in (${phones})
  786. </if>
  787. <if test=" null != levelStartScore and (0 != levelStartScore and '' != levelStartScore)">
  788. and cu.poins &gt;= #{levelStartScore}
  789. <if test=" null != levelEndScore">
  790. and cu.poins &lt; #{levelEndScore}
  791. </if>
  792. </if>
  793. <if test=" null != levelStartScore and (0 == levelStartScore or '' == levelStartScore)">
  794. and (cu.poins is null or
  795. (cu.poins &gt;= #{levelStartScore}
  796. <if test=" null != levelEndScore">
  797. and cu.poins &lt; #{levelEndScore}
  798. </if>
  799. ))
  800. </if>
  801. <if test=" null != tagIds ">
  802. and JSON_CONTAINS(JSON_ARRAY(cut.tags),JSON_ARRAY
  803. <foreach collection="tagIds" index="index" item="idItem" open="(" separator="," close=")">
  804. #{idItem}
  805. </foreach>
  806. )
  807. </if>
  808. <!-- <if test=" null != sortColumns">order by ${sortColumns}</if>-->
  809. </sql>
  810. <sql id="filterWhereConditions1">
  811. where 1=1
  812. <if test=" null != tenantInfo.tenantId and '' != tenantInfo.tenantId">
  813. and cu.`tenant_id` like concat('%,', #{tenantInfo.tenantId},',%')
  814. </if>
  815. <if test=" null != basicInfo.startTime ">
  816. and cu.create_date &gt;= #{basicInfo.startTime}
  817. </if>
  818. <if test=" null != basicInfo.endTime">
  819. and cu.create_date &lt;= #{basicInfo.endTime}
  820. </if>
  821. <if test=" null != basicInfo.birthStartTime ">
  822. and cu.birthdate &gt;= #{basicInfo.birthStartTime}
  823. </if>
  824. <if test=" null != basicInfo.birthEndTime">
  825. and cu.birthdate &lt; #{basicInfo.birthEndTime}
  826. </if>
  827. <if test=" null != basicInfo.loginStartTime ">
  828. and cu.active_time &gt;= #{basicInfo.loginStartTime}
  829. </if>
  830. <if test=" null != basicInfo.loginEndTime">
  831. and cu.active_time &lt;= #{basicInfo.loginEndTime}
  832. </if>
  833. <if test=" null != basicInfo.verifiedStartTime and null != basicInfo.verifiedEndTime ">
  834. and 0&lt;
  835. (select count(*) from wx_coupon_order co
  836. where cu.id = co.c_user_id
  837. and co.coupon_order_status = 1
  838. and co.update_date &gt;= #{basicInfo.verifiedStartTime}
  839. and co.update_date &lt;= #{basicInfo.verifiedEndTime})
  840. </if>
  841. <if test=" null != basicInfo.phones">
  842. and cu.phone in (${basicInfo.phones})
  843. </if>
  844. <if test=" null != basicInfo.levelStartScore and (0 != basicInfo.levelStartScore and '' != basicInfo.levelStartScore)">
  845. and cu.poins &gt;= #{basicInfo.levelStartScore}
  846. <if test=" null != basicInfo.levelEndScore">
  847. and cu.poins &lt; #{basicInfo.levelEndScore}
  848. </if>
  849. </if>
  850. <if test=" null != basicInfo.levelStartScore and (0 == basicInfo.levelStartScore or '' == basicInfo.levelStartScore)">
  851. and (cu.poins is null or
  852. (cu.poins &gt;= #{basicInfo.levelStartScore}
  853. <if test=" null != basicInfo.levelEndScore">
  854. and cu.poins &lt; #{basicInfo.levelEndScore}
  855. </if>
  856. ))
  857. </if>
  858. <if test=" null != basicInfo.tagIds ">
  859. and JSON_CONTAINS(JSON_ARRAY(cut.tags),JSON_ARRAY
  860. <foreach collection="basicInfo.tagIds" index="index" item="idItem" open="(" separator="," close=")">
  861. #{idItem}
  862. </foreach>
  863. )
  864. </if>
  865. <!-- <if test=" null != sortColumns">order by ${sortColumns}</if>-->
  866. </sql>
  867. <select id="findCountByFilter" parameterType="com.iformall.domain.dto.WxCUserBasicInfoDto" resultType="java.lang.Long">
  868. select count(distinct cu.id) from wx_c_user_basic_info cu
  869. <if test=" null != tagIds ">
  870. join wx_c_user_tags cut on cut.`id` = cu.`tag_id`
  871. </if>
  872. <include refid="filterWhereConditions"/>
  873. </select>
  874. <select id="findCountByFilter1" resultType="java.lang.Long">
  875. select count(distinct cu.id) from wx_c_user_basic_info cu
  876. <if test=" null != basicInfo.tagIds ">
  877. join wx_c_user_tags cut on cut.`id` = cu.`tag_id`
  878. </if>
  879. <include refid="filterWhereConditions1"/>
  880. </select>
  881. <select id="findListByFilter" parameterType="com.iformall.domain.dto.WxCUserBasicInfoDto" resultMap="BaseResultMap">
  882. select <include refid="msgColumns"/>
  883. from wx_c_user_basic_info cu
  884. <if test=" null != tagIds ">
  885. join wx_c_user_tags cut on cut.`id` = cu.`tag_id`
  886. </if>
  887. <include refid="filterWhereConditions"/>
  888. </select>
  889. <select id="findOpenIdByFilter" parameterType="com.iformall.domain.dto.WxCUserBasicInfoDto" resultType="String">
  890. select distinct open_id from wx_c_user where user_id in (
  891. select id
  892. from wx_c_user_basic_info cu
  893. <if test=" null != tagIds ">
  894. join wx_c_user_tags cut on cut.`id` = cu.`tag_id`
  895. </if>
  896. <include refid="filterWhereConditions"/>
  897. )
  898. </select>
  899. <select id="findListByFilter1" resultMap="BaseResultMap">
  900. select <include refid="msgColumns"/>
  901. from wx_c_user_basic_info cu
  902. <if test=" null != basicInfo.tagIds ">
  903. join wx_c_user_tags cut on cut.`id` = cu.`tag_id`
  904. </if>
  905. <include refid="filterWhereConditions1"/>
  906. </select>
  907. <!-- <select id="findImportUserCount" resultType="java.lang.Long">
  908. SELECT count(distinct cubi.id) FROM wx_c_user_basic_info cubi
  909. left join wx_c_user cu on cubi.id=cu.user_id
  910. where cu.id is null
  911. <if test=" null != finalTenantId and '' != finalTenantId">
  912. and cubi.`final_tenant_id` = #{finalTenantId}
  913. </if>
  914. </select>
  915. <select id="findImportUserCount1" resultType="java.lang.Long">
  916. SELECT count(distinct cubi.id) FROM wx_c_user_basic_info cubi
  917. left join wx_c_user cu on cubi.id=cu.user_id
  918. where cu.id is null
  919. <if test=" null != tenantId and '' != tenantId">
  920. and cubi.`tenant_id` like concat('%,', #{tenantInfo.tenantId},',%')
  921. </if>
  922. </select> -->
  923. <select id="findGrowUserCount" resultType="java.lang.Long">
  924. SELECT count(cubi.id) FROM wx_c_user_basic_info cubi
  925. <!-- left join wx_c_user cu on cubi.id=cu.user_id
  926. where cu.id is not null -->
  927. where 1 =1
  928. <if test=" null != finalTenantId and '' != finalTenantId">
  929. and cubi.`final_tenant_id` = #{finalTenantId}
  930. </if>
  931. </select>
  932. <select id="findGrowUserCount1" resultType="java.lang.Long">
  933. SELECT count(cubi.id) FROM wx_c_user_basic_info cubi
  934. <!-- left join wx_c_user cu on cubi.id=cu.user_id
  935. where cu.id is not null -->
  936. where final_tenant_id = #{finalTenantId}
  937. <if test=" null != tenantId and '' != tenantId">
  938. and cubi.`tenant_id` like concat('%,', #{tenantId},',%')
  939. </if>
  940. </select>
  941. <update id="incActRecordById" parameterType="java.util.HashMap">
  942. UPDATE wx_c_user_basic_info set act_record = act_record +1 where id = #{id} and final_tenant_id = #{finalTenantId}
  943. </update>
  944. <!--<select id="selectNotCUserList" resultMap="BaseResultMap">
  945. 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
  946. </select>-->
  947. <update id="cuserOldToNew" statementType="CALLABLE" >
  948. {call cuser_old_to_new(#{oldCuserId},#{newCuserId},#{tableIndex},#{finalTableIndex})}
  949. </update>
  950. </mapper>