Browse Source

增加群聊统计数据

xueyiming 1 day ago
parent
commit
5188e0c8f3

+ 2 - 2
api-module/src/main/java/com/tzld/piaoquan/api/dao/generator/MybatisGeneratorMain.java

@@ -20,8 +20,8 @@ public class MybatisGeneratorMain {
             throws SQLException, IOException, InterruptedException, InvalidConfigurationException, XMLParserException {
         List<String> warnings = new ArrayList<>();
 
-//        File configFile = new File(MybatisGeneratorMain.class.getResource("/mybatis-generator-config.xml").getFile());
-        File configFile = new File(MybatisGeneratorMain.class.getResource("/mybatis-api-generator-config.xml").getFile());
+        File configFile = new File(MybatisGeneratorMain.class.getResource("/mybatis-generator-config.xml").getFile());
+//        File configFile = new File(MybatisGeneratorMain.class.getResource("/mybatis-api-generator-config.xml").getFile());
 //        File configFile = new File(MybatisGeneratorMain.class.getResource("/mybatis-api-contentPlatform-generator-config.xml").getFile());
 //        File configFile = new File(MybatisGeneratorMain.class.getResource("/mybatis-api-wecomThirdpart-generator-config.xml").getFile());
         ConfigurationParser cp = new ConfigurationParser(warnings);

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

@@ -50,7 +50,7 @@
             <property name="enableSubPackages" value="true"/>
         </javaClientGenerator>
 
-        <table tableName="cgi_reply_bucket_data" domainObjectName="CgiReplyBucketData" alias=""/>
+<!--        <table tableName="cgi_reply_bucket_data" domainObjectName="CgiReplyBucketData" alias=""/>-->
 <!--        <table tableName="we_com_user" domainObjectName="WeComUser" alias=""/>-->
 <!--        <table tableName="we_com_alert_message" domainObjectName="AlertMessage" alias=""/>-->
 <!--        <table tableName="gh_detail" domainObjectName="GhDetail" alias=""/>-->
@@ -64,8 +64,7 @@
 <!--        <table tableName="we_com_staff_with_user" domainObjectName="StaffWithUser" alias=""/>-->
 <!--        <table tableName="we_com_corp_statistics_total" domainObjectName="CorpStatisticsTotal" alias=""/>-->
 <!--        <table tableName="we_com_staff_statistics_total" domainObjectName="StaffStatisticsTotal" alias=""/>-->
-
-
+        <table tableName="we_com_staff_group_statistics_total" domainObjectName="StaffGroupStatisticsTotal" alias=""/>
 
 
     </context>

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

@@ -48,4 +48,7 @@ public interface WeComConstant {
     String POST_WE_COM_ADD_MOMENT_TASK = "https://qyapi.weixin.qq.com/cgi-bin/externalcontact/add_moment_task";
 
     String POST_WE_COM_USER_BEHAVIOR_DATA = "https://qyapi.weixin.qq.com/cgi-bin/externalcontact/get_user_behavior_data";
+
+    String POST_WE_COM_USER_GROUP_CHAT_STATISTIC = "https://qyapi.weixin.qq.com/cgi-bin/externalcontact/groupchat/statistic_group_by_day";
+
 }

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

@@ -0,0 +1,35 @@
+package com.tzld.piaoquan.growth.common.dao.mapper;
+
+import com.tzld.piaoquan.growth.common.model.po.StaffGroupStatisticsTotal;
+import com.tzld.piaoquan.growth.common.model.po.StaffGroupStatisticsTotalExample;
+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 StaffGroupStatisticsTotalMapper {
+    long countByExample(StaffGroupStatisticsTotalExample example);
+
+    int deleteByExample(StaffGroupStatisticsTotalExample example);
+
+    int deleteByPrimaryKey(Long id);
+
+    int insert(StaffGroupStatisticsTotal record);
+
+    int insertSelective(StaffGroupStatisticsTotal record);
+
+    List<StaffGroupStatisticsTotal> selectByExample(StaffGroupStatisticsTotalExample example);
+
+    StaffGroupStatisticsTotal selectByPrimaryKey(Long id);
+
+    int updateByExampleSelective(@Param("record") StaffGroupStatisticsTotal record, @Param("example") StaffGroupStatisticsTotalExample example);
+
+    int updateByExample(@Param("record") StaffGroupStatisticsTotal record, @Param("example") StaffGroupStatisticsTotalExample example);
+
+    int updateByPrimaryKeySelective(StaffGroupStatisticsTotal record);
+
+    int updateByPrimaryKey(StaffGroupStatisticsTotal record);
+}

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

@@ -0,0 +1,180 @@
+package com.tzld.piaoquan.growth.common.model.po;
+
+import java.util.Date;
+
+public class StaffGroupStatisticsTotal {
+    private Long id;
+
+    private String date;
+
+    private Long corpId;
+
+    private Long staffId;
+
+    private Long statTime;
+
+    private Integer newChatCnt;
+
+    private Integer chatTotal;
+
+    private Integer chatHasMsg;
+
+    private Integer newMemberCnt;
+
+    private Integer memberTotal;
+
+    private Integer memberHasMsg;
+
+    private Integer msgTotal;
+
+    private Integer migrateTraineeChatCnt;
+
+    private Date createTime;
+
+    private Date updateTime;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getDate() {
+        return date;
+    }
+
+    public void setDate(String date) {
+        this.date = date;
+    }
+
+    public Long getCorpId() {
+        return corpId;
+    }
+
+    public void setCorpId(Long corpId) {
+        this.corpId = corpId;
+    }
+
+    public Long getStaffId() {
+        return staffId;
+    }
+
+    public void setStaffId(Long staffId) {
+        this.staffId = staffId;
+    }
+
+    public Long getStatTime() {
+        return statTime;
+    }
+
+    public void setStatTime(Long statTime) {
+        this.statTime = statTime;
+    }
+
+    public Integer getNewChatCnt() {
+        return newChatCnt;
+    }
+
+    public void setNewChatCnt(Integer newChatCnt) {
+        this.newChatCnt = newChatCnt;
+    }
+
+    public Integer getChatTotal() {
+        return chatTotal;
+    }
+
+    public void setChatTotal(Integer chatTotal) {
+        this.chatTotal = chatTotal;
+    }
+
+    public Integer getChatHasMsg() {
+        return chatHasMsg;
+    }
+
+    public void setChatHasMsg(Integer chatHasMsg) {
+        this.chatHasMsg = chatHasMsg;
+    }
+
+    public Integer getNewMemberCnt() {
+        return newMemberCnt;
+    }
+
+    public void setNewMemberCnt(Integer newMemberCnt) {
+        this.newMemberCnt = newMemberCnt;
+    }
+
+    public Integer getMemberTotal() {
+        return memberTotal;
+    }
+
+    public void setMemberTotal(Integer memberTotal) {
+        this.memberTotal = memberTotal;
+    }
+
+    public Integer getMemberHasMsg() {
+        return memberHasMsg;
+    }
+
+    public void setMemberHasMsg(Integer memberHasMsg) {
+        this.memberHasMsg = memberHasMsg;
+    }
+
+    public Integer getMsgTotal() {
+        return msgTotal;
+    }
+
+    public void setMsgTotal(Integer msgTotal) {
+        this.msgTotal = msgTotal;
+    }
+
+    public Integer getMigrateTraineeChatCnt() {
+        return migrateTraineeChatCnt;
+    }
+
+    public void setMigrateTraineeChatCnt(Integer migrateTraineeChatCnt) {
+        this.migrateTraineeChatCnt = migrateTraineeChatCnt;
+    }
+
+    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(", date=").append(date);
+        sb.append(", corpId=").append(corpId);
+        sb.append(", staffId=").append(staffId);
+        sb.append(", statTime=").append(statTime);
+        sb.append(", newChatCnt=").append(newChatCnt);
+        sb.append(", chatTotal=").append(chatTotal);
+        sb.append(", chatHasMsg=").append(chatHasMsg);
+        sb.append(", newMemberCnt=").append(newMemberCnt);
+        sb.append(", memberTotal=").append(memberTotal);
+        sb.append(", memberHasMsg=").append(memberHasMsg);
+        sb.append(", msgTotal=").append(msgTotal);
+        sb.append(", migrateTraineeChatCnt=").append(migrateTraineeChatCnt);
+        sb.append(", createTime=").append(createTime);
+        sb.append(", updateTime=").append(updateTime);
+        sb.append("]");
+        return sb.toString();
+    }
+}

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

@@ -0,0 +1,1122 @@
+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 StaffGroupStatisticsTotalExample {
+    protected String orderByClause;
+
+    protected boolean distinct;
+
+    protected List<Criteria> oredCriteria;
+
+    protected Page page;
+
+    public StaffGroupStatisticsTotalExample() {
+        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 andDateIsNull() {
+            addCriterion("`date` is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andDateIsNotNull() {
+            addCriterion("`date` is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andDateEqualTo(String value) {
+            addCriterion("`date` =", value, "date");
+            return (Criteria) this;
+        }
+
+        public Criteria andDateNotEqualTo(String value) {
+            addCriterion("`date` <>", value, "date");
+            return (Criteria) this;
+        }
+
+        public Criteria andDateGreaterThan(String value) {
+            addCriterion("`date` >", value, "date");
+            return (Criteria) this;
+        }
+
+        public Criteria andDateGreaterThanOrEqualTo(String value) {
+            addCriterion("`date` >=", value, "date");
+            return (Criteria) this;
+        }
+
+        public Criteria andDateLessThan(String value) {
+            addCriterion("`date` <", value, "date");
+            return (Criteria) this;
+        }
+
+        public Criteria andDateLessThanOrEqualTo(String value) {
+            addCriterion("`date` <=", value, "date");
+            return (Criteria) this;
+        }
+
+        public Criteria andDateLike(String value) {
+            addCriterion("`date` like", value, "date");
+            return (Criteria) this;
+        }
+
+        public Criteria andDateNotLike(String value) {
+            addCriterion("`date` not like", value, "date");
+            return (Criteria) this;
+        }
+
+        public Criteria andDateIn(List<String> values) {
+            addCriterion("`date` in", values, "date");
+            return (Criteria) this;
+        }
+
+        public Criteria andDateNotIn(List<String> values) {
+            addCriterion("`date` not in", values, "date");
+            return (Criteria) this;
+        }
+
+        public Criteria andDateBetween(String value1, String value2) {
+            addCriterion("`date` between", value1, value2, "date");
+            return (Criteria) this;
+        }
+
+        public Criteria andDateNotBetween(String value1, String value2) {
+            addCriterion("`date` not between", value1, value2, "date");
+            return (Criteria) this;
+        }
+
+        public Criteria andCorpIdIsNull() {
+            addCriterion("corp_id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCorpIdIsNotNull() {
+            addCriterion("corp_id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCorpIdEqualTo(Long value) {
+            addCriterion("corp_id =", value, "corpId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCorpIdNotEqualTo(Long value) {
+            addCriterion("corp_id <>", value, "corpId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCorpIdGreaterThan(Long value) {
+            addCriterion("corp_id >", value, "corpId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCorpIdGreaterThanOrEqualTo(Long value) {
+            addCriterion("corp_id >=", value, "corpId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCorpIdLessThan(Long value) {
+            addCriterion("corp_id <", value, "corpId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCorpIdLessThanOrEqualTo(Long value) {
+            addCriterion("corp_id <=", value, "corpId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCorpIdIn(List<Long> values) {
+            addCriterion("corp_id in", values, "corpId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCorpIdNotIn(List<Long> values) {
+            addCriterion("corp_id not in", values, "corpId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCorpIdBetween(Long value1, Long value2) {
+            addCriterion("corp_id between", value1, value2, "corpId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCorpIdNotBetween(Long value1, Long value2) {
+            addCriterion("corp_id not between", value1, value2, "corpId");
+            return (Criteria) this;
+        }
+
+        public Criteria andStaffIdIsNull() {
+            addCriterion("staff_id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andStaffIdIsNotNull() {
+            addCriterion("staff_id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andStaffIdEqualTo(Long value) {
+            addCriterion("staff_id =", value, "staffId");
+            return (Criteria) this;
+        }
+
+        public Criteria andStaffIdNotEqualTo(Long value) {
+            addCriterion("staff_id <>", value, "staffId");
+            return (Criteria) this;
+        }
+
+        public Criteria andStaffIdGreaterThan(Long value) {
+            addCriterion("staff_id >", value, "staffId");
+            return (Criteria) this;
+        }
+
+        public Criteria andStaffIdGreaterThanOrEqualTo(Long value) {
+            addCriterion("staff_id >=", value, "staffId");
+            return (Criteria) this;
+        }
+
+        public Criteria andStaffIdLessThan(Long value) {
+            addCriterion("staff_id <", value, "staffId");
+            return (Criteria) this;
+        }
+
+        public Criteria andStaffIdLessThanOrEqualTo(Long value) {
+            addCriterion("staff_id <=", value, "staffId");
+            return (Criteria) this;
+        }
+
+        public Criteria andStaffIdIn(List<Long> values) {
+            addCriterion("staff_id in", values, "staffId");
+            return (Criteria) this;
+        }
+
+        public Criteria andStaffIdNotIn(List<Long> values) {
+            addCriterion("staff_id not in", values, "staffId");
+            return (Criteria) this;
+        }
+
+        public Criteria andStaffIdBetween(Long value1, Long value2) {
+            addCriterion("staff_id between", value1, value2, "staffId");
+            return (Criteria) this;
+        }
+
+        public Criteria andStaffIdNotBetween(Long value1, Long value2) {
+            addCriterion("staff_id not between", value1, value2, "staffId");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatTimeIsNull() {
+            addCriterion("stat_time is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatTimeIsNotNull() {
+            addCriterion("stat_time is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatTimeEqualTo(Long value) {
+            addCriterion("stat_time =", value, "statTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatTimeNotEqualTo(Long value) {
+            addCriterion("stat_time <>", value, "statTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatTimeGreaterThan(Long value) {
+            addCriterion("stat_time >", value, "statTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatTimeGreaterThanOrEqualTo(Long value) {
+            addCriterion("stat_time >=", value, "statTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatTimeLessThan(Long value) {
+            addCriterion("stat_time <", value, "statTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatTimeLessThanOrEqualTo(Long value) {
+            addCriterion("stat_time <=", value, "statTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatTimeIn(List<Long> values) {
+            addCriterion("stat_time in", values, "statTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatTimeNotIn(List<Long> values) {
+            addCriterion("stat_time not in", values, "statTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatTimeBetween(Long value1, Long value2) {
+            addCriterion("stat_time between", value1, value2, "statTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatTimeNotBetween(Long value1, Long value2) {
+            addCriterion("stat_time not between", value1, value2, "statTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andNewChatCntIsNull() {
+            addCriterion("new_chat_cnt is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andNewChatCntIsNotNull() {
+            addCriterion("new_chat_cnt is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andNewChatCntEqualTo(Integer value) {
+            addCriterion("new_chat_cnt =", value, "newChatCnt");
+            return (Criteria) this;
+        }
+
+        public Criteria andNewChatCntNotEqualTo(Integer value) {
+            addCriterion("new_chat_cnt <>", value, "newChatCnt");
+            return (Criteria) this;
+        }
+
+        public Criteria andNewChatCntGreaterThan(Integer value) {
+            addCriterion("new_chat_cnt >", value, "newChatCnt");
+            return (Criteria) this;
+        }
+
+        public Criteria andNewChatCntGreaterThanOrEqualTo(Integer value) {
+            addCriterion("new_chat_cnt >=", value, "newChatCnt");
+            return (Criteria) this;
+        }
+
+        public Criteria andNewChatCntLessThan(Integer value) {
+            addCriterion("new_chat_cnt <", value, "newChatCnt");
+            return (Criteria) this;
+        }
+
+        public Criteria andNewChatCntLessThanOrEqualTo(Integer value) {
+            addCriterion("new_chat_cnt <=", value, "newChatCnt");
+            return (Criteria) this;
+        }
+
+        public Criteria andNewChatCntIn(List<Integer> values) {
+            addCriterion("new_chat_cnt in", values, "newChatCnt");
+            return (Criteria) this;
+        }
+
+        public Criteria andNewChatCntNotIn(List<Integer> values) {
+            addCriterion("new_chat_cnt not in", values, "newChatCnt");
+            return (Criteria) this;
+        }
+
+        public Criteria andNewChatCntBetween(Integer value1, Integer value2) {
+            addCriterion("new_chat_cnt between", value1, value2, "newChatCnt");
+            return (Criteria) this;
+        }
+
+        public Criteria andNewChatCntNotBetween(Integer value1, Integer value2) {
+            addCriterion("new_chat_cnt not between", value1, value2, "newChatCnt");
+            return (Criteria) this;
+        }
+
+        public Criteria andChatTotalIsNull() {
+            addCriterion("chat_total is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andChatTotalIsNotNull() {
+            addCriterion("chat_total is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andChatTotalEqualTo(Integer value) {
+            addCriterion("chat_total =", value, "chatTotal");
+            return (Criteria) this;
+        }
+
+        public Criteria andChatTotalNotEqualTo(Integer value) {
+            addCriterion("chat_total <>", value, "chatTotal");
+            return (Criteria) this;
+        }
+
+        public Criteria andChatTotalGreaterThan(Integer value) {
+            addCriterion("chat_total >", value, "chatTotal");
+            return (Criteria) this;
+        }
+
+        public Criteria andChatTotalGreaterThanOrEqualTo(Integer value) {
+            addCriterion("chat_total >=", value, "chatTotal");
+            return (Criteria) this;
+        }
+
+        public Criteria andChatTotalLessThan(Integer value) {
+            addCriterion("chat_total <", value, "chatTotal");
+            return (Criteria) this;
+        }
+
+        public Criteria andChatTotalLessThanOrEqualTo(Integer value) {
+            addCriterion("chat_total <=", value, "chatTotal");
+            return (Criteria) this;
+        }
+
+        public Criteria andChatTotalIn(List<Integer> values) {
+            addCriterion("chat_total in", values, "chatTotal");
+            return (Criteria) this;
+        }
+
+        public Criteria andChatTotalNotIn(List<Integer> values) {
+            addCriterion("chat_total not in", values, "chatTotal");
+            return (Criteria) this;
+        }
+
+        public Criteria andChatTotalBetween(Integer value1, Integer value2) {
+            addCriterion("chat_total between", value1, value2, "chatTotal");
+            return (Criteria) this;
+        }
+
+        public Criteria andChatTotalNotBetween(Integer value1, Integer value2) {
+            addCriterion("chat_total not between", value1, value2, "chatTotal");
+            return (Criteria) this;
+        }
+
+        public Criteria andChatHasMsgIsNull() {
+            addCriterion("chat_has_msg is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andChatHasMsgIsNotNull() {
+            addCriterion("chat_has_msg is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andChatHasMsgEqualTo(Integer value) {
+            addCriterion("chat_has_msg =", value, "chatHasMsg");
+            return (Criteria) this;
+        }
+
+        public Criteria andChatHasMsgNotEqualTo(Integer value) {
+            addCriterion("chat_has_msg <>", value, "chatHasMsg");
+            return (Criteria) this;
+        }
+
+        public Criteria andChatHasMsgGreaterThan(Integer value) {
+            addCriterion("chat_has_msg >", value, "chatHasMsg");
+            return (Criteria) this;
+        }
+
+        public Criteria andChatHasMsgGreaterThanOrEqualTo(Integer value) {
+            addCriterion("chat_has_msg >=", value, "chatHasMsg");
+            return (Criteria) this;
+        }
+
+        public Criteria andChatHasMsgLessThan(Integer value) {
+            addCriterion("chat_has_msg <", value, "chatHasMsg");
+            return (Criteria) this;
+        }
+
+        public Criteria andChatHasMsgLessThanOrEqualTo(Integer value) {
+            addCriterion("chat_has_msg <=", value, "chatHasMsg");
+            return (Criteria) this;
+        }
+
+        public Criteria andChatHasMsgIn(List<Integer> values) {
+            addCriterion("chat_has_msg in", values, "chatHasMsg");
+            return (Criteria) this;
+        }
+
+        public Criteria andChatHasMsgNotIn(List<Integer> values) {
+            addCriterion("chat_has_msg not in", values, "chatHasMsg");
+            return (Criteria) this;
+        }
+
+        public Criteria andChatHasMsgBetween(Integer value1, Integer value2) {
+            addCriterion("chat_has_msg between", value1, value2, "chatHasMsg");
+            return (Criteria) this;
+        }
+
+        public Criteria andChatHasMsgNotBetween(Integer value1, Integer value2) {
+            addCriterion("chat_has_msg not between", value1, value2, "chatHasMsg");
+            return (Criteria) this;
+        }
+
+        public Criteria andNewMemberCntIsNull() {
+            addCriterion("new_member_cnt is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andNewMemberCntIsNotNull() {
+            addCriterion("new_member_cnt is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andNewMemberCntEqualTo(Integer value) {
+            addCriterion("new_member_cnt =", value, "newMemberCnt");
+            return (Criteria) this;
+        }
+
+        public Criteria andNewMemberCntNotEqualTo(Integer value) {
+            addCriterion("new_member_cnt <>", value, "newMemberCnt");
+            return (Criteria) this;
+        }
+
+        public Criteria andNewMemberCntGreaterThan(Integer value) {
+            addCriterion("new_member_cnt >", value, "newMemberCnt");
+            return (Criteria) this;
+        }
+
+        public Criteria andNewMemberCntGreaterThanOrEqualTo(Integer value) {
+            addCriterion("new_member_cnt >=", value, "newMemberCnt");
+            return (Criteria) this;
+        }
+
+        public Criteria andNewMemberCntLessThan(Integer value) {
+            addCriterion("new_member_cnt <", value, "newMemberCnt");
+            return (Criteria) this;
+        }
+
+        public Criteria andNewMemberCntLessThanOrEqualTo(Integer value) {
+            addCriterion("new_member_cnt <=", value, "newMemberCnt");
+            return (Criteria) this;
+        }
+
+        public Criteria andNewMemberCntIn(List<Integer> values) {
+            addCriterion("new_member_cnt in", values, "newMemberCnt");
+            return (Criteria) this;
+        }
+
+        public Criteria andNewMemberCntNotIn(List<Integer> values) {
+            addCriterion("new_member_cnt not in", values, "newMemberCnt");
+            return (Criteria) this;
+        }
+
+        public Criteria andNewMemberCntBetween(Integer value1, Integer value2) {
+            addCriterion("new_member_cnt between", value1, value2, "newMemberCnt");
+            return (Criteria) this;
+        }
+
+        public Criteria andNewMemberCntNotBetween(Integer value1, Integer value2) {
+            addCriterion("new_member_cnt not between", value1, value2, "newMemberCnt");
+            return (Criteria) this;
+        }
+
+        public Criteria andMemberTotalIsNull() {
+            addCriterion("member_total is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andMemberTotalIsNotNull() {
+            addCriterion("member_total is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andMemberTotalEqualTo(Integer value) {
+            addCriterion("member_total =", value, "memberTotal");
+            return (Criteria) this;
+        }
+
+        public Criteria andMemberTotalNotEqualTo(Integer value) {
+            addCriterion("member_total <>", value, "memberTotal");
+            return (Criteria) this;
+        }
+
+        public Criteria andMemberTotalGreaterThan(Integer value) {
+            addCriterion("member_total >", value, "memberTotal");
+            return (Criteria) this;
+        }
+
+        public Criteria andMemberTotalGreaterThanOrEqualTo(Integer value) {
+            addCriterion("member_total >=", value, "memberTotal");
+            return (Criteria) this;
+        }
+
+        public Criteria andMemberTotalLessThan(Integer value) {
+            addCriterion("member_total <", value, "memberTotal");
+            return (Criteria) this;
+        }
+
+        public Criteria andMemberTotalLessThanOrEqualTo(Integer value) {
+            addCriterion("member_total <=", value, "memberTotal");
+            return (Criteria) this;
+        }
+
+        public Criteria andMemberTotalIn(List<Integer> values) {
+            addCriterion("member_total in", values, "memberTotal");
+            return (Criteria) this;
+        }
+
+        public Criteria andMemberTotalNotIn(List<Integer> values) {
+            addCriterion("member_total not in", values, "memberTotal");
+            return (Criteria) this;
+        }
+
+        public Criteria andMemberTotalBetween(Integer value1, Integer value2) {
+            addCriterion("member_total between", value1, value2, "memberTotal");
+            return (Criteria) this;
+        }
+
+        public Criteria andMemberTotalNotBetween(Integer value1, Integer value2) {
+            addCriterion("member_total not between", value1, value2, "memberTotal");
+            return (Criteria) this;
+        }
+
+        public Criteria andMemberHasMsgIsNull() {
+            addCriterion("member_has_msg is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andMemberHasMsgIsNotNull() {
+            addCriterion("member_has_msg is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andMemberHasMsgEqualTo(Integer value) {
+            addCriterion("member_has_msg =", value, "memberHasMsg");
+            return (Criteria) this;
+        }
+
+        public Criteria andMemberHasMsgNotEqualTo(Integer value) {
+            addCriterion("member_has_msg <>", value, "memberHasMsg");
+            return (Criteria) this;
+        }
+
+        public Criteria andMemberHasMsgGreaterThan(Integer value) {
+            addCriterion("member_has_msg >", value, "memberHasMsg");
+            return (Criteria) this;
+        }
+
+        public Criteria andMemberHasMsgGreaterThanOrEqualTo(Integer value) {
+            addCriterion("member_has_msg >=", value, "memberHasMsg");
+            return (Criteria) this;
+        }
+
+        public Criteria andMemberHasMsgLessThan(Integer value) {
+            addCriterion("member_has_msg <", value, "memberHasMsg");
+            return (Criteria) this;
+        }
+
+        public Criteria andMemberHasMsgLessThanOrEqualTo(Integer value) {
+            addCriterion("member_has_msg <=", value, "memberHasMsg");
+            return (Criteria) this;
+        }
+
+        public Criteria andMemberHasMsgIn(List<Integer> values) {
+            addCriterion("member_has_msg in", values, "memberHasMsg");
+            return (Criteria) this;
+        }
+
+        public Criteria andMemberHasMsgNotIn(List<Integer> values) {
+            addCriterion("member_has_msg not in", values, "memberHasMsg");
+            return (Criteria) this;
+        }
+
+        public Criteria andMemberHasMsgBetween(Integer value1, Integer value2) {
+            addCriterion("member_has_msg between", value1, value2, "memberHasMsg");
+            return (Criteria) this;
+        }
+
+        public Criteria andMemberHasMsgNotBetween(Integer value1, Integer value2) {
+            addCriterion("member_has_msg not between", value1, value2, "memberHasMsg");
+            return (Criteria) this;
+        }
+
+        public Criteria andMsgTotalIsNull() {
+            addCriterion("msg_total is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andMsgTotalIsNotNull() {
+            addCriterion("msg_total is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andMsgTotalEqualTo(Integer value) {
+            addCriterion("msg_total =", value, "msgTotal");
+            return (Criteria) this;
+        }
+
+        public Criteria andMsgTotalNotEqualTo(Integer value) {
+            addCriterion("msg_total <>", value, "msgTotal");
+            return (Criteria) this;
+        }
+
+        public Criteria andMsgTotalGreaterThan(Integer value) {
+            addCriterion("msg_total >", value, "msgTotal");
+            return (Criteria) this;
+        }
+
+        public Criteria andMsgTotalGreaterThanOrEqualTo(Integer value) {
+            addCriterion("msg_total >=", value, "msgTotal");
+            return (Criteria) this;
+        }
+
+        public Criteria andMsgTotalLessThan(Integer value) {
+            addCriterion("msg_total <", value, "msgTotal");
+            return (Criteria) this;
+        }
+
+        public Criteria andMsgTotalLessThanOrEqualTo(Integer value) {
+            addCriterion("msg_total <=", value, "msgTotal");
+            return (Criteria) this;
+        }
+
+        public Criteria andMsgTotalIn(List<Integer> values) {
+            addCriterion("msg_total in", values, "msgTotal");
+            return (Criteria) this;
+        }
+
+        public Criteria andMsgTotalNotIn(List<Integer> values) {
+            addCriterion("msg_total not in", values, "msgTotal");
+            return (Criteria) this;
+        }
+
+        public Criteria andMsgTotalBetween(Integer value1, Integer value2) {
+            addCriterion("msg_total between", value1, value2, "msgTotal");
+            return (Criteria) this;
+        }
+
+        public Criteria andMsgTotalNotBetween(Integer value1, Integer value2) {
+            addCriterion("msg_total not between", value1, value2, "msgTotal");
+            return (Criteria) this;
+        }
+
+        public Criteria andMigrateTraineeChatCntIsNull() {
+            addCriterion("migrate_trainee_chat_cnt is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andMigrateTraineeChatCntIsNotNull() {
+            addCriterion("migrate_trainee_chat_cnt is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andMigrateTraineeChatCntEqualTo(Integer value) {
+            addCriterion("migrate_trainee_chat_cnt =", value, "migrateTraineeChatCnt");
+            return (Criteria) this;
+        }
+
+        public Criteria andMigrateTraineeChatCntNotEqualTo(Integer value) {
+            addCriterion("migrate_trainee_chat_cnt <>", value, "migrateTraineeChatCnt");
+            return (Criteria) this;
+        }
+
+        public Criteria andMigrateTraineeChatCntGreaterThan(Integer value) {
+            addCriterion("migrate_trainee_chat_cnt >", value, "migrateTraineeChatCnt");
+            return (Criteria) this;
+        }
+
+        public Criteria andMigrateTraineeChatCntGreaterThanOrEqualTo(Integer value) {
+            addCriterion("migrate_trainee_chat_cnt >=", value, "migrateTraineeChatCnt");
+            return (Criteria) this;
+        }
+
+        public Criteria andMigrateTraineeChatCntLessThan(Integer value) {
+            addCriterion("migrate_trainee_chat_cnt <", value, "migrateTraineeChatCnt");
+            return (Criteria) this;
+        }
+
+        public Criteria andMigrateTraineeChatCntLessThanOrEqualTo(Integer value) {
+            addCriterion("migrate_trainee_chat_cnt <=", value, "migrateTraineeChatCnt");
+            return (Criteria) this;
+        }
+
+        public Criteria andMigrateTraineeChatCntIn(List<Integer> values) {
+            addCriterion("migrate_trainee_chat_cnt in", values, "migrateTraineeChatCnt");
+            return (Criteria) this;
+        }
+
+        public Criteria andMigrateTraineeChatCntNotIn(List<Integer> values) {
+            addCriterion("migrate_trainee_chat_cnt not in", values, "migrateTraineeChatCnt");
+            return (Criteria) this;
+        }
+
+        public Criteria andMigrateTraineeChatCntBetween(Integer value1, Integer value2) {
+            addCriterion("migrate_trainee_chat_cnt between", value1, value2, "migrateTraineeChatCnt");
+            return (Criteria) this;
+        }
+
+        public Criteria andMigrateTraineeChatCntNotBetween(Integer value1, Integer value2) {
+            addCriterion("migrate_trainee_chat_cnt not between", value1, value2, "migrateTraineeChatCnt");
+            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);
+        }
+    }
+}

+ 374 - 0
common-module/src/main/resources/mapper/StaffGroupStatisticsTotalMapper.xml

@@ -0,0 +1,374 @@
+<?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.StaffGroupStatisticsTotalMapper">
+  <resultMap id="BaseResultMap" type="com.tzld.piaoquan.growth.common.model.po.StaffGroupStatisticsTotal">
+    <id column="id" jdbcType="BIGINT" property="id" />
+    <result column="date" jdbcType="VARCHAR" property="date" />
+    <result column="corp_id" jdbcType="BIGINT" property="corpId" />
+    <result column="staff_id" jdbcType="BIGINT" property="staffId" />
+    <result column="stat_time" jdbcType="BIGINT" property="statTime" />
+    <result column="new_chat_cnt" jdbcType="INTEGER" property="newChatCnt" />
+    <result column="chat_total" jdbcType="INTEGER" property="chatTotal" />
+    <result column="chat_has_msg" jdbcType="INTEGER" property="chatHasMsg" />
+    <result column="new_member_cnt" jdbcType="INTEGER" property="newMemberCnt" />
+    <result column="member_total" jdbcType="INTEGER" property="memberTotal" />
+    <result column="member_has_msg" jdbcType="INTEGER" property="memberHasMsg" />
+    <result column="msg_total" jdbcType="INTEGER" property="msgTotal" />
+    <result column="migrate_trainee_chat_cnt" jdbcType="INTEGER" property="migrateTraineeChatCnt" />
+    <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, `date`, corp_id, staff_id, stat_time, new_chat_cnt, chat_total, chat_has_msg, 
+    new_member_cnt, member_total, member_has_msg, msg_total, migrate_trainee_chat_cnt, 
+    create_time, update_time
+  </sql>
+  <select id="selectByExample" parameterType="com.tzld.piaoquan.growth.common.model.po.StaffGroupStatisticsTotalExample" resultMap="BaseResultMap">
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from we_com_staff_group_statistics_total
+    <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_staff_group_statistics_total
+    where id = #{id,jdbcType=BIGINT}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+    delete from we_com_staff_group_statistics_total
+    where id = #{id,jdbcType=BIGINT}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.tzld.piaoquan.growth.common.model.po.StaffGroupStatisticsTotalExample">
+    delete from we_com_staff_group_statistics_total
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.tzld.piaoquan.growth.common.model.po.StaffGroupStatisticsTotal">
+    insert into we_com_staff_group_statistics_total (id, `date`, corp_id, 
+      staff_id, stat_time, new_chat_cnt, 
+      chat_total, chat_has_msg, new_member_cnt, 
+      member_total, member_has_msg, msg_total, 
+      migrate_trainee_chat_cnt, create_time, update_time
+      )
+    values (#{id,jdbcType=BIGINT}, #{date,jdbcType=VARCHAR}, #{corpId,jdbcType=BIGINT}, 
+      #{staffId,jdbcType=BIGINT}, #{statTime,jdbcType=BIGINT}, #{newChatCnt,jdbcType=INTEGER}, 
+      #{chatTotal,jdbcType=INTEGER}, #{chatHasMsg,jdbcType=INTEGER}, #{newMemberCnt,jdbcType=INTEGER}, 
+      #{memberTotal,jdbcType=INTEGER}, #{memberHasMsg,jdbcType=INTEGER}, #{msgTotal,jdbcType=INTEGER}, 
+      #{migrateTraineeChatCnt,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
+      )
+  </insert>
+  <insert id="insertSelective" parameterType="com.tzld.piaoquan.growth.common.model.po.StaffGroupStatisticsTotal">
+    insert into we_com_staff_group_statistics_total
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="date != null">
+        `date`,
+      </if>
+      <if test="corpId != null">
+        corp_id,
+      </if>
+      <if test="staffId != null">
+        staff_id,
+      </if>
+      <if test="statTime != null">
+        stat_time,
+      </if>
+      <if test="newChatCnt != null">
+        new_chat_cnt,
+      </if>
+      <if test="chatTotal != null">
+        chat_total,
+      </if>
+      <if test="chatHasMsg != null">
+        chat_has_msg,
+      </if>
+      <if test="newMemberCnt != null">
+        new_member_cnt,
+      </if>
+      <if test="memberTotal != null">
+        member_total,
+      </if>
+      <if test="memberHasMsg != null">
+        member_has_msg,
+      </if>
+      <if test="msgTotal != null">
+        msg_total,
+      </if>
+      <if test="migrateTraineeChatCnt != null">
+        migrate_trainee_chat_cnt,
+      </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="date != null">
+        #{date,jdbcType=VARCHAR},
+      </if>
+      <if test="corpId != null">
+        #{corpId,jdbcType=BIGINT},
+      </if>
+      <if test="staffId != null">
+        #{staffId,jdbcType=BIGINT},
+      </if>
+      <if test="statTime != null">
+        #{statTime,jdbcType=BIGINT},
+      </if>
+      <if test="newChatCnt != null">
+        #{newChatCnt,jdbcType=INTEGER},
+      </if>
+      <if test="chatTotal != null">
+        #{chatTotal,jdbcType=INTEGER},
+      </if>
+      <if test="chatHasMsg != null">
+        #{chatHasMsg,jdbcType=INTEGER},
+      </if>
+      <if test="newMemberCnt != null">
+        #{newMemberCnt,jdbcType=INTEGER},
+      </if>
+      <if test="memberTotal != null">
+        #{memberTotal,jdbcType=INTEGER},
+      </if>
+      <if test="memberHasMsg != null">
+        #{memberHasMsg,jdbcType=INTEGER},
+      </if>
+      <if test="msgTotal != null">
+        #{msgTotal,jdbcType=INTEGER},
+      </if>
+      <if test="migrateTraineeChatCnt != null">
+        #{migrateTraineeChatCnt,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.StaffGroupStatisticsTotalExample" resultType="java.lang.Long">
+    select count(*) from we_com_staff_group_statistics_total
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map">
+    update we_com_staff_group_statistics_total
+    <set>
+      <if test="record.id != null">
+        id = #{record.id,jdbcType=BIGINT},
+      </if>
+      <if test="record.date != null">
+        `date` = #{record.date,jdbcType=VARCHAR},
+      </if>
+      <if test="record.corpId != null">
+        corp_id = #{record.corpId,jdbcType=BIGINT},
+      </if>
+      <if test="record.staffId != null">
+        staff_id = #{record.staffId,jdbcType=BIGINT},
+      </if>
+      <if test="record.statTime != null">
+        stat_time = #{record.statTime,jdbcType=BIGINT},
+      </if>
+      <if test="record.newChatCnt != null">
+        new_chat_cnt = #{record.newChatCnt,jdbcType=INTEGER},
+      </if>
+      <if test="record.chatTotal != null">
+        chat_total = #{record.chatTotal,jdbcType=INTEGER},
+      </if>
+      <if test="record.chatHasMsg != null">
+        chat_has_msg = #{record.chatHasMsg,jdbcType=INTEGER},
+      </if>
+      <if test="record.newMemberCnt != null">
+        new_member_cnt = #{record.newMemberCnt,jdbcType=INTEGER},
+      </if>
+      <if test="record.memberTotal != null">
+        member_total = #{record.memberTotal,jdbcType=INTEGER},
+      </if>
+      <if test="record.memberHasMsg != null">
+        member_has_msg = #{record.memberHasMsg,jdbcType=INTEGER},
+      </if>
+      <if test="record.msgTotal != null">
+        msg_total = #{record.msgTotal,jdbcType=INTEGER},
+      </if>
+      <if test="record.migrateTraineeChatCnt != null">
+        migrate_trainee_chat_cnt = #{record.migrateTraineeChatCnt,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_staff_group_statistics_total
+    set id = #{record.id,jdbcType=BIGINT},
+      `date` = #{record.date,jdbcType=VARCHAR},
+      corp_id = #{record.corpId,jdbcType=BIGINT},
+      staff_id = #{record.staffId,jdbcType=BIGINT},
+      stat_time = #{record.statTime,jdbcType=BIGINT},
+      new_chat_cnt = #{record.newChatCnt,jdbcType=INTEGER},
+      chat_total = #{record.chatTotal,jdbcType=INTEGER},
+      chat_has_msg = #{record.chatHasMsg,jdbcType=INTEGER},
+      new_member_cnt = #{record.newMemberCnt,jdbcType=INTEGER},
+      member_total = #{record.memberTotal,jdbcType=INTEGER},
+      member_has_msg = #{record.memberHasMsg,jdbcType=INTEGER},
+      msg_total = #{record.msgTotal,jdbcType=INTEGER},
+      migrate_trainee_chat_cnt = #{record.migrateTraineeChatCnt,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.StaffGroupStatisticsTotal">
+    update we_com_staff_group_statistics_total
+    <set>
+      <if test="date != null">
+        `date` = #{date,jdbcType=VARCHAR},
+      </if>
+      <if test="corpId != null">
+        corp_id = #{corpId,jdbcType=BIGINT},
+      </if>
+      <if test="staffId != null">
+        staff_id = #{staffId,jdbcType=BIGINT},
+      </if>
+      <if test="statTime != null">
+        stat_time = #{statTime,jdbcType=BIGINT},
+      </if>
+      <if test="newChatCnt != null">
+        new_chat_cnt = #{newChatCnt,jdbcType=INTEGER},
+      </if>
+      <if test="chatTotal != null">
+        chat_total = #{chatTotal,jdbcType=INTEGER},
+      </if>
+      <if test="chatHasMsg != null">
+        chat_has_msg = #{chatHasMsg,jdbcType=INTEGER},
+      </if>
+      <if test="newMemberCnt != null">
+        new_member_cnt = #{newMemberCnt,jdbcType=INTEGER},
+      </if>
+      <if test="memberTotal != null">
+        member_total = #{memberTotal,jdbcType=INTEGER},
+      </if>
+      <if test="memberHasMsg != null">
+        member_has_msg = #{memberHasMsg,jdbcType=INTEGER},
+      </if>
+      <if test="msgTotal != null">
+        msg_total = #{msgTotal,jdbcType=INTEGER},
+      </if>
+      <if test="migrateTraineeChatCnt != null">
+        migrate_trainee_chat_cnt = #{migrateTraineeChatCnt,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.StaffGroupStatisticsTotal">
+    update we_com_staff_group_statistics_total
+    set `date` = #{date,jdbcType=VARCHAR},
+      corp_id = #{corpId,jdbcType=BIGINT},
+      staff_id = #{staffId,jdbcType=BIGINT},
+      stat_time = #{statTime,jdbcType=BIGINT},
+      new_chat_cnt = #{newChatCnt,jdbcType=INTEGER},
+      chat_total = #{chatTotal,jdbcType=INTEGER},
+      chat_has_msg = #{chatHasMsg,jdbcType=INTEGER},
+      new_member_cnt = #{newMemberCnt,jdbcType=INTEGER},
+      member_total = #{memberTotal,jdbcType=INTEGER},
+      member_has_msg = #{memberHasMsg,jdbcType=INTEGER},
+      msg_total = #{msgTotal,jdbcType=INTEGER},
+      migrate_trainee_chat_cnt = #{migrateTraineeChatCnt,jdbcType=INTEGER},
+      create_time = #{createTime,jdbcType=TIMESTAMP},
+      update_time = #{updateTime,jdbcType=TIMESTAMP}
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+</mapper>

+ 58 - 4
offline-module/src/main/java/com/tzld/piaoquan/offline/job/WeComStaffDataJob.java

@@ -5,10 +5,7 @@ import com.alibaba.fastjson.JSONObject;
 import com.tzld.piaoquan.growth.common.common.enums.TimeEnum;
 import com.tzld.piaoquan.growth.common.component.HttpPoolClient;
 import com.tzld.piaoquan.growth.common.component.ProxyHttpPoolClient;
-import com.tzld.piaoquan.growth.common.dao.mapper.CorpMapper;
-import com.tzld.piaoquan.growth.common.dao.mapper.CorpStatisticsTotalMapper;
-import com.tzld.piaoquan.growth.common.dao.mapper.StaffMapper;
-import com.tzld.piaoquan.growth.common.dao.mapper.StaffStatisticsTotalMapper;
+import com.tzld.piaoquan.growth.common.dao.mapper.*;
 import com.tzld.piaoquan.growth.common.model.bo.XxlJobParam;
 import com.tzld.piaoquan.growth.common.model.po.*;
 import com.tzld.piaoquan.growth.common.service.WeComAccessTokenService;
@@ -54,6 +51,9 @@ public class WeComStaffDataJob {
     @Autowired
     private StaffStatisticsTotalMapper staffStatisticsTotalMapper;
 
+    @Autowired
+    private StaffGroupStatisticsTotalMapper staffGroupStatisticsTotalMapper;
+
     @Autowired
     private CorpStatisticsTotalMapper corpStatisticsTotalMapper;
 
@@ -130,6 +130,7 @@ public class WeComStaffDataJob {
         List<Staff> staffs = staffMapper.selectByExample(staffExample);
         for (Staff staff : staffs) {
             statisticsStaffTotal(staff, startTime, endTime, date);
+            statisticsStaffGroupTotal(staff, startTime, date);
         }
         StaffStatisticsTotalExample staffStatisticsTotalExample = new StaffStatisticsTotalExample();
         staffStatisticsTotalExample.createCriteria().andDateEqualTo(date);
@@ -230,4 +231,57 @@ public class WeComStaffDataJob {
         }
     }
 
+
+    private void statisticsStaffGroupTotal(Staff staff, long startTime, String date) throws IOException {
+        Long corpId = staff.getCorpId();
+        StaffGroupStatisticsTotalExample example = new StaffGroupStatisticsTotalExample();
+        example.createCriteria().andCorpIdEqualTo(corpId).andStaffIdEqualTo(staff.getId()).andDateEqualTo(date);
+        long l = staffGroupStatisticsTotalMapper.countByExample(example);
+        if (l > 0) {
+            return;
+        }
+        String accessToken = weComAccessTokenService.getWeComAccessToken(corpId);
+        String url = POST_WE_COM_USER_GROUP_CHAT_STATISTIC
+                + "?access_token=" + accessToken;
+        JSONObject params = new JSONObject();
+        params.put("day_begin_time", startTime);
+        JSONObject ownerFilter = new JSONObject();
+        JSONArray userIds = new JSONArray();
+        userIds.add(staff.getCarrierId());
+        ownerFilter.put("userid_list", userIds);
+        params.put("owner_filter", ownerFilter);
+        System.out.println(JSONObject.toJSONString(params));
+        String res;
+        if (staff.getCorpId() == 1L) {
+            res = httpPoolClient.post(url, params.toJSONString());
+        } else {
+            res = proxyHttpPoolClient.post(url, params.toJSONString());
+        }
+        if (StringUtils.isNotEmpty(res)) {
+            JSONObject jsonObject = JSONObject.parseObject(res);
+            System.out.println("jsonObject = " + jsonObject);
+            Integer errcode = jsonObject.getInteger("errcode");
+            if (errcode == 0) {
+                JSONArray jsonArray = jsonObject.getJSONArray("behavior_data");
+                if (!jsonArray.isEmpty()) {
+                    JSONObject data = jsonArray.getJSONObject(0);
+                    StaffGroupStatisticsTotal statisticsTotal = new StaffGroupStatisticsTotal();
+                    statisticsTotal.setStatTime(data.getLong("stat_time"));
+                    statisticsTotal.setNewChatCnt(data.getInteger("new_chat_cnt"));
+                    statisticsTotal.setChatTotal(data.getInteger("chat_total"));
+                    statisticsTotal.setChatHasMsg(data.getInteger("chat_has_msg"));
+                    statisticsTotal.setNewMemberCnt(data.getInteger("new_member_cnt"));
+                    statisticsTotal.setMemberTotal(data.getInteger("member_total"));
+                    statisticsTotal.setMemberHasMsg(data.getInteger("member_has_msg"));
+                    statisticsTotal.setMsgTotal(data.getInteger("msg_total"));
+                    statisticsTotal.setMigrateTraineeChatCnt(data.getInteger("migrate_trainee_chat_cnt"));
+                    statisticsTotal.setDate(date);
+                    statisticsTotal.setCorpId(corpId);
+                    statisticsTotal.setStaffId(staff.getId());
+                    staffGroupStatisticsTotalMapper.insertSelective(statisticsTotal);
+                }
+            }
+        }
+    }
+
 }