|
@@ -1,5 +1,6 @@
|
|
|
package com.liangjian11.wx.mp.service.impl;
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.liangjian11.wx.mp.mapper.KeywordMessageRefMapper;
|
|
|
import com.liangjian11.wx.mp.modle.KeywordMessageRef;
|
|
@@ -7,8 +8,11 @@ import com.liangjian11.wx.mp.service.KeywordMessageRefService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
/**
|
|
|
- * @Author: 黄树文
|
|
|
+ * @Author: zyy
|
|
|
* @Date: 2020/6/1 14:08
|
|
|
*/
|
|
|
@Service
|
|
@@ -16,4 +20,33 @@ public class KeywordMessageRefServiceImpl extends ServiceImpl<KeywordMessageRefM
|
|
|
@Autowired
|
|
|
private KeywordMessageRefMapper keywordMessageRefMapper;
|
|
|
|
|
|
+ @Override
|
|
|
+ public List<Integer> getMessageIdByKeywordId(Integer KeywordId) {
|
|
|
+ ArrayList<Integer> msgList = new ArrayList<>();
|
|
|
+ List<KeywordMessageRef> list = keywordMessageRefMapper.selectList(new QueryWrapper<KeywordMessageRef>().eq("KeywordId", KeywordId));
|
|
|
+ for (KeywordMessageRef keywordMessageRef : list) {
|
|
|
+ msgList.add(keywordMessageRef.getMessageId());
|
|
|
+ }
|
|
|
+ return msgList;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public int selectCount(int keyWordId, int messageId) {
|
|
|
+ return keywordMessageRefMapper.selectCount(new QueryWrapper<KeywordMessageRef>().eq("keyWordId",keyWordId).eq("messageId",messageId));
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public int insert(KeywordMessageRef keywordMessageRef) {
|
|
|
+ return keywordMessageRefMapper.insert(keywordMessageRef);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public int update(KeywordMessageRef keywordMessageRef) {
|
|
|
+ return keywordMessageRefMapper.updateById(keywordMessageRef);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public int delete(Integer id) {
|
|
|
+ return keywordMessageRefMapper.deleteById(id);
|
|
|
+ }
|
|
|
}
|