xueyiming 7 mesiacov pred
rodič
commit
7b98c1343f
18 zmenil súbory, kde vykonal 330 pridanie a 70 odobranie
  1. 34 0
      we-com-server/src/main/java/com/tzld/piaoquan/wecom/dao/generator/MybatisGeneratorMain.java
  2. 76 0
      we-com-server/src/main/java/com/tzld/piaoquan/wecom/dao/generator/PaginationPlugin.java
  3. 0 2
      we-com-server/src/main/java/com/tzld/piaoquan/wecom/dao/mapper/HistoryMessageMapper.java
  4. 0 1
      we-com-server/src/main/java/com/tzld/piaoquan/wecom/dao/mapper/MessageAttachmentMapper.java
  5. 1 1
      we-com-server/src/main/java/com/tzld/piaoquan/wecom/dao/mapper/UserMapper.java
  6. 0 2
      we-com-server/src/main/java/com/tzld/piaoquan/wecom/job/WeComHistoryDataJob.java
  7. 39 14
      we-com-server/src/main/java/com/tzld/piaoquan/wecom/job/WeComMessageDataJob.java
  8. 11 13
      we-com-server/src/main/java/com/tzld/piaoquan/wecom/model/po/HistoryMessageExample.java
  9. 0 1
      we-com-server/src/main/java/com/tzld/piaoquan/wecom/model/po/MessageAttachment.java
  10. 11 12
      we-com-server/src/main/java/com/tzld/piaoquan/wecom/model/po/MessageAttachmentExample.java
  11. 0 6
      we-com-server/src/main/java/com/tzld/piaoquan/wecom/model/po/User.java
  12. 11 13
      we-com-server/src/main/java/com/tzld/piaoquan/wecom/model/po/UserExample.java
  13. 0 1
      we-com-server/src/main/java/com/tzld/piaoquan/wecom/service/Impl/UserServiceImpl.java
  14. 28 0
      we-com-server/src/main/java/com/tzld/piaoquan/wecom/utils/DateUtil.java
  15. 108 0
      we-com-server/src/main/java/com/tzld/piaoquan/wecom/utils/page/Page.java
  16. 3 1
      we-com-server/src/main/resources/mapper/HistoryMessageMapper.xml
  17. 5 3
      we-com-server/src/main/resources/mapper/MessageAttachmentMapper.xml
  18. 3 0
      we-com-server/src/main/resources/mapper/UserMapper.xml

+ 34 - 0
we-com-server/src/main/java/com/tzld/piaoquan/wecom/dao/generator/MybatisGeneratorMain.java

@@ -0,0 +1,34 @@
+package com.tzld.piaoquan.wecom.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;
+
+/**
+ * @author ehlxr
+ * @since 2021-12-14 14:03.
+ */
+public class MybatisGeneratorMain {
+
+    public static void main(String[] args)
+            throws SQLException, IOException, InterruptedException, InvalidConfigurationException, XMLParserException {
+        List<String> warnings = new ArrayList<>();
+
+        File configFile = new File(MybatisGeneratorMain.class.getResource("/mybatis-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");
+    }
+}

+ 76 - 0
we-com-server/src/main/java/com/tzld/piaoquan/wecom/dao/generator/PaginationPlugin.java

@@ -0,0 +1,76 @@
+package com.tzld.piaoquan.wecom.dao.generator;
+
+import org.mybatis.generator.api.CommentGenerator;
+import org.mybatis.generator.api.IntrospectedTable;
+import org.mybatis.generator.api.PluginAdapter;
+import org.mybatis.generator.api.dom.java.*;
+import org.mybatis.generator.api.dom.xml.Attribute;
+import org.mybatis.generator.api.dom.xml.TextElement;
+import org.mybatis.generator.api.dom.xml.XmlElement;
+
+import java.util.List;
+
+public class PaginationPlugin extends PluginAdapter {
+
+    @Override
+    public boolean modelExampleClassGenerated(TopLevelClass topLevelClass, IntrospectedTable introspectedTable) {
+        addPage(topLevelClass, introspectedTable, "page");
+        return super.modelExampleClassGenerated(topLevelClass, introspectedTable);
+    }
+
+    @Override
+    public boolean sqlMapSelectByExampleWithoutBLOBsElementGenerated(XmlElement element, IntrospectedTable introspectedTable) {
+        XmlElement page = new XmlElement("if");
+        page.addAttribute(new Attribute("test", "page != null"));
+        page.addElement(new TextElement("limit #{page.offset} , #{page.pageSize}"));
+        element.addElement(page);
+        return super.sqlMapUpdateByExampleWithoutBLOBsElementGenerated(element, introspectedTable);
+    }
+
+    @Override
+    public boolean sqlMapSelectByExampleWithBLOBsElementGenerated(XmlElement element, IntrospectedTable introspectedTable) {
+        XmlElement page = new XmlElement("if");
+        page.addAttribute(new Attribute("test", "page != null"));
+        page.addElement(new TextElement("limit #{page.offset} , #{page.pageSize}"));
+        element.addElement(page);
+        return super.sqlMapSelectByExampleWithBLOBsElementGenerated(element, introspectedTable);
+    }
+
+    /**
+     * @param topLevelClass
+     * @param introspectedTable
+     * @param name
+     */
+    private void addPage(TopLevelClass topLevelClass, IntrospectedTable introspectedTable, String name) {
+        topLevelClass.addImportedType(new FullyQualifiedJavaType("com.tzld.piaoquan.wecom.utils.page.Page"));
+        CommentGenerator commentGenerator = context.getCommentGenerator();
+        Field field = new Field();
+        field.setVisibility(JavaVisibility.PROTECTED);
+        field.setType(new FullyQualifiedJavaType("com.tzld.piaoquan.wecom.utils.page.Page"));
+        field.setName(name);
+        commentGenerator.addFieldComment(field, introspectedTable);
+        topLevelClass.addField(field);
+        char c = name.charAt(0);
+        String camel = Character.toUpperCase(c) + name.substring(1);
+        Method method = new Method();
+        method.setVisibility(JavaVisibility.PUBLIC);
+        method.setName("set" + camel);
+        method.addParameter(new Parameter(new FullyQualifiedJavaType("com.tzld.piaoquan.wecom.utils.page.Page"), name));
+        method.addBodyLine("this." + name + "=" + name + ";");
+        commentGenerator.addGeneralMethodComment(method, introspectedTable);
+        topLevelClass.addMethod(method);
+        method = new Method();
+        method.setVisibility(JavaVisibility.PUBLIC);
+        method.setReturnType(new FullyQualifiedJavaType("com.tzld.piaoquan.wecom.utils.page.Page"));
+        method.setName("get" + camel);
+        method.addBodyLine("return " + name + ";");
+        commentGenerator.addGeneralMethodComment(method, introspectedTable);
+        topLevelClass.addMethod(method);
+    }
+
+    @Override
+    public boolean validate(List<String> arg0) {
+        return true;
+    }
+
+}

+ 0 - 2
we-com-server/src/main/java/com/tzld/piaoquan/wecom/dao/mapper/HistoryMessageMapper.java

@@ -3,14 +3,12 @@ package com.tzld.piaoquan.wecom.dao.mapper;
 import com.tzld.piaoquan.wecom.model.po.HistoryMessage;
 import com.tzld.piaoquan.wecom.model.po.HistoryMessageExample;
 import java.util.List;
-import java.util.Set;
 
 import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
 
 @Repository
 public interface HistoryMessageMapper {
-
     long countByExample(HistoryMessageExample example);
 
     int deleteByExample(HistoryMessageExample example);

+ 0 - 1
we-com-server/src/main/java/com/tzld/piaoquan/wecom/dao/mapper/MessageAttachmentMapper.java

@@ -8,7 +8,6 @@ import org.springframework.stereotype.Repository;
 
 @Repository
 public interface MessageAttachmentMapper {
-
     long countByExample(MessageAttachmentExample example);
 
     int deleteByExample(MessageAttachmentExample example);

+ 1 - 1
we-com-server/src/main/java/com/tzld/piaoquan/wecom/dao/mapper/UserMapper.java

@@ -33,5 +33,5 @@ public interface UserMapper {
 
     Long selectIdByExternalUserId3rdParty(String externalUserId3rdParty);
 
-    int insertList(@Param("list") List<User> list);
+    void insertList(@Param("list") List<User> list);
 }

+ 0 - 2
we-com-server/src/main/java/com/tzld/piaoquan/wecom/job/WeComHistoryDataJob.java

@@ -13,9 +13,7 @@ import com.tzld.piaoquan.wecom.service.MessageAttachmentService;
 import com.tzld.piaoquan.wecom.utils.HttpClientUtil;
 import com.tzld.piaoquan.wecom.utils.HttpPoolClient;
 import com.tzld.piaoquan.wecom.utils.MiniprogramUtil;
-import com.tzld.piaoquan.wecom.utils.URLUtil;
 import org.apache.commons.lang3.ObjectUtils;
-import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 import org.springframework.util.CollectionUtils;

+ 39 - 14
we-com-server/src/main/java/com/tzld/piaoquan/wecom/job/WeComMessageDataJob.java

@@ -1,10 +1,16 @@
 package com.tzld.piaoquan.wecom.job;
 
+import com.alibaba.fastjson.JSONObject;
 import com.aliyun.odps.data.Record;
 import com.tzld.piaoquan.wecom.common.constant.MiniprogramConstant;
+import com.tzld.piaoquan.wecom.dao.mapper.MessageAttachmentMapper;
 import com.tzld.piaoquan.wecom.dao.mapper.UserMapper;
 import com.tzld.piaoquan.wecom.model.bo.PushMessage;
+import com.tzld.piaoquan.wecom.model.po.MessageAttachment;
+import com.tzld.piaoquan.wecom.model.po.MessageAttachmentExample;
 import com.tzld.piaoquan.wecom.model.po.User;
+import com.tzld.piaoquan.wecom.model.po.UserExample;
+import com.tzld.piaoquan.wecom.utils.DateUtil;
 import com.tzld.piaoquan.wecom.utils.OdpsUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.redis.core.RedisTemplate;
@@ -17,10 +23,12 @@ import java.util.stream.Collectors;
 @Component
 public class WeComMessageDataJob {
 
-
     @Autowired
     private UserMapper userMapper;
 
+    @Autowired
+    private MessageAttachmentMapper messageAttachmentMapper;
+
     @Autowired
     private RedisTemplate<String, Object> redisTemplate;
 
@@ -29,8 +37,10 @@ public class WeComMessageDataJob {
     List<PushMessage> goodList = new ArrayList<>();
     List<Long> saveList = new ArrayList<>();
 
+    //初始化操作
     void init() {
-        List<Record> recordList = OdpsUtil.getOdpsData("SELECT * FROM loghubods.history_good_video_can_push_user_list where dt = 20240922;");
+        String sql = String.format("SELECT * FROM loghubods.history_good_video_can_push_user_list where dt = %s;", DateUtil.getBeforeDayDateString());
+        List<Record> recordList = OdpsUtil.getOdpsData(sql);
         if (CollectionUtils.isEmpty(recordList)) {
             return;
         }
@@ -38,34 +48,49 @@ public class WeComMessageDataJob {
         for (Record record : recordList) {
             PushMessage pushMessage = new PushMessage();
             Long videoId = Long.parseLong((String) record.get(0));
-            StringBuilder stringBuilder = new StringBuilder((String) record.get(1));
-            stringBuilder.delete(0, 1);
-            stringBuilder.delete(stringBuilder.length() - 1, stringBuilder.length());
-            Set<Long> userIds = Arrays.stream(stringBuilder.toString().split(",")).map(String::trim).map(Long::parseLong).collect(Collectors.toSet());
+            Set<Long> userIds = new HashSet<>(JSONObject.parseArray((String) record.get(1), Long.class));
             pushMessage.setVideoId(videoId);
             pushMessage.setUserIds(userIds);
             list.add(pushMessage);
         }
         goodList = list;
-        saveList = Objects.requireNonNull(redisTemplate.opsForList().range(MiniprogramConstant.GUARANTEED_MINIPROGRAM_KEY, 0, 2)).stream().map(o -> (Long) o).collect(Collectors.toList());
+        List<Long> saveVideoIds = Objects.requireNonNull(redisTemplate.opsForList().range(MiniprogramConstant.GUARANTEED_MINIPROGRAM_KEY, 0, 2)).stream().map(o -> (Long) o).collect(Collectors.toList());
+        if (CollectionUtils.isEmpty(saveVideoIds)) {
+            throw new RuntimeException("保底数据为空");
+        }
+        MessageAttachmentExample example = new MessageAttachmentExample();
+        example.createCriteria().andMiniprogramVideoIdIn(saveVideoIds);
+        List<MessageAttachment> messageAttachmentList = messageAttachmentMapper.selectByExample(example);
+        if (CollectionUtils.isEmpty(messageAttachmentList) || messageAttachmentList.size() < saveVideoIds.size()) {
+            throw new RuntimeException("保底数据获取失败");
+        }
+        for (MessageAttachment messageAttachment : messageAttachmentList) {
+            if (messageAttachment.getUpdateTime().compareTo(DateUtil.getThatDayDate()) < 0) {
+                throw new RuntimeException("保底数据不是最新的");
+            }
+        }
+        saveList = saveVideoIds;
     }
 
+    public void assemble(){
+        UserExample example = new UserExample();
+    }
 
 
     public String getPushKey(User user) {
-        int i = 0;
+        int n = 0;
         StringBuilder key = new StringBuilder();
         for (PushMessage pushMessage : goodList) {
             if (pushMessage.getUserIds().contains(user.getId())) {
                 if (key.length() == 0) {
                     key.append(pushMessage.getVideoId());
-                    i++;
+                    n++;
                 } else {
                     key.append("_");
                     key.append(pushMessage.getVideoId());
                 }
-                i++;
-                if (i > sum) {
+                n++;
+                if (n > sum) {
                     return key.toString();
                 }
             }
@@ -73,13 +98,13 @@ public class WeComMessageDataJob {
         for (Long videoId : saveList) {
             if (key.length() == 0) {
                 key.append(videoId);
-                i++;
+                n++;
             } else {
                 key.append("_");
                 key.append(videoId);
             }
-            i++;
-            if (i > sum) {
+            n++;
+            if (n > sum) {
                 return key.toString();
             }
         }

+ 11 - 13
we-com-server/src/main/java/com/tzld/piaoquan/wecom/model/po/HistoryMessageExample.java

@@ -1,17 +1,19 @@
 package com.tzld.piaoquan.wecom.model.po;
 
+import com.tzld.piaoquan.wecom.utils.page.Page;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
 
 public class HistoryMessageExample {
-
     protected String orderByClause;
 
     protected boolean distinct;
 
     protected List<Criteria> oredCriteria;
 
+    protected Page page;
+
     public HistoryMessageExample() {
         oredCriteria = new ArrayList<Criteria>();
     }
@@ -65,6 +67,14 @@ public class HistoryMessageExample {
         distinct = false;
     }
 
+    public void setPage(Page page) {
+        this.page=page;
+    }
+
+    public Page getPage() {
+        return page;
+    }
+
     protected abstract static class GeneratedCriteria {
         protected List<Criterion> criteria;
 
@@ -527,12 +537,6 @@ public class HistoryMessageExample {
         }
     }
 
-    /**
-     * This class was generated by MyBatis Generator.
-     * This class corresponds to the database table we_com_history_message
-     *
-     * @mbg.generated do_not_delete_during_merge
-     */
     public static class Criteria extends GeneratedCriteria {
 
         protected Criteria() {
@@ -540,12 +544,6 @@ public class HistoryMessageExample {
         }
     }
 
-    /**
-     * This class was generated by MyBatis Generator.
-     * This class corresponds to the database table we_com_history_message
-     *
-     * @mbg.generated
-     */
     public static class Criterion {
         private String condition;
 

+ 0 - 1
we-com-server/src/main/java/com/tzld/piaoquan/wecom/model/po/MessageAttachment.java

@@ -3,7 +3,6 @@ package com.tzld.piaoquan.wecom.model.po;
 import java.util.Date;
 
 public class MessageAttachment {
-
     private Long id;
 
     private Integer type;

+ 11 - 12
we-com-server/src/main/java/com/tzld/piaoquan/wecom/model/po/MessageAttachmentExample.java

@@ -1,5 +1,6 @@
 package com.tzld.piaoquan.wecom.model.po;
 
+import com.tzld.piaoquan.wecom.utils.page.Page;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
@@ -11,6 +12,8 @@ public class MessageAttachmentExample {
 
     protected List<Criteria> oredCriteria;
 
+    protected Page page;
+
     public MessageAttachmentExample() {
         oredCriteria = new ArrayList<Criteria>();
     }
@@ -64,6 +67,14 @@ public class MessageAttachmentExample {
         distinct = false;
     }
 
+    public void setPage(Page page) {
+        this.page=page;
+    }
+
+    public Page getPage() {
+        return page;
+    }
+
     protected abstract static class GeneratedCriteria {
         protected List<Criterion> criteria;
 
@@ -886,12 +897,6 @@ public class MessageAttachmentExample {
         }
     }
 
-    /**
-     * This class was generated by MyBatis Generator.
-     * This class corresponds to the database table we_com_message_attachment
-     *
-     * @mbg.generated do_not_delete_during_merge
-     */
     public static class Criteria extends GeneratedCriteria {
 
         protected Criteria() {
@@ -899,12 +904,6 @@ public class MessageAttachmentExample {
         }
     }
 
-    /**
-     * This class was generated by MyBatis Generator.
-     * This class corresponds to the database table we_com_message_attachment
-     *
-     * @mbg.generated
-     */
     public static class Criterion {
         private String condition;
 

+ 0 - 6
we-com-server/src/main/java/com/tzld/piaoquan/wecom/model/po/User.java

@@ -2,13 +2,7 @@ package com.tzld.piaoquan.wecom.model.po;
 
 import java.util.Date;
 
-/**
- *
- * This class was generated by MyBatis Generator.
- * This class corresponds to the database table we_com_user
- */
 public class User {
-
     private Long id;
 
     private String externalUserId;

+ 11 - 13
we-com-server/src/main/java/com/tzld/piaoquan/wecom/model/po/UserExample.java

@@ -1,17 +1,19 @@
 package com.tzld.piaoquan.wecom.model.po;
 
+import com.tzld.piaoquan.wecom.utils.page.Page;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
 
 public class UserExample {
-
     protected String orderByClause;
 
     protected boolean distinct;
 
     protected List<Criteria> oredCriteria;
 
+    protected Page page;
+
     public UserExample() {
         oredCriteria = new ArrayList<Criteria>();
     }
@@ -65,6 +67,14 @@ public class UserExample {
         distinct = false;
     }
 
+    public void setPage(Page page) {
+        this.page=page;
+    }
+
+    public Page getPage() {
+        return page;
+    }
+
     protected abstract static class GeneratedCriteria {
         protected List<Criterion> criteria;
 
@@ -937,12 +947,6 @@ public class UserExample {
         }
     }
 
-    /**
-     * This class was generated by MyBatis Generator.
-     * This class corresponds to the database table we_com_user
-     *
-     * @mbg.generated do_not_delete_during_merge
-     */
     public static class Criteria extends GeneratedCriteria {
 
         protected Criteria() {
@@ -950,12 +954,6 @@ public class UserExample {
         }
     }
 
-    /**
-     * This class was generated by MyBatis Generator.
-     * This class corresponds to the database table we_com_user
-     *
-     * @mbg.generated
-     */
     public static class Criterion {
         private String condition;
 

+ 0 - 1
we-com-server/src/main/java/com/tzld/piaoquan/wecom/service/Impl/UserServiceImpl.java

@@ -1,7 +1,6 @@
 package com.tzld.piaoquan.wecom.service.Impl;
 
 import com.tzld.piaoquan.wecom.dao.mapper.UserMapper;
-import com.tzld.piaoquan.wecom.model.po.User;
 import com.tzld.piaoquan.wecom.service.UserService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;

+ 28 - 0
we-com-server/src/main/java/com/tzld/piaoquan/wecom/utils/DateUtil.java

@@ -0,0 +1,28 @@
+package com.tzld.piaoquan.wecom.utils;
+
+
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
+
+public class DateUtil {
+
+    //获取当天的日期
+    public static Date getThatDayDate() {
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(new Date());
+        calendar.set(Calendar.HOUR_OF_DAY, 0);
+        calendar.set(Calendar.MINUTE, 0);
+        calendar.set(Calendar.SECOND, 0);
+        return calendar.getTime();
+    }
+
+    public static String getBeforeDayDateString(){
+        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
+        return dateFormat.format(new Date().getTime() - 86400000);
+    }
+
+
+
+
+}

+ 108 - 0
we-com-server/src/main/java/com/tzld/piaoquan/wecom/utils/page/Page.java

@@ -0,0 +1,108 @@
+package com.tzld.piaoquan.wecom.utils.page;
+
+import java.util.List;
+
+public class Page<T> {
+
+    public static final String DEFAULT_PAGE_SIZE = "20";
+    public static final String DEFAULT_CURRENT_PAGE = "1";
+
+    private int currentPage = Integer.valueOf(DEFAULT_CURRENT_PAGE);
+    private int totalSize;
+    private int pageSize = Integer.valueOf(DEFAULT_PAGE_SIZE);
+
+    private List<T> objs;
+
+    private T obj;
+
+    public Page() {
+    }
+
+    public Page(int currentPage) {
+        this.currentPage = currentPage;
+    }
+
+    public Page(int currentPage, int pageSize) {
+        setCurrentPage(currentPage);
+        setPageSize(pageSize);
+    }
+
+    public int getNextPage() {
+        return currentPage == getTotalPage() ? currentPage : currentPage + 1;
+    }
+
+    public int getPrePage() {
+        return currentPage > 1 ? currentPage - 1 : 1;
+    }
+
+    public int getOffset() {
+        return getCurPageFirstRecNum() - 1;
+    }
+
+    public int getCurPageFirstRecNum() {
+        return (getCurrentPage() - 1) * pageSize + 1;
+    }
+
+    public int getCurPageLastRecNum() {
+        return getCurrentPage() * pageSize;
+    }
+
+    public int getTotalPage() {
+        int t = totalSize % pageSize > 0 ? totalSize / pageSize + 1 : totalSize / pageSize;
+        if (t <= 0) {
+            t = 1;
+        }
+        return t;
+    }
+
+    public void setObjs(List<T> objs) {
+        this.objs = objs;
+    }
+
+    public List<T> getObjs() {
+        return objs;
+    }
+
+    public int getCurrentPage() {
+        return currentPage;
+    }
+
+    public void setCurrentPage(int currentPage) {
+        this.currentPage = currentPage;
+    }
+
+    public int getTotalSize() {
+        return totalSize;
+    }
+
+    public void setTotalSize(int totalSize) {
+        this.totalSize = totalSize;
+    }
+
+    public int getPageSize() {
+        return pageSize;
+    }
+
+    public void setPageSize(int pageSize) {
+        if (pageSize > 0) {
+            this.pageSize = pageSize;
+        }
+    }
+
+    public boolean containData() {
+        return getTotalSize() > 0;
+    }
+    @Override
+    public String toString() {
+        return "Page [currentPage=" + getCurrentPage() + ", totalSize=" + getTotalSize() + ", pageSize=" + getPageSize()
+                + "]";
+    }
+
+    public T getObj() {
+        return obj;
+    }
+
+    public void setObj(T obj) {
+        this.obj = obj;
+    }
+}

+ 3 - 1
we-com-server/src/main/resources/mapper/HistoryMessageMapper.xml

@@ -2,7 +2,6 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.tzld.piaoquan.wecom.dao.mapper.HistoryMessageMapper">
   <resultMap id="BaseResultMap" type="com.tzld.piaoquan.wecom.model.po.HistoryMessage">
-
     <id column="id" jdbcType="BIGINT" property="id" />
     <result column="user_id" jdbcType="BIGINT" property="userId" />
     <result column="video_id" jdbcType="BIGINT" property="videoId" />
@@ -85,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 

+ 5 - 3
we-com-server/src/main/resources/mapper/MessageAttachmentMapper.xml

@@ -2,7 +2,6 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.tzld.piaoquan.wecom.dao.mapper.MessageAttachmentMapper">
   <resultMap id="BaseResultMap" type="com.tzld.piaoquan.wecom.model.po.MessageAttachment">
-
     <id column="id" jdbcType="BIGINT" property="id" />
     <result column="type" jdbcType="INTEGER" property="type" />
     <result column="url" jdbcType="VARCHAR" property="url" />
@@ -91,6 +90,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 
@@ -112,12 +114,12 @@
     insert into we_com_message_attachment (id, `type`, url, 
       title, `desc`, appid, 
       page, cover, miniprogram_video_id, 
-      create_time, update_time
+      is_delete, create_time, update_time
       )
     values (#{id,jdbcType=BIGINT}, #{type,jdbcType=INTEGER}, #{url,jdbcType=VARCHAR}, 
       #{title,jdbcType=VARCHAR}, #{desc,jdbcType=VARCHAR}, #{appid,jdbcType=VARCHAR}, 
       #{page,jdbcType=VARCHAR}, #{cover,jdbcType=VARCHAR}, #{miniprogramVideoId,jdbcType=BIGINT}, 
-      #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
+      #{isDelete,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
       )
   </insert>
   <insert id="insertSelective" parameterType="com.tzld.piaoquan.wecom.model.po.MessageAttachment">

+ 3 - 0
we-com-server/src/main/resources/mapper/UserMapper.xml

@@ -91,6 +91,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