瀏覽代碼

Merge branch 'master' into dev-wyp-20250310-getUser

wangyunpeng 3 月之前
父節點
當前提交
db53f2ec9c
共有 26 個文件被更改,包括 2564 次插入142 次删除
  1. 3 2
      api-module/src/main/java/com/tzld/piaoquan/api/common/enums/SecretEnum.java
  2. 31 0
      api-module/src/main/java/com/tzld/piaoquan/api/dao/generator/ApiMybatisGeneratorMain.java
  3. 7 13
      api-module/src/main/java/com/tzld/piaoquan/api/dao/mapper/ReplyStaffMapper.java
  4. 29 2
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/ReplyStaff.java
  5. 99 16
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/ReplyStaffExample.java
  6. 1 1
      api-module/src/main/java/com/tzld/piaoquan/api/service/impl/CgiReplyServiceImpl.java
  7. 7 21
      api-module/src/main/java/com/tzld/piaoquan/api/service/impl/ThirdPartyServiceImpl.java
  8. 16 9
      api-module/src/main/java/com/tzld/piaoquan/api/service/impl/WeComServiceImpl.java
  9. 76 37
      api-module/src/main/java/com/tzld/piaoquan/api/service/strategy/impl/WeComPushMessageStrategyV1.java
  10. 47 29
      api-module/src/main/resources/mapper/ReplyStaffMapper.xml
  11. 64 0
      api-module/src/main/resources/mybatis-api-generator-config.xml
  12. 1 1
      api-module/src/main/resources/mybatis-generator-config.xml
  13. 3 0
      common-module/src/main/java/com/tzld/piaoquan/growth/common/common/constant/WeComConstant.java
  14. 2 1
      common-module/src/main/java/com/tzld/piaoquan/growth/common/dao/mapper/CgiReplyBucketDataMapper.java
  15. 35 0
      common-module/src/main/java/com/tzld/piaoquan/growth/common/dao/mapper/TagMapper.java
  16. 35 0
      common-module/src/main/java/com/tzld/piaoquan/growth/common/dao/mapper/UserWithTagMapper.java
  17. 103 0
      common-module/src/main/java/com/tzld/piaoquan/growth/common/model/po/Tag.java
  18. 733 0
      common-module/src/main/java/com/tzld/piaoquan/growth/common/model/po/TagExample.java
  19. 81 0
      common-module/src/main/java/com/tzld/piaoquan/growth/common/model/po/UserWithTag.java
  20. 573 0
      common-module/src/main/java/com/tzld/piaoquan/growth/common/model/po/UserWithTagExample.java
  21. 1 1
      common-module/src/main/resources/mapper/CgiReplyBucketDataMapper.xml
  22. 261 0
      common-module/src/main/resources/mapper/TagMapper.xml
  23. 231 0
      common-module/src/main/resources/mapper/UserWithTagMapper.xml
  24. 16 5
      offline-module/src/main/java/com/tzld/piaoquan/offline/job/AutoReplyVideoDataJob.java
  25. 2 1
      offline-module/src/main/java/com/tzld/piaoquan/offline/job/WeComMessageDataJob.java
  26. 107 3
      offline-module/src/main/java/com/tzld/piaoquan/offline/job/WeComUserDataJob.java

+ 3 - 2
api-module/src/main/java/com/tzld/piaoquan/api/common/enums/SecretEnum.java

@@ -9,13 +9,14 @@ public enum SecretEnum {
     SECRET_ENUM_1("3b83574b477d4c5b8508a6e33f6e35ec", "魅力", "ml"),
     SECRET_ENUM_2("70d342bf11a84ac7aca6b3e99541e085", "老来福", "llf"),
     SECRET_ENUM_3("595db67618174499b2bed23d8be6a3c1", "微小盟", "wxm"),
-    SECRET_ENUM_4("9a48498757774ddf8a3878b9c02d0fef", "福州像素", "xs"),
+    SECRET_ENUM_4("9a48498757774ddf8a3878b9c02d0fef", "像素", "xs"),
     SECRET_ENUM_5("35afea64fd374477bb32999120b91637", "泽火", "zh"),
     SECRET_ENUM_6("ee93a44c4be4448ab0ac9334a296016e", "云誉", "yy"),
     SECRET_ENUM_7("da2c526d31d14430b49af808e90542dc", "创易", "cy"),
     SECRET_ENUM_8("e5758dbc43204434b71b8e025023170f", "微讯", "wx"),
     SECRET_ENUM_9("1e836616178a4c32a9e8abea47eb6edd", "莱墘", "lq"),
-    SECRET_ENUM_10("57a1c09a209445fc83a5fba81b0194bc", "博虎", "bh");
+    SECRET_ENUM_10("57a1c09a209445fc83a5fba81b0194bc", "博虎", "bh"),
+    SECRET_ENUM_11("232bab5faeb54acfbbcef3dc693c4639", "守望", "sw");
 
 
     SecretEnum(String secret, String desc, String channel) {

+ 31 - 0
api-module/src/main/java/com/tzld/piaoquan/api/dao/generator/ApiMybatisGeneratorMain.java

@@ -0,0 +1,31 @@
+package com.tzld.piaoquan.api.dao.generator;
+
+import org.mybatis.generator.api.MyBatisGenerator;
+import org.mybatis.generator.config.Configuration;
+import org.mybatis.generator.config.xml.ConfigurationParser;
+import org.mybatis.generator.exception.InvalidConfigurationException;
+import org.mybatis.generator.exception.XMLParserException;
+import org.mybatis.generator.internal.DefaultShellCallback;
+
+import java.io.File;
+import java.io.IOException;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.List;
+
+
+public class ApiMybatisGeneratorMain {
+
+    public static void main(String[] args)
+            throws SQLException, IOException, InterruptedException, InvalidConfigurationException, XMLParserException {
+        List<String> warnings = new ArrayList<>();
+
+        File configFile = new File(ApiMybatisGeneratorMain.class.getResource("/mybatis-api-generator-config.xml").getFile());
+        ConfigurationParser cp = new ConfigurationParser(warnings);
+        Configuration config = cp.parseConfiguration(configFile);
+        DefaultShellCallback callback = new DefaultShellCallback(true);
+        MyBatisGenerator myBatisGenerator = new MyBatisGenerator(config, callback, warnings);
+        myBatisGenerator.generate(null);
+        System.out.println("genreate finish");
+    }
+}

+ 7 - 13
api-module/src/main/java/com/tzld/piaoquan/api/dao/mapper/ReplyStaffMapper.java

@@ -1,16 +1,10 @@
 package com.tzld.piaoquan.api.dao.mapper;
 
-
 import com.tzld.piaoquan.api.model.po.ReplyStaff;
 import com.tzld.piaoquan.api.model.po.ReplyStaffExample;
-import org.apache.ibatis.annotations.Mapper;
-import org.apache.ibatis.annotations.Param;
-import org.springframework.stereotype.Repository;
-
 import java.util.List;
+import org.apache.ibatis.annotations.Param;
 
-@Mapper
-@Repository
 public interface ReplyStaffMapper {
     long countByExample(ReplyStaffExample example);
 
@@ -18,19 +12,19 @@ public interface ReplyStaffMapper {
 
     int deleteByPrimaryKey(Long id);
 
-    int insert(ReplyStaff row);
+    int insert(ReplyStaff record);
 
-    int insertSelective(ReplyStaff row);
+    int insertSelective(ReplyStaff record);
 
     List<ReplyStaff> selectByExample(ReplyStaffExample example);
 
     ReplyStaff selectByPrimaryKey(Long id);
 
-    int updateByExampleSelective(@Param("row") ReplyStaff row, @Param("example") ReplyStaffExample example);
+    int updateByExampleSelective(@Param("record") ReplyStaff record, @Param("example") ReplyStaffExample example);
 
-    int updateByExample(@Param("row") ReplyStaff row, @Param("example") ReplyStaffExample example);
+    int updateByExample(@Param("record") ReplyStaff record, @Param("example") ReplyStaffExample example);
 
-    int updateByPrimaryKeySelective(ReplyStaff row);
+    int updateByPrimaryKeySelective(ReplyStaff record);
 
-    int updateByPrimaryKey(ReplyStaff row);
+    int updateByPrimaryKey(ReplyStaff record);
 }

+ 29 - 2
api-module/src/main/java/com/tzld/piaoquan/api/model/po/ReplyStaff.java

@@ -9,6 +9,8 @@ public class ReplyStaff {
 
     private String name;
 
+    private String videoIds;
+
     private Integer isDelete;
 
     private Date createTime;
@@ -28,7 +30,7 @@ public class ReplyStaff {
     }
 
     public void setUserId(String userId) {
-        this.userId = userId == null ? null : userId.trim();
+        this.userId = userId;
     }
 
     public String getName() {
@@ -36,7 +38,15 @@ public class ReplyStaff {
     }
 
     public void setName(String name) {
-        this.name = name == null ? null : name.trim();
+        this.name = name;
+    }
+
+    public String getVideoIds() {
+        return videoIds;
+    }
+
+    public void setVideoIds(String videoIds) {
+        this.videoIds = videoIds;
     }
 
     public Integer getIsDelete() {
@@ -62,4 +72,21 @@ public class ReplyStaff {
     public void setUpdateTime(Date updateTime) {
         this.updateTime = updateTime;
     }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", id=").append(id);
+        sb.append(", userId=").append(userId);
+        sb.append(", name=").append(name);
+        sb.append(", videoIds=").append(videoIds);
+        sb.append(", isDelete=").append(isDelete);
+        sb.append(", createTime=").append(createTime);
+        sb.append(", updateTime=").append(updateTime);
+        sb.append("]");
+        return sb.toString();
+    }
 }

+ 99 - 16
api-module/src/main/java/com/tzld/piaoquan/api/model/po/ReplyStaffExample.java

@@ -1,5 +1,7 @@
 package com.tzld.piaoquan.api.model.po;
 
+import com.tzld.piaoquan.growth.common.utils.page.Page;
+
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
@@ -11,8 +13,10 @@ public class ReplyStaffExample {
 
     protected List<Criteria> oredCriteria;
 
+    protected Page page;
+
     public ReplyStaffExample() {
-        oredCriteria = new ArrayList<>();
+        oredCriteria = new ArrayList<Criteria>();
     }
 
     public void setOrderByClause(String orderByClause) {
@@ -64,12 +68,20 @@ public class ReplyStaffExample {
         distinct = false;
     }
 
+    public void setPage(Page page) {
+        this.page=page;
+    }
+
+    public Page getPage() {
+        return page;
+    }
+
     protected abstract static class GeneratedCriteria {
         protected List<Criterion> criteria;
 
         protected GeneratedCriteria() {
             super();
-            criteria = new ArrayList<>();
+            criteria = new ArrayList<Criterion>();
         }
 
         public boolean isValid() {
@@ -236,72 +248,142 @@ public class ReplyStaffExample {
         }
 
         public Criteria andNameIsNull() {
-            addCriterion("name is null");
+            addCriterion("`name` is null");
             return (Criteria) this;
         }
 
         public Criteria andNameIsNotNull() {
-            addCriterion("name is not null");
+            addCriterion("`name` is not null");
             return (Criteria) this;
         }
 
         public Criteria andNameEqualTo(String value) {
-            addCriterion("name =", value, "name");
+            addCriterion("`name` =", value, "name");
             return (Criteria) this;
         }
 
         public Criteria andNameNotEqualTo(String value) {
-            addCriterion("name <>", value, "name");
+            addCriterion("`name` <>", value, "name");
             return (Criteria) this;
         }
 
         public Criteria andNameGreaterThan(String value) {
-            addCriterion("name >", value, "name");
+            addCriterion("`name` >", value, "name");
             return (Criteria) this;
         }
 
         public Criteria andNameGreaterThanOrEqualTo(String value) {
-            addCriterion("name >=", value, "name");
+            addCriterion("`name` >=", value, "name");
             return (Criteria) this;
         }
 
         public Criteria andNameLessThan(String value) {
-            addCriterion("name <", value, "name");
+            addCriterion("`name` <", value, "name");
             return (Criteria) this;
         }
 
         public Criteria andNameLessThanOrEqualTo(String value) {
-            addCriterion("name <=", value, "name");
+            addCriterion("`name` <=", value, "name");
             return (Criteria) this;
         }
 
         public Criteria andNameLike(String value) {
-            addCriterion("name like", value, "name");
+            addCriterion("`name` like", value, "name");
             return (Criteria) this;
         }
 
         public Criteria andNameNotLike(String value) {
-            addCriterion("name not like", value, "name");
+            addCriterion("`name` not like", value, "name");
             return (Criteria) this;
         }
 
         public Criteria andNameIn(List<String> values) {
-            addCriterion("name in", values, "name");
+            addCriterion("`name` in", values, "name");
             return (Criteria) this;
         }
 
         public Criteria andNameNotIn(List<String> values) {
-            addCriterion("name not in", values, "name");
+            addCriterion("`name` not in", values, "name");
             return (Criteria) this;
         }
 
         public Criteria andNameBetween(String value1, String value2) {
-            addCriterion("name between", value1, value2, "name");
+            addCriterion("`name` between", value1, value2, "name");
             return (Criteria) this;
         }
 
         public Criteria andNameNotBetween(String value1, String value2) {
-            addCriterion("name not between", value1, value2, "name");
+            addCriterion("`name` not between", value1, value2, "name");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdsIsNull() {
+            addCriterion("video_ids is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdsIsNotNull() {
+            addCriterion("video_ids is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdsEqualTo(String value) {
+            addCriterion("video_ids =", value, "videoIds");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdsNotEqualTo(String value) {
+            addCriterion("video_ids <>", value, "videoIds");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdsGreaterThan(String value) {
+            addCriterion("video_ids >", value, "videoIds");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdsGreaterThanOrEqualTo(String value) {
+            addCriterion("video_ids >=", value, "videoIds");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdsLessThan(String value) {
+            addCriterion("video_ids <", value, "videoIds");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdsLessThanOrEqualTo(String value) {
+            addCriterion("video_ids <=", value, "videoIds");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdsLike(String value) {
+            addCriterion("video_ids like", value, "videoIds");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdsNotLike(String value) {
+            addCriterion("video_ids not like", value, "videoIds");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdsIn(List<String> values) {
+            addCriterion("video_ids in", values, "videoIds");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdsNotIn(List<String> values) {
+            addCriterion("video_ids not in", values, "videoIds");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdsBetween(String value1, String value2) {
+            addCriterion("video_ids between", value1, value2, "videoIds");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdsNotBetween(String value1, String value2) {
+            addCriterion("video_ids not between", value1, value2, "videoIds");
             return (Criteria) this;
         }
 
@@ -487,6 +569,7 @@ public class ReplyStaffExample {
     }
 
     public static class Criteria extends GeneratedCriteria {
+
         protected Criteria() {
             super();
         }

+ 1 - 1
api-module/src/main/java/com/tzld/piaoquan/api/service/impl/CgiReplyServiceImpl.java

@@ -43,7 +43,7 @@ public class CgiReplyServiceImpl implements CgiReplyService {
     public ReplyBucketData getRgiReplyData(BucketDataParam bucketDataParam) {
         String ghId = bucketDataParam.getGhId();
         GhDetailExample example = new GhDetailExample();
-        example.createCriteria().andGhIdEqualTo(ghId);
+        example.createCriteria().andGhIdEqualTo(ghId).andIsDeleteEqualTo(0);
         List<GhDetail> ghDetails = ghDetailMapper.selectByExample(example);
         if (CollectionUtils.isEmpty(ghDetails)) {
             LarkRobotUtil.sendMessage("公众号信息查询失败 ghId=" + ghId);

+ 7 - 21
api-module/src/main/java/com/tzld/piaoquan/api/service/impl/ThirdPartyServiceImpl.java

@@ -80,7 +80,8 @@ public class ThirdPartyServiceImpl implements ThirdPartyService {
         }
         log.info("getPushMessage param={} secretEnum desc={}", param, secretEnum.desc);
         GhDetailExample example = new GhDetailExample();
-        example.createCriteria().andTypeEqualTo(GhTypeEnum.THIRD_PARTY_GH.type).andGhIdEqualTo(param.getGhId());
+        example.createCriteria().andTypeEqualTo(GhTypeEnum.THIRD_PARTY_GH.type).andGhIdEqualTo(param.getGhId())
+                .andIsDeleteEqualTo(0);
         List<GhDetail> ghDetails = ghDetailMapper.selectByExample(example);
         if (CollectionUtils.isEmpty(ghDetails)) {
             return CommonResponse.create(404, "ghId不存在,请联系管理员配置");
@@ -137,32 +138,17 @@ public class ThirdPartyServiceImpl implements ThirdPartyService {
         if (!DateUtil.isValidDate(canViewReportDate)) {
             return CommonResponse.create(ExceptionCodeEnum.PARAMS_ERROR, "系统异常");
         }
-        //llf只返回2024-11-30后的数据
-        if (secretEnum == SecretEnum.SECRET_ENUM_2) {
-            long targetTime = DateUtil.dateStrToTimestamp(date, "yyyy-MM-dd");
-            long limitTime = DateUtil.dateStrToTimestamp("2024-11-30", "yyyy-MM-dd");
-            if (targetTime < limitTime) {
-                return CommonResponse.create(500, "数据不存在");
-            }
-        }
-
-        //博虎UV需要去重
-        if (secretEnum == SecretEnum.SECRET_ENUM_10) {
-            List<ReportUvVo> res = new ArrayList<>();
-            return CommonResponse.success(res);
-        }
-
         //10点后可查询前一天数据
         long nowTimestamp = System.currentTimeMillis() / 1000;
         long limitTime = nowTimestamp - 34L * TimeConstant.HOUR;
         long targetTime = DateUtil.dateStrToTimestamp(date, "yyyy-MM-dd");
-        String channel = secretEnum.channel;
+        String desc = secretEnum.desc;
         if (targetTime > limitTime) {
             return CommonResponse.create(500, "数据不存在");
         }
         String dt = date.replace("-", "").substring(0, 8);
-        String sql = String.format("SELECT * FROM alg_growth_3rd_gh_reply_uv_report WHERE dt = %s AND channel = '%s';",
-                dt, channel);
+        String sql = String.format("SELECT * FROM gzh_autoreply_behavior_uv_total WHERE dt = %s AND 合作方 = '%s';",
+                dt, desc);
         List<ReportUvVo> res = new ArrayList<>();
         List<Record> recordList = odpsManager.query(sql);
         if (CollectionUtils.isEmpty(recordList)) {
@@ -170,8 +156,8 @@ public class ThirdPartyServiceImpl implements ThirdPartyService {
         }
         for (Record record : recordList) {
             ReportUvVo reportUvVo = new ReportUvVo();
-            reportUvVo.setGhId(record.getString(0));
-            reportUvVo.setUv(record.getBigint(1));
+            reportUvVo.setGhId(record.getString(1));
+            reportUvVo.setUv(record.getBigint(3));
             res.add(reportUvVo);
         }
         return CommonResponse.success(res);

+ 16 - 9
api-module/src/main/java/com/tzld/piaoquan/api/service/impl/WeComServiceImpl.java

@@ -2,6 +2,7 @@ package com.tzld.piaoquan.api.service.impl;
 
 import com.alibaba.fastjson.JSON;
 
+import com.alibaba.fastjson.JSONArray;
 import com.tzld.piaoquan.api.common.enums.ReplyStrategyServiceEnum;
 import com.tzld.piaoquan.api.dao.mapper.ReplyStaffMapper;
 import com.tzld.piaoquan.api.model.bo.BucketDataParam;
@@ -16,6 +17,7 @@ import com.tzld.piaoquan.api.service.WeComService;
 import com.tzld.piaoquan.api.service.strategy.ReplyStrategyService;
 import com.tzld.piaoquan.growth.common.common.base.CommonResponse;
 import com.tzld.piaoquan.growth.common.common.enums.ExceptionCodeEnum;
+import com.tzld.piaoquan.growth.common.common.enums.StrategyStatusEnum;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -56,8 +58,16 @@ public class WeComServiceImpl implements WeComService {
         if (param == null || StringUtils.isEmpty(param.getCorpId()) || !CORP_ID.equals(param.getCorpId()) || StringUtils.isEmpty(param.getUserId())) {
             return CommonResponse.create(ExceptionCodeEnum.PARAMS_ERROR, "参数错误");
         }
+
+        ReplyStaffExample example = new ReplyStaffExample();
+        example.createCriteria().andUserIdEqualTo(param.getUserId()).andIsDeleteEqualTo(0);
+        List<ReplyStaff> replyStaffs = replyStaffMapper.selectByExample(example);
+        if (CollectionUtils.isEmpty(replyStaffs)) {
+            return CommonResponse.create(ExceptionCodeEnum.PARAMS_ERROR, "用户查询不到");
+        }
+        ReplyStaff replyStaff = replyStaffs.get(0);
         List<WeComPushMessageVo> res = new ArrayList<>();
-        ReplyBucketData replyBucketData = getPushMessageData(param);
+        ReplyBucketData replyBucketData = getPushMessageData(param, replyStaff.getVideoIds());
         if (replyBucketData == null) {
             return CommonResponse.create(500, "数据异常");
         }
@@ -66,13 +76,6 @@ public class WeComServiceImpl implements WeComService {
         if (CollectionUtils.isEmpty(groupList)) {
             return CommonResponse.create(500, "数据异常");
         }
-        ReplyStaffExample example = new ReplyStaffExample();
-        example.createCriteria().andUserIdEqualTo(param.getUserId()).andIsDeleteEqualTo(0);
-        List<ReplyStaff> replyStaffs = replyStaffMapper.selectByExample(example);
-        if (CollectionUtils.isEmpty(replyStaffs)) {
-            return CommonResponse.create(ExceptionCodeEnum.PARAMS_ERROR, "用户查询不到");
-        }
-        ReplyStaff replyStaff = replyStaffs.get(0);
         String name = replyStaff.getName();
         for (GroupData groupData : groupList) {
             if (CollectionUtils.isEmpty(groupData.getMsgDataList())) {
@@ -105,7 +108,7 @@ public class WeComServiceImpl implements WeComService {
         return CommonResponse.success(res);
     }
 
-    private ReplyBucketData getPushMessageData(WeComPushMessageParam param) {
+    private ReplyBucketData getPushMessageData(WeComPushMessageParam param, String videoIds) {
         log.info("strategyServiceMap={}", JSON.toJSONString(strategyServiceMap));
         for (Map.Entry<String, ReplyStrategyService> stringReplyStrategyServiceEntry : strategyServiceMap.entrySet()) {
             ReplyStrategyService replyStrategyService = stringReplyStrategyServiceEntry.getValue();
@@ -113,6 +116,10 @@ public class WeComServiceImpl implements WeComService {
             if (replyStrategyService.support(ReplyStrategyServiceEnum.WE_COM_PUSH_MESSAGE_STRATEGY_V1)) {
                 BucketDataParam bucketDataParam = new BucketDataParam();
                 bucketDataParam.setGhId(param.getUserId());
+                if (StringUtils.isNotEmpty(videoIds)) {
+                    bucketDataParam.setStrategyStatus(StrategyStatusEnum.DEFAULT.status);
+                    bucketDataParam.setVideos(JSONArray.parseArray(videoIds, Long.class));
+                }
                 return replyStrategyService.getResult(bucketDataParam);
             }
         }

+ 76 - 37
api-module/src/main/java/com/tzld/piaoquan/api/service/strategy/impl/WeComPushMessageStrategyV1.java

@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
 import com.tzld.piaoquan.api.common.enums.ReplyStrategyServiceEnum;
 import com.tzld.piaoquan.api.component.TouLiuHttpClient;
 import com.tzld.piaoquan.api.dao.mapper.AlgGhAutoreplyVideoRankDataMapper;
+import com.tzld.piaoquan.growth.common.common.enums.StrategyStatusEnum;
 import com.tzld.piaoquan.growth.common.dao.mapper.CgiReplyBucketDataMapper;
 import com.tzld.piaoquan.api.model.bo.*;
 import com.tzld.piaoquan.api.model.po.AlgGhAutoreplyVideoRankData;
@@ -39,6 +40,8 @@ public class WeComPushMessageStrategyV1 implements ReplyStrategyService {
      */
     private static final String bucketStrategyConfig = "{\"we-com-base\":[0,1,2,3,4,5,6],\"we-com-explore1\":[7],\"we-com-explore2\":[8,9]}";
 
+
+    private static final String manualConfig = "{\"we-com-manual\":[0,1,2,3,4,5,6,7,8,9]}";
     /**
      * 自动回复使用小程序Id
      */
@@ -60,8 +63,13 @@ public class WeComPushMessageStrategyV1 implements ReplyStrategyService {
     public ReplyBucketData getResult(BucketDataParam bucketDataParam) {
         log.info("ThirdPartyPushMessageStrategyV1 start");
         // 0 获取策略key
-        JSONObject bucketStrategyConfigJsonObject = JSON.parseObject(bucketStrategyConfig);
-        Set<String> keyedSet = bucketStrategyConfigJsonObject.keySet();
+        JSONObject configJsonObject;
+        if (Objects.equals(StrategyStatusEnum.DEFAULT.status, bucketDataParam.getStrategyStatus())) {
+            configJsonObject = JSON.parseObject(manualConfig);
+        } else {
+            configJsonObject = JSON.parseObject(bucketStrategyConfig);
+        }
+        Set<String> keyedSet = configJsonObject.keySet();
         // 1 处理文章--算法引擎--排序文章数据
 //        getWenzhangData();
         // 2 处理小程序--读取离线数据表--获取策略排序小程序数据
@@ -72,7 +80,7 @@ public class WeComPushMessageStrategyV1 implements ReplyStrategyService {
         // 3 入库读表
         insertSmallData(smallDataCgiReplyList, keyedSet, bucketDataParam);
         // 4 组装分桶数据
-        return getReplyBucketData(bucketStrategyConfigJsonObject, keyedSet, bucketDataParam.getGhId());
+        return getReplyBucketData(configJsonObject, keyedSet, bucketDataParam.getGhId());
     }
 
     private ReplyBucketData getReplyBucketData(JSONObject bucketStrategyConfigJsonObject, Set<String> keyedSet, String ghId) {
@@ -207,41 +215,72 @@ public class WeComPushMessageStrategyV1 implements ReplyStrategyService {
                 // base作为人工控制
                 continue;
             }
-            // 获取最新dt的策略
-            String dtVersion = algGhAutoreplyVideoRankDataMapper.selectLatestDtVersionByStrategyKeyAndGhId(key, bucketDataParam.getGhId());
-            if (StringUtils.isEmpty(dtVersion)) {
-                continue;
-            }
-            // 判断当前的dtVersion是否已经处理过了
-            CgiReplyBucketDataExample cgiReplyBucketDataExample = new CgiReplyBucketDataExample();
-            cgiReplyBucketDataExample.createCriteria().andIsDeleteEqualTo(0).andStrategyDtEqualTo(dtVersion).andStrategyEqualTo(key).andGhIdEqualTo(bucketDataParam.getGhId());
-            long count = cgiReplyBucketDataMapper.countByExample(cgiReplyBucketDataExample);
-            if (count != 0) {
-                // 说明已处理过该dtVersion数据
-                continue;
-            }
-            // 获取最新dt数据
-            List<AlgGhAutoreplyVideoRankData> dtVersionStrategyData = getDtVersionStrategyData(key, dtVersion, bucketDataParam.getGhId());
-            List<Long> videoIds = dtVersionStrategyData.stream().map(AlgGhAutoreplyVideoRankData::getVideoId).collect(Collectors.toList());
-            Map<Long, VideoDetail> videoDetailMap = touLiuHttpClient.getVideoDetailRequest(videoIds);
-            result.addAll(dtVersionStrategyData.stream().map(x -> {
-                CgiReplyBucketData cgiReplyBucketData = new CgiReplyBucketData();
-                cgiReplyBucketData.setStrategy(key);
-                cgiReplyBucketData.setSort(x.getSort());
-                cgiReplyBucketData.setStrategyDt(x.getDtVersion());
-                cgiReplyBucketData.setGhId(x.getGhId());
-                cgiReplyBucketData.setMsgType(1);
-                cgiReplyBucketData.setTitle(x.getTitle());
-                VideoDetail videoDetail = videoDetailMap.get(x.getVideoId());
-                if (videoDetail != null && StringUtils.isNotEmpty(videoDetail.getCover())) {
-                    cgiReplyBucketData.setCoverUrl(videoDetail.getCover());
-                } else {
-                    cgiReplyBucketData.setCoverUrl(CDN_URL + x.getCoverUrl());
+            if (Objects.equals(StrategyStatusEnum.DEFAULT.status, bucketDataParam.getStrategyStatus())) {
+                if (CollectionUtils.isEmpty(bucketDataParam.getVideos())) {
+                    return null;
                 }
-                cgiReplyBucketData.setMiniAppId(SMALL_APP_Id);
-                cgiReplyBucketData.setMiniVideoId(x.getVideoId());
-                return cgiReplyBucketData;
-            }).collect(Collectors.toList()));
+                CgiReplyBucketDataExample cgiReplyBucketDataExample = new CgiReplyBucketDataExample();
+                cgiReplyBucketDataExample.createCriteria().andIsDeleteEqualTo(0).andStrategyEqualTo(key)
+                        .andGhIdEqualTo(bucketDataParam.getGhId()).andMiniVideoIdIn(bucketDataParam.getVideos());
+                long count = cgiReplyBucketDataMapper.countByExample(cgiReplyBucketDataExample);
+                if (count == bucketDataParam.getVideos().size()) {
+                    // 已经存在就不处理
+                    continue;
+                }
+                Map<Long, VideoDetail> videoDetailMap = touLiuHttpClient.getVideoDetailRequest(bucketDataParam.getVideos());
+                int sort = 1;
+                for (Long videoId : bucketDataParam.getVideos()) {
+                    CgiReplyBucketData cgiReplyBucketData = new CgiReplyBucketData();
+                    cgiReplyBucketData.setStrategy(key);
+                    cgiReplyBucketData.setSort(sort);
+                    cgiReplyBucketData.setGhId(bucketDataParam.getGhId());
+                    cgiReplyBucketData.setMsgType(1);
+                    VideoDetail videoDetail = videoDetailMap.get(videoId);
+                    if (videoDetail != null && StringUtils.isNotEmpty(videoDetail.getCover())) {
+                        cgiReplyBucketData.setCoverUrl(videoDetail.getCover());
+                    }
+                    if (videoDetail != null && StringUtils.isNotEmpty(videoDetail.getTitle())) {
+                        cgiReplyBucketData.setTitle(videoDetail.getTitle());
+                    }
+                    cgiReplyBucketData.setMiniAppId(SMALL_APP_Id);
+                    cgiReplyBucketData.setMiniVideoId(videoId);
+                    result.add(cgiReplyBucketData);
+                    sort++;
+                }
+            } else {
+                // 获取最新dt的策略
+                String dtVersion = algGhAutoreplyVideoRankDataMapper.selectLatestDtVersionByStrategyKeyAndGhId(key, bucketDataParam.getGhId());
+                // 判断当前的dtVersion是否已经处理过了
+                CgiReplyBucketDataExample cgiReplyBucketDataExample = new CgiReplyBucketDataExample();
+                cgiReplyBucketDataExample.createCriteria().andIsDeleteEqualTo(0).andStrategyDtEqualTo(dtVersion).andStrategyEqualTo(key).andGhIdEqualTo(bucketDataParam.getGhId());
+                long count = cgiReplyBucketDataMapper.countByExample(cgiReplyBucketDataExample);
+                if (count != 0) {
+                    // 说明已处理过该dtVersion数据
+                    continue;
+                }
+                // 获取最新dt数据
+                List<AlgGhAutoreplyVideoRankData> dtVersionStrategyData = getDtVersionStrategyData(key, dtVersion, bucketDataParam.getGhId());
+                List<Long> videoIds = dtVersionStrategyData.stream().map(AlgGhAutoreplyVideoRankData::getVideoId).collect(Collectors.toList());
+                Map<Long, VideoDetail> videoDetailMap = touLiuHttpClient.getVideoDetailRequest(videoIds);
+                result.addAll(dtVersionStrategyData.stream().map(x -> {
+                    CgiReplyBucketData cgiReplyBucketData = new CgiReplyBucketData();
+                    cgiReplyBucketData.setStrategy(key);
+                    cgiReplyBucketData.setSort(x.getSort());
+                    cgiReplyBucketData.setStrategyDt(x.getDtVersion());
+                    cgiReplyBucketData.setGhId(x.getGhId());
+                    cgiReplyBucketData.setMsgType(1);
+                    cgiReplyBucketData.setTitle(x.getTitle());
+                    VideoDetail videoDetail = videoDetailMap.get(x.getVideoId());
+                    if (videoDetail != null && StringUtils.isNotEmpty(videoDetail.getCover())) {
+                        cgiReplyBucketData.setCoverUrl(videoDetail.getCover());
+                    } else {
+                        cgiReplyBucketData.setCoverUrl(CDN_URL + x.getCoverUrl());
+                    }
+                    cgiReplyBucketData.setMiniAppId(SMALL_APP_Id);
+                    cgiReplyBucketData.setMiniVideoId(x.getVideoId());
+                    return cgiReplyBucketData;
+                }).collect(Collectors.toList()));
+            }
         }
         // 获取最新数据版本
         return CollectionUtils.isEmpty(result) ? null : result;

+ 47 - 29
api-module/src/main/resources/mapper/ReplyStaffMapper.xml

@@ -5,6 +5,7 @@
     <id column="id" jdbcType="BIGINT" property="id" />
     <result column="user_id" jdbcType="VARCHAR" property="userId" />
     <result column="name" jdbcType="VARCHAR" property="name" />
+    <result column="video_ids" jdbcType="VARCHAR" property="videoIds" />
     <result column="is_delete" jdbcType="INTEGER" property="isDelete" />
     <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
     <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
@@ -68,7 +69,7 @@
     </where>
   </sql>
   <sql id="Base_Column_List">
-    id, user_id, name, is_delete, create_time, update_time
+    id, user_id, `name`, video_ids, is_delete, create_time, update_time
   </sql>
   <select id="selectByExample" parameterType="com.tzld.piaoquan.api.model.po.ReplyStaffExample" resultMap="BaseResultMap">
     select
@@ -83,6 +84,9 @@
     <if test="orderByClause != null">
       order by ${orderByClause}
     </if>
+    <if test="page != null">
+      limit #{page.offset} , #{page.pageSize}
+    </if>
   </select>
   <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
     select 
@@ -101,12 +105,12 @@
     </if>
   </delete>
   <insert id="insert" parameterType="com.tzld.piaoquan.api.model.po.ReplyStaff">
-    insert into reply_staff (id, user_id, name, 
-      is_delete, create_time, update_time
-      )
+    insert into reply_staff (id, user_id, `name`, 
+      video_ids, is_delete, create_time, 
+      update_time)
     values (#{id,jdbcType=BIGINT}, #{userId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, 
-      #{isDelete,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
-      )
+      #{videoIds,jdbcType=VARCHAR}, #{isDelete,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, 
+      #{updateTime,jdbcType=TIMESTAMP})
   </insert>
   <insert id="insertSelective" parameterType="com.tzld.piaoquan.api.model.po.ReplyStaff">
     insert into reply_staff
@@ -118,7 +122,10 @@
         user_id,
       </if>
       <if test="name != null">
-        name,
+        `name`,
+      </if>
+      <if test="videoIds != null">
+        video_ids,
       </if>
       <if test="isDelete != null">
         is_delete,
@@ -140,6 +147,9 @@
       <if test="name != null">
         #{name,jdbcType=VARCHAR},
       </if>
+      <if test="videoIds != null">
+        #{videoIds,jdbcType=VARCHAR},
+      </if>
       <if test="isDelete != null">
         #{isDelete,jdbcType=INTEGER},
       </if>
@@ -160,38 +170,42 @@
   <update id="updateByExampleSelective" parameterType="map">
     update reply_staff
     <set>
-      <if test="row.id != null">
-        id = #{row.id,jdbcType=BIGINT},
+      <if test="record.id != null">
+        id = #{record.id,jdbcType=BIGINT},
+      </if>
+      <if test="record.userId != null">
+        user_id = #{record.userId,jdbcType=VARCHAR},
       </if>
-      <if test="row.userId != null">
-        user_id = #{row.userId,jdbcType=VARCHAR},
+      <if test="record.name != null">
+        `name` = #{record.name,jdbcType=VARCHAR},
       </if>
-      <if test="row.name != null">
-        name = #{row.name,jdbcType=VARCHAR},
+      <if test="record.videoIds != null">
+        video_ids = #{record.videoIds,jdbcType=VARCHAR},
       </if>
-      <if test="row.isDelete != null">
-        is_delete = #{row.isDelete,jdbcType=INTEGER},
+      <if test="record.isDelete != null">
+        is_delete = #{record.isDelete,jdbcType=INTEGER},
       </if>
-      <if test="row.createTime != null">
-        create_time = #{row.createTime,jdbcType=TIMESTAMP},
+      <if test="record.createTime != null">
+        create_time = #{record.createTime,jdbcType=TIMESTAMP},
       </if>
-      <if test="row.updateTime != null">
-        update_time = #{row.updateTime,jdbcType=TIMESTAMP},
+      <if test="record.updateTime != null">
+        update_time = #{record.updateTime,jdbcType=TIMESTAMP},
       </if>
     </set>
-    <if test="example != null">
+    <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
   </update>
   <update id="updateByExample" parameterType="map">
     update reply_staff
-    set id = #{row.id,jdbcType=BIGINT},
-      user_id = #{row.userId,jdbcType=VARCHAR},
-      name = #{row.name,jdbcType=VARCHAR},
-      is_delete = #{row.isDelete,jdbcType=INTEGER},
-      create_time = #{row.createTime,jdbcType=TIMESTAMP},
-      update_time = #{row.updateTime,jdbcType=TIMESTAMP}
-    <if test="example != null">
+    set id = #{record.id,jdbcType=BIGINT},
+      user_id = #{record.userId,jdbcType=VARCHAR},
+      `name` = #{record.name,jdbcType=VARCHAR},
+      video_ids = #{record.videoIds,jdbcType=VARCHAR},
+      is_delete = #{record.isDelete,jdbcType=INTEGER},
+      create_time = #{record.createTime,jdbcType=TIMESTAMP},
+      update_time = #{record.updateTime,jdbcType=TIMESTAMP}
+    <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
   </update>
@@ -202,7 +216,10 @@
         user_id = #{userId,jdbcType=VARCHAR},
       </if>
       <if test="name != null">
-        name = #{name,jdbcType=VARCHAR},
+        `name` = #{name,jdbcType=VARCHAR},
+      </if>
+      <if test="videoIds != null">
+        video_ids = #{videoIds,jdbcType=VARCHAR},
       </if>
       <if test="isDelete != null">
         is_delete = #{isDelete,jdbcType=INTEGER},
@@ -219,7 +236,8 @@
   <update id="updateByPrimaryKey" parameterType="com.tzld.piaoquan.api.model.po.ReplyStaff">
     update reply_staff
     set user_id = #{userId,jdbcType=VARCHAR},
-      name = #{name,jdbcType=VARCHAR},
+      `name` = #{name,jdbcType=VARCHAR},
+      video_ids = #{videoIds,jdbcType=VARCHAR},
       is_delete = #{isDelete,jdbcType=INTEGER},
       create_time = #{createTime,jdbcType=TIMESTAMP},
       update_time = #{updateTime,jdbcType=TIMESTAMP}

+ 64 - 0
api-module/src/main/resources/mybatis-api-generator-config.xml

@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE generatorConfiguration
+        PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN"
+        "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">
+<!-- 配置生成器 -->
+<generatorConfiguration>
+    <context id="mysql" defaultModelType="flat">
+        <property name="autoDelimitKeywords" value="true"/>
+        <!-- 生成的Java文件的编码 -->
+        <property name="javaFileEncoding" value="UTF-8"/>
+        <!-- 格式化java代码 -->
+        <property name="javaFormatter" value="org.mybatis.generator.api.dom.DefaultJavaFormatter"/>
+        <!-- 格式化XML代码 -->
+        <property name="xmlFormatter" value="org.mybatis.generator.api.dom.DefaultXmlFormatter"/>
+        <!-- beginningDelimiter和endingDelimiter:指明数据库的用于标记数据库对象名的符号,比如ORACLE就是双引号,MYSQL默认是`反引号; -->
+        <property name="beginningDelimiter" value="`"/>
+        <property name="endingDelimiter" value="`"/>
+
+        <plugin type="org.mybatis.generator.plugins.ToStringPlugin"/>
+        <plugin type="org.mybatis.generator.plugins.UnmergeableXmlMappersPlugin"/>
+        <plugin type="com.tzld.piaoquan.api.dao.generator.PaginationPlugin"/>
+
+        <commentGenerator>
+<!--            <property name="addRemarkComments" value="true"/>-->
+            <property name="suppressDate" value="true"/>
+            <property name="suppressAllComments" value="true"/>
+        </commentGenerator>
+
+        <jdbcConnection driverClass="com.mysql.jdbc.Driver"
+                        connectionURL="jdbc:mysql://rm-bp17q95335a99272b.mysql.rds.aliyuncs.com:3306/growth?useUnicode=true&amp;characterEncoding=utf-8&amp;zeroDateTimeBehavior=convertToNull&amp;useSSL=false"
+                        userId="crawler" password="crawler123456@">
+        </jdbcConnection>
+
+        <javaTypeResolver type="org.mybatis.generator.internal.types.JavaTypeResolverDefaultImpl">
+            <property name="forceBigDecimals" value="false"/>
+        </javaTypeResolver>
+
+        <javaModelGenerator targetPackage="com.tzld.piaoquan.api.model.po" targetProject="/Users/shimeng/Desktop/project/growth-manager/api-module/src/main/java">
+            <property name="constructorBased" value="false"/>
+            <property name="enableSubPackages" value="true"/>
+            <property name="immutable" value="false"/>
+        </javaModelGenerator>
+
+        <sqlMapGenerator targetPackage="mapper" targetProject="/Users/shimeng/Desktop/project/growth-manager/api-module/src/main/resources">
+            <property name="enableSubPackages" value="true"/>
+        </sqlMapGenerator>
+
+        <javaClientGenerator targetPackage="com.tzld.piaoquan.api.dao.mapper" type="XMLMAPPER"
+                             targetProject="/Users/shimeng/Desktop/project/growth-manager/api-module/src/main/java">
+            <property name="enableSubPackages" value="true"/>
+        </javaClientGenerator>
+
+<!--        <table tableName="we_com_alert_message" domainObjectName="AlertMessage" alias=""/>-->
+<!--        <table tableName="gh_detail" domainObjectName="GhDetail" alias=""/>-->
+<!--        <table tableName="we_com_guarantees_video" domainObjectName="GuaranteesVideo" alias=""/>-->
+<!--        <table tableName="we_com_staff" domainObjectName="Staff" alias=""/>-->
+<!--        <table tableName="we_com_message_attachment" domainObjectName="MessageAttachment" alias=""/>-->
+        <table tableName="reply_staff" domainObjectName="ReplyStaff" alias=""/>
+<!--        <table tableName="we_com_send_msg_result" domainObjectName="SendMsgResult" alias=""/>-->
+<!--        <table tableName="we_com_corp" domainObjectName="Corp" alias=""/>-->
+
+    </context>
+
+</generatorConfiguration>

+ 1 - 1
api-module/src/main/resources/mybatis-generator-config.xml

@@ -55,7 +55,7 @@
 <!--        <table tableName="we_com_guarantees_video" domainObjectName="GuaranteesVideo" alias=""/>-->
 <!--        <table tableName="we_com_staff" domainObjectName="Staff" alias=""/>-->
 <!--        <table tableName="we_com_message_attachment" domainObjectName="MessageAttachment" alias=""/>-->
-        <table tableName="we_com_user_count" domainObjectName="UserCount" alias=""/>
+        <table tableName="we_com_user_with_tag" domainObjectName="UserWithTag" alias=""/>
 <!--        <table tableName="we_com_send_msg_result" domainObjectName="SendMsgResult" alias=""/>-->
 <!--        <table tableName="we_com_corp" domainObjectName="Corp" alias=""/>-->
 

+ 3 - 0
common-module/src/main/java/com/tzld/piaoquan/growth/common/common/constant/WeComConstant.java

@@ -31,4 +31,7 @@ public interface WeComConstant {
 
     //获取配置了客户联系功能的成员列表
     String GET_WE_COM_FOLLOW_USER_LIST = "https://qyapi.weixin.qq.com/cgi-bin/externalcontact/get_follow_user_list";
+
+    //获取企业客户标签详情
+    String POST_CORP_TAG_LIST = "https://qyapi.weixin.qq.com/cgi-bin/externalcontact/get_corp_tag_list";
 }

+ 2 - 1
common-module/src/main/java/com/tzld/piaoquan/growth/common/dao/mapper/CgiReplyBucketDataMapper.java

@@ -6,6 +6,7 @@ import com.tzld.piaoquan.growth.common.model.po.CgiReplyBucketDataExample;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.Date;
 import java.util.List;
 
 @Mapper
@@ -32,5 +33,5 @@ public interface CgiReplyBucketDataMapper {
 
     int updateByPrimaryKey(CgiReplyBucketData row);
 
-    List<Long> selectVideoId();
+    List<Long> selectVideoId(@Param("createTime") Date createTime);
 }

+ 35 - 0
common-module/src/main/java/com/tzld/piaoquan/growth/common/dao/mapper/TagMapper.java

@@ -0,0 +1,35 @@
+package com.tzld.piaoquan.growth.common.dao.mapper;
+
+import com.tzld.piaoquan.growth.common.model.po.Tag;
+import com.tzld.piaoquan.growth.common.model.po.TagExample;
+import java.util.List;
+
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+
+@Mapper
+@Repository
+public interface TagMapper {
+    long countByExample(TagExample example);
+
+    int deleteByExample(TagExample example);
+
+    int deleteByPrimaryKey(Long id);
+
+    int insert(Tag record);
+
+    int insertSelective(Tag record);
+
+    List<Tag> selectByExample(TagExample example);
+
+    Tag selectByPrimaryKey(Long id);
+
+    int updateByExampleSelective(@Param("record") Tag record, @Param("example") TagExample example);
+
+    int updateByExample(@Param("record") Tag record, @Param("example") TagExample example);
+
+    int updateByPrimaryKeySelective(Tag record);
+
+    int updateByPrimaryKey(Tag record);
+}

+ 35 - 0
common-module/src/main/java/com/tzld/piaoquan/growth/common/dao/mapper/UserWithTagMapper.java

@@ -0,0 +1,35 @@
+package com.tzld.piaoquan.growth.common.dao.mapper;
+
+import com.tzld.piaoquan.growth.common.model.po.UserWithTag;
+import com.tzld.piaoquan.growth.common.model.po.UserWithTagExample;
+import java.util.List;
+
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+
+@Mapper
+@Repository
+public interface UserWithTagMapper {
+    long countByExample(UserWithTagExample example);
+
+    int deleteByExample(UserWithTagExample example);
+
+    int deleteByPrimaryKey(Long id);
+
+    int insert(UserWithTag record);
+
+    int insertSelective(UserWithTag record);
+
+    List<UserWithTag> selectByExample(UserWithTagExample example);
+
+    UserWithTag selectByPrimaryKey(Long id);
+
+    int updateByExampleSelective(@Param("record") UserWithTag record, @Param("example") UserWithTagExample example);
+
+    int updateByExample(@Param("record") UserWithTag record, @Param("example") UserWithTagExample example);
+
+    int updateByPrimaryKeySelective(UserWithTag record);
+
+    int updateByPrimaryKey(UserWithTag record);
+}

+ 103 - 0
common-module/src/main/java/com/tzld/piaoquan/growth/common/model/po/Tag.java

@@ -0,0 +1,103 @@
+package com.tzld.piaoquan.growth.common.model.po;
+
+import java.util.Date;
+
+public class Tag {
+    private Long id;
+
+    private String tagGroupId;
+
+    private String tagGroupName;
+
+    private String tagId;
+
+    private String tagName;
+
+    private Integer isDelete;
+
+    private Date createTime;
+
+    private Date updateTime;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getTagGroupId() {
+        return tagGroupId;
+    }
+
+    public void setTagGroupId(String tagGroupId) {
+        this.tagGroupId = tagGroupId;
+    }
+
+    public String getTagGroupName() {
+        return tagGroupName;
+    }
+
+    public void setTagGroupName(String tagGroupName) {
+        this.tagGroupName = tagGroupName;
+    }
+
+    public String getTagId() {
+        return tagId;
+    }
+
+    public void setTagId(String tagId) {
+        this.tagId = tagId;
+    }
+
+    public String getTagName() {
+        return tagName;
+    }
+
+    public void setTagName(String tagName) {
+        this.tagName = tagName;
+    }
+
+    public Integer getIsDelete() {
+        return isDelete;
+    }
+
+    public void setIsDelete(Integer isDelete) {
+        this.isDelete = isDelete;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", id=").append(id);
+        sb.append(", tagGroupId=").append(tagGroupId);
+        sb.append(", tagGroupName=").append(tagGroupName);
+        sb.append(", tagId=").append(tagId);
+        sb.append(", tagName=").append(tagName);
+        sb.append(", isDelete=").append(isDelete);
+        sb.append(", createTime=").append(createTime);
+        sb.append(", updateTime=").append(updateTime);
+        sb.append("]");
+        return sb.toString();
+    }
+}

+ 733 - 0
common-module/src/main/java/com/tzld/piaoquan/growth/common/model/po/TagExample.java

@@ -0,0 +1,733 @@
+package com.tzld.piaoquan.growth.common.model.po;
+
+import com.tzld.piaoquan.growth.common.utils.page.Page;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+public class TagExample {
+    protected String orderByClause;
+
+    protected boolean distinct;
+
+    protected List<Criteria> oredCriteria;
+
+    protected Page page;
+
+    public TagExample() {
+        oredCriteria = new ArrayList<Criteria>();
+    }
+
+    public void setOrderByClause(String orderByClause) {
+        this.orderByClause = orderByClause;
+    }
+
+    public String getOrderByClause() {
+        return orderByClause;
+    }
+
+    public void setDistinct(boolean distinct) {
+        this.distinct = distinct;
+    }
+
+    public boolean isDistinct() {
+        return distinct;
+    }
+
+    public List<Criteria> getOredCriteria() {
+        return oredCriteria;
+    }
+
+    public void or(Criteria criteria) {
+        oredCriteria.add(criteria);
+    }
+
+    public Criteria or() {
+        Criteria criteria = createCriteriaInternal();
+        oredCriteria.add(criteria);
+        return criteria;
+    }
+
+    public Criteria createCriteria() {
+        Criteria criteria = createCriteriaInternal();
+        if (oredCriteria.size() == 0) {
+            oredCriteria.add(criteria);
+        }
+        return criteria;
+    }
+
+    protected Criteria createCriteriaInternal() {
+        Criteria criteria = new Criteria();
+        return criteria;
+    }
+
+    public void clear() {
+        oredCriteria.clear();
+        orderByClause = null;
+        distinct = false;
+    }
+
+    public void setPage(Page page) {
+        this.page=page;
+    }
+
+    public Page getPage() {
+        return page;
+    }
+
+    protected abstract static class GeneratedCriteria {
+        protected List<Criterion> criteria;
+
+        protected GeneratedCriteria() {
+            super();
+            criteria = new ArrayList<Criterion>();
+        }
+
+        public boolean isValid() {
+            return criteria.size() > 0;
+        }
+
+        public List<Criterion> getAllCriteria() {
+            return criteria;
+        }
+
+        public List<Criterion> getCriteria() {
+            return criteria;
+        }
+
+        protected void addCriterion(String condition) {
+            if (condition == null) {
+                throw new RuntimeException("Value for condition cannot be null");
+            }
+            criteria.add(new Criterion(condition));
+        }
+
+        protected void addCriterion(String condition, Object value, String property) {
+            if (value == null) {
+                throw new RuntimeException("Value for " + property + " cannot be null");
+            }
+            criteria.add(new Criterion(condition, value));
+        }
+
+        protected void addCriterion(String condition, Object value1, Object value2, String property) {
+            if (value1 == null || value2 == null) {
+                throw new RuntimeException("Between values for " + property + " cannot be null");
+            }
+            criteria.add(new Criterion(condition, value1, value2));
+        }
+
+        public Criteria andIdIsNull() {
+            addCriterion("id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdIsNotNull() {
+            addCriterion("id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdEqualTo(Long value) {
+            addCriterion("id =", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotEqualTo(Long value) {
+            addCriterion("id <>", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdGreaterThan(Long value) {
+            addCriterion("id >", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdGreaterThanOrEqualTo(Long value) {
+            addCriterion("id >=", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdLessThan(Long value) {
+            addCriterion("id <", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdLessThanOrEqualTo(Long value) {
+            addCriterion("id <=", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdIn(List<Long> values) {
+            addCriterion("id in", values, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotIn(List<Long> values) {
+            addCriterion("id not in", values, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdBetween(Long value1, Long value2) {
+            addCriterion("id between", value1, value2, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotBetween(Long value1, Long value2) {
+            addCriterion("id not between", value1, value2, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagGroupIdIsNull() {
+            addCriterion("tag_group_id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagGroupIdIsNotNull() {
+            addCriterion("tag_group_id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagGroupIdEqualTo(String value) {
+            addCriterion("tag_group_id =", value, "tagGroupId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagGroupIdNotEqualTo(String value) {
+            addCriterion("tag_group_id <>", value, "tagGroupId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagGroupIdGreaterThan(String value) {
+            addCriterion("tag_group_id >", value, "tagGroupId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagGroupIdGreaterThanOrEqualTo(String value) {
+            addCriterion("tag_group_id >=", value, "tagGroupId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagGroupIdLessThan(String value) {
+            addCriterion("tag_group_id <", value, "tagGroupId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagGroupIdLessThanOrEqualTo(String value) {
+            addCriterion("tag_group_id <=", value, "tagGroupId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagGroupIdLike(String value) {
+            addCriterion("tag_group_id like", value, "tagGroupId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagGroupIdNotLike(String value) {
+            addCriterion("tag_group_id not like", value, "tagGroupId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagGroupIdIn(List<String> values) {
+            addCriterion("tag_group_id in", values, "tagGroupId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagGroupIdNotIn(List<String> values) {
+            addCriterion("tag_group_id not in", values, "tagGroupId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagGroupIdBetween(String value1, String value2) {
+            addCriterion("tag_group_id between", value1, value2, "tagGroupId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagGroupIdNotBetween(String value1, String value2) {
+            addCriterion("tag_group_id not between", value1, value2, "tagGroupId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagGroupNameIsNull() {
+            addCriterion("tag_group_name is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagGroupNameIsNotNull() {
+            addCriterion("tag_group_name is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagGroupNameEqualTo(String value) {
+            addCriterion("tag_group_name =", value, "tagGroupName");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagGroupNameNotEqualTo(String value) {
+            addCriterion("tag_group_name <>", value, "tagGroupName");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagGroupNameGreaterThan(String value) {
+            addCriterion("tag_group_name >", value, "tagGroupName");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagGroupNameGreaterThanOrEqualTo(String value) {
+            addCriterion("tag_group_name >=", value, "tagGroupName");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagGroupNameLessThan(String value) {
+            addCriterion("tag_group_name <", value, "tagGroupName");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagGroupNameLessThanOrEqualTo(String value) {
+            addCriterion("tag_group_name <=", value, "tagGroupName");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagGroupNameLike(String value) {
+            addCriterion("tag_group_name like", value, "tagGroupName");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagGroupNameNotLike(String value) {
+            addCriterion("tag_group_name not like", value, "tagGroupName");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagGroupNameIn(List<String> values) {
+            addCriterion("tag_group_name in", values, "tagGroupName");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagGroupNameNotIn(List<String> values) {
+            addCriterion("tag_group_name not in", values, "tagGroupName");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagGroupNameBetween(String value1, String value2) {
+            addCriterion("tag_group_name between", value1, value2, "tagGroupName");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagGroupNameNotBetween(String value1, String value2) {
+            addCriterion("tag_group_name not between", value1, value2, "tagGroupName");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagIdIsNull() {
+            addCriterion("tag_id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagIdIsNotNull() {
+            addCriterion("tag_id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagIdEqualTo(String value) {
+            addCriterion("tag_id =", value, "tagId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagIdNotEqualTo(String value) {
+            addCriterion("tag_id <>", value, "tagId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagIdGreaterThan(String value) {
+            addCriterion("tag_id >", value, "tagId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagIdGreaterThanOrEqualTo(String value) {
+            addCriterion("tag_id >=", value, "tagId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagIdLessThan(String value) {
+            addCriterion("tag_id <", value, "tagId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagIdLessThanOrEqualTo(String value) {
+            addCriterion("tag_id <=", value, "tagId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagIdLike(String value) {
+            addCriterion("tag_id like", value, "tagId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagIdNotLike(String value) {
+            addCriterion("tag_id not like", value, "tagId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagIdIn(List<String> values) {
+            addCriterion("tag_id in", values, "tagId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagIdNotIn(List<String> values) {
+            addCriterion("tag_id not in", values, "tagId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagIdBetween(String value1, String value2) {
+            addCriterion("tag_id between", value1, value2, "tagId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagIdNotBetween(String value1, String value2) {
+            addCriterion("tag_id not between", value1, value2, "tagId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagNameIsNull() {
+            addCriterion("tag_name is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagNameIsNotNull() {
+            addCriterion("tag_name is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagNameEqualTo(String value) {
+            addCriterion("tag_name =", value, "tagName");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagNameNotEqualTo(String value) {
+            addCriterion("tag_name <>", value, "tagName");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagNameGreaterThan(String value) {
+            addCriterion("tag_name >", value, "tagName");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagNameGreaterThanOrEqualTo(String value) {
+            addCriterion("tag_name >=", value, "tagName");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagNameLessThan(String value) {
+            addCriterion("tag_name <", value, "tagName");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagNameLessThanOrEqualTo(String value) {
+            addCriterion("tag_name <=", value, "tagName");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagNameLike(String value) {
+            addCriterion("tag_name like", value, "tagName");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagNameNotLike(String value) {
+            addCriterion("tag_name not like", value, "tagName");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagNameIn(List<String> values) {
+            addCriterion("tag_name in", values, "tagName");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagNameNotIn(List<String> values) {
+            addCriterion("tag_name not in", values, "tagName");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagNameBetween(String value1, String value2) {
+            addCriterion("tag_name between", value1, value2, "tagName");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagNameNotBetween(String value1, String value2) {
+            addCriterion("tag_name not between", value1, value2, "tagName");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteIsNull() {
+            addCriterion("is_delete is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteIsNotNull() {
+            addCriterion("is_delete is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteEqualTo(Integer value) {
+            addCriterion("is_delete =", value, "isDelete");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteNotEqualTo(Integer value) {
+            addCriterion("is_delete <>", value, "isDelete");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteGreaterThan(Integer value) {
+            addCriterion("is_delete >", value, "isDelete");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteGreaterThanOrEqualTo(Integer value) {
+            addCriterion("is_delete >=", value, "isDelete");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteLessThan(Integer value) {
+            addCriterion("is_delete <", value, "isDelete");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteLessThanOrEqualTo(Integer value) {
+            addCriterion("is_delete <=", value, "isDelete");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteIn(List<Integer> values) {
+            addCriterion("is_delete in", values, "isDelete");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteNotIn(List<Integer> values) {
+            addCriterion("is_delete not in", values, "isDelete");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteBetween(Integer value1, Integer value2) {
+            addCriterion("is_delete between", value1, value2, "isDelete");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteNotBetween(Integer value1, Integer value2) {
+            addCriterion("is_delete not between", value1, value2, "isDelete");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeIsNull() {
+            addCriterion("create_time is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeIsNotNull() {
+            addCriterion("create_time is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeEqualTo(Date value) {
+            addCriterion("create_time =", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeNotEqualTo(Date value) {
+            addCriterion("create_time <>", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeGreaterThan(Date value) {
+            addCriterion("create_time >", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) {
+            addCriterion("create_time >=", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeLessThan(Date value) {
+            addCriterion("create_time <", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeLessThanOrEqualTo(Date value) {
+            addCriterion("create_time <=", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeIn(List<Date> values) {
+            addCriterion("create_time in", values, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeNotIn(List<Date> values) {
+            addCriterion("create_time not in", values, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeBetween(Date value1, Date value2) {
+            addCriterion("create_time between", value1, value2, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeNotBetween(Date value1, Date value2) {
+            addCriterion("create_time not between", value1, value2, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeIsNull() {
+            addCriterion("update_time is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeIsNotNull() {
+            addCriterion("update_time is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeEqualTo(Date value) {
+            addCriterion("update_time =", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeNotEqualTo(Date value) {
+            addCriterion("update_time <>", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeGreaterThan(Date value) {
+            addCriterion("update_time >", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) {
+            addCriterion("update_time >=", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeLessThan(Date value) {
+            addCriterion("update_time <", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeLessThanOrEqualTo(Date value) {
+            addCriterion("update_time <=", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeIn(List<Date> values) {
+            addCriterion("update_time in", values, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeNotIn(List<Date> values) {
+            addCriterion("update_time not in", values, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeBetween(Date value1, Date value2) {
+            addCriterion("update_time between", value1, value2, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeNotBetween(Date value1, Date value2) {
+            addCriterion("update_time not between", value1, value2, "updateTime");
+            return (Criteria) this;
+        }
+    }
+
+    public static class Criteria extends GeneratedCriteria {
+
+        protected Criteria() {
+            super();
+        }
+    }
+
+    public static class Criterion {
+        private String condition;
+
+        private Object value;
+
+        private Object secondValue;
+
+        private boolean noValue;
+
+        private boolean singleValue;
+
+        private boolean betweenValue;
+
+        private boolean listValue;
+
+        private String typeHandler;
+
+        public String getCondition() {
+            return condition;
+        }
+
+        public Object getValue() {
+            return value;
+        }
+
+        public Object getSecondValue() {
+            return secondValue;
+        }
+
+        public boolean isNoValue() {
+            return noValue;
+        }
+
+        public boolean isSingleValue() {
+            return singleValue;
+        }
+
+        public boolean isBetweenValue() {
+            return betweenValue;
+        }
+
+        public boolean isListValue() {
+            return listValue;
+        }
+
+        public String getTypeHandler() {
+            return typeHandler;
+        }
+
+        protected Criterion(String condition) {
+            super();
+            this.condition = condition;
+            this.typeHandler = null;
+            this.noValue = true;
+        }
+
+        protected Criterion(String condition, Object value, String typeHandler) {
+            super();
+            this.condition = condition;
+            this.value = value;
+            this.typeHandler = typeHandler;
+            if (value instanceof List<?>) {
+                this.listValue = true;
+            } else {
+                this.singleValue = true;
+            }
+        }
+
+        protected Criterion(String condition, Object value) {
+            this(condition, value, null);
+        }
+
+        protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
+            super();
+            this.condition = condition;
+            this.value = value;
+            this.secondValue = secondValue;
+            this.typeHandler = typeHandler;
+            this.betweenValue = true;
+        }
+
+        protected Criterion(String condition, Object value, Object secondValue) {
+            this(condition, value, secondValue, null);
+        }
+    }
+}

+ 81 - 0
common-module/src/main/java/com/tzld/piaoquan/growth/common/model/po/UserWithTag.java

@@ -0,0 +1,81 @@
+package com.tzld.piaoquan.growth.common.model.po;
+
+import java.util.Date;
+
+public class UserWithTag {
+    private Long id;
+
+    private Long userId;
+
+    private Long tagId;
+
+    private Integer isDelete;
+
+    private Date createTime;
+
+    private Date updateTime;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getUserId() {
+        return userId;
+    }
+
+    public void setUserId(Long userId) {
+        this.userId = userId;
+    }
+
+    public Long getTagId() {
+        return tagId;
+    }
+
+    public void setTagId(Long tagId) {
+        this.tagId = tagId;
+    }
+
+    public Integer getIsDelete() {
+        return isDelete;
+    }
+
+    public void setIsDelete(Integer isDelete) {
+        this.isDelete = isDelete;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", id=").append(id);
+        sb.append(", userId=").append(userId);
+        sb.append(", tagId=").append(tagId);
+        sb.append(", isDelete=").append(isDelete);
+        sb.append(", createTime=").append(createTime);
+        sb.append(", updateTime=").append(updateTime);
+        sb.append("]");
+        return sb.toString();
+    }
+}

+ 573 - 0
common-module/src/main/java/com/tzld/piaoquan/growth/common/model/po/UserWithTagExample.java

@@ -0,0 +1,573 @@
+package com.tzld.piaoquan.growth.common.model.po;
+
+import com.tzld.piaoquan.growth.common.utils.page.Page;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+public class UserWithTagExample {
+    protected String orderByClause;
+
+    protected boolean distinct;
+
+    protected List<Criteria> oredCriteria;
+
+    protected Page page;
+
+    public UserWithTagExample() {
+        oredCriteria = new ArrayList<Criteria>();
+    }
+
+    public void setOrderByClause(String orderByClause) {
+        this.orderByClause = orderByClause;
+    }
+
+    public String getOrderByClause() {
+        return orderByClause;
+    }
+
+    public void setDistinct(boolean distinct) {
+        this.distinct = distinct;
+    }
+
+    public boolean isDistinct() {
+        return distinct;
+    }
+
+    public List<Criteria> getOredCriteria() {
+        return oredCriteria;
+    }
+
+    public void or(Criteria criteria) {
+        oredCriteria.add(criteria);
+    }
+
+    public Criteria or() {
+        Criteria criteria = createCriteriaInternal();
+        oredCriteria.add(criteria);
+        return criteria;
+    }
+
+    public Criteria createCriteria() {
+        Criteria criteria = createCriteriaInternal();
+        if (oredCriteria.size() == 0) {
+            oredCriteria.add(criteria);
+        }
+        return criteria;
+    }
+
+    protected Criteria createCriteriaInternal() {
+        Criteria criteria = new Criteria();
+        return criteria;
+    }
+
+    public void clear() {
+        oredCriteria.clear();
+        orderByClause = null;
+        distinct = false;
+    }
+
+    public void setPage(Page page) {
+        this.page=page;
+    }
+
+    public Page getPage() {
+        return page;
+    }
+
+    protected abstract static class GeneratedCriteria {
+        protected List<Criterion> criteria;
+
+        protected GeneratedCriteria() {
+            super();
+            criteria = new ArrayList<Criterion>();
+        }
+
+        public boolean isValid() {
+            return criteria.size() > 0;
+        }
+
+        public List<Criterion> getAllCriteria() {
+            return criteria;
+        }
+
+        public List<Criterion> getCriteria() {
+            return criteria;
+        }
+
+        protected void addCriterion(String condition) {
+            if (condition == null) {
+                throw new RuntimeException("Value for condition cannot be null");
+            }
+            criteria.add(new Criterion(condition));
+        }
+
+        protected void addCriterion(String condition, Object value, String property) {
+            if (value == null) {
+                throw new RuntimeException("Value for " + property + " cannot be null");
+            }
+            criteria.add(new Criterion(condition, value));
+        }
+
+        protected void addCriterion(String condition, Object value1, Object value2, String property) {
+            if (value1 == null || value2 == null) {
+                throw new RuntimeException("Between values for " + property + " cannot be null");
+            }
+            criteria.add(new Criterion(condition, value1, value2));
+        }
+
+        public Criteria andIdIsNull() {
+            addCriterion("id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdIsNotNull() {
+            addCriterion("id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdEqualTo(Long value) {
+            addCriterion("id =", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotEqualTo(Long value) {
+            addCriterion("id <>", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdGreaterThan(Long value) {
+            addCriterion("id >", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdGreaterThanOrEqualTo(Long value) {
+            addCriterion("id >=", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdLessThan(Long value) {
+            addCriterion("id <", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdLessThanOrEqualTo(Long value) {
+            addCriterion("id <=", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdIn(List<Long> values) {
+            addCriterion("id in", values, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotIn(List<Long> values) {
+            addCriterion("id not in", values, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdBetween(Long value1, Long value2) {
+            addCriterion("id between", value1, value2, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotBetween(Long value1, Long value2) {
+            addCriterion("id not between", value1, value2, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserIdIsNull() {
+            addCriterion("user_id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserIdIsNotNull() {
+            addCriterion("user_id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserIdEqualTo(Long value) {
+            addCriterion("user_id =", value, "userId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserIdNotEqualTo(Long value) {
+            addCriterion("user_id <>", value, "userId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserIdGreaterThan(Long value) {
+            addCriterion("user_id >", value, "userId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserIdGreaterThanOrEqualTo(Long value) {
+            addCriterion("user_id >=", value, "userId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserIdLessThan(Long value) {
+            addCriterion("user_id <", value, "userId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserIdLessThanOrEqualTo(Long value) {
+            addCriterion("user_id <=", value, "userId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserIdIn(List<Long> values) {
+            addCriterion("user_id in", values, "userId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserIdNotIn(List<Long> values) {
+            addCriterion("user_id not in", values, "userId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserIdBetween(Long value1, Long value2) {
+            addCriterion("user_id between", value1, value2, "userId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserIdNotBetween(Long value1, Long value2) {
+            addCriterion("user_id not between", value1, value2, "userId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagIdIsNull() {
+            addCriterion("tag_id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagIdIsNotNull() {
+            addCriterion("tag_id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagIdEqualTo(Long value) {
+            addCriterion("tag_id =", value, "tagId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagIdNotEqualTo(Long value) {
+            addCriterion("tag_id <>", value, "tagId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagIdGreaterThan(Long value) {
+            addCriterion("tag_id >", value, "tagId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagIdGreaterThanOrEqualTo(Long value) {
+            addCriterion("tag_id >=", value, "tagId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagIdLessThan(Long value) {
+            addCriterion("tag_id <", value, "tagId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagIdLessThanOrEqualTo(Long value) {
+            addCriterion("tag_id <=", value, "tagId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagIdIn(List<Long> values) {
+            addCriterion("tag_id in", values, "tagId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagIdNotIn(List<Long> values) {
+            addCriterion("tag_id not in", values, "tagId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagIdBetween(Long value1, Long value2) {
+            addCriterion("tag_id between", value1, value2, "tagId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagIdNotBetween(Long value1, Long value2) {
+            addCriterion("tag_id not between", value1, value2, "tagId");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteIsNull() {
+            addCriterion("is_delete is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteIsNotNull() {
+            addCriterion("is_delete is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteEqualTo(Integer value) {
+            addCriterion("is_delete =", value, "isDelete");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteNotEqualTo(Integer value) {
+            addCriterion("is_delete <>", value, "isDelete");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteGreaterThan(Integer value) {
+            addCriterion("is_delete >", value, "isDelete");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteGreaterThanOrEqualTo(Integer value) {
+            addCriterion("is_delete >=", value, "isDelete");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteLessThan(Integer value) {
+            addCriterion("is_delete <", value, "isDelete");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteLessThanOrEqualTo(Integer value) {
+            addCriterion("is_delete <=", value, "isDelete");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteIn(List<Integer> values) {
+            addCriterion("is_delete in", values, "isDelete");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteNotIn(List<Integer> values) {
+            addCriterion("is_delete not in", values, "isDelete");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteBetween(Integer value1, Integer value2) {
+            addCriterion("is_delete between", value1, value2, "isDelete");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteNotBetween(Integer value1, Integer value2) {
+            addCriterion("is_delete not between", value1, value2, "isDelete");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeIsNull() {
+            addCriterion("create_time is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeIsNotNull() {
+            addCriterion("create_time is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeEqualTo(Date value) {
+            addCriterion("create_time =", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeNotEqualTo(Date value) {
+            addCriterion("create_time <>", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeGreaterThan(Date value) {
+            addCriterion("create_time >", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) {
+            addCriterion("create_time >=", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeLessThan(Date value) {
+            addCriterion("create_time <", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeLessThanOrEqualTo(Date value) {
+            addCriterion("create_time <=", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeIn(List<Date> values) {
+            addCriterion("create_time in", values, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeNotIn(List<Date> values) {
+            addCriterion("create_time not in", values, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeBetween(Date value1, Date value2) {
+            addCriterion("create_time between", value1, value2, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeNotBetween(Date value1, Date value2) {
+            addCriterion("create_time not between", value1, value2, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeIsNull() {
+            addCriterion("update_time is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeIsNotNull() {
+            addCriterion("update_time is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeEqualTo(Date value) {
+            addCriterion("update_time =", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeNotEqualTo(Date value) {
+            addCriterion("update_time <>", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeGreaterThan(Date value) {
+            addCriterion("update_time >", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) {
+            addCriterion("update_time >=", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeLessThan(Date value) {
+            addCriterion("update_time <", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeLessThanOrEqualTo(Date value) {
+            addCriterion("update_time <=", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeIn(List<Date> values) {
+            addCriterion("update_time in", values, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeNotIn(List<Date> values) {
+            addCriterion("update_time not in", values, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeBetween(Date value1, Date value2) {
+            addCriterion("update_time between", value1, value2, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeNotBetween(Date value1, Date value2) {
+            addCriterion("update_time not between", value1, value2, "updateTime");
+            return (Criteria) this;
+        }
+    }
+
+    public static class Criteria extends GeneratedCriteria {
+
+        protected Criteria() {
+            super();
+        }
+    }
+
+    public static class Criterion {
+        private String condition;
+
+        private Object value;
+
+        private Object secondValue;
+
+        private boolean noValue;
+
+        private boolean singleValue;
+
+        private boolean betweenValue;
+
+        private boolean listValue;
+
+        private String typeHandler;
+
+        public String getCondition() {
+            return condition;
+        }
+
+        public Object getValue() {
+            return value;
+        }
+
+        public Object getSecondValue() {
+            return secondValue;
+        }
+
+        public boolean isNoValue() {
+            return noValue;
+        }
+
+        public boolean isSingleValue() {
+            return singleValue;
+        }
+
+        public boolean isBetweenValue() {
+            return betweenValue;
+        }
+
+        public boolean isListValue() {
+            return listValue;
+        }
+
+        public String getTypeHandler() {
+            return typeHandler;
+        }
+
+        protected Criterion(String condition) {
+            super();
+            this.condition = condition;
+            this.typeHandler = null;
+            this.noValue = true;
+        }
+
+        protected Criterion(String condition, Object value, String typeHandler) {
+            super();
+            this.condition = condition;
+            this.value = value;
+            this.typeHandler = typeHandler;
+            if (value instanceof List<?>) {
+                this.listValue = true;
+            } else {
+                this.singleValue = true;
+            }
+        }
+
+        protected Criterion(String condition, Object value) {
+            this(condition, value, null);
+        }
+
+        protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
+            super();
+            this.condition = condition;
+            this.value = value;
+            this.secondValue = secondValue;
+            this.typeHandler = typeHandler;
+            this.betweenValue = true;
+        }
+
+        protected Criterion(String condition, Object value, Object secondValue) {
+            this(condition, value, secondValue, null);
+        }
+    }
+}

+ 1 - 1
common-module/src/main/resources/mapper/CgiReplyBucketDataMapper.xml

@@ -402,6 +402,6 @@
   <select id="selectVideoId" resultType="java.lang.Long">
     select distinct mini_video_id
     from cgi_reply_bucket_data
-    where is_delete = 0;
+    where is_delete = 0 and create_time > #{createTime,jdbcType=TIMESTAMP};
   </select>
 </mapper>

+ 261 - 0
common-module/src/main/resources/mapper/TagMapper.xml

@@ -0,0 +1,261 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.tzld.piaoquan.growth.common.dao.mapper.TagMapper">
+  <resultMap id="BaseResultMap" type="com.tzld.piaoquan.growth.common.model.po.Tag">
+    <id column="id" jdbcType="BIGINT" property="id" />
+    <result column="tag_group_id" jdbcType="VARCHAR" property="tagGroupId" />
+    <result column="tag_group_name" jdbcType="VARCHAR" property="tagGroupName" />
+    <result column="tag_id" jdbcType="VARCHAR" property="tagId" />
+    <result column="tag_name" jdbcType="VARCHAR" property="tagName" />
+    <result column="is_delete" jdbcType="INTEGER" property="isDelete" />
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
+  </resultMap>
+  <sql id="Example_Where_Clause">
+    <where>
+      <foreach collection="oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Update_By_Example_Where_Clause">
+    <where>
+      <foreach collection="example.oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Base_Column_List">
+    id, tag_group_id, tag_group_name, tag_id, tag_name, is_delete, create_time, update_time
+  </sql>
+  <select id="selectByExample" parameterType="com.tzld.piaoquan.growth.common.model.po.TagExample" resultMap="BaseResultMap">
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from we_com_tag
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+    <if test="orderByClause != null">
+      order by ${orderByClause}
+    </if>
+    <if test="page != null">
+      limit #{page.offset} , #{page.pageSize}
+    </if>
+  </select>
+  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
+    select 
+    <include refid="Base_Column_List" />
+    from we_com_tag
+    where id = #{id,jdbcType=BIGINT}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+    delete from we_com_tag
+    where id = #{id,jdbcType=BIGINT}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.tzld.piaoquan.growth.common.model.po.TagExample">
+    delete from we_com_tag
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.tzld.piaoquan.growth.common.model.po.Tag">
+    insert into we_com_tag (id, tag_group_id, tag_group_name, 
+      tag_id, tag_name, is_delete, 
+      create_time, update_time)
+    values (#{id,jdbcType=BIGINT}, #{tagGroupId,jdbcType=VARCHAR}, #{tagGroupName,jdbcType=VARCHAR}, 
+      #{tagId,jdbcType=VARCHAR}, #{tagName,jdbcType=VARCHAR}, #{isDelete,jdbcType=INTEGER}, 
+      #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
+  </insert>
+  <insert id="insertSelective" parameterType="com.tzld.piaoquan.growth.common.model.po.Tag">
+    insert into we_com_tag
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="tagGroupId != null">
+        tag_group_id,
+      </if>
+      <if test="tagGroupName != null">
+        tag_group_name,
+      </if>
+      <if test="tagId != null">
+        tag_id,
+      </if>
+      <if test="tagName != null">
+        tag_name,
+      </if>
+      <if test="isDelete != null">
+        is_delete,
+      </if>
+      <if test="createTime != null">
+        create_time,
+      </if>
+      <if test="updateTime != null">
+        update_time,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=BIGINT},
+      </if>
+      <if test="tagGroupId != null">
+        #{tagGroupId,jdbcType=VARCHAR},
+      </if>
+      <if test="tagGroupName != null">
+        #{tagGroupName,jdbcType=VARCHAR},
+      </if>
+      <if test="tagId != null">
+        #{tagId,jdbcType=VARCHAR},
+      </if>
+      <if test="tagName != null">
+        #{tagName,jdbcType=VARCHAR},
+      </if>
+      <if test="isDelete != null">
+        #{isDelete,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null">
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateTime != null">
+        #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="com.tzld.piaoquan.growth.common.model.po.TagExample" resultType="java.lang.Long">
+    select count(*) from we_com_tag
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map">
+    update we_com_tag
+    <set>
+      <if test="record.id != null">
+        id = #{record.id,jdbcType=BIGINT},
+      </if>
+      <if test="record.tagGroupId != null">
+        tag_group_id = #{record.tagGroupId,jdbcType=VARCHAR},
+      </if>
+      <if test="record.tagGroupName != null">
+        tag_group_name = #{record.tagGroupName,jdbcType=VARCHAR},
+      </if>
+      <if test="record.tagId != null">
+        tag_id = #{record.tagId,jdbcType=VARCHAR},
+      </if>
+      <if test="record.tagName != null">
+        tag_name = #{record.tagName,jdbcType=VARCHAR},
+      </if>
+      <if test="record.isDelete != null">
+        is_delete = #{record.isDelete,jdbcType=INTEGER},
+      </if>
+      <if test="record.createTime != null">
+        create_time = #{record.createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="record.updateTime != null">
+        update_time = #{record.updateTime,jdbcType=TIMESTAMP},
+      </if>
+    </set>
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExample" parameterType="map">
+    update we_com_tag
+    set id = #{record.id,jdbcType=BIGINT},
+      tag_group_id = #{record.tagGroupId,jdbcType=VARCHAR},
+      tag_group_name = #{record.tagGroupName,jdbcType=VARCHAR},
+      tag_id = #{record.tagId,jdbcType=VARCHAR},
+      tag_name = #{record.tagName,jdbcType=VARCHAR},
+      is_delete = #{record.isDelete,jdbcType=INTEGER},
+      create_time = #{record.createTime,jdbcType=TIMESTAMP},
+      update_time = #{record.updateTime,jdbcType=TIMESTAMP}
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.tzld.piaoquan.growth.common.model.po.Tag">
+    update we_com_tag
+    <set>
+      <if test="tagGroupId != null">
+        tag_group_id = #{tagGroupId,jdbcType=VARCHAR},
+      </if>
+      <if test="tagGroupName != null">
+        tag_group_name = #{tagGroupName,jdbcType=VARCHAR},
+      </if>
+      <if test="tagId != null">
+        tag_id = #{tagId,jdbcType=VARCHAR},
+      </if>
+      <if test="tagName != null">
+        tag_name = #{tagName,jdbcType=VARCHAR},
+      </if>
+      <if test="isDelete != null">
+        is_delete = #{isDelete,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null">
+        create_time = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateTime != null">
+        update_time = #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+    </set>
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.tzld.piaoquan.growth.common.model.po.Tag">
+    update we_com_tag
+    set tag_group_id = #{tagGroupId,jdbcType=VARCHAR},
+      tag_group_name = #{tagGroupName,jdbcType=VARCHAR},
+      tag_id = #{tagId,jdbcType=VARCHAR},
+      tag_name = #{tagName,jdbcType=VARCHAR},
+      is_delete = #{isDelete,jdbcType=INTEGER},
+      create_time = #{createTime,jdbcType=TIMESTAMP},
+      update_time = #{updateTime,jdbcType=TIMESTAMP}
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+</mapper>

+ 231 - 0
common-module/src/main/resources/mapper/UserWithTagMapper.xml

@@ -0,0 +1,231 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.tzld.piaoquan.growth.common.dao.mapper.UserWithTagMapper">
+  <resultMap id="BaseResultMap" type="com.tzld.piaoquan.growth.common.model.po.UserWithTag">
+    <id column="id" jdbcType="BIGINT" property="id" />
+    <result column="user_id" jdbcType="BIGINT" property="userId" />
+    <result column="tag_id" jdbcType="BIGINT" property="tagId" />
+    <result column="is_delete" jdbcType="INTEGER" property="isDelete" />
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
+  </resultMap>
+  <sql id="Example_Where_Clause">
+    <where>
+      <foreach collection="oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Update_By_Example_Where_Clause">
+    <where>
+      <foreach collection="example.oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Base_Column_List">
+    id, user_id, tag_id, is_delete, create_time, update_time
+  </sql>
+  <select id="selectByExample" parameterType="com.tzld.piaoquan.growth.common.model.po.UserWithTagExample" resultMap="BaseResultMap">
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from we_com_user_with_tag
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+    <if test="orderByClause != null">
+      order by ${orderByClause}
+    </if>
+    <if test="page != null">
+      limit #{page.offset} , #{page.pageSize}
+    </if>
+  </select>
+  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
+    select 
+    <include refid="Base_Column_List" />
+    from we_com_user_with_tag
+    where id = #{id,jdbcType=BIGINT}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+    delete from we_com_user_with_tag
+    where id = #{id,jdbcType=BIGINT}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.tzld.piaoquan.growth.common.model.po.UserWithTagExample">
+    delete from we_com_user_with_tag
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.tzld.piaoquan.growth.common.model.po.UserWithTag">
+    insert into we_com_user_with_tag (id, user_id, tag_id, 
+      is_delete, create_time, update_time
+      )
+    values (#{id,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT}, #{tagId,jdbcType=BIGINT}, 
+      #{isDelete,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
+      )
+  </insert>
+  <insert id="insertSelective" parameterType="com.tzld.piaoquan.growth.common.model.po.UserWithTag">
+    insert into we_com_user_with_tag
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="userId != null">
+        user_id,
+      </if>
+      <if test="tagId != null">
+        tag_id,
+      </if>
+      <if test="isDelete != null">
+        is_delete,
+      </if>
+      <if test="createTime != null">
+        create_time,
+      </if>
+      <if test="updateTime != null">
+        update_time,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=BIGINT},
+      </if>
+      <if test="userId != null">
+        #{userId,jdbcType=BIGINT},
+      </if>
+      <if test="tagId != null">
+        #{tagId,jdbcType=BIGINT},
+      </if>
+      <if test="isDelete != null">
+        #{isDelete,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null">
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateTime != null">
+        #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="com.tzld.piaoquan.growth.common.model.po.UserWithTagExample" resultType="java.lang.Long">
+    select count(*) from we_com_user_with_tag
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map">
+    update we_com_user_with_tag
+    <set>
+      <if test="record.id != null">
+        id = #{record.id,jdbcType=BIGINT},
+      </if>
+      <if test="record.userId != null">
+        user_id = #{record.userId,jdbcType=BIGINT},
+      </if>
+      <if test="record.tagId != null">
+        tag_id = #{record.tagId,jdbcType=BIGINT},
+      </if>
+      <if test="record.isDelete != null">
+        is_delete = #{record.isDelete,jdbcType=INTEGER},
+      </if>
+      <if test="record.createTime != null">
+        create_time = #{record.createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="record.updateTime != null">
+        update_time = #{record.updateTime,jdbcType=TIMESTAMP},
+      </if>
+    </set>
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExample" parameterType="map">
+    update we_com_user_with_tag
+    set id = #{record.id,jdbcType=BIGINT},
+      user_id = #{record.userId,jdbcType=BIGINT},
+      tag_id = #{record.tagId,jdbcType=BIGINT},
+      is_delete = #{record.isDelete,jdbcType=INTEGER},
+      create_time = #{record.createTime,jdbcType=TIMESTAMP},
+      update_time = #{record.updateTime,jdbcType=TIMESTAMP}
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.tzld.piaoquan.growth.common.model.po.UserWithTag">
+    update we_com_user_with_tag
+    <set>
+      <if test="userId != null">
+        user_id = #{userId,jdbcType=BIGINT},
+      </if>
+      <if test="tagId != null">
+        tag_id = #{tagId,jdbcType=BIGINT},
+      </if>
+      <if test="isDelete != null">
+        is_delete = #{isDelete,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null">
+        create_time = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateTime != null">
+        update_time = #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+    </set>
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.tzld.piaoquan.growth.common.model.po.UserWithTag">
+    update we_com_user_with_tag
+    set user_id = #{userId,jdbcType=BIGINT},
+      tag_id = #{tagId,jdbcType=BIGINT},
+      is_delete = #{isDelete,jdbcType=INTEGER},
+      create_time = #{createTime,jdbcType=TIMESTAMP},
+      update_time = #{updateTime,jdbcType=TIMESTAMP}
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+</mapper>

+ 16 - 5
offline-module/src/main/java/com/tzld/piaoquan/offline/job/AutoReplyVideoDataJob.java

@@ -15,6 +15,7 @@ import com.tzld.piaoquan.growth.common.model.po.CgiReplyBucketData;
 import com.tzld.piaoquan.growth.common.model.po.CgiReplyBucketDataExample;
 import com.tzld.piaoquan.growth.common.model.po.GhDetail;
 import com.tzld.piaoquan.growth.common.model.po.GhDetailExample;
+import com.tzld.piaoquan.growth.common.utils.DateUtil;
 import com.tzld.piaoquan.growth.common.utils.LarkRobotUtil;
 import com.xxl.job.core.biz.model.ReturnT;
 import com.xxl.job.core.handler.annotation.XxlJob;
@@ -25,9 +26,7 @@ import org.springframework.stereotype.Component;
 import org.springframework.util.CollectionUtils;
 
 import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Objects;
+import java.util.*;
 import java.util.stream.Collectors;
 
 @Slf4j
@@ -107,7 +106,8 @@ public class AutoReplyVideoDataJob {
 
     @XxlJob("validateAutoReplyVideoAuditStatusJob")
     public ReturnT<String> validateAutoReplyVideoAuditStatus(String param) throws IOException {
-        List<Long> videoIds = cgiReplyBucketDataMapper.selectVideoId();
+        Long beforeDayStart = DateUtil.getBeforeDayStart(7);
+        List<Long> videoIds = cgiReplyBucketDataMapper.selectVideoId(new Date(beforeDayStart));
         if (CollectionUtils.isEmpty(videoIds)) {
             return ReturnT.SUCCESS;
         }
@@ -144,7 +144,8 @@ public class AutoReplyVideoDataJob {
 
         for (Long videoId : auditFailedVideoIds) {
             CgiReplyBucketDataExample example = new CgiReplyBucketDataExample();
-            example.createCriteria().andMiniVideoIdEqualTo(videoId).andIsDeleteEqualTo(0);
+            example.createCriteria().andMiniVideoIdEqualTo(videoId).andIsDeleteEqualTo(0)
+                    .andCreateTimeGreaterThan(new Date(beforeDayStart));
             List<CgiReplyBucketData> cgiReplyBucketDataList = cgiReplyBucketDataMapper.selectByExample(example);
 //            List<String> ghIds = new ArrayList<>();
 //            List<String> manualGhIds = new ArrayList<>();
@@ -183,6 +184,16 @@ public class AutoReplyVideoDataJob {
 
             }
         }
+
+        Map<String, JSONObject> collect = rows.stream()
+                .collect(Collectors.toMap(
+                        row -> row.getString("ghId") + "-" + row.getString("video"),
+                        row -> row,
+                        (existing, replacement) -> existing
+                ));
+        rows = new ArrayList<>(collect.values());
+
+
         FeishuTableDTO tableDTO = FeishuTableDTO.createTable("自动回复视频审核失败报警", columns, rows, false);
         JSONObject content = JSONObject.parseObject(JSONObject.toJSONString(tableDTO));
         JSONObject bodyParam = new JSONObject();

+ 2 - 1
offline-module/src/main/java/com/tzld/piaoquan/offline/job/WeComMessageDataJob.java

@@ -238,7 +238,8 @@ public class WeComMessageDataJob {
         init(staffIds);
         for (Corp corp : corps) {
             WeComUserExample weComUserExample = new WeComUserExample();
-            weComUserExample.createCriteria().andExternalUserIdIsNotNull().andCorpIdEqualTo(corp.getId()).andGroupMsgDisabledEqualTo((byte) 0);
+            weComUserExample.createCriteria().andExternalUserIdIsNotNull().andCorpIdEqualTo(corp.getId())
+                    .andGroupMsgDisabledNotEqualTo((byte) 2);
             if (xxlJobParam.getUserId() != null) {
                 weComUserExample.createCriteria().andIdEqualTo(xxlJobParam.getUserId());
             }

+ 107 - 3
offline-module/src/main/java/com/tzld/piaoquan/offline/job/WeComUserDataJob.java

@@ -54,6 +54,12 @@ public class WeComUserDataJob {
     @Autowired
     private UserCountMapper userCountMapper;
 
+    @Autowired
+    private TagMapper tagMapper;
+
+    @Autowired
+    private UserWithTagMapper userWithTagMapper;
+
     @XxlJob("updateStaffWithUserJob")
     public ReturnT<String> updateStaffWithUser(String param) {
         XxlJobParam xxlJobParam = new XxlJobParam();
@@ -234,7 +240,8 @@ public class WeComUserDataJob {
     }
 
     @XxlJob("statisticsUserCountJob")
-    public ReturnT<String> statisticsUserCount(String param) {
+    public ReturnT<String> statisticsUserCount(String param) throws IOException {
+        refreshTag();
         StaffExample staffExample = new StaffExample();
         List<Staff> staffList = staffMapper.selectByExample(staffExample);
         String date;
@@ -278,15 +285,17 @@ public class WeComUserDataJob {
             String cursor = "";
             do {
                 String res = getUserDetailList(staff.getCarrierId(), cursor, corpId);
-                log.info("updateUserList res={} cursor={}", res, cursor);
+                log.info("getUserList res={} cursor={}", res, cursor);
                 JSONObject jsonObject = JSONObject.parseObject(res);
                 Integer errCode = jsonObject.getInteger("errcode");
                 if (errCode != 0) {
-                    log.error("updateUserList error carrierId={} cursor={}", staff.getCarrierId(), cursor);
+                    log.error("getUserList error carrierId={} cursor={}", staff.getCarrierId(), cursor);
                     return null;
                 }
                 JSONArray externalContactList = jsonObject.getJSONArray("external_contact_list");
                 for (int i = 0; i < externalContactList.size(); i++) {
+                    JSONObject externalContact = externalContactList.getJSONObject(i).getJSONObject("external_contact");
+                    String externalUserId = externalContact.getString("external_userid");
                     JSONObject followInfo = externalContactList.getJSONObject(i).getJSONObject("follow_info");
                     Long createAt = followInfo.getLong("createtime");
                     String dateString = DateUtil.getDateString(createAt * 1000, "yyyy-MM-dd");
@@ -294,6 +303,45 @@ public class WeComUserDataJob {
                         newCount++;
                     }
                     count++;
+                    JSONArray tagIds = followInfo.getJSONArray("tag_id");
+                    Long userId = weComUserMapper.selectIdByExternalUserId(externalUserId);
+                    if (userId == null) {
+                        String name = externalContact.getString("name");
+                        String unionId = externalContact.getString("unionid");
+                        String avatar = externalContact.getString("avatar");
+                        Integer type = externalContact.getInteger("type");
+                        Integer gender = externalContact.getInteger("gender");
+                        WeComUser weComUser = new WeComUser();
+                        weComUser.setExternalUserId(externalUserId);
+                        weComUser.setName(name);
+                        weComUser.setType(type);
+                        weComUser.setUnionId(unionId);
+                        weComUser.setGender(gender);
+                        weComUser.setAvatar(avatar);
+                        weComUser.setCreatedAt(createAt);
+                        weComUserMapper.insertSelective(weComUser);
+                        userId = weComUser.getId();
+                        StaffWithUser staffWithUser = new StaffWithUser();
+                        staffWithUser.setStaffId(staff.getId());
+                        staffWithUser.setUserId(userId);
+                        staffWithUserMapper.insert(staffWithUser);
+                    }
+
+                    if (!tagIds.isEmpty()) {
+                        List<String> tagIdList = tagIds.toJavaList(String.class);
+                        for (String tagId : tagIdList) {
+                            TagExample example = new TagExample();
+                            example.createCriteria().andTagIdEqualTo(tagId);
+                            List<Tag> tags = tagMapper.selectByExample(example);
+                            if (!CollectionUtils.isEmpty(tags)) {
+                                Tag tag = tags.get(0);
+                                UserWithTag userWithTag = new UserWithTag();
+                                userWithTag.setUserId(userId);
+                                userWithTag.setTagId(tag.getId());
+                                addUserWithTag(userWithTag);
+                            }
+                        }
+                    }
                 }
                 String nextCursor = jsonObject.getString("next_cursor");
                 if (cursor.equals(nextCursor)) {
@@ -308,4 +356,60 @@ public class WeComUserDataJob {
         result.put("newCount", newCount);
         return result;
     }
+
+
+    public void refreshTag() throws IOException {
+        String weComAccessToken = weComAccessTokenService.getWeComAccessToken(1L);
+        String url = String.format(POST_CORP_TAG_LIST + "?access_token=%s", weComAccessToken);
+        String res = httpPoolClient.post(url);
+        JSONObject jsonObject = JSONObject.parseObject(res);
+        Integer errcode = jsonObject.getInteger("errcode");
+        if (errcode == 0) {
+            JSONArray tagGroup = jsonObject.getJSONArray("tag_group");
+            if (!tagGroup.isEmpty()) {
+                for (int i = 0; i < tagGroup.size(); i++) {
+                    JSONObject tagGroupJSONObject = tagGroup.getJSONObject(i);
+                    String groupId = tagGroupJSONObject.getString("group_id");
+                    String groupName = tagGroupJSONObject.getString("group_name");
+                    JSONArray tags = tagGroupJSONObject.getJSONArray("tag");
+                    if (tags.isEmpty()) {
+                        continue;
+                    }
+                    for (int j = 0; j < tags.size(); j++) {
+                        JSONObject tagsJSONObject = tags.getJSONObject(j);
+                        String tagId = tagsJSONObject.getString("id");
+                        String tagName = tagsJSONObject.getString("name");
+                        Tag tag = new Tag();
+                        tag.setTagGroupId(groupId);
+                        tag.setTagGroupName(groupName);
+                        tag.setTagId(tagId);
+                        tag.setTagName(tagName);
+                        addAndUpdateTag(tag);
+                    }
+                }
+            }
+        }
+    }
+
+    private void addAndUpdateTag(Tag tag) {
+        TagExample example = new TagExample();
+        example.createCriteria().andTagGroupIdEqualTo(tag.getTagGroupId()).andTagIdEqualTo(tag.getTagId());
+        List<Tag> tags = tagMapper.selectByExample(example);
+        if (CollectionUtils.isEmpty(tags)) {
+            tagMapper.insertSelective(tag);
+        } else {
+            tag.setId(tags.get(0).getId());
+            tagMapper.updateByPrimaryKeySelective(tag);
+        }
+    }
+
+    private void addUserWithTag(UserWithTag userWithTag) {
+        UserWithTagExample userWithTagExample = new UserWithTagExample();
+        userWithTagExample.createCriteria().andUserIdEqualTo(userWithTag.getUserId()).andTagIdEqualTo(userWithTag.getTagId());
+        long l = userWithTagMapper.countByExample(userWithTagExample);
+        if (l == 0) {
+            userWithTagMapper.insertSelective(userWithTag);
+        }
+    }
+
 }