distinct wcubi.`id`,wcubi.`phone`,wcubi.`birthdate`,wcubi.`education`,wcubi.`sex`,wcubi.`email`, wcubi.`address`,wcubi.`poins`,wcubi.`tag_id`,wcubi.`create_date`,wcubi.`update_date`, wcubi.`final_tenant_id`,wcubi.`name`,wcubi.`nick_name`, wcubi.`avatar_url`,wcubi.`credit`,wcubi.`active_time`,wcubi.`login_count`,wcubi.`act_record` ,(select level from wx_level_config where poins >= points and tenant_id=wcubi.final_tenant_id order by points desc limit 1 ) level,wcubi.status `id`,`phone`,`birthdate`,`education`,`sex`,`email`,`address`,`poins`,`tag_id`, `create_date`,`update_date`,`tenant_id`,`parent_tenant_id`,`name`,`nick_name`,`credit`,`active_time`,`act_record` where 1 = 1 and wcubi.`id` = #{id} and wcubi.`final_tenant_id` = #{finalTenantId} and wcubi.`phone` like concat('%', #{phone},'%') and wcubi.`birthdate` = #{birthdate} and wcubi.`education` like concat('%', #{education},'%') and wcubi.`sex` = #{sex} and wcubi.`email` like concat('%', #{email},'%') and wcubi.`address` like concat('%', #{address},'%') and wcubi.`poins` = #{poins} and wcubi.`credit` = #{credit} and wcubi.`tag_id` = #{tagId} and wcubi.`create_date` = #{createDate} and wcubi.`update_date` = #{updateDate} and wcubi.`act_record` = #{actRecord} and wcubi.`name` like concat('%', #{name},'%') and wcubi.`create_date` between #{startTime} and #{endTime} and wcubi.`status` = #{status} and wcubi.id in #{idItem} order by wcubi.`active_time` DESC where 1 = 1 and wcubi.`id` = #{basicInfo.id} and wcu.`tenant_id` = #{tenantInfo.tenantId} and wcu.`parent_tenant_id` = #{tenantInfo.parentTenantId} and wcubi.`phone` like concat('%', #{basicInfo.phone},'%') and wcubi.`birthdate` = #{basicInfo.birthdate} and wcubi.`education` like concat('%', #{basicInfo.education},'%') and wcubi.`sex` = #{basicInfo.sex} and wcubi.`email` like concat('%', #{basicInfo.email},'%') and wcubi.`address` like concat('%', #{basicInfo.address},'%') and wcubi.`poins` = #{basicInfo.poins} and wcubi.`credit` = #{basicInfo.credit} and wcubi.`tag_id` = #{basicInfo.tagId} and wcubi.`create_date` = #{basicInfo.createDate} and wcubi.`update_date` = #{basicInfo.updateDate} and wcubi.`act_record` = #{basicInfo.actRecord} and wcubi.`name` like concat('%', #{basicInfo.name},'%') and wcubi.`create_date` between #{basicInfo.startTime} and #{basicInfo.endTime} and wcubi.`status` = #{basicInfo.status} and wcubi.id in #{idItem} order by wcubi.`active_time` DESC update wx_c_user_basic_info set poins=#{poins} where id=#{id} update wx_c_user_basic_info set poins=poins+#{poins} where id=#{id} update wx_c_user_basic_info set poins=poins-#{poins} where id=#{id} update wx_c_user_basic_info set id=#{newId} , credit=#{credit} , poins=#{poins} where id = #{id} distinct cub.id,cub.phone,cub.birthdate,cub.education,cub.sex,cub.email,cub.address,cub.poins,cub.tag_id, cub.create_date,cub.update_date,cub.name,cub.level,cub.nick_name,cub.score_date,cub.final_tenant_id distinct cu.`id`,cu.`phone`,cu.`birthdate`,cu.`education`,cu.`sex`,cu.`email`,cu.`address`,cu.`poins`,cu.`tag_id`, cu.`create_date`,cu.`update_date`,cu.`name`,cu.`level`,cu.`nick_name`, cut.`tags`,cu.`credit`,cu.`active_time`,cu.`act_record`,cu.`final_tenant_id` where 1 = 1 and cu.`id` = #{id} and cu.`final_tenant_id` = #{finalTenantId} and cu.`phone` like concat('%', #{phone},'%') and cu.`birthdate` = #{birthdate} and cu.`education` like concat('%', #{education},'%') and cu.`sex` = #{sex} and cu.`email` like concat('%', #{email},'%') and cu.`address` like concat('%', #{address},'%') and cu.`poins` = #{poins} and cu.`tag_id` = #{tagId} and cu.`create_date` = #{createDate} and cu.`update_date` = #{updateDate} and cu.`act_record` = #{actRecord} and cu.`name` like concat('%', #{name},'%') and cu.`create_date` between #{startTime} and #{endTime} and cu.id in #{idItem} where 1 = 1 and cu.`id` = #{basicInfo.id} and c.`tenant_id` = #{tenantInfo.tenantId} and c.`parent_tenant_id` = #{tenantInfo.parentTenantId} and cu.`phone` like concat('%', #{basicInfo.phone},'%') and cu.`birthdate` = #{basicInfo.birthdate} and cu.`education` like concat('%', #{basicInfo.education},'%') and cu.`sex` = #{basicInfo.sex} and cu.`email` like concat('%', #{basicInfo.email},'%') and cu.`address` like concat('%', #{basicInfo.address},'%') and cu.`poins` = #{basicInfo.poins} and cu.`tag_id` = #{basicInfo.tagId} and cu.`create_date` = #{basicInfo.createDate} and cu.`update_date` = #{basicInfo.updateDate} and cu.`act_record` = #{basicInfo.actRecord} and cu.`name` like concat('%', #{basicInfo.name},'%') and cu.`create_date` between #{basicInfo.startTime} and #{basicInfo.endTime} and cu.id in #{idItem} distinct cu.`id`,cu.`phone`,cu.`email` where 1=1 and cu.`final_tenant_id` = #{finalTenantId} and cu.create_date >= #{startTime} and cu.create_date <= #{endTime} and cu.birthdate >= #{birthStartTime} and cu.birthdate < #{birthEndTime} and cu.active_time >= #{loginStartTime} and cu.active_time <= #{loginEndTime} and 0< (select count(*) from wx_coupon_order co where cu.id = co.c_user_id and co.coupon_order_status = 1 and co.update_date >= #{verifiedStartTime} and co.update_date <= #{verifiedEndTime}) and cu.phone in (${phones}) and cu.poins >= #{levelStartScore} and cu.poins < #{levelEndScore} and (cu.poins is null or (cu.poins >= #{levelStartScore} and cu.poins < #{levelEndScore} )) and JSON_CONTAINS(JSON_ARRAY(cut.tags),JSON_ARRAY #{idItem} ) where 1=1 and c.`tenant_id` = #{tenantInfo.tenantId} and c.`parent_tenant_id` = #{tenantInfo.parentTenantId} and cu.create_date >= #{basicInfo.startTime} and cu.create_date <= #{basicInfo.endTime} and cu.birthdate >= #{basicInfo.birthStartTime} and cu.birthdate < #{basicInfo.birthEndTime} and cu.active_time >= #{basicInfo.loginStartTime} and cu.active_time <= #{basicInfo.loginEndTime} and 0< (select count(*) from wx_coupon_order co where cu.id = co.c_user_id and co.coupon_order_status = 1 and co.update_date >= #{basicInfo.verifiedStartTime} and co.update_date <= #{basicInfo.verifiedEndTime}) and cu.phone in (${basicInfo.phones}) and cu.poins >= #{basicInfo.levelStartScore} and cu.poins < #{basicInfo.levelEndScore} and (cu.poins is null or (cu.poins >= #{basicInfo.levelStartScore} and cu.poins < #{basicInfo.levelEndScore} )) and JSON_CONTAINS(JSON_ARRAY(cut.tags),JSON_ARRAY #{idItem} ) UPDATE wx_c_user_basic_info set act_record = act_record +1 where id = #{id} {call cuser_old_to_new(#{oldCuserId},#{newCuserId})}