Commit d79b8465 by 桂前礼

finished

parent 175df8c6
package com.pcloud.book.book.dto;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class BookGuideDelayDto {
private String userWxId;
private Date expireTime;
private String keyword;
private String ip;
}
package com.pcloud.book.keywords.biz.impl;
import com.alibaba.fastjson.JSONObject;
import com.pcloud.book.base.exception.BookBizException;
import com.pcloud.book.book.constant.BookConstant;
import com.pcloud.book.book.dto.BookGuideDelayDto;
import com.pcloud.book.consumer.channel.QrcodeSceneConsr;
import com.pcloud.book.consumer.content.ResourceConsr;
import com.pcloud.book.consumer.resource.ProductConsr;
......@@ -41,6 +43,7 @@ import com.pcloud.book.weixinclock.dao.WeixinClockGroupClassifyDao;
import com.pcloud.book.weixinclock.dto.WeixinClockDto;
import com.pcloud.channelcenter.wechat.dto.AccountSettingDto;
import com.pcloud.common.core.aspect.ParamLog;
import com.pcloud.common.utils.DateUtils;
import com.pcloud.common.utils.ListUtils;
import com.pcloud.common.utils.cache.redis.JedisClusterUtils;
import com.pcloud.common.utils.httpclient.UrlUtils;
......@@ -64,6 +67,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -158,63 +162,19 @@ public class BookGuideBizImpl implements BookGuideBiz {
bookGroupCipherUserDao.insert(bookGroupCipherUser);
//好友引导语
sendFriendGuide(bookGroupId, agreeAddUserDTO);
//回复关键词引导语
List<SelfRobotKeyword> selfRobotKeywords = selfRobotKeywordDao.getListByBookGroupId(bookGroupId);
if (!ListUtils.isEmpty(selfRobotKeywords)){
ThreadPoolUtils.SEND_MESSAGE_THREAD_POOL.execute(()->{
for (SelfRobotKeyword selfRobotKeyword:selfRobotKeywords){
try {
if ("长江作业本".equals(selfRobotKeyword.getKeyword())){
Thread.sleep(1000*60*10);
}
if (!StringUtil.isEmpty(selfRobotKeyword.getGuide())){
SendTextMessageVO vo = new SendTextMessageVO();
vo.setContent(selfRobotKeyword.getGuide());
vo.setCode(SendMessageTypeEnum.SELF.getCode());
vo.setWxId(agreeAddUserDTO.getRobotWxId());
vo.setAltId(agreeAddUserDTO.getRobotWxId());
vo.setWxGroupId(agreeAddUserDTO.getUserWxId());
vo.setIp(agreeAddUserDTO.getIp());
WxGroupSDK.sendTextMessage(vo);
log.info("临时demo发送个人号加好友信息"+vo.toString());
}
if ("学前".equals(selfRobotKeyword.getKeyword())
&&envStr.toUpperCase().equals("PRO")&&agreeAddUserDTO.getRobotWxId().equals("wxid_x8i897ryabo722")){
SendGroupInviteVO sendGroupInviteVO = new SendGroupInviteVO();
sendGroupInviteVO.setAltId(agreeAddUserDTO.getRobotWxId());
sendGroupInviteVO.setWxId(agreeAddUserDTO.getUserWxId());
sendGroupInviteVO.setWxGroupId("23084048866@chatroom");
sendGroupInviteVO.setIp(agreeAddUserDTO.getIp());
WxGroupSDK.sendGroupInvite(sendGroupInviteVO);
log.info("临时发送入群连接 sendGroupInviteVO:{}", sendGroupInviteVO);
}
if ("教辅书单".equals(selfRobotKeyword.getKeyword())){
List<SelfRobotKeywordReply> replyList = selfRobotKeywordReplyDao.getListByKeywordId(selfRobotKeyword.getId());
if (ListUtils.isEmpty(replyList)){
continue;
}
for (SelfRobotKeywordReply keywordReply : replyList){
if (ReplyTypeEnum.RESOURCE.value.equals(keywordReply.getType())){
SendFileVO sendFileVO = new SendFileVO();
Map<Long, ResourceDTO> map = resourceConsr.mapByIds(Arrays.asList(keywordReply.getResourceId()));
ResourceDTO resourceDTO = map.get(keywordReply.getResourceId());
if (resourceDTO != null) {
sendFileVO.setFileUrl(resourceDTO.getFileUrl());
sendFileVO.setFileName(resourceDTO.getResourceName());
}
sendFileVO.setIp(agreeAddUserDTO.getIp());
sendFileVO.setAltId(agreeAddUserDTO.getRobotWxId());
sendFileVO.setWxId(agreeAddUserDTO.getUserWxId());
WxGroupSDK.sendFile(sendFileVO);
}
}
}
Thread.sleep(1000*40);
} catch (InterruptedException e) {
log.error("发消息休眠5秒出错", e);
}
}
});
// TODO 引导语发送后 查询等待时间
int time = 60;
// 向缓存中写入相关信息 延迟推送时间
if (envStr.toUpperCase().equals("TEST") && agreeAddUserDTO.getRobotWxId().equals("wxid_zus32xb5ukjn22")
|| envStr.toUpperCase().equals("UAT") && agreeAddUserDTO.getRobotWxId().equals("wxid_p7gywuxkk89112")
|| envStr.toUpperCase().equals("PRO") && agreeAddUserDTO.getRobotWxId().equals("wxid_x8i897ryabo722")) {
List<SelfRobotKeyword> selfRobotKeywords = selfRobotKeywordDao.getListByBookGroupId(bookGroupId);
BookGuideDelayDto delayDto = new BookGuideDelayDto(agreeAddUserDTO.getUserWxId(), DateUtils.addSecond(new Date(), time), selfRobotKeywords.get(0).getKeyword(), agreeAddUserDTO.getIp());
log.info("[向缓存中写入相关信息 延迟推送时间]:{}",JSONObject.toJSONString(delayDto));
// 加好友 清除历史
JedisClusterUtils.hdel(agreeAddUserDTO.getRobotWxId()+"_DELAY_PUSH", agreeAddUserDTO.getUserWxId());
JedisClusterUtils.hset(agreeAddUserDTO.getRobotWxId()+"_DELAY_PUSH", agreeAddUserDTO.getUserWxId(), JSONObject.toJSONString(delayDto));
}
return;
}
......
package com.pcloud.book.keywords.biz.impl;
import com.alibaba.fastjson.JSONObject;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.pcloud.appcenter.app.dto.AppDto;
import com.pcloud.book.base.exception.BookBizException;
import com.pcloud.book.book.biz.BookKeywordWarehouseBiz;
import com.pcloud.book.book.dto.BookGuideDelayDto;
import com.pcloud.book.consumer.app.AppConsr;
import com.pcloud.book.consumer.channel.QrcodeSceneConsr;
import com.pcloud.book.consumer.content.ResourceConsr;
......@@ -42,7 +43,6 @@ import com.pcloud.book.group.tools.SendSelfMsgTools;
import com.pcloud.book.group.tools.SendWeixinRequestTools;
import com.pcloud.book.group.vo.ClassifyNameVO;
import com.pcloud.book.group.vo.ClassifyVO;
import com.pcloud.book.group.vo.GroupQrcode4ClassifyVO;
import com.pcloud.book.group.vo.ListClassifyVO;
import com.pcloud.book.keywords.biz.BookKeywordBiz;
import com.pcloud.book.keywords.dao.*;
......@@ -90,9 +90,8 @@ import com.sdk.wxgroup.SendGroupInviteVO;
import com.sdk.wxgroup.SendMessageTypeEnum;
import com.sdk.wxgroup.SendPicMessageVO;
import com.sdk.wxgroup.SendTextMessageVO;
import com.sdk.wxgroup.SendXmlCardVO;
import com.sdk.wxgroup.WxGroupSDK;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.MapUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -101,10 +100,11 @@ import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
......@@ -115,10 +115,6 @@ import java.util.Optional;
import java.util.TreeSet;
import java.util.stream.Collectors;
import javax.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
/**
* @author lily
* @date 2019/4/25 10:47
......@@ -528,8 +524,83 @@ public class BookKeywordBizImpl implements BookKeywordBiz {
if (bookGroupCipherUser == null || StringUtil.isEmpty(bookGroupCipherUser.getShortBookName())) {
return;
}
// 处理 YES NO
if ((envStr.toUpperCase().equals("TEST") && sendTextDTO.getWxId().equals("wxid_zus32xb5ukjn22") && new Long(1621L).equals(bookGroupCipherUser.getBookGroupId()))
|| (envStr.toUpperCase().equals("UAT") && sendTextDTO.getWxId().equals("wxid_51ff9f099l9a22") && new Long(449L).equals(bookGroupCipherUser.getBookGroupId()))
|| (envStr.toUpperCase().equals("PRO") && sendTextDTO.getWxId().equals("wxid_x8i897ryabo722") && new Long(23735L).equals(bookGroupCipherUser.getBookGroupId()))) {
// 从缓存中获取当前关键词
String curJson = JedisClusterUtils.hget(sendTextDTO.getWxId()+"_DELAY_PUSH", sendTextDTO.getWechatUserId());
if (!StringUtil.isEmpty(curJson)) {
BookGuideDelayDto bookGuideDelayDto = JSONObject.parseObject(curJson, BookGuideDelayDto.class);
// 获取下一个关键词
SelfRobotKeyword selfRobotKeyword = selfRobotKeywordDao.getNextKeyWord(bookGroupCipherUser.getBookGroupId(), bookGuideDelayDto.getKeyword());
if (sendTextDTO.getTextContent().contains("不")) {
// 用户否定回复 发送引导语
SendTextMessageVO vo = new SendTextMessageVO();
vo.setContent(selfRobotKeyword.getGuide());
vo.setCode(SendMessageTypeEnum.SELF.getCode());
vo.setWxId(sendTextDTO.getWechatUserId());
vo.setAltId(sendTextDTO.getWxId());
vo.setWxGroupId(sendTextDTO.getWechatUserId());
vo.setIp(sendTextDTO.getIp());
WxGroupSDK.sendTextMessage(vo);
log.info("[回复内容包含否定内容] SendTextMessageVO:{}",vo);
if ("学前".equals(selfRobotKeyword.getKeyword())
&& envStr.toUpperCase().equals("PRO") && sendTextDTO.getWxId().equals("wxid_x8i897ryabo722")) {
SendGroupInviteVO sendGroupInviteVO = new SendGroupInviteVO();
sendGroupInviteVO.setAltId(sendTextDTO.getWxId());
sendGroupInviteVO.setWxId(sendTextDTO.getWechatUserId());
sendGroupInviteVO.setWxGroupId("23084048866@chatroom");
sendGroupInviteVO.setIp(sendTextDTO.getIp());
WxGroupSDK.sendGroupInvite(sendGroupInviteVO);
log.info("临时发送入群连接 sendGroupInviteVO:{}", sendGroupInviteVO);
}
if ("教辅书单".equals(selfRobotKeyword.getKeyword())){
List<SelfRobotKeywordReply> replyList = selfRobotKeywordReplyDao.getListByKeywordId(selfRobotKeyword.getId());
if (!ListUtils.isEmpty(replyList)) {
for (SelfRobotKeywordReply keywordReply : replyList) {
if (ReplyTypeEnum.RESOURCE.value.equals(keywordReply.getType())) {
SendFileVO sendFileVO = new SendFileVO();
Map<Long, ResourceDTO> map = resourceConsr.mapByIds(Arrays.asList(keywordReply.getResourceId()));
ResourceDTO resourceDTO = map.get(keywordReply.getResourceId());
if (resourceDTO != null) {
sendFileVO.setFileUrl(resourceDTO.getFileUrl());
sendFileVO.setFileName(resourceDTO.getResourceName());
}
sendFileVO.setIp(sendTextDTO.getIp());
sendFileVO.setAltId(sendTextDTO.getWxId());
sendFileVO.setWxId(sendTextDTO.getWechatUserId());
WxGroupSDK.sendFile(sendFileVO);
}
}
}
}
int time = 60;
if ("背景音乐".equals(bookGuideDelayDto.getKeyword())){
time = 600;
}
// 更新缓存中的关键词
BookGuideDelayDto delayDto = BookGuideDelayDto.builder().userWxId(sendTextDTO.getWechatUserId())
.expireTime(DateUtils.addSecond(new Date(), time))
.keyword(selfRobotKeyword.getKeyword())
.ip(sendTextDTO.getIp()).build();
JedisClusterUtils.hset(sendTextDTO.getWxId() + "_DELAY_PUSH", sendTextDTO.getWechatUserId(), JSONObject.toJSONString(delayDto));
} else {
content = bookGuideDelayDto.getKeyword();
}
}
}
SelfRobotKeyword selfRobotKeyword = selfRobotKeywordDao.getByBookGroupIdAndKeyword(bookGroupCipherUser.getBookGroupId(), content);
if (selfRobotKeyword != null) {
// 用户回复了关键词 删除缓存中的数据 结束主动推送流程
if(JedisClusterUtils.hexists(sendTextDTO.getWxId()+"_DELAY_PUSH",sendTextDTO.getWechatUserId())){
JedisClusterUtils.hdel(sendTextDTO.getWxId()+"_DELAY_PUSH",sendTextDTO.getWechatUserId());
}
sendSelfKeyword(selfRobotKeyword, sendTextDTO);
//临时,后面要删
String robotId = sendTextDTO.getWxId();
......@@ -584,16 +655,20 @@ public class BookKeywordBizImpl implements BookKeywordBiz {
}
}
} else {
BookGroup bookGroup = bookGroupDao.getByShortBookName(content);
if (bookGroup == null) {
//既不是关键词也不是识别码
String altIdAndWxId = sendTextDTO.getWxId() + "_" + sendTextDTO.getWechatUserId();
Integer send = JedisClusterUtils.hgetJson2Class(REPLY_GUIDE_CACHE, altIdAndWxId, Integer.class);
if (send == null) {
sendText(sendTextDTO, "请按以上指引回复准确的内容以便获取对应服务,谢谢!");
JedisClusterUtils.hset2Json(REPLY_GUIDE_CACHE, altIdAndWxId, 1);
//1小时缓存
JedisClusterUtils.expire(REPLY_GUIDE_CACHE, 60 * 60 * 1);
if (!((envStr.toUpperCase().equals("TEST") && sendTextDTO.getWxId().equals("wxid_zus32xb5ukjn22") && new Long(1621L).equals(bookGroupCipherUser.getBookGroupId()))
|| (envStr.toUpperCase().equals("UAT") && sendTextDTO.getWxId().equals("wxid_51ff9f099l9a22") && new Long(449L).equals(bookGroupCipherUser.getBookGroupId()))
|| (envStr.toUpperCase().equals("PRO") && sendTextDTO.getWxId().equals("wxid_x8i897ryabo722") && new Long(23735L).equals(bookGroupCipherUser.getBookGroupId())))){
BookGroup bookGroup = bookGroupDao.getByShortBookName(content);
if (bookGroup == null) {
//既不是关键词也不是识别码
String altIdAndWxId = sendTextDTO.getWxId() + "_" + sendTextDTO.getWechatUserId();
Integer send = JedisClusterUtils.hgetJson2Class(REPLY_GUIDE_CACHE, altIdAndWxId, Integer.class);
if (send == null) {
sendText(sendTextDTO, "请按以上指引回复准确的内容以便获取对应服务,谢谢!");
JedisClusterUtils.hset2Json(REPLY_GUIDE_CACHE, altIdAndWxId, 1);
//1小时缓存
JedisClusterUtils.expire(REPLY_GUIDE_CACHE, 60 * 60 * 1);
}
}
}
}
......
......@@ -30,5 +30,7 @@ public interface SelfRobotKeywordDao extends BaseDao<SelfRobotKeyword> {
List<String> getKeywords(Long bookGroupId);
SelfRobotKeyword getNextKeyWord(Long bookGroupId, String keyword);
List<SelfRobotKeyword> getListByBookGroupIds(List<Long> bookGroupIds);
}
......@@ -79,6 +79,14 @@ public class SelfRobotKeywordDaoImpl extends BaseDaoImpl<SelfRobotKeyword> imple
}
@Override
public SelfRobotKeyword getNextKeyWord(Long bookGroupId, String keyword) {
Map<String, Object> map = new HashMap<>();
map.put("bookGroupId", bookGroupId);
map.put("keyword", keyword);
return this.getSqlSession().selectOne(this.getStatement("getNextKeyWord"), map);
}
@Override
public List<SelfRobotKeyword> getListByBookGroupIds(List<Long> bookGroupIds) {
Map<String, Object> map = new HashMap<>();
map.put("bookGroupIds", bookGroupIds);
......
package com.pcloud.book.keywords.runner;
import com.alibaba.fastjson.JSONObject;
import com.pcloud.book.book.dto.BookGuideDelayDto;
import com.pcloud.book.consumer.content.ResourceConsr;
import com.pcloud.book.keywords.biz.BookKeywordBiz;
import com.pcloud.book.keywords.dao.SelfRobotKeywordDao;
import com.pcloud.book.keywords.dao.SelfRobotKeywordReplyDao;
import com.pcloud.book.keywords.entity.SelfRobotKeyword;
import com.pcloud.book.keywords.entity.SelfRobotKeywordReply;
import com.pcloud.book.keywords.enums.ReplyTypeEnum;
import com.pcloud.common.utils.DateUtils;
import com.pcloud.common.utils.ListUtils;
import com.pcloud.common.utils.cache.redis.JedisClusterUtils;
import com.pcloud.contentcenter.resource.dto.ResourceDTO;
import com.sdk.wxgroup.SendFileVO;
import com.sdk.wxgroup.SendGroupInviteVO;
import com.sdk.wxgroup.SendMessageTypeEnum;
import com.sdk.wxgroup.SendTextMessageVO;
import com.sdk.wxgroup.WxGroupSDK;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* 项目启动制行的任务
*
* @author Gui_q
* @since 2020年2月3日 12点14分
*/
@Component
@Slf4j
public class KeyWordDelayRunner implements ApplicationRunner {
@Value("${system.env}")
private String envStr;
@Autowired
private SelfRobotKeywordDao selfRobotKeywordDao;
@Autowired
private BookKeywordBiz bookKeywordBiz;
@Autowired
private ResourceConsr resourceConsr;
@Autowired
private SelfRobotKeywordReplyDao selfRobotKeywordReplyDao;
@Override
public void run(ApplicationArguments applicationArguments) throws Exception {
log.info("[项目启动后 定时检查用户情况]");
if(!JedisClusterUtils.setnx("KEYWORDDELAYRUNNER_LOCK","KEYWORDDELAYRUNNER_LOCK")){
JedisClusterUtils.expire("KEYWORDDELAYRUNNER_LOCK",15*60);
return;
}
Long bookGroupId = 0L;
String wxid = "";
switch (envStr.toUpperCase()) {
case "TEST":
wxid = "wxid_zus32xb5ukjn22";
bookGroupId = 1621L;
break;
case "UAT":
wxid = "wxid_51ff9f099l9a22";
bookGroupId = 449L;
break;
case "PRO":
wxid = "wxid_x8i897ryabo722";
bookGroupId = 23735L;
break;
}
String finalWxid = wxid;
Long finalBookGroupId = bookGroupId;
new Thread(() -> {
while (true) {
try {
Thread.sleep(1000);
Map<String, String> friends = JedisClusterUtils.hgetAll(finalWxid+"_DELAY_PUSH");
if (friends==null){
continue;
}
Set<String> userSet = friends.keySet();
for (String userId : userSet) {
try {
BookGuideDelayDto bookGuideDelayDto = JSONObject.parseObject(friends.get(userId), BookGuideDelayDto.class);
if (bookGuideDelayDto.getExpireTime().before(new Date())) {
// 用户超时未答复 主动推送关键词
SelfRobotKeyword selfRobotKeyword = selfRobotKeywordDao.getNextKeyWord(finalBookGroupId, bookGuideDelayDto.getKeyword());
if (selfRobotKeyword==null){
JedisClusterUtils.hdel(finalWxid+"_DELAY_PUSH",userId);
continue;
}
// log.info("finalBookGroupId:{} bookGuideDelayDto:{}", finalBookGroupId, friends.get(userId));
// 用户否定回复 发送引导语
SendTextMessageVO vo = new SendTextMessageVO();
vo.setContent(selfRobotKeyword.getGuide());
vo.setCode(SendMessageTypeEnum.SELF.getCode());
vo.setWxId(bookGuideDelayDto.getUserWxId());
vo.setAltId(finalWxid);
vo.setWxGroupId(bookGuideDelayDto.getUserWxId());
vo.setIp(bookGuideDelayDto.getIp());
WxGroupSDK.sendTextMessage(vo);
if ("学前".equals(selfRobotKeyword.getKeyword())
&& envStr.toUpperCase().equals("PRO") && finalWxid.equals("wxid_x8i897ryabo722")) {
SendGroupInviteVO sendGroupInviteVO = new SendGroupInviteVO();
sendGroupInviteVO.setAltId(finalWxid);
sendGroupInviteVO.setWxId(bookGuideDelayDto.getUserWxId());
sendGroupInviteVO.setWxGroupId("23084048866@chatroom");
sendGroupInviteVO.setIp(bookGuideDelayDto.getIp());
WxGroupSDK.sendGroupInvite(sendGroupInviteVO);
log.info("临时发送入群连接 sendGroupInviteVO:{}", sendGroupInviteVO);
}
if ("教辅书单".equals(selfRobotKeyword.getKeyword())) {
List<SelfRobotKeywordReply> replyList = selfRobotKeywordReplyDao.getListByKeywordId(selfRobotKeyword.getId());
if (!ListUtils.isEmpty(replyList)) {
for (SelfRobotKeywordReply keywordReply : replyList) {
if (ReplyTypeEnum.RESOURCE.value.equals(keywordReply.getType())) {
SendFileVO sendFileVO = new SendFileVO();
Map<Long, ResourceDTO> map = resourceConsr.mapByIds(Arrays.asList(keywordReply.getResourceId()));
ResourceDTO resourceDTO = map.get(keywordReply.getResourceId());
if (resourceDTO != null) {
sendFileVO.setFileUrl(resourceDTO.getFileUrl());
sendFileVO.setFileName(resourceDTO.getResourceName());
}
sendFileVO.setIp(bookGuideDelayDto.getIp());
sendFileVO.setAltId(finalWxid);
sendFileVO.setWxId(bookGuideDelayDto.getUserWxId());
WxGroupSDK.sendFile(sendFileVO);
}
}
}
}
int time = 60;
if ("背景音乐".equals(selfRobotKeyword.getKeyword())){
time = 600;
}
// 更新缓存中的关键词
BookGuideDelayDto delayDto = BookGuideDelayDto.builder().userWxId(bookGuideDelayDto.getUserWxId())
.expireTime(DateUtils.addSecond(new Date(), time))
.keyword(selfRobotKeyword.getKeyword())
.ip(bookGuideDelayDto.getIp()).build();
JedisClusterUtils.hset(finalWxid + "_DELAY_PUSH", bookGuideDelayDto.getUserWxId(), JSONObject.toJSONString(delayDto));
}
}catch (Exception e){
continue;
}
}
} catch (Exception e) {
// log.info("[KeyWordDelayRunner] 关键词超时推送 失败",e);
}
}
}).start();
}
}
......@@ -93,6 +93,14 @@
order by seq_num
</select>
<select id="getNextKeyWord" parameterType="map" resultMap="BaseResultMap">
SELECT * FROM self_robot_keyword
WHERE book_group_id=#{bookGroupId}
AND seq_num > (SELECT seq_num FROM self_robot_keyword WHERE keyword = #{keyword} AND book_group_id=#{bookGroupId} LIMIT 1)
ORDER BY seq_num
LIMIT 1
</select>
<!--根据社群码和关键词获取-->
<select id="getByBookGroupIdAndKeyword" parameterType="map" resultMap="BaseResultMap">
select <include refid="Base_Column_List"/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment