瀏覽代碼

first commit

xueyiming 6 月之前
當前提交
abfc776232
共有 100 個文件被更改,包括 7018 次插入0 次删除
  1. 8 0
      .idea/.gitignore
  2. 22 0
      .idea/compiler.xml
  3. 12 0
      .idea/encodings.xml
  4. 40 0
      .idea/jarRepositories.xml
  5. 14 0
      .idea/misc.xml
  6. 124 0
      .idea/uiDesigner.xml
  7. 35 0
      api-module/pom.xml
  8. 25 0
      api-module/src/main/java/com/tzld/piaoquan/api/GrowthServerApplication.java
  9. 20 0
      api-module/src/main/java/com/tzld/piaoquan/api/controller/IndexController.java
  10. 26 0
      api-module/src/main/java/com/tzld/piaoquan/api/controller/MessageController.java
  11. 124 0
      api-module/src/main/java/com/tzld/piaoquan/api/controller/WeComController.java
  12. 31 0
      api-module/src/main/java/com/tzld/piaoquan/api/dao/generator/MybatisGeneratorMain.java
  13. 76 0
      api-module/src/main/java/com/tzld/piaoquan/api/dao/generator/PaginationPlugin.java
  14. 33 0
      api-module/src/main/java/com/tzld/piaoquan/api/dao/mapper/CorpMapper.java
  15. 32 0
      api-module/src/main/java/com/tzld/piaoquan/api/dao/mapper/GuaranteesVideoMapper.java
  16. 32 0
      api-module/src/main/java/com/tzld/piaoquan/api/dao/mapper/MessageAttachmentMapper.java
  17. 32 0
      api-module/src/main/java/com/tzld/piaoquan/api/dao/mapper/StaffMapper.java
  18. 36 0
      api-module/src/main/java/com/tzld/piaoquan/api/dao/mapper/StaffWithUserMapper.java
  19. 37 0
      api-module/src/main/java/com/tzld/piaoquan/api/dao/mapper/UserMapper.java
  20. 7 0
      api-module/src/main/java/com/tzld/piaoquan/api/service/AccessTokenService.java
  21. 68 0
      api-module/src/main/java/com/tzld/piaoquan/api/service/Impl/AccessTokenServiceImpl.java
  22. 226 0
      api-module/src/main/java/com/tzld/piaoquan/api/service/Impl/MessageAttachmentServiceImpl.java
  23. 220 0
      api-module/src/main/java/com/tzld/piaoquan/api/service/Impl/UserServiceImpl.java
  24. 15 0
      api-module/src/main/java/com/tzld/piaoquan/api/service/MessageAttachmentService.java
  25. 16 0
      api-module/src/main/java/com/tzld/piaoquan/api/service/UserService.java
  26. 11 0
      api-module/src/main/resources/application-dev.properties
  27. 12 0
      api-module/src/main/resources/application-prod.properties
  28. 11 0
      api-module/src/main/resources/application-test.properties
  29. 34 0
      api-module/src/main/resources/application.properties
  30. 94 0
      api-module/src/main/resources/log4j2.xml
  31. 246 0
      api-module/src/main/resources/mapper/CorpMapper.xml
  32. 246 0
      api-module/src/main/resources/mapper/GuaranteesVideoMapper.xml
  33. 356 0
      api-module/src/main/resources/mapper/MessageAttachmentMapper.xml
  34. 294 0
      api-module/src/main/resources/mapper/StaffMapper.xml
  35. 277 0
      api-module/src/main/resources/mapper/StaffWithUserMapper.xml
  36. 419 0
      api-module/src/main/resources/mapper/UserMapper.xml
  37. 13 0
      api-module/src/main/resources/mybatis-config.xml
  38. 64 0
      api-module/src/main/resources/mybatis-generator-config.xml
  39. 11 0
      api-module/target/classes/application-dev.properties
  40. 12 0
      api-module/target/classes/application-prod.properties
  41. 11 0
      api-module/target/classes/application-test.properties
  42. 34 0
      api-module/target/classes/application.properties
  43. 二進制
      api-module/target/classes/com/tzld/piaoquan/api/GrowthServerApplication.class
  44. 二進制
      api-module/target/classes/com/tzld/piaoquan/api/controller/IndexController.class
  45. 二進制
      api-module/target/classes/com/tzld/piaoquan/api/controller/MessageController.class
  46. 二進制
      api-module/target/classes/com/tzld/piaoquan/api/controller/WeComController.class
  47. 二進制
      api-module/target/classes/com/tzld/piaoquan/api/dao/generator/MybatisGeneratorMain.class
  48. 二進制
      api-module/target/classes/com/tzld/piaoquan/api/dao/generator/PaginationPlugin.class
  49. 二進制
      api-module/target/classes/com/tzld/piaoquan/api/dao/mapper/CorpMapper.class
  50. 二進制
      api-module/target/classes/com/tzld/piaoquan/api/dao/mapper/GuaranteesVideoMapper.class
  51. 二進制
      api-module/target/classes/com/tzld/piaoquan/api/dao/mapper/MessageAttachmentMapper.class
  52. 二進制
      api-module/target/classes/com/tzld/piaoquan/api/dao/mapper/StaffMapper.class
  53. 二進制
      api-module/target/classes/com/tzld/piaoquan/api/dao/mapper/StaffWithUserMapper.class
  54. 二進制
      api-module/target/classes/com/tzld/piaoquan/api/dao/mapper/UserMapper.class
  55. 二進制
      api-module/target/classes/com/tzld/piaoquan/api/service/AccessTokenService.class
  56. 二進制
      api-module/target/classes/com/tzld/piaoquan/api/service/Impl/AccessTokenServiceImpl.class
  57. 二進制
      api-module/target/classes/com/tzld/piaoquan/api/service/Impl/MessageAttachmentServiceImpl.class
  58. 二進制
      api-module/target/classes/com/tzld/piaoquan/api/service/Impl/UserServiceImpl.class
  59. 二進制
      api-module/target/classes/com/tzld/piaoquan/api/service/MessageAttachmentService.class
  60. 二進制
      api-module/target/classes/com/tzld/piaoquan/api/service/UserService.class
  61. 94 0
      api-module/target/classes/log4j2.xml
  62. 246 0
      api-module/target/classes/mapper/CorpMapper.xml
  63. 246 0
      api-module/target/classes/mapper/GuaranteesVideoMapper.xml
  64. 356 0
      api-module/target/classes/mapper/MessageAttachmentMapper.xml
  65. 294 0
      api-module/target/classes/mapper/StaffMapper.xml
  66. 277 0
      api-module/target/classes/mapper/StaffWithUserMapper.xml
  67. 419 0
      api-module/target/classes/mapper/UserMapper.xml
  68. 13 0
      api-module/target/classes/mybatis-config.xml
  69. 64 0
      api-module/target/classes/mybatis-generator-config.xml
  70. 20 0
      common-module/pom.xml
  71. 80 0
      common-module/src/main/java/com/tzld/piaoquan/common/common/base/CommonResponse.java
  72. 19 0
      common-module/src/main/java/com/tzld/piaoquan/common/common/constant/MessageConstant.java
  73. 8 0
      common-module/src/main/java/com/tzld/piaoquan/common/common/constant/OtherServerURL.java
  74. 7 0
      common-module/src/main/java/com/tzld/piaoquan/common/common/constant/RedisConstant.java
  75. 13 0
      common-module/src/main/java/com/tzld/piaoquan/common/common/constant/ResponseConstant.java
  76. 11 0
      common-module/src/main/java/com/tzld/piaoquan/common/common/constant/TimeConstant.java
  77. 34 0
      common-module/src/main/java/com/tzld/piaoquan/common/common/constant/WeComConstant.java
  78. 10 0
      common-module/src/main/java/com/tzld/piaoquan/common/common/constant/WeComServerConstant.java
  79. 18 0
      common-module/src/main/java/com/tzld/piaoquan/common/common/enums/CorpEnum.java
  80. 27 0
      common-module/src/main/java/com/tzld/piaoquan/common/common/enums/ExceptionCodeEnum.java
  81. 21 0
      common-module/src/main/java/com/tzld/piaoquan/common/common/enums/MessageAttachmentTypeEnum.java
  82. 19 0
      common-module/src/main/java/com/tzld/piaoquan/common/common/enums/SourceEnum.java
  83. 20 0
      common-module/src/main/java/com/tzld/piaoquan/common/common/enums/TimeEnum.java
  84. 25 0
      common-module/src/main/java/com/tzld/piaoquan/common/common/exception/CustomizeException.java
  85. 94 0
      common-module/src/main/java/com/tzld/piaoquan/common/component/HttpPoolClient.java
  86. 48 0
      common-module/src/main/java/com/tzld/piaoquan/common/config/DataSourceConfig.java
  87. 64 0
      common-module/src/main/java/com/tzld/piaoquan/common/config/HttpClientConfig.java
  88. 43 0
      common-module/src/main/java/com/tzld/piaoquan/common/config/RedisConfig.java
  89. 49 0
      common-module/src/main/java/com/tzld/piaoquan/common/config/XxlJobConfig.java
  90. 37 0
      common-module/src/main/java/com/tzld/piaoquan/common/model/bo/AdPutFlowParam.java
  91. 13 0
      common-module/src/main/java/com/tzld/piaoquan/common/model/bo/ExternalUser.java
  92. 12 0
      common-module/src/main/java/com/tzld/piaoquan/common/model/bo/MiniprogramRecord.java
  93. 17 0
      common-module/src/main/java/com/tzld/piaoquan/common/model/bo/PushMessage.java
  94. 15 0
      common-module/src/main/java/com/tzld/piaoquan/common/model/bo/SendDetail.java
  95. 24 0
      common-module/src/main/java/com/tzld/piaoquan/common/model/bo/VideoCombination.java
  96. 11 0
      common-module/src/main/java/com/tzld/piaoquan/common/model/bo/VideoDetail.java
  97. 16 0
      common-module/src/main/java/com/tzld/piaoquan/common/model/bo/VideoParam.java
  98. 23 0
      common-module/src/main/java/com/tzld/piaoquan/common/model/bo/XxlJobParam.java
  99. 92 0
      common-module/src/main/java/com/tzld/piaoquan/common/model/po/AlertMessage.java
  100. 663 0
      common-module/src/main/java/com/tzld/piaoquan/common/model/po/AlertMessageExample.java

+ 8 - 0
.idea/.gitignore

@@ -0,0 +1,8 @@
+# Default ignored files
+/shelf/
+/workspace.xml
+# Editor-based HTTP Client requests
+/httpRequests/
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml

+ 22 - 0
.idea/compiler.xml

@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="CompilerConfiguration">
+    <annotationProcessing>
+      <profile name="Maven default annotation processors profile" enabled="true">
+        <sourceOutputDir name="target/generated-sources/annotations" />
+        <sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
+        <outputRelativeToContentRoot value="true" />
+        <module name="api-module" />
+        <module name="offline-module" />
+        <module name="common-module" />
+      </profile>
+    </annotationProcessing>
+  </component>
+  <component name="JavacSettings">
+    <option name="ADDITIONAL_OPTIONS_OVERRIDE">
+      <module name="api-module" options="-parameters" />
+      <module name="common-module" options="-parameters" />
+      <module name="offline-module" options="-parameters" />
+    </option>
+  </component>
+</project>

+ 12 - 0
.idea/encodings.xml

@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="Encoding">
+    <file url="file://$PROJECT_DIR$/api-module/src/main/java" charset="UTF-8" />
+    <file url="file://$PROJECT_DIR$/api-module/src/main/resources" charset="UTF-8" />
+    <file url="file://$PROJECT_DIR$/common-module/src/main/java" charset="UTF-8" />
+    <file url="file://$PROJECT_DIR$/offline-module/src/main/java" charset="UTF-8" />
+    <file url="file://$PROJECT_DIR$/offline-module/src/main/resources" charset="UTF-8" />
+    <file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
+    <file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
+  </component>
+</project>

+ 40 - 0
.idea/jarRepositories.xml

@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="RemoteRepositoriesConfiguration">
+    <remote-repository>
+      <option name="id" value="central" />
+      <option name="name" value="Central Repository" />
+      <option name="url" value="https://repo.maven.apache.org/maven2" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="public" />
+      <option name="name" value="Public Repositories" />
+      <option name="url" value="http://nexus.stuuudy.com:9580/nexus/content/groups/public/" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="central" />
+      <option name="name" value="Maven Central repository" />
+      <option name="url" value="https://repo1.maven.org/maven2" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="maven-net-cloudera" />
+      <option name="name" value="cloudera Mirror" />
+      <option name="url" value="https://repository.cloudera.com/content/repositories/releases/" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="jboss.community" />
+      <option name="name" value="JBoss Community repository" />
+      <option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="stuuudy" />
+      <option name="name" value="stuuudy" />
+      <option name="url" value="http://nexus.stuuudy.com:9580/nexus/content/repositories/stuuudy/" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="releases" />
+      <option name="name" value="Releases" />
+      <option name="url" value="http://nexus.stuuudy.com:9580/nexus/content/repositories/releases/" />
+    </remote-repository>
+  </component>
+</project>

+ 14 - 0
.idea/misc.xml

@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ExternalStorageConfigurationManager" enabled="true" />
+  <component name="MavenProjectsManager">
+    <option name="originalFiles">
+      <list>
+        <option value="$PROJECT_DIR$/pom.xml" />
+      </list>
+    </option>
+  </component>
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
+    <output url="file://$PROJECT_DIR$/out" />
+  </component>
+</project>

+ 124 - 0
.idea/uiDesigner.xml

@@ -0,0 +1,124 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="Palette2">
+    <group name="Swing">
+      <item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.svg" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
+      </item>
+      <item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.svg" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
+      </item>
+      <item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.svg" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
+      </item>
+      <item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.svg" removable="false" auto-create-binding="false" can-attach-label="true">
+        <default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
+      </item>
+      <item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.svg" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
+        <initial-values>
+          <property name="text" value="Button" />
+        </initial-values>
+      </item>
+      <item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.svg" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
+        <initial-values>
+          <property name="text" value="RadioButton" />
+        </initial-values>
+      </item>
+      <item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.svg" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
+        <initial-values>
+          <property name="text" value="CheckBox" />
+        </initial-values>
+      </item>
+      <item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.svg" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
+        <initial-values>
+          <property name="text" value="Label" />
+        </initial-values>
+      </item>
+      <item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
+          <preferred-size width="150" height="-1" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
+          <preferred-size width="150" height="-1" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
+          <preferred-size width="150" height="-1" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.svg" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.svg" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.svg" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.svg" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
+      </item>
+      <item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.svg" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.svg" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.svg" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.svg" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
+          <preferred-size width="200" height="200" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.svg" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
+          <preferred-size width="200" height="200" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.svg" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
+      </item>
+      <item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.svg" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
+      </item>
+      <item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.svg" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
+      </item>
+      <item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.svg" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
+      </item>
+      <item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.svg" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
+          <preferred-size width="-1" height="20" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.svg" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
+      </item>
+      <item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.svg" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
+      </item>
+    </group>
+  </component>
+</project>

+ 35 - 0
api-module/pom.xml

@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>com.tzld.piaoquan</groupId>
+        <artifactId>growth-manager</artifactId>
+        <version>1.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>api-module</artifactId>
+
+    <properties>
+        <maven.compiler.source>8</maven.compiler.source>
+        <maven.compiler.target>8</maven.compiler.target>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>com.tzld.piaoquan</groupId>
+            <artifactId>common-module</artifactId>
+            <version>1.0-SNAPSHOT</version>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.tzld.piaoquan</groupId>
+            <artifactId>offline-module</artifactId>
+            <version>1.0-SNAPSHOT</version>
+            <scope>compile</scope>
+        </dependency>
+    </dependencies>
+
+</project>

+ 25 - 0
api-module/src/main/java/com/tzld/piaoquan/api/GrowthServerApplication.java

@@ -0,0 +1,25 @@
+package com.tzld.piaoquan.api;
+
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.context.annotation.ComponentScan;
+
+
+@SpringBootApplication
+@ComponentScan({
+        "com.tzld.piaoquan.common.*",
+        "com.tzld.piaoquan.offline.*",
+        "com.tzld.piaoquan.api.*"
+})
+@MapperScan({
+        "com.tzld.piaoquan.api.dao.mapper",
+        "com.tzld.piaoquan.offline.dao.mapper"
+})
+//@MapperScan("com.tzld.piaoquan.api.dao.mapper")
+//@MapperScan("com.tzld.piaoquan.offline.dao.mapper")
+public class GrowthServerApplication {
+    public static void main(String[] args) {
+        SpringApplication.run(GrowthServerApplication.class, args);
+    }
+}

+ 20 - 0
api-module/src/main/java/com/tzld/piaoquan/api/controller/IndexController.java

@@ -0,0 +1,20 @@
+package com.tzld.piaoquan.api.controller;
+
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/")
+public class IndexController {
+
+    /**
+     * 探活
+     *
+     * @return
+     */
+    @GetMapping("/healthcheck")
+    public String healthcheck() {
+        return "ok";
+    }
+}

+ 26 - 0
api-module/src/main/java/com/tzld/piaoquan/api/controller/MessageController.java

@@ -0,0 +1,26 @@
+package com.tzld.piaoquan.api.controller;
+
+
+import com.tzld.piaoquan.common.common.base.CommonResponse;
+import com.tzld.piaoquan.common.model.vo.GuaranteedParam;
+import com.tzld.piaoquan.api.service.MessageAttachmentService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/wecom/message")
+public class MessageController {
+
+    @Autowired
+    private MessageAttachmentService messageAttachmentService;
+
+    //创建保底小程序
+    @PostMapping("/miniprogram/guaranteed/create")
+    public CommonResponse<Void> createGuaranteedMiniProgram(@RequestBody GuaranteedParam guaranteedParam){
+        return messageAttachmentService.createGuaranteedMiniProgram(guaranteedParam);
+    }
+
+}

+ 124 - 0
api-module/src/main/java/com/tzld/piaoquan/api/controller/WeComController.java

@@ -0,0 +1,124 @@
+package com.tzld.piaoquan.api.controller;
+
+import com.alibaba.fastjson.JSONObject;
+import com.tzld.piaoquan.common.common.constant.WeComServerConstant;
+import com.tzld.piaoquan.api.service.UserService;
+import com.tzld.piaoquan.common.utils.wecom.WXBizMsgCrypt;
+import com.tzld.piaoquan.common.utils.wecom.WxUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.ServletInputStream;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.io.PrintWriter;
+import java.util.Map;
+
+import static com.tzld.piaoquan.common.common.enums.CorpEnum.HNWQ;
+
+@Slf4j
+@RestController
+@RequestMapping("/wecom/server")
+public class WeComController {
+
+
+    @Autowired
+    private UserService userService;
+
+    @GetMapping("/verify")
+    public void verifyGet(HttpServletRequest request, HttpServletResponse response) {
+        try {
+            // 微信加密签名
+            String msgSignature = request.getParameter("msg_signature");
+            // 时间戳
+            String timestamp = request.getParameter("timestamp");
+            // 随机数
+            String nonce = request.getParameter("nonce");
+            // 随机字符串
+            // 如果是刷新,需返回原echostr
+            String echoStr = request.getParameter("echostr");
+            // 微信加密签名
+            WXBizMsgCrypt wxcpt = new WXBizMsgCrypt(WeComServerConstant.TOKEN,
+                    WeComServerConstant.ENCODING_AES_KEY,
+                    WeComServerConstant.CORP_ID);
+
+            String sEchoStr = ""; //需要返回的明文
+            PrintWriter out;
+
+            sEchoStr = wxcpt.VerifyURL(msgSignature, timestamp,
+                    nonce, echoStr);
+            log.info("verifyurl echostr: " + sEchoStr);
+
+            // 验证URL成功,将sEchoStr返回
+            out = response.getWriter();
+            out.print(sEchoStr);
+        } catch (Exception e) {
+            //验证URL失败,错误原因请查看异常
+            log.error("verifyGet error", e);
+        }
+
+    }
+
+    /**
+     * 刷新 ticket
+     */
+    @PostMapping(value = "/verify")
+    public String verifyPost(HttpServletRequest request) {
+
+        try {
+            // 微信加密签名
+            String msg_signature = request.getParameter("msg_signature");
+            // 时间戳
+            String timestamp = request.getParameter("timestamp");
+            // 随机数
+            String nonce = request.getParameter("nonce");
+
+            String id = WeComServerConstant.CORP_ID;
+
+            WXBizMsgCrypt wxcpt = new WXBizMsgCrypt(WeComServerConstant.TOKEN, WeComServerConstant.ENCODING_AES_KEY, id);
+
+            StringBuilder postData = new StringBuilder();   // 密文,对应POST请求的数据
+            //1.获取加密的请求消息:使用输入流获得加密请求消息postData
+            ServletInputStream in = request.getInputStream();
+            BufferedReader reader = new BufferedReader(new InputStreamReader(in));
+
+            String tempStr = "";   //作为输出字符串的临时串,用于判断是否读取完毕
+            while (null != (tempStr = reader.readLine())) {
+                postData.append(tempStr);
+            }
+
+            String suiteXml = wxcpt.DecryptMsg(msg_signature, timestamp, nonce, postData.toString());
+            log.info("suiteXml: " + suiteXml);
+
+            Map suiteMap = WxUtil.transferXmlToMap(suiteXml);
+            log.info("suiteMap = {}", JSONObject.toJSONString(suiteMap));
+            if (suiteMap != null) {
+                String changeType = (String) suiteMap.get("ChangeType");
+                if (StringUtils.isNotEmpty(changeType) && changeType.equals("add_external_contact")) {
+                    String userId = (String) suiteMap.get("UserID");
+                    String externalUserId = (String) suiteMap.get("ExternalUserID");
+                    log.info("addStaffWithUser userId={} externalUserId={}", userId, externalUserId);
+                    userService.addStaffWithUser(externalUserId, userId, HNWQ.getId());
+                }
+
+                if (StringUtils.isNotEmpty(changeType) && changeType.equals("del_follow_user")) {
+                    String userId = (String) suiteMap.get("UserID");
+                    String externalUserId = (String) suiteMap.get("ExternalUserID");
+                    log.info("delStaffWithUser userId={} externalUserId={}", userId, externalUserId);
+                    userService.delStaffWithUser(externalUserId, userId, System.currentTimeMillis());
+                }
+            }
+        } catch (Exception e) {
+            log.error("verifyPost error", e);
+        }
+        String success = "success";
+        return success;
+    }
+}

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

@@ -0,0 +1,31 @@
+package com.tzld.piaoquan.api.dao.generator;
+
+import org.mybatis.generator.api.MyBatisGenerator;
+import org.mybatis.generator.config.Configuration;
+import org.mybatis.generator.config.xml.ConfigurationParser;
+import org.mybatis.generator.exception.InvalidConfigurationException;
+import org.mybatis.generator.exception.XMLParserException;
+import org.mybatis.generator.internal.DefaultShellCallback;
+
+import java.io.File;
+import java.io.IOException;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.List;
+
+
+public class 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
api-module/src/main/java/com/tzld/piaoquan/api/dao/generator/PaginationPlugin.java

@@ -0,0 +1,76 @@
+package com.tzld.piaoquan.api.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.common.utils.page.Page"));
+        CommentGenerator commentGenerator = context.getCommentGenerator();
+        Field field = new Field();
+        field.setVisibility(JavaVisibility.PROTECTED);
+        field.setType(new FullyQualifiedJavaType("com.tzld.piaoquan.common.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.common.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.common.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;
+    }
+
+}

+ 33 - 0
api-module/src/main/java/com/tzld/piaoquan/api/dao/mapper/CorpMapper.java

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

+ 32 - 0
api-module/src/main/java/com/tzld/piaoquan/api/dao/mapper/GuaranteesVideoMapper.java

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

+ 32 - 0
api-module/src/main/java/com/tzld/piaoquan/api/dao/mapper/MessageAttachmentMapper.java

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

+ 32 - 0
api-module/src/main/java/com/tzld/piaoquan/api/dao/mapper/StaffMapper.java

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

+ 36 - 0
api-module/src/main/java/com/tzld/piaoquan/api/dao/mapper/StaffWithUserMapper.java

@@ -0,0 +1,36 @@
+package com.tzld.piaoquan.api.dao.mapper;
+
+import com.tzld.piaoquan.common.model.po.StaffWithUser;
+import com.tzld.piaoquan.common.model.po.StaffWithUserExample;
+import java.util.List;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+
+@Repository
+public interface StaffWithUserMapper {
+    long countByExample(StaffWithUserExample example);
+
+    int deleteByExample(StaffWithUserExample example);
+
+    int deleteByPrimaryKey(Long id);
+
+    int insert(StaffWithUser record);
+
+    int insertSelective(StaffWithUser record);
+
+    List<StaffWithUser> selectByExample(StaffWithUserExample example);
+
+    StaffWithUser selectByPrimaryKey(Long id);
+
+    int updateByExampleSelective(@Param("record") StaffWithUser record, @Param("example") StaffWithUserExample example);
+
+    int updateByExample(@Param("record") StaffWithUser record, @Param("example") StaffWithUserExample example);
+
+    int updateByPrimaryKeySelective(StaffWithUser record);
+
+    int updateByPrimaryKey(StaffWithUser record);
+
+    void insertList(@Param("list") List<StaffWithUser> list);
+
+    List<String> selectExternalUserIdByStaffId(@Param("staffId")Long staffId);
+}

+ 37 - 0
api-module/src/main/java/com/tzld/piaoquan/api/dao/mapper/UserMapper.java

@@ -0,0 +1,37 @@
+package com.tzld.piaoquan.api.dao.mapper;
+
+import com.tzld.piaoquan.common.model.po.User;
+import com.tzld.piaoquan.common.model.po.UserExample;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+@Repository
+public interface UserMapper {
+    long countByExample(UserExample example);
+
+    int deleteByExample(UserExample example);
+
+    int deleteByPrimaryKey(Long id);
+
+    int insert(User record);
+
+    int insertSelective(User record);
+
+    List<User> selectByExample(UserExample example);
+
+    User selectByPrimaryKey(Long id);
+
+    int updateByExampleSelective(@Param("record") User record, @Param("example") UserExample example);
+
+    int updateByExample(@Param("record") User record, @Param("example") UserExample example);
+
+    int updateByPrimaryKeySelective(User record);
+
+    int updateByPrimaryKey(User record);
+
+    Long selectIdByExternalUserId(String externalUserId);
+
+    void insertList(@Param("list") List<User> list);
+}

+ 7 - 0
api-module/src/main/java/com/tzld/piaoquan/api/service/AccessTokenService.java

@@ -0,0 +1,7 @@
+package com.tzld.piaoquan.api.service;
+
+public interface AccessTokenService {
+
+    String getWeComAccessToken(Long corpId);
+
+}

+ 68 - 0
api-module/src/main/java/com/tzld/piaoquan/api/service/Impl/AccessTokenServiceImpl.java

@@ -0,0 +1,68 @@
+package com.tzld.piaoquan.api.service.Impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.tzld.piaoquan.common.component.HttpPoolClient;
+import com.tzld.piaoquan.api.dao.mapper.CorpMapper;
+import com.tzld.piaoquan.common.model.po.Corp;
+import com.tzld.piaoquan.common.model.po.CorpExample;
+import com.tzld.piaoquan.api.service.AccessTokenService;
+import com.tzld.piaoquan.common.utils.LarkRobotUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
+
+import java.io.IOException;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+
+import static com.tzld.piaoquan.common.common.constant.RedisConstant.WE_COM_ACCESS_TOKEN;
+import static com.tzld.piaoquan.common.common.constant.WeComConstant.GET_WE_COM_ACCESS_TOKEN_URL;
+
+@Slf4j
+@Service
+public class AccessTokenServiceImpl implements AccessTokenService {
+
+    @Autowired
+    private HttpPoolClient httpPoolClient;
+
+    @Autowired
+    private RedisTemplate<String, Object> redisTemplate;
+
+    @Autowired
+    private CorpMapper corpMapper;
+
+    @Override
+    public String getWeComAccessToken(Long corpId) {
+        try {
+            String key = String.format(WE_COM_ACCESS_TOKEN, corpId);
+            String accessToken = (String) redisTemplate.opsForValue().get(key);
+            if (StringUtils.isNotEmpty(accessToken)) {
+                return accessToken;
+            }
+            CorpExample example = new CorpExample();
+            example.createCriteria().andIdEqualTo(corpId);
+            List<Corp> corps = corpMapper.selectByExample(example);
+            if (CollectionUtils.isEmpty(corps)) {
+                LarkRobotUtil.sendMessage("查询不到主体,获取access_token失败");
+                return "";
+            }
+            Corp corp = corps.get(0);
+            String cropId = corp.getCorpId();
+            String secret = corp.getSecret();
+            String res = httpPoolClient.get(String.format(GET_WE_COM_ACCESS_TOKEN_URL +
+                    "?corpid=%s&corpsecret=%s", cropId, secret));
+            JSONObject jsonObject = JSONObject.parseObject(res);
+            Long expiresIn = jsonObject.getLong("expires_in");
+            String newAccessToken = jsonObject.getString("access_token");
+            redisTemplate.opsForValue().set(key, newAccessToken, expiresIn, TimeUnit.SECONDS);
+            return newAccessToken;
+        } catch (IOException e) {
+            LarkRobotUtil.sendMessage("getWeComAccessToken error:" + e);
+            log.error("getWeComAccessToken error", e);
+        }
+        return "";
+    }
+}

+ 226 - 0
api-module/src/main/java/com/tzld/piaoquan/api/service/Impl/MessageAttachmentServiceImpl.java

@@ -0,0 +1,226 @@
+package com.tzld.piaoquan.api.service.Impl;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.tzld.piaoquan.api.dao.mapper.GuaranteesVideoMapper;
+import com.tzld.piaoquan.api.dao.mapper.MessageAttachmentMapper;
+import com.tzld.piaoquan.api.service.MessageAttachmentService;
+import com.tzld.piaoquan.common.common.base.CommonResponse;
+import com.tzld.piaoquan.common.common.enums.MessageAttachmentTypeEnum;
+import com.tzld.piaoquan.common.component.HttpPoolClient;
+import com.tzld.piaoquan.common.model.bo.VideoDetail;
+import com.tzld.piaoquan.common.model.bo.VideoParam;
+import com.tzld.piaoquan.common.model.po.GuaranteesVideo;
+import com.tzld.piaoquan.common.model.po.GuaranteesVideoExample;
+import com.tzld.piaoquan.common.model.po.MessageAttachment;
+import com.tzld.piaoquan.common.model.po.MessageAttachmentExample;
+import com.tzld.piaoquan.common.model.vo.GuaranteedParam;
+import com.tzld.piaoquan.common.utils.DateUtil;
+import com.tzld.piaoquan.common.utils.LarkRobotUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
+
+import java.io.IOException;
+import java.util.*;
+
+import static com.tzld.piaoquan.common.common.constant.MessageConstant.MAX_VIDEO_NUM;
+import static com.tzld.piaoquan.common.common.constant.MessageConstant.appid;
+import static com.tzld.piaoquan.common.common.constant.OtherServerURL.POST_VIDEO_DETAIL_URL;
+import static com.tzld.piaoquan.common.common.constant.TimeConstant.MILLISECOND_DAY;
+
+
+@Slf4j
+@Service
+public class MessageAttachmentServiceImpl implements MessageAttachmentService {
+
+    @Autowired
+    private HttpPoolClient httpPoolClient;
+
+    @Autowired
+    private MessageAttachmentMapper messageAttachmentMapper;
+
+    @Autowired
+    private GuaranteesVideoMapper guaranteesVideoMapper;
+
+    @Override
+    public void addMiniProgram(List<MessageAttachment> messageAttachmentList, Long createTime) {
+        for (MessageAttachment messageAttachment : messageAttachmentList) {
+            MessageAttachmentExample example = new MessageAttachmentExample();
+            example.createCriteria()
+                    .andAppidEqualTo(messageAttachment.getAppid())
+                    .andTypeEqualTo(messageAttachment.getType())
+                    .andMiniprogramVideoIdEqualTo(messageAttachment.getMiniprogramVideoId())
+                    .andStaffIdEqualTo(messageAttachment.getStaffId());
+            List<MessageAttachment> messageAttachments = messageAttachmentMapper.selectByExample(example);
+            if (CollectionUtils.isEmpty(messageAttachments)) {
+                if (createTime != null) {
+                    messageAttachment.setSendTime(new Date(createTime));
+                }
+                messageAttachmentMapper.insert(messageAttachment);
+                continue;
+            }
+            messageAttachment.setId(messageAttachments.get(0).getId());
+            messageAttachmentMapper.updateByPrimaryKeySelective(messageAttachment);
+        }
+    }
+
+
+    public CommonResponse<Void> createGuaranteedMiniProgram(GuaranteedParam guaranteedParam) {
+        if (isInvalidGuaranteedParam(guaranteedParam)) {
+            return CommonResponse.create(500, "参数错误");
+        }
+
+        Set<Long> videoIds = new HashSet<>();
+        for (VideoParam videoParam : guaranteedParam.getVideoParamList()) {
+            processVideoParam(videoParam, guaranteedParam.getDate(), videoIds);
+        }
+
+        Map<Long, VideoDetail> coverMap = getVideoDetail(videoIds);
+        Map<Long, MessageAttachment> messageAttachmentMap = createMessageAttachmentMap(videoIds, coverMap);
+
+        List<MessageAttachment> messageAttachmentList = new ArrayList<>();
+        for (VideoParam videoParam : guaranteedParam.getVideoParamList()) {
+            addMessageAttachments(videoParam, messageAttachmentMap, guaranteedParam.getDate(), messageAttachmentList);
+        }
+
+        addMiniProgram(messageAttachmentList, null);
+        return CommonResponse.success();
+    }
+
+    private boolean isInvalidGuaranteedParam(GuaranteedParam guaranteedParam) {
+        return guaranteedParam == null ||
+                StringUtils.isEmpty(guaranteedParam.getDate()) ||
+                CollectionUtils.isEmpty(guaranteedParam.getVideoParamList());
+    }
+
+
+    private void processVideoParam(VideoParam videoParam, String date, Set<Long> videoIds) {
+        if (CollectionUtils.isEmpty(videoParam.getVideoIds()) || videoParam.getVideoIds().size() < MAX_VIDEO_NUM) {
+            LarkRobotUtil.sendMessage("保底视频数量异常,请查看" + date);
+        }
+        List<Long> staffIds = Optional.ofNullable(videoParam.getStaffIds()).orElseGet(() -> {
+            List<Long> newStaffIds = new ArrayList<>();
+            if (videoParam.getStaffId() != null) {
+                newStaffIds.add(videoParam.getStaffId());
+            }
+            return newStaffIds;
+        });
+        for (Long staffId : staffIds) {
+            checkVideoSendTime(videoParam, staffId);
+            videoIds.addAll(videoParam.getVideoIds());
+        }
+    }
+
+    private void checkVideoSendTime(VideoParam videoParam, Long staffId) {
+        for (Long videoId : videoParam.getVideoIds()) {
+            MessageAttachmentExample example = new MessageAttachmentExample();
+            example.createCriteria().andMiniprogramVideoIdEqualTo(videoId).andStaffIdEqualTo(staffId);
+            List<MessageAttachment> messageAttachmentList = messageAttachmentMapper.selectByExample(example);
+            if (CollectionUtils.isEmpty(messageAttachmentList)) {
+                continue;
+            }
+            MessageAttachment messageAttachment = messageAttachmentList.get(0);
+            if (messageAttachment.getSendTime() != null &&
+                    DateUtil.dateDifference(new Date(), messageAttachment.getSendTime()) < 90 * MILLISECOND_DAY) {
+                LarkRobotUtil.sendMessage("保底视频90天内已发送,请查看videoId=" + videoId);
+                throw new RuntimeException("保底视频90天内已发送,请查看videoId=" + videoId);
+            }
+        }
+    }
+
+    private Map<Long, MessageAttachment> createMessageAttachmentMap(Set<Long> videoIds, Map<Long, VideoDetail> coverMap) {
+        Map<Long, MessageAttachment> messageAttachmentMap = new HashMap<>();
+        for (Long videoId : videoIds) {
+            VideoDetail videoDetail = coverMap.get(videoId);
+            if (videoDetail == null || StringUtils.isEmpty(videoDetail.getCover()) || StringUtils.isEmpty(videoDetail.getTitle())) {
+                LarkRobotUtil.sendMessage("获取视频详情异常,请查看" + videoId);
+                throw new RuntimeException("获取视频详情异常");
+            }
+            MessageAttachment messageAttachment = new MessageAttachment();
+            messageAttachment.setMiniprogramVideoId(videoId);
+            messageAttachment.setType(MessageAttachmentTypeEnum.MINI_PROGRAM.getType());
+            messageAttachment.setCover(videoDetail.getCover());
+            messageAttachment.setTitle(videoDetail.getTitle());
+            messageAttachment.setAppid(appid);
+            messageAttachmentMap.put(videoId, messageAttachment);
+        }
+        return messageAttachmentMap;
+    }
+
+    private void addMessageAttachments(VideoParam videoParam, Map<Long, MessageAttachment> messageAttachmentMap, String date, List<MessageAttachment> messageAttachmentList) {
+        List<Long> staffIds = Optional.ofNullable(videoParam.getStaffIds()).orElseGet(() -> {
+            List<Long> newStaffIds = new ArrayList<>();
+            if (videoParam.getStaffId() != null) {
+                newStaffIds.add(videoParam.getStaffId());
+            }
+            return newStaffIds;
+        });
+
+        for (Long staffId : staffIds) {
+            if (staffId == 0) {
+                addGuaranteesVideo(date, staffId, videoParam.getVideoIds());
+                continue;
+            }
+
+            for (Long videoId : videoParam.getVideoIds()) {
+                MessageAttachment messageAttachment = messageAttachmentMap.get(videoId);
+                if (messageAttachment == null) {
+                    continue;
+                }
+
+                MessageAttachment newMessageAttachment = new MessageAttachment();
+                BeanUtils.copyProperties(messageAttachment, newMessageAttachment);
+                newMessageAttachment.setStaffId(staffId);
+                messageAttachmentList.add(newMessageAttachment);
+            }
+            addGuaranteesVideo(date, staffId, videoParam.getVideoIds());
+        }
+    }
+
+    private void addGuaranteesVideo(String date, Long staffId, List<Long> videoIds) {
+        GuaranteesVideoExample example = new GuaranteesVideoExample();
+        example.createCriteria().andIsDeleteEqualTo(0).andDateEqualTo(date).andStaffIdEqualTo(staffId);
+        List<GuaranteesVideo> guaranteesVideos = guaranteesVideoMapper.selectByExample(example);
+        for (GuaranteesVideo guaranteesVideo : guaranteesVideos) {
+            guaranteesVideo.setIsDelete(1);
+            guaranteesVideoMapper.updateByPrimaryKeySelective(guaranteesVideo);
+        }
+        GuaranteesVideo guaranteesVideo = new GuaranteesVideo();
+        guaranteesVideo.setDate(date);
+        guaranteesVideo.setStaffId(staffId);
+        guaranteesVideo.setVideoIds(JSONObject.toJSONString(videoIds));
+        guaranteesVideoMapper.insertSelective(guaranteesVideo);
+    }
+
+
+    public Map<Long, VideoDetail> getVideoDetail(Set<Long> videoIdList) {
+        try {
+            Map<Long, VideoDetail> map = new HashMap<>();
+            JSONObject params = new JSONObject();
+            params.put("videoIdList", videoIdList);
+            String post = httpPoolClient.post(POST_VIDEO_DETAIL_URL, params.toJSONString());
+            JSONObject res = JSONObject.parseObject(post);
+            JSONArray data = res.getJSONArray("data");
+            for (int i = 0; i < data.size(); i++) {
+                VideoDetail videoDetail = new VideoDetail();
+                JSONObject jsonObject = data.getJSONObject(i);
+                Long videoId = jsonObject.getLong("id");
+                String shareImgPath = jsonObject.getString("shareImgPath");
+                String title = jsonObject.getString("title");
+                videoDetail.setCover(shareImgPath);
+                videoDetail.setTitle(title);
+                map.put(videoId, videoDetail);
+            }
+            return map;
+        } catch (IOException e) {
+            log.error("MessageAttachmentServiceImpl getVideDetail error", e);
+        }
+        return new HashMap<>();
+    }
+
+
+}

+ 220 - 0
api-module/src/main/java/com/tzld/piaoquan/api/service/Impl/UserServiceImpl.java

@@ -0,0 +1,220 @@
+package com.tzld.piaoquan.api.service.Impl;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.tzld.piaoquan.common.component.HttpPoolClient;
+import com.tzld.piaoquan.api.dao.mapper.StaffMapper;
+import com.tzld.piaoquan.api.dao.mapper.StaffWithUserMapper;
+import com.tzld.piaoquan.api.dao.mapper.UserMapper;
+import com.tzld.piaoquan.api.service.AccessTokenService;
+import com.tzld.piaoquan.api.service.UserService;
+import com.tzld.piaoquan.common.model.po.*;
+import com.tzld.piaoquan.common.utils.LarkRobotUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import static com.tzld.piaoquan.common.common.constant.WeComConstant.GET_WE_COM_EXTERNAL_CONTACT_GET;
+
+@Slf4j
+@Service
+public class UserServiceImpl implements UserService {
+    @Autowired
+    private HttpPoolClient httpPoolClient;
+
+    @Autowired
+    private AccessTokenService accessTokenService;
+
+    @Autowired
+    private UserMapper userMapper;
+
+    @Autowired
+    private StaffWithUserMapper staffWithUserMapper;
+
+    @Autowired
+    private StaffMapper staffMapper;
+
+    @Override
+    public void addStaffWithUser(String externalUserId, String carrierId, Long corpId) {
+        if (StringUtils.isEmpty(externalUserId) || StringUtils.isEmpty(carrierId)) {
+            return;
+        }
+        Staff staff = getStaff(carrierId);
+        insertStaffWithUser(externalUserId, staff, corpId);
+    }
+
+    @Override
+    public void insertStaffWithUser(String externalUserId, Staff staff, Long corpId) {
+        try {
+            UserExample userExample = new UserExample();
+            userExample.createCriteria().andExternalUserIdEqualTo(externalUserId);
+            List<User> userList = userMapper.selectByExample(userExample);
+            if (CollectionUtils.isEmpty(userList)) {
+                JSONObject userDetail = getUserDetail(externalUserId, corpId);
+                if (userDetail == null) {
+                    return;
+                }
+                JSONObject externalContact = userDetail.getJSONObject("external_contact");
+                JSONArray followUserList = userDetail.getJSONArray("follow_user");
+                Long createAt = null;
+                List<String> staffUserIdList = new ArrayList<>();
+                for (int i = 0; i < followUserList.size(); i++) {
+                    JSONObject followUser = followUserList.getJSONObject(i);
+                    if (createAt == null) {
+                        createAt = followUser.getLong("createtime");
+                    } else {
+                        createAt = Math.min(createAt, followUser.getLong("createtime"));
+                    }
+                    String userId = followUser.getString("userid");
+                    if (StringUtils.isNotEmpty(userId)) {
+                        staffUserIdList.add(userId);
+                    }
+                }
+                String name = externalContact.getString("name");
+                String unionId = externalContact.getString("unionid");
+                String avatar = externalContact.getString("avatar");
+                Integer type = externalContact.getInteger("type");
+                Integer gender = externalContact.getInteger("gender");
+                User user = new User();
+                user.setExternalUserId(externalUserId);
+                user.setCreatedAt(createAt);
+                user.setName(name);
+                user.setUnionId(unionId);
+                user.setAvatar(avatar);
+                user.setType(type);
+                user.setGender(gender);
+                user.setCorpId(corpId);
+                userMapper.insert(user);
+                Long userId = user.getId();
+                if (userId == null) {
+                    log.error("insertStaffWithUserJob insert user error user={}", user);
+                    return;
+                }
+                if (CollectionUtils.isEmpty(staffUserIdList)) {
+                    return;
+                }
+                for (String staffUserId : staffUserIdList) {
+                    StaffExample staffExample = new StaffExample();
+                    staffExample.createCriteria().andCarrierIdEqualTo(staffUserId);
+                    List<Staff> staffList1 = staffMapper.selectByExample(staffExample);
+                    if (CollectionUtils.isEmpty(staffList1)) {
+                        continue;
+                    }
+                    Staff staff1 = staffList1.get(0);
+                    Long staffId = staff1.getId();
+                    StaffWithUser staffWithUser = new StaffWithUser();
+                    staffWithUser.setStaffId(staffId);
+                    staffWithUser.setUserId(userId);
+                    staffWithUserMapper.insert(staffWithUser);
+                }
+            } else {
+                User user = userList.get(0);
+                StaffWithUserExample staffWithUserExample = new StaffWithUserExample();
+                staffWithUserExample.createCriteria().andUserIdEqualTo(user.getId()).andStaffIdEqualTo(staff.getId());
+                List<StaffWithUser> staffWithUserList = staffWithUserMapper.selectByExample(staffWithUserExample);
+                if (CollectionUtils.isEmpty(staffWithUserList)) {
+                    StaffWithUser staffWithUser = new StaffWithUser();
+                    staffWithUser.setStaffId(staff.getId());
+                    staffWithUser.setUserId(user.getId());
+                    staffWithUserMapper.insert(staffWithUser);
+                } else {
+                    StaffWithUser staffWithUser = staffWithUserList.get(0);
+                    if (staffWithUser.getIsDelete() == 1) {
+                        staffWithUser.setIsDelete(0);
+                        staffWithUserMapper.updateByPrimaryKeySelective(staffWithUser);
+                    }
+                }
+            }
+        } catch (Exception e) {
+            LarkRobotUtil.sendMessage("insertUser error externalUserId=" + externalUserId + e);
+            log.error("insertUser error", e);
+        }
+    }
+
+    @Override
+    public void delStaffWithUser(String externalUserId, String carrierId, Long deleteTime) {
+        if (StringUtils.isEmpty(externalUserId) || StringUtils.isEmpty(carrierId)) {
+            return;
+        }
+        Staff staff = getStaff(carrierId);
+        if (staff == null) {
+            return;
+        }
+        User user = getUser(externalUserId);
+        if (user == null) {
+            return;
+        }
+        StaffWithUserExample example = new StaffWithUserExample();
+        example.createCriteria().andStaffIdEqualTo(staff.getId()).andUserIdEqualTo(user.getId());
+        List<StaffWithUser> staffWithUserList = staffWithUserMapper.selectByExample(example);
+        if (CollectionUtils.isEmpty(staffWithUserList) || staffWithUserList.get(0).getIsDelete() == 1) {
+            return;
+        }
+        StaffWithUser staffWithUser = staffWithUserList.get(0);
+        staffWithUser.setDeleteTime(new Date());
+        staffWithUser.setIsDelete(1);
+        staffWithUserMapper.updateByPrimaryKeySelective(staffWithUser);
+    }
+
+    @Override
+    public void delStaffWithUser(Long userId, Long staffId, Long deleteTime) {
+        if (userId == null || staffId == null) {
+            return;
+        }
+        StaffWithUserExample example = new StaffWithUserExample();
+        example.createCriteria().andStaffIdEqualTo(staffId).andUserIdEqualTo(userId);
+        List<StaffWithUser> staffWithUserList = staffWithUserMapper.selectByExample(example);
+        if (CollectionUtils.isEmpty(staffWithUserList) || staffWithUserList.get(0).getIsDelete() == 1) {
+            return;
+        }
+        StaffWithUser staffWithUser = staffWithUserList.get(0);
+        if (deleteTime != null) {
+            staffWithUser.setDeleteTime(new Date(deleteTime));
+        }
+        staffWithUser.setIsDelete(1);
+        staffWithUserMapper.updateByPrimaryKeySelective(staffWithUser);
+    }
+
+
+    private Staff getStaff(String carrierId) {
+        StaffExample example = new StaffExample();
+        example.createCriteria().andCarrierIdEqualTo(carrierId);
+        List<Staff> staffList = staffMapper.selectByExample(example);
+        if (CollectionUtils.isEmpty(staffList)) {
+            log.error("getStaff staff empty carrierId={}", carrierId);
+            return null;
+        }
+        return staffList.get(0);
+    }
+
+    private User getUser(String externalUserId) {
+        UserExample userExample = new UserExample();
+        userExample.createCriteria().andExternalUserIdEqualTo(externalUserId);
+        List<User> userList = userMapper.selectByExample(userExample);
+        if (CollectionUtils.isEmpty(userList)) {
+            log.error("getUser user empty externalUserId={}", externalUserId);
+            return null;
+        }
+        return userList.get(0);
+    }
+
+
+    public JSONObject getUserDetail(String externalUserId, Long corpId) throws IOException {
+        String weComAccessToken = accessTokenService.getWeComAccessToken(corpId);
+        String url = String.format(GET_WE_COM_EXTERNAL_CONTACT_GET + "?access_token=%s&external_userid=%s", weComAccessToken, externalUserId);
+        String res = httpPoolClient.get(url);
+        JSONObject jsonObject = JSONObject.parseObject(res);
+        Integer errcode = jsonObject.getInteger("errcode");
+        if (errcode == 0) {
+            return jsonObject;
+        }
+        return null;
+    }
+}

+ 15 - 0
api-module/src/main/java/com/tzld/piaoquan/api/service/MessageAttachmentService.java

@@ -0,0 +1,15 @@
+package com.tzld.piaoquan.api.service;
+
+import com.tzld.piaoquan.common.common.base.CommonResponse;
+import com.tzld.piaoquan.common.model.po.MessageAttachment;
+import com.tzld.piaoquan.common.model.vo.GuaranteedParam;
+
+import java.util.List;
+
+public interface MessageAttachmentService {
+
+    void addMiniProgram(List<MessageAttachment> messageAttachmentList, Long createTime);
+
+    CommonResponse<Void> createGuaranteedMiniProgram(GuaranteedParam guaranteedParam);
+
+}

+ 16 - 0
api-module/src/main/java/com/tzld/piaoquan/api/service/UserService.java

@@ -0,0 +1,16 @@
+package com.tzld.piaoquan.api.service;
+
+import com.tzld.piaoquan.common.model.po.Staff;
+
+
+public interface UserService {
+
+
+    void addStaffWithUser(String externalUserId, String staffUserId, Long corpId);
+
+    void insertStaffWithUser(String externalUserId, Staff staff, Long corpId);
+
+    void delStaffWithUser(String externalUserId, String carrierId, Long deleteTime);
+
+    void delStaffWithUser(Long userId, Long staffId, Long deleteTime);
+}

+ 11 - 0
api-module/src/main/resources/application-dev.properties

@@ -0,0 +1,11 @@
+spring.datasource.username=crawler
+spring.datasource.password=crawler123456@
+spring.datasource.url=jdbc:mysql://rm-bp1k5853td1r25g3n690.mysql.rds.aliyuncs.com:3306/piaoquan-crawler?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true
+
+spring.redis.database=2
+spring.redis.host=r-bp154bpw97gptefiqkpd.redis.rds.aliyuncs.com
+spring.redis.port=6379
+spring.redis.password=Qingqu2019
+
+xxl.job.admin.addresses=http://xxl-job-test-internal.piaoquantv.com/xxl-job-admin
+

+ 12 - 0
api-module/src/main/resources/application-prod.properties

@@ -0,0 +1,12 @@
+spring.datasource.username=crawler
+spring.datasource.password=crawler123456@
+spring.datasource.url=jdbc:mysql://rm-bp17q95335a99272b.mysql.rds.aliyuncs.com:3306/growth?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true
+
+spring.redis.host=r-bp1m4nvh130sfjjc6f.redis.rds.aliyuncs.com
+spring.redis.port=6379
+spring.redis.password=Qingqu2019
+
+xxl.job.admin.addresses=http://xxl-job-internal.piaoquantv.com/xxl-job-admin
+
+
+

+ 11 - 0
api-module/src/main/resources/application-test.properties

@@ -0,0 +1,11 @@
+server.port=8080
+
+spring.datasource.username=crawler
+spring.datasource.password=crawler123456@
+spring.datasource.url=jdbc:mysql://rm-bp17q95335a99272b.mysql.rds.aliyuncs.com:3306/growth?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true
+
+spring.redis.host=r-bp1m4nvh130sfjjc6fpd.redis.rds.aliyuncs.com
+spring.redis.port=6379
+spring.redis.password=Qingqu2019
+
+xxl.job.admin.addresses=http://xxl-job-test-internal.piaoquantv.com/xxl-job-admin

+ 34 - 0
api-module/src/main/resources/application.properties

@@ -0,0 +1,34 @@
+logging.config=classpath:log4j2.xml
+spring.profiles.active=test
+spring.application.name=we-com-server
+
+spring.datasource.driver-class-name=com.mysql.jdbc.Driver
+spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
+spring.datasource.initialSize=5
+spring.datasource.maxActive=20
+spring.datasource.maxWait=60000
+spring.datasource.timeBetweenEvictionRunsMillis=60000
+spring.datasource.minEvictableIdleTimeMillis=300000
+spring.datasource.validationQuery=SELECT 1 FROM DUAL
+spring.datasource.testWhileIdle=true
+spring.datasource.testOnBorrow=false
+spring.datasource.testOnReturn=false
+spring.datasource.poolPreparedStatements=true
+
+spring.redis.lettuce.pool.max-active=8
+spring.redis.lettuce.pool.max-wait=-1
+spring.redis.lettuce.pool.max-idle=8
+spring.redis.lettuce.pool.min-idle=0
+
+datalog=/datalog
+
+xxl.job.accessToken=
+xxl.job.executor.appname=${spring.application.name}
+xxl.job.executor.address=
+xxl.job.executor.ip=
+xxl.job.executor.port=9999
+xxl.job.executor.logpath=${datalog}/xxl-job/
+xxl.job.executor.logretentiondays=30
+
+
+

+ 94 - 0
api-module/src/main/resources/log4j2.xml

@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--Configuration后面的status,这个用于设置log4j2自身内部的信息输出,可以不设置,当设置成trace时,你会看到log4j2内部各种详细输出-->
+<!--monitorInterval:Log4j能够自动检测修改配置 文件和重新配置本身,设置间隔秒数-->
+<configuration monitorInterval="5">
+    <!--日志级别以及优先级排序: OFF > FATAL > ERROR > WARN > INFO > DEBUG > TRACE > ALL -->
+
+    <!--变量配置-->
+    <Properties>
+        <!-- 格式化输出:%date表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度 %msg:日志消息,%n是换行符-->
+        <!-- %logger{36} 表示 Logger 名字最长36个字符 -->
+        <property name="LOG_PATTERN" value="%date{HH:mm:ss.SSS} [%thread] %-5level %logger{36}  - %msg%n" />
+        <!-- 定义日志存储的路径,不要配置相对路径 -->
+        <property name="FILE_PATH" value="/datalog" />
+        <!--项目名称-->
+        <property name="FILE_NAME" value="we_com_server" />
+    </Properties>
+
+    <appenders>
+
+        <console name="Console" target="SYSTEM_OUT">
+            <!--输出日志的格式-->
+            <PatternLayout pattern="${LOG_PATTERN}"/>
+            <!--控制台只输出level及其以上级别的信息(onMatch),其他的直接拒绝(onMismatch)-->
+            <ThresholdFilter level="info" onMatch="ACCEPT" onMismatch="DENY"/>
+        </console>
+
+
+        <!-- 这个会打印出所有的info及以下级别的信息,每次大小超过size,则这size大小的日志会自动存入按年份-月份建立的文件夹下面并进行压缩,作为存档-->
+        <RollingFile name="RollingFileInfo" fileName="${FILE_PATH}/${FILE_NAME}/info.log" filePattern="${FILE_PATH}/${FILE_NAME}-INFO-%d{yyyy-MM-dd}_%i.log.gz">
+            <!--控制台只输出level及以上级别的信息(onMatch),其他的直接拒绝(onMismatch)-->
+            <ThresholdFilter level="info" onMatch="ACCEPT" onMismatch="DENY"/>
+            <PatternLayout pattern="${LOG_PATTERN}"/>
+            <Policies>
+                <!--interval属性用来指定多久滚动一次,默认是1 hour-->
+                <TimeBasedTriggeringPolicy interval="1"/>
+                <SizeBasedTriggeringPolicy size="10MB"/>
+            </Policies>
+            <!-- DefaultRolloverStrategy属性如不设置,则默认为最多同一文件夹下7个文件开始覆盖-->
+            <DefaultRolloverStrategy max="15"/>
+        </RollingFile>
+
+        <!-- 这个会打印出所有的warn及以下级别的信息,每次大小超过size,则这size大小的日志会自动存入按年份-月份建立的文件夹下面并进行压缩,作为存档-->
+        <RollingFile name="RollingFileWarn" fileName="${FILE_PATH}/${FILE_NAME}/warn.log" filePattern="${FILE_PATH}/${FILE_NAME}-WARN-%d{yyyy-MM-dd}_%i.log.gz">
+            <!--控制台只输出level及以上级别的信息(onMatch),其他的直接拒绝(onMismatch)-->
+            <ThresholdFilter level="warn" onMatch="ACCEPT" onMismatch="DENY"/>
+            <PatternLayout pattern="${LOG_PATTERN}"/>
+            <Policies>
+                <!--interval属性用来指定多久滚动一次,默认是1 hour-->
+                <TimeBasedTriggeringPolicy interval="1"/>
+                <SizeBasedTriggeringPolicy size="10MB"/>
+            </Policies>
+            <!-- DefaultRolloverStrategy属性如不设置,则默认为最多同一文件夹下7个文件开始覆盖-->
+            <DefaultRolloverStrategy max="15"/>
+        </RollingFile>
+
+        <!-- 这个会打印出所有的error及以下级别的信息,每次大小超过size,则这size大小的日志会自动存入按年份-月份建立的文件夹下面并进行压缩,作为存档-->
+        <RollingFile name="RollingFileError" fileName="${FILE_PATH}/${FILE_NAME}/error.log" filePattern="${FILE_PATH}/${FILE_NAME}-ERROR-%d{yyyy-MM-dd}_%i.log.gz">
+            <!--控制台只输出level及以上级别的信息(onMatch),其他的直接拒绝(onMismatch)-->
+            <ThresholdFilter level="error" onMatch="ACCEPT" onMismatch="DENY"/>
+            <PatternLayout pattern="${LOG_PATTERN}"/>
+            <Policies>
+                <!--interval属性用来指定多久滚动一次,默认是1 hour-->
+                <TimeBasedTriggeringPolicy interval="1"/>
+                <SizeBasedTriggeringPolicy size="10MB"/>
+            </Policies>
+            <!-- DefaultRolloverStrategy属性如不设置,则默认为最多同一文件夹下7个文件开始覆盖-->
+            <DefaultRolloverStrategy max="15"/>
+        </RollingFile>
+
+    </appenders>
+
+    <!--Logger节点用来单独指定日志的形式,比如要为指定包下的class指定不同的日志级别等。-->
+    <!--然后定义loggers,只有定义了logger并引入的appender,appender才会生效-->
+    <loggers>
+
+        <!--过滤掉spring和mybatis的一些无用的DEBUG信息-->
+        <logger name="org.mybatis" level="info" additivity="false">
+            <AppenderRef ref="Console"/>
+        </logger>
+        <!--监控系统信息-->
+        <!--若是additivity设为false,则 子Logger 只会在自己的appender里输出,而不会在 父Logger 的appender里输出。-->
+        <Logger name="org.springframework" level="info" additivity="false">
+            <AppenderRef ref="Console"/>
+        </Logger>
+
+        <root level="info">
+            <appender-ref ref="Console"/>
+            <appender-ref ref="Filelog"/>
+            <appender-ref ref="RollingFileInfo"/>
+            <appender-ref ref="RollingFileWarn"/>
+            <appender-ref ref="RollingFileError"/>
+        </root>
+    </loggers>
+</configuration>

+ 246 - 0
api-module/src/main/resources/mapper/CorpMapper.xml

@@ -0,0 +1,246 @@
+<?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.common.dao.mapper.OfflineCorpMapper">
+  <resultMap id="BaseResultMap" type="com.tzld.piaoquan.common.model.po.Corp">
+    <id column="id" jdbcType="BIGINT" property="id" />
+    <result column="name" jdbcType="VARCHAR" property="name" />
+    <result column="corp_id" jdbcType="VARCHAR" property="corpId" />
+    <result column="secret" jdbcType="VARCHAR" property="secret" />
+    <result column="is_delete" jdbcType="INTEGER" property="isDelete" />
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
+  </resultMap>
+  <sql id="Example_Where_Clause">
+    <where>
+      <foreach collection="oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Update_By_Example_Where_Clause">
+    <where>
+      <foreach collection="example.oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Base_Column_List">
+    id, `name`, corp_id, secret, is_delete, create_time, update_time
+  </sql>
+  <select id="selectByExample" parameterType="com.tzld.piaoquan.common.model.po.CorpExample" resultMap="BaseResultMap">
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from we_com_corp
+    <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_corp
+    where id = #{id,jdbcType=BIGINT}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+    delete from we_com_corp
+    where id = #{id,jdbcType=BIGINT}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.tzld.piaoquan.common.model.po.CorpExample">
+    delete from we_com_corp
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.tzld.piaoquan.common.model.po.Corp">
+    insert into we_com_corp (id, `name`, corp_id, 
+      secret, is_delete, create_time, 
+      update_time)
+    values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{corpId,jdbcType=VARCHAR}, 
+      #{secret,jdbcType=VARCHAR}, #{isDelete,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, 
+      #{updateTime,jdbcType=TIMESTAMP})
+  </insert>
+  <insert id="insertSelective" parameterType="com.tzld.piaoquan.common.model.po.Corp">
+    insert into we_com_corp
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="name != null">
+        `name`,
+      </if>
+      <if test="corpId != null">
+        corp_id,
+      </if>
+      <if test="secret != null">
+        secret,
+      </if>
+      <if test="isDelete != null">
+        is_delete,
+      </if>
+      <if test="createTime != null">
+        create_time,
+      </if>
+      <if test="updateTime != null">
+        update_time,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=BIGINT},
+      </if>
+      <if test="name != null">
+        #{name,jdbcType=VARCHAR},
+      </if>
+      <if test="corpId != null">
+        #{corpId,jdbcType=VARCHAR},
+      </if>
+      <if test="secret != null">
+        #{secret,jdbcType=VARCHAR},
+      </if>
+      <if test="isDelete != null">
+        #{isDelete,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null">
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateTime != null">
+        #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="com.tzld.piaoquan.common.model.po.CorpExample" resultType="java.lang.Long">
+    select count(*) from we_com_corp
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map">
+    update we_com_corp
+    <set>
+      <if test="record.id != null">
+        id = #{record.id,jdbcType=BIGINT},
+      </if>
+      <if test="record.name != null">
+        `name` = #{record.name,jdbcType=VARCHAR},
+      </if>
+      <if test="record.corpId != null">
+        corp_id = #{record.corpId,jdbcType=VARCHAR},
+      </if>
+      <if test="record.secret != null">
+        secret = #{record.secret,jdbcType=VARCHAR},
+      </if>
+      <if test="record.isDelete != null">
+        is_delete = #{record.isDelete,jdbcType=INTEGER},
+      </if>
+      <if test="record.createTime != null">
+        create_time = #{record.createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="record.updateTime != null">
+        update_time = #{record.updateTime,jdbcType=TIMESTAMP},
+      </if>
+    </set>
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExample" parameterType="map">
+    update we_com_corp
+    set id = #{record.id,jdbcType=BIGINT},
+      `name` = #{record.name,jdbcType=VARCHAR},
+      corp_id = #{record.corpId,jdbcType=VARCHAR},
+      secret = #{record.secret,jdbcType=VARCHAR},
+      is_delete = #{record.isDelete,jdbcType=INTEGER},
+      create_time = #{record.createTime,jdbcType=TIMESTAMP},
+      update_time = #{record.updateTime,jdbcType=TIMESTAMP}
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.tzld.piaoquan.common.model.po.Corp">
+    update we_com_corp
+    <set>
+      <if test="name != null">
+        `name` = #{name,jdbcType=VARCHAR},
+      </if>
+      <if test="corpId != null">
+        corp_id = #{corpId,jdbcType=VARCHAR},
+      </if>
+      <if test="secret != null">
+        secret = #{secret,jdbcType=VARCHAR},
+      </if>
+      <if test="isDelete != null">
+        is_delete = #{isDelete,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null">
+        create_time = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateTime != null">
+        update_time = #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+    </set>
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.tzld.piaoquan.common.model.po.Corp">
+    update we_com_corp
+    set `name` = #{name,jdbcType=VARCHAR},
+      corp_id = #{corpId,jdbcType=VARCHAR},
+      secret = #{secret,jdbcType=VARCHAR},
+      is_delete = #{isDelete,jdbcType=INTEGER},
+      create_time = #{createTime,jdbcType=TIMESTAMP},
+      update_time = #{updateTime,jdbcType=TIMESTAMP}
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+</mapper>

+ 246 - 0
api-module/src/main/resources/mapper/GuaranteesVideoMapper.xml

@@ -0,0 +1,246 @@
+<?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.common.dao.mapper.OfflineGuaranteesVideoMapper">
+  <resultMap id="BaseResultMap" type="com.tzld.piaoquan.common.model.po.GuaranteesVideo">
+    <id column="id" jdbcType="BIGINT" property="id" />
+    <result column="date" jdbcType="VARCHAR" property="date" />
+    <result column="staff_id" jdbcType="BIGINT" property="staffId" />
+    <result column="video_ids" jdbcType="VARCHAR" property="videoIds" />
+    <result column="is_delete" jdbcType="INTEGER" property="isDelete" />
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
+  </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`, staff_id, video_ids, is_delete, create_time, update_time
+  </sql>
+  <select id="selectByExample" parameterType="com.tzld.piaoquan.common.model.po.GuaranteesVideoExample" resultMap="BaseResultMap">
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from we_com_guarantees_video
+    <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_guarantees_video
+    where id = #{id,jdbcType=BIGINT}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+    delete from we_com_guarantees_video
+    where id = #{id,jdbcType=BIGINT}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.tzld.piaoquan.common.model.po.GuaranteesVideoExample">
+    delete from we_com_guarantees_video
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.tzld.piaoquan.common.model.po.GuaranteesVideo">
+    insert into we_com_guarantees_video (id, `date`, staff_id, 
+      video_ids, is_delete, create_time, 
+      update_time)
+    values (#{id,jdbcType=BIGINT}, #{date,jdbcType=VARCHAR}, #{staffId,jdbcType=BIGINT}, 
+      #{videoIds,jdbcType=VARCHAR}, #{isDelete,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, 
+      #{updateTime,jdbcType=TIMESTAMP})
+  </insert>
+  <insert id="insertSelective" parameterType="com.tzld.piaoquan.common.model.po.GuaranteesVideo">
+    insert into we_com_guarantees_video
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="date != null">
+        `date`,
+      </if>
+      <if test="staffId != null">
+        staff_id,
+      </if>
+      <if test="videoIds != null">
+        video_ids,
+      </if>
+      <if test="isDelete != null">
+        is_delete,
+      </if>
+      <if test="createTime != null">
+        create_time,
+      </if>
+      <if test="updateTime != null">
+        update_time,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=BIGINT},
+      </if>
+      <if test="date != null">
+        #{date,jdbcType=VARCHAR},
+      </if>
+      <if test="staffId != null">
+        #{staffId,jdbcType=BIGINT},
+      </if>
+      <if test="videoIds != null">
+        #{videoIds,jdbcType=VARCHAR},
+      </if>
+      <if test="isDelete != null">
+        #{isDelete,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null">
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateTime != null">
+        #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="com.tzld.piaoquan.common.model.po.GuaranteesVideoExample" resultType="java.lang.Long">
+    select count(*) from we_com_guarantees_video
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map">
+    update we_com_guarantees_video
+    <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.staffId != null">
+        staff_id = #{record.staffId,jdbcType=BIGINT},
+      </if>
+      <if test="record.videoIds != null">
+        video_ids = #{record.videoIds,jdbcType=VARCHAR},
+      </if>
+      <if test="record.isDelete != null">
+        is_delete = #{record.isDelete,jdbcType=INTEGER},
+      </if>
+      <if test="record.createTime != null">
+        create_time = #{record.createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="record.updateTime != null">
+        update_time = #{record.updateTime,jdbcType=TIMESTAMP},
+      </if>
+    </set>
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExample" parameterType="map">
+    update we_com_guarantees_video
+    set id = #{record.id,jdbcType=BIGINT},
+      `date` = #{record.date,jdbcType=VARCHAR},
+      staff_id = #{record.staffId,jdbcType=BIGINT},
+      video_ids = #{record.videoIds,jdbcType=VARCHAR},
+      is_delete = #{record.isDelete,jdbcType=INTEGER},
+      create_time = #{record.createTime,jdbcType=TIMESTAMP},
+      update_time = #{record.updateTime,jdbcType=TIMESTAMP}
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.tzld.piaoquan.common.model.po.GuaranteesVideo">
+    update we_com_guarantees_video
+    <set>
+      <if test="date != null">
+        `date` = #{date,jdbcType=VARCHAR},
+      </if>
+      <if test="staffId != null">
+        staff_id = #{staffId,jdbcType=BIGINT},
+      </if>
+      <if test="videoIds != null">
+        video_ids = #{videoIds,jdbcType=VARCHAR},
+      </if>
+      <if test="isDelete != null">
+        is_delete = #{isDelete,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null">
+        create_time = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateTime != null">
+        update_time = #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+    </set>
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.tzld.piaoquan.common.model.po.GuaranteesVideo">
+    update we_com_guarantees_video
+    set `date` = #{date,jdbcType=VARCHAR},
+      staff_id = #{staffId,jdbcType=BIGINT},
+      video_ids = #{videoIds,jdbcType=VARCHAR},
+      is_delete = #{isDelete,jdbcType=INTEGER},
+      create_time = #{createTime,jdbcType=TIMESTAMP},
+      update_time = #{updateTime,jdbcType=TIMESTAMP}
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+</mapper>

+ 356 - 0
api-module/src/main/resources/mapper/MessageAttachmentMapper.xml

@@ -0,0 +1,356 @@
+<?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.common.dao.mapper.OfflineMessageAttachmentMapper">
+  <resultMap id="BaseResultMap" type="com.tzld.piaoquan.common.model.po.MessageAttachment">
+    <id column="id" jdbcType="BIGINT" property="id" />
+    <result column="staff_id" jdbcType="BIGINT" property="staffId" />
+    <result column="type" jdbcType="INTEGER" property="type" />
+    <result column="url" jdbcType="VARCHAR" property="url" />
+    <result column="title" jdbcType="VARCHAR" property="title" />
+    <result column="desc" jdbcType="VARCHAR" property="desc" />
+    <result column="appid" jdbcType="VARCHAR" property="appid" />
+    <result column="page" jdbcType="VARCHAR" property="page" />
+    <result column="cover" jdbcType="VARCHAR" property="cover" />
+    <result column="miniprogram_video_id" jdbcType="BIGINT" property="miniprogramVideoId" />
+    <result column="is_delete" jdbcType="INTEGER" property="isDelete" />
+    <result column="send_time" jdbcType="TIMESTAMP" property="sendTime" />
+    <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, staff_id, `type`, url, title, `desc`, appid, page, cover, miniprogram_video_id, 
+    is_delete, send_time, create_time, update_time
+  </sql>
+  <select id="selectByExample" parameterType="com.tzld.piaoquan.common.model.po.MessageAttachmentExample" resultMap="BaseResultMap">
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from we_com_message_attachment
+    <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_message_attachment
+    where id = #{id,jdbcType=BIGINT}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+    delete from we_com_message_attachment
+    where id = #{id,jdbcType=BIGINT}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.tzld.piaoquan.common.model.po.MessageAttachmentExample">
+    delete from we_com_message_attachment
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.tzld.piaoquan.common.model.po.MessageAttachment">
+    insert into we_com_message_attachment (id, staff_id, `type`, 
+      url, title, `desc`, appid, 
+      page, cover, miniprogram_video_id, 
+      send_time, create_time,
+      update_time)
+    values (#{id,jdbcType=BIGINT}, #{staffId,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}, 
+      #{sendTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP},
+      #{updateTime,jdbcType=TIMESTAMP})
+  </insert>
+  <insert id="insertSelective" parameterType="com.tzld.piaoquan.common.model.po.MessageAttachment">
+    insert into we_com_message_attachment
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="staffId != null">
+        staff_id,
+      </if>
+      <if test="type != null">
+        `type`,
+      </if>
+      <if test="url != null">
+        url,
+      </if>
+      <if test="title != null">
+        title,
+      </if>
+      <if test="desc != null">
+        `desc`,
+      </if>
+      <if test="appid != null">
+        appid,
+      </if>
+      <if test="page != null">
+        page,
+      </if>
+      <if test="cover != null">
+        cover,
+      </if>
+      <if test="miniprogramVideoId != null">
+        miniprogram_video_id,
+      </if>
+      <if test="isDelete != null">
+        is_delete,
+      </if>
+      <if test="sendTime != null">
+        send_time,
+      </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="staffId != null">
+        #{staffId,jdbcType=BIGINT},
+      </if>
+      <if test="type != null">
+        #{type,jdbcType=INTEGER},
+      </if>
+      <if test="url != null">
+        #{url,jdbcType=VARCHAR},
+      </if>
+      <if test="title != null">
+        #{title,jdbcType=VARCHAR},
+      </if>
+      <if test="desc != null">
+        #{desc,jdbcType=VARCHAR},
+      </if>
+      <if test="appid != null">
+        #{appid,jdbcType=VARCHAR},
+      </if>
+      <if test="page != null">
+        #{page,jdbcType=VARCHAR},
+      </if>
+      <if test="cover != null">
+        #{cover,jdbcType=VARCHAR},
+      </if>
+      <if test="miniprogramVideoId != null">
+        #{miniprogramVideoId,jdbcType=BIGINT},
+      </if>
+      <if test="isDelete != null">
+        #{isDelete,jdbcType=INTEGER},
+      </if>
+      <if test="sendTime != null">
+        #{sendTime,jdbcType=TIMESTAMP},
+      </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.common.model.po.MessageAttachmentExample" resultType="java.lang.Long">
+    select count(*) from we_com_message_attachment
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map">
+    update we_com_message_attachment
+    <set>
+      <if test="record.id != null">
+        id = #{record.id,jdbcType=BIGINT},
+      </if>
+      <if test="record.staffId != null">
+        staff_id = #{record.staffId,jdbcType=BIGINT},
+      </if>
+      <if test="record.type != null">
+        `type` = #{record.type,jdbcType=INTEGER},
+      </if>
+      <if test="record.url != null">
+        url = #{record.url,jdbcType=VARCHAR},
+      </if>
+      <if test="record.title != null">
+        title = #{record.title,jdbcType=VARCHAR},
+      </if>
+      <if test="record.desc != null">
+        `desc` = #{record.desc,jdbcType=VARCHAR},
+      </if>
+      <if test="record.appid != null">
+        appid = #{record.appid,jdbcType=VARCHAR},
+      </if>
+      <if test="record.page != null">
+        page = #{record.page,jdbcType=VARCHAR},
+      </if>
+      <if test="record.cover != null">
+        cover = #{record.cover,jdbcType=VARCHAR},
+      </if>
+      <if test="record.miniprogramVideoId != null">
+        miniprogram_video_id = #{record.miniprogramVideoId,jdbcType=BIGINT},
+      </if>
+      <if test="record.isDelete != null">
+        is_delete = #{record.isDelete,jdbcType=INTEGER},
+      </if>
+      <if test="record.sendTime != null">
+        send_time = #{record.sendTime,jdbcType=TIMESTAMP},
+      </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_message_attachment
+    set id = #{record.id,jdbcType=BIGINT},
+      staff_id = #{record.staffId,jdbcType=BIGINT},
+      `type` = #{record.type,jdbcType=INTEGER},
+      url = #{record.url,jdbcType=VARCHAR},
+      title = #{record.title,jdbcType=VARCHAR},
+      `desc` = #{record.desc,jdbcType=VARCHAR},
+      appid = #{record.appid,jdbcType=VARCHAR},
+      page = #{record.page,jdbcType=VARCHAR},
+      cover = #{record.cover,jdbcType=VARCHAR},
+      miniprogram_video_id = #{record.miniprogramVideoId,jdbcType=BIGINT},
+      is_delete = #{record.isDelete,jdbcType=INTEGER},
+      send_time = #{record.sendTime,jdbcType=TIMESTAMP},
+      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.common.model.po.MessageAttachment">
+    update we_com_message_attachment
+    <set>
+      <if test="staffId != null">
+        staff_id = #{staffId,jdbcType=BIGINT},
+      </if>
+      <if test="type != null">
+        `type` = #{type,jdbcType=INTEGER},
+      </if>
+      <if test="url != null">
+        url = #{url,jdbcType=VARCHAR},
+      </if>
+      <if test="title != null">
+        title = #{title,jdbcType=VARCHAR},
+      </if>
+      <if test="desc != null">
+        `desc` = #{desc,jdbcType=VARCHAR},
+      </if>
+      <if test="appid != null">
+        appid = #{appid,jdbcType=VARCHAR},
+      </if>
+      <if test="page != null">
+        page = #{page,jdbcType=VARCHAR},
+      </if>
+      <if test="cover != null">
+        cover = #{cover,jdbcType=VARCHAR},
+      </if>
+      <if test="miniprogramVideoId != null">
+        miniprogram_video_id = #{miniprogramVideoId,jdbcType=BIGINT},
+      </if>
+      <if test="isDelete != null">
+        is_delete = #{isDelete,jdbcType=INTEGER},
+      </if>
+      <if test="sendTime != null">
+        send_time = #{sendTime,jdbcType=TIMESTAMP},
+      </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.common.model.po.MessageAttachment">
+    update we_com_message_attachment
+    set staff_id = #{staffId,jdbcType=BIGINT},
+      `type` = #{type,jdbcType=INTEGER},
+      url = #{url,jdbcType=VARCHAR},
+      title = #{title,jdbcType=VARCHAR},
+      `desc` = #{desc,jdbcType=VARCHAR},
+      appid = #{appid,jdbcType=VARCHAR},
+      page = #{page,jdbcType=VARCHAR},
+      cover = #{cover,jdbcType=VARCHAR},
+      miniprogram_video_id = #{miniprogramVideoId,jdbcType=BIGINT},
+      is_delete = #{isDelete,jdbcType=INTEGER},
+      send_time = #{sendTime,jdbcType=TIMESTAMP},
+      create_time = #{createTime,jdbcType=TIMESTAMP},
+      update_time = #{updateTime,jdbcType=TIMESTAMP}
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+</mapper>

+ 294 - 0
api-module/src/main/resources/mapper/StaffMapper.xml

@@ -0,0 +1,294 @@
+<?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.common.dao.mapper.OfflineStaffMapper">
+  <resultMap id="BaseResultMap" type="com.tzld.piaoquan.common.model.po.Staff">
+    <id column="id" jdbcType="BIGINT" property="id" />
+    <result column="corp_id" jdbcType="BIGINT" property="corpId" />
+    <result column="staff_ext_id" jdbcType="VARCHAR" property="staffExtId" />
+    <result column="carrier_id" jdbcType="VARCHAR" property="carrierId" />
+    <result column="remark" jdbcType="VARCHAR" property="remark" />
+    <result column="category1" jdbcType="VARCHAR" property="category1" />
+    <result column="category2" jdbcType="VARCHAR" property="category2" />
+    <result column="is_delete" jdbcType="INTEGER" property="isDelete" />
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
+  </resultMap>
+  <sql id="Example_Where_Clause">
+    <where>
+      <foreach collection="oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Update_By_Example_Where_Clause">
+    <where>
+      <foreach collection="example.oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Base_Column_List">
+    id, corp_id, staff_ext_id, carrier_id, remark, category1, category2, is_delete, create_time, 
+    update_time
+  </sql>
+  <select id="selectByExample" parameterType="com.tzld.piaoquan.common.model.po.StaffExample" resultMap="BaseResultMap">
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from we_com_staff
+    <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
+    where id = #{id,jdbcType=BIGINT}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+    delete from we_com_staff
+    where id = #{id,jdbcType=BIGINT}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.tzld.piaoquan.common.model.po.StaffExample">
+    delete from we_com_staff
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.tzld.piaoquan.common.model.po.Staff">
+    insert into we_com_staff (id, corp_id, staff_ext_id, 
+      carrier_id, remark, category1, 
+      category2, create_time,
+      update_time)
+    values (#{id,jdbcType=BIGINT}, #{corpId,jdbcType=BIGINT}, #{staffExtId,jdbcType=VARCHAR}, 
+      #{carrierId,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{category1,jdbcType=VARCHAR}, 
+      #{category2,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
+      #{updateTime,jdbcType=TIMESTAMP})
+  </insert>
+  <insert id="insertSelective" parameterType="com.tzld.piaoquan.common.model.po.Staff">
+    insert into we_com_staff
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="corpId != null">
+        corp_id,
+      </if>
+      <if test="staffExtId != null">
+        staff_ext_id,
+      </if>
+      <if test="carrierId != null">
+        carrier_id,
+      </if>
+      <if test="remark != null">
+        remark,
+      </if>
+      <if test="category1 != null">
+        category1,
+      </if>
+      <if test="category2 != null">
+        category2,
+      </if>
+      <if test="isDelete != null">
+        is_delete,
+      </if>
+      <if test="createTime != null">
+        create_time,
+      </if>
+      <if test="updateTime != null">
+        update_time,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=BIGINT},
+      </if>
+      <if test="corpId != null">
+        #{corpId,jdbcType=BIGINT},
+      </if>
+      <if test="staffExtId != null">
+        #{staffExtId,jdbcType=VARCHAR},
+      </if>
+      <if test="carrierId != null">
+        #{carrierId,jdbcType=VARCHAR},
+      </if>
+      <if test="remark != null">
+        #{remark,jdbcType=VARCHAR},
+      </if>
+      <if test="category1 != null">
+        #{category1,jdbcType=VARCHAR},
+      </if>
+      <if test="category2 != null">
+        #{category2,jdbcType=VARCHAR},
+      </if>
+      <if test="isDelete != null">
+        #{isDelete,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null">
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateTime != null">
+        #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="com.tzld.piaoquan.common.model.po.StaffExample" resultType="java.lang.Long">
+    select count(*) from we_com_staff
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map">
+    update we_com_staff
+    <set>
+      <if test="record.id != null">
+        id = #{record.id,jdbcType=BIGINT},
+      </if>
+      <if test="record.corpId != null">
+        corp_id = #{record.corpId,jdbcType=BIGINT},
+      </if>
+      <if test="record.staffExtId != null">
+        staff_ext_id = #{record.staffExtId,jdbcType=VARCHAR},
+      </if>
+      <if test="record.carrierId != null">
+        carrier_id = #{record.carrierId,jdbcType=VARCHAR},
+      </if>
+      <if test="record.remark != null">
+        remark = #{record.remark,jdbcType=VARCHAR},
+      </if>
+      <if test="record.category1 != null">
+        category1 = #{record.category1,jdbcType=VARCHAR},
+      </if>
+      <if test="record.category2 != null">
+        category2 = #{record.category2,jdbcType=VARCHAR},
+      </if>
+      <if test="record.isDelete != null">
+        is_delete = #{record.isDelete,jdbcType=INTEGER},
+      </if>
+      <if test="record.createTime != null">
+        create_time = #{record.createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="record.updateTime != null">
+        update_time = #{record.updateTime,jdbcType=TIMESTAMP},
+      </if>
+    </set>
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExample" parameterType="map">
+    update we_com_staff
+    set id = #{record.id,jdbcType=BIGINT},
+      corp_id = #{record.corpId,jdbcType=BIGINT},
+      staff_ext_id = #{record.staffExtId,jdbcType=VARCHAR},
+      carrier_id = #{record.carrierId,jdbcType=VARCHAR},
+      remark = #{record.remark,jdbcType=VARCHAR},
+      category1 = #{record.category1,jdbcType=VARCHAR},
+      category2 = #{record.category2,jdbcType=VARCHAR},
+      is_delete = #{record.isDelete,jdbcType=INTEGER},
+      create_time = #{record.createTime,jdbcType=TIMESTAMP},
+      update_time = #{record.updateTime,jdbcType=TIMESTAMP}
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.tzld.piaoquan.common.model.po.Staff">
+    update we_com_staff
+    <set>
+      <if test="corpId != null">
+        corp_id = #{corpId,jdbcType=BIGINT},
+      </if>
+      <if test="staffExtId != null">
+        staff_ext_id = #{staffExtId,jdbcType=VARCHAR},
+      </if>
+      <if test="carrierId != null">
+        carrier_id = #{carrierId,jdbcType=VARCHAR},
+      </if>
+      <if test="remark != null">
+        remark = #{remark,jdbcType=VARCHAR},
+      </if>
+      <if test="category1 != null">
+        category1 = #{category1,jdbcType=VARCHAR},
+      </if>
+      <if test="category2 != null">
+        category2 = #{category2,jdbcType=VARCHAR},
+      </if>
+      <if test="isDelete != null">
+        is_delete = #{isDelete,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null">
+        create_time = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateTime != null">
+        update_time = #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+    </set>
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.tzld.piaoquan.common.model.po.Staff">
+    update we_com_staff
+    set corp_id = #{corpId,jdbcType=BIGINT},
+      staff_ext_id = #{staffExtId,jdbcType=VARCHAR},
+      carrier_id = #{carrierId,jdbcType=VARCHAR},
+      remark = #{remark,jdbcType=VARCHAR},
+      category1 = #{category1,jdbcType=VARCHAR},
+      category2 = #{category2,jdbcType=VARCHAR},
+      is_delete = #{isDelete,jdbcType=INTEGER},
+      create_time = #{createTime,jdbcType=TIMESTAMP},
+      update_time = #{updateTime,jdbcType=TIMESTAMP}
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+</mapper>

+ 277 - 0
api-module/src/main/resources/mapper/StaffWithUserMapper.xml

@@ -0,0 +1,277 @@
+<?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.common.dao.mapper.OfflineStaffWithUserMapper">
+  <resultMap id="BaseResultMap" type="com.tzld.piaoquan.common.model.po.StaffWithUser">
+    <id column="id" jdbcType="BIGINT" property="id" />
+    <result column="staff_id" jdbcType="BIGINT" property="staffId" />
+    <result column="user_id" jdbcType="BIGINT" property="userId" />
+    <result column="is_delete" jdbcType="INTEGER" property="isDelete" />
+    <result column="delete_time" jdbcType="TIMESTAMP" property="deleteTime" />
+    <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, staff_id, user_id, is_delete, delete_time, create_time, update_time
+  </sql>
+  <select id="selectByExample" parameterType="com.tzld.piaoquan.common.model.po.StaffWithUserExample" resultMap="BaseResultMap">
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from we_com_staff_with_user
+    <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_with_user
+    where id = #{id,jdbcType=BIGINT}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+    delete from we_com_staff_with_user
+    where id = #{id,jdbcType=BIGINT}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.tzld.piaoquan.common.model.po.StaffWithUserExample">
+    delete from we_com_staff_with_user
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.tzld.piaoquan.common.model.po.StaffWithUser">
+    insert into we_com_staff_with_user (id, staff_id, user_id, delete_time, create_time,
+      update_time)
+    values (#{id,jdbcType=BIGINT}, #{staffId,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT},
+      #{deleteTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP},
+      #{updateTime,jdbcType=TIMESTAMP})
+  </insert>
+  <insert id="insertSelective" parameterType="com.tzld.piaoquan.common.model.po.StaffWithUser">
+    insert into we_com_staff_with_user
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="staffId != null">
+        staff_id,
+      </if>
+      <if test="userId != null">
+        user_id,
+      </if>
+      <if test="isDelete != null">
+        is_delete,
+      </if>
+      <if test="deleteTime != null">
+        delete_time,
+      </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="staffId != null">
+        #{staffId,jdbcType=BIGINT},
+      </if>
+      <if test="userId != null">
+        #{userId,jdbcType=BIGINT},
+      </if>
+      <if test="isDelete != null">
+        #{isDelete,jdbcType=INTEGER},
+      </if>
+      <if test="deleteTime != null">
+        #{deleteTime,jdbcType=TIMESTAMP},
+      </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.common.model.po.StaffWithUserExample" resultType="java.lang.Long">
+    select count(*) from we_com_staff_with_user
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map">
+    update we_com_staff_with_user
+    <set>
+      <if test="record.id != null">
+        id = #{record.id,jdbcType=BIGINT},
+      </if>
+      <if test="record.staffId != null">
+        staff_id = #{record.staffId,jdbcType=BIGINT},
+      </if>
+      <if test="record.userId != null">
+        user_id = #{record.userId,jdbcType=BIGINT},
+      </if>
+      <if test="record.isDelete != null">
+        is_delete = #{record.isDelete,jdbcType=INTEGER},
+      </if>
+      <if test="record.deleteTime != null">
+        delete_time = #{record.deleteTime,jdbcType=TIMESTAMP},
+      </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_with_user
+    set id = #{record.id,jdbcType=BIGINT},
+      staff_id = #{record.staffId,jdbcType=BIGINT},
+      user_id = #{record.userId,jdbcType=BIGINT},
+      is_delete = #{record.isDelete,jdbcType=INTEGER},
+      delete_time = #{record.deleteTime,jdbcType=TIMESTAMP},
+      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.common.model.po.StaffWithUser">
+    update we_com_staff_with_user
+    <set>
+      <if test="staffId != null">
+        staff_id = #{staffId,jdbcType=BIGINT},
+      </if>
+      <if test="userId != null">
+        user_id = #{userId,jdbcType=BIGINT},
+      </if>
+      <if test="isDelete != null">
+        is_delete = #{isDelete,jdbcType=INTEGER},
+      </if>
+      <if test="deleteTime != null">
+        delete_time = #{deleteTime,jdbcType=TIMESTAMP},
+      </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.common.model.po.StaffWithUser">
+    update we_com_staff_with_user
+    set staff_id = #{staffId,jdbcType=BIGINT},
+      user_id = #{userId,jdbcType=BIGINT},
+      is_delete = #{isDelete,jdbcType=INTEGER},
+      delete_time = #{deleteTime,jdbcType=TIMESTAMP},
+      create_time = #{createTime,jdbcType=TIMESTAMP},
+      update_time = #{updateTime,jdbcType=TIMESTAMP}
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+
+  <insert id="insertList" parameterType="java.util.List">
+    insert into we_com_staff_with_user
+    (
+    staff_id,
+    user_id,
+    is_delete,
+    delete_time,
+    create_time,
+    update_time
+    )
+    values
+    <foreach collection="list" item="item" separator=",">
+      (
+      #{item.staffId,jdbcType=BIGINT},
+      #{item.userId,jdbcType=BIGINT},
+      #{item.isDelete,jdbcType=INTEGER},
+      #{item.deleteTime,jdbcType=TIMESTAMP},
+      #{item.createTime,jdbcType=TIMESTAMP},
+      #{item.updateTime,jdbcType=TIMESTAMP}
+      )
+    </foreach>
+  </insert>
+
+  <select id="selectExternalUserIdByStaffId" parameterType="java.lang.Long" resultType="java.lang.String">
+    select t2.external_user_id
+    from we_com_staff_with_user t1
+    left join we_com_user t2
+    on t1.user_id = t2.id
+    where t1.staff_id = #{staffId,jdbcType=BIGINT}
+    and t2.external_user_id is not null
+  </select>
+</mapper>

+ 419 - 0
api-module/src/main/resources/mapper/UserMapper.xml

@@ -0,0 +1,419 @@
+<?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.api.dao.mapper.UserMapper">
+  <resultMap id="BaseResultMap" type="com.tzld.piaoquan.common.model.po.User">
+    <id column="id" jdbcType="BIGINT" property="id" />
+    <result column="corp_id" jdbcType="BIGINT" property="corpId" />
+    <result column="external_user_id" jdbcType="VARCHAR" property="externalUserId" />
+    <result column="union_id" jdbcType="VARCHAR" property="unionId" />
+    <result column="external_user_id_3rd_party" jdbcType="VARCHAR" property="externalUserId3rdParty" />
+    <result column="type" jdbcType="INTEGER" property="type" />
+    <result column="name" jdbcType="VARCHAR" property="name" />
+    <result column="avatar" jdbcType="VARCHAR" property="avatar" />
+    <result column="gender" jdbcType="INTEGER" property="gender" />
+    <result column="is_delete" jdbcType="INTEGER" property="isDelete" />
+    <result column="created_at" jdbcType="BIGINT" property="createdAt" />
+    <result column="updated_at" jdbcType="BIGINT" property="updatedAt" />
+    <result column="deleted_at" jdbcType="BIGINT" property="deletedAt" />
+    <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, corp_id, external_user_id, union_id, external_user_id_3rd_party, `type`, `name`, 
+    avatar, gender, is_delete, created_at, updated_at, deleted_at, create_time, update_time
+  </sql>
+  <select id="selectByExample" parameterType="com.tzld.piaoquan.common.model.po.UserExample" resultMap="BaseResultMap">
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from we_com_user
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+    <if test="orderByClause != null">
+      order by ${orderByClause}
+    </if>
+    <if test="page != null">
+      limit #{page.offset} , #{page.pageSize}
+    </if>
+  </select>
+  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
+    select 
+    <include refid="Base_Column_List" />
+    from we_com_user
+    where id = #{id,jdbcType=BIGINT}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+    delete from we_com_user
+    where id = #{id,jdbcType=BIGINT}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.tzld.piaoquan.common.model.po.UserExample">
+    delete from we_com_user
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.tzld.piaoquan.common.model.po.User" useGeneratedKeys="true" keyProperty="id">
+    insert into we_com_user (id, corp_id, external_user_id, 
+      union_id, external_user_id_3rd_party, `type`, 
+      `name`, avatar, gender, 
+      created_at, updated_at,
+      deleted_at, create_time, update_time
+      )
+    values (#{id,jdbcType=BIGINT}, #{corpId,jdbcType=BIGINT}, #{externalUserId,jdbcType=VARCHAR}, 
+      #{unionId,jdbcType=VARCHAR}, #{externalUserId3rdParty,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER}, 
+      #{name,jdbcType=VARCHAR}, #{avatar,jdbcType=VARCHAR}, #{gender,jdbcType=INTEGER}, 
+      #{createdAt,jdbcType=BIGINT}, #{updatedAt,jdbcType=BIGINT},
+      #{deletedAt,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
+      )
+    <selectKey resultType="java.lang.Long" order="AFTER" keyProperty="id">
+      select LAST_INSERT_ID()
+    </selectKey>
+  </insert>
+  <insert id="insertSelective" parameterType="com.tzld.piaoquan.common.model.po.User">
+    insert into we_com_user
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="corpId != null">
+        corp_id,
+      </if>
+      <if test="externalUserId != null">
+        external_user_id,
+      </if>
+      <if test="unionId != null">
+        union_id,
+      </if>
+      <if test="externalUserId3rdParty != null">
+        external_user_id_3rd_party,
+      </if>
+      <if test="type != null">
+        `type`,
+      </if>
+      <if test="name != null">
+        `name`,
+      </if>
+      <if test="avatar != null">
+        avatar,
+      </if>
+      <if test="gender != null">
+        gender,
+      </if>
+      <if test="isDelete != null">
+        is_delete,
+      </if>
+      <if test="createdAt != null">
+        created_at,
+      </if>
+      <if test="updatedAt != null">
+        updated_at,
+      </if>
+      <if test="deletedAt != null">
+        deleted_at,
+      </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="corpId != null">
+        #{corpId,jdbcType=BIGINT},
+      </if>
+      <if test="externalUserId != null">
+        #{externalUserId,jdbcType=VARCHAR},
+      </if>
+      <if test="unionId != null">
+        #{unionId,jdbcType=VARCHAR},
+      </if>
+      <if test="externalUserId3rdParty != null">
+        #{externalUserId3rdParty,jdbcType=VARCHAR},
+      </if>
+      <if test="type != null">
+        #{type,jdbcType=INTEGER},
+      </if>
+      <if test="name != null">
+        #{name,jdbcType=VARCHAR},
+      </if>
+      <if test="avatar != null">
+        #{avatar,jdbcType=VARCHAR},
+      </if>
+      <if test="gender != null">
+        #{gender,jdbcType=INTEGER},
+      </if>
+      <if test="isDelete != null">
+        #{isDelete,jdbcType=INTEGER},
+      </if>
+      <if test="createdAt != null">
+        #{createdAt,jdbcType=BIGINT},
+      </if>
+      <if test="updatedAt != null">
+        #{updatedAt,jdbcType=BIGINT},
+      </if>
+      <if test="deletedAt != null">
+        #{deletedAt,jdbcType=BIGINT},
+      </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.common.model.po.UserExample" resultType="java.lang.Long">
+    select count(*) from we_com_user
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map">
+    update we_com_user
+    <set>
+      <if test="record.id != null">
+        id = #{record.id,jdbcType=BIGINT},
+      </if>
+      <if test="record.corpId != null">
+        corp_id = #{record.corpId,jdbcType=BIGINT},
+      </if>
+      <if test="record.externalUserId != null">
+        external_user_id = #{record.externalUserId,jdbcType=VARCHAR},
+      </if>
+      <if test="record.unionId != null">
+        union_id = #{record.unionId,jdbcType=VARCHAR},
+      </if>
+      <if test="record.externalUserId3rdParty != null">
+        external_user_id_3rd_party = #{record.externalUserId3rdParty,jdbcType=VARCHAR},
+      </if>
+      <if test="record.type != null">
+        `type` = #{record.type,jdbcType=INTEGER},
+      </if>
+      <if test="record.name != null">
+        `name` = #{record.name,jdbcType=VARCHAR},
+      </if>
+      <if test="record.avatar != null">
+        avatar = #{record.avatar,jdbcType=VARCHAR},
+      </if>
+      <if test="record.gender != null">
+        gender = #{record.gender,jdbcType=INTEGER},
+      </if>
+      <if test="record.isDelete != null">
+        is_delete = #{record.isDelete,jdbcType=INTEGER},
+      </if>
+      <if test="record.createdAt != null">
+        created_at = #{record.createdAt,jdbcType=BIGINT},
+      </if>
+      <if test="record.updatedAt != null">
+        updated_at = #{record.updatedAt,jdbcType=BIGINT},
+      </if>
+      <if test="record.deletedAt != null">
+        deleted_at = #{record.deletedAt,jdbcType=BIGINT},
+      </if>
+      <if test="record.createTime != null">
+        create_time = #{record.createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="record.updateTime != null">
+        update_time = #{record.updateTime,jdbcType=TIMESTAMP},
+      </if>
+    </set>
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExample" parameterType="map">
+    update we_com_user
+    set id = #{record.id,jdbcType=BIGINT},
+      corp_id = #{record.corpId,jdbcType=BIGINT},
+      external_user_id = #{record.externalUserId,jdbcType=VARCHAR},
+      union_id = #{record.unionId,jdbcType=VARCHAR},
+      external_user_id_3rd_party = #{record.externalUserId3rdParty,jdbcType=VARCHAR},
+      `type` = #{record.type,jdbcType=INTEGER},
+      `name` = #{record.name,jdbcType=VARCHAR},
+      avatar = #{record.avatar,jdbcType=VARCHAR},
+      gender = #{record.gender,jdbcType=INTEGER},
+      is_delete = #{record.isDelete,jdbcType=INTEGER},
+      created_at = #{record.createdAt,jdbcType=BIGINT},
+      updated_at = #{record.updatedAt,jdbcType=BIGINT},
+      deleted_at = #{record.deletedAt,jdbcType=BIGINT},
+      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.common.model.po.User">
+    update we_com_user
+    <set>
+      <if test="corpId != null">
+        corp_id = #{corpId,jdbcType=BIGINT},
+      </if>
+      <if test="externalUserId != null">
+        external_user_id = #{externalUserId,jdbcType=VARCHAR},
+      </if>
+      <if test="unionId != null">
+        union_id = #{unionId,jdbcType=VARCHAR},
+      </if>
+      <if test="externalUserId3rdParty != null">
+        external_user_id_3rd_party = #{externalUserId3rdParty,jdbcType=VARCHAR},
+      </if>
+      <if test="type != null">
+        `type` = #{type,jdbcType=INTEGER},
+      </if>
+      <if test="name != null">
+        `name` = #{name,jdbcType=VARCHAR},
+      </if>
+      <if test="avatar != null">
+        avatar = #{avatar,jdbcType=VARCHAR},
+      </if>
+      <if test="gender != null">
+        gender = #{gender,jdbcType=INTEGER},
+      </if>
+      <if test="isDelete != null">
+        is_delete = #{isDelete,jdbcType=INTEGER},
+      </if>
+      <if test="createdAt != null">
+        created_at = #{createdAt,jdbcType=BIGINT},
+      </if>
+      <if test="updatedAt != null">
+        updated_at = #{updatedAt,jdbcType=BIGINT},
+      </if>
+      <if test="deletedAt != null">
+        deleted_at = #{deletedAt,jdbcType=BIGINT},
+      </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.common.model.po.User">
+    update we_com_user
+    set corp_id = #{corpId,jdbcType=BIGINT},
+      external_user_id = #{externalUserId,jdbcType=VARCHAR},
+      union_id = #{unionId,jdbcType=VARCHAR},
+      external_user_id_3rd_party = #{externalUserId3rdParty,jdbcType=VARCHAR},
+      `type` = #{type,jdbcType=INTEGER},
+      `name` = #{name,jdbcType=VARCHAR},
+      avatar = #{avatar,jdbcType=VARCHAR},
+      gender = #{gender,jdbcType=INTEGER},
+      is_delete = #{isDelete,jdbcType=INTEGER},
+      created_at = #{createdAt,jdbcType=BIGINT},
+      updated_at = #{updatedAt,jdbcType=BIGINT},
+      deleted_at = #{deletedAt,jdbcType=BIGINT},
+      create_time = #{createTime,jdbcType=TIMESTAMP},
+      update_time = #{updateTime,jdbcType=TIMESTAMP}
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+
+    <select id="selectIdByExternalUserId" parameterType="String" resultType="Long">
+        select id
+        from we_com_user
+        where external_user_id = #{externalUserId}
+    </select>
+
+    <insert id="insertList" parameterType="java.util.List">
+        insert into we_com_user
+        (
+        corp_id,
+        external_user_id,
+        union_id,
+        external_user_id_3rd_party,
+        `type`,
+        `name`,
+        avatar,
+        gender,
+        created_at,
+        updated_at,
+        deleted_at,
+        create_time,
+        update_time
+        )
+        values
+        <foreach collection="list" item="item" separator=",">
+            (
+            #{item.corpId,jdbcType=BIGINT}
+            #{item.externalUserId,jdbcType=VARCHAR},
+            #{item.unionId,jdbcType=VARCHAR},
+            #{item.externalUserId3rdParty,jdbcType=VARCHAR},
+            #{item.type,jdbcType=INTEGER},
+            #{item.name,jdbcType=VARCHAR},
+            #{item.avatar,jdbcType=VARCHAR},
+            #{item.gender,jdbcType=INTEGER},
+            #{item.createdAt,jdbcType=BIGINT},
+            #{item.updatedAt,jdbcType=BIGINT},
+            #{item.deletedAt,jdbcType=BIGINT},
+            #{item.createTime,jdbcType=TIMESTAMP},
+            #{item.updateTime,jdbcType=TIMESTAMP}
+            )
+        </foreach>
+    </insert>
+</mapper>

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

@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-config.dtd">
+<configuration>
+    <properties>
+        <property name="dialect" value="mysql"/>
+    </properties>
+    <settings>
+        <!--<setting name="logImpl" value="LOG4J"/>-->
+        <setting name="mapUnderscoreToCamelCase" value="true" />
+        <!--<setting name="logImpl" value="STDOUT_LOGGING" />-->
+    </settings>
+</configuration>

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

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

+ 11 - 0
api-module/target/classes/application-dev.properties

@@ -0,0 +1,11 @@
+spring.datasource.username=crawler
+spring.datasource.password=crawler123456@
+spring.datasource.url=jdbc:mysql://rm-bp1k5853td1r25g3n690.mysql.rds.aliyuncs.com:3306/piaoquan-crawler?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true
+
+spring.redis.database=2
+spring.redis.host=r-bp154bpw97gptefiqkpd.redis.rds.aliyuncs.com
+spring.redis.port=6379
+spring.redis.password=Qingqu2019
+
+xxl.job.admin.addresses=http://xxl-job-test-internal.piaoquantv.com/xxl-job-admin
+

+ 12 - 0
api-module/target/classes/application-prod.properties

@@ -0,0 +1,12 @@
+spring.datasource.username=crawler
+spring.datasource.password=crawler123456@
+spring.datasource.url=jdbc:mysql://rm-bp17q95335a99272b.mysql.rds.aliyuncs.com:3306/growth?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true
+
+spring.redis.host=r-bp1m4nvh130sfjjc6f.redis.rds.aliyuncs.com
+spring.redis.port=6379
+spring.redis.password=Qingqu2019
+
+xxl.job.admin.addresses=http://xxl-job-internal.piaoquantv.com/xxl-job-admin
+
+
+

+ 11 - 0
api-module/target/classes/application-test.properties

@@ -0,0 +1,11 @@
+server.port=8080
+
+spring.datasource.username=crawler
+spring.datasource.password=crawler123456@
+spring.datasource.url=jdbc:mysql://rm-bp17q95335a99272b.mysql.rds.aliyuncs.com:3306/growth?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true
+
+spring.redis.host=r-bp1m4nvh130sfjjc6fpd.redis.rds.aliyuncs.com
+spring.redis.port=6379
+spring.redis.password=Qingqu2019
+
+xxl.job.admin.addresses=http://xxl-job-test-internal.piaoquantv.com/xxl-job-admin

+ 34 - 0
api-module/target/classes/application.properties

@@ -0,0 +1,34 @@
+logging.config=classpath:log4j2.xml
+spring.profiles.active=test
+spring.application.name=we-com-server
+
+spring.datasource.driver-class-name=com.mysql.jdbc.Driver
+spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
+spring.datasource.initialSize=5
+spring.datasource.maxActive=20
+spring.datasource.maxWait=60000
+spring.datasource.timeBetweenEvictionRunsMillis=60000
+spring.datasource.minEvictableIdleTimeMillis=300000
+spring.datasource.validationQuery=SELECT 1 FROM DUAL
+spring.datasource.testWhileIdle=true
+spring.datasource.testOnBorrow=false
+spring.datasource.testOnReturn=false
+spring.datasource.poolPreparedStatements=true
+
+spring.redis.lettuce.pool.max-active=8
+spring.redis.lettuce.pool.max-wait=-1
+spring.redis.lettuce.pool.max-idle=8
+spring.redis.lettuce.pool.min-idle=0
+
+datalog=/datalog
+
+xxl.job.accessToken=
+xxl.job.executor.appname=${spring.application.name}
+xxl.job.executor.address=
+xxl.job.executor.ip=
+xxl.job.executor.port=9999
+xxl.job.executor.logpath=${datalog}/xxl-job/
+xxl.job.executor.logretentiondays=30
+
+
+

二進制
api-module/target/classes/com/tzld/piaoquan/api/GrowthServerApplication.class


二進制
api-module/target/classes/com/tzld/piaoquan/api/controller/IndexController.class


二進制
api-module/target/classes/com/tzld/piaoquan/api/controller/MessageController.class


二進制
api-module/target/classes/com/tzld/piaoquan/api/controller/WeComController.class


二進制
api-module/target/classes/com/tzld/piaoquan/api/dao/generator/MybatisGeneratorMain.class


二進制
api-module/target/classes/com/tzld/piaoquan/api/dao/generator/PaginationPlugin.class


二進制
api-module/target/classes/com/tzld/piaoquan/api/dao/mapper/CorpMapper.class


二進制
api-module/target/classes/com/tzld/piaoquan/api/dao/mapper/GuaranteesVideoMapper.class


二進制
api-module/target/classes/com/tzld/piaoquan/api/dao/mapper/MessageAttachmentMapper.class


二進制
api-module/target/classes/com/tzld/piaoquan/api/dao/mapper/StaffMapper.class


二進制
api-module/target/classes/com/tzld/piaoquan/api/dao/mapper/StaffWithUserMapper.class


二進制
api-module/target/classes/com/tzld/piaoquan/api/dao/mapper/UserMapper.class


二進制
api-module/target/classes/com/tzld/piaoquan/api/service/AccessTokenService.class


二進制
api-module/target/classes/com/tzld/piaoquan/api/service/Impl/AccessTokenServiceImpl.class


二進制
api-module/target/classes/com/tzld/piaoquan/api/service/Impl/MessageAttachmentServiceImpl.class


二進制
api-module/target/classes/com/tzld/piaoquan/api/service/Impl/UserServiceImpl.class


二進制
api-module/target/classes/com/tzld/piaoquan/api/service/MessageAttachmentService.class


二進制
api-module/target/classes/com/tzld/piaoquan/api/service/UserService.class


+ 94 - 0
api-module/target/classes/log4j2.xml

@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--Configuration后面的status,这个用于设置log4j2自身内部的信息输出,可以不设置,当设置成trace时,你会看到log4j2内部各种详细输出-->
+<!--monitorInterval:Log4j能够自动检测修改配置 文件和重新配置本身,设置间隔秒数-->
+<configuration monitorInterval="5">
+    <!--日志级别以及优先级排序: OFF > FATAL > ERROR > WARN > INFO > DEBUG > TRACE > ALL -->
+
+    <!--变量配置-->
+    <Properties>
+        <!-- 格式化输出:%date表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度 %msg:日志消息,%n是换行符-->
+        <!-- %logger{36} 表示 Logger 名字最长36个字符 -->
+        <property name="LOG_PATTERN" value="%date{HH:mm:ss.SSS} [%thread] %-5level %logger{36}  - %msg%n" />
+        <!-- 定义日志存储的路径,不要配置相对路径 -->
+        <property name="FILE_PATH" value="/datalog" />
+        <!--项目名称-->
+        <property name="FILE_NAME" value="we_com_server" />
+    </Properties>
+
+    <appenders>
+
+        <console name="Console" target="SYSTEM_OUT">
+            <!--输出日志的格式-->
+            <PatternLayout pattern="${LOG_PATTERN}"/>
+            <!--控制台只输出level及其以上级别的信息(onMatch),其他的直接拒绝(onMismatch)-->
+            <ThresholdFilter level="info" onMatch="ACCEPT" onMismatch="DENY"/>
+        </console>
+
+
+        <!-- 这个会打印出所有的info及以下级别的信息,每次大小超过size,则这size大小的日志会自动存入按年份-月份建立的文件夹下面并进行压缩,作为存档-->
+        <RollingFile name="RollingFileInfo" fileName="${FILE_PATH}/${FILE_NAME}/info.log" filePattern="${FILE_PATH}/${FILE_NAME}-INFO-%d{yyyy-MM-dd}_%i.log.gz">
+            <!--控制台只输出level及以上级别的信息(onMatch),其他的直接拒绝(onMismatch)-->
+            <ThresholdFilter level="info" onMatch="ACCEPT" onMismatch="DENY"/>
+            <PatternLayout pattern="${LOG_PATTERN}"/>
+            <Policies>
+                <!--interval属性用来指定多久滚动一次,默认是1 hour-->
+                <TimeBasedTriggeringPolicy interval="1"/>
+                <SizeBasedTriggeringPolicy size="10MB"/>
+            </Policies>
+            <!-- DefaultRolloverStrategy属性如不设置,则默认为最多同一文件夹下7个文件开始覆盖-->
+            <DefaultRolloverStrategy max="15"/>
+        </RollingFile>
+
+        <!-- 这个会打印出所有的warn及以下级别的信息,每次大小超过size,则这size大小的日志会自动存入按年份-月份建立的文件夹下面并进行压缩,作为存档-->
+        <RollingFile name="RollingFileWarn" fileName="${FILE_PATH}/${FILE_NAME}/warn.log" filePattern="${FILE_PATH}/${FILE_NAME}-WARN-%d{yyyy-MM-dd}_%i.log.gz">
+            <!--控制台只输出level及以上级别的信息(onMatch),其他的直接拒绝(onMismatch)-->
+            <ThresholdFilter level="warn" onMatch="ACCEPT" onMismatch="DENY"/>
+            <PatternLayout pattern="${LOG_PATTERN}"/>
+            <Policies>
+                <!--interval属性用来指定多久滚动一次,默认是1 hour-->
+                <TimeBasedTriggeringPolicy interval="1"/>
+                <SizeBasedTriggeringPolicy size="10MB"/>
+            </Policies>
+            <!-- DefaultRolloverStrategy属性如不设置,则默认为最多同一文件夹下7个文件开始覆盖-->
+            <DefaultRolloverStrategy max="15"/>
+        </RollingFile>
+
+        <!-- 这个会打印出所有的error及以下级别的信息,每次大小超过size,则这size大小的日志会自动存入按年份-月份建立的文件夹下面并进行压缩,作为存档-->
+        <RollingFile name="RollingFileError" fileName="${FILE_PATH}/${FILE_NAME}/error.log" filePattern="${FILE_PATH}/${FILE_NAME}-ERROR-%d{yyyy-MM-dd}_%i.log.gz">
+            <!--控制台只输出level及以上级别的信息(onMatch),其他的直接拒绝(onMismatch)-->
+            <ThresholdFilter level="error" onMatch="ACCEPT" onMismatch="DENY"/>
+            <PatternLayout pattern="${LOG_PATTERN}"/>
+            <Policies>
+                <!--interval属性用来指定多久滚动一次,默认是1 hour-->
+                <TimeBasedTriggeringPolicy interval="1"/>
+                <SizeBasedTriggeringPolicy size="10MB"/>
+            </Policies>
+            <!-- DefaultRolloverStrategy属性如不设置,则默认为最多同一文件夹下7个文件开始覆盖-->
+            <DefaultRolloverStrategy max="15"/>
+        </RollingFile>
+
+    </appenders>
+
+    <!--Logger节点用来单独指定日志的形式,比如要为指定包下的class指定不同的日志级别等。-->
+    <!--然后定义loggers,只有定义了logger并引入的appender,appender才会生效-->
+    <loggers>
+
+        <!--过滤掉spring和mybatis的一些无用的DEBUG信息-->
+        <logger name="org.mybatis" level="info" additivity="false">
+            <AppenderRef ref="Console"/>
+        </logger>
+        <!--监控系统信息-->
+        <!--若是additivity设为false,则 子Logger 只会在自己的appender里输出,而不会在 父Logger 的appender里输出。-->
+        <Logger name="org.springframework" level="info" additivity="false">
+            <AppenderRef ref="Console"/>
+        </Logger>
+
+        <root level="info">
+            <appender-ref ref="Console"/>
+            <appender-ref ref="Filelog"/>
+            <appender-ref ref="RollingFileInfo"/>
+            <appender-ref ref="RollingFileWarn"/>
+            <appender-ref ref="RollingFileError"/>
+        </root>
+    </loggers>
+</configuration>

+ 246 - 0
api-module/target/classes/mapper/CorpMapper.xml

@@ -0,0 +1,246 @@
+<?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.common.dao.mapper.OfflineCorpMapper">
+  <resultMap id="BaseResultMap" type="com.tzld.piaoquan.common.model.po.Corp">
+    <id column="id" jdbcType="BIGINT" property="id" />
+    <result column="name" jdbcType="VARCHAR" property="name" />
+    <result column="corp_id" jdbcType="VARCHAR" property="corpId" />
+    <result column="secret" jdbcType="VARCHAR" property="secret" />
+    <result column="is_delete" jdbcType="INTEGER" property="isDelete" />
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
+  </resultMap>
+  <sql id="Example_Where_Clause">
+    <where>
+      <foreach collection="oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Update_By_Example_Where_Clause">
+    <where>
+      <foreach collection="example.oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Base_Column_List">
+    id, `name`, corp_id, secret, is_delete, create_time, update_time
+  </sql>
+  <select id="selectByExample" parameterType="com.tzld.piaoquan.common.model.po.CorpExample" resultMap="BaseResultMap">
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from we_com_corp
+    <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_corp
+    where id = #{id,jdbcType=BIGINT}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+    delete from we_com_corp
+    where id = #{id,jdbcType=BIGINT}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.tzld.piaoquan.common.model.po.CorpExample">
+    delete from we_com_corp
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.tzld.piaoquan.common.model.po.Corp">
+    insert into we_com_corp (id, `name`, corp_id, 
+      secret, is_delete, create_time, 
+      update_time)
+    values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{corpId,jdbcType=VARCHAR}, 
+      #{secret,jdbcType=VARCHAR}, #{isDelete,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, 
+      #{updateTime,jdbcType=TIMESTAMP})
+  </insert>
+  <insert id="insertSelective" parameterType="com.tzld.piaoquan.common.model.po.Corp">
+    insert into we_com_corp
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="name != null">
+        `name`,
+      </if>
+      <if test="corpId != null">
+        corp_id,
+      </if>
+      <if test="secret != null">
+        secret,
+      </if>
+      <if test="isDelete != null">
+        is_delete,
+      </if>
+      <if test="createTime != null">
+        create_time,
+      </if>
+      <if test="updateTime != null">
+        update_time,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=BIGINT},
+      </if>
+      <if test="name != null">
+        #{name,jdbcType=VARCHAR},
+      </if>
+      <if test="corpId != null">
+        #{corpId,jdbcType=VARCHAR},
+      </if>
+      <if test="secret != null">
+        #{secret,jdbcType=VARCHAR},
+      </if>
+      <if test="isDelete != null">
+        #{isDelete,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null">
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateTime != null">
+        #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="com.tzld.piaoquan.common.model.po.CorpExample" resultType="java.lang.Long">
+    select count(*) from we_com_corp
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map">
+    update we_com_corp
+    <set>
+      <if test="record.id != null">
+        id = #{record.id,jdbcType=BIGINT},
+      </if>
+      <if test="record.name != null">
+        `name` = #{record.name,jdbcType=VARCHAR},
+      </if>
+      <if test="record.corpId != null">
+        corp_id = #{record.corpId,jdbcType=VARCHAR},
+      </if>
+      <if test="record.secret != null">
+        secret = #{record.secret,jdbcType=VARCHAR},
+      </if>
+      <if test="record.isDelete != null">
+        is_delete = #{record.isDelete,jdbcType=INTEGER},
+      </if>
+      <if test="record.createTime != null">
+        create_time = #{record.createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="record.updateTime != null">
+        update_time = #{record.updateTime,jdbcType=TIMESTAMP},
+      </if>
+    </set>
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExample" parameterType="map">
+    update we_com_corp
+    set id = #{record.id,jdbcType=BIGINT},
+      `name` = #{record.name,jdbcType=VARCHAR},
+      corp_id = #{record.corpId,jdbcType=VARCHAR},
+      secret = #{record.secret,jdbcType=VARCHAR},
+      is_delete = #{record.isDelete,jdbcType=INTEGER},
+      create_time = #{record.createTime,jdbcType=TIMESTAMP},
+      update_time = #{record.updateTime,jdbcType=TIMESTAMP}
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.tzld.piaoquan.common.model.po.Corp">
+    update we_com_corp
+    <set>
+      <if test="name != null">
+        `name` = #{name,jdbcType=VARCHAR},
+      </if>
+      <if test="corpId != null">
+        corp_id = #{corpId,jdbcType=VARCHAR},
+      </if>
+      <if test="secret != null">
+        secret = #{secret,jdbcType=VARCHAR},
+      </if>
+      <if test="isDelete != null">
+        is_delete = #{isDelete,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null">
+        create_time = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateTime != null">
+        update_time = #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+    </set>
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.tzld.piaoquan.common.model.po.Corp">
+    update we_com_corp
+    set `name` = #{name,jdbcType=VARCHAR},
+      corp_id = #{corpId,jdbcType=VARCHAR},
+      secret = #{secret,jdbcType=VARCHAR},
+      is_delete = #{isDelete,jdbcType=INTEGER},
+      create_time = #{createTime,jdbcType=TIMESTAMP},
+      update_time = #{updateTime,jdbcType=TIMESTAMP}
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+</mapper>

+ 246 - 0
api-module/target/classes/mapper/GuaranteesVideoMapper.xml

@@ -0,0 +1,246 @@
+<?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.common.dao.mapper.OfflineGuaranteesVideoMapper">
+  <resultMap id="BaseResultMap" type="com.tzld.piaoquan.common.model.po.GuaranteesVideo">
+    <id column="id" jdbcType="BIGINT" property="id" />
+    <result column="date" jdbcType="VARCHAR" property="date" />
+    <result column="staff_id" jdbcType="BIGINT" property="staffId" />
+    <result column="video_ids" jdbcType="VARCHAR" property="videoIds" />
+    <result column="is_delete" jdbcType="INTEGER" property="isDelete" />
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
+  </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`, staff_id, video_ids, is_delete, create_time, update_time
+  </sql>
+  <select id="selectByExample" parameterType="com.tzld.piaoquan.common.model.po.GuaranteesVideoExample" resultMap="BaseResultMap">
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from we_com_guarantees_video
+    <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_guarantees_video
+    where id = #{id,jdbcType=BIGINT}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+    delete from we_com_guarantees_video
+    where id = #{id,jdbcType=BIGINT}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.tzld.piaoquan.common.model.po.GuaranteesVideoExample">
+    delete from we_com_guarantees_video
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.tzld.piaoquan.common.model.po.GuaranteesVideo">
+    insert into we_com_guarantees_video (id, `date`, staff_id, 
+      video_ids, is_delete, create_time, 
+      update_time)
+    values (#{id,jdbcType=BIGINT}, #{date,jdbcType=VARCHAR}, #{staffId,jdbcType=BIGINT}, 
+      #{videoIds,jdbcType=VARCHAR}, #{isDelete,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, 
+      #{updateTime,jdbcType=TIMESTAMP})
+  </insert>
+  <insert id="insertSelective" parameterType="com.tzld.piaoquan.common.model.po.GuaranteesVideo">
+    insert into we_com_guarantees_video
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="date != null">
+        `date`,
+      </if>
+      <if test="staffId != null">
+        staff_id,
+      </if>
+      <if test="videoIds != null">
+        video_ids,
+      </if>
+      <if test="isDelete != null">
+        is_delete,
+      </if>
+      <if test="createTime != null">
+        create_time,
+      </if>
+      <if test="updateTime != null">
+        update_time,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=BIGINT},
+      </if>
+      <if test="date != null">
+        #{date,jdbcType=VARCHAR},
+      </if>
+      <if test="staffId != null">
+        #{staffId,jdbcType=BIGINT},
+      </if>
+      <if test="videoIds != null">
+        #{videoIds,jdbcType=VARCHAR},
+      </if>
+      <if test="isDelete != null">
+        #{isDelete,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null">
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateTime != null">
+        #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="com.tzld.piaoquan.common.model.po.GuaranteesVideoExample" resultType="java.lang.Long">
+    select count(*) from we_com_guarantees_video
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map">
+    update we_com_guarantees_video
+    <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.staffId != null">
+        staff_id = #{record.staffId,jdbcType=BIGINT},
+      </if>
+      <if test="record.videoIds != null">
+        video_ids = #{record.videoIds,jdbcType=VARCHAR},
+      </if>
+      <if test="record.isDelete != null">
+        is_delete = #{record.isDelete,jdbcType=INTEGER},
+      </if>
+      <if test="record.createTime != null">
+        create_time = #{record.createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="record.updateTime != null">
+        update_time = #{record.updateTime,jdbcType=TIMESTAMP},
+      </if>
+    </set>
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExample" parameterType="map">
+    update we_com_guarantees_video
+    set id = #{record.id,jdbcType=BIGINT},
+      `date` = #{record.date,jdbcType=VARCHAR},
+      staff_id = #{record.staffId,jdbcType=BIGINT},
+      video_ids = #{record.videoIds,jdbcType=VARCHAR},
+      is_delete = #{record.isDelete,jdbcType=INTEGER},
+      create_time = #{record.createTime,jdbcType=TIMESTAMP},
+      update_time = #{record.updateTime,jdbcType=TIMESTAMP}
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.tzld.piaoquan.common.model.po.GuaranteesVideo">
+    update we_com_guarantees_video
+    <set>
+      <if test="date != null">
+        `date` = #{date,jdbcType=VARCHAR},
+      </if>
+      <if test="staffId != null">
+        staff_id = #{staffId,jdbcType=BIGINT},
+      </if>
+      <if test="videoIds != null">
+        video_ids = #{videoIds,jdbcType=VARCHAR},
+      </if>
+      <if test="isDelete != null">
+        is_delete = #{isDelete,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null">
+        create_time = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateTime != null">
+        update_time = #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+    </set>
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.tzld.piaoquan.common.model.po.GuaranteesVideo">
+    update we_com_guarantees_video
+    set `date` = #{date,jdbcType=VARCHAR},
+      staff_id = #{staffId,jdbcType=BIGINT},
+      video_ids = #{videoIds,jdbcType=VARCHAR},
+      is_delete = #{isDelete,jdbcType=INTEGER},
+      create_time = #{createTime,jdbcType=TIMESTAMP},
+      update_time = #{updateTime,jdbcType=TIMESTAMP}
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+</mapper>

+ 356 - 0
api-module/target/classes/mapper/MessageAttachmentMapper.xml

@@ -0,0 +1,356 @@
+<?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.common.dao.mapper.OfflineMessageAttachmentMapper">
+  <resultMap id="BaseResultMap" type="com.tzld.piaoquan.common.model.po.MessageAttachment">
+    <id column="id" jdbcType="BIGINT" property="id" />
+    <result column="staff_id" jdbcType="BIGINT" property="staffId" />
+    <result column="type" jdbcType="INTEGER" property="type" />
+    <result column="url" jdbcType="VARCHAR" property="url" />
+    <result column="title" jdbcType="VARCHAR" property="title" />
+    <result column="desc" jdbcType="VARCHAR" property="desc" />
+    <result column="appid" jdbcType="VARCHAR" property="appid" />
+    <result column="page" jdbcType="VARCHAR" property="page" />
+    <result column="cover" jdbcType="VARCHAR" property="cover" />
+    <result column="miniprogram_video_id" jdbcType="BIGINT" property="miniprogramVideoId" />
+    <result column="is_delete" jdbcType="INTEGER" property="isDelete" />
+    <result column="send_time" jdbcType="TIMESTAMP" property="sendTime" />
+    <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, staff_id, `type`, url, title, `desc`, appid, page, cover, miniprogram_video_id, 
+    is_delete, send_time, create_time, update_time
+  </sql>
+  <select id="selectByExample" parameterType="com.tzld.piaoquan.common.model.po.MessageAttachmentExample" resultMap="BaseResultMap">
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from we_com_message_attachment
+    <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_message_attachment
+    where id = #{id,jdbcType=BIGINT}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+    delete from we_com_message_attachment
+    where id = #{id,jdbcType=BIGINT}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.tzld.piaoquan.common.model.po.MessageAttachmentExample">
+    delete from we_com_message_attachment
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.tzld.piaoquan.common.model.po.MessageAttachment">
+    insert into we_com_message_attachment (id, staff_id, `type`, 
+      url, title, `desc`, appid, 
+      page, cover, miniprogram_video_id, 
+      send_time, create_time,
+      update_time)
+    values (#{id,jdbcType=BIGINT}, #{staffId,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}, 
+      #{sendTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP},
+      #{updateTime,jdbcType=TIMESTAMP})
+  </insert>
+  <insert id="insertSelective" parameterType="com.tzld.piaoquan.common.model.po.MessageAttachment">
+    insert into we_com_message_attachment
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="staffId != null">
+        staff_id,
+      </if>
+      <if test="type != null">
+        `type`,
+      </if>
+      <if test="url != null">
+        url,
+      </if>
+      <if test="title != null">
+        title,
+      </if>
+      <if test="desc != null">
+        `desc`,
+      </if>
+      <if test="appid != null">
+        appid,
+      </if>
+      <if test="page != null">
+        page,
+      </if>
+      <if test="cover != null">
+        cover,
+      </if>
+      <if test="miniprogramVideoId != null">
+        miniprogram_video_id,
+      </if>
+      <if test="isDelete != null">
+        is_delete,
+      </if>
+      <if test="sendTime != null">
+        send_time,
+      </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="staffId != null">
+        #{staffId,jdbcType=BIGINT},
+      </if>
+      <if test="type != null">
+        #{type,jdbcType=INTEGER},
+      </if>
+      <if test="url != null">
+        #{url,jdbcType=VARCHAR},
+      </if>
+      <if test="title != null">
+        #{title,jdbcType=VARCHAR},
+      </if>
+      <if test="desc != null">
+        #{desc,jdbcType=VARCHAR},
+      </if>
+      <if test="appid != null">
+        #{appid,jdbcType=VARCHAR},
+      </if>
+      <if test="page != null">
+        #{page,jdbcType=VARCHAR},
+      </if>
+      <if test="cover != null">
+        #{cover,jdbcType=VARCHAR},
+      </if>
+      <if test="miniprogramVideoId != null">
+        #{miniprogramVideoId,jdbcType=BIGINT},
+      </if>
+      <if test="isDelete != null">
+        #{isDelete,jdbcType=INTEGER},
+      </if>
+      <if test="sendTime != null">
+        #{sendTime,jdbcType=TIMESTAMP},
+      </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.common.model.po.MessageAttachmentExample" resultType="java.lang.Long">
+    select count(*) from we_com_message_attachment
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map">
+    update we_com_message_attachment
+    <set>
+      <if test="record.id != null">
+        id = #{record.id,jdbcType=BIGINT},
+      </if>
+      <if test="record.staffId != null">
+        staff_id = #{record.staffId,jdbcType=BIGINT},
+      </if>
+      <if test="record.type != null">
+        `type` = #{record.type,jdbcType=INTEGER},
+      </if>
+      <if test="record.url != null">
+        url = #{record.url,jdbcType=VARCHAR},
+      </if>
+      <if test="record.title != null">
+        title = #{record.title,jdbcType=VARCHAR},
+      </if>
+      <if test="record.desc != null">
+        `desc` = #{record.desc,jdbcType=VARCHAR},
+      </if>
+      <if test="record.appid != null">
+        appid = #{record.appid,jdbcType=VARCHAR},
+      </if>
+      <if test="record.page != null">
+        page = #{record.page,jdbcType=VARCHAR},
+      </if>
+      <if test="record.cover != null">
+        cover = #{record.cover,jdbcType=VARCHAR},
+      </if>
+      <if test="record.miniprogramVideoId != null">
+        miniprogram_video_id = #{record.miniprogramVideoId,jdbcType=BIGINT},
+      </if>
+      <if test="record.isDelete != null">
+        is_delete = #{record.isDelete,jdbcType=INTEGER},
+      </if>
+      <if test="record.sendTime != null">
+        send_time = #{record.sendTime,jdbcType=TIMESTAMP},
+      </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_message_attachment
+    set id = #{record.id,jdbcType=BIGINT},
+      staff_id = #{record.staffId,jdbcType=BIGINT},
+      `type` = #{record.type,jdbcType=INTEGER},
+      url = #{record.url,jdbcType=VARCHAR},
+      title = #{record.title,jdbcType=VARCHAR},
+      `desc` = #{record.desc,jdbcType=VARCHAR},
+      appid = #{record.appid,jdbcType=VARCHAR},
+      page = #{record.page,jdbcType=VARCHAR},
+      cover = #{record.cover,jdbcType=VARCHAR},
+      miniprogram_video_id = #{record.miniprogramVideoId,jdbcType=BIGINT},
+      is_delete = #{record.isDelete,jdbcType=INTEGER},
+      send_time = #{record.sendTime,jdbcType=TIMESTAMP},
+      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.common.model.po.MessageAttachment">
+    update we_com_message_attachment
+    <set>
+      <if test="staffId != null">
+        staff_id = #{staffId,jdbcType=BIGINT},
+      </if>
+      <if test="type != null">
+        `type` = #{type,jdbcType=INTEGER},
+      </if>
+      <if test="url != null">
+        url = #{url,jdbcType=VARCHAR},
+      </if>
+      <if test="title != null">
+        title = #{title,jdbcType=VARCHAR},
+      </if>
+      <if test="desc != null">
+        `desc` = #{desc,jdbcType=VARCHAR},
+      </if>
+      <if test="appid != null">
+        appid = #{appid,jdbcType=VARCHAR},
+      </if>
+      <if test="page != null">
+        page = #{page,jdbcType=VARCHAR},
+      </if>
+      <if test="cover != null">
+        cover = #{cover,jdbcType=VARCHAR},
+      </if>
+      <if test="miniprogramVideoId != null">
+        miniprogram_video_id = #{miniprogramVideoId,jdbcType=BIGINT},
+      </if>
+      <if test="isDelete != null">
+        is_delete = #{isDelete,jdbcType=INTEGER},
+      </if>
+      <if test="sendTime != null">
+        send_time = #{sendTime,jdbcType=TIMESTAMP},
+      </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.common.model.po.MessageAttachment">
+    update we_com_message_attachment
+    set staff_id = #{staffId,jdbcType=BIGINT},
+      `type` = #{type,jdbcType=INTEGER},
+      url = #{url,jdbcType=VARCHAR},
+      title = #{title,jdbcType=VARCHAR},
+      `desc` = #{desc,jdbcType=VARCHAR},
+      appid = #{appid,jdbcType=VARCHAR},
+      page = #{page,jdbcType=VARCHAR},
+      cover = #{cover,jdbcType=VARCHAR},
+      miniprogram_video_id = #{miniprogramVideoId,jdbcType=BIGINT},
+      is_delete = #{isDelete,jdbcType=INTEGER},
+      send_time = #{sendTime,jdbcType=TIMESTAMP},
+      create_time = #{createTime,jdbcType=TIMESTAMP},
+      update_time = #{updateTime,jdbcType=TIMESTAMP}
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+</mapper>

+ 294 - 0
api-module/target/classes/mapper/StaffMapper.xml

@@ -0,0 +1,294 @@
+<?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.common.dao.mapper.OfflineStaffMapper">
+  <resultMap id="BaseResultMap" type="com.tzld.piaoquan.common.model.po.Staff">
+    <id column="id" jdbcType="BIGINT" property="id" />
+    <result column="corp_id" jdbcType="BIGINT" property="corpId" />
+    <result column="staff_ext_id" jdbcType="VARCHAR" property="staffExtId" />
+    <result column="carrier_id" jdbcType="VARCHAR" property="carrierId" />
+    <result column="remark" jdbcType="VARCHAR" property="remark" />
+    <result column="category1" jdbcType="VARCHAR" property="category1" />
+    <result column="category2" jdbcType="VARCHAR" property="category2" />
+    <result column="is_delete" jdbcType="INTEGER" property="isDelete" />
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
+  </resultMap>
+  <sql id="Example_Where_Clause">
+    <where>
+      <foreach collection="oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Update_By_Example_Where_Clause">
+    <where>
+      <foreach collection="example.oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Base_Column_List">
+    id, corp_id, staff_ext_id, carrier_id, remark, category1, category2, is_delete, create_time, 
+    update_time
+  </sql>
+  <select id="selectByExample" parameterType="com.tzld.piaoquan.common.model.po.StaffExample" resultMap="BaseResultMap">
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from we_com_staff
+    <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
+    where id = #{id,jdbcType=BIGINT}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+    delete from we_com_staff
+    where id = #{id,jdbcType=BIGINT}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.tzld.piaoquan.common.model.po.StaffExample">
+    delete from we_com_staff
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.tzld.piaoquan.common.model.po.Staff">
+    insert into we_com_staff (id, corp_id, staff_ext_id, 
+      carrier_id, remark, category1, 
+      category2, create_time,
+      update_time)
+    values (#{id,jdbcType=BIGINT}, #{corpId,jdbcType=BIGINT}, #{staffExtId,jdbcType=VARCHAR}, 
+      #{carrierId,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{category1,jdbcType=VARCHAR}, 
+      #{category2,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
+      #{updateTime,jdbcType=TIMESTAMP})
+  </insert>
+  <insert id="insertSelective" parameterType="com.tzld.piaoquan.common.model.po.Staff">
+    insert into we_com_staff
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="corpId != null">
+        corp_id,
+      </if>
+      <if test="staffExtId != null">
+        staff_ext_id,
+      </if>
+      <if test="carrierId != null">
+        carrier_id,
+      </if>
+      <if test="remark != null">
+        remark,
+      </if>
+      <if test="category1 != null">
+        category1,
+      </if>
+      <if test="category2 != null">
+        category2,
+      </if>
+      <if test="isDelete != null">
+        is_delete,
+      </if>
+      <if test="createTime != null">
+        create_time,
+      </if>
+      <if test="updateTime != null">
+        update_time,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=BIGINT},
+      </if>
+      <if test="corpId != null">
+        #{corpId,jdbcType=BIGINT},
+      </if>
+      <if test="staffExtId != null">
+        #{staffExtId,jdbcType=VARCHAR},
+      </if>
+      <if test="carrierId != null">
+        #{carrierId,jdbcType=VARCHAR},
+      </if>
+      <if test="remark != null">
+        #{remark,jdbcType=VARCHAR},
+      </if>
+      <if test="category1 != null">
+        #{category1,jdbcType=VARCHAR},
+      </if>
+      <if test="category2 != null">
+        #{category2,jdbcType=VARCHAR},
+      </if>
+      <if test="isDelete != null">
+        #{isDelete,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null">
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateTime != null">
+        #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="com.tzld.piaoquan.common.model.po.StaffExample" resultType="java.lang.Long">
+    select count(*) from we_com_staff
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map">
+    update we_com_staff
+    <set>
+      <if test="record.id != null">
+        id = #{record.id,jdbcType=BIGINT},
+      </if>
+      <if test="record.corpId != null">
+        corp_id = #{record.corpId,jdbcType=BIGINT},
+      </if>
+      <if test="record.staffExtId != null">
+        staff_ext_id = #{record.staffExtId,jdbcType=VARCHAR},
+      </if>
+      <if test="record.carrierId != null">
+        carrier_id = #{record.carrierId,jdbcType=VARCHAR},
+      </if>
+      <if test="record.remark != null">
+        remark = #{record.remark,jdbcType=VARCHAR},
+      </if>
+      <if test="record.category1 != null">
+        category1 = #{record.category1,jdbcType=VARCHAR},
+      </if>
+      <if test="record.category2 != null">
+        category2 = #{record.category2,jdbcType=VARCHAR},
+      </if>
+      <if test="record.isDelete != null">
+        is_delete = #{record.isDelete,jdbcType=INTEGER},
+      </if>
+      <if test="record.createTime != null">
+        create_time = #{record.createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="record.updateTime != null">
+        update_time = #{record.updateTime,jdbcType=TIMESTAMP},
+      </if>
+    </set>
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExample" parameterType="map">
+    update we_com_staff
+    set id = #{record.id,jdbcType=BIGINT},
+      corp_id = #{record.corpId,jdbcType=BIGINT},
+      staff_ext_id = #{record.staffExtId,jdbcType=VARCHAR},
+      carrier_id = #{record.carrierId,jdbcType=VARCHAR},
+      remark = #{record.remark,jdbcType=VARCHAR},
+      category1 = #{record.category1,jdbcType=VARCHAR},
+      category2 = #{record.category2,jdbcType=VARCHAR},
+      is_delete = #{record.isDelete,jdbcType=INTEGER},
+      create_time = #{record.createTime,jdbcType=TIMESTAMP},
+      update_time = #{record.updateTime,jdbcType=TIMESTAMP}
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.tzld.piaoquan.common.model.po.Staff">
+    update we_com_staff
+    <set>
+      <if test="corpId != null">
+        corp_id = #{corpId,jdbcType=BIGINT},
+      </if>
+      <if test="staffExtId != null">
+        staff_ext_id = #{staffExtId,jdbcType=VARCHAR},
+      </if>
+      <if test="carrierId != null">
+        carrier_id = #{carrierId,jdbcType=VARCHAR},
+      </if>
+      <if test="remark != null">
+        remark = #{remark,jdbcType=VARCHAR},
+      </if>
+      <if test="category1 != null">
+        category1 = #{category1,jdbcType=VARCHAR},
+      </if>
+      <if test="category2 != null">
+        category2 = #{category2,jdbcType=VARCHAR},
+      </if>
+      <if test="isDelete != null">
+        is_delete = #{isDelete,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null">
+        create_time = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateTime != null">
+        update_time = #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+    </set>
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.tzld.piaoquan.common.model.po.Staff">
+    update we_com_staff
+    set corp_id = #{corpId,jdbcType=BIGINT},
+      staff_ext_id = #{staffExtId,jdbcType=VARCHAR},
+      carrier_id = #{carrierId,jdbcType=VARCHAR},
+      remark = #{remark,jdbcType=VARCHAR},
+      category1 = #{category1,jdbcType=VARCHAR},
+      category2 = #{category2,jdbcType=VARCHAR},
+      is_delete = #{isDelete,jdbcType=INTEGER},
+      create_time = #{createTime,jdbcType=TIMESTAMP},
+      update_time = #{updateTime,jdbcType=TIMESTAMP}
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+</mapper>

+ 277 - 0
api-module/target/classes/mapper/StaffWithUserMapper.xml

@@ -0,0 +1,277 @@
+<?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.common.dao.mapper.OfflineStaffWithUserMapper">
+  <resultMap id="BaseResultMap" type="com.tzld.piaoquan.common.model.po.StaffWithUser">
+    <id column="id" jdbcType="BIGINT" property="id" />
+    <result column="staff_id" jdbcType="BIGINT" property="staffId" />
+    <result column="user_id" jdbcType="BIGINT" property="userId" />
+    <result column="is_delete" jdbcType="INTEGER" property="isDelete" />
+    <result column="delete_time" jdbcType="TIMESTAMP" property="deleteTime" />
+    <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, staff_id, user_id, is_delete, delete_time, create_time, update_time
+  </sql>
+  <select id="selectByExample" parameterType="com.tzld.piaoquan.common.model.po.StaffWithUserExample" resultMap="BaseResultMap">
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from we_com_staff_with_user
+    <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_with_user
+    where id = #{id,jdbcType=BIGINT}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+    delete from we_com_staff_with_user
+    where id = #{id,jdbcType=BIGINT}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.tzld.piaoquan.common.model.po.StaffWithUserExample">
+    delete from we_com_staff_with_user
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.tzld.piaoquan.common.model.po.StaffWithUser">
+    insert into we_com_staff_with_user (id, staff_id, user_id, delete_time, create_time,
+      update_time)
+    values (#{id,jdbcType=BIGINT}, #{staffId,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT},
+      #{deleteTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP},
+      #{updateTime,jdbcType=TIMESTAMP})
+  </insert>
+  <insert id="insertSelective" parameterType="com.tzld.piaoquan.common.model.po.StaffWithUser">
+    insert into we_com_staff_with_user
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="staffId != null">
+        staff_id,
+      </if>
+      <if test="userId != null">
+        user_id,
+      </if>
+      <if test="isDelete != null">
+        is_delete,
+      </if>
+      <if test="deleteTime != null">
+        delete_time,
+      </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="staffId != null">
+        #{staffId,jdbcType=BIGINT},
+      </if>
+      <if test="userId != null">
+        #{userId,jdbcType=BIGINT},
+      </if>
+      <if test="isDelete != null">
+        #{isDelete,jdbcType=INTEGER},
+      </if>
+      <if test="deleteTime != null">
+        #{deleteTime,jdbcType=TIMESTAMP},
+      </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.common.model.po.StaffWithUserExample" resultType="java.lang.Long">
+    select count(*) from we_com_staff_with_user
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map">
+    update we_com_staff_with_user
+    <set>
+      <if test="record.id != null">
+        id = #{record.id,jdbcType=BIGINT},
+      </if>
+      <if test="record.staffId != null">
+        staff_id = #{record.staffId,jdbcType=BIGINT},
+      </if>
+      <if test="record.userId != null">
+        user_id = #{record.userId,jdbcType=BIGINT},
+      </if>
+      <if test="record.isDelete != null">
+        is_delete = #{record.isDelete,jdbcType=INTEGER},
+      </if>
+      <if test="record.deleteTime != null">
+        delete_time = #{record.deleteTime,jdbcType=TIMESTAMP},
+      </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_with_user
+    set id = #{record.id,jdbcType=BIGINT},
+      staff_id = #{record.staffId,jdbcType=BIGINT},
+      user_id = #{record.userId,jdbcType=BIGINT},
+      is_delete = #{record.isDelete,jdbcType=INTEGER},
+      delete_time = #{record.deleteTime,jdbcType=TIMESTAMP},
+      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.common.model.po.StaffWithUser">
+    update we_com_staff_with_user
+    <set>
+      <if test="staffId != null">
+        staff_id = #{staffId,jdbcType=BIGINT},
+      </if>
+      <if test="userId != null">
+        user_id = #{userId,jdbcType=BIGINT},
+      </if>
+      <if test="isDelete != null">
+        is_delete = #{isDelete,jdbcType=INTEGER},
+      </if>
+      <if test="deleteTime != null">
+        delete_time = #{deleteTime,jdbcType=TIMESTAMP},
+      </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.common.model.po.StaffWithUser">
+    update we_com_staff_with_user
+    set staff_id = #{staffId,jdbcType=BIGINT},
+      user_id = #{userId,jdbcType=BIGINT},
+      is_delete = #{isDelete,jdbcType=INTEGER},
+      delete_time = #{deleteTime,jdbcType=TIMESTAMP},
+      create_time = #{createTime,jdbcType=TIMESTAMP},
+      update_time = #{updateTime,jdbcType=TIMESTAMP}
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+
+  <insert id="insertList" parameterType="java.util.List">
+    insert into we_com_staff_with_user
+    (
+    staff_id,
+    user_id,
+    is_delete,
+    delete_time,
+    create_time,
+    update_time
+    )
+    values
+    <foreach collection="list" item="item" separator=",">
+      (
+      #{item.staffId,jdbcType=BIGINT},
+      #{item.userId,jdbcType=BIGINT},
+      #{item.isDelete,jdbcType=INTEGER},
+      #{item.deleteTime,jdbcType=TIMESTAMP},
+      #{item.createTime,jdbcType=TIMESTAMP},
+      #{item.updateTime,jdbcType=TIMESTAMP}
+      )
+    </foreach>
+  </insert>
+
+  <select id="selectExternalUserIdByStaffId" parameterType="java.lang.Long" resultType="java.lang.String">
+    select t2.external_user_id
+    from we_com_staff_with_user t1
+    left join we_com_user t2
+    on t1.user_id = t2.id
+    where t1.staff_id = #{staffId,jdbcType=BIGINT}
+    and t2.external_user_id is not null
+  </select>
+</mapper>

+ 419 - 0
api-module/target/classes/mapper/UserMapper.xml

@@ -0,0 +1,419 @@
+<?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.api.dao.mapper.UserMapper">
+  <resultMap id="BaseResultMap" type="com.tzld.piaoquan.common.model.po.User">
+    <id column="id" jdbcType="BIGINT" property="id" />
+    <result column="corp_id" jdbcType="BIGINT" property="corpId" />
+    <result column="external_user_id" jdbcType="VARCHAR" property="externalUserId" />
+    <result column="union_id" jdbcType="VARCHAR" property="unionId" />
+    <result column="external_user_id_3rd_party" jdbcType="VARCHAR" property="externalUserId3rdParty" />
+    <result column="type" jdbcType="INTEGER" property="type" />
+    <result column="name" jdbcType="VARCHAR" property="name" />
+    <result column="avatar" jdbcType="VARCHAR" property="avatar" />
+    <result column="gender" jdbcType="INTEGER" property="gender" />
+    <result column="is_delete" jdbcType="INTEGER" property="isDelete" />
+    <result column="created_at" jdbcType="BIGINT" property="createdAt" />
+    <result column="updated_at" jdbcType="BIGINT" property="updatedAt" />
+    <result column="deleted_at" jdbcType="BIGINT" property="deletedAt" />
+    <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, corp_id, external_user_id, union_id, external_user_id_3rd_party, `type`, `name`, 
+    avatar, gender, is_delete, created_at, updated_at, deleted_at, create_time, update_time
+  </sql>
+  <select id="selectByExample" parameterType="com.tzld.piaoquan.common.model.po.UserExample" resultMap="BaseResultMap">
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from we_com_user
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+    <if test="orderByClause != null">
+      order by ${orderByClause}
+    </if>
+    <if test="page != null">
+      limit #{page.offset} , #{page.pageSize}
+    </if>
+  </select>
+  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
+    select 
+    <include refid="Base_Column_List" />
+    from we_com_user
+    where id = #{id,jdbcType=BIGINT}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+    delete from we_com_user
+    where id = #{id,jdbcType=BIGINT}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.tzld.piaoquan.common.model.po.UserExample">
+    delete from we_com_user
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.tzld.piaoquan.common.model.po.User" useGeneratedKeys="true" keyProperty="id">
+    insert into we_com_user (id, corp_id, external_user_id, 
+      union_id, external_user_id_3rd_party, `type`, 
+      `name`, avatar, gender, 
+      created_at, updated_at,
+      deleted_at, create_time, update_time
+      )
+    values (#{id,jdbcType=BIGINT}, #{corpId,jdbcType=BIGINT}, #{externalUserId,jdbcType=VARCHAR}, 
+      #{unionId,jdbcType=VARCHAR}, #{externalUserId3rdParty,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER}, 
+      #{name,jdbcType=VARCHAR}, #{avatar,jdbcType=VARCHAR}, #{gender,jdbcType=INTEGER}, 
+      #{createdAt,jdbcType=BIGINT}, #{updatedAt,jdbcType=BIGINT},
+      #{deletedAt,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
+      )
+    <selectKey resultType="java.lang.Long" order="AFTER" keyProperty="id">
+      select LAST_INSERT_ID()
+    </selectKey>
+  </insert>
+  <insert id="insertSelective" parameterType="com.tzld.piaoquan.common.model.po.User">
+    insert into we_com_user
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="corpId != null">
+        corp_id,
+      </if>
+      <if test="externalUserId != null">
+        external_user_id,
+      </if>
+      <if test="unionId != null">
+        union_id,
+      </if>
+      <if test="externalUserId3rdParty != null">
+        external_user_id_3rd_party,
+      </if>
+      <if test="type != null">
+        `type`,
+      </if>
+      <if test="name != null">
+        `name`,
+      </if>
+      <if test="avatar != null">
+        avatar,
+      </if>
+      <if test="gender != null">
+        gender,
+      </if>
+      <if test="isDelete != null">
+        is_delete,
+      </if>
+      <if test="createdAt != null">
+        created_at,
+      </if>
+      <if test="updatedAt != null">
+        updated_at,
+      </if>
+      <if test="deletedAt != null">
+        deleted_at,
+      </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="corpId != null">
+        #{corpId,jdbcType=BIGINT},
+      </if>
+      <if test="externalUserId != null">
+        #{externalUserId,jdbcType=VARCHAR},
+      </if>
+      <if test="unionId != null">
+        #{unionId,jdbcType=VARCHAR},
+      </if>
+      <if test="externalUserId3rdParty != null">
+        #{externalUserId3rdParty,jdbcType=VARCHAR},
+      </if>
+      <if test="type != null">
+        #{type,jdbcType=INTEGER},
+      </if>
+      <if test="name != null">
+        #{name,jdbcType=VARCHAR},
+      </if>
+      <if test="avatar != null">
+        #{avatar,jdbcType=VARCHAR},
+      </if>
+      <if test="gender != null">
+        #{gender,jdbcType=INTEGER},
+      </if>
+      <if test="isDelete != null">
+        #{isDelete,jdbcType=INTEGER},
+      </if>
+      <if test="createdAt != null">
+        #{createdAt,jdbcType=BIGINT},
+      </if>
+      <if test="updatedAt != null">
+        #{updatedAt,jdbcType=BIGINT},
+      </if>
+      <if test="deletedAt != null">
+        #{deletedAt,jdbcType=BIGINT},
+      </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.common.model.po.UserExample" resultType="java.lang.Long">
+    select count(*) from we_com_user
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map">
+    update we_com_user
+    <set>
+      <if test="record.id != null">
+        id = #{record.id,jdbcType=BIGINT},
+      </if>
+      <if test="record.corpId != null">
+        corp_id = #{record.corpId,jdbcType=BIGINT},
+      </if>
+      <if test="record.externalUserId != null">
+        external_user_id = #{record.externalUserId,jdbcType=VARCHAR},
+      </if>
+      <if test="record.unionId != null">
+        union_id = #{record.unionId,jdbcType=VARCHAR},
+      </if>
+      <if test="record.externalUserId3rdParty != null">
+        external_user_id_3rd_party = #{record.externalUserId3rdParty,jdbcType=VARCHAR},
+      </if>
+      <if test="record.type != null">
+        `type` = #{record.type,jdbcType=INTEGER},
+      </if>
+      <if test="record.name != null">
+        `name` = #{record.name,jdbcType=VARCHAR},
+      </if>
+      <if test="record.avatar != null">
+        avatar = #{record.avatar,jdbcType=VARCHAR},
+      </if>
+      <if test="record.gender != null">
+        gender = #{record.gender,jdbcType=INTEGER},
+      </if>
+      <if test="record.isDelete != null">
+        is_delete = #{record.isDelete,jdbcType=INTEGER},
+      </if>
+      <if test="record.createdAt != null">
+        created_at = #{record.createdAt,jdbcType=BIGINT},
+      </if>
+      <if test="record.updatedAt != null">
+        updated_at = #{record.updatedAt,jdbcType=BIGINT},
+      </if>
+      <if test="record.deletedAt != null">
+        deleted_at = #{record.deletedAt,jdbcType=BIGINT},
+      </if>
+      <if test="record.createTime != null">
+        create_time = #{record.createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="record.updateTime != null">
+        update_time = #{record.updateTime,jdbcType=TIMESTAMP},
+      </if>
+    </set>
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExample" parameterType="map">
+    update we_com_user
+    set id = #{record.id,jdbcType=BIGINT},
+      corp_id = #{record.corpId,jdbcType=BIGINT},
+      external_user_id = #{record.externalUserId,jdbcType=VARCHAR},
+      union_id = #{record.unionId,jdbcType=VARCHAR},
+      external_user_id_3rd_party = #{record.externalUserId3rdParty,jdbcType=VARCHAR},
+      `type` = #{record.type,jdbcType=INTEGER},
+      `name` = #{record.name,jdbcType=VARCHAR},
+      avatar = #{record.avatar,jdbcType=VARCHAR},
+      gender = #{record.gender,jdbcType=INTEGER},
+      is_delete = #{record.isDelete,jdbcType=INTEGER},
+      created_at = #{record.createdAt,jdbcType=BIGINT},
+      updated_at = #{record.updatedAt,jdbcType=BIGINT},
+      deleted_at = #{record.deletedAt,jdbcType=BIGINT},
+      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.common.model.po.User">
+    update we_com_user
+    <set>
+      <if test="corpId != null">
+        corp_id = #{corpId,jdbcType=BIGINT},
+      </if>
+      <if test="externalUserId != null">
+        external_user_id = #{externalUserId,jdbcType=VARCHAR},
+      </if>
+      <if test="unionId != null">
+        union_id = #{unionId,jdbcType=VARCHAR},
+      </if>
+      <if test="externalUserId3rdParty != null">
+        external_user_id_3rd_party = #{externalUserId3rdParty,jdbcType=VARCHAR},
+      </if>
+      <if test="type != null">
+        `type` = #{type,jdbcType=INTEGER},
+      </if>
+      <if test="name != null">
+        `name` = #{name,jdbcType=VARCHAR},
+      </if>
+      <if test="avatar != null">
+        avatar = #{avatar,jdbcType=VARCHAR},
+      </if>
+      <if test="gender != null">
+        gender = #{gender,jdbcType=INTEGER},
+      </if>
+      <if test="isDelete != null">
+        is_delete = #{isDelete,jdbcType=INTEGER},
+      </if>
+      <if test="createdAt != null">
+        created_at = #{createdAt,jdbcType=BIGINT},
+      </if>
+      <if test="updatedAt != null">
+        updated_at = #{updatedAt,jdbcType=BIGINT},
+      </if>
+      <if test="deletedAt != null">
+        deleted_at = #{deletedAt,jdbcType=BIGINT},
+      </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.common.model.po.User">
+    update we_com_user
+    set corp_id = #{corpId,jdbcType=BIGINT},
+      external_user_id = #{externalUserId,jdbcType=VARCHAR},
+      union_id = #{unionId,jdbcType=VARCHAR},
+      external_user_id_3rd_party = #{externalUserId3rdParty,jdbcType=VARCHAR},
+      `type` = #{type,jdbcType=INTEGER},
+      `name` = #{name,jdbcType=VARCHAR},
+      avatar = #{avatar,jdbcType=VARCHAR},
+      gender = #{gender,jdbcType=INTEGER},
+      is_delete = #{isDelete,jdbcType=INTEGER},
+      created_at = #{createdAt,jdbcType=BIGINT},
+      updated_at = #{updatedAt,jdbcType=BIGINT},
+      deleted_at = #{deletedAt,jdbcType=BIGINT},
+      create_time = #{createTime,jdbcType=TIMESTAMP},
+      update_time = #{updateTime,jdbcType=TIMESTAMP}
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+
+    <select id="selectIdByExternalUserId" parameterType="String" resultType="Long">
+        select id
+        from we_com_user
+        where external_user_id = #{externalUserId}
+    </select>
+
+    <insert id="insertList" parameterType="java.util.List">
+        insert into we_com_user
+        (
+        corp_id,
+        external_user_id,
+        union_id,
+        external_user_id_3rd_party,
+        `type`,
+        `name`,
+        avatar,
+        gender,
+        created_at,
+        updated_at,
+        deleted_at,
+        create_time,
+        update_time
+        )
+        values
+        <foreach collection="list" item="item" separator=",">
+            (
+            #{item.corpId,jdbcType=BIGINT}
+            #{item.externalUserId,jdbcType=VARCHAR},
+            #{item.unionId,jdbcType=VARCHAR},
+            #{item.externalUserId3rdParty,jdbcType=VARCHAR},
+            #{item.type,jdbcType=INTEGER},
+            #{item.name,jdbcType=VARCHAR},
+            #{item.avatar,jdbcType=VARCHAR},
+            #{item.gender,jdbcType=INTEGER},
+            #{item.createdAt,jdbcType=BIGINT},
+            #{item.updatedAt,jdbcType=BIGINT},
+            #{item.deletedAt,jdbcType=BIGINT},
+            #{item.createTime,jdbcType=TIMESTAMP},
+            #{item.updateTime,jdbcType=TIMESTAMP}
+            )
+        </foreach>
+    </insert>
+</mapper>

+ 13 - 0
api-module/target/classes/mybatis-config.xml

@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-config.dtd">
+<configuration>
+    <properties>
+        <property name="dialect" value="mysql"/>
+    </properties>
+    <settings>
+        <!--<setting name="logImpl" value="LOG4J"/>-->
+        <setting name="mapUnderscoreToCamelCase" value="true" />
+        <!--<setting name="logImpl" value="STDOUT_LOGGING" />-->
+    </settings>
+</configuration>

+ 64 - 0
api-module/target/classes/mybatis-generator-config.xml

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

+ 20 - 0
common-module/pom.xml

@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>com.tzld.piaoquan</groupId>
+        <artifactId>growth-manager</artifactId>
+        <version>1.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>common-module</artifactId>
+
+    <properties>
+        <maven.compiler.source>8</maven.compiler.source>
+        <maven.compiler.target>8</maven.compiler.target>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    </properties>
+
+</project>

+ 80 - 0
common-module/src/main/java/com/tzld/piaoquan/common/common/base/CommonResponse.java

@@ -0,0 +1,80 @@
+package com.tzld.piaoquan.common.common.base;
+
+import com.tzld.piaoquan.common.common.enums.ExceptionCodeEnum;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+
+import static com.tzld.piaoquan.common.common.constant.ResponseConstant.SUCCESS_CODE;
+import static com.tzld.piaoquan.common.common.constant.ResponseConstant.SUCCESS_MSG;
+
+/**
+ * Common Response
+ *
+ * @author xueyiming
+ */
+@Setter
+@Getter
+@ToString
+public class CommonResponse<T> {
+    /**
+     * 返回状态码,0 表示业务成功
+     */
+    private int code = 0;
+    /**
+     * 返回消息
+     */
+    private String msg = "success";
+    /**
+     * 业务成功时返回数据
+     */
+    private T data;
+
+    public static <T> CommonResponse<T> success() {
+        CommonResponse<T> commonResponse = new CommonResponse<>();
+        commonResponse.setCode(SUCCESS_CODE);
+        commonResponse.setMsg(SUCCESS_MSG);
+        return commonResponse;
+    }
+
+    public static <T> CommonResponse<T> success(T data) {
+        CommonResponse<T> commonResponse = new CommonResponse<>();
+        commonResponse.setCode(SUCCESS_CODE);
+        commonResponse.setMsg(SUCCESS_MSG);
+        commonResponse.setData(data);
+        return commonResponse;
+    }
+
+    public static <T> CommonResponse<T> create() {
+        return create(SUCCESS_CODE, SUCCESS_MSG, null);
+    }
+
+    public static <T> CommonResponse<T> create(T data) {
+        return create(SUCCESS_CODE, SUCCESS_MSG, data);
+    }
+
+    public static <T> CommonResponse<T> create(ExceptionCodeEnum exceptionCodeEnum) {
+        return create(exceptionCodeEnum.getCode(), exceptionCodeEnum.getMsg(), null);
+    }
+
+    public static <T> CommonResponse<T> create(ExceptionCodeEnum exceptionCodeEnum, String msg) {
+        return create(exceptionCodeEnum.getCode(), msg, null);
+    }
+
+    public static <T> CommonResponse<T> create(int code, String msg) {
+        return create(code, msg, null);
+    }
+
+    public static <T> CommonResponse<T> create(int code, String msg, T data) {
+        CommonResponse<T> commonResponse = new CommonResponse<>();
+        commonResponse.setCode(code);
+        commonResponse.setMsg(msg);
+        commonResponse.setData(data);
+        return commonResponse;
+    }
+
+    public boolean isSuccess() {
+        return this.code == SUCCESS_CODE;
+    }
+
+}

+ 19 - 0
common-module/src/main/java/com/tzld/piaoquan/common/common/constant/MessageConstant.java

@@ -0,0 +1,19 @@
+package com.tzld.piaoquan.common.common.constant;
+
+public interface MessageConstant {
+
+    //推送保底内容
+    String guaranteedText = "- 晚上好!愿这宁静的夜晚带给你心灵的放松与安宁,以下是大家都在看的爆款视频!";
+
+    String morningText = "早安,新的一天,愿你拥有最好的心情去迎接一切美好!爆款视频抢先观看,点击下方精彩不断~";
+
+    //小程序id
+    String appid = "wx7187c217efef24a7";
+
+    String defaultName = "日常push-%s-%s";
+
+    //发送视频数量
+    int MAX_VIDEO_NUM = 3;
+
+
+}

+ 8 - 0
common-module/src/main/java/com/tzld/piaoquan/common/common/constant/OtherServerURL.java

@@ -0,0 +1,8 @@
+package com.tzld.piaoquan.common.common.constant;
+
+public interface OtherServerURL {
+
+    String POST_VIDEO_DETAIL_URL = "https://longvideoapi.piaoquantv.com/longvideoapi/openapi/video/batchSelectVideoInfo";
+
+    String POST_ADD_TENCENT = "https://api.piaoquantv.com/ad/put/flow/add/tencent";
+}

+ 7 - 0
common-module/src/main/java/com/tzld/piaoquan/common/common/constant/RedisConstant.java

@@ -0,0 +1,7 @@
+package com.tzld.piaoquan.common.common.constant;
+
+public interface RedisConstant {
+
+    String WE_COM_ACCESS_TOKEN = "WE_COM_ACCESS_TOKEN_%s";
+
+}

+ 13 - 0
common-module/src/main/java/com/tzld/piaoquan/common/common/constant/ResponseConstant.java

@@ -0,0 +1,13 @@
+package com.tzld.piaoquan.common.common.constant;
+
+/**
+ * 响应常量
+ *
+ * @author xueyiming
+ */
+public interface ResponseConstant {
+
+    int SUCCESS_CODE = 0;
+
+    String SUCCESS_MSG = "success";
+}

+ 11 - 0
common-module/src/main/java/com/tzld/piaoquan/common/common/constant/TimeConstant.java

@@ -0,0 +1,11 @@
+package com.tzld.piaoquan.common.common.constant;
+
+public interface TimeConstant {
+
+    Integer MINUTE = 60;
+    Integer HOUR = 60 * 60;
+    Integer DAY = 60 * 60 * 24;
+
+    Long MILLISECOND_DAY = (long) DAY * 1000;
+
+}

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

@@ -0,0 +1,34 @@
+package com.tzld.piaoquan.common.common.constant;
+
+public interface WeComConstant {
+
+    //获取企微token接口
+    String GET_WE_COM_ACCESS_TOKEN_URL = "https://qyapi.weixin.qq.com/cgi-bin/gettoken";
+
+    //获取群发记录列表
+    String POST_WE_COM_GROUP_MSG_LIST_URL = "https://qyapi.weixin.qq.com/cgi-bin/externalcontact/get_groupmsg_list_v2";
+
+    //获取群发成员发送任务列表
+    String POST_WE_COM_GROUP_MSG_TASK = "https://qyapi.weixin.qq.com/cgi-bin/externalcontact/get_groupmsg_task";
+
+    //获取企业群发成员执行结果
+    String POST_WE_COM_GROUP_MSG_SEND_RESULT = "https://qyapi.weixin.qq.com/cgi-bin/externalcontact/get_groupmsg_send_result";
+
+    //创建企业群发
+    String POST_WE_COM_ADD_MSG_TEMPLATE = "https://qyapi.weixin.qq.com/cgi-bin/externalcontact/add_msg_template";
+
+    //批量获取客户详情
+    String POST_WE_COM_GET_BY_USER = "https://qyapi.weixin.qq.com/cgi-bin/externalcontact/batch/get_by_user";
+
+    //上传临时素材
+    String POST_WE_COM_MEDIA_UPLOAD = "https://qyapi.weixin.qq.com/cgi-bin/media/upload";
+
+    //获取客户列表
+    String GET_WE_COM_EXTERNAL_CONTACT_LIST = "https://qyapi.weixin.qq.com/cgi-bin/externalcontact/list";
+
+    //获取客户详情
+    String GET_WE_COM_EXTERNAL_CONTACT_GET = "https://qyapi.weixin.qq.com/cgi-bin/externalcontact/get";
+
+    //获取配置了客户联系功能的成员列表
+    String GET_WE_COM_FOLLOW_USER_LIST = "https://qyapi.weixin.qq.com/cgi-bin/externalcontact/get_follow_user_list";
+}

+ 10 - 0
common-module/src/main/java/com/tzld/piaoquan/common/common/constant/WeComServerConstant.java

@@ -0,0 +1,10 @@
+package com.tzld.piaoquan.common.common.constant;
+
+public interface WeComServerConstant {
+
+    String TOKEN = "Sk4rwob1vD9bjZDINuYVBU";
+
+    String ENCODING_AES_KEY = "i2DhQ6AjBGpacrSA8NNXIW1MWRzCAwowbrEd30GWEeR";
+
+    String CORP_ID = "wwa4015dc7d652a21f";
+}

+ 18 - 0
common-module/src/main/java/com/tzld/piaoquan/common/common/enums/CorpEnum.java

@@ -0,0 +1,18 @@
+package com.tzld.piaoquan.common.common.enums;
+
+import lombok.Getter;
+
+@Getter
+public enum CorpEnum {
+
+    HNWQ(1L, "湖南为趣时代");
+
+    final Long id;
+    final String desc;
+
+    CorpEnum(Long id, String desc) {
+        this.id = id;
+        this.desc = desc;
+    }
+
+}

+ 27 - 0
common-module/src/main/java/com/tzld/piaoquan/common/common/enums/ExceptionCodeEnum.java

@@ -0,0 +1,27 @@
+package com.tzld.piaoquan.common.common.enums;
+
+import lombok.Getter;
+
+/**
+ * 异常
+ *
+ * @author xueyiming
+ */
+@Getter
+public enum ExceptionCodeEnum {
+    /**
+     * 自定义异常信息
+     */
+    SYSTEM_ERROR(1000, "系统错误"),
+    PARAMS_ERROR(2001, "参数错误")
+    ;
+
+    private final int code;
+    private final String msg;
+
+    ExceptionCodeEnum(int code, String msg) {
+        this.code = code;
+        this.msg = msg;
+    }
+
+}

+ 21 - 0
common-module/src/main/java/com/tzld/piaoquan/common/common/enums/MessageAttachmentTypeEnum.java

@@ -0,0 +1,21 @@
+package com.tzld.piaoquan.common.common.enums;
+
+import lombok.Getter;
+
+@Getter
+public enum MessageAttachmentTypeEnum {
+
+    DEFAULT(0,"未知"),
+    IMAGE(1,"图片"),
+    LINK(2,"链接"),
+    MINI_PROGRAM(3, "小程序"),
+    VIDEO(4, "视频");
+
+    final Integer type;
+    final String desc;
+    MessageAttachmentTypeEnum(Integer type, String desc){
+        this.type = type;
+        this.desc = desc;
+    }
+
+}

+ 19 - 0
common-module/src/main/java/com/tzld/piaoquan/common/common/enums/SourceEnum.java

@@ -0,0 +1,19 @@
+package com.tzld.piaoquan.common.common.enums;
+
+import lombok.Getter;
+
+@Getter
+public enum SourceEnum {
+
+    MANUAL("manual", "保底记录"),
+    HISTORICAL_TOP("historical_top", "优质记录");
+
+    final String name;
+    final String desc;
+
+    SourceEnum(String name, String desc) {
+        this.name = name;
+        this.desc = desc;
+    }
+
+}

+ 20 - 0
common-module/src/main/java/com/tzld/piaoquan/common/common/enums/TimeEnum.java

@@ -0,0 +1,20 @@
+package com.tzld.piaoquan.common.common.enums;
+
+import lombok.Getter;
+
+@Getter
+public enum TimeEnum {
+
+    SECOND(1, "秒"),
+    MINUTE(60, "分"),
+    HOUR(60 * 60, "小时"),
+    DAY(60 * 60 * 24, "天");
+
+    final Integer time;
+    final String desc;
+
+    TimeEnum(Integer time, String desc) {
+        this.time = time;
+        this.desc = desc;
+    }
+}

+ 25 - 0
common-module/src/main/java/com/tzld/piaoquan/common/common/exception/CustomizeException.java

@@ -0,0 +1,25 @@
+package com.tzld.piaoquan.common.common.exception;
+
+
+import com.tzld.piaoquan.common.common.enums.ExceptionCodeEnum;
+import lombok.Getter;
+import lombok.Setter;
+
+@Setter
+@Getter
+public class CustomizeException extends RuntimeException {
+
+    private static final long serialVersionUID = 1L;
+
+    private ExceptionCodeEnum exceptionCodeEnum;
+
+    public CustomizeException(ExceptionCodeEnum exceptionCodeEnum) {
+        super(exceptionCodeEnum.getMsg());
+        this.exceptionCodeEnum = exceptionCodeEnum;
+    }
+
+    public CustomizeException(ExceptionCodeEnum exceptionCodeEnum, String msg) {
+        super(msg);
+        this.exceptionCodeEnum = exceptionCodeEnum;
+    }
+}

+ 94 - 0
common-module/src/main/java/com/tzld/piaoquan/common/component/HttpPoolClient.java

@@ -0,0 +1,94 @@
+package com.tzld.piaoquan.common.component;
+
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.http.HttpEntity;
+import org.apache.http.HttpStatus;
+import org.apache.http.client.methods.*;
+import org.apache.http.entity.StringEntity;
+import org.apache.http.entity.mime.MultipartEntityBuilder;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.util.EntityUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.SocketTimeoutException;
+import java.nio.charset.StandardCharsets;
+
+@Slf4j
+@Component
+public class HttpPoolClient {
+
+    @Autowired
+    private CloseableHttpClient httpClient;
+
+    public String get(String url) throws IOException {
+        HttpGet httpGet = new HttpGet(url);
+        return request(httpGet);
+    }
+
+    public String post(String url) throws IOException {
+        HttpPost httpPost = new HttpPost(url);
+        return request(httpPost);
+    }
+
+
+    public String post(String url, String json) throws IOException {
+        HttpPost httpPost = new HttpPost(url);
+        if (StringUtils.isBlank(json)) {
+            return request(httpPost);
+        }
+        StringEntity entity = new StringEntity(json, StandardCharsets.UTF_8);
+        entity.setContentEncoding("UTF-8");
+        entity.setContentType("application/json");
+        httpPost.setEntity(entity);
+        return request(httpPost);
+    }
+
+    public String post(String url, File file) throws IOException {
+        HttpPost uploadFile = new HttpPost(url);
+        MultipartEntityBuilder builder = MultipartEntityBuilder.create();
+        builder.addBinaryBody("media", file);
+        uploadFile.setEntity(builder.build());
+        return request(uploadFile);
+    }
+
+    public String request(HttpRequestBase request) throws IOException {
+
+        HttpEntity entity = null;
+        CloseableHttpResponse response = request((HttpUriRequest) request);
+        if (response == null) {
+            log.error("call api exception no response");
+            throw new RuntimeException("call api exception no response");
+        }
+        entity = response.getEntity();
+        String content = null;
+        if (entity != null) {
+            content = EntityUtils.toString(entity, "UTF-8");
+        }
+        int httpStatus = response.getStatusLine().getStatusCode();
+        if (httpStatus == HttpStatus.SC_OK) {
+            return content;
+        }
+        String path = request.getURI().toString();
+        log.error("http call api {} fail response status {} content {}", path, httpStatus, content);
+        return null;
+    }
+
+
+    public CloseableHttpResponse request(HttpUriRequest request) {
+        try {
+            return httpClient.execute(request);
+        } catch (Exception e) {
+            String path = request.getURI().toString();
+            if (e instanceof SocketTimeoutException) {
+                log.error(String.format("http timeout request url = %s .", path));
+            }
+            throw new RuntimeException(String.format("http exception request url = %s ", path), e);
+        }
+    }
+
+
+}

+ 48 - 0
common-module/src/main/java/com/tzld/piaoquan/common/config/DataSourceConfig.java

@@ -0,0 +1,48 @@
+package com.tzld.piaoquan.common.config;
+
+import com.alibaba.druid.pool.DruidDataSource;
+import org.apache.ibatis.session.SqlSessionFactory;
+import org.mybatis.spring.SqlSessionFactoryBean;
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Primary;
+import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
+import org.springframework.jdbc.datasource.DataSourceTransactionManager;
+import org.springframework.transaction.PlatformTransactionManager;
+
+import javax.sql.DataSource;
+
+
+@Configuration
+@MapperScan(basePackages = DataSourceConfig.PACKAGE_MASTER, sqlSessionFactoryRef = "masterSqlSessionFactory")
+public class DataSourceConfig {
+    // 数据源
+    static final String PACKAGE_MASTER = "com.tzld.piaoquan.growth.dao";
+    static final String MAPPER_LOCATION_MASTER = "classpath:mapper/*.xml";
+
+    @Bean(name = "dataSource")
+    @ConfigurationProperties("spring.datasource")
+    public DataSource getDataSource(){
+        return new DruidDataSource();
+    }
+
+    @Primary
+    @Bean(name = "masterTransactionManager")
+    public PlatformTransactionManager masterTransactionManager(@Qualifier("dataSource") DataSource dataSource) {
+        return new DataSourceTransactionManager(dataSource);
+    }
+
+    @Primary
+    @Bean(name = "masterSqlSessionFactory")
+    public SqlSessionFactory masterSqlSessionFactory(@Qualifier("dataSource") DataSource dataSource) throws Exception {
+        final SqlSessionFactoryBean sessionFactoryBean = new SqlSessionFactoryBean();
+        sessionFactoryBean.setDataSource(dataSource);
+        sessionFactoryBean.setMapperLocations(new PathMatchingResourcePatternResolver().getResources(DataSourceConfig.MAPPER_LOCATION_MASTER));
+        return sessionFactoryBean.getObject();
+    }
+
+
+}

+ 64 - 0
common-module/src/main/java/com/tzld/piaoquan/common/config/HttpClientConfig.java

@@ -0,0 +1,64 @@
+package com.tzld.piaoquan.common.config;
+
+import org.apache.http.client.config.RequestConfig;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.DefaultHttpRequestRetryHandler;
+import org.apache.http.impl.client.HttpClientBuilder;
+import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+@Configuration
+public class HttpClientConfig {
+
+
+    /**
+     * 链接建立的超时时间 ms
+     */
+    private static final int CONNECTION_TIMEOUT = 3000;
+    /**
+     * 响应超时时间 ms
+     */
+    private static final int SOCKET_TIMEOUT = 10000;
+
+    /**
+     * 每个路由的最大连接数
+     */
+    private static final int MAX_PER_ROUTE = 20;
+
+    /**
+     * 最大连接数
+     */
+    private static final int MAX_TOTAL = 100;
+
+    /**
+     * 重试次数,默认0
+     */
+    private static final int RETRY_COUNT = 3;
+
+    /**
+     * 从connection pool中获得一个connection的超时时间 ms
+     */
+    private static final int CONNECTION_WAIT_TIMEOUT = 2000;
+
+
+    @Bean
+    public CloseableHttpClient httpClient() {
+
+        RequestConfig requestConfig = RequestConfig.custom()
+                .setConnectTimeout(CONNECTION_TIMEOUT)
+                .setSocketTimeout(SOCKET_TIMEOUT)
+                .setConnectionRequestTimeout(CONNECTION_WAIT_TIMEOUT)
+                .build();
+
+        PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager();
+        connectionManager.setMaxTotal(MAX_TOTAL); // 设置最大连接数
+        connectionManager.setDefaultMaxPerRoute(MAX_PER_ROUTE); // 每个路由的最大连接数
+
+        return HttpClientBuilder.create()
+                .setDefaultRequestConfig(requestConfig)
+                .setConnectionManager(connectionManager)
+                .setRetryHandler(new DefaultHttpRequestRetryHandler(RETRY_COUNT, false))
+                .build();
+    }
+}

+ 43 - 0
common-module/src/main/java/com/tzld/piaoquan/common/config/RedisConfig.java

@@ -0,0 +1,43 @@
+package com.tzld.piaoquan.common.config;
+
+import com.fasterxml.jackson.annotation.JsonAutoDetect;
+import com.fasterxml.jackson.annotation.PropertyAccessor;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.jsontype.impl.LaissezFaireSubTypeValidator;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.data.redis.connection.RedisConnectionFactory;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer;
+import org.springframework.data.redis.serializer.RedisSerializer;
+import org.springframework.data.redis.serializer.StringRedisSerializer;
+
+@Configuration
+public class RedisConfig {
+
+    @Bean
+    public RedisTemplate<String, Object> redisTemplate(RedisConnectionFactory redisConnectionFactory){
+        RedisTemplate<String, Object> redisTemplate = new RedisTemplate<>();
+        redisTemplate.setConnectionFactory(redisConnectionFactory);
+        //设置value的序列化方式json
+        redisTemplate.setValueSerializer(redisSerializer());
+        //设置key序列化方式String
+        redisTemplate.setKeySerializer(new StringRedisSerializer());
+        //设置hash key序列化方式String
+        redisTemplate.setHashKeySerializer(new StringRedisSerializer());
+        //设置hash value序列化json
+        redisTemplate.setHashValueSerializer(redisSerializer());
+        redisTemplate.afterPropertiesSet();
+        return redisTemplate;
+    }
+
+    public RedisSerializer<Object> redisSerializer() {
+        //创建JSON序列化器
+        ObjectMapper objectMapper = new ObjectMapper();
+        objectMapper.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
+        //必须设置,否则无法序列化实体类对象
+        objectMapper.activateDefaultTyping(LaissezFaireSubTypeValidator.instance, ObjectMapper.DefaultTyping.NON_FINAL);
+        return new GenericJackson2JsonRedisSerializer(objectMapper);
+    }
+
+}

+ 49 - 0
common-module/src/main/java/com/tzld/piaoquan/common/config/XxlJobConfig.java

@@ -0,0 +1,49 @@
+package com.tzld.piaoquan.common.config;
+
+import com.xxl.job.core.executor.impl.XxlJobSpringExecutor;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+@Configuration
+public class XxlJobConfig {
+
+
+    @Value("${xxl.job.admin.addresses}")
+    private String adminAddresses;
+
+    @Value("${xxl.job.accessToken}")
+    private String accessToken;
+
+    @Value("${xxl.job.executor.appname}")
+    private String appName;
+
+    @Value("${xxl.job.executor.address}")
+    private String address;
+
+    @Value("${xxl.job.executor.ip}")
+    private String ip;
+
+    @Value("${xxl.job.executor.port}")
+    private int port;
+
+    @Value("${xxl.job.executor.logpath}")
+    private String logPath;
+
+    @Value("${xxl.job.executor.logretentiondays}")
+    private int logRetentionDays;
+
+    @Bean
+    public XxlJobSpringExecutor xxlJobExecutor() {
+        XxlJobSpringExecutor xxlJobSpringExecutor = new XxlJobSpringExecutor();
+        xxlJobSpringExecutor.setAdminAddresses(adminAddresses);
+        xxlJobSpringExecutor.setAppname(appName);
+        xxlJobSpringExecutor.setAddress(address);
+        xxlJobSpringExecutor.setIp(ip);
+        xxlJobSpringExecutor.setPort(port);
+        xxlJobSpringExecutor.setAccessToken(accessToken);
+        xxlJobSpringExecutor.setLogPath(logPath);
+        xxlJobSpringExecutor.setLogRetentionDays(logRetentionDays);
+        return xxlJobSpringExecutor;
+    }
+}

+ 37 - 0
common-module/src/main/java/com/tzld/piaoquan/common/model/bo/AdPutFlowParam.java

@@ -0,0 +1,37 @@
+package com.tzld.piaoquan.common.model.bo;
+
+import lombok.Data;
+
+import java.util.Map;
+
+@Data
+public class AdPutFlowParam {
+
+    private Long id;
+
+    private Long videoId;
+
+    private String putScene;
+
+    private String channel;
+
+    private String remark;
+
+    private String path;
+
+    private Map<String,String> requestParam;
+
+    private String rootSourceId;
+
+    private String putTypeOne;
+
+    private String putTypeTwo;
+
+    private String putTypeThree;
+
+    private String testId;
+
+    private String putCarrierId;
+
+    private String putStartDate;
+}

+ 13 - 0
common-module/src/main/java/com/tzld/piaoquan/common/model/bo/ExternalUser.java

@@ -0,0 +1,13 @@
+package com.tzld.piaoquan.common.model.bo;
+
+import lombok.Data;
+
+@Data
+public class ExternalUser {
+
+    private String externalUserId;
+
+    private Integer status;
+
+    private Long sendTime;
+}

+ 12 - 0
common-module/src/main/java/com/tzld/piaoquan/common/model/bo/MiniprogramRecord.java

@@ -0,0 +1,12 @@
+package com.tzld.piaoquan.common.model.bo;
+
+import lombok.Data;
+
+@Data
+public class MiniprogramRecord {
+
+    private Long videoId;
+
+    private Integer attachmentIdx;
+
+}

+ 17 - 0
common-module/src/main/java/com/tzld/piaoquan/common/model/bo/PushMessage.java

@@ -0,0 +1,17 @@
+package com.tzld.piaoquan.common.model.bo;
+
+import lombok.Data;
+
+import java.util.Set;
+
+@Data
+public class PushMessage {
+
+    private Long videoId;
+
+    private Set<Long> userIds;
+
+    private Long staffId;
+
+    private Double score;
+}

+ 15 - 0
common-module/src/main/java/com/tzld/piaoquan/common/model/bo/SendDetail.java

@@ -0,0 +1,15 @@
+package com.tzld.piaoquan.common.model.bo;
+
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class SendDetail {
+
+    private Long staffId;
+
+    private String remark;
+
+    private List<Long> sendCountList;
+}

+ 24 - 0
common-module/src/main/java/com/tzld/piaoquan/common/model/bo/VideoCombination.java

@@ -0,0 +1,24 @@
+package com.tzld.piaoquan.common.model.bo;
+
+import lombok.Data;
+import lombok.ToString;
+
+import java.util.List;
+
+@ToString
+@Data
+public class VideoCombination {
+
+    private List<List<Long>> threeVideoList;
+
+    private Integer threeVideoIndex;
+
+    private List<List<Long>> twoVideoList;
+
+    private Integer twoVideoIndex;
+
+    private List<List<Long>> oneVideoList;
+
+    private Integer oneVideoIndex;
+
+}

+ 11 - 0
common-module/src/main/java/com/tzld/piaoquan/common/model/bo/VideoDetail.java

@@ -0,0 +1,11 @@
+package com.tzld.piaoquan.common.model.bo;
+
+import lombok.Data;
+
+@Data
+public class VideoDetail {
+
+    private String cover;
+
+    private String title;
+}

+ 16 - 0
common-module/src/main/java/com/tzld/piaoquan/common/model/bo/VideoParam.java

@@ -0,0 +1,16 @@
+package com.tzld.piaoquan.common.model.bo;
+
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class VideoParam {
+
+    private Long staffId;
+
+    private List<Long> staffIds;
+
+    private List<Long> videoIds;
+
+}

+ 23 - 0
common-module/src/main/java/com/tzld/piaoquan/common/model/bo/XxlJobParam.java

@@ -0,0 +1,23 @@
+package com.tzld.piaoquan.common.model.bo;
+
+import lombok.Data;
+import lombok.ToString;
+
+import java.util.List;
+
+@Data
+@ToString
+public class XxlJobParam {
+
+    private Long corpId;
+
+    private Long startTime;
+
+    private Long endTime;
+
+    private Long staffId;
+
+    private List<Long> staffIds;
+
+    private Long userId;
+}

+ 92 - 0
common-module/src/main/java/com/tzld/piaoquan/common/model/po/AlertMessage.java

@@ -0,0 +1,92 @@
+package com.tzld.piaoquan.common.model.po;
+
+import java.util.Date;
+
+public class AlertMessage {
+    private Long id;
+
+    private Long messageId;
+
+    private String staffName;
+
+    private String videoIds;
+
+    private String status;
+
+    private String sendTime;
+
+    private Date createTime;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getMessageId() {
+        return messageId;
+    }
+
+    public void setMessageId(Long messageId) {
+        this.messageId = messageId;
+    }
+
+    public String getStaffName() {
+        return staffName;
+    }
+
+    public void setStaffName(String staffName) {
+        this.staffName = staffName;
+    }
+
+    public String getVideoIds() {
+        return videoIds;
+    }
+
+    public void setVideoIds(String videoIds) {
+        this.videoIds = videoIds;
+    }
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
+    public String getSendTime() {
+        return sendTime;
+    }
+
+    public void setSendTime(String sendTime) {
+        this.sendTime = sendTime;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    @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(", messageId=").append(messageId);
+        sb.append(", staffName=").append(staffName);
+        sb.append(", videoIds=").append(videoIds);
+        sb.append(", status=").append(status);
+        sb.append(", sendTime=").append(sendTime);
+        sb.append(", createTime=").append(createTime);
+        sb.append("]");
+        return sb.toString();
+    }
+}

+ 663 - 0
common-module/src/main/java/com/tzld/piaoquan/common/model/po/AlertMessageExample.java

@@ -0,0 +1,663 @@
+package com.tzld.piaoquan.common.model.po;
+
+import com.tzld.piaoquan.common.utils.page.Page;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+public class AlertMessageExample {
+    protected String orderByClause;
+
+    protected boolean distinct;
+
+    protected List<Criteria> oredCriteria;
+
+    protected Page page;
+
+    public AlertMessageExample() {
+        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 andMessageIdIsNull() {
+            addCriterion("message_id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andMessageIdIsNotNull() {
+            addCriterion("message_id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andMessageIdEqualTo(Long value) {
+            addCriterion("message_id =", value, "messageId");
+            return (Criteria) this;
+        }
+
+        public Criteria andMessageIdNotEqualTo(Long value) {
+            addCriterion("message_id <>", value, "messageId");
+            return (Criteria) this;
+        }
+
+        public Criteria andMessageIdGreaterThan(Long value) {
+            addCriterion("message_id >", value, "messageId");
+            return (Criteria) this;
+        }
+
+        public Criteria andMessageIdGreaterThanOrEqualTo(Long value) {
+            addCriterion("message_id >=", value, "messageId");
+            return (Criteria) this;
+        }
+
+        public Criteria andMessageIdLessThan(Long value) {
+            addCriterion("message_id <", value, "messageId");
+            return (Criteria) this;
+        }
+
+        public Criteria andMessageIdLessThanOrEqualTo(Long value) {
+            addCriterion("message_id <=", value, "messageId");
+            return (Criteria) this;
+        }
+
+        public Criteria andMessageIdIn(List<Long> values) {
+            addCriterion("message_id in", values, "messageId");
+            return (Criteria) this;
+        }
+
+        public Criteria andMessageIdNotIn(List<Long> values) {
+            addCriterion("message_id not in", values, "messageId");
+            return (Criteria) this;
+        }
+
+        public Criteria andMessageIdBetween(Long value1, Long value2) {
+            addCriterion("message_id between", value1, value2, "messageId");
+            return (Criteria) this;
+        }
+
+        public Criteria andMessageIdNotBetween(Long value1, Long value2) {
+            addCriterion("message_id not between", value1, value2, "messageId");
+            return (Criteria) this;
+        }
+
+        public Criteria andStaffNameIsNull() {
+            addCriterion("staff_name is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andStaffNameIsNotNull() {
+            addCriterion("staff_name is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andStaffNameEqualTo(String value) {
+            addCriterion("staff_name =", value, "staffName");
+            return (Criteria) this;
+        }
+
+        public Criteria andStaffNameNotEqualTo(String value) {
+            addCriterion("staff_name <>", value, "staffName");
+            return (Criteria) this;
+        }
+
+        public Criteria andStaffNameGreaterThan(String value) {
+            addCriterion("staff_name >", value, "staffName");
+            return (Criteria) this;
+        }
+
+        public Criteria andStaffNameGreaterThanOrEqualTo(String value) {
+            addCriterion("staff_name >=", value, "staffName");
+            return (Criteria) this;
+        }
+
+        public Criteria andStaffNameLessThan(String value) {
+            addCriterion("staff_name <", value, "staffName");
+            return (Criteria) this;
+        }
+
+        public Criteria andStaffNameLessThanOrEqualTo(String value) {
+            addCriterion("staff_name <=", value, "staffName");
+            return (Criteria) this;
+        }
+
+        public Criteria andStaffNameLike(String value) {
+            addCriterion("staff_name like", value, "staffName");
+            return (Criteria) this;
+        }
+
+        public Criteria andStaffNameNotLike(String value) {
+            addCriterion("staff_name not like", value, "staffName");
+            return (Criteria) this;
+        }
+
+        public Criteria andStaffNameIn(List<String> values) {
+            addCriterion("staff_name in", values, "staffName");
+            return (Criteria) this;
+        }
+
+        public Criteria andStaffNameNotIn(List<String> values) {
+            addCriterion("staff_name not in", values, "staffName");
+            return (Criteria) this;
+        }
+
+        public Criteria andStaffNameBetween(String value1, String value2) {
+            addCriterion("staff_name between", value1, value2, "staffName");
+            return (Criteria) this;
+        }
+
+        public Criteria andStaffNameNotBetween(String value1, String value2) {
+            addCriterion("staff_name not between", value1, value2, "staffName");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdsIsNull() {
+            addCriterion("video_ids is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdsIsNotNull() {
+            addCriterion("video_ids is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdsEqualTo(String value) {
+            addCriterion("video_ids =", value, "videoIds");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdsNotEqualTo(String value) {
+            addCriterion("video_ids <>", value, "videoIds");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdsGreaterThan(String value) {
+            addCriterion("video_ids >", value, "videoIds");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdsGreaterThanOrEqualTo(String value) {
+            addCriterion("video_ids >=", value, "videoIds");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdsLessThan(String value) {
+            addCriterion("video_ids <", value, "videoIds");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdsLessThanOrEqualTo(String value) {
+            addCriterion("video_ids <=", value, "videoIds");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdsLike(String value) {
+            addCriterion("video_ids like", value, "videoIds");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdsNotLike(String value) {
+            addCriterion("video_ids not like", value, "videoIds");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdsIn(List<String> values) {
+            addCriterion("video_ids in", values, "videoIds");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdsNotIn(List<String> values) {
+            addCriterion("video_ids not in", values, "videoIds");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdsBetween(String value1, String value2) {
+            addCriterion("video_ids between", value1, value2, "videoIds");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdsNotBetween(String value1, String value2) {
+            addCriterion("video_ids not between", value1, value2, "videoIds");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusIsNull() {
+            addCriterion("`status` is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusIsNotNull() {
+            addCriterion("`status` is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusEqualTo(String value) {
+            addCriterion("`status` =", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusNotEqualTo(String value) {
+            addCriterion("`status` <>", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusGreaterThan(String value) {
+            addCriterion("`status` >", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusGreaterThanOrEqualTo(String value) {
+            addCriterion("`status` >=", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusLessThan(String value) {
+            addCriterion("`status` <", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusLessThanOrEqualTo(String value) {
+            addCriterion("`status` <=", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusLike(String value) {
+            addCriterion("`status` like", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusNotLike(String value) {
+            addCriterion("`status` not like", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusIn(List<String> values) {
+            addCriterion("`status` in", values, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusNotIn(List<String> values) {
+            addCriterion("`status` not in", values, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusBetween(String value1, String value2) {
+            addCriterion("`status` between", value1, value2, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusNotBetween(String value1, String value2) {
+            addCriterion("`status` not between", value1, value2, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andSendTimeIsNull() {
+            addCriterion("send_time is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andSendTimeIsNotNull() {
+            addCriterion("send_time is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andSendTimeEqualTo(Date value) {
+            addCriterion("send_time =", value, "sendTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andSendTimeNotEqualTo(Date value) {
+            addCriterion("send_time <>", value, "sendTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andSendTimeGreaterThan(Date value) {
+            addCriterion("send_time >", value, "sendTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andSendTimeGreaterThanOrEqualTo(Date value) {
+            addCriterion("send_time >=", value, "sendTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andSendTimeLessThan(Date value) {
+            addCriterion("send_time <", value, "sendTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andSendTimeLessThanOrEqualTo(Date value) {
+            addCriterion("send_time <=", value, "sendTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andSendTimeIn(List<Date> values) {
+            addCriterion("send_time in", values, "sendTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andSendTimeNotIn(List<Date> values) {
+            addCriterion("send_time not in", values, "sendTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andSendTimeBetween(Date value1, Date value2) {
+            addCriterion("send_time between", value1, value2, "sendTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andSendTimeNotBetween(Date value1, Date value2) {
+            addCriterion("send_time not between", value1, value2, "sendTime");
+            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 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);
+        }
+    }
+}

部分文件因文件數量過多而無法顯示