jinshihui 9 meses atrás
pai
commit
1b3252fa35
100 arquivos alterados com 12397 adições e 1 exclusões
  1. 2 0
      .gitignore
  2. 3 0
      .vscode/settings.json
  3. 2 0
      linkwe-ai/bin/.gitattributes
  4. 33 0
      linkwe-ai/bin/.gitignore
  5. 19 0
      linkwe-ai/bin/.mvn/wrapper/maven-wrapper.properties
  6. 164 0
      linkwe-ai/bin/pom.xml
  7. 8 0
      linkwe-ai/bin/src/main/resources/application.properties
  8. 11 0
      linkwe-ai/bin/src/main/resources/banner.txt
  9. 203 0
      linkwe-ai/bin/src/main/resources/logback-spring.xml
  10. 4 0
      linkwe-ai/bin/src/main/resources/mapper/ai/SysUserMapper2.xml
  11. 4 0
      linkwe-ai/bin/src/main/resources/mapper/qw/SysUserMapper1.xml
  12. 24 0
      linkwe-ai/bin/src/main/resources/spy.properties
  13. 1 0
      linkwe-api/bin/jdkReplace/README.txt
  14. BIN
      linkwe-api/bin/jdkReplace/US_export_policy.jar
  15. BIN
      linkwe-api/bin/jdkReplace/local_policy.jar
  16. 134 0
      linkwe-api/bin/pom.xml
  17. 10 0
      linkwe-api/bin/src/main/resources/banner.txt
  18. 206 0
      linkwe-api/bin/src/main/resources/logback-spring.xml
  19. 24 0
      linkwe-api/bin/src/main/resources/spy.properties
  20. BIN
      linkwe-api/bin/src/main/resources/templates/CustomerSeas.xlsx
  21. 213 0
      linkwe-api/bin/src/main/resources/templates/jump.html
  22. 116 0
      linkwe-auth/bin/pom.xml
  23. 10 0
      linkwe-auth/bin/src/main/resources/banner.txt
  24. 36 0
      linkwe-auth/bin/src/main/resources/i18n/messages.properties
  25. 203 0
      linkwe-auth/bin/src/main/resources/logback-spring.xml
  26. 29 0
      linkwe-auth/bin/src/main/resources/mapper/system/SysAreaMapper.xml
  27. 112 0
      linkwe-auth/bin/src/main/resources/mapper/system/SysConfigMapper.xml
  28. 164 0
      linkwe-auth/bin/src/main/resources/mapper/system/SysDeptMapper.xml
  29. 124 0
      linkwe-auth/bin/src/main/resources/mapper/system/SysDictDataMapper.xml
  30. 105 0
      linkwe-auth/bin/src/main/resources/mapper/system/SysDictTypeMapper.xml
  31. 57 0
      linkwe-auth/bin/src/main/resources/mapper/system/SysLogininforMapper.xml
  32. 192 0
      linkwe-auth/bin/src/main/resources/mapper/system/SysMenuMapper.xml
  33. 89 0
      linkwe-auth/bin/src/main/resources/mapper/system/SysNoticeMapper.xml
  34. 83 0
      linkwe-auth/bin/src/main/resources/mapper/system/SysOperLogMapper.xml
  35. 122 0
      linkwe-auth/bin/src/main/resources/mapper/system/SysPostMapper.xml
  36. 57 0
      linkwe-auth/bin/src/main/resources/mapper/system/SysRoleDeptMapper.xml
  37. 204 0
      linkwe-auth/bin/src/main/resources/mapper/system/SysRoleMapper.xml
  38. 27 0
      linkwe-auth/bin/src/main/resources/mapper/system/SysRoleMenuMapper.xml
  39. 24 0
      linkwe-auth/bin/src/main/resources/mapper/system/SysUserManageScopMapper.xml
  40. 643 0
      linkwe-auth/bin/src/main/resources/mapper/system/SysUserMapper.xml
  41. 34 0
      linkwe-auth/bin/src/main/resources/mapper/system/SysUserPostMapper.xml
  42. 87 0
      linkwe-auth/bin/src/main/resources/mapper/system/SysUserRoleMapper.xml
  43. 28 0
      linkwe-auth/bin/src/main/resources/spy.properties
  44. 155 0
      linkwe-chinacoal/bin/pom.xml
  45. 19 0
      linkwe-chinacoal/bin/src/main/resources/banner.txt
  46. 203 0
      linkwe-chinacoal/bin/src/main/resources/logback-spring.xml
  47. 14 0
      linkwe-chinacoal/bin/src/main/resources/mapper/modules/bdshdb/customer/EquityCouponMapper.xml
  48. 28 0
      linkwe-chinacoal/bin/src/main/resources/mapper/modules/bdshdb/customer/LocalAppUserMapper.xml
  49. 5 0
      linkwe-chinacoal/bin/src/main/resources/mapper/modules/bdshdb/customer/ProductGroupsMapper.xml
  50. 35 0
      linkwe-chinacoal/bin/src/main/resources/mapper/modules/bdshdb/customer/ProductMapper.xml
  51. 34 0
      linkwe-chinacoal/bin/src/main/resources/mapper/modules/bdshdb/customer/WeActivityCopyMapper.xml
  52. 66 0
      linkwe-chinacoal/bin/src/main/resources/mapper/modules/bdshdb/customer/WeAssistanceUserRecordMapper.xml
  53. 22 0
      linkwe-chinacoal/bin/src/main/resources/mapper/modules/jzgdb/customer/SysUserJzgMapper.xml
  54. 53 0
      linkwe-chinacoal/bin/src/main/resources/mapper/modules/ltycaasdb/ucc/LtUccRmsRecorderlogMapper.xml
  55. 141 0
      linkwe-chinacoal/bin/src/main/resources/mapper/modules/qywx/system/SysDeptMapper.xml
  56. 532 0
      linkwe-chinacoal/bin/src/main/resources/mapper/modules/qywx/system/SysUserMapper.xml
  57. 23 0
      linkwe-chinacoal/bin/src/main/resources/mapper/modules/qywx/system/SysUserPhoneLogMapper.xml
  58. 160 0
      linkwe-chinacoal/bin/src/main/resources/mapper/modules/qywx/system/UccRmsRecorderlogMapper.xml
  59. 21 0
      linkwe-chinacoal/bin/src/main/resources/mapper/modules/xxxt/renewal/CarRenewalMapper.xml
  60. 202 0
      linkwe-chinacoal/bin/src/main/resources/mapper/modules/xxxt/renewal/MidRenewalFramenoListMapper.xml
  61. 25 0
      linkwe-chinacoal/bin/src/main/resources/mapper/modules/xxxt/renewal/NocarfeeMsgMapper.xml
  62. 13 0
      linkwe-chinacoal/bin/src/main/resources/mapper/modules/xxxt/renewal/ProcedureMapper.xml
  63. 37 0
      linkwe-chinacoal/bin/src/main/resources/mapper/modules/xxxt/renewal/QwBaiduMapper.xml
  64. 382 0
      linkwe-chinacoal/bin/src/main/resources/mapper/modules/xxxt/renewal/QwCarHfListMapper.xml
  65. 76 0
      linkwe-chinacoal/bin/src/main/resources/mapper/modules/xxxt/renewal/QwCarHfMsgMapper.xml
  66. 202 0
      linkwe-chinacoal/bin/src/main/resources/mapper/modules/xxxt/renewal/QwFcXBMsgMapper.xml
  67. 137 0
      linkwe-chinacoal/bin/src/main/resources/mapper/modules/xxxt/renewal/QwGenjinMsgMapper.xml
  68. 199 0
      linkwe-chinacoal/bin/src/main/resources/mapper/modules/xxxt/renewal/QwMidRenewalGfListMapper.xml
  69. 21 0
      linkwe-chinacoal/bin/src/main/resources/mapper/modules/xxxt/renewal/QwOneRenewalMapper.xml
  70. 49 0
      linkwe-chinacoal/bin/src/main/resources/mapper/modules/xxxt/renewal/QwRenewalCarSalesConfigMapper.xml
  71. 880 0
      linkwe-chinacoal/bin/src/main/resources/mapper/modules/xxxt/renewal/QwRenewalFramenoListMapper.xml
  72. 537 0
      linkwe-chinacoal/bin/src/main/resources/mapper/modules/xxxt/renewal/QwRenewalFramenoOtherlistMapper.xml
  73. 43 0
      linkwe-chinacoal/bin/src/main/resources/mapper/modules/xxxt/renewal/QwRenewalImportDataMapper.xml
  74. 23 0
      linkwe-chinacoal/bin/src/main/resources/mapper/modules/xxxt/renewal/QwRenewalImportStatusMapper.xml
  75. 150 0
      linkwe-chinacoal/bin/src/main/resources/mapper/modules/xxxt/renewal/QwRenewalLawMapper.xml
  76. 94 0
      linkwe-chinacoal/bin/src/main/resources/mapper/modules/xxxt/renewal/QwRenewalLawNMapper.xml
  77. 29 0
      linkwe-chinacoal/bin/src/main/resources/mapper/modules/xxxt/renewal/QwRenewalTurnoverMapper.xml
  78. 2106 0
      linkwe-chinacoal/bin/src/main/resources/mapper/modules/xxxt/renewal/QwSqlScriptMapper.xml
  79. 316 0
      linkwe-chinacoal/bin/src/main/resources/mapper/modules/xxxt/system/DictMapper.xml
  80. 28 0
      linkwe-chinacoal/bin/src/main/resources/mapper/modules/xxxt/system/PrpdagentMapper.xml
  81. 30 0
      linkwe-chinacoal/bin/src/main/resources/mapper/modules/xxxt/system/PrpdnetpointMapper.xml
  82. 34 0
      linkwe-chinacoal/bin/src/main/resources/mapper/modules/xxxt/system/QwComcodeDeptMapper.xml
  83. 65 0
      linkwe-chinacoal/bin/src/main/resources/mapper/modules/xxxt/system/QwSysDictMapper.xml
  84. 26 0
      linkwe-chinacoal/bin/src/main/resources/mapper/modules/xxxt/system/QwUserDeptMapper.xml
  85. 33 0
      linkwe-chinacoal/bin/src/main/resources/mapper/modules/xxxt/system/SacompanyMapper.xml
  86. 24 0
      linkwe-chinacoal/bin/src/main/resources/spy.properties
  87. 340 0
      linkwe-common/bin/pom.xml
  88. 124 0
      linkwe-fileservice/bin/pom.xml
  89. 11 0
      linkwe-fileservice/bin/src/main/resources/banner.txt
  90. 203 0
      linkwe-fileservice/bin/src/main/resources/logback-spring.xml
  91. 60 0
      linkwe-framework/bin/pom.xml
  92. 128 0
      linkwe-gateway/bin/pom.xml
  93. 12 0
      linkwe-gateway/bin/src/main/resources/banner.txt
  94. 202 0
      linkwe-gateway/bin/src/main/resources/logback-spring.xml
  95. 4 1
      linkwe-gateway/pom.xml
  96. 149 0
      linkwe-scheduler/bin/pom.xml
  97. 0 0
      linkwe-scheduler/bin/src/main/resources/META-INF/services/com.linkwechat.scheduler.processor.IPowerJobProcessor
  98. 11 0
      linkwe-scheduler/bin/src/main/resources/banner.txt
  99. 203 0
      linkwe-scheduler/bin/src/main/resources/logback-spring.xml
  100. 67 0
      linkwe-scheduler/bin/src/main/resources/mapper/modules/xxxt/CarDblinkMapper.xml

+ 2 - 0
.gitignore

@@ -20,3 +20,5 @@ velocity.log
 logs
 .m2
 *.log
+
+linkwe-service\bin\**

+ 3 - 0
.vscode/settings.json

@@ -0,0 +1,3 @@
+{
+  "java.configuration.updateBuildConfiguration": "automatic"
+}

+ 2 - 0
linkwe-ai/bin/.gitattributes

@@ -0,0 +1,2 @@
+/mvnw text eol=lf
+*.cmd text eol=crlf

+ 33 - 0
linkwe-ai/bin/.gitignore

@@ -0,0 +1,33 @@
+HELP.md
+target/
+!.mvn/wrapper/maven-wrapper.jar
+!**/src/main/**/target/
+!**/src/test/**/target/
+
+### STS ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
+
+### IntelliJ IDEA ###
+.idea
+*.iws
+*.iml
+*.ipr
+
+### NetBeans ###
+/nbproject/private/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/
+build/
+!**/src/main/**/build/
+!**/src/test/**/build/
+
+### VS Code ###
+.vscode/

+ 19 - 0
linkwe-ai/bin/.mvn/wrapper/maven-wrapper.properties

@@ -0,0 +1,19 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+wrapperVersion=3.3.2
+distributionType=only-script
+distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip

+ 164 - 0
linkwe-ai/bin/pom.xml

@@ -0,0 +1,164 @@
+<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <artifactId>linkwechat-cloud</artifactId>
+        <groupId>com.linkwechat</groupId>
+        <version>3.1.0</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+    <artifactId>linkwe-ai</artifactId>
+
+    <description>
+        AI助手功能(该项目没有用到)
+    </description>
+
+    <properties>
+        <java.version>1.8</java.version>
+        <maven.compiler.source>1.8</maven.compiler.source>
+        <maven.compiler.target>1.8</maven.compiler.target>
+        <maven.build.timestamp.format>yyyyMMddHHmmss</maven.build.timestamp.format>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter</artifactId>
+        </dependency>
+
+        <!-- 阿里数据库连接池 -->
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>druid-spring-boot-starter</artifactId>
+        </dependency>
+
+        <!-- JSON工具类 -->
+        <dependency>
+            <groupId>com.fasterxml.jackson.core</groupId>
+            <artifactId>jackson-databind</artifactId>
+        </dependency>
+
+        <!-- 阿里JSON解析器 -->
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>fastjson</artifactId>
+            <version>2.0.12</version>
+        </dependency>
+        <!-- 阿里JSON解析器 -->
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>fastjson</artifactId>
+            <scope>compile</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>p6spy</groupId>
+            <artifactId>p6spy</artifactId>
+        </dependency>
+
+        <!-- redis 缓存操作 -->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-data-redis</artifactId>
+        </dependency>
+        <!--mybatis-plus多数据源配置-->
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>dynamic-datasource-spring-boot-starter</artifactId>
+            <version>3.4.0</version>
+        </dependency>
+
+        <!--mybatis-plus多数据源配置-->
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-boot-starter</artifactId>
+        </dependency>
+
+        <!--邮件发送-->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-mail</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.alibaba.cloud</groupId>
+            <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
+            <version>2021.1</version>
+        </dependency>
+
+        <!--校验字段是否为空依赖-->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-validation</artifactId>
+        </dependency>
+
+
+        <!-- SpringCloud Alibaba Nacos Config -->
+        <dependency>
+            <groupId>com.alibaba.cloud</groupId>
+            <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>io.springfox</groupId>
+            <artifactId>springfox-swagger-common</artifactId>
+            <version>2.9.2</version>
+            <scope>compile</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>com.linkwechat</groupId>
+            <artifactId>linkwe-service</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>dashscope-sdk-java</artifactId>
+            <!-- 请将 'the-latest-version' 替换为最新版本号:https://mvnrepository.com/artifact/com.alibaba/dashscope-sdk-java -->
+            <version>2.18.2</version>
+        </dependency>
+
+        <!-- Apache Commons Net for FTP -->
+        <dependency>
+            <groupId>commons-net</groupId>
+            <artifactId>commons-net</artifactId>
+            <version>3.8.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-webflux</artifactId>
+        </dependency>
+
+    </dependencies>
+
+    <build>
+        <finalName>lw-ai</finalName>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+                <version>2.3.3.RELEASE</version>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>repackage</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+
+        </plugins>
+    </build>
+
+</project>

+ 8 - 0
linkwe-ai/bin/src/main/resources/application.properties

@@ -0,0 +1,8 @@
+spring.application.name=linkwe-ai
+
+# application.properties
+ftp.server=ftp.example.com
+ftp.port=21
+ftp.username=your_username
+ftp.password=your_password
+ftp.base-dir=/path/to/base/directory

+ 11 - 0
linkwe-ai/bin/src/main/resources/banner.txt

@@ -0,0 +1,11 @@
+${AnsiColor.GREEN}
+   ________               __          __      __             __
+  / ____/ /_  ___  _____/ /___ ___  / /___  / /____  _  __/ /
+ / /   / __ \/ _ \/ ___/ / __ `/ / / / __ \/ //_/ _ \| |/_/ /
+/ /___/ / / /  __/ /__/ / /_/ / /_/ / /_/ / ,< /  __/>  </_
+\____/_/ /_/\___/\___/_/\__,_/\__,_/\____/_/|_|\___/_/|_/(_)
+
+${AnsiColor.WHITE}
+
+Spring Application Name: ${spring.application.name}
+

+ 203 - 0
linkwe-ai/bin/src/main/resources/logback-spring.xml

@@ -0,0 +1,203 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration scan="true" scanPeriod="60 seconds" debug="false">
+    <!-- 日志输出格式 -->
+    <property name="log.pattern" value="%d{yyyy-MM-dd HH:mm:ss.SSS,CTT} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
+
+    <!--  邮件 -->
+    <!-- SMTP server的地址,必需指定。如网易的SMTP服务器地址是: smtp.163.com -->
+    <property name="smtpHost" value="smtp.163.com"/><!--填入要发送邮件的smtp服务器地址-->
+    <!-- SMTP server的端口地址。默认值:25 -->
+    <property name="smtpPort" value="25"/>
+    <!-- 发送邮件账号,默认为null -->
+    <property name="username" value="*"/><!--发件人账号-->
+    <!-- 发送邮件密码,默认为null -->
+    <property name="password" value="*"/><!--发件人密码-->
+    <!-- 如果设置为true,appender将会使用SSL连接到日志服务器。默认值:false -->
+    <property name="SSL" value="true"/>
+    <!-- 指定发送到那个邮箱,可设置多个<to>属性,指定多个目的邮箱 -->
+    <property name="email_to" value="*"/>
+    <!--收件人账号多个可以逗号隔开-->
+    <!-- 指定发件人名称。如果设置成“&lt;ADMIN&gt; ”,则邮件发件人将会是“<ADMIN> ” -->
+    <property name="email_from" value="1" />
+    <!-- 指定emial的标题,它需要满足PatternLayout中的格式要求。如果设置成“Log: %logger - %msg ”,就案例来讲,则发送邮件时,标题为“【Error】: com.foo.Bar - Hello World ”。 默认值:"%logger{20} - %m". -->
+    <property name="email_subject" value="【linkwechat-ai】【Error】: %logger" />
+
+
+    <property name="app_name" value="linkwe-ai"/>
+    <!-- 日志根目录-->
+    <springProperty scope="context" name="log.path" source="logging.path"
+                    defaultValue="./logs/linkwe-ai"/>
+
+    <!-- 控制台输出 -->
+    <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
+        <encoder>
+            <pattern>${log.pattern}</pattern>
+        </encoder>
+    </appender>
+
+    <!-- 系统日志输出 -->
+    <!-- 循环文件输出(基于时间戳的分文件,是实际项目中用途最广的一种情况) -->
+    <appender name="file_debug" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <file>${log.path}/debug/${app_name}.debug.log</file>
+        <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+            <!-- rollover daily -->
+            <fileNamePattern>${log.path}/debug/${app_name}_%d{yyyy-MM-dd}.debug.%i.log</fileNamePattern>
+            <!-- each file should be at most 100MB, keep 60 days worth of history, but at most 20GB -->
+            <maxFileSize>50MB</maxFileSize>
+            <maxHistory>30</maxHistory>
+            <totalSizeCap>10GB</totalSizeCap>
+        </rollingPolicy>
+        <encoder>
+            <pattern>${log.pattern}</pattern>
+        </encoder>
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <level>DEBUG</level>
+            <onMatch>ACCEPT</onMatch>
+            <onMismatch>DENY</onMismatch>
+        </filter>
+    </appender>
+    <!-- 异步输出 -->
+    <appender name="arollingfile_debug" class="ch.qos.logback.classic.AsyncAppender">
+        <!-- 不丢失日志.默认的,如果队列的80%已满,则会丢弃TRACT、DEBUG、INFO级别的日志 -->
+        <discardingThreshold>0</discardingThreshold>
+        <!-- 更改默认的队列的深度,该值会影响性能.默认值为256 -->
+        <queueSize>1</queueSize>
+        <!-- 添加附加的appender,最多只能添加一个 -->
+        <appender-ref ref="file_debug"/>
+    </appender>
+
+    <!-- 循环文件输出(基于时间戳的分文件,是实际项目中用途最广的一种情况) -->
+    <appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <file>${log.path}/info/${app_name}.info.log</file>
+        <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+            <!-- rollover daily -->
+            <fileNamePattern>${log.path}/info/${app_name}_%d{yyyy-MM-dd}.info.%i.log</fileNamePattern>
+            <!-- each file should be at most 100MB, keep 60 days worth of history, but at most 20GB -->
+            <maxFileSize>50MB</maxFileSize>
+            <maxHistory>30</maxHistory>
+            <totalSizeCap>10GB</totalSizeCap>
+        </rollingPolicy>
+        <encoder>
+            <pattern>${log.pattern}</pattern>
+        </encoder>
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <level>INFO</level>
+            <onMatch>ACCEPT</onMatch>
+            <onMismatch>DENY</onMismatch>
+        </filter>
+    </appender>
+    <!-- 异步输出 -->
+    <appender name="arollingfile_info" class="ch.qos.logback.classic.AsyncAppender">
+        <!-- 不丢失日志.默认的,如果队列的80%已满,则会丢弃TRACT、DEBUG、INFO级别的日志 -->
+        <discardingThreshold>0</discardingThreshold>
+        <!-- 更改默认的队列的深度,该值会影响性能.默认值为256 -->
+        <queueSize>1</queueSize>
+        <!-- 添加附加的appender,最多只能添加一个 -->
+        <appender-ref ref="file_info"/>
+    </appender>
+
+    <!-- 循环文件输出(基于时间戳的分文件,是实际项目中用途最广的一种情况) -->
+    <appender name="file_warn" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <file>${log.path}/warn/${app_name}.warn.log</file>
+        <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+            <!-- rollover daily -->
+            <fileNamePattern>${log.path}/warn/${app_name}_%d{yyyy-MM-dd}.warn.%i.log</fileNamePattern>
+            <!-- each file should be at most 100MB, keep 60 days worth of history, but at most 20GB -->
+            <maxFileSize>50MB</maxFileSize>
+            <maxHistory>30</maxHistory>
+            <totalSizeCap>10GB</totalSizeCap>
+        </rollingPolicy>
+        <encoder>
+            <pattern>${log.pattern}</pattern>
+        </encoder>
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <level>WARN</level>
+            <onMatch>ACCEPT</onMatch>
+            <onMismatch>DENY</onMismatch>
+        </filter>
+    </appender>
+    <!-- 异步输出 -->
+    <appender name="arollingfile_warn" class="ch.qos.logback.classic.AsyncAppender">
+        <!-- 不丢失日志.默认的,如果队列的80%已满,则会丢弃TRACT、DEBUG、INFO级别的日志 -->
+        <discardingThreshold>0</discardingThreshold>
+        <!-- 更改默认的队列的深度,该值会影响性能.默认值为256 -->
+        <queueSize>1</queueSize>
+        <!-- 添加附加的appender,最多只能添加一个 -->
+        <appender-ref ref="file_warn"/>
+    </appender>
+
+    <!-- 循环文件输出(基于时间戳的分文件,是实际项目中用途最广的一种情况) -->
+    <appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <file>${log.path}/error/${app_name}.error.log</file>
+        <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+            <!-- rollover daily -->
+            <fileNamePattern>${log.path}/error/${app_name}_%d{yyyy-MM-dd}.error.%i.log</fileNamePattern>
+            <!-- each file should be at most 100MB, keep 60 days worth of history, but at most 20GB -->
+            <maxFileSize>50MB</maxFileSize>
+            <maxHistory>30</maxHistory>
+            <totalSizeCap>10GB</totalSizeCap>
+        </rollingPolicy>
+        <encoder>
+            <pattern>${log.pattern}</pattern>
+        </encoder>
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <level>ERROR</level>
+            <onMatch>ACCEPT</onMatch>
+            <onMismatch>DENY</onMismatch>
+        </filter>
+    </appender>
+    <!-- 异步输出 -->
+    <appender name="arollingfile_error" class="ch.qos.logback.classic.AsyncAppender">
+        <!-- 不丢失日志.默认的,如果队列的80%已满,则会丢弃TRACT、DEBUG、INFO级别的日志 -->
+        <discardingThreshold>0</discardingThreshold>
+        <!-- 更改默认的队列的深度,该值会影响性能.默认值为256 -->
+        <queueSize>1</queueSize>
+        <!-- 添加附加的appender,最多只能添加一个 -->
+        <appender-ref ref="file_error"/>
+    </appender>
+
+    <!-- ERROR邮件发送 -->
+    <appender name="EMAIL" class="ch.qos.logback.classic.net.SMTPAppender">
+        <smtpHost>${smtpHost}</smtpHost>
+        <smtpPort>${smtpPort}</smtpPort>
+        <username>${username}</username>
+        <password>${password}</password>
+        <!-- <asynchronousSending>true</asynchronousSending>-->
+        <SSL>${SSL}</SSL>
+        <!--<STARTTLS>true</STARTTLS>-->
+        <to>${email_to}</to>
+        <from>${email_from}</from>
+        <subject>${email_subject}</subject>
+        <!-- html格式-->
+        <layout class="ch.qos.logback.classic.html.HTMLLayout">
+            <Pattern>%date%level%thread%logger{0}%line%message</Pattern>
+        </layout>
+        <!-- 这里采用等级过滤器 指定等级相符才发送 -->
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <level>ERROR</level>
+            <onMatch>ACCEPT</onMatch>
+            <onMismatch>DENY</onMismatch>
+        </filter>
+        <cyclicBufferTracker class="ch.qos.logback.core.spi.CyclicBufferTracker">
+            <!-- 每个电子邮件只发送一个日志条目 -->
+            <bufferSize>1</bufferSize>
+        </cyclicBufferTracker>
+    </appender>
+
+
+    <!-- 系统模块日志级别控制  -->
+    <logger name="cn.linkwechat" level="info" />
+    <!-- Spring日志级别控制  -->
+    <logger name="org.springframework" level="warn" />
+
+    <!--系统操作日志-->
+    <root level="info">
+        <appender-ref ref="console" />
+        <appender-ref ref="arollingfile_debug" />
+        <appender-ref ref="arollingfile_info" />
+        <appender-ref ref="arollingfile_warn" />
+        <appender-ref ref="arollingfile_error" />
+        <!-- <appender-ref ref="alarm_error" />-->
+        <appender-ref ref="EMAIL" />
+    </root>
+</configuration>

+ 4 - 0
linkwe-ai/bin/src/main/resources/mapper/ai/SysUserMapper2.xml

@@ -0,0 +1,4 @@
+<?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.linkwechat.coal.modules.ai.mapper.SysUserMapper2">
+</mapper>

+ 4 - 0
linkwe-ai/bin/src/main/resources/mapper/qw/SysUserMapper1.xml

@@ -0,0 +1,4 @@
+<?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.linkwechat.coal.modules.qw.mapper.SysUserMapper1">
+</mapper>

+ 24 - 0
linkwe-ai/bin/src/main/resources/spy.properties

@@ -0,0 +1,24 @@
+#3.2.1\u4EE5\u4E0A\u4F7F\u7528
+modulelist=com.baomidou.mybatisplus.extension.p6spy.MybatisPlusLogFactory,com.p6spy.engine.outage.P6OutageFactory
+#3.2.1\u4EE5\u4E0B\u4F7F\u7528\u6216\u8005\u4E0D\u914D\u7F6E
+#modulelist=com.p6spy.engine.logging.P6LogFactory,com.p6spy.engine.outage.P6OutageFactory
+# \u81EA\u5B9A\u4E49\u65E5\u5FD7\u6253\u5370
+logMessageFormat=com.baomidou.mybatisplus.extension.p6spy.P6SpyLogger
+#\u65E5\u5FD7\u8F93\u51FA\u5230\u63A7\u5236\u53F0
+appender=com.baomidou.mybatisplus.extension.p6spy.StdoutLogger
+# \u4F7F\u7528\u65E5\u5FD7\u7CFB\u7EDF\u8BB0\u5F55 sql
+#appender=com.p6spy.engine.spy.appender.Slf4JLogger
+# \u8BBE\u7F6E p6spy driver \u4EE3\u7406
+deregisterdrivers=true
+# \u53D6\u6D88JDBC URL\u524D\u7F00
+useprefix=true
+# \u914D\u7F6E\u8BB0\u5F55 Log \u4F8B\u5916,\u53EF\u53BB\u6389\u7684\u7ED3\u679C\u96C6\u6709error,info,batch,debug,statement,commit,rollback,result,resultset.
+excludecategories=info,debug,result,commit,resultset
+# \u65E5\u671F\u683C\u5F0F
+dateformat=yyyy-MM-dd HH:mm:ss
+# \u5B9E\u9645\u9A71\u52A8\u53EF\u591A\u4E2A
+#driverlist=oracle.jdbc.driver.OracleDriver
+# \u662F\u5426\u5F00\u542F\u6162SQL\u8BB0\u5F55
+outagedetection=true
+# \u6162SQL\u8BB0\u5F55\u6807\u51C6 2 \u79D2
+outagedetectioninterval=2

+ 1 - 0
linkwe-api/bin/jdkReplace/README.txt

@@ -0,0 +1 @@
+2024011014:35

BIN
linkwe-api/bin/jdkReplace/US_export_policy.jar


BIN
linkwe-api/bin/jdkReplace/local_policy.jar


+ 134 - 0
linkwe-api/bin/pom.xml

@@ -0,0 +1,134 @@
+<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>linkwechat-cloud</artifactId>
+        <groupId>com.linkwechat</groupId>
+        <version>3.1.0</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>linkwe-api</artifactId>
+
+    <properties>
+        <java.version>1.8</java.version>
+        <maven.compiler.source>1.8</maven.compiler.source>
+        <maven.compiler.target>1.8</maven.compiler.target>
+        <maven.build.timestamp.format>yyyyMMddHHmmss</maven.build.timestamp.format>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-validation</artifactId>
+        </dependency>
+
+        <!-- 阿里数据库连接池 -->
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>druid-spring-boot-starter</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-test</artifactId>
+            <version>2.6.1</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.junit.jupiter</groupId>
+            <artifactId>junit-jupiter</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <!-- liquibase -->
+        <!--<dependency>
+            <groupId>org.liquibase</groupId>
+            <artifactId>liquibase-core</artifactId>
+        </dependency>-->
+
+        <!-- swagger2-->
+        <dependency>
+            <groupId>io.springfox</groupId>
+            <artifactId>springfox-swagger2</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.linkwechat</groupId>
+            <artifactId>linkwe-service</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.alibaba.cloud</groupId>
+            <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
+            <version>2021.1</version>
+        </dependency>
+
+        <!-- SpringCloud Alibaba Nacos Config -->
+        <dependency>
+            <groupId>com.alibaba.cloud</groupId>
+            <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
+        </dependency>
+
+
+    </dependencies>
+
+
+    <build>
+        <finalName>lw-api</finalName>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+                <version>2.3.3.RELEASE</version>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>repackage</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.liquibase</groupId>
+                <artifactId>liquibase-maven-plugin</artifactId>
+                <version>4.8.0</version>
+                <dependencies>
+                    <dependency>
+                        <groupId>org.liquibase</groupId>
+                        <artifactId>liquibase-core</artifactId>
+                        <version>4.8.0</version>
+                    </dependency>
+                </dependencies>
+                <configuration>
+                    <propertyFile>src/main/resources/liquibase-db.properties</propertyFile>
+                    <changeLogFile>src/main/resources/db/changelog-master.xml</changeLogFile>
+                    <diffChangeLogFile>src/main/resources/db/changelog/changelog_${maven.build.timestamp}.xml</diffChangeLogFile>
+                    <outputChangeLogFile>src/main/resources/db/changelog/changelog_original.xml</outputChangeLogFile>
+                    <dropFirst>false</dropFirst>
+                    <defaultSchemaName/>
+                    <verbose>true</verbose>
+                    <logging>debug</logging>
+                    <promptOnNonLocalDatabase>true</promptOnNonLocalDatabase>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>

+ 10 - 0
linkwe-api/bin/src/main/resources/banner.txt

@@ -0,0 +1,10 @@
+${AnsiColor.GREEN}
+  _     _       _   __        __    ____ _           _      _          _
+ | |   (_)_ __ | | _\ \      / /__ / ___| |__   __ _| |_   / \   _ __ (_)
+ | |   | | '_ \| |/ /\ \ /\ / / _ \ |   | '_ \ / _` | __| / _ \ | '_ \| |
+ | |___| | | | |   <  \ V  V /  __/ |___| | | | (_| | |_ / ___ \| |_) | |
+ |_____|_|_| |_|_|\_\  \_/\_/ \___|\____|_| |_|\__,_|\__/_/   \_\ .__/|_|
+                                                                |_|
+ ${AnsiColor.WHITE}
+
+ Spring Boot Version: ${spring-boot.version}

+ 206 - 0
linkwe-api/bin/src/main/resources/logback-spring.xml

@@ -0,0 +1,206 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration scan="true" scanPeriod="60 seconds" debug="false">
+    <!-- 日志存放路径 -->
+
+    <property name="app_name" value="linkwe-api"/>
+
+    <!-- 日志输出格式 -->
+    <property name="log.pattern" value="%d{yyyy-MM-dd HH:mm:ss.SSS,CTT} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
+
+    <!--  邮件 -->
+    <!-- SMTP server的地址,必需指定。如网易的SMTP服务器地址是: smtp.163.com -->
+    <property name="smtpHost" value="smtp.163.com"/><!--填入要发送邮件的smtp服务器地址-->
+    <!-- SMTP server的端口地址。默认值:25 -->
+    <property name="smtpPort" value="25"/>
+    <!-- 发送邮件账号,默认为null -->
+    <property name="username" value="*"/><!--发件人账号-->
+    <!-- 发送邮件密码,默认为null -->
+    <property name="password" value="*"/><!--发件人密码-->
+    <!-- 如果设置为true,appender将会使用SSL连接到日志服务器。默认值:false -->
+    <property name="SSL" value="true"/>
+    <!-- 指定发送到那个邮箱,可设置多个<to>属性,指定多个目的邮箱 -->
+    <property name="email_to" value="*"/>
+    <!--收件人账号多个可以逗号隔开-->
+    <!-- 指定发件人名称。如果设置成“&lt;ADMIN&gt; ”,则邮件发件人将会是“<ADMIN> ” -->
+    <property name="email_from" value="1" />
+    <!-- 指定emial的标题,它需要满足PatternLayout中的格式要求。如果设置成“Log: %logger - %msg ”,就案例来讲,则发送邮件时,标题为“【Error】: com.foo.Bar - Hello World ”。 默认值:"%logger{20} - %m". -->
+    <property name="email_subject" value="【linkwechat-api】【Error】: %logger" />
+
+    <!-- 日志根目录-->
+    <springProperty scope="context" name="log.path" source="logging.path"
+                    defaultValue="./logs/linkwe-api"/>
+
+    <!-- 控制台输出 -->
+    <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
+        <encoder>
+            <pattern>${log.pattern}</pattern>
+        </encoder>
+    </appender>
+
+    <!-- 系统日志输出 -->
+    <!-- 循环文件输出(基于时间戳的分文件,是实际项目中用途最广的一种情况) -->
+    <appender name="file_debug" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <file>${log.path}/debug/${app_name}.debug.log</file>
+        <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+            <!-- rollover daily -->
+            <fileNamePattern>${log.path}/debug/${app_name}_%d{yyyy-MM-dd}.debug.%i.log</fileNamePattern>
+            <!-- each file should be at most 100MB, keep 60 days worth of history, but at most 20GB -->
+            <maxFileSize>50MB</maxFileSize>
+            <maxHistory>30</maxHistory>
+            <totalSizeCap>10GB</totalSizeCap>
+        </rollingPolicy>
+        <encoder>
+            <pattern>${log.pattern}</pattern>
+        </encoder>
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <level>DEBUG</level>
+            <onMatch>ACCEPT</onMatch>
+            <onMismatch>DENY</onMismatch>
+        </filter>
+    </appender>
+    <!-- 异步输出 -->
+    <appender name="arollingfile_debug" class="ch.qos.logback.classic.AsyncAppender">
+        <!-- 不丢失日志.默认的,如果队列的80%已满,则会丢弃TRACT、DEBUG、INFO级别的日志 -->
+        <discardingThreshold>0</discardingThreshold>
+        <!-- 更改默认的队列的深度,该值会影响性能.默认值为256 -->
+        <queueSize>1</queueSize>
+        <!-- 添加附加的appender,最多只能添加一个 -->
+        <appender-ref ref="file_debug"/>
+    </appender>
+
+    <!-- 循环文件输出(基于时间戳的分文件,是实际项目中用途最广的一种情况) -->
+    <appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <file>${log.path}/info/${app_name}.info.log</file>
+        <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+            <!-- rollover daily -->
+            <fileNamePattern>${log.path}/info/${app_name}_%d{yyyy-MM-dd}.info.%i.log</fileNamePattern>
+            <!-- each file should be at most 100MB, keep 60 days worth of history, but at most 20GB -->
+            <maxFileSize>50MB</maxFileSize>
+            <maxHistory>30</maxHistory>
+            <totalSizeCap>10GB</totalSizeCap>
+        </rollingPolicy>
+        <encoder>
+            <pattern>${log.pattern}</pattern>
+        </encoder>
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <level>INFO</level>
+            <onMatch>ACCEPT</onMatch>
+            <onMismatch>DENY</onMismatch>
+        </filter>
+    </appender>
+    <!-- 异步输出 -->
+    <appender name="arollingfile_info" class="ch.qos.logback.classic.AsyncAppender">
+        <!-- 不丢失日志.默认的,如果队列的80%已满,则会丢弃TRACT、DEBUG、INFO级别的日志 -->
+        <discardingThreshold>0</discardingThreshold>
+        <!-- 更改默认的队列的深度,该值会影响性能.默认值为256 -->
+        <queueSize>1</queueSize>
+        <!-- 添加附加的appender,最多只能添加一个 -->
+        <appender-ref ref="file_info"/>
+    </appender>
+
+    <!-- 循环文件输出(基于时间戳的分文件,是实际项目中用途最广的一种情况) -->
+    <appender name="file_warn" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <file>${log.path}/warn/${app_name}.warn.log</file>
+        <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+            <!-- rollover daily -->
+            <fileNamePattern>${log.path}/warn/${app_name}_%d{yyyy-MM-dd}.warn.%i.log</fileNamePattern>
+            <!-- each file should be at most 100MB, keep 60 days worth of history, but at most 20GB -->
+            <maxFileSize>50MB</maxFileSize>
+            <maxHistory>30</maxHistory>
+            <totalSizeCap>10GB</totalSizeCap>
+        </rollingPolicy>
+        <encoder>
+            <pattern>${log.pattern}</pattern>
+        </encoder>
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <level>WARN</level>
+            <onMatch>ACCEPT</onMatch>
+            <onMismatch>DENY</onMismatch>
+        </filter>
+    </appender>
+    <!-- 异步输出 -->
+    <appender name="arollingfile_warn" class="ch.qos.logback.classic.AsyncAppender">
+        <!-- 不丢失日志.默认的,如果队列的80%已满,则会丢弃TRACT、DEBUG、INFO级别的日志 -->
+        <discardingThreshold>0</discardingThreshold>
+        <!-- 更改默认的队列的深度,该值会影响性能.默认值为256 -->
+        <queueSize>1</queueSize>
+        <!-- 添加附加的appender,最多只能添加一个 -->
+        <appender-ref ref="file_warn"/>
+    </appender>
+
+    <!-- 循环文件输出(基于时间戳的分文件,是实际项目中用途最广的一种情况) -->
+    <appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <file>${log.path}/error/${app_name}.error.log</file>
+        <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+            <!-- rollover daily -->
+            <fileNamePattern>${log.path}/error/${app_name}_%d{yyyy-MM-dd}.error.%i.log</fileNamePattern>
+            <!-- each file should be at most 100MB, keep 60 days worth of history, but at most 20GB -->
+            <maxFileSize>50MB</maxFileSize>
+            <maxHistory>30</maxHistory>
+            <totalSizeCap>10GB</totalSizeCap>
+        </rollingPolicy>
+        <encoder>
+            <pattern>${log.pattern}</pattern>
+        </encoder>
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <level>ERROR</level>
+            <onMatch>ACCEPT</onMatch>
+            <onMismatch>DENY</onMismatch>
+        </filter>
+    </appender>
+    <!-- 异步输出 -->
+    <appender name="arollingfile_error" class="ch.qos.logback.classic.AsyncAppender">
+        <!-- 不丢失日志.默认的,如果队列的80%已满,则会丢弃TRACT、DEBUG、INFO级别的日志 -->
+        <discardingThreshold>0</discardingThreshold>
+        <!-- 更改默认的队列的深度,该值会影响性能.默认值为256 -->
+        <queueSize>1</queueSize>
+        <!-- 添加附加的appender,最多只能添加一个 -->
+        <appender-ref ref="file_error"/>
+    </appender>
+
+    <!-- ERROR邮件发送 -->
+    <appender name="EMAIL" class="ch.qos.logback.classic.net.SMTPAppender">
+        <smtpHost>${smtpHost}</smtpHost>
+        <smtpPort>${smtpPort}</smtpPort>
+        <username>${username}</username>
+        <password>${password}</password>
+       <!-- <asynchronousSending>true</asynchronousSending>-->
+        <SSL>${SSL}</SSL>
+        <!--<STARTTLS>true</STARTTLS>-->
+        <to>${email_to}</to>
+        <from>${email_from}</from>
+        <subject>${email_subject}</subject>
+        <!-- html格式-->
+        <layout class="ch.qos.logback.classic.html.HTMLLayout">
+            <Pattern>%date%level%thread%logger{0}%line%message</Pattern>
+        </layout>
+        <!-- 这里采用等级过滤器 指定等级相符才发送 -->
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <level>ERROR</level>
+            <onMatch>ACCEPT</onMatch>
+            <onMismatch>DENY</onMismatch>
+        </filter>
+        <cyclicBufferTracker class="ch.qos.logback.core.spi.CyclicBufferTracker">
+            <!-- 每个电子邮件只发送一个日志条目 -->
+            <bufferSize>1</bufferSize>
+        </cyclicBufferTracker>
+    </appender>
+
+
+    <!-- 系统模块日志级别控制  -->
+    <logger name="cn.linkwechat" level="info" />
+    <!-- Spring日志级别控制  -->
+    <logger name="org.springframework" level="warn" />
+
+    <!--系统操作日志-->
+    <root level="info">
+        <appender-ref ref="console" />
+        <appender-ref ref="arollingfile_debug" />
+        <appender-ref ref="arollingfile_info" />
+        <appender-ref ref="arollingfile_warn" />
+        <appender-ref ref="arollingfile_error" />
+        <!-- <appender-ref ref="alarm_error" />-->
+        <appender-ref ref="EMAIL" />
+    </root>
+
+</configuration>

+ 24 - 0
linkwe-api/bin/src/main/resources/spy.properties

@@ -0,0 +1,24 @@
+#3.2.1\u4EE5\u4E0A\u4F7F\u7528
+modulelist=com.baomidou.mybatisplus.extension.p6spy.MybatisPlusLogFactory,com.p6spy.engine.outage.P6OutageFactory
+#3.2.1\u4EE5\u4E0B\u4F7F\u7528\u6216\u8005\u4E0D\u914D\u7F6E
+#modulelist=com.p6spy.engine.logging.P6LogFactory,com.p6spy.engine.outage.P6OutageFactory
+# \u81EA\u5B9A\u4E49\u65E5\u5FD7\u6253\u5370
+logMessageFormat=com.baomidou.mybatisplus.extension.p6spy.P6SpyLogger
+#\u65E5\u5FD7\u8F93\u51FA\u5230\u63A7\u5236\u53F0
+appender=com.baomidou.mybatisplus.extension.p6spy.StdoutLogger
+# \u4F7F\u7528\u65E5\u5FD7\u7CFB\u7EDF\u8BB0\u5F55 sql
+#appender=com.p6spy.engine.spy.appender.Slf4JLogger
+# \u8BBE\u7F6E p6spy driver \u4EE3\u7406
+deregisterdrivers=true
+# \u53D6\u6D88JDBC URL\u524D\u7F00
+useprefix=true
+# \u914D\u7F6E\u8BB0\u5F55 Log \u4F8B\u5916,\u53EF\u53BB\u6389\u7684\u7ED3\u679C\u96C6\u6709error,info,batch,debug,statement,commit,rollback,result,resultset.
+excludecategories=info,debug,result,commit,resultset
+# \u65E5\u671F\u683C\u5F0F
+dateformat=yyyy-MM-dd HH:mm:ss
+# \u5B9E\u9645\u9A71\u52A8\u53EF\u591A\u4E2A
+#driverlist=org.h2.Driver
+# \u662F\u5426\u5F00\u542F\u6162SQL\u8BB0\u5F55
+outagedetection=true
+# \u6162SQL\u8BB0\u5F55\u6807\u51C6 2 \u79D2
+outagedetectioninterval=2

BIN
linkwe-api/bin/src/main/resources/templates/CustomerSeas.xlsx


+ 213 - 0
linkwe-api/bin/src/main/resources/templates/jump.html

@@ -0,0 +1,213 @@
+<html>
+
+<head>
+  <title>打开小程序</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+  <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1, maximum-scale=1">
+  <script>
+    window.data = {}
+    window.onerror = e => {
+      console.error(e)
+      alert('发生错误' + e)
+    }
+  </script>
+  <!-- weui 样式 -->
+  <link rel="stylesheet" href="https://res.wx.qq.com/open/libs/weui/2.4.1/weui.min.css">
+  </link>
+  <!-- 调试用的移动端 console -->
+  <!-- <script src="https://cdn.jsdelivr.net/npm/eruda"></script> -->
+  <!-- <script>eruda.init();</script> -->
+  <!-- 公众号 JSSDK -->
+  <!-- <script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script> -->
+  <script src="https://cdn.jsdelivr.net/npm/jsqr@1.4.0/dist/jsQR.min.js"></script>
+  <script>
+    function docReady(fn) {
+      if (document.readyState === 'complete' || document.readyState === 'interactive') {
+        fn()
+      } else {
+        document.addEventListener('DOMContentLoaded', fn);
+      }
+    }
+
+    docReady(async function () {
+      var ua = navigator.userAgent.toLowerCase()
+      var isWXWork = ua.match(/wxwork/i) == 'wxwork'
+      var isWeixin = !isWXWork && ua.match(/micromessenger/i) == 'micromessenger'
+      var isMobile = false
+      var isDesktop = false
+      if (navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|IEMobile)/i)) {
+        isMobile = true
+      } else {
+        isDesktop = true
+      }
+
+      //  "type":"0-文章 1-公众号二维码 2-个人二维码 3-群二维码 4-员工活码 5-客群活码 6-门店导购活码 7-个人小程序 8-门店群活码 9-企业小程序 10-小程序二维码"
+      if (window.data.errorMsg) {
+        alert('发生错误:' + window.data.errorMsg)
+        return
+      } else if (window.data.type == 0) {
+        location.href = (window.data.linkPath)
+        return
+      }
+
+      if (isWeixin) {
+
+        if ([5, 6, 8].includes(+window.data.type)) {
+          var canvas = document.createElement('canvas')
+          var ctx = canvas.getContext('2d')
+          var img = new Image()
+          img.setAttribute('crossOrigin', 'anonymous')
+          img.onload = function () {
+            canvas.width = img.width
+            canvas.height = img.height
+            ctx.drawImage(img, 0, 0)
+            var imageData = ctx.getImageData(0, 0, img.width, img.height)
+            var code = jsQR(imageData.data, imageData.width, imageData.height, {
+              inversionAttempts: "dontInvert",
+            })
+
+            location.href = ((code && code.data) || window.data.url_scheme)
+          }
+          img.src = window.data.qrCode
+          return
+        }
+
+        // var containerEl = document.getElementById('wechat-web-container')
+        // containerEl.classList.remove('hidden')
+        // containerEl.classList.add('full', 'wechat-web-container')
+
+        // var launchBtn = document.getElementById('launch-btn')
+        // launchBtn.addEventListener('ready', function (e) {
+        //   console.log('开放标签 ready')
+        // })
+        // launchBtn.addEventListener('launch', function (e) {
+        //   console.log('开放标签 success')
+        // })
+        // launchBtn.addEventListener('error', function (e) {
+        //   console.log('开放标签 fail', e.detail)
+        // })
+
+        // wx.config({
+        //   debug: true, // 调试时可开启
+        //   appId: 'wx2567dbb9d3fd9556', // <!-- replace -->
+        //   timestamp: 0, // 必填,填任意数字即可
+        //   nonceStr: 'nonceStr', // 必填,填任意非空字符串即可
+        //   signature: 'signature', // 必填,填任意非空字符串即可
+        //   jsApiList: ['chooseImage'], // 必填,随意一个接口即可
+        //   openTagList: ['wx-open-launch-weapp'], // 填入打开小程序的开放标签名
+        // })
+      }
+      if (isDesktop) {
+        // 在 pc 上则给提示引导到手机端打开
+        var containerEl = document.getElementById('desktop-web-container')
+        containerEl.classList.remove('hidden')
+        containerEl.classList.add('full', 'desktop-web-container')
+      } else {
+        var containerEl = document.getElementById('public-web-container')
+        containerEl.classList.remove('hidden')
+        containerEl.classList.add('full', 'public-web-container')
+
+
+        var buttonEl = document.getElementById('public-web-jump-button')
+        var buttonLoadingEl = document.getElementById('public-web-jump-button-loading')
+        try {
+          await openWeapp(() => {
+            buttonEl.classList.remove('weui-btn_loading')
+            buttonLoadingEl.classList.add('hidden')
+          })
+        } catch (e) {
+          buttonEl.classList.remove('weui-btn_loading')
+          buttonLoadingEl.classList.add('hidden')
+          throw e
+        }
+      }
+    })
+
+    async function openWeapp(onBeforeJump) {
+      if (onBeforeJump) {
+        onBeforeJump()
+      }
+      location.href = window.data.url_scheme
+    }
+  </script>
+  <style>
+    .hidden {
+      display: none;
+    }
+
+    .full {
+      position: absolute;
+      top: 0;
+      bottom: 0;
+      left: 0;
+      right: 0;
+    }
+
+    .public-web-container {
+      display: flex;
+      flex-direction: column;
+      align-items: center;
+    }
+
+    .public-web-container p {
+      position: absolute;
+      top: 40%;
+    }
+
+    .public-web-container a {
+      position: absolute;
+      bottom: 40%;
+    }
+
+    /* .wechat-web-container {
+      display: flex;
+      flex-direction: column;
+      align-items: center;
+    }
+
+    .wechat-web-container p {
+      position: absolute;
+      top: 40%;
+    }
+
+    .wechat-web-container wx-open-launch-weapp {
+      position: absolute;
+      bottom: 40%;
+      left: 0;
+      right: 0;
+      display: flex;
+      flex-direction: column;
+      align-items: center;
+    } */
+
+    .desktop-web-container {
+      display: flex;
+      flex-direction: column;
+      align-items: center;
+    }
+
+    .desktop-web-container p {
+      position: absolute;
+      top: 40%;
+    }
+  </style>
+</head>
+
+<body>
+  <div class="page full">
+    <div id="public-web-container" class="hidden">
+      <p class="">正在打开 “仟微科技”...</p> <!-- replace -->
+      <a id="public-web-jump-button" href="javascript:" class="weui-btn weui-btn_primary weui-btn_loading"
+        onclick="openWeapp()">
+        <span id="public-web-jump-button-loading" class="weui-primary-loading weui-primary-loading_transparent"><i
+            class="weui-primary-loading__dot"></i></span>
+        打开小程序
+      </a>
+    </div>
+    <div id="desktop-web-container" class="hidden">
+      <p class="">请在手机打开网页链接</p>
+    </div>
+  </div>
+</body>
+
+</html>

+ 116 - 0
linkwe-auth/bin/pom.xml

@@ -0,0 +1,116 @@
+<?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">
+    <parent>
+        <artifactId>linkwechat-cloud</artifactId>
+        <groupId>com.linkwechat</groupId>
+        <version>3.1.0</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+    <packaging>jar</packaging>
+    <artifactId>linkwe-auth</artifactId>
+
+    <description>
+        认证模块
+    </description>
+
+    <properties>
+        <java.version>1.8</java.version>
+        <maven.compiler.source>1.8</maven.compiler.source>
+        <maven.compiler.target>1.8</maven.compiler.target>
+        <maven.build.timestamp.format>yyyyMMddHHmmss</maven.build.timestamp.format>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+
+        <!-- 阿里数据库连接池 -->
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>druid-spring-boot-starter</artifactId>
+        </dependency>
+
+        <!-- spring-boot-devtools -->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-devtools</artifactId>
+            <optional>true</optional> <!-- 表示依赖不会传递 -->
+        </dependency>
+
+        <!-- 参数校验 -->
+        <dependency>
+            <groupId>org.hibernate.validator</groupId>
+            <artifactId>hibernate-validator</artifactId>
+        </dependency>
+
+        <!-- swagger2-->
+        <dependency>
+            <groupId>io.springfox</groupId>
+            <artifactId>springfox-swagger2</artifactId>
+        </dependency>
+
+        <!-- Mysql驱动包 -->
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.linkwechat</groupId>
+            <artifactId>linkwe-framework</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.linkwechat</groupId>
+            <artifactId>linkwe-service</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.alibaba.cloud</groupId>
+            <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
+        </dependency>
+
+        <!-- SpringCloud Alibaba Nacos Config -->
+        <dependency>
+            <groupId>com.alibaba.cloud</groupId>
+            <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
+<!--            <version>2021.1</version>-->
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+
+    </dependencies>
+
+    <build>
+        <finalName>lw-auth</finalName>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+                <version>2.3.3.RELEASE</version>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>repackage</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>

+ 10 - 0
linkwe-auth/bin/src/main/resources/banner.txt

@@ -0,0 +1,10 @@
+${AnsiColor.GREEN}
+  _     _       _   __        __    ____ _           _      _         _   _
+ | |   (_)_ __ | | _\ \      / /__ / ___| |__   __ _| |_   / \  _   _| |_| |__
+ | |   | | '_ \| |/ /\ \ /\ / / _ \ |   | '_ \ / _` | __| / _ \| | | | __| '_ \
+ | |___| | | | |   <  \ V  V /  __/ |___| | | | (_| | |_ / ___ \ |_| | |_| | | |
+ |_____|_|_| |_|_|\_\  \_/\_/ \___|\____|_| |_|\__,_|\__/_/   \_\__,_|\__|_| |_|
+
+ ${AnsiColor.WHITE}
+
+ Spring Boot Version: ${spring-boot.version}

+ 36 - 0
linkwe-auth/bin/src/main/resources/i18n/messages.properties

@@ -0,0 +1,36 @@
+#错误消息
+not.null=* 必须填写
+user.jcaptcha.error=验证码错误
+user.jcaptcha.expire=验证码已失效
+user.not.exists=用户不存在/密码错误
+user.password.not.match=用户不存在/密码错误
+user.password.retry.limit.count=密码输入错误{0}次
+user.password.retry.limit.exceed=密码输入错误{0}次,帐户锁定10分钟
+user.password.delete=对不起,您的账号已被删除
+user.blocked=用户已封禁,请联系管理员
+role.blocked=角色已封禁,请联系管理员
+user.logout.success=退出成功
+
+length.not.valid=长度必须在{min}到{max}个字符之间
+
+user.username.not.valid=* 2到20个汉字、字母、数字或下划线组成,且必须以非数字开头
+user.password.not.valid=* 5-50个字符
+ 
+user.email.not.valid=邮箱格式错误
+user.mobile.phone.number.not.valid=手机号格式错误
+user.login.success=登录成功
+user.notfound=请重新登录
+user.forcelogout=管理员强制退出,请重新登录
+user.unknown.error=未知错误,请重新登录
+
+##文件上传消息
+upload.exceed.maxSize=上传的文件大小超出限制的文件大小!<br/>允许的文件最大大小是:{0}MB!
+upload.filename.exceed.length=上传的文件名最长{0}个字符
+
+##权限
+no.permission=您没有数据的权限,请联系管理员添加权限 [{0}]
+no.create.permission=您没有创建数据的权限,请联系管理员添加权限 [{0}]
+no.update.permission=您没有修改数据的权限,请联系管理员添加权限 [{0}]
+no.delete.permission=您没有删除数据的权限,请联系管理员添加权限 [{0}]
+no.export.permission=您没有导出数据的权限,请联系管理员添加权限 [{0}]
+no.view.permission=您没有查看数据的权限,请联系管理员添加权限 [{0}]

+ 203 - 0
linkwe-auth/bin/src/main/resources/logback-spring.xml

@@ -0,0 +1,203 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration scan="true" scanPeriod="60 seconds" debug="false">
+
+    <!-- 日志输出格式 -->
+    <property name="log.pattern" value="%d{yyyy-MM-dd HH:mm:ss.SSS,CTT} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
+
+    <!--  邮件 -->
+    <!-- SMTP server的地址,必需指定。如网易的SMTP服务器地址是: smtp.163.com -->
+    <property name="smtpHost" value="smtp.163.com"/><!--填入要发送邮件的smtp服务器地址-->
+    <!-- SMTP server的端口地址。默认值:25 -->
+    <property name="smtpPort" value="25"/>
+    <!-- 发送邮件账号,默认为null -->
+    <property name="username" value="*"/><!--发件人账号-->
+    <!-- 发送邮件密码,默认为null -->
+    <property name="password" value="*"/><!--发件人密码-->
+    <!-- 如果设置为true,appender将会使用SSL连接到日志服务器。默认值:false -->
+    <property name="SSL" value="true"/>
+    <!-- 指定发送到那个邮箱,可设置多个<to>属性,指定多个目的邮箱 -->
+    <property name="email_to" value="*"/>
+    <!--收件人账号多个可以逗号隔开-->
+    <!-- 指定发件人名称。如果设置成“&lt;ADMIN&gt; ”,则邮件发件人将会是“<ADMIN> ” -->
+    <property name="email_from" value="1" />
+    <!-- 指定emial的标题,它需要满足PatternLayout中的格式要求。如果设置成“Log: %logger - %msg ”,就案例来讲,则发送邮件时,标题为“【Error】: com.foo.Bar - Hello World ”。 默认值:"%logger{20} - %m". -->
+    <property name="email_subject" value="【linkwechat-auth】【Error】: %logger" />
+
+    <property name="app_name" value="linkwe-auth"/>
+    <!-- 日志根目录-->
+    <springProperty scope="context" name="log.path" source="logging.path"
+                    defaultValue="./logs/linkwe-auth"/>
+
+    <!-- 控制台输出 -->
+    <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
+        <encoder>
+            <pattern>${log.pattern}</pattern>
+        </encoder>
+    </appender>
+
+    <!-- 系统日志输出 -->
+    <!-- 循环文件输出(基于时间戳的分文件,是实际项目中用途最广的一种情况) -->
+    <appender name="file_debug" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <file>${log.path}/debug/${app_name}.debug.log</file>
+        <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+            <!-- rollover daily -->
+            <fileNamePattern>${log.path}/debug/${app_name}_%d{yyyy-MM-dd}.debug.%i.log</fileNamePattern>
+            <!-- each file should be at most 100MB, keep 60 days worth of history, but at most 20GB -->
+            <maxFileSize>50MB</maxFileSize>
+            <maxHistory>30</maxHistory>
+            <totalSizeCap>10GB</totalSizeCap>
+        </rollingPolicy>
+        <encoder>
+            <pattern>${log.pattern}</pattern>
+        </encoder>
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <level>DEBUG</level>
+            <onMatch>ACCEPT</onMatch>
+            <onMismatch>DENY</onMismatch>
+        </filter>
+    </appender>
+    <!-- 异步输出 -->
+    <appender name="arollingfile_debug" class="ch.qos.logback.classic.AsyncAppender">
+        <!-- 不丢失日志.默认的,如果队列的80%已满,则会丢弃TRACT、DEBUG、INFO级别的日志 -->
+        <discardingThreshold>0</discardingThreshold>
+        <!-- 更改默认的队列的深度,该值会影响性能.默认值为256 -->
+        <queueSize>1</queueSize>
+        <!-- 添加附加的appender,最多只能添加一个 -->
+        <appender-ref ref="file_debug"/>
+    </appender>
+
+    <!-- 循环文件输出(基于时间戳的分文件,是实际项目中用途最广的一种情况) -->
+    <appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <file>${log.path}/info/${app_name}.info.log</file>
+        <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+            <!-- rollover daily -->
+            <fileNamePattern>${log.path}/info/${app_name}_%d{yyyy-MM-dd}.info.%i.log</fileNamePattern>
+            <!-- each file should be at most 100MB, keep 60 days worth of history, but at most 20GB -->
+            <maxFileSize>50MB</maxFileSize>
+            <maxHistory>30</maxHistory>
+            <totalSizeCap>10GB</totalSizeCap>
+        </rollingPolicy>
+        <encoder>
+            <pattern>${log.pattern}</pattern>
+        </encoder>
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <level>INFO</level>
+            <onMatch>ACCEPT</onMatch>
+            <onMismatch>DENY</onMismatch>
+        </filter>
+    </appender>
+    <!-- 异步输出 -->
+    <appender name="arollingfile_info" class="ch.qos.logback.classic.AsyncAppender">
+        <!-- 不丢失日志.默认的,如果队列的80%已满,则会丢弃TRACT、DEBUG、INFO级别的日志 -->
+        <discardingThreshold>0</discardingThreshold>
+        <!-- 更改默认的队列的深度,该值会影响性能.默认值为256 -->
+        <queueSize>1</queueSize>
+        <!-- 添加附加的appender,最多只能添加一个 -->
+        <appender-ref ref="file_info"/>
+    </appender>
+
+    <!-- 循环文件输出(基于时间戳的分文件,是实际项目中用途最广的一种情况) -->
+    <appender name="file_warn" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <file>${log.path}/warn/${app_name}.warn.log</file>
+        <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+            <!-- rollover daily -->
+            <fileNamePattern>${log.path}/warn/${app_name}_%d{yyyy-MM-dd}.warn.%i.log</fileNamePattern>
+            <!-- each file should be at most 100MB, keep 60 days worth of history, but at most 20GB -->
+            <maxFileSize>50MB</maxFileSize>
+            <maxHistory>30</maxHistory>
+            <totalSizeCap>10GB</totalSizeCap>
+        </rollingPolicy>
+        <encoder>
+            <pattern>${log.pattern}</pattern>
+        </encoder>
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <level>WARN</level>
+            <onMatch>ACCEPT</onMatch>
+            <onMismatch>DENY</onMismatch>
+        </filter>
+    </appender>
+    <!-- 异步输出 -->
+    <appender name="arollingfile_warn" class="ch.qos.logback.classic.AsyncAppender">
+        <!-- 不丢失日志.默认的,如果队列的80%已满,则会丢弃TRACT、DEBUG、INFO级别的日志 -->
+        <discardingThreshold>0</discardingThreshold>
+        <!-- 更改默认的队列的深度,该值会影响性能.默认值为256 -->
+        <queueSize>1</queueSize>
+        <!-- 添加附加的appender,最多只能添加一个 -->
+        <appender-ref ref="file_warn"/>
+    </appender>
+
+    <!-- 循环文件输出(基于时间戳的分文件,是实际项目中用途最广的一种情况) -->
+    <appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <file>${log.path}/error/${app_name}.error.log</file>
+        <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+            <!-- rollover daily -->
+            <fileNamePattern>${log.path}/error/${app_name}_%d{yyyy-MM-dd}.error.%i.log</fileNamePattern>
+            <!-- each file should be at most 100MB, keep 60 days worth of history, but at most 20GB -->
+            <maxFileSize>50MB</maxFileSize>
+            <maxHistory>30</maxHistory>
+            <totalSizeCap>10GB</totalSizeCap>
+        </rollingPolicy>
+        <encoder>
+            <pattern>${log.pattern}</pattern>
+        </encoder>
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <level>ERROR</level>
+            <onMatch>ACCEPT</onMatch>
+            <onMismatch>DENY</onMismatch>
+        </filter>
+    </appender>
+    <!-- 异步输出 -->
+    <appender name="arollingfile_error" class="ch.qos.logback.classic.AsyncAppender">
+        <!-- 不丢失日志.默认的,如果队列的80%已满,则会丢弃TRACT、DEBUG、INFO级别的日志 -->
+        <discardingThreshold>0</discardingThreshold>
+        <!-- 更改默认的队列的深度,该值会影响性能.默认值为256 -->
+        <queueSize>1</queueSize>
+        <!-- 添加附加的appender,最多只能添加一个 -->
+        <appender-ref ref="file_error"/>
+    </appender>
+
+    <!-- ERROR邮件发送 -->
+    <appender name="EMAIL" class="ch.qos.logback.classic.net.SMTPAppender">
+        <smtpHost>${smtpHost}</smtpHost>
+        <smtpPort>${smtpPort}</smtpPort>
+        <username>${username}</username>
+        <password>${password}</password>
+        <!-- <asynchronousSending>true</asynchronousSending>-->
+        <SSL>${SSL}</SSL>
+        <!--<STARTTLS>true</STARTTLS>-->
+        <to>${email_to}</to>
+        <from>${email_from}</from>
+        <subject>${email_subject}</subject>
+        <!-- html格式-->
+        <layout class="ch.qos.logback.classic.html.HTMLLayout">
+            <Pattern>%date%level%thread%logger{0}%line%message</Pattern>
+        </layout>
+        <!-- 这里采用等级过滤器 指定等级相符才发送 -->
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <level>ERROR</level>
+            <onMatch>ACCEPT</onMatch>
+            <onMismatch>DENY</onMismatch>
+        </filter>
+        <cyclicBufferTracker class="ch.qos.logback.core.spi.CyclicBufferTracker">
+            <!-- 每个电子邮件只发送一个日志条目 -->
+            <bufferSize>1</bufferSize>
+        </cyclicBufferTracker>
+    </appender>
+
+
+    <!-- 系统模块日志级别控制  -->
+    <logger name="cn.linkwechat" level="info" />
+    <!-- Spring日志级别控制  -->
+    <logger name="org.springframework" level="warn" />
+
+    <!--系统操作日志-->
+    <root level="info">
+        <appender-ref ref="console" />
+        <appender-ref ref="arollingfile_debug" />
+        <appender-ref ref="arollingfile_info" />
+        <appender-ref ref="arollingfile_warn" />
+        <appender-ref ref="arollingfile_error" />
+        <!-- <appender-ref ref="alarm_error" />-->
+        <appender-ref ref="EMAIL" />
+    </root>
+</configuration>

+ 29 - 0
linkwe-auth/bin/src/main/resources/mapper/system/SysAreaMapper.xml

@@ -0,0 +1,29 @@
+<?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.linkwechat.web.mapper.SysAreaMapper">
+
+
+
+    <resultMap type="com.linkwechat.web.domain.SysArea" id="SysAreaResult">
+                <result property="id" column="id" jdbcType="INTEGER"/>
+                <result property="parentId" column="parent_id" jdbcType="INTEGER"/>
+                <result property="level" column="level" jdbcType="INTEGER"/>
+                <result property="name" column="name" jdbcType="VARCHAR"/>
+                <result property="ePrefix" column="e_prefix" jdbcType="VARCHAR"/>
+                <result property="eName" column="e_name" jdbcType="VARCHAR"/>
+                <result property="extId" column="ext_id" jdbcType="INTEGER"/>
+                <result property="extName" column="ext_name" jdbcType="VARCHAR"/>
+                <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+                <result property="createBy" column="create_by" jdbcType="VARCHAR"/>
+                <result property="createById" column="create_by_id" jdbcType="INTEGER"/>
+                <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
+                <result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
+                <result property="updateById" column="update_by_id" jdbcType="INTEGER"/>
+                <result property="delFlag" column="del_flag" jdbcType="INTEGER"/>
+            </resultMap>
+
+    <sql id="selectSysAreaVo">
+        select id, parent_id, level, name, e_prefix, e_name, ext_id, ext_name, create_time, create_by, create_by_id, update_time, update_by, update_by_id, del_flag from sys_area
+    </sql>
+
+</mapper>

+ 112 - 0
linkwe-auth/bin/src/main/resources/mapper/system/SysConfigMapper.xml

@@ -0,0 +1,112 @@
+<?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.linkwechat.web.mapper.SysConfigMapper">
+    
+    <resultMap type="SysConfig" id="SysConfigResult">
+    	<id     property="configId"      column="config_id"      />
+        <result property="configName"    column="config_name"    />
+        <result property="configKey"     column="config_key"     />
+        <result property="configValue"   column="config_value"   />
+        <result property="configType"    column="config_type"    />
+        <result property="createBy"      column="create_by"      />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"      column="update_by"      />
+        <result property="updateTime"    column="update_time"    />
+    </resultMap>
+    
+    <sql id="selectConfigVo">
+        select config_id, config_name, config_key, config_value, config_type, create_by, create_time, update_by, update_time, remark 
+		from sys_config
+    </sql>
+    
+    <!-- 查询条件 -->
+	<sql id="sqlwhereSearch">
+		<where>
+			<if test="configId !=null">
+				and config_id = #{configId}
+			</if>
+			<if test="configKey !=null and configKey != ''">
+				and config_key = #{configKey}
+			</if>
+		</where>
+	</sql>
+    
+    <select id="selectConfig" parameterType="SysConfig" resultMap="SysConfigResult">
+        <include refid="selectConfigVo"/>
+        <include refid="sqlwhereSearch"/>
+    </select>
+    
+    <select id="selectConfigList" parameterType="SysConfig" resultMap="SysConfigResult">
+        <include refid="selectConfigVo"/>
+        <where>
+			<if test="configName != null and configName != ''">
+				AND config_name like concat('%', #{configName}, '%')
+			</if>
+			<if test="configType != null and configType != ''">
+				AND config_type = #{configType}
+			</if>
+			<if test="configKey != null and configKey != ''">
+				AND config_key like concat('%', #{configKey}, '%')
+			</if>
+			<if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
+				and date_format(create_time,'%y%m%d') &gt;= date_format(#{beginTime},'%y%m%d')
+			</if>
+			<if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
+				and date_format(create_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')
+			</if>
+		</where>
+    </select>
+    
+    <select id="checkConfigKeyUnique" parameterType="String" resultMap="SysConfigResult">
+        <include refid="selectConfigVo"/>
+        where config_key = #{configKey} limit 1
+    </select>
+    
+    <insert id="insertConfig" parameterType="SysConfig">
+        insert into sys_config (
+			<if test="configName != null and configName != '' ">config_name,</if>
+			<if test="configKey != null and configKey != '' ">config_key,</if>
+			<if test="configValue != null and configValue != '' ">config_value,</if>
+			<if test="configType != null and configType != '' ">config_type,</if>
+			<if test="createBy != null and createBy != ''">create_by,</if>
+			<if test="remark != null and remark != ''">remark,</if>
+ 			create_time
+        )values(
+			<if test="configName != null and configName != ''">#{configName},</if>
+			<if test="configKey != null and configKey != ''">#{configKey},</if>
+			<if test="configValue != null and configValue != ''">#{configValue},</if>
+			<if test="configType != null and configType != ''">#{configType},</if>
+			<if test="createBy != null and createBy != ''">#{createBy},</if>
+			<if test="remark != null and remark != ''">#{remark},</if>
+ 			sysdate()
+		)
+    </insert>
+	 
+    <update id="updateConfig" parameterType="SysConfig">
+        update sys_config 
+        <set>
+            <if test="configName != null and configName != ''">config_name = #{configName},</if>
+            <if test="configKey != null and configKey != ''">config_key = #{configKey},</if>
+            <if test="configValue != null and configValue != ''">config_value = #{configValue},</if>
+            <if test="configType != null and configType != ''">config_type = #{configType},</if>
+            <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
+            <if test="remark != null">remark = #{remark},</if>
+ 			update_time = sysdate()
+        </set>
+        where config_id = #{configId}
+    </update>
+	
+    <delete id="deleteConfigById" parameterType="Long">
+        delete from sys_config where config_id = #{configId}
+    </delete>
+    
+    <delete id="deleteConfigByIds" parameterType="Long">
+        delete from sys_config where config_id in 
+        <foreach item="configId" collection="array" open="(" separator="," close=")">
+        	#{configId}
+        </foreach>
+    </delete>
+    
+</mapper>

+ 164 - 0
linkwe-auth/bin/src/main/resources/mapper/system/SysDeptMapper.xml

@@ -0,0 +1,164 @@
+<?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.linkwechat.web.mapper.SysDeptMapper">
+
+	<resultMap type="com.linkwechat.common.core.domain.entity.SysDept" id="SysDeptResult">
+		<id     property="deptId"     column="dept_id"     />
+		<result property="parentId"   column="parent_id"   />
+		<result property="ancestors"  column="ancestors"   />
+		<result property="deptName"   column="dept_name"   />
+		<result property="deptEnName"   column="dept_en_name"   />
+		<result property="orderNum"   column="order_num"   />
+		<result property="leader"     column="leader"      />
+		<result property="phone"      column="phone"       />
+		<result property="email"      column="email"       />
+		<result property="status"     column="status"      />
+		<result property="delFlag"    column="del_flag"    />
+		<result property="parentName" column="parent_name" />
+		<result property="createBy"   column="create_by"   />
+		<result property="createTime" column="create_time" />
+		<result property="updateBy"   column="update_by"   />
+		<result property="updateTime" column="update_time" />
+	</resultMap>
+
+	<sql id="selectDeptVo">
+        select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.dept_en_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time
+        from sys_dept d
+    </sql>
+
+	<select id="selectDeptList" parameterType="com.linkwechat.common.core.domain.entity.SysDept" resultMap="SysDeptResult">
+        <include refid="selectDeptVo"/>
+        where d.del_flag = '0'
+        <if test="parentId != null and parentId != 0">
+			AND parent_id = #{parentId}
+		</if>
+		<if test="deptName != null and deptName != ''">
+			AND dept_name like concat('%', #{deptName}, '%')
+		</if>
+		<if test="status != null and status != ''">
+			AND status = #{status}
+		</if>
+		order by d.parent_id, d.order_num
+    </select>
+
+	<select id="selectUserDeptList" parameterType="java.lang.String" resultMap="SysDeptResult">
+		<include refid="selectDeptVo"/>
+		left join sys_user_dept ud on ud.dept_id = d.dept_id
+		left join sys_user u on u.open_userid = ud.open_userid
+		left join sys_user_role ur on ur.user_id = u.user_id
+		left join sys_role_dept rd on ur.role_id = rd.role_id and d.dept_id = rd.dept_id
+		where d.del_flag = '0' and ud.open_userid = #{openUserid}
+		order by d.parent_id, d.order_num
+	</select>
+
+    <select id="selectDeptListByRoleId" parameterType="Long" resultType="Integer">
+		select d.dept_id, d.parent_id
+		from sys_dept d
+            left join sys_role_dept rd on d.dept_id = rd.dept_id
+        where rd.role_id = #{roleId}
+        	and d.dept_id not in (select d.parent_id from sys_dept d inner join sys_role_dept rd on d.dept_id = rd.dept_id and rd.role_id = #{roleId})
+		order by d.parent_id, d.order_num
+	</select>
+
+    <select id="selectDeptById" parameterType="Long" resultMap="SysDeptResult">
+		<include refid="selectDeptVo"/>
+		where dept_id = #{deptId}
+	</select>
+
+    <select id="checkDeptExistUser" parameterType="Long" resultType="int">
+		select count(1) from sys_user where dept_id = #{deptId} and del_flag = '0'
+	</select>
+
+	<select id="hasChildByDeptId" parameterType="Long" resultType="int">
+		select count(1) from sys_dept
+		where del_flag = '0' and parent_id = #{deptId} limit 1
+	</select>
+
+	<select id="selectChildrenDeptById" parameterType="Long" resultMap="SysDeptResult">
+		select * from sys_dept where find_in_set(#{deptId}, ancestors)
+	</select>
+
+	<select id="selectNormalChildrenDeptById" parameterType="Long" resultType="int">
+		select count(*) from sys_dept where status = 0 and del_flag = '0' and find_in_set(#{deptId}, ancestors)
+	</select>
+
+	<select id="checkDeptNameUnique" resultMap="SysDeptResult">
+	    <include refid="selectDeptVo"/>
+		where dept_name=#{deptName} and parent_id = #{parentId} limit 1
+	</select>
+
+    <insert id="insertDept" parameterType="com.linkwechat.common.core.domain.entity.SysDept">
+ 		insert into sys_dept(
+ 			<if test="deptId != null and deptId != 0">dept_id,</if>
+ 			<if test="parentId != null and parentId != 0">parent_id,</if>
+ 			<if test="deptName != null and deptName != ''">dept_name,</if>
+ 			<if test="deptEnName != null and deptEnName != ''">dept_en_name,</if>
+ 			<if test="ancestors != null and ancestors != ''">ancestors,</if>
+ 			<if test="orderNum != null and orderNum != ''">order_num,</if>
+ 			<if test="leader != null and leader != ''">leader,</if>
+ 			<if test="phone != null and phone != ''">phone,</if>
+ 			<if test="email != null and email != ''">email,</if>
+ 			<if test="status != null">status,</if>
+ 			<if test="createBy != null and createBy != ''">create_by,</if>
+ 			create_time
+ 		)values(
+ 			<if test="deptId != null and deptId != 0">#{deptId},</if>
+ 			<if test="parentId != null and parentId != 0">#{parentId},</if>
+ 			<if test="deptName != null and deptName != ''">#{deptName},</if>
+ 			<if test="deptEnName != null and deptEnName != ''">#{deptEnName},</if>
+ 			<if test="ancestors != null and ancestors != ''">#{ancestors},</if>
+ 			<if test="orderNum != null and orderNum != ''">#{orderNum},</if>
+ 			<if test="leader != null and leader != ''">#{leader},</if>
+ 			<if test="phone != null and phone != ''">#{phone},</if>
+ 			<if test="email != null and email != ''">#{email},</if>
+ 			<if test="status != null">#{status},</if>
+ 			<if test="createBy != null and createBy != ''">#{createBy},</if>
+ 			sysdate()
+ 		)
+	</insert>
+
+	<update id="updateDept" parameterType="com.linkwechat.common.core.domain.entity.SysDept">
+ 		update sys_dept
+ 		<set>
+ 			<if test="parentId != null and parentId != 0">parent_id = #{parentId},</if>
+ 			<if test="deptName != null and deptName != ''">dept_name = #{deptName},</if>
+ 			<if test="deptEnName != null and deptEnName != ''">dept_en_name = #{deptEnName},</if>
+ 			<if test="ancestors != null and ancestors != ''">ancestors = #{ancestors},</if>
+ 			<if test="orderNum != null and orderNum != ''">order_num = #{orderNum},</if>
+ 			<if test="leader != null">leader = #{leader},</if>
+ 			<if test="phone != null">phone = #{phone},</if>
+ 			<if test="email != null">email = #{email},</if>
+ 			<if test="status != null and status != ''">status = #{status},</if>
+ 			<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
+ 			update_time = sysdate()
+ 		</set>
+ 		where dept_id = #{deptId}
+	</update>
+
+	<update id="updateDeptChildren" parameterType="java.util.List">
+	    update sys_dept set ancestors =
+	    <foreach collection="depts" item="item" index="index"
+	        separator=" " open="case dept_id" close="end">
+	        when #{item.deptId} then #{item.ancestors}
+	    </foreach>
+	    where dept_id in
+	    <foreach collection="depts" item="item" index="index"
+	        separator="," open="(" close=")">
+	        #{item.deptId}
+	    </foreach>
+	</update>
+
+	<update id="updateDeptStatusNormal" parameterType="Long">
+		update sys_dept set status = '0' where dept_id in
+		<foreach collection="array" item="deptId" open="(" separator="," close=")">
+			#{deptId}
+		</foreach>
+	</update>
+
+	<delete id="deleteDeptById" parameterType="Long">
+		update sys_dept set del_flag = '2' where dept_id = #{deptId}
+	</delete>
+
+</mapper> 

+ 124 - 0
linkwe-auth/bin/src/main/resources/mapper/system/SysDictDataMapper.xml

@@ -0,0 +1,124 @@
+<?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.linkwechat.web.mapper.SysDictDataMapper">
+	
+	<resultMap type="SysDictData" id="SysDictDataResult">
+		<id     property="dictCode"   column="dict_code"   />
+		<result property="dictSort"   column="dict_sort"   />
+		<result property="dictLabel"  column="dict_label"  />
+		<result property="dictValue"  column="dict_value"  />
+		<result property="dictType"   column="dict_type"   />
+		<result property="cssClass"   column="css_class"   />
+		<result property="listClass"  column="list_class"  />
+		<result property="isDefault"  column="is_default"  />
+		<result property="status"     column="status"      />
+		<result property="createBy"   column="create_by"   />
+		<result property="createTime" column="create_time" />
+		<result property="updateBy"   column="update_by"   />
+		<result property="updateTime" column="update_time" />
+	</resultMap>
+	
+	<sql id="selectDictDataVo">
+        select dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, remark 
+		from sys_dict_data
+    </sql>
+
+	<select id="selectDictDataList" parameterType="SysDictData" resultMap="SysDictDataResult">
+	    <include refid="selectDictDataVo"/>
+		<where>
+		    <if test="dictType != null and dictType != ''">
+				AND dict_type = #{dictType}
+			</if>
+			<if test="dictLabel != null and dictLabel != ''">
+				AND dict_label like concat('%', #{dictLabel}, '%')
+			</if>
+			<if test="status != null and status != ''">
+				AND status = #{status}
+			</if>
+		</where>
+		order by dict_sort asc
+	</select>
+	
+	<select id="selectDictDataByType" parameterType="SysDictData" resultMap="SysDictDataResult">
+		<include refid="selectDictDataVo"/>
+		where status = '0' and dict_type = #{dictType} order by dict_sort asc
+	</select>
+	
+	<select id="selectDictLabel" resultType="String">
+		select dict_label from sys_dict_data
+		where dict_type = #{dictType} and dict_value = #{dictValue}
+	</select>
+	
+	<select id="selectDictDataById" parameterType="Long" resultMap="SysDictDataResult">
+		<include refid="selectDictDataVo"/>
+		where dict_code = #{dictCode}
+	</select>
+	
+	<select id="countDictDataByType" resultType="Integer">
+	    select count(1) from sys_dict_data where dict_type=#{dictType}  
+	</select>
+	
+	<delete id="deleteDictDataById" parameterType="Long">
+ 		delete from sys_dict_data where dict_code = #{dictCode}
+ 	</delete>
+ 	
+ 	<delete id="deleteDictDataByIds" parameterType="Long">
+ 		delete from sys_dict_data where dict_code in
+ 		<foreach collection="array" item="dictCode" open="(" separator="," close=")">
+ 			#{dictCode}
+        </foreach> 
+ 	</delete>
+	
+	<update id="updateDictData" parameterType="SysDictData">
+ 		update sys_dict_data
+ 		<set>
+ 			<if test="dictSort != null">dict_sort = #{dictSort},</if>
+ 			<if test="dictLabel != null and dictLabel != ''">dict_label = #{dictLabel},</if>
+ 			<if test="dictValue != null and dictValue != ''">dict_value = #{dictValue},</if>
+ 			<if test="dictType != null and dictType != ''">dict_type = #{dictType},</if>
+ 			<if test="cssClass != null">css_class = #{cssClass},</if>
+ 			<if test="listClass != null">list_class = #{listClass},</if>
+ 			<if test="isDefault != null and isDefault != ''">is_default = #{isDefault},</if>
+ 			<if test="status != null">status = #{status},</if>
+ 			<if test="remark != null">remark = #{remark},</if>
+ 			<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
+ 			update_time = sysdate()
+ 		</set>
+ 		where dict_code = #{dictCode}
+	</update>
+	
+	<update id="updateDictDataType" parameterType="String">
+ 		update sys_dict_data set dict_type = #{newDictType} where dict_type = #{oldDictType}
+	</update>
+ 	
+ 	<insert id="insertDictData" parameterType="SysDictData">
+ 		insert into sys_dict_data(
+ 			<if test="dictSort != null">dict_sort,</if>
+ 			<if test="dictLabel != null and dictLabel != ''">dict_label,</if>
+ 			<if test="dictValue != null and dictValue != ''">dict_value,</if>
+ 			<if test="dictType != null and dictType != ''">dict_type,</if>
+ 			<if test="cssClass != null and cssClass != ''">css_class,</if>
+ 			<if test="listClass != null and listClass != ''">list_class,</if>
+ 			<if test="isDefault != null and isDefault != ''">is_default,</if>
+ 			<if test="status != null">status,</if>
+ 			<if test="remark != null and remark != ''">remark,</if>
+ 			<if test="createBy != null and createBy != ''">create_by,</if>
+ 			create_time
+ 		)values(
+ 		    <if test="dictSort != null">#{dictSort},</if>
+ 		    <if test="dictLabel != null and dictLabel != ''">#{dictLabel},</if>
+ 			<if test="dictValue != null and dictValue != ''">#{dictValue},</if>
+ 			<if test="dictType != null and dictType != ''">#{dictType},</if>
+ 			<if test="cssClass != null and cssClass != ''">#{cssClass},</if>
+ 			<if test="listClass != null and listClass != ''">#{listClass},</if>
+ 			<if test="isDefault != null and isDefault != ''">#{isDefault},</if>
+ 			<if test="status != null">#{status},</if>
+ 			<if test="remark != null and remark != ''">#{remark},</if>
+ 			<if test="createBy != null and createBy != ''">#{createBy},</if>
+ 			sysdate()
+ 		)
+	</insert>
+	
+</mapper> 

+ 105 - 0
linkwe-auth/bin/src/main/resources/mapper/system/SysDictTypeMapper.xml

@@ -0,0 +1,105 @@
+<?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.linkwechat.web.mapper.SysDictTypeMapper">
+
+	<resultMap type="SysDictType" id="SysDictTypeResult">
+		<id     property="dictId"     column="dict_id"     />
+		<result property="dictName"   column="dict_name"   />
+		<result property="dictType"   column="dict_type"   />
+		<result property="status"     column="status"      />
+		<result property="createBy"   column="create_by"   />
+		<result property="createTime" column="create_time" />
+		<result property="updateBy"   column="update_by"   />
+		<result property="updateTime" column="update_time" />
+	</resultMap>
+	
+	<sql id="selectDictTypeVo">
+        select dict_id, dict_name, dict_type, status, create_by, create_time, remark 
+		from sys_dict_type
+    </sql>
+
+	<select id="selectDictTypeList" parameterType="SysDictType" resultMap="SysDictTypeResult">
+	    <include refid="selectDictTypeVo"/>
+		<where>
+		    <if test="dictName != null and dictName != ''">
+				AND dict_name like concat('%', #{dictName}, '%')
+			</if>
+			<if test="status != null and status != ''">
+				AND status = #{status}
+			</if>
+			<if test="dictType != null and dictType != ''">
+				AND dict_type like concat('%', #{dictType}, '%')
+			</if>
+			<if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
+				and date_format(create_time,'%y%m%d') &gt;= date_format(#{beginTime},'%y%m%d')
+			</if>
+			<if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
+				and date_format(create_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')
+			</if>
+	    </where>
+	</select>
+	
+	<select id="selectDictTypeAll" resultMap="SysDictTypeResult">
+		<include refid="selectDictTypeVo"/>
+	</select>
+	
+	<select id="selectDictTypeById" parameterType="Long" resultMap="SysDictTypeResult">
+		<include refid="selectDictTypeVo"/>
+		where dict_id = #{dictId}
+	</select>
+	
+	<select id="selectDictTypeByType" parameterType="String" resultMap="SysDictTypeResult">
+		<include refid="selectDictTypeVo"/>
+		where dict_type = #{dictType}
+	</select>
+	
+	<select id="checkDictTypeUnique" parameterType="String" resultMap="SysDictTypeResult">
+		<include refid="selectDictTypeVo"/>
+		where dict_type = #{dictType} limit 1
+	</select>
+	
+	<delete id="deleteDictTypeById" parameterType="Long">
+ 		delete from sys_dict_type where dict_id = #{dictId}
+ 	</delete>
+ 	
+ 	<delete id="deleteDictTypeByIds" parameterType="Long">
+ 		delete from sys_dict_type where dict_id in
+ 		<foreach collection="array" item="dictId" open="(" separator="," close=")">
+ 			#{dictId}
+        </foreach> 
+ 	</delete>
+
+ 	<update id="updateDictType" parameterType="SysDictType">
+ 		update sys_dict_type
+ 		<set>
+ 			<if test="dictName != null and dictName != ''">dict_name = #{dictName},</if>
+ 			<if test="dictType != null and dictType != ''">dict_type = #{dictType},</if>
+ 			<if test="status != null">status = #{status},</if>
+ 			<if test="remark != null">remark = #{remark},</if>
+ 			<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
+ 			update_time = sysdate()
+ 		</set>
+ 		where dict_id = #{dictId}
+	</update>
+ 	
+ 	<insert id="insertDictType" parameterType="SysDictType">
+ 		insert into sys_dict_type(
+ 			<if test="dictName != null and dictName != ''">dict_name,</if>
+ 			<if test="dictType != null and dictType != ''">dict_type,</if>
+ 			<if test="status != null">status,</if>
+ 			<if test="remark != null and remark != ''">remark,</if>
+ 			<if test="createBy != null and createBy != ''">create_by,</if>
+ 			create_time
+ 		)values(
+ 			<if test="dictName != null and dictName != ''">#{dictName},</if>
+ 			<if test="dictType != null and dictType != ''">#{dictType},</if>
+ 			<if test="status != null">#{status},</if>
+ 			<if test="remark != null and remark != ''">#{remark},</if>
+ 			<if test="createBy != null and createBy != ''">#{createBy},</if>
+ 			sysdate()
+ 		)
+	</insert>
+	
+</mapper> 

+ 57 - 0
linkwe-auth/bin/src/main/resources/mapper/system/SysLogininforMapper.xml

@@ -0,0 +1,57 @@
+<?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.linkwechat.web.mapper.SysLogininforMapper">
+
+	<resultMap type="SysLogininfor" id="SysLogininforResult">
+		<id     property="infoId"        column="info_id"           />
+		<result property="userName"      column="user_name"         />
+		<result property="status"        column="status"            />
+		<result property="ipaddr"        column="ipaddr"            />
+		<result property="loginLocation" column="login_location"    />
+		<result property="browser"       column="browser"           />
+		<result property="os"            column="os"                />
+		<result property="msg"           column="msg"               />
+		<result property="loginTime"     column="login_time"        />
+	</resultMap>
+
+	<insert id="insertLogininfor" parameterType="SysLogininfor">
+		insert into sys_logininfor (user_name, status, ipaddr, login_location, browser, os, msg, login_time)
+		values (#{userName}, #{status}, #{ipaddr}, #{loginLocation}, #{browser}, #{os}, #{msg}, sysdate())
+	</insert>
+	
+	<select id="selectLogininforList" parameterType="SysLogininfor" resultMap="SysLogininforResult">
+		select info_id, user_name, ipaddr, login_location, browser, os, status, msg, login_time from sys_logininfor
+		<where>
+			<if test="ipaddr != null and ipaddr != ''">
+				AND ipaddr like concat('%', #{ipaddr}, '%')
+			</if>
+			<if test="status != null and status != ''">
+				AND status = #{status}
+			</if>
+			<if test="userName != null and userName != ''">
+				AND user_name like concat('%', #{userName}, '%')
+			</if>
+			<if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
+				and date_format(login_time,'%y%m%d') &gt;= date_format(#{beginTime},'%y%m%d')
+			</if>
+			<if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
+				and date_format(login_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')
+			</if>
+		</where>
+		order by info_id desc
+	</select>
+	
+	<delete id="deleteLogininforByIds" parameterType="Long">
+ 		delete from sys_logininfor where info_id in
+ 		<foreach collection="array" item="infoId" open="(" separator="," close=")">
+ 			#{infoId}
+        </foreach> 
+ 	</delete>
+    
+    <update id="cleanLogininfor">
+        truncate table sys_logininfor
+    </update>
+    
+</mapper> 

+ 192 - 0
linkwe-auth/bin/src/main/resources/mapper/system/SysMenuMapper.xml

@@ -0,0 +1,192 @@
+<?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.linkwechat.web.mapper.SysMenuMapper">
+
+	<resultMap type="SysMenu" id="SysMenuResult">
+		<id     property="menuId"         column="menu_id"        />
+		<result property="menuName"       column="menu_name"      />
+		<result property="parentName"     column="parent_name"    />
+		<result property="parentId"       column="parent_id"      />
+		<result property="orderNum"       column="order_num"      />
+		<result property="path"           column="path"           />
+		<result property="component"      column="component"      />
+		<result property="isFrame"        column="is_frame"       />
+		<result property="menuType"       column="menu_type"      />
+		<result property="visible"        column="visible"        />
+		<result property="status"         column="status"         />
+		<result property="perms"          column="perms"          />
+		<result property="icon"           column="icon"           />
+		<result property="createBy"       column="create_by"      />
+		<result property="createTime"     column="create_time"    />
+		<result property="updateTime"     column="update_time"    />
+		<result property="updateBy"       column="update_by"      />
+		<result property="remark"         column="remark"         />
+	</resultMap>
+
+	<sql id="selectMenuVo">
+        select menu_id, menu_name, parent_id, order_num, path, component, is_frame, menu_type, visible, status, ifnull(perms,'') as perms, icon, create_time 
+		from sys_menu
+    </sql>
+    
+    <select id="selectMenuList" parameterType="SysMenu" resultMap="SysMenuResult">
+		<include refid="selectMenuVo"/>
+		 where path != 'System'
+			<if test="menuName != null and menuName != ''">
+				AND menu_name like concat('%', #{menuName}, '%')
+			</if>
+			<if test="visible != null and visible != ''">
+				AND visible = #{visible}
+			</if>
+			<if test="status != null and status != ''">
+				AND status = #{status}
+			</if>
+		order by parent_id, order_num
+	</select>
+	
+	<select id="selectMenuTreeAll" resultMap="SysMenuResult">
+		select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.menu_type, m.icon, m.order_num, m.create_time
+		from sys_menu m where m.menu_type in ('M', 'C') and m.status = 0 and m.path !='System'
+		order by m.parent_id, m.order_num
+	</select>
+	
+	<select id="selectMenuListByUserId" parameterType="com.linkwechat.common.core.domain.entity.SysMenu" resultMap="SysMenuResult">
+		select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.menu_type, m.icon, m.order_num, m.create_time
+		from sys_menu m
+		left join sys_role_menu rm on m.menu_id = rm.menu_id
+		left join sys_user_role ur on rm.role_id = ur.role_id
+		left join sys_role ro on ur.role_id = ro.role_id
+		where ur.user_id = #{params.userId} and  m.path != 'System'
+		<if test="menuName != null and menuName != ''">
+            AND menu_name like concat('%', #{menuName}, '%')
+		</if>
+		<if test="visible != null and visible != ''">
+            AND visible = #{visible}
+		</if>
+		<if test="status != null and status != ''">
+            AND status = #{status}
+		</if>
+		order by m.parent_id, m.order_num
+	</select>
+    
+    <select id="selectMenuTreeByUserId" parameterType="Long" resultMap="SysMenuResult">
+		select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.menu_type, m.icon, m.order_num, m.create_time
+		from sys_menu m
+			 left join sys_role_menu rm on m.menu_id = rm.menu_id
+			 left join sys_user_role ur on rm.role_id = ur.role_id
+			 left join sys_role ro on ur.role_id = ro.role_id
+			 left join sys_user u on ur.user_id = u.user_id
+		where u.user_id = #{userId} and m.menu_type in ('M', 'C') and m.status = 0  AND ro.status = 0 and m.path !='System'
+		order by m.parent_id, m.order_num
+	</select>
+	
+	<select id="selectMenuListByRoleId" parameterType="Long" resultMap="SysMenuResult">
+		select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.menu_type, m.icon, m.order_num, m.create_time
+		from sys_menu m
+            left join sys_role_menu rm on m.menu_id = rm.menu_id
+        where rm.role_id = #{roleId}
+        	and m.menu_id not in (select m.parent_id from sys_menu m inner join sys_role_menu rm on m.menu_id = rm.menu_id and rm.role_id = #{roleId})
+		order by m.parent_id, m.order_num
+	</select>
+	
+	<select id="selectMenuPerms" resultType="String">
+		select distinct m.perms
+		from sys_menu m
+			 left join sys_role_menu rm on m.menu_id = rm.menu_id
+			 left join sys_user_role ur on rm.role_id = ur.role_id
+	</select>
+
+	<select id="selectMenuPermsByUserId" parameterType="Long" resultType="String">
+		select distinct m.perms
+		from sys_menu m
+			 left join sys_role_menu rm on m.menu_id = rm.menu_id
+			 left join sys_user_role ur on rm.role_id = ur.role_id
+			 left join sys_role r on r.role_id = ur.role_id
+		where m.status = '0' and r.status = '0' and ur.user_id = #{userId}
+	</select>
+	
+	<select id="selectMenuById" parameterType="Long" resultMap="SysMenuResult">
+		<include refid="selectMenuVo"/>
+		where menu_id = #{menuId}
+	</select>
+	
+	<select id="hasChildByMenuId" resultType="Integer">
+	    select count(1) from sys_menu where parent_id = #{menuId}  
+	</select>
+	
+	<select id="checkMenuNameUnique" parameterType="SysMenu" resultMap="SysMenuResult">
+		<include refid="selectMenuVo"/>
+		where menu_name=#{menuName} and parent_id = #{parentId} limit 1
+	</select>
+	
+	<update id="updateMenu" parameterType="SysMenu">
+		update sys_menu
+		<set>
+			<if test="menuName != null and menuName != ''">menu_name = #{menuName},</if>
+			<if test="parentId != null">parent_id = #{parentId},</if>
+			<if test="orderNum != null and orderNum != ''">order_num = #{orderNum},</if>
+		    <choose>
+                 <when test="path != null and path != ''">path = #{path},</when>
+				<otherwise>
+					path = '',
+				</otherwise>
+			</choose>
+			<choose>
+				<when test="component != null and component != ''">component = #{component},</when>
+				<otherwise>
+					component = '',
+				</otherwise>
+			</choose>
+			<if test="isFrame != null and isFrame != ''">is_frame = #{isFrame},</if>
+			<if test="menuType != null and menuType != ''">menu_type = #{menuType},</if>
+			<if test="visible != null">visible = #{visible},</if>
+			<if test="status != null">status = #{status},</if>
+			<if test="perms !=null">perms = #{perms},</if>
+			<if test="icon !=null and icon != ''">icon = #{icon},</if>
+			<if test="remark != null and remark != ''">remark = #{remark},</if>
+			<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
+			update_time = sysdate()
+		</set>
+		where menu_id = #{menuId}
+	</update>
+
+	<insert id="insertMenu" parameterType="SysMenu">
+		insert into sys_menu(
+		<if test="parentId != null and parentId != 0">parent_id,</if>
+		<if test="menuName != null and menuName != ''">menu_name,</if>
+		<if test="orderNum != null and orderNum != ''">order_num,</if>
+		<if test="path != null and path != ''">path,</if>
+		<if test="component != null and component != ''">component,</if>
+		<if test="isFrame != null and isFrame != ''">is_frame,</if>
+		<if test="menuType != null and menuType != ''">menu_type,</if>
+		<if test="visible != null">visible,</if>
+		<if test="status != null">status,</if>
+		<if test="perms !=null and perms != ''">perms,</if>
+		<if test="icon != null and icon != ''">icon,</if>
+		<if test="remark != null and remark != ''">remark,</if>
+		<if test="createBy != null and createBy != ''">create_by,</if>
+		create_time
+		)values(
+		<if test="parentId != null and parentId != 0">#{parentId},</if>
+		<if test="menuName != null and menuName != ''">#{menuName},</if>
+		<if test="orderNum != null and orderNum != ''">#{orderNum},</if>
+		<if test="path != null and path != ''">#{path},</if>
+		<if test="component != null and component != ''">#{component},</if>
+		<if test="isFrame != null and isFrame != ''">#{isFrame},</if>
+		<if test="menuType != null and menuType != ''">#{menuType},</if>
+		<if test="visible != null">#{visible},</if>
+		<if test="status != null">#{status},</if>
+		<if test="perms !=null and perms != ''">#{perms},</if>
+		<if test="icon != null and icon != ''">#{icon},</if>
+		<if test="remark != null and remark != ''">#{remark},</if>
+		<if test="createBy != null and createBy != ''">#{createBy},</if>
+		sysdate()
+		)
+	</insert>
+	
+	<delete id="deleteMenuById" parameterType="Long">
+	    delete from sys_menu where menu_id = #{menuId}
+	</delete>
+
+</mapper> 

+ 89 - 0
linkwe-auth/bin/src/main/resources/mapper/system/SysNoticeMapper.xml

@@ -0,0 +1,89 @@
+<?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.linkwechat.web.mapper.SysNoticeMapper">
+    
+    <resultMap type="SysNotice" id="SysNoticeResult">
+        <result property="noticeId"       column="notice_id"       />
+        <result property="noticeTitle"    column="notice_title"    />
+        <result property="noticeType"     column="notice_type"     />
+        <result property="noticeContent"  column="notice_content"  />
+        <result property="status"         column="status"          />
+        <result property="createBy"       column="create_by"       />
+        <result property="createTime"     column="create_time"     />
+        <result property="updateBy"       column="update_by"       />
+        <result property="updateTime"     column="update_time"     />
+        <result property="remark"         column="remark"          />
+    </resultMap>
+    
+    <sql id="selectNoticeVo">
+        select notice_id, notice_title, notice_type, notice_content, status, create_by, create_time, update_by, update_time, remark 
+		from sys_notice
+    </sql>
+    
+    <select id="selectNoticeById" parameterType="Long" resultMap="SysNoticeResult">
+        <include refid="selectNoticeVo"/>
+        where notice_id = #{noticeId}
+    </select>
+    
+    <select id="selectNoticeList" parameterType="SysNotice" resultMap="SysNoticeResult">
+        <include refid="selectNoticeVo"/>
+        <where>
+			<if test="noticeTitle != null and noticeTitle != ''">
+				AND notice_title like concat('%', #{noticeTitle}, '%')
+			</if>
+			<if test="noticeType != null and noticeType != ''">
+				AND notice_type = #{noticeType}
+			</if>
+			<if test="createBy != null and createBy != ''">
+				AND create_by like concat('%', #{createBy}, '%')
+			</if>
+		</where>
+    </select>
+    
+    <insert id="insertNotice" parameterType="SysNotice">
+        insert into sys_notice (
+			<if test="noticeTitle != null and noticeTitle != '' ">notice_title, </if>
+			<if test="noticeType != null and noticeType != '' ">notice_type, </if>
+			<if test="noticeContent != null and noticeContent != '' ">notice_content, </if>
+			<if test="status != null and status != '' ">status, </if>
+			<if test="remark != null and remark != ''">remark,</if>
+ 			<if test="createBy != null and createBy != ''">create_by,</if>
+ 			create_time
+ 		)values(
+			<if test="noticeTitle != null and noticeTitle != ''">#{noticeTitle}, </if>
+			<if test="noticeType != null and noticeType != ''">#{noticeType}, </if>
+			<if test="noticeContent != null and noticeContent != ''">#{noticeContent}, </if>
+			<if test="status != null and status != ''">#{status}, </if>
+			<if test="remark != null and remark != ''">#{remark},</if>
+ 			<if test="createBy != null and createBy != ''">#{createBy},</if>
+ 			sysdate()
+		)
+    </insert>
+	 
+    <update id="updateNotice" parameterType="SysNotice">
+        update sys_notice 
+        <set>
+            <if test="noticeTitle != null and noticeTitle != ''">notice_title = #{noticeTitle}, </if>
+            <if test="noticeType != null and noticeType != ''">notice_type = #{noticeType}, </if>
+            <if test="noticeContent != null">notice_content = #{noticeContent}, </if>
+            <if test="status != null and status != ''">status = #{status}, </if>
+            <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
+ 			update_time = sysdate()
+        </set>
+        where notice_id = #{noticeId}
+    </update>
+	
+    <delete id="deleteNoticeById" parameterType="Long">
+        delete from sys_notice where notice_id = #{noticeId}
+    </delete>
+    
+    <delete id="deleteNoticeByIds" parameterType="Long">
+        delete from sys_notice where notice_id in 
+        <foreach item="noticeId" collection="array" open="(" separator="," close=")">
+            #{noticeId}
+        </foreach>
+    </delete>
+    
+</mapper>

+ 83 - 0
linkwe-auth/bin/src/main/resources/mapper/system/SysOperLogMapper.xml

@@ -0,0 +1,83 @@
+<?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.linkwechat.web.mapper.SysOperLogMapper">
+
+	<resultMap type="SysOperLog" id="SysOperLogResult">
+		<id     property="operId"         column="oper_id"        />
+		<result property="title"          column="title"          />
+		<result property="businessType"   column="business_type"  />
+		<result property="method"         column="method"         />
+		<result property="requestMethod"  column="request_method" />
+		<result property="operatorType"   column="operator_type"  />
+		<result property="operName"       column="oper_name"      />
+		<result property="deptName"       column="dept_name"      />
+		<result property="operUrl"        column="oper_url"       />
+		<result property="operIp"         column="oper_ip"        />
+		<result property="operLocation"   column="oper_location"  />
+		<result property="operParam"      column="oper_param"     />
+		<result property="jsonResult"     column="json_result"    />
+		<result property="status"         column="status"         />
+		<result property="errorMsg"       column="error_msg"      />
+		<result property="operTime"       column="oper_time"      />
+	</resultMap>
+
+	<sql id="selectOperLogVo">
+        select oper_id, title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, oper_time
+        from sys_oper_log
+    </sql>
+    
+	<insert id="insertOperlog" parameterType="SysOperLog">
+		insert into sys_oper_log(title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, oper_time)
+        values (#{title}, #{businessType}, #{method}, #{requestMethod}, #{operatorType}, #{operName}, #{deptName}, #{operUrl}, #{operIp}, #{operLocation}, #{operParam}, #{jsonResult}, #{status}, #{errorMsg}, sysdate())
+	</insert>
+	
+	<select id="selectOperLogList" parameterType="SysOperLog" resultMap="SysOperLogResult">
+		<include refid="selectOperLogVo"/>
+		<where>
+			<if test="title != null and title != ''">
+				AND title like concat('%', #{title}, '%')
+			</if>
+			<if test="businessType != null and businessType != ''">
+				AND business_type = #{businessType}
+			</if>
+			<if test="businessTypes != null and businessTypes.length > 0">
+			    AND business_type in
+			    <foreach collection="businessTypes" item="businessType" open="(" separator="," close=")">
+		 			#{businessType}
+		        </foreach> 
+			</if>
+			<if test="status != null">
+				AND status = #{status}
+			</if>
+			<if test="operName != null and operName != ''">
+				AND oper_name like concat('%', #{operName}, '%')
+			</if>
+			<if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
+				and date_format(oper_time,'%y%m%d') &gt;= date_format(#{beginTime},'%y%m%d')
+			</if>
+			<if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
+				and date_format(oper_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')
+			</if>
+		</where>
+		order by oper_id desc
+	</select>
+	
+	<delete id="deleteOperLogByIds" parameterType="Long">
+ 		delete from sys_oper_log where oper_id in
+ 		<foreach collection="array" item="operId" open="(" separator="," close=")">
+ 			#{operId}
+        </foreach> 
+ 	</delete>
+ 	
+ 	<select id="selectOperLogById" parameterType="Long" resultMap="SysOperLogResult">
+		<include refid="selectOperLogVo"/>
+		where oper_id = #{operId}
+	</select>
+	
+	<update id="cleanOperLog">
+        truncate table sys_oper_log
+    </update>
+
+</mapper> 

+ 122 - 0
linkwe-auth/bin/src/main/resources/mapper/system/SysPostMapper.xml

@@ -0,0 +1,122 @@
+<?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.linkwechat.web.mapper.SysPostMapper">
+
+	<resultMap type="SysPost" id="SysPostResult">
+		<id     property="postId"        column="post_id"       />
+		<result property="postCode"      column="post_code"     />
+		<result property="postName"      column="post_name"     />
+		<result property="postSort"      column="post_sort"     />
+		<result property="status"        column="status"        />
+		<result property="createBy"      column="create_by"     />
+		<result property="createTime"    column="create_time"   />
+		<result property="updateBy"      column="update_by"     />
+		<result property="updateTime"    column="update_time"   />
+		<result property="remark"        column="remark"        />
+	</resultMap>
+	
+	<sql id="selectPostVo">
+        select post_id, post_code, post_name, post_sort, status, create_by, create_time, remark 
+		from sys_post
+    </sql>
+	
+	<select id="selectPostList" parameterType="SysPost" resultMap="SysPostResult">
+	    <include refid="selectPostVo"/>
+		<where>
+			<if test="postCode != null and postCode != ''">
+				AND post_code like concat('%', #{postCode}, '%')
+			</if>
+			<if test="status != null and status != ''">
+				AND status = #{status}
+			</if>
+			<if test="postName != null and postName != ''">
+				AND post_name like concat('%', #{postName}, '%')
+			</if>
+		</where>
+	</select>
+	
+	<select id="selectPostAll" resultMap="SysPostResult">
+		<include refid="selectPostVo"/>
+	</select>
+	
+	<select id="selectPostById" parameterType="Long" resultMap="SysPostResult">
+		<include refid="selectPostVo"/>
+		where post_id = #{postId}
+	</select>
+	
+	<select id="selectPostListByUserId" parameterType="Long" resultType="Integer">
+		select p.post_id
+        from sys_post p
+	        left join sys_user_post up on up.post_id = p.post_id
+	        left join sys_user u on u.user_id = up.user_id
+	    where u.user_id = #{userId}
+	</select>
+	
+	<select id="selectPostsByUserName" parameterType="String" resultMap="SysPostResult">
+		select p.post_id, p.post_name, p.post_code
+		from sys_post p
+			 left join sys_user_post up on up.post_id = p.post_id
+			 left join sys_user u on u.user_id = up.user_id
+		where u.user_name = #{userName}
+	</select>
+	
+	<select id="checkPostNameUnique" parameterType="String" resultMap="SysPostResult">
+		<include refid="selectPostVo"/>
+		 where post_name=#{postName} limit 1
+	</select>
+	
+	<select id="checkPostCodeUnique" parameterType="String" resultMap="SysPostResult">
+		<include refid="selectPostVo"/>
+		 where post_code=#{postCode} limit 1
+	</select>
+	
+	<update id="updatePost" parameterType="SysPost">
+ 		update sys_post
+ 		<set>
+ 			<if test="postCode != null and postCode != ''">post_code = #{postCode},</if>
+ 			<if test="postName != null and postName != ''">post_name = #{postName},</if>
+ 			<if test="postSort != null and postSort != ''">post_sort = #{postSort},</if>
+ 			<if test="status != null and status != ''">status = #{status},</if>
+ 			<if test="remark != null">remark = #{remark},</if>
+ 			<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
+ 			update_time = sysdate()
+ 		</set>
+ 		where post_id = #{postId}
+	</update>
+ 	
+ 	<insert id="insertPost" parameterType="SysPost" useGeneratedKeys="true" keyProperty="postId">
+ 		insert into sys_post(
+ 			<if test="postId != null and postId != 0">post_id,</if>
+ 			<if test="postCode != null and postCode != ''">post_code,</if>
+ 			<if test="postName != null and postName != ''">post_name,</if>
+ 			<if test="postSort != null and postSort != ''">post_sort,</if>
+ 			<if test="status != null and status != ''">status,</if>
+ 			<if test="remark != null and remark != ''">remark,</if>
+ 			<if test="createBy != null and createBy != ''">create_by,</if>
+ 			create_time
+ 		)values(
+ 			<if test="postId != null and postId != 0">#{postId},</if>
+ 			<if test="postCode != null and postCode != ''">#{postCode},</if>
+ 			<if test="postName != null and postName != ''">#{postName},</if>
+ 			<if test="postSort != null and postSort != ''">#{postSort},</if>
+ 			<if test="status != null and status != ''">#{status},</if>
+ 			<if test="remark != null and remark != ''">#{remark},</if>
+ 			<if test="createBy != null and createBy != ''">#{createBy},</if>
+ 			sysdate()
+ 		)
+	</insert>
+	
+	<delete id="deletePostById" parameterType="Long">
+		delete from sys_post where post_id = #{postId}
+	</delete>
+	
+	<delete id="deletePostByIds" parameterType="Long">
+ 		delete from sys_post where post_id in
+ 		<foreach collection="array" item="postId" open="(" separator="," close=")">
+ 			#{postId}
+        </foreach> 
+ 	</delete>
+
+</mapper> 

+ 57 - 0
linkwe-auth/bin/src/main/resources/mapper/system/SysRoleDeptMapper.xml

@@ -0,0 +1,57 @@
+<?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.linkwechat.web.mapper.SysRoleDeptMapper">
+
+	<resultMap type="SysRoleDept" id="SysRoleDeptResult">
+		<result property="roleId"     column="role_id"      />
+		<result property="deptId"     column="dept_id"      />
+	</resultMap>
+
+	<resultMap id="deptResult" type="SysDept">
+		<id property="deptId" column="dept_id"/>
+		<result property="parentId" column="parent_id"/>
+		<result property="deptName" column="dept_name"/>
+		<result property="deptEnName" column="dept_en_name"/>
+		<result property="orderNum" column="order_num"/>
+		<result property="leader" column="leader"/>
+		<result property="status" column="dept_status"/>
+	</resultMap>
+
+	<select id="selectRoleDeptList" parameterType="Long" resultMap="deptResult">
+		select
+		    d.dept_id,
+		    d.dept_name,
+		    d.dept_en_name,
+		    d.order_num,
+		    d.leader,
+		    d.status
+		from sys_role_dept rd
+		left join sys_dept d on d.dept_id = rd.dept_id
+		where role_id=#{roleId}
+	</select>
+
+	<delete id="deleteRoleDeptByRoleId" parameterType="Long">
+		delete from sys_role_dept where role_id=#{roleId}
+	</delete>
+	
+	<select id="selectCountRoleDeptByDeptId" resultType="Integer">
+	    select count(1) from sys_role_dept where dept_id=#{deptId}
+	</select>
+	
+	<delete id="deleteRoleDept" parameterType="Long">
+ 		delete from sys_role_dept where role_id in
+ 		<foreach collection="array" item="roleId" open="(" separator="," close=")">
+ 			#{roleId}
+        </foreach> 
+ 	</delete>
+	
+	<insert id="batchRoleDept">
+		insert into sys_role_dept(role_id, dept_id) values
+		<foreach item="item" index="index" collection="list" separator=",">
+			(#{item.roleId},#{item.deptId})
+		</foreach>
+	</insert>
+	
+</mapper> 

+ 204 - 0
linkwe-auth/bin/src/main/resources/mapper/system/SysRoleMapper.xml

@@ -0,0 +1,204 @@
+<?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.linkwechat.web.mapper.SysRoleMapper">
+
+    <resultMap type="com.linkwechat.common.core.domain.entity.SysRole" id="SysRoleResult">
+        <id property="roleId" column="role_id"/>
+        <result property="roleName" column="role_name"/>
+        <result property="roleKey" column="role_key"/>
+        <result property="roleSort" column="role_sort"/>
+        <result property="dataScope" column="data_scope"/>
+        <result property="status" column="status"/>
+        <result property="delFlag" column="del_flag"/>
+        <result property="createBy" column="create_by"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateBy" column="update_by"/>
+        <result property="updateTime" column="update_time"/>
+        <result property="remark" column="remark"/>
+    </resultMap>
+
+    <resultMap type="com.linkwechat.web.domain.vo.RoleVo" id="SysRoleVoResult">
+        <id property="roleId" column="role_id"/>
+        <result property="roleName" column="role_name"/>
+        <result property="roleKey" column="role_key"/>
+        <result property="roleSort" column="role_sort"/>
+        <result property="dataScope" column="data_scope"/>
+        <result property="status" column="status"/>
+        <result property="delFlag" column="del_flag"/>
+        <result property="createTime" column="create_time"/>
+        <result property="remark" column="remark"/>
+        <result property="userCount" column="user_count"/>
+    </resultMap>
+
+    <sql id="selectRoleBase">
+        select r.role_id,
+               r.role_name,
+               r.role_key,
+               r.role_sort,
+               r.data_scope,
+               r.status,
+               r.del_flag,
+               r.create_time,
+               r.remark,
+               count(if(su.user_id is not NULL,ur.user_id,NULL)) as user_count
+        from sys_role r
+        LEFT join sys_user_role ur on ur.role_id = r.role_id
+        LEFT JOIN sys_user su on su.user_id=ur.user_id
+    </sql>
+
+    <sql id="selectRoleVo">
+        select distinct r.role_id,
+                        r.role_name,
+                        r.role_key,
+                        r.role_sort,
+                        r.data_scope,
+                        r.status,
+                        r.del_flag,
+                        r.create_time,
+                        r.remark
+        from sys_role r
+                 left join sys_user_role ur on ur.role_id = r.role_id
+                 left join sys_user u on u.user_id = ur.user_id
+                 left join sys_dept d on u.dept_id = d.dept_id
+    </sql>
+
+    <select id="selectRoleBaseList" parameterType="com.linkwechat.common.core.domain.entity.SysRole" resultMap="SysRoleVoResult">
+        <include refid="selectRoleBase"/>
+        where r.del_flag = '0'
+        <if test="roleName != null and roleName != ''">
+            AND r.role_name like concat('%', #{roleName}, '%')
+        </if>
+        <if test="status != null and status != ''">
+            AND r.status = #{status}
+        </if>
+        <if test="roleKey != null and roleKey != ''">
+            AND r.role_key = #{roleKey}
+        </if>
+        <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
+            and date_format(r.create_time,'%y%m%d') &gt;= date_format(#{beginTime},'%y%m%d')
+        </if>
+        <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
+            and date_format(r.create_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')
+        </if>
+        group by r.role_id
+        order by r.role_sort
+    </select>
+
+    <select id="selectRoleList" parameterType="com.linkwechat.common.core.domain.entity.SysRole" resultMap="SysRoleResult">
+        <include refid="selectRoleVo"/>
+        where r.del_flag = '0'
+        <if test="roleName != null and roleName != ''">
+            AND r.role_name like concat('%', #{roleName}, '%')
+        </if>
+        <if test="status != null and status != ''">
+            AND r.status = #{status}
+        </if>
+        <if test="roleKey != null and roleKey != ''">
+            AND r.role_key = #{roleKey}
+        </if>
+        <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
+            and date_format(r.create_time,'%y%m%d') &gt;= date_format(#{beginTime},'%y%m%d')
+        </if>
+        <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
+            and date_format(r.create_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')
+        </if>
+        order by r.role_sort
+    </select>
+
+    <select id="selectRolePermissionByUserId" parameterType="Long" resultMap="SysRoleResult">
+        <include refid="selectRoleVo"/>
+        WHERE r.del_flag = '0' and ur.user_id = #{userId}
+    </select>
+
+    <select id="selectRoleAll" resultMap="SysRoleResult">
+        <include refid="selectRoleVo"/>
+    </select>
+
+    <select id="selectRoleListByUserId" parameterType="Long" resultMap="SysRoleResult">
+        <include refid="selectRoleVo"/>
+        where u.user_id = #{userId}
+    </select>
+
+    <select id="selectRoleById" parameterType="Long" resultMap="SysRoleResult">
+        <include refid="selectRoleVo"/>
+        where r.role_id = #{roleId}
+    </select>
+
+    <select id="selectSuperAdminBaseRoleList" resultMap="SysRoleResult">
+        <include refid="selectRoleVo"/>
+        where r.del_flag = '0' and r.base_role = 1
+        order by r.role_sort
+    </select>
+
+    <select id="selectRolesByUserName" parameterType="String" resultMap="SysRoleResult">
+        <include refid="selectRoleVo"/>
+        WHERE r.del_flag = '0' and u.user_name = #{userName}
+    </select>
+
+    <select id="checkRoleNameUnique" parameterType="String" resultMap="SysRoleResult">
+        <include refid="selectRoleVo"/>
+        where r.role_name=#{roleName} and r.del_flag = '0' limit 1
+    </select>
+
+    <select id="checkRoleKeyUnique" parameterType="String" resultMap="SysRoleResult">
+        <include refid="selectRoleVo"/>
+        where r.role_key=#{roleKey} limit 1
+    </select>
+
+	<insert id="insertRole" parameterType="com.linkwechat.common.core.domain.entity.SysRole" useGeneratedKeys="true" keyProperty="roleId">
+ 		insert into sys_role(
+ 			<if test="roleId != null and roleId != 0">role_id,</if>
+ 			<if test="roleName != null and roleName != ''">role_name,</if>
+ 			<if test="roleKey != null and roleKey != ''">role_key,</if>
+ 			<if test="roleSort != null and roleSort != ''">role_sort,</if>
+ 			<if test="dataScope != null and dataScope != ''">data_scope,</if>
+ 			<if test="status != null and status != ''">status,</if>
+ 			<if test="remark != null and remark != ''">remark,</if>
+ 			<if test="createBy != null and createBy != ''">create_by,</if>
+ 			create_time
+ 		)values(
+ 			<if test="roleId != null and roleId != 0">#{roleId},</if>
+ 			<if test="roleName != null and roleName != ''">#{roleName},</if>
+ 			<if test="roleKey != null and roleKey != ''">#{roleKey},</if>
+ 			<if test="roleSort != null and roleSort != ''">#{roleSort},</if>
+ 			<if test="dataScope != null and dataScope != ''">#{dataScope},</if>
+ 			<if test="status != null and status != ''">#{status},</if>
+ 			<if test="remark != null and remark != ''">#{remark},</if>
+ 			<if test="createBy != null and createBy != ''">#{createBy},</if>
+ 			sysdate()
+ 		)
+	</insert>
+	
+	<update id="updateRole" parameterType="com.linkwechat.common.core.domain.entity.SysRole">
+ 		update sys_role
+ 		<set>
+ 			<if test="roleName != null and roleName != ''">role_name = #{roleName},</if>
+ 			<if test="roleKey != null and roleKey != ''">role_key = #{roleKey},</if>
+ 			<if test="roleSort != null and roleSort != ''">role_sort = #{roleSort},</if>
+ 			<if test="dataScope != null and dataScope != ''">data_scope = #{dataScope},</if>
+ 			<if test="status != null and status != ''">status = #{status},</if>
+ 			<if test="remark != null">remark = #{remark},</if>
+ 			<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
+ 			update_time = sysdate()
+ 		</set>
+ 		where role_id = #{roleId}
+	</update>
+	
+	<update id="updateRoleStatus" parameterType="com.linkwechat.common.core.domain.entity.SysRole">
+ 		update sys_user set status = #{status} where user_id = #{userId}
+	</update>
+	
+	<delete id="deleteRoleById" parameterType="Long">
+ 		delete from sys_role where role_id = #{roleId}
+ 	</delete>
+ 	
+ 	<delete id="deleteRoleByIds" parameterType="Long">
+ 	    update sys_role set del_flag = '2' where role_id in
+ 		<foreach collection="array" item="roleId" open="(" separator="," close=")">
+ 			#{roleId}
+        </foreach> 
+ 	</delete>
+ 	
+</mapper> 

+ 27 - 0
linkwe-auth/bin/src/main/resources/mapper/system/SysRoleMenuMapper.xml

@@ -0,0 +1,27 @@
+<?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.linkwechat.web.mapper.SysRoleMenuMapper">
+
+	<resultMap type="SysRoleMenu" id="SysRoleMenuResult">
+		<result property="roleId"     column="role_id"      />
+		<result property="menuId"     column="menu_id"      />
+	</resultMap>
+	
+	<select id="checkMenuExistRole" resultType="Integer">
+	    select count(1) from sys_role_menu where menu_id = #{menuId}
+	</select>
+
+	<delete id="deleteRoleMenuByRoleId" parameterType="Long">
+		delete from sys_role_menu where role_id=#{roleId}
+	</delete>
+	
+	<insert id="batchRoleMenu">
+		insert into sys_role_menu(role_id, menu_id) values
+		<foreach item="item" index="index" collection="list" separator=",">
+			(#{item.roleId},#{item.menuId})
+		</foreach>
+	</insert>
+	
+</mapper> 

+ 24 - 0
linkwe-auth/bin/src/main/resources/mapper/system/SysUserManageScopMapper.xml

@@ -0,0 +1,24 @@
+<?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.linkwechat.web.mapper.SysUserManageScopMapper">
+
+    <resultMap id="BaseResultMap" type="com.linkwechat.common.core.domain.SysUserManageScop">
+            <id property="id" column="id" jdbcType="BIGINT"/>
+            <result property="userId" column="user_id" jdbcType="BIGINT"/>
+            <result property="deptId" column="dept_id" jdbcType="BIGINT"/>
+            <result property="createBy" column="create_by" jdbcType="VARCHAR"/>
+            <result property="createById" column="create_by_id" jdbcType="BIGINT"/>
+            <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+            <result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
+            <result property="updateById" column="update_by_id" jdbcType="BIGINT"/>
+            <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
+    </resultMap>
+
+    <sql id="Base_Column_List">
+        id,user_id,dept_id,
+        create_by,create_by_id,create_time,
+        update_by,update_by_id,update_time
+    </sql>
+</mapper>

+ 643 - 0
linkwe-auth/bin/src/main/resources/mapper/system/SysUserMapper.xml

@@ -0,0 +1,643 @@
+<?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.linkwechat.web.mapper.SysUserMapper">
+    <resultMap type="com.linkwechat.common.core.domain.entity.SysUser" id="SysUserResult">
+        <id property="userId" column="user_id"/>
+        <result property="weUserId" column="we_user_id"/>
+        <result property="dataScope" column="data_scope"/>
+        <result property="deptId" column="dept_id"/>
+        <result property="userName" column="user_name"/>
+        <result property="position" column="position"/>
+        <result property="phoneNumber" column="phone_number"/>
+        <result property="sex" column="sex"/>
+        <result property="email" column="email"/>
+        <result property="bizMail" column="biz_mail"/>
+        <result property="leader" column="leader"/>
+        <result property="avatar" column="avatar"/>
+        <result property="thumbAvatar" column="thumb_avatar"/>
+        <result property="telephone" column="telephone"/>
+        <result property="nickName" column="nick_name"/>
+        <result property="extAttr" column="ext_attr"/>
+        <result property="weUserStatus" column="we_user_status"/>
+        <result property="qrCode" column="qr_code"/>
+        <result property="externalProfile" column="external_profile"/>
+        <result property="externalPosition" column="external_position"/>
+        <result property="address" column="address"/>
+        <result property="openUserid" column="open_userid"/>
+        <result property="password" column="password"/>
+        <result property="status" column="status"/>
+        <result property="delFlag" column="del_flag"/>
+        <result property="loginIp" column="login_ip"/>
+        <result property="loginDate" column="login_date"/>
+        <result property="createBy" column="create_by"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateBy" column="update_by"/>
+        <result property="updateTime" column="update_time"/>
+        <result property="remark" column="remark"/>
+        <result property="userType" column="user_type"/>
+        <association property="dept" column="dept_id" javaType="com.linkwechat.common.core.domain.entity.SysDept" resultMap="deptResult"/>
+        <collection property="roles" javaType="java.util.List" resultMap="RoleResult"/>
+    </resultMap>
+
+    <resultMap id="userDeptResult" type="com.linkwechat.web.domain.vo.UserVo">
+        <id property="userId" column="user_id"/>
+        <result property="weUserId" column="we_user_id"/>
+        <result property="scopeDept" column="scopeDept"/>
+        <result property="dataScope" column="data_scope" />
+        <result property="userName" column="user_name"/>
+        <result property="position" column="position"/>
+        <result property="phoneNumber" column="phone_number"/>
+        <result property="nickName" column="nick_name"/>
+        <result property="openUserid" column="open_userid"/>
+        <collection property="userDepts" ofType="com.linkwechat.common.core.domain.entity.SysUserDept" column="we_user_id" select="com.linkwechat.web.mapper.SysUserMapper.selectSysUserDeptList">
+            <id property="deptId" column="dept_id"/>
+            <result property="deptName" column="dept_name"/>
+            <result property="deptEnName" column="dept_en_name"/>
+        </collection>
+    </resultMap>
+
+    <resultMap id="userRoleResult" type="com.linkwechat.web.domain.vo.UserRoleVo">
+        <id property="userId" column="user_id"/>
+        <id property="roleId" column="role_id"/>
+        <result property="roleName" column="role_name"/>
+    </resultMap>
+
+    <resultMap id="deptResult" type="com.linkwechat.common.core.domain.entity.SysDept">
+        <id property="deptId" column="dept_id"/>
+        <result property="parentId" column="parent_id"/>
+        <result property="deptName" column="dept_name"/>
+        <result property="deptEnName" column="dept_en_name"/>
+        <result property="orderNum" column="order_num"/>
+        <result property="leader" column="leader"/>
+        <result property="status" column="dept_status"/>
+    </resultMap>
+
+    <resultMap id="RoleResult" type="com.linkwechat.common.core.domain.entity.SysRole">
+        <id property="roleId" column="role_id"/>
+        <result property="roleName" column="role_name"/>
+        <result property="roleKey" column="role_key"/>
+        <result property="roleSort" column="role_sort"/>
+        <result property="dataScope" column="data_scope"/>
+        <result property="status" column="role_status"/>
+    </resultMap>
+
+    <sql id="simpleUserVo">
+        select user_id,
+               dept_id,
+               user_name,
+               user_type,
+               nick_name,
+               email,
+               phone_number,
+               sex,
+               avatar,
+               password,
+               status,
+               del_flag,
+               login_ip,
+               login_date,
+               create_by,
+               create_time,
+               update_by,
+               update_time,
+               remark,
+               we_user_id,
+               position,
+               thumb_avatar,
+               biz_mail,
+               leader,
+               telephone,
+               ext_attr,
+               we_user_status,
+               qr_code,
+               external_profile,
+               external_position,
+               address,
+               open_userid
+        from sys_user
+    </sql>
+
+    <sql id="selectUserVo">
+        select u.user_id,
+               ifnull(u.data_scope,5) as data_scope,
+               u.we_user_id,
+               u.dept_id,
+               u.user_name,
+               u.position,
+               u.phone_number,
+               u.sex,
+               u.email,
+               u.biz_mail,
+               u.leader,
+               u.avatar,
+               u.thumb_avatar,
+               u.telephone,
+               u.nick_name,
+               u.ext_attr,
+               u.we_user_status,
+               u.qr_code,
+               u.external_profile,
+               u.external_position,
+               u.address,
+               u.open_userid,
+               u.password,
+               u.status,
+               u.del_flag,
+               u.login_ip,
+               u.login_date,
+               u.create_by,
+               u.create_time,
+               u.remark,
+               u.user_type,
+               d.dept_id,
+               d.parent_id,
+               d.dept_name,
+               d.dept_en_name,
+               d.status as dept_status,
+               r.role_id,
+               r.role_name,
+               r.role_key,
+               r.role_sort,
+               r.data_scope,
+               r.status as role_status
+        from sys_user u
+                 left join sys_dept d on u.dept_id = d.dept_id
+                 left join sys_user_role ur on u.user_id = ur.user_id
+                 left join sys_role r on r.role_id = ur.role_id
+    </sql>
+
+    <select id="selectUserRoleList" parameterType="java.util.List" resultMap="userRoleResult">
+        select u.user_id,
+        r.role_id,
+        r.role_name
+        from sys_user u
+        left join sys_user_role ur on u.user_id = ur.user_id and u.user_id in
+        <foreach collection="userIds" item="userId" open="(" separator="," close=")">
+            #{userId}
+        </foreach>
+        left join sys_role r on r.role_id = ur.role_id
+        where u.del_flag = '0' and r.role_id is not null
+    </select>
+
+    <select id="selectUserDeptList" resultMap="userDeptResult">
+        select * from (select
+        u.we_user_id,
+        ifnull(u.data_scope,5) as data_scope,
+        (SELECT GROUP_CONCAT(d.dept_name) FROM sys_user_manage_scop sums
+        LEFT JOIN sys_dept d ON d.dept_id=sums.dept_id
+        WHERE sums.user_id=u.user_id ) as scopeDept,
+        u.user_id,
+        u.user_name,
+        u.position,
+        u.phone_number,
+        u.nick_name,
+        u.open_userid
+        from sys_user u
+        left join sys_user_dept ud on u.we_user_id = ud.we_user_id
+        LEFT JOIN sys_dept d ON ud.dept_id = d.dept_id
+        LEFT JOIN sys_dept e ON u.dept_id = e.dept_id
+        left join sys_user_role sur on sur.user_id=u.user_id
+        where u.del_flag = 0 and u.is_user_leave=0
+        <if test="sysUser.userName != null and sysUser.userName != ''">
+            AND u.user_name like concat('%', #{sysUser.userName}, '%')
+        </if>
+        <if test="sysUser.status != null and sysUser.status != ''">
+            AND u.status = #{sysUser.status}
+        </if>
+        <if test="sysUser.phoneNumber != null and sysUser.phoneNumber != ''">
+            AND u.phone_number like concat('%', #{sysUser.phoneNumber}, '%')
+        </if>
+        <if test="sysUser.beginTime != null and sysUser.beginTime != ''"><!-- 开始时间检索 -->
+            AND date_format(u.create_time,'%y%m%d') &gt;= date_format(#{sysUser.beginTime},'%y%m%d')
+        </if>
+        <if test="sysUser.endTime != null and sysUser.endTime != ''"><!-- 结束时间检索 -->
+            AND date_format(u.create_time,'%y%m%d') &lt;= date_format(#{sysUser.endTime},'%y%m%d')
+        </if>
+        <if test="sysUser.roleId != null ">
+            AND sur.role_id = #{sysUser.roleId}
+        </if>
+        <if test="sysUser.deptId != 1">
+            AND u.dept_id in (select dept_id from sys_dept where find_in_set(#{sysUser.deptId}, ancestors)
+            union
+            select #{sysUser.deptId}
+            )
+        </if>
+        union
+
+        select
+        u.we_user_id,
+        ifnull(u.data_scope,5) as data_scope,
+        (SELECT GROUP_CONCAT(d.dept_name) FROM sys_user_manage_scop sums
+        LEFT JOIN sys_dept d ON d.dept_id=sums.dept_id
+        WHERE sums.user_id=u.user_id ) as scopeDept,
+        u.user_id,
+        u.user_name,
+        u.position,
+        u.phone_number,
+        u.nick_name,
+        u.open_userid
+        from sys_user u
+        left join sys_user_dept ud on u.we_user_id = ud.we_user_id
+        LEFT JOIN sys_dept d ON ud.dept_id = d.dept_id
+        LEFT JOIN sys_dept e ON u.dept_id = e.dept_id
+        left join sys_user_role sur on sur.user_id=u.user_id
+        where u.del_flag = 0 and u.is_user_leave=0
+        <if test="sysUser.userName != null and sysUser.userName != ''">
+            AND u.user_name like concat('%', #{sysUser.userName}, '%')
+        </if>
+        <if test="sysUser.status != null and sysUser.status != ''">
+            AND u.status = #{sysUser.status}
+        </if>
+        <if test="sysUser.phoneNumber != null and sysUser.phoneNumber != ''">
+            AND u.phone_number like concat('%', #{sysUser.phoneNumber}, '%')
+        </if>
+        <if test="sysUser.beginTime != null and sysUser.beginTime != ''"><!-- 开始时间检索 -->
+            AND date_format(u.create_time,'%y%m%d') &gt;= date_format(#{sysUser.beginTime},'%y%m%d')
+        </if>
+        <if test="sysUser.endTime != null and sysUser.endTime != ''"><!-- 结束时间检索 -->
+            AND date_format(u.create_time,'%y%m%d') &lt;= date_format(#{sysUser.endTime},'%y%m%d')
+        </if>
+        <if test="sysUser.roleId != null ">
+            AND sur.role_id = #{sysUser.roleId}
+        </if>
+        <if test="sysUser.deptId != 1">
+            AND (ud.dept_id in (select dept_id from sys_dept where find_in_set(#{sysUser.deptId}, ancestors)
+            union
+            select #{
+            sysUser.deptId}
+            )
+            )
+        </if>
+        ) aaa
+        <if test="pageDomain !=null">
+            <if test="pageDomain.pageNum !=null and pageDomain.pageSize !=null">
+                limit ${pageDomain.pageSize * (pageDomain.pageNum-1)}, #{pageDomain.pageSize}
+            </if>
+        </if>
+
+    </select>
+
+    <select id="selectCountUserDeptList" parameterType="com.linkwechat.common.core.domain.entity.SysUser" resultType="int">
+        select count(DISTINCT we_user_id) from (
+
+        select
+        u.*
+        from sys_user u
+        left join sys_user_dept ud on u.we_user_id = ud.we_user_id
+        left join sys_dept d on ud.dept_id = d.dept_id
+        LEFT JOIN sys_dept e ON u.dept_id = e.dept_id
+        left join sys_user_role sur on sur.user_id=u.user_id
+        where u.del_flag = 0 and u.is_user_leave=0
+        <if test="userName != null and userName != ''">
+            AND u.user_name like concat('%', #{userName}, '%')
+        </if>
+        <if test="status != null and status != ''">
+            AND u.status = #{status}
+        </if>
+        <if test="phoneNumber != null and phoneNumber != ''">
+            AND u.phone_number like concat('%', #{phoneNumber}, '%')
+        </if>
+        <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
+            AND date_format(u.create_time,'%y%m%d') &gt;= date_format(#{beginTime},'%y%m%d')
+        </if>
+        <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
+            AND date_format(u.create_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')
+        </if>
+        <if test="roleId != null ">
+            AND sur.role_id = #{roleId}
+        </if>
+        <if test="deptId != 1">
+            AND (
+            u.dept_id in (select dept_id from sys_dept where find_in_set(#{deptId}, ancestors)
+            union
+            select #{deptId}
+            )
+            )
+        </if>
+        union all
+        select
+        u.*
+        from sys_user u
+        left join sys_user_dept ud on u.we_user_id = ud.we_user_id
+        left join sys_dept d on ud.dept_id = d.dept_id
+        LEFT JOIN sys_dept e ON u.dept_id = e.dept_id
+        left join sys_user_role sur on sur.user_id=u.user_id
+        where u.del_flag = 0 and u.is_user_leave=0
+        <if test="userName != null and userName != ''">
+            AND u.user_name like concat('%', #{userName}, '%')
+        </if>
+        <if test="status != null and status != ''">
+            AND u.status = #{status}
+        </if>
+        <if test="phoneNumber != null and phoneNumber != ''">
+            AND u.phone_number like concat('%', #{phoneNumber}, '%')
+        </if>
+        <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
+            AND date_format(u.create_time,'%y%m%d') &gt;= date_format(#{beginTime},'%y%m%d')
+        </if>
+        <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
+            AND date_format(u.create_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')
+        </if>
+        <if test="roleId != null ">
+            AND sur.role_id = #{roleId}
+        </if>
+        <if test="deptId != 1">
+            AND (ud.dept_id in (select dept_id from sys_dept where find_in_set(#{deptId}, ancestors)
+            union
+            select #{deptId}
+            )
+        )
+        </if>
+        ) aaa
+
+    </select>
+
+    <select id="selectUserList" parameterType="com.linkwechat.common.core.domain.entity.SysUser" resultMap="SysUserResult">
+        select u.user_id,u.we_user_id,u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phone_number,
+        u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
+        d.dept_name, d.leader from sys_user u
+        left join sys_dept d on u.dept_id = d.dept_id
+        where u.del_flag = '0'
+        <if test="userName != null and userName != ''">
+            AND u.user_name like concat('%', #{userName}, '%')
+        </if>
+        <if test="status != null and status != ''">
+            AND u.status = #{status}
+        </if>
+        <if test="phoneNumber != null and phoneNumber != ''">
+            AND u.phone_number like concat('%', #{phoneNumber}, '%')
+        </if>
+        <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
+            AND date_format(u.create_time,'%y%m%d') &gt;= date_format(#{beginTime},'%y%m%d')
+        </if>
+        <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
+            AND date_format(u.create_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')
+        </if>
+        <if test="deptId != null and deptId != 0">
+            AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE FIND_IN_SET
+            (#{deptId},ancestors) ))
+        </if>
+    </select>
+
+    <select id="selectUserByUserName" parameterType="String" resultMap="SysUserResult">
+        <include refid="selectUserVo"/>
+        where (u.user_name = #{userName} or u.we_user_id = #{userName}) and  u.del_flag = '0'
+    </select>
+
+    <select id="selectUserById" parameterType="Long" resultMap="SysUserResult">
+        <include refid="selectUserVo"/>
+        where u.user_id = #{userId}
+    </select>
+
+    <select id="checkUserNameUnique" parameterType="String" resultType="int">
+        select count(1)
+        from sys_user
+        where user_name = #{userName}
+          and del_flag = '0' limit 1
+    </select>
+
+    <select id="checkPhoneUnique" parameterType="String" resultMap="SysUserResult">
+        select user_id, phone_number
+        from sys_user
+        where phone_number = #{phoneNumber}
+          and del_flag = '0' limit 1
+    </select>
+
+    <select id="checkEmailUnique" parameterType="String" resultMap="SysUserResult">
+        select user_id, email
+        from sys_user
+        where email = #{email}
+          and del_flag = '0' limit 1
+    </select>
+
+    <select id="selectUserByWeUserId" resultMap="SysUserResult">
+        <include refid="selectUserVo"/>
+        <where>
+            <if test="weUserId != null and weUserId != ''">
+                and u.we_user_id = #{weUserId}
+            </if>
+        </where>
+    </select>
+
+    <insert id="insertUser" parameterType="com.linkwechat.common.core.domain.entity.SysUser" useGeneratedKeys="true" keyProperty="userId">
+        insert into sys_user(
+        <if test="userId != null and userId != 0">user_id,</if>
+        <if test="weUserId != null and weUserId != ''">we_user_id,</if>
+        <if test="deptId != null and deptId != 0">dept_id,</if>
+        <if test="userName != null and userName != ''">user_name,</if>
+        <if test="position != null and position != ''">position,</if>
+        <if test="phoneNumber != null and phoneNumber != ''">phone_number,</if>
+        <if test="sex != null and sex != ''">sex,</if>
+        <if test="email != null and email != ''">email,</if>
+        <if test="bizMail != null and bizMail != ''">biz_mail,</if>
+        <if test="leader != null and leader != ''">leader,</if>
+        <if test="avatar != null and avatar != ''">avatar,</if>
+        <if test="thumbAvatar != null and thumbAvatar != ''">thumb_avatar,</if>
+        <if test="telephone != null and telephone != ''">telephone,</if>
+        <if test="nickName != null and nickName != ''">nick_name,</if>
+        <if test="extAttr != null and extAttr != ''">ext_attr,</if>
+        <if test="weUserStatus != null and weUserStatus != ''">we_user_status,</if>
+        <if test="qrCode != null and qrCode != ''">qr_code,</if>
+        <if test="externalProfile != null and externalProfile != ''">external_profile,</if>
+        <if test="externalPosition != null and externalPosition != ''">external_position,</if>
+        <if test="address != null and address != ''">address,</if>
+        <if test="openUserid != null and openUserid != ''">open_userid,</if>
+        <if test="password != null and password != ''">password,</if>
+        <if test="status != null and status != ''">status,</if>
+        <if test="createBy != null and createBy != ''">create_by,</if>
+        <if test="remark != null and remark != ''">remark,</if>
+        <if test="userType != null and userType != ''">user_type,</if>
+        create_time
+        )values(
+        <if test="userId != null and userId != 0">#{userId},</if>
+        <if test="weUserId != null and weUserId != ''">#{weUserId},</if>
+        <if test="deptId != null and deptId != 0">#{deptId},</if>
+        <if test="userName != null and userName != ''">#{userName},</if>
+        <if test="position != null and position != ''">#{position},</if>
+        <if test="phoneNumber != null and phoneNumber != ''">#{phoneNumber},</if>
+        <if test="sex != null and sex != ''">#{sex},</if>
+        <if test="email != null and email != ''">#{email},</if>
+        <if test="bizMail != null and bizMail != ''">#{bizMail},</if>
+        <if test="leader != null and leader != ''">#{leader},</if>
+        <if test="avatar != null and avatar != ''">#{avatar},</if>
+        <if test="thumbAvatar != null and thumbAvatar != ''">#{thumbAvatar},</if>
+        <if test="telephone != null and telephone != ''">#{telephone},</if>
+        <if test="nickName != null and nickName != ''">#{nickName},</if>
+        <if test="extAttr != null and extAttr != ''">#{extAttr},</if>
+        <if test="weUserStatus != null and weUserStatus != ''">#{weUserStatus},</if>
+        <if test="qrCode != null and qrCode != ''">#{qrCode},</if>
+        <if test="externalProfile != null and externalProfile != ''">#{externalProfile},</if>
+        <if test="externalPosition != null and externalPosition != ''">#{externalPosition},</if>
+        <if test="address != null and address != ''">#{address},</if>
+        <if test="openUserid != null and openUserid != ''">#{openUserid},</if>
+        <if test="password != null and password != ''">#{password},</if>
+        <if test="status != null and status != ''">#{status},</if>
+        <if test="createBy != null and createBy != ''">#{createBy},</if>
+        <if test="remark != null and remark != ''">#{remark},</if>
+        <if test="userType != null and userType != ''">#{userType},</if>
+        sysdate()
+        )
+    </insert>
+
+    <update id="updateUser" parameterType="com.linkwechat.common.core.domain.entity.SysUser">
+        update sys_user
+        <set>
+            <if test="weUserId != null and weUserId != ''">we_user_id = #{weUserId},</if>
+            <if test="deptId != null and deptId != 0">dept_id = #{deptId},</if>
+            <if test="userName != null and userName != ''">user_name = #{userName},</if>
+            <if test="position != null and position != ''">position = #{position},</if>
+            <if test="phoneNumber != null and phoneNumber != ''">phone_number = #{phoneNumber},</if>
+            <if test="sex != null and sex != ''">sex = #{sex},</if>
+            <if test="email != null and email != ''">email = #{email},</if>
+            <if test="bizMail != null and bizMail != ''">biz_mail = #{bizMail},</if>
+            <if test="leader != null and leader != ''">leader = #{leader},</if>
+            <if test="avatar != null and avatar != ''">avatar = #{avatar},</if>
+            <if test="thumbAvatar != null and thumbAvatar != ''">thumb_avatar = #{thumbAvatar},</if>
+            <if test="telephone != null and telephone != ''">telephone = #{telephone},</if>
+            <if test="nickName != null and nickName != ''">nick_name = #{nickName},</if>
+            <if test="extAttr != null and extAttr != ''">ext_attr = #{extAttr},</if>
+            <if test="weUserStatus != null and weUserStatus != ''">we_user_status = #{weUserStatus},</if>
+            <if test="qrCode != null and qrCode != ''">qr_code = #{qrCode},</if>
+            <if test="externalProfile != null and externalProfile != ''">external_profile = #{externalProfile},</if>
+            <if test="externalPosition != null and externalPosition != ''">external_position = #{externalPosition},</if>
+            <if test="address != null and address != ''">address = #{address},</if>
+            <if test="openUserid != null and openUserid != ''">open_userid = #{openUserid},</if>
+            <if test="password != null and password != ''">password = #{password},</if>
+            <if test="status != null and status != ''">status = #{status},</if>
+            <if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
+            <if test="remark != null and remark != ''">remark = #{remark},</if>
+            <if test="userType != null and userType != ''">user_type = #{userType},</if>
+            update_time = sysdate()
+        </set>
+        where user_id = #{userId}
+    </update>
+
+    <update id="updateUserStatus" parameterType="com.linkwechat.common.core.domain.entity.SysUser">
+        update sys_user
+        set status = #{status}
+        where user_id = #{userId}
+    </update>
+
+    <update id="updateUserAvatar" parameterType="com.linkwechat.common.core.domain.entity.SysUser">
+        update sys_user
+        set avatar = #{avatar}
+        where user_name = #{userName}
+    </update>
+
+    <update id="resetUserPwd" parameterType="com.linkwechat.common.core.domain.entity.SysUser">
+        update sys_user
+        set password = #{password}
+        where user_name = #{userName}
+    </update>
+
+    <delete id="deleteUserById" parameterType="Long">
+        delete
+        from sys_user
+        where user_id = #{userId}
+    </delete>
+
+    <delete id="deleteUserByIds" parameterType="Long">
+        update sys_user set del_flag = '2' where user_id in
+        <foreach collection="array" item="userId" open="(" separator="," close=")">
+            #{userId}
+        </foreach>
+    </delete>
+
+    <update id="batchAddOrUpdate">
+        insert into sys_user (user_id, dept_id, user_name, user_type, nick_name, email, phone_number, sex,
+                             avatar,password,status,login_ip,login_date,we_user_id,position, thumb_avatar,
+                             biz_mail, leader, telephone, ext_attr, we_user_status,qr_code, external_profile,
+                             external_position,address,open_userid,is_allocate,dimission_time,is_open_chat,
+                             create_by,create_by_id,create_time,update_by,update_by_id,update_time,remark)
+        values
+        <foreach collection="weUserList" item="weUser" index="index" separator=",">
+         ( #{weUser.userId},#{weUser.deptId},#{weUser.userName},#{weUser.userType},#{weUser.nickName},#{weUser.email},#{weUser.phoneNumber},#{weUser.sex},
+            #{weUser.avatar}, #{weUser.password}, #{weUser.status}, #{weUser.loginIp}, #{weUser.loginDate}, #{weUser.weUserId}, #{weUser.position}, #{weUser.thumbAvatar},
+            #{weUser.bizMail}, #{weUser.leader}, #{weUser.telephone}, #{weUser.extAttr}, #{weUser.weUserStatus}, #{weUser.qrCode}, #{weUser.externalProfile},
+            #{weUser.externalPosition}, #{weUser.address}, #{weUser.openUserid}, #{weUser.isAllocate}, #{weUser.dimissionTime}, #{weUser.isOpenChat},
+            #{weUser.createBy}, #{weUser.createById}, #{weUser.createTime}, #{weUser.updateBy}, #{weUser.updateById}, #{weUser.updateTime}, #{weUser.remark}
+            )
+        </foreach>
+        ON DUPLICATE KEY UPDATE
+        dept_id=IFNULL(VALUES(dept_id), sys_user.dept_id),
+        user_name=IFNULL(VALUES(user_name), sys_user.user_name),
+        user_type=IFNULL(VALUES(user_type), sys_user.user_type),
+        nick_name=IFNULL(VALUES(nick_name), sys_user.nick_name),
+        email=IFNULL(VALUES(email), sys_user.email),
+        phone_number=IFNULL(VALUES(phone_number), sys_user.phone_number),
+        sex=IFNULL(VALUES(sex), sys_user.sex),
+        avatar=IFNULL(VALUES(avatar), sys_user.avatar),
+        password=IFNULL(VALUES(password), sys_user.password),
+        status=IFNULL(VALUES(status), sys_user.status),
+        login_ip=IFNULL(VALUES(login_ip), sys_user.login_ip),
+        login_date=IFNULL(VALUES(login_date), sys_user.login_date),
+        we_user_id=IFNULL(VALUES(we_user_id), sys_user.we_user_id),
+        position=IFNULL(VALUES(position), sys_user.position),
+        thumb_avatar=IFNULL(VALUES(thumb_avatar), sys_user.thumb_avatar),
+        biz_mail=IFNULL(VALUES(biz_mail), sys_user.biz_mail),
+        leader=IFNULL(VALUES(leader), sys_user.leader),
+        telephone=IFNULL(VALUES(telephone), sys_user.telephone),
+        ext_attr=IFNULL(VALUES(ext_attr), sys_user.ext_attr),
+        we_user_status=IFNULL(VALUES(we_user_status), sys_user.we_user_status),
+        qr_code=IFNULL(VALUES(qr_code), sys_user.qr_code),
+        external_profile=IFNULL(VALUES(external_profile), sys_user.external_profile),
+        external_position=IFNULL(VALUES(external_position), sys_user.external_position),
+        address=IFNULL(VALUES(address), sys_user.address),
+        open_userid=IFNULL(VALUES(open_userid), sys_user.open_userid),
+        is_allocate=IFNULL(VALUES(is_allocate), sys_user.is_allocate),
+        dimission_time=IFNULL(VALUES(dimission_time), sys_user.dimission_time),
+        is_open_chat=IFNULL(VALUES(is_open_chat), sys_user.is_open_chat),
+        update_by=IFNULL(VALUES(update_by), sys_user.update_by),
+        update_by_id=IFNULL(VALUES(update_by_id), sys_user.update_by_id),
+        update_time=IFNULL(VALUES(update_time), sys_user.update_time),
+        remark=IFNULL(VALUES(remark), sys_user.remark);
+
+    </update>
+
+    <select id="findAllSysUser" resultType="com.linkwechat.common.core.domain.entity.SysUser">
+        SELECT
+        su.*,
+        (SELECT GROUP_CONCAT(d.dept_name) FROM  sys_dept d WHERE sud.dept_id = d.dept_id) as dept_name
+        FROM
+        sys_user su
+        LEFT JOIN sys_user_dept sud on su.user_id=sud.user_id
+        WHERE
+        su.del_flag = 0
+        <if test="weUserIds !='' and weUserIds !=null">
+           and su.we_user_id in
+            <foreach collection="weUserIds.split(',')" item="item" index="index" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        <if test="positions !='' and positions !=null">
+            and su.position in
+            <foreach collection="positions.split(',')" item="item" index="index" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+
+        <if test="deptIds != null and deptIds != ''">
+            and sud.dept_id in
+            <foreach collection="deptIds.split(',')" item="item" index="index" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+
+    </select>
+    <select id="selectSysUserDeptList" resultType="com.linkwechat.common.core.domain.entity.SysUserDept">
+        SELECT
+            u.we_user_id,
+            IFNULL( d.dept_id, u.dept_id ) dept_id,
+            IFNULL( d.dept_name, e.dept_name ) dept_name,
+            IFNULL( d.dept_en_name, e.dept_en_name ) dept_en_name
+        FROM
+            sys_user u
+            LEFT JOIN sys_user_dept ud ON u.we_user_id = ud.we_user_id
+            LEFT JOIN sys_dept d ON ud.dept_id = d.dept_id
+            LEFT JOIN sys_dept e ON u.dept_id = e.dept_id
+        WHERE
+            u.we_user_id=#{weUserId}
+    </select>
+</mapper>

+ 34 - 0
linkwe-auth/bin/src/main/resources/mapper/system/SysUserPostMapper.xml

@@ -0,0 +1,34 @@
+<?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.linkwechat.web.mapper.SysUserPostMapper">
+
+	<resultMap type="SysUserPost" id="SysUserPostResult">
+		<result property="userId"     column="user_id"      />
+		<result property="postId"     column="post_id"      />
+	</resultMap>
+
+	<delete id="deleteUserPostByUserId" parameterType="Long">
+		delete from sys_user_post where user_id=#{userId}
+	</delete>
+	
+	<select id="countUserPostById" resultType="Integer">
+	    select count(1) from sys_user_post where post_id=#{postId}  
+	</select>
+	
+	<delete id="deleteUserPost" parameterType="Long">
+ 		delete from sys_user_post where user_id in
+ 		<foreach collection="array" item="userId" open="(" separator="," close=")">
+ 			#{userId}
+        </foreach> 
+ 	</delete>
+	
+	<insert id="batchUserPost">
+		insert into sys_user_post(user_id, post_id) values
+		<foreach item="item" index="index" collection="list" separator=",">
+			(#{item.userId},#{item.postId})
+		</foreach>
+	</insert>
+	
+</mapper> 

+ 87 - 0
linkwe-auth/bin/src/main/resources/mapper/system/SysUserRoleMapper.xml

@@ -0,0 +1,87 @@
+<?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.linkwechat.web.mapper.SysUserRoleMapper">
+
+    <resultMap type="SysUserRole" id="SysUserRoleResult">
+        <result property="userId" column="user_id"/>
+        <result property="roleId" column="role_id"/>
+    </resultMap>
+
+    <resultMap type="RoleUserVo" id="SysUserRoleVoResult">
+        <result property="userId" column="user_id"/>
+        <result property="userName" column="user_name"/>
+        <result property="nickName" column="nick_name"/>
+        <result property="weUserId" column="we_user_id"/>
+        <result property="openUserid" column="open_userid"/>
+    </resultMap>
+
+    <select id="selectUserByRoleId" parameterType="Long" resultMap="SysUserRoleVoResult">
+        select u.user_id,
+               u.user_name,
+               u.nick_name,
+               u.we_user_id,
+               u.open_userid
+        from sys_user_role ur
+                 left join sys_user u on u.user_id = ur.user_id
+        where ur.role_id = #{roleId} and u.user_id is not NULL
+    </select>
+
+    <delete id="deleteUserRoleByUserId" parameterType="Long">
+        delete
+        from sys_user_role
+        where user_id = #{userId}
+    </delete>
+
+    <select id="countUserRoleByRoleId" resultType="Integer">
+        select count(1)
+        from sys_user_role
+        where role_id = #{roleId}
+    </select>
+
+    <delete id="deleteUserRole" parameterType="Long">
+        delete from sys_user_role where user_id in
+        <foreach collection="ids" item="userId" open="(" separator="," close=")">
+            #{userId}
+        </foreach>
+        <if test="roleId != null">
+          and role_id = #{roleId}
+        </if>
+    </delete>
+
+    <insert id="batchUserRole">
+        insert into sys_user_role(user_id, role_id) values
+        <foreach item="item" index="index" collection="list" separator=",">
+            (#{item.userId},#{item.roleId})
+        </foreach>
+    </insert>
+
+    <delete id="deleteUserRoleInfo" parameterType="SysUserRole">
+        delete
+        from sys_user_role
+        where user_id = #{userId}
+          and role_id = #{roleId}
+    </delete>
+
+    <delete id="deleteUserRoleInfos">
+        delete from sys_user_role where role_id=#{roleId} and user_id in
+        <foreach collection="userIds" item="userId" open="(" separator="," close=")">
+            #{userId}
+        </foreach>
+    </delete>
+
+    <delete id="deleteUserRoleByRoleId" parameterType="java.lang.Long">
+        delete
+        from sys_user_role
+        where role_id = #{roleId}
+    </delete>
+
+    <select id="findAllUserRole" resultType="com.linkwechat.web.domain.SysUserRole">
+        SELECT
+            *
+        FROM
+            sys_user_role
+    </select>
+
+</mapper> 

+ 28 - 0
linkwe-auth/bin/src/main/resources/spy.properties

@@ -0,0 +1,28 @@
+#3.2.1以上使用
+modulelist=com.baomidou.mybatisplus.extension.p6spy.MybatisPlusLogFactory,com.p6spy.engine.outage.P6OutageFactory
+#3.2.1以下使用或者不配置
+#modulelist=com.p6spy.engine.logging.P6LogFactory,com.p6spy.engine.outage.P6OutageFactory
+# 自定义日志打印
+logMessageFormat=com.baomidou.mybatisplus.extension.p6spy.P6SpyLogger
+#日志输出到控制台
+appender=com.baomidou.mybatisplus.extension.p6spy.StdoutLogger
+# 使用日志系统记录 sql
+#appender=com.p6spy.engine.spy.appender.Slf4JLogger
+# 设置 p6spy driver 代理
+deregisterdrivers=true
+# 取消JDBC URL前缀
+useprefix=true
+# 配置记录 Log 例外,可去掉的结果集有error,info,batch,debug,statement,commit,rollback,result,resultset.
+excludecategories=info,debug,result,commit,resultset
+# 日期格式
+dateformat=yyyy-MM-dd HH:mm:ss
+# 实际驱动可多个
+#driverlist=org.h2.Driver
+# 是否开启慢SQL记录
+outagedetection=true
+# 慢SQL记录标准 2 秒
+outagedetectioninterval=2
+#开启日志过滤
+filter=true
+#排序sql包含QRTZ的sql 多个逗号隔离
+exclude=QRTZ,sys_oper_log

+ 155 - 0
linkwe-chinacoal/bin/pom.xml

@@ -0,0 +1,155 @@
+<?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">
+    <parent>
+        <artifactId>linkwechat-cloud</artifactId>
+        <groupId>com.linkwechat</groupId>
+        <version>3.1.0</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>linkwe-chinacoal</artifactId>
+
+    <description>
+        中煤核心业务相关
+    </description>
+
+    <properties>
+        <java.version>1.8</java.version>
+        <maven.compiler.source>1.8</maven.compiler.source>
+        <maven.compiler.target>1.8</maven.compiler.target>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter</artifactId>
+        </dependency>
+
+        <!-- 阿里数据库连接池 -->
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>druid-spring-boot-starter</artifactId>
+        </dependency>
+
+
+        <!-- JSON工具类 -->
+        <dependency>
+            <groupId>com.fasterxml.jackson.core</groupId>
+            <artifactId>jackson-databind</artifactId>
+        </dependency>
+
+        <!-- 阿里JSON解析器 -->
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>fastjson</artifactId>
+            <version>2.0.12</version>
+        </dependency>
+        <!-- 阿里JSON解析器 -->
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>fastjson</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <!--    oracle    -->
+        <!--    mysql    -->
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>p6spy</groupId>
+            <artifactId>p6spy</artifactId>
+        </dependency>
+
+        <!-- redis 缓存操作 -->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-data-redis</artifactId>
+        </dependency>
+        <!--mybatis-plus多数据源配置-->
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>dynamic-datasource-spring-boot-starter</artifactId>
+            <version>3.4.0</version>
+        </dependency>
+
+        <!--mybatis-plus多数据源配置-->
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-boot-starter</artifactId>
+        </dependency>
+
+        <!--邮件发送-->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-mail</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.alibaba.cloud</groupId>
+            <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
+            <version>2021.1</version>
+        </dependency>
+
+        <!--校验字段是否为空依赖-->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-validation</artifactId>
+        </dependency>
+
+
+        <!-- SpringCloud Alibaba Nacos Config -->
+        <dependency>
+            <groupId>com.alibaba.cloud</groupId>
+            <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>io.springfox</groupId>
+            <artifactId>springfox-swagger-common</artifactId>
+            <version>2.9.2</version>
+            <scope>compile</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>com.linkwechat</groupId>
+            <artifactId>linkwe-service</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>cn.afterturn</groupId>
+            <artifactId>easypoi-spring-boot-starter</artifactId>
+            <version>4.4.0</version>
+        </dependency>
+    </dependencies>
+
+
+    <build>
+        <finalName>lw-chinacoal</finalName>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+                <version>2.3.3.RELEASE</version>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>repackage</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+
+        </plugins>
+    </build>
+
+
+</project>

+ 19 - 0
linkwe-chinacoal/bin/src/main/resources/banner.txt

@@ -0,0 +1,19 @@
+${AnsiColor.GREEN}
+  ,--,                              ,-.                                             ,---,                                                                    ,--,
+,--.'|     ,--,                 ,--/ /|                                           ,--.' |      ,--,                                                        ,--.'|
+|  | :   ,--.'|         ,---, ,--. :/ |          .---.              ,---,.        |  |  :    ,--.'|         ,---,                        ,---.             |  | :
+:  : '   |  |,      ,-+-. /  |:  : ' /          /. ./|            ,'  .' |        :  :  :    |  |,      ,-+-. /  |                      '   ,'\            :  : '
+|  ' |   `--'_     ,--.'|'   ||  '  /        .-'-. ' |   ,---.  ,---.'   , ,---.  :  |  |,--.`--'_     ,--.'|'   |  ,--.--.     ,---.  /   /   |  ,--.--.  |  ' |
+'  | |   ,' ,'|   |   |  ,"' |'  |  :       /___/ \: |  /     \ |   |    |/     \ |  :  '   |,' ,'|   |   |  ,"' | /       \   /     \.   ; ,. : /       \ '  | |
+|  | :   '  | |   |   | /  | ||  |   \   .-'.. '   ' . /    /  |:   :  .'/    / ' |  |   /' :'  | |   |   | /  | |.--.  .-. | /    / ''   | |: :.--.  .-. ||  | :
+'  : |__ |  | :   |   | |  | |'  : |. \ /___/ \:     '.    ' / |:   |.' .    ' /  '  :  | | ||  | :   |   | |  | | \__\/: . ..    ' / '   | .; : \__\/: . .'  : |__
+|  | '.'|'  : |__ |   | |  |/ |  | ' \ \.   \  ' .\   '   ;   /|`---'   '   ; :__ |  |  ' | :'  : |__ |   | |  |/  ," .--.; |'   ; :__|   :    | ," .--.; ||  | '.'|
+;  :    ;|  | '.'||   | |--'  '  : |--'  \   \   ' \ |'   |  / |        '   | '.'||  :  :_:,'|  | '.'||   | |--'  /  /  ,.  |'   | '.'|\   \  / /  /  ,.  |;  :    ;
+|  ,   / ;  :    ;|   |/      ;  |,'      \   \  |--" |   :    |        |   :    :|  | ,'    ;  :    ;|   |/     ;  :   .'   \   :    : `----' ;  :   .'   \  ,   /
+ ---`-'  |  ,   / '---'       '--'         \   \ |     \   \  /          \   \  / `--''      |  ,   / '---'      |  ,     .-./\   \  /         |  ,     .-./---`-'
+          ---`-'                            '---"       `----'            `----'              ---`-'              `--`---'     `----'           `--`---'
+
+
+${AnsiColor.WHITE}
+
+Spring Application Name: ${spring.application.name}

+ 203 - 0
linkwe-chinacoal/bin/src/main/resources/logback-spring.xml

@@ -0,0 +1,203 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration scan="true" scanPeriod="60 seconds" debug="false">
+    <!-- 日志输出格式 -->
+    <property name="log.pattern" value="%d{yyyy-MM-dd HH:mm:ss.SSS,CTT} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
+
+    <!--  邮件 -->
+    <!-- SMTP server的地址,必需指定。如网易的SMTP服务器地址是: smtp.163.com -->
+    <property name="smtpHost" value="smtp.163.com"/><!--填入要发送邮件的smtp服务器地址-->
+    <!-- SMTP server的端口地址。默认值:25 -->
+    <property name="smtpPort" value="25"/>
+    <!-- 发送邮件账号,默认为null -->
+    <property name="username" value="*"/><!--发件人账号-->
+    <!-- 发送邮件密码,默认为null -->
+    <property name="password" value="*"/><!--发件人密码-->
+    <!-- 如果设置为true,appender将会使用SSL连接到日志服务器。默认值:false -->
+    <property name="SSL" value="true"/>
+    <!-- 指定发送到那个邮箱,可设置多个<to>属性,指定多个目的邮箱 -->
+    <property name="email_to" value="*"/>
+    <!--收件人账号多个可以逗号隔开-->
+    <!-- 指定发件人名称。如果设置成“&lt;ADMIN&gt; ”,则邮件发件人将会是“<ADMIN> ” -->
+    <property name="email_from" value="1" />
+    <!-- 指定emial的标题,它需要满足PatternLayout中的格式要求。如果设置成“Log: %logger - %msg ”,就案例来讲,则发送邮件时,标题为“【Error】: com.foo.Bar - Hello World ”。 默认值:"%logger{20} - %m". -->
+    <property name="email_subject" value="【linkwechat-chinacoal】【Error】: %logger" />
+
+
+    <property name="app_name" value="linkwe-chinacoal"/>
+    <!-- 日志根目录-->
+    <springProperty scope="context" name="log.path" source="logging.path"
+                    defaultValue="./logs/linkwe-chinacoal"/>
+
+    <!-- 控制台输出 -->
+    <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
+        <encoder>
+            <pattern>${log.pattern}</pattern>
+        </encoder>
+    </appender>
+
+    <!-- 系统日志输出 -->
+    <!-- 循环文件输出(基于时间戳的分文件,是实际项目中用途最广的一种情况) -->
+    <appender name="file_debug" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <file>${log.path}/debug/${app_name}.debug.log</file>
+        <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+            <!-- rollover daily -->
+            <fileNamePattern>${log.path}/debug/${app_name}_%d{yyyy-MM-dd}.debug.%i.log</fileNamePattern>
+            <!-- each file should be at most 100MB, keep 60 days worth of history, but at most 20GB -->
+            <maxFileSize>50MB</maxFileSize>
+            <maxHistory>30</maxHistory>
+            <totalSizeCap>10GB</totalSizeCap>
+        </rollingPolicy>
+        <encoder>
+            <pattern>${log.pattern}</pattern>
+        </encoder>
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <level>DEBUG</level>
+            <onMatch>ACCEPT</onMatch>
+            <onMismatch>DENY</onMismatch>
+        </filter>
+    </appender>
+    <!-- 异步输出 -->
+    <appender name="arollingfile_debug" class="ch.qos.logback.classic.AsyncAppender">
+        <!-- 不丢失日志.默认的,如果队列的80%已满,则会丢弃TRACT、DEBUG、INFO级别的日志 -->
+        <discardingThreshold>0</discardingThreshold>
+        <!-- 更改默认的队列的深度,该值会影响性能.默认值为256 -->
+        <queueSize>1</queueSize>
+        <!-- 添加附加的appender,最多只能添加一个 -->
+        <appender-ref ref="file_debug"/>
+    </appender>
+
+    <!-- 循环文件输出(基于时间戳的分文件,是实际项目中用途最广的一种情况) -->
+    <appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <file>${log.path}/info/${app_name}.info.log</file>
+        <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+            <!-- rollover daily -->
+            <fileNamePattern>${log.path}/info/${app_name}_%d{yyyy-MM-dd}.info.%i.log</fileNamePattern>
+            <!-- each file should be at most 100MB, keep 60 days worth of history, but at most 20GB -->
+            <maxFileSize>50MB</maxFileSize>
+            <maxHistory>30</maxHistory>
+            <totalSizeCap>10GB</totalSizeCap>
+        </rollingPolicy>
+        <encoder>
+            <pattern>${log.pattern}</pattern>
+        </encoder>
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <level>INFO</level>
+            <onMatch>ACCEPT</onMatch>
+            <onMismatch>DENY</onMismatch>
+        </filter>
+    </appender>
+    <!-- 异步输出 -->
+    <appender name="arollingfile_info" class="ch.qos.logback.classic.AsyncAppender">
+        <!-- 不丢失日志.默认的,如果队列的80%已满,则会丢弃TRACT、DEBUG、INFO级别的日志 -->
+        <discardingThreshold>0</discardingThreshold>
+        <!-- 更改默认的队列的深度,该值会影响性能.默认值为256 -->
+        <queueSize>1</queueSize>
+        <!-- 添加附加的appender,最多只能添加一个 -->
+        <appender-ref ref="file_info"/>
+    </appender>
+
+    <!-- 循环文件输出(基于时间戳的分文件,是实际项目中用途最广的一种情况) -->
+    <appender name="file_warn" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <file>${log.path}/warn/${app_name}.warn.log</file>
+        <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+            <!-- rollover daily -->
+            <fileNamePattern>${log.path}/warn/${app_name}_%d{yyyy-MM-dd}.warn.%i.log</fileNamePattern>
+            <!-- each file should be at most 100MB, keep 60 days worth of history, but at most 20GB -->
+            <maxFileSize>50MB</maxFileSize>
+            <maxHistory>30</maxHistory>
+            <totalSizeCap>10GB</totalSizeCap>
+        </rollingPolicy>
+        <encoder>
+            <pattern>${log.pattern}</pattern>
+        </encoder>
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <level>WARN</level>
+            <onMatch>ACCEPT</onMatch>
+            <onMismatch>DENY</onMismatch>
+        </filter>
+    </appender>
+    <!-- 异步输出 -->
+    <appender name="arollingfile_warn" class="ch.qos.logback.classic.AsyncAppender">
+        <!-- 不丢失日志.默认的,如果队列的80%已满,则会丢弃TRACT、DEBUG、INFO级别的日志 -->
+        <discardingThreshold>0</discardingThreshold>
+        <!-- 更改默认的队列的深度,该值会影响性能.默认值为256 -->
+        <queueSize>1</queueSize>
+        <!-- 添加附加的appender,最多只能添加一个 -->
+        <appender-ref ref="file_warn"/>
+    </appender>
+
+    <!-- 循环文件输出(基于时间戳的分文件,是实际项目中用途最广的一种情况) -->
+    <appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <file>${log.path}/error/${app_name}.error.log</file>
+        <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+            <!-- rollover daily -->
+            <fileNamePattern>${log.path}/error/${app_name}_%d{yyyy-MM-dd}.error.%i.log</fileNamePattern>
+            <!-- each file should be at most 100MB, keep 60 days worth of history, but at most 20GB -->
+            <maxFileSize>50MB</maxFileSize>
+            <maxHistory>30</maxHistory>
+            <totalSizeCap>10GB</totalSizeCap>
+        </rollingPolicy>
+        <encoder>
+            <pattern>${log.pattern}</pattern>
+        </encoder>
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <level>ERROR</level>
+            <onMatch>ACCEPT</onMatch>
+            <onMismatch>DENY</onMismatch>
+        </filter>
+    </appender>
+    <!-- 异步输出 -->
+    <appender name="arollingfile_error" class="ch.qos.logback.classic.AsyncAppender">
+        <!-- 不丢失日志.默认的,如果队列的80%已满,则会丢弃TRACT、DEBUG、INFO级别的日志 -->
+        <discardingThreshold>0</discardingThreshold>
+        <!-- 更改默认的队列的深度,该值会影响性能.默认值为256 -->
+        <queueSize>1</queueSize>
+        <!-- 添加附加的appender,最多只能添加一个 -->
+        <appender-ref ref="file_error"/>
+    </appender>
+
+    <!-- ERROR邮件发送 -->
+    <appender name="EMAIL" class="ch.qos.logback.classic.net.SMTPAppender">
+        <smtpHost>${smtpHost}</smtpHost>
+        <smtpPort>${smtpPort}</smtpPort>
+        <username>${username}</username>
+        <password>${password}</password>
+        <!-- <asynchronousSending>true</asynchronousSending>-->
+        <SSL>${SSL}</SSL>
+        <!--<STARTTLS>true</STARTTLS>-->
+        <to>${email_to}</to>
+        <from>${email_from}</from>
+        <subject>${email_subject}</subject>
+        <!-- html格式-->
+        <layout class="ch.qos.logback.classic.html.HTMLLayout">
+            <Pattern>%date%level%thread%logger{0}%line%message</Pattern>
+        </layout>
+        <!-- 这里采用等级过滤器 指定等级相符才发送 -->
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <level>ERROR</level>
+            <onMatch>ACCEPT</onMatch>
+            <onMismatch>DENY</onMismatch>
+        </filter>
+        <cyclicBufferTracker class="ch.qos.logback.core.spi.CyclicBufferTracker">
+            <!-- 每个电子邮件只发送一个日志条目 -->
+            <bufferSize>1</bufferSize>
+        </cyclicBufferTracker>
+    </appender>
+
+
+    <!-- 系统模块日志级别控制  -->
+    <logger name="cn.linkwechat" level="info" />
+    <!-- Spring日志级别控制  -->
+    <logger name="org.springframework" level="warn" />
+
+    <!--系统操作日志-->
+    <root level="info">
+        <appender-ref ref="console" />
+        <appender-ref ref="arollingfile_debug" />
+        <appender-ref ref="arollingfile_info" />
+        <appender-ref ref="arollingfile_warn" />
+        <appender-ref ref="arollingfile_error" />
+        <!-- <appender-ref ref="alarm_error" />-->
+        <appender-ref ref="EMAIL" />
+    </root>
+</configuration>

+ 14 - 0
linkwe-chinacoal/bin/src/main/resources/mapper/modules/bdshdb/customer/EquityCouponMapper.xml

@@ -0,0 +1,14 @@
+<?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.linkwechat.coal.modules.bdshdb.equity.mapper.EquityCouponMapper">
+    <select id="getEquityCoupon" resultType="com.linkwechat.coal.modules.bdshdb.equity.entity.EquityCoupon">
+        select
+            lri.id as id,
+            lri.rights_name as rightsName
+            from local_rights_info lri
+            where
+                1=1
+                and lri.rights_status = 1
+                and classify not like '%1947826051340091394%'
+    </select>
+</mapper>

+ 28 - 0
linkwe-chinacoal/bin/src/main/resources/mapper/modules/bdshdb/customer/LocalAppUserMapper.xml

@@ -0,0 +1,28 @@
+<?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.linkwechat.coal.modules.bdshdb.customer.mapper.LocalAppUserMapper">
+
+    <select id="selectUserList"
+            resultType="com.linkwechat.coal.modules.bdshdb.customer.domain.vo.LocalAppUserVo">
+        SELECT
+            lau.id, lau.name, lau.phone, lau.user_type as userType,
+            lau.wechat_nickname as wechatNickname, lau.wechat_head_photo as wechatHeadPhoto,
+            loup.gender, loup.birthday_time AS birthdayTime, lau.user_status_type as userStatusType,lau.create_time as createTime,
+            lau.open_id AS openId
+        FROM local_app_user as lau
+        LEFT JOIN local_ordinary_user_process loup ON lau.ordinary_user_id = loup.ordinary_user_id
+        <where>
+            lau.user_type = 1 and lau.del_flag = 0 and lau.phone is not null and lau.phone != ''
+            <if test="localAppUserDto.startDate != null and localAppUserDto.endDate != null">
+                AND date_format(lau.create_time,'%Y-%m-%d')
+                BETWEEN
+                date_format(#{localAppUserDto.startDate},'%Y-%m-%d') AND date_format(#{localAppUserDto.endDate},'%Y-%m-%d')
+            </if>
+            <if test="localAppUserDto.isWx != null">
+                AND lau.open_id is not null
+            </if>
+        </where>
+    </select>
+</mapper>

+ 5 - 0
linkwe-chinacoal/bin/src/main/resources/mapper/modules/bdshdb/customer/ProductGroupsMapper.xml

@@ -0,0 +1,5 @@
+<?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.linkwechat.coal.modules.bdshdb.customer.mapper.ProductGroupsMapper">
+
+</mapper>

+ 35 - 0
linkwe-chinacoal/bin/src/main/resources/mapper/modules/bdshdb/customer/ProductMapper.xml

@@ -0,0 +1,35 @@
+<?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.linkwechat.coal.modules.bdshdb.customer.mapper.ProductMapper">
+
+    <select id="getYxPageProductList" resultType="com.linkwechat.coal.modules.bdshdb.customer.domain.vo.ProductYXListDTO">
+        select
+            p.product_id as productId,
+            p.product_name as productName,
+            p.category_id AS categoryId,
+            p.sold_quantity AS soldQuantity,
+            p.sold_price  as soldPrice,
+            p.product_image  as productImage,
+            p.product_status  as productStatus,
+            m.id AS merchantId,
+            m.store_name AS merchantName
+        from  local_products p
+        LEFT JOIN local_merchant_info m ON p.merchant_id = m.id
+        <where>
+            p.is_deleted = 0
+            AND (p.category_id LIKE '%1889837829066899458%'  or p.category_id LIKE '%1889837335015636994%')
+            AND p.stock_quantity > 0
+            AND p.sale_end_date <![CDATA[>=]]> CURDATE()
+            <if test="vo.productId !=null and vo.productId !=''">
+                AND p.product_id = #{vo.productId}
+            </if>
+            <if test="vo.productStatus !=null">
+                AND p.product_status = #{vo.productStatus}
+            </if>
+            <if test="vo.productName !=null and vo.productName !=''">
+                AND p.product_name like  concat('%', #{vo.productName}, '%')
+            </if>
+        </where>
+        order by p.sold_price
+    </select>
+</mapper>

+ 34 - 0
linkwe-chinacoal/bin/src/main/resources/mapper/modules/bdshdb/customer/WeActivityCopyMapper.xml

@@ -0,0 +1,34 @@
+<?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.linkwechat.coal.modules.bdshdb.equity.mapper.WeActivityCopyMapper">
+    <select id="selectFormRecordByActId" resultType="com.linkwechat.domain.activity.vo.FormRecordVo">
+        select
+            wafr.act_id as actId,
+            wafr.user_id as userId,
+            MAX(wafr.user_nick_name) as userNickName,
+            GROUP_CONCAT(CONCAT(wafr.form_name, ':', wafr.form_val) SEPARATOR ',') as userInfo
+        from
+            we_application_form_record wafr
+        where
+            1=1
+          and wafr.act_id = #{actId}
+        group by wafr.act_id, wafr.user_id
+    </select>
+
+    <select id="selectWinRecordByActId" resultType="com.linkwechat.domain.activity.vo.WinRecordVo">
+        select
+        wpr.id as id,
+        wpr.act_id as actId,
+        wpr.user_id as userId,
+        wpr.user_phone as userPhone,
+        wpr.user_name as userNickName
+        from
+        we_prize_record wpr
+        where
+        1=1
+        and wpr.act_id = #{actId}
+        <if test="prizeType != null and prizeType != ''">
+            and wpr.prize_type != 5
+        </if>
+    </select>
+</mapper>

+ 66 - 0
linkwe-chinacoal/bin/src/main/resources/mapper/modules/bdshdb/customer/WeAssistanceUserRecordMapper.xml

@@ -0,0 +1,66 @@
+<?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.linkwechat.coal.modules.bdshdb.redenvelope.mapper.WeAssistanceUserRecordMapper">
+    <select id="listAssistanceRecord" resultType="com.linkwechat.coal.modules.bdshdb.redenvelope.entity.vo.AssistanceRecordVo">
+        select
+            waur.id as id,
+            waur.act_id as actId,
+            waur.user_id as userId,
+            wrea.user_nick_name as userNickName,
+            wrea.user_phone as userPhone,
+            wrea.money as money,
+            waur.assistance_user_id as helpUserId,
+            waur.assistance_user_nick_name as helpUserNickName,
+            waur.assistance_user_phone as helpUserPhone
+        from
+            we_assistance_user_record waur
+        left join
+            we_red_envelope_assistance wrea on wrea.user_id = waur.user_id
+        where
+            1=1
+        <if test="userInfo != null and userInfo != ''">
+            and (wrea.user_nick_name like concat('%',#{userInfo},'%')
+            or wrea.user_phone like concat('%',#{userInfo},'%'))
+        </if>
+        <if test="actId != null and actId != ''">
+            and waur.act_id = #{actId}
+        </if>
+    </select>
+
+    <select id="listWinningRecord" resultType="com.linkwechat.coal.modules.bdshdb.redenvelope.entity.vo.WinningRecordVo">
+        select
+        wpr.id as id,
+        wpr.act_id as actId,
+        wpr.user_id as userId,
+        wpr.user_name as userNickName,
+        wpr.user_phone as userPhone
+        from
+        we_prize_record wpr
+        where
+        1=1
+        <if test="actId != null and actId != ''">
+            and wpr.act_id = #{actId}
+        </if>
+    </select>
+
+    <select id="listFormRecord" resultType="com.linkwechat.coal.modules.bdshdb.redenvelope.entity.vo.FormRecordVo">
+        select
+        wafr.act_id as actId,
+        wafr.user_id as userId,
+        MAX(wafr.user_nick_name) as userNickName,
+        GROUP_CONCAT(CONCAT(wafr.form_name, ':', wafr.form_val) SEPARATOR ',') as userInfo
+        from
+        we_application_form_record wafr
+        where
+        1=1
+        <if test="actId != null and actId != ''">
+            and wafr.act_id = #{actId}
+        </if>
+        <if test="userInfo != null and userInfo != ''">
+            and (wafr.user_nick_name like concat('%',#{userInfo},'%')
+            or wafr.user_phone like concat('%',#{userInfo},'%'))
+        </if>
+        group by wafr.act_id, wafr.user_id
+    </select>
+
+</mapper>

+ 22 - 0
linkwe-chinacoal/bin/src/main/resources/mapper/modules/jzgdb/customer/SysUserJzgMapper.xml

@@ -0,0 +1,22 @@
+<?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.linkwechat.coal.modules.jzgdb.customer.mapper.SysUserJzgMapper">
+
+    <select id="selectUserList" resultType="com.linkwechat.coal.modules.jzgdb.customer.domain.vo.SysUserJzgVo">
+        SELECT
+        su.id, su.name, su.mobile,
+        suif.sex, suif.birthday, su.create_time as createTime
+        FROM sys_user as su
+        LEFT JOIN sys_user_info suif on suif.id =su.id
+        <where>
+            su.type = 0 and su.status != 0
+            <if test="sysUserDto.startDate != null and sysUserDto.endDate != null">
+                AND date_format(su.create_time,'%Y-%m-%d')
+                BETWEEN
+                date_format(#{sysUserDto.startDate},'%Y-%m-%d') AND date_format(#{sysUserDto.endDate},'%Y-%m-%d')
+            </if>
+        </where>
+    </select>
+</mapper>

+ 53 - 0
linkwe-chinacoal/bin/src/main/resources/mapper/modules/ltycaasdb/ucc/LtUccRmsRecorderlogMapper.xml

@@ -0,0 +1,53 @@
+<?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.linkwechat.coal.modules.ltycaasdb.ucc.mapper.LtUccRmsRecorderlogMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.linkwechat.coal.modules.ltycaasdb.ucc.entity.LtUccRmsRecorderlog">
+        <id column="ID" property="id" />
+        <result column="create_date" property="createDate" />
+        <result column="create_user" property="createUser" />
+        <result column="update_date" property="updateDate" />
+        <result column="update_user" property="updateUser" />
+        <result column="valid_flag" property="validFlag" />
+        <result column="tenant_code" property="tenantCode" />
+        <result column="agent_no" property="agentNo" />
+        <result column="ani" property="ani" />
+        <result column="calldirect" property="calldirect" />
+        <result column="cpid" property="cpid" />
+        <result column="dnis" property="dnis" />
+        <result column="endtime" property="endtime" />
+        <result column="ext" property="ext" />
+        <result column="filename" property="filename" />
+        <result column="organ_name" property="organName" />
+        <result column="organ_no" property="organNo" />
+        <result column="starttime" property="starttime" />
+        <result column="status" property="status" />
+        <result column="hangup_direction" property="hangupDirection" />
+        <result column="ring_time" property="ringTime" />
+        <result column="hangup_cause" property="hangupCause" />
+        <result column="ring_start_time" property="ringStartTime" />
+        <result column="ring_end_time" property="ringEndTime" />
+        <result column="call_start_time" property="callStartTime" />
+        <result column="active_time" property="activeTime" />
+        <result column="hangup_time" property="hangupTime" />
+        <result column="queue_start_time" property="queueStartTime" />
+        <result column="queue_end_time" property="queueEndTime" />
+        <result column="record_text" property="recordText" />
+        <result column="isPase_text" property="ispaseText" />
+        <result column="org_id" property="orgId" />
+        <result column="user_id" property="userId" />
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="Base_Column_List">
+        ID, create_date, create_user, update_date, update_user, valid_flag, tenant_code, agent_no, ani, calldirect, cpid, dnis, endtime, ext, filename, organ_name, organ_no, starttime, status, hangup_direction, ring_time, hangup_cause, ring_start_time, ring_end_time, call_start_time, active_time, hangup_time, queue_start_time, queue_end_time, record_text, isPase_text, org_id, user_id
+    </sql>
+    <select id="select" resultMap="BaseResultMap">
+        select <include refid="Base_Column_List"/>
+        from ucc_rms_recorderlog a
+        where a.starttime IS not NULL
+        and date_format(a.starttime,'%Y-%m-%d') >= date_format(#{calldate, jdbcType=TIMESTAMP},'%Y-%m-%d')
+    </select>
+
+</mapper>

+ 141 - 0
linkwe-chinacoal/bin/src/main/resources/mapper/modules/qywx/system/SysDeptMapper.xml

@@ -0,0 +1,141 @@
+<?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.linkwechat.coal.modules.qywx.system.mapper.SysDeptMapper">
+
+	<resultMap type="com.linkwechat.common.core.domain.entity.SysDept" id="SysDeptResult">
+		<id     property="deptId"     column="dept_id"     />
+		<result property="parentId"   column="parent_id"   />
+		<result property="ancestors"  column="ancestors"   />
+		<result property="deptName"   column="dept_name"   />
+		<result property="deptEnName"   column="dept_en_name"   />
+		<result property="orderNum"   column="order_num"   />
+		<result property="leader"     column="leader"      />
+		<result property="phone"      column="phone"       />
+		<result property="email"      column="email"       />
+		<result property="status"     column="status"      />
+		<result property="delFlag"    column="del_flag"    />
+		<result property="parentName" column="parent_name" />
+		<result property="createBy"   column="create_by"   />
+		<result property="createTime" column="create_time" />
+		<result property="updateBy"   column="update_by"   />
+		<result property="updateTime" column="update_time" />
+	</resultMap>
+
+	<sql id="Base_Column_List">
+		d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.dept_en_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time
+	</sql>
+	<sql id="selectDeptVo">
+        select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.dept_en_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time
+        from sys_dept d
+    </sql>
+
+	<select id="selectDeptList" parameterType="com.linkwechat.common.core.domain.entity.SysDept" resultMap="SysDeptResult">
+        <include refid="selectDeptVo"/>
+        where d.del_flag = '0'
+        <if test="parentId != null and parentId != 0">
+			AND parent_id = #{parentId}
+		</if>
+		<if test="deptName != null and deptName != ''">
+			AND dept_name like concat('%', #{deptName}, '%')
+		</if>
+		<if test="status != null and status != ''">
+			AND status = #{status}
+		</if>
+		order by d.parent_id, d.order_num
+    </select>
+	<select id="select3DeptList" resultType="com.linkwechat.common.core.domain.entity.SysDept">
+		<include refid="selectDeptVo"/>
+		where d.del_flag = '0' /*and
+		(d.ancestors REGEXP  '^[0-9]+,[0-9]+,[0-9]+,[0-9]+$'
+			or d.ancestors REGEXP  '^[0-9]+,[0-9]+,[0-9]+$'
+			or d.parent_id='1' )*/
+		<if test="parentId != null and parentId != 0">
+			AND parent_id = #{parentId}
+		</if>
+		<if test="deptName != null and deptName != ''">
+			AND dept_name like concat('%', #{deptName}, '%')
+		</if>
+		<if test="status != null and status != ''">
+			AND status = #{status}
+		</if>
+		order by d.parent_id, d.order_num
+	</select>
+	<select id="selectByDeptIds" resultType="com.linkwechat.common.core.domain.entity.SysDept">
+		<include refid="selectDeptVo"/>
+		where d.del_flag = '0'
+		and d.dept_id in
+		<foreach collection="deptIds" open="(" item="item" index="index" separator="," close=")">
+			#{item}
+		</foreach>
+	</select>
+	<select id="selectDeptListAllChildren" resultType="com.linkwechat.common.core.domain.entity.SysDept">
+		select * from (SELECT
+		d.dept_id, d.parent_id, d.ancestors,
+		case
+		when d.ancestors like '0,1,4%' then concat(d.dept_name,'(公司总部)')
+		when d.ancestors like '0,1,3007%' then concat(d.dept_name,'(个人代理)')
+		when d.ancestors like '0,1,3026%' then concat(d.dept_name,'(业务员)')
+		else d.dept_name
+		end as dept_name,
+		d.dept_en_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time
+		FROM sys_dept d
+		where status = 0 and del_flag = '0'
+		and dept_id =#{deptId}
+		union
+		select
+		<include refid="Base_Column_List"/>
+		from sys_dept d
+		where status = 0 and del_flag = '0'
+		and (ancestors like concat('%,',#{deptId},',%') or ancestors like concat('%,', #{deptId}))
+		) aa
+	</select>
+	<select id="selectDeptListGetAllChildren" resultType="com.linkwechat.common.core.domain.entity.SysDept">
+		select * from (SELECT
+		d.dept_id, d.parent_id, d.ancestors,
+		case
+		when d.ancestors like '0,1,4%' then concat(d.dept_name,'(公司总部)')
+		when d.ancestors like '0,1,2973%' then concat(d.dept_name,'(离职人员)')
+		when d.ancestors like '0,1,3007%' then concat(d.dept_name,'(个人代理)')
+		when d.ancestors like '0,1,3026%' then concat(d.dept_name,'(业务员)')
+		when d.ancestors like '0,1,3088%' then concat(d.dept_name,'(IT)')
+		when d.ancestors like '0,1,3092%' then concat(d.dept_name,'(IT支持)')
+		when d.ancestors like '0,1,3104%' then concat(d.dept_name,'(专业代理)')
+		else d.dept_name
+		end as dept_name,
+		d.dept_en_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time
+		FROM sys_dept d
+		where status = 0 and del_flag = '0'
+		and dept_id  =#{dept}
+		union
+		select
+		<include refid="Base_Column_List"/>
+		from sys_dept d
+		where status = 0 and del_flag = '0'
+		and (ancestors like concat('%,',#{dept},',%') or ancestors like concat('%,', #{dept}))
+		) aa
+	</select>
+	<select id="selectByParentId" resultType="com.linkwechat.common.core.domain.entity.SysDept">
+		SELECT <include refid="Base_Column_List"/> from sys_dept a where a.parent_id=#{deptId}
+		and status = 0 and del_flag = '0'
+	</select>
+
+	<select id="selectParentDeptId" resultType="java.lang.String">
+		SELECT a.parent_id from sys_dept a
+		where a.dept_id in
+		<foreach collection="deptIds" open="(" item="item" index="index" separator="," close=")">
+			#{item}
+		</foreach>
+		and a.del_flag = '0'
+    </select>
+	<select id="selectByDeptId" resultType="java.lang.String">
+		select aaa.map_type from sys_dept_map aaa where aaa.dept_id = #{deptId}
+
+	</select>
+    <select id="selectByDeptIdGetDept" resultType="com.linkwechat.common.core.domain.entity.SysDept">
+		SELECT <include refid="Base_Column_List"/>
+		from sys_dept d
+		where d.dept_id =#{deptId}
+	</select>
+</mapper>

+ 532 - 0
linkwe-chinacoal/bin/src/main/resources/mapper/modules/qywx/system/SysUserMapper.xml

@@ -0,0 +1,532 @@
+<?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.linkwechat.coal.modules.qywx.system.mapper.SysUserMapper">
+
+    <resultMap id="userDeptResult" type="com.linkwechat.coal.modules.qywx.system.domain.vo.UserVo">
+        <id property="userId" column="user_id"/>
+        <result property="weUserId" column="we_user_id"/>
+        <result property="scopeDept" column="scopeDept"/>
+        <result property="dataScope" column="data_scope"/>
+        <result property="userName" column="user_name"/>
+        <result property="position" column="position"/>
+        <result property="phoneNumber" column="phone_number"/>
+        <result property="nickName" column="nick_name"/>
+        <result property="openUserid" column="open_userid"/>
+        <collection property="userDepts" ofType="com.linkwechat.common.core.domain.entity.SysUserDept">
+            <id property="deptId" column="dept_id"/>
+            <result property="deptName" column="dept_name"/>
+            <result property="deptEnName" column="dept_en_name"/>
+        </collection>
+    </resultMap>
+
+    <sql id="Base_Column_List">
+       user_id,
+       dept_id,
+       user_name,
+       user_type,
+       nick_name,
+       email,
+       phone_number,
+       sex,
+       avatar,
+       password,
+       status,
+       del_flag,
+       login_ip,
+       login_date,
+       create_by,
+       create_time,
+       update_by,
+       update_time,
+       remark,
+       we_user_id,
+       position,
+       thumb_avatar,
+       biz_mail,
+       leader,
+       telephone,
+       ext_attr,
+       we_user_status,
+       qr_code,
+       external_profile,
+       external_position,
+       address,
+       open_userid
+    </sql>
+    <select id="selectUserDeptList" resultMap="userDeptResult">
+        select
+        u.we_user_id,
+        ifnull(u.data_scope,5) as data_scope,
+        (SELECT GROUP_CONCAT(d.dept_name) FROM sys_user_manage_scop sums
+        LEFT JOIN sys_dept d ON d.dept_id=sums.dept_id
+        WHERE sums.user_id=u.user_id ) as scopeDept,
+        u.user_id,
+        u.user_name,
+        u.position,
+        u.phone_number,
+        u.nick_name,
+        u.open_userid,
+        IFNULL(d.dept_id,u.dept_id) dept_id,
+        IFNULL(d.dept_name, e.dept_name) dept_name,
+        IFNULL(d.dept_en_name, e.dept_en_name) dept_en_name
+        from sys_user u
+        left join sys_user_dept ud on u.we_user_id = ud.we_user_id
+        left join sys_dept d on ud.dept_id = d.dept_id
+        LEFT JOIN sys_dept e ON u.dept_id = e.dept_id
+        left join sys_user_role sur on sur.user_id=u.user_id
+        where u.del_flag = 0 and u.is_user_leave=0
+        <if test="sysUser.userName != null and sysUser.userName != ''">
+            AND u.user_name like concat('%', #{sysUser.userName}, '%')
+        </if>
+        <if test="sysUser.status != null and sysUser.status != ''">
+            AND u.status = #{sysUser.status}
+        </if>
+        <if test="sysUser.phoneNumber != null and sysUser.phoneNumber != ''">
+            AND u.phone_number like concat('%', #{sysUser.phoneNumber}, '%')
+        </if>
+        <if test="sysUser.beginTime != null and sysUser.beginTime != ''"><!-- 开始时间检索 -->
+            AND date_format(u.create_time,'%y%m%d') &gt;= date_format(#{sysUser.beginTime},'%y%m%d')
+        </if>
+        <if test="sysUser.endTime != null and sysUser.endTime != ''"><!-- 结束时间检索 -->
+            AND date_format(u.create_time,'%y%m%d') &lt;= date_format(#{sysUser.endTime},'%y%m%d')
+        </if>
+        <if test="sysUser.roleId != null ">
+            AND sur.role_id = #{sysUser.roleId}
+        </if>
+        <if test="sysUser.deptId != 1">
+            AND (ud.dept_id in (select dept_id from sys_dept where find_in_set(#{sysUser.deptId}, ancestors)
+            union
+            select #{sysUser.deptId}
+            )
+            OR
+            u.dept_id in (select dept_id from sys_dept where find_in_set(#{sysUser.deptId}, ancestors)
+            union
+            select #{sysUser.deptId}
+            )
+            )
+        </if>
+
+        ORDER BY u.we_user_id
+        <if test="pageDomain !=null">
+            <if test="pageDomain.pageNum !=null and pageDomain.pageSize !=null">
+                limit ${pageDomain.pageSize * (pageDomain.pageNum-1)}, #{pageDomain.pageSize}
+            </if>
+        </if>
+
+    </select>
+    <select id="queryByDeptId" resultType="com.linkwechat.coal.modules.qywx.system.domain.vo.UserVo">
+        select * from (
+        select
+        distinct
+        u.we_user_id,
+        u.user_id,
+        u.user_name
+        from sys_user u
+        <if test="dataScope != 1">
+            join ( select * from sys_user_dept aa
+            where aa.dept_id in(
+                            select dept_id from sys_dept where
+                            find_in_set(
+                                <if test="selectParent == 'yes'">
+                                    (
+                                    select a.parent_id from sys_dept a where a.dept_id=#{deptId}
+                                    )
+                                </if>
+                                <if test="selectParent == 'no'">
+                                    #{deptId}
+                                </if>
+                                , ancestors
+                            )
+                            UNION ALL
+                            SELECT #{deptId}
+                            <if test="deptMapId != null and deptMapId !=''">
+                                union all
+                                select aaa.map_type from sys_dept_map aaa where aaa.dept_id = #{deptMapId}
+                                union all
+                                select dept_id from sys_dept where find_in_set((select aaa.map_type from sys_dept_map aaa where aaa.dept_id = #{deptMapId}), ancestors)
+                            </if>
+                            <if test="weUserId != null and weUserId !=''">
+                                union ALL
+                                select dept_id from sys_user_dept where we_user_id = #{weUserId}
+                                union ALL
+                                SELECT dept_id FROM sys_dept WHERE find_in_set(( select dept_id from sys_user_dept where we_user_id = #{weUserId}  limit 1,1  ), ancestors )
+                                union ALL
+                                SELECT dept_id FROM sys_dept WHERE find_in_set(( select dept_id from sys_user_dept where we_user_id = #{weUserId}  limit 2,1  ), ancestors )
+                                union ALL
+                                SELECT dept_id FROM sys_dept WHERE find_in_set(( select dept_id from sys_user_dept where we_user_id = #{weUserId}  limit 3,1  ), ancestors )
+                                union ALL
+                                SELECT dept_id FROM sys_dept WHERE find_in_set(( select dept_id from sys_user_dept where we_user_id = #{weUserId}  limit 4,1  ), ancestors )
+                                union ALL
+                                SELECT dept_id FROM sys_dept WHERE find_in_set(( select dept_id from sys_user_dept where we_user_id = #{weUserId}  limit 5,1  ), ancestors )
+                            </if>
+                        )
+            ) v on u.we_user_id=v.we_user_id
+        </if>
+        where u.del_flag = 0 and u.is_user_leave=0
+        and u.user_id in(select user_id from sys_user_role where role_id in(9, 10))
+        union
+        select
+        distinct
+        u.we_user_id,
+        u.user_id,
+        u.user_name
+        from sys_user u
+        where u.del_flag = 0 and u.is_user_leave=0
+        and u.user_id in(select user_id from sys_user_role where role_id in(9, 10))
+        <if test="dataScope != 1">
+            AND u.dept_id in (
+            select dept_id from sys_dept where find_in_set(
+            <if test="selectParent == 'yes'">
+                (
+                select a.parent_id from sys_dept a where a.dept_id=#{deptId}
+                )
+            </if>
+            <if test="selectParent == 'no'">
+                #{deptId}
+            </if>
+            , ancestors
+            )
+            union
+            select #{deptId}
+            <if test="deptMapId != null and deptMapId !=''">
+                union all
+                select aaa.map_type from sys_dept_map aaa where aaa.dept_id = #{deptMapId}
+                union all
+                select dept_id from sys_dept where find_in_set((select aaa.map_type from sys_dept_map aaa where aaa.dept_id = #{deptMapId}), ancestors)
+            </if>
+            )
+        </if>
+        ) uu
+        ORDER BY uu.user_name
+    </select>
+    <select id="queryByDeptIdList" resultType="com.linkwechat.coal.modules.qywx.system.domain.vo.UserVo">
+        select * from (
+        select
+        distinct
+        u.we_user_id,
+        u.user_id,
+        u.user_name
+        from sys_user u
+        <if test="dataScope != 1">
+            <if test="deptList != null and deptList.size > 0 ">
+                join ( select * from sys_user_dept aa
+                where aa.dept_id in
+                <foreach collection="deptList" item="item" index="i" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+                ) v on u.we_user_id=v.we_user_id
+            </if>
+        </if>
+        where u.del_flag = 0 and u.is_user_leave=0
+        and u.user_id in(
+            select user_id from sys_user_role
+                           where role_id in
+                            <foreach collection="roleList" item="item" index="i" open="(" close=")" separator=",">
+                                #{item}
+                            </foreach>
+            )
+        union
+        select
+        distinct
+        u.we_user_id,
+        u.user_id,
+        u.user_name
+        from sys_user u
+        where u.del_flag = 0 and u.is_user_leave=0
+        and u.user_id in(select user_id from sys_user_role where role_id in
+                                                <foreach collection="roleList" item="item" index="i" open="(" close=")" separator=",">
+                                                    #{item}
+                                                </foreach>
+                       )
+        <if test="dataScope != 1">
+            <if test="deptList != null and deptList.size > 0 ">
+                AND u.dept_id in
+                <foreach collection="deptList" item="item" index="i" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+
+        </if>
+        ) uu
+        ORDER BY uu.user_name
+    </select>
+
+    <select id="queryByDeptIdChild" resultType="com.linkwechat.coal.modules.qywx.system.domain.vo.UserVo">
+        select * from (
+        select
+        distinct
+        u.we_user_id,
+        u.user_id,
+        u.user_name
+        from sys_user u
+        <if test="dataScope != 1">
+            join ( select * from sys_user_dept aa
+            where aa.dept_id in(
+                    select dept_id from sys_dept where find_in_set(
+                        (
+                        #{deptId}
+                        ), ancestors
+                    )
+                    UNION ALL
+                    SELECT #{deptId}
+                    <if test="deptMapId != null and deptMapId !=''">
+                        union all
+                        select aaa.map_type from sys_dept_map aaa where aaa.dept_id = #{deptMapId}
+                        union all
+                        select dept_id from sys_dept where find_in_set((select aaa.map_type from sys_dept_map aaa where aaa.dept_id = #{deptMapId}), ancestors)
+                    </if>
+                    <if test="weUserId != null and weUserId !=''">
+                        union ALL
+                        select dept_id from sys_user_dept where we_user_id = #{weUserId}
+                        union ALL
+                        SELECT dept_id FROM sys_dept WHERE find_in_set(( select dept_id from sys_user_dept where we_user_id = #{weUserId}  limit 1,1  ), ancestors )
+                        union ALL
+                        SELECT dept_id FROM sys_dept WHERE find_in_set(( select dept_id from sys_user_dept where we_user_id = #{weUserId}  limit 2,1  ), ancestors )
+                        union ALL
+                        SELECT dept_id FROM sys_dept WHERE find_in_set(( select dept_id from sys_user_dept where we_user_id = #{weUserId}  limit 3,1  ), ancestors )
+                        union ALL
+                        SELECT dept_id FROM sys_dept WHERE find_in_set(( select dept_id from sys_user_dept where we_user_id = #{weUserId}  limit 4,1  ), ancestors )
+                        union ALL
+                        SELECT dept_id FROM sys_dept WHERE find_in_set(( select dept_id from sys_user_dept where we_user_id = #{weUserId}  limit 5,1  ), ancestors )
+                    </if>
+                )
+            ) v on u.we_user_id=v.we_user_id
+        </if>
+        where u.del_flag = 0 and u.is_user_leave=0
+        and u.user_id in(select user_id from sys_user_role where role_id in(10))
+        union
+        select
+        distinct
+        u.we_user_id,
+        u.user_id,
+        u.user_name
+        from sys_user u
+        where u.del_flag = 0 and u.is_user_leave=0
+        and u.user_id in(select user_id from sys_user_role where role_id in(10))
+        <if test="dataScope != 1">
+            AND u.dept_id in (
+            select dept_id from sys_dept where find_in_set(
+                (
+                #{deptId}
+                ), ancestors
+            )
+            union
+            select #{deptId}
+            <if test="deptMapId != null and deptMapId !=''">
+                union all
+                select aaa.map_type from sys_dept_map aaa where aaa.dept_id = #{deptMapId}
+                union all
+                select dept_id from sys_dept where find_in_set((select aaa.map_type from sys_dept_map aaa where aaa.dept_id = #{deptMapId}), ancestors)
+            </if>
+            )
+        </if>
+
+        ) uu
+        ORDER BY uu.user_name
+    </select>
+
+    <select id="queryByDeptIdChildList" resultType="com.linkwechat.coal.modules.qywx.system.domain.vo.UserVo">
+        select * from (
+        select
+        distinct
+        u.we_user_id,
+        u.user_id,
+        u.user_name
+        from sys_user u
+        <if test="dataScope != 1">
+            <if test="deptList != null and deptList.size > 0 ">
+                join ( select * from sys_user_dept aa
+                where aa.dept_id in
+                <foreach collection="deptList" item="item" index="i" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+                ) v on u.we_user_id=v.we_user_id
+            </if>
+        </if>
+        where u.del_flag = 0 and u.is_user_leave=0
+        <if test="roleList != null and roleList.size > 0 ">
+            and u.user_id in(select user_id from sys_user_role where role_id in
+            <foreach collection="roleList" item="item" index="i" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+            )
+        </if>
+        union
+        select
+        distinct
+        u.we_user_id,
+        u.user_id,
+        u.user_name
+        from sys_user u
+        where u.del_flag = 0 and u.is_user_leave=0
+        <if test="roleList != null and roleList.size > 0 ">
+            and u.user_id in(select user_id from sys_user_role where role_id in
+            <foreach collection="roleList" item="item" index="i" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+            )
+        </if>
+        <if test="dataScope != 1">
+            <if test="deptList != null and deptList.size > 0 ">
+                AND u.dept_id in
+                <foreach collection="deptList" item="item" index="i" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+
+        </if>
+        ) uu
+        ORDER BY uu.user_name
+    </select>
+    <select id="queryByDeptIdGetChildList" resultType="com.linkwechat.coal.modules.qywx.system.domain.vo.UserVo">
+        select * from (
+                select
+                    distinct
+                    u.we_user_id,
+                    u.user_id,
+                    u.user_name
+                from sys_user u
+                join sys_dept bb  on u.dept_id=bb.dept_id
+                where u.del_flag = 0 and u.is_user_leave=0
+                and
+                <foreach collection="deptIds" index="i" item="item" open="(" close=")" separator=" or ">
+                    find_in_set(#{item}, bb.ancestors)
+                </foreach>
+
+            union
+                select
+                    distinct
+                    u.we_user_id,
+                    u.user_id,
+                    u.user_name
+                from sys_user u
+                where u.del_flag = 0 and u.is_user_leave=0
+                and  u.dept_id in
+                <foreach collection="deptIds" index="i" item="item" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+        ) uu
+        ORDER BY uu.user_name
+    </select>
+
+    <select id="selectDeptIds" resultType="com.linkwechat.common.core.domain.entity.SysUser">
+        SELECT
+        <include refid="Base_Column_List"/>
+        FROM sys_user a WHERE a.dept_id in
+        <foreach collection="deptIds" index="index" item="item" open="(" close=")" separator=",">
+            #{item.deptId}
+        </foreach>
+    </select>
+    <select id="selectByUserIdGetDept" resultType="com.linkwechat.common.core.domain.entity.SysDept">
+        SELECT dept_name,dept_id
+        FROM sys_dept a
+        where a.dept_id=(select dept_id from sys_user where user_id=#{userId})
+    </select>
+    <select id="selectDeptLevel" resultType="java.lang.String">
+        SELECT ancestors
+        FROM sys_dept a
+        where a.dept_id= #{deptId}
+    </select>
+    <select id="selectOtherDept" resultType="java.lang.String">
+        SELECT dept_id from sys_user_dept where we_user_id = #{weUserId}
+    </select>
+    <select id="selectByChildDept" resultType="java.lang.String">
+        SELECT dept_id from sys_dept where 1=2
+        <foreach collection="deptList" item="item" index="i" separator=" ">
+            or find_in_set(#{item}, ancestors)
+        </foreach>
+    </select>
+    <select id="selectAllDept" resultType="java.lang.String">
+        SELECT dept_id from sys_dept
+    </select>
+    <select id="selectUserMap" resultType="java.lang.String">
+        SELECT map_type from sys_dept_map where dept_id = #{deptId}
+    </select>
+    <select id="selectParentDeptId" resultType="java.lang.String">
+        SELECT parent_id from sys_dept  where dept_id = #{deptId}
+    </select>
+
+
+    <select id="selectAllDeptId" resultType="java.lang.String">
+        select
+            b.dept_id
+        from sys_user a join sys_user_dept b on a.we_user_id = b.we_user_id
+        where a.we_user_id = #{weUserId}
+        and a.del_flag  = 0
+        and b.del_flag  = 0
+        union
+        select
+            a.dept_id
+        from sys_user a
+        where a.we_user_id = #{weUserId}
+        and a.del_flag  = 0
+    </select>
+    <select id="selectByDeptIdGetIdChildList" resultType="java.lang.String">
+        SELECT
+            a.user_id
+        FROM
+            sys_user a
+        JOIN sys_dept b ON a.dept_id = b.dept_id
+        WHERE
+            (find_in_set( #{deptId}, b.ancestors )
+                OR b.dept_id = #{deptId})
+          AND a.del_flag = '0'
+          AND b.del_flag = '0'
+    </select>
+    <select id="selectByDeptIdGetWeUserIdChildList" resultType="java.lang.String">
+        SELECT
+            a.we_user_id
+        FROM
+            sys_user a
+                JOIN sys_dept b ON a.dept_id = b.dept_id
+        WHERE
+            (find_in_set( #{deptId}, b.ancestors )
+                OR b.dept_id = #{deptId})
+          AND a.del_flag = '0'
+          AND b.del_flag = '0'
+    </select>
+
+    <select id="selectByDeptIdGetIdNameChildList" resultType="com.linkwechat.coal.modules.xxxt.system.domain.vo.DictVo">
+        SELECT
+            a.user_id as dictcode,
+            a.user_name as dictvalue,
+            'QW_BY_DEPTID_GET_CHILD_USERID' as dicttype
+        FROM
+             sys_user a
+        JOIN sys_dept b ON a.dept_id = b.dept_id
+        JOIN sys_user_role c ON a.user_id=c.user_id
+        WHERE 1=1
+         and
+        <foreach collection="deptList" item="item" index="i" open="(" close=")" separator=" OR ">
+            find_in_set( #{item}, b.ancestors )
+            OR b.dept_id = #{item}
+        </foreach>
+          AND c.role_id in
+          <foreach collection="list" item="item" index="i" open="(" close=")" separator=",">
+              #{item}
+          </foreach>
+          AND a.del_flag = '0'
+          AND b.del_flag = '0'
+        union
+        SELECT
+        a.user_id as dictcode,
+        a.user_name as dictvalue,
+        'QW_BY_DEPTID_GET_CHILD_USERID' as dicttype
+        FROM
+        sys_user a
+        JOIN ( SELECT * FROM sys_user_dept aa
+                        WHERE aa.dept_id IN
+                        <foreach collection="deptList" item="item" index="i" open="(" close=")" separator=",">
+                            #{item}
+                        </foreach>
+        ) b ON a.we_user_id = b.we_user_id
+        JOIN sys_user_role c ON a.user_id=c.user_id
+        WHERE 1=1
+        AND c.role_id in
+        <foreach collection="list" item="item" index="i" open="(" close=")" separator=",">
+            #{item}
+        </foreach>
+        AND a.del_flag = '0'
+        AND b.del_flag = '0'
+    </select>
+</mapper>

+ 23 - 0
linkwe-chinacoal/bin/src/main/resources/mapper/modules/qywx/system/SysUserPhoneLogMapper.xml

@@ -0,0 +1,23 @@
+<?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.linkwechat.coal.modules.qywx.system.mapper.SysUserPhoneLogMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.linkwechat.coal.modules.qywx.system.domain.entity.SysUserPhoneLog">
+        <id column="id" property="id" />
+        <result column="policyno" property="policyno" />
+        <result column="applyname" property="applyname" />
+        <result column="phone" property="phone" />
+        <result column="gong_num" property="gongNum" />
+        <result column="operator" property="operator" />
+        <result column="operdate" property="operdate" />
+        <result column="call_id" property="callId" />
+        <result column="record_id" property="recordId" />
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="Base_Column_List">
+        policyno, applyname, phone, gong_num, operator, operdate, call_id, record_id, id
+    </sql>
+
+</mapper>

+ 160 - 0
linkwe-chinacoal/bin/src/main/resources/mapper/modules/qywx/system/UccRmsRecorderlogMapper.xml

@@ -0,0 +1,160 @@
+<?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.linkwechat.coal.modules.qywx.system.mapper.UccRmsRecorderlogMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.linkwechat.coal.modules.qywx.system.domain.entity.UccRmsRecorderlog">
+        <id column="ID" property="id" />
+        <result column="create_date" property="createDate" />
+        <result column="create_user" property="createUser" />
+        <result column="update_date" property="updateDate" />
+        <result column="update_user" property="updateUser" />
+        <result column="valid_flag" property="validFlag" />
+        <result column="tenant_code" property="tenantCode" />
+        <result column="agent_no" property="agentNo" />
+        <result column="ani" property="ani" />
+        <result column="calldirect" property="calldirect" />
+        <result column="cpid" property="cpid" />
+        <result column="dnis" property="dnis" />
+        <result column="endtime" property="endtime" />
+        <result column="ext" property="ext" />
+        <result column="filename" property="filename" />
+        <result column="organ_name" property="organName" />
+        <result column="organ_no" property="organNo" />
+        <result column="starttime" property="starttime" />
+        <result column="status" property="status" />
+        <result column="hangup_direction" property="hangupDirection" />
+        <result column="ring_time" property="ringTime" />
+        <result column="hangup_cause" property="hangupCause" />
+        <result column="ring_start_time" property="ringStartTime" />
+        <result column="ring_end_time" property="ringEndTime" />
+        <result column="call_start_time" property="callStartTime" />
+        <result column="active_time" property="activeTime" />
+        <result column="hangup_time" property="hangupTime" />
+        <result column="queue_start_time" property="queueStartTime" />
+        <result column="queue_end_time" property="queueEndTime" />
+        <result column="record_text" property="recordText" />
+        <result column="isPase_text" property="ispaseText" />
+        <result column="org_id" property="orgId" />
+        <result column="user_id" property="userId" />
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="Base_Column_List">
+        ID, create_date, create_user, update_date, update_user, valid_flag, tenant_code, agent_no, ani, calldirect, cpid, dnis, endtime, ext, filename, organ_name, organ_no, starttime, status, hangup_direction, ring_time, hangup_cause, ring_start_time, ring_end_time, call_start_time, active_time, hangup_time, queue_start_time, queue_end_time, record_text, isPase_text, org_id, user_id
+    </sql>
+    <update id="updateWeUserId">
+        update ucc_rms_recorderlog a
+        set
+            a.user_id = IFNULL((select b.we_user_id from sys_cx_user_map b where a.agent_no=b.cx_id),(select b.we_user_id from sys_cx_user_map b where a.agent_no=b.cx_id2))
+        where
+            date_format(a.starttime,'%Y-%m-%d') >= date_format(#{calldate, jdbcType=TIMESTAMP},'%Y-%m-%d')
+        and  (a.user_id='' or a.user_id is null)
+    </update>
+    <select id="select" resultType="com.linkwechat.coal.modules.qywx.system.domain.vo.UccRmsRecorderlogVo">
+        SELECT aaa.* FROM
+        (SELECT
+        (select t1.dept_name from sys_dept t1 where t1.dept_id=(select t.dept_id from sys_user t where t.we_user_id=a.user_id  and t.del_flag=0))  AS comname,
+        cpid callid,
+        a.ani,
+        a.agent_no AS agentNo,
+        CONCAT( a.user_id, '(', (select t.user_name from sys_user t where t.we_user_id=a.user_id and t.del_flag=0), ')' ) AS userName,
+        CONCAT(SUBSTR(a.dnis,1,3),'****' ,SUBSTR(a.dnis,8))dnis,
+        a.call_start_time AS callStartTime,
+        ( CASE WHEN a.`status` = 0 THEN '已接听' ELSE '未接听' END ) status,
+        a.starttime,
+        a.endtime,
+        SEC_TO_TIME(
+            CASE WHEN a.`status` = 0 THEN UNIX_TIMESTAMP( a.endtime )- UNIX_TIMESTAMP( a.starttime )
+            ELSE 0 END
+            ) calltime,
+        IF
+        (
+        a.filename = ''
+        OR a.filename IS NULL,
+        '',
+        CONCAT( 'http://10.1.71.10:9200/rms/', SUBSTR( a.filename, 7, 10 ), '/', a.filename, '.wav' )) filename
+        FROM
+        ucc_rms_recorderlog a
+        where a.user_id is not null
+        <if test="ani != null and ani !=''">
+            AND a.ani=#{ani}
+        </if>
+        <if test="userName != null and userName !=''">
+            AND (a.user_id = #{userName} or a.user_id in(select t.we_user_id from sys_user t where t.user_name like concat('%',#{userName},'%')) )
+        </if>
+        <if test="dnis != null and dnis !=''">
+            AND a.dnis = #{dnis}
+        </if>
+        <if test="status != null and status !=''">
+            AND a.status = #{status}
+        </if>
+        <if test="weUserIdList != null">
+            AND a.user_id in
+            <foreach collection="weUserIdList" index="i" item="item" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        <if test="callStartDate != null and callEndDate != null">
+            AND date_format(a.call_start_time,'%Y-%m-%d')
+            BETWEEN
+            date_format(#{callStartDate},'%Y-%m-%d') AND date_format(#{callEndDate},'%Y-%m-%d')
+        </if>
+
+        ORDER BY
+        a.call_start_time DESC
+        ) as aaa
+    </select>
+    <!--
+     SEC_TO_TIME(SUM(UNIX_TIMESTAMP( a.endtime )- UNIX_TIMESTAMP( a.starttime ))) calltime,
+     SEC_TO_TIME(ROUND(SUM(UNIX_TIMESTAMP( a.endtime )- UNIX_TIMESTAMP( a.starttime ))/ count(1))) avgtime,
+
+
+     -->
+    <select id="uccCount" resultType="com.linkwechat.coal.modules.qywx.system.domain.vo.UccCountVo">
+        SELECT tt.* from (
+            SELECT
+            CONCAT( aa.user_id, '(', (select t.user_name from sys_user t where t.we_user_id=aa.user_id and t.del_flag=0), ')' ) AS userName,
+            aa.*,
+            (select t1.dept_name from sys_dept t1 where t1.dept_id=(select t.dept_id from sys_user t where t.we_user_id=aa.user_id and t.del_flag=0))  AS comname
+        FROM
+            (SELECT
+            date_format(a.call_start_time,'%Y-%m-%d') AS callDate,
+            a.user_id,
+            count(1) callCount,
+            SEC_TO_TIME(SUM(
+                IF(a.`status` = 0,UNIX_TIMESTAMP( a.endtime )- UNIX_TIMESTAMP( a.starttime ),0)
+                )
+            ) calltime,
+            SEC_TO_TIME(IFNULL(ROUND(SUM(
+                IF(a.`status` = 0,UNIX_TIMESTAMP( a.endtime )- UNIX_TIMESTAMP( a.starttime ),0)
+                )/ sum(IF(a.`status` = 0,1,0))),0)
+            ) avgtime,
+            count(1) callOutCount,
+            sum(IF(a.`status` = 0,1,0)) callOkCount,
+            (count(1) - sum(IF(a.`status` = 0,1,0))) callErrCount,
+            round(round(sum(IF(a.`status` = 0,1,0)) /count(1),2)*100) callLv
+            FROM
+            ucc_rms_recorderlog a
+            WHERE a.user_id is not null
+            <if test="callStartDate != null and callEndDate != null">
+                AND date_format(a.call_start_time,'%Y-%m-%d')
+                BETWEEN
+                date_format(#{callStartDate},'%Y-%m-%d') AND date_format(#{callEndDate},'%Y-%m-%d')
+            </if>
+            <if test="weUserIdList != null">
+                AND a.user_id in
+                <foreach collection="weUserIdList" index="i" item="item" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            group by
+                date_format(a.call_start_time,'%Y-%m-%d'),
+                a.user_id
+            ) as aa
+            ORDER BY
+                date_format( aa.callDate, '%Y-%m-%d' ) DESC, aa.callCount DESC
+        ) as tt
+    </select>
+
+</mapper>

+ 21 - 0
linkwe-chinacoal/bin/src/main/resources/mapper/modules/xxxt/renewal/CarRenewalMapper.xml

@@ -0,0 +1,21 @@
+<?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.linkwechat.coal.modules.xxxt.renewal.mapper.CarRenewalMapper">
+
+
+    <select id="selectPolicyno" resultType="java.lang.String">
+        select
+            b.subpolicyno
+        from
+            gupolicymain@${dblink} a,
+            gupolicyrisk@${dblink} b
+        where a.policyno=b.policyno
+        and a.proposalno=#{policyno}
+    </select>
+    <select id="selectSalesInfoKey" resultType="java.lang.String">
+        select salesinfokey from guRenewalBaseComInfo@${dblink}
+        where operatorcode = #{operatorcode}
+        and netpointcode=#{netpointcode}
+        and mobilephone=#{mobilephone}
+    </select>
+</mapper>

+ 202 - 0
linkwe-chinacoal/bin/src/main/resources/mapper/modules/xxxt/renewal/MidRenewalFramenoListMapper.xml

@@ -0,0 +1,202 @@
+<?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.linkwechat.coal.modules.xxxt.renewal.mapper.MidRenewalFramenoListMapper">
+    <resultMap id="BaseMap" type="com.linkwechat.coal.modules.xxxt.renewal.domain.entity.QwRenewalFramenoList" >
+
+    </resultMap>
+    <select id="selectWhere"
+            resultType="com.linkwechat.coal.modules.xxxt.renewal.domain.vo.MidRenewalFramenoListVo">
+        SELECT
+            a.lisenseno,
+            a.frameno,
+            a.engineno,
+            a.modelcname,
+            a.comcode,
+            a.companycname,
+            a.agentcode,
+            a.agentname,
+            a.netpointcode,
+            a.netpointsname,
+            a.salesmancode,
+            a.usercname,
+            a.oldjqpolicyno,
+            a.oldjqstartdate,
+            a.oldjqenddate,
+            decode(a.oldsypolicyno,'0','', a.oldsypolicyno ) oldsypolicyno,
+            a.oldsystartdate,
+
+            NVL2(a.oldjqstartdate,'交:' || to_char(a.oldjqstartdate, 'yyyy-MM-dd'),'')
+            ||
+            NVL2(a.oldsystartdate, '&lt;br/&gt;' || '商:' || to_char(a.oldsystartdate, 'yyyy-MM-dd'), '') AS syJqStartdate,
+
+
+            NVL2(a.oldjqenddate,'交:' || to_char(a.oldjqenddate, 'yyyy-MM-dd'),'')
+                ||
+                NVL2(a.oldsyenddate, '&lt;br/&gt;' || '商:' || to_char(a.oldsyenddate, 'yyyy-MM-dd'), '') AS syJqEnddate,
+            a.oldsyenddate,
+            a.applicode,
+            a.appliname,
+            a.appcontactphone,
+            a.jqpolicyno,
+            a.sypolicyno,
+            case
+                when (a.jqpolicyno IS NOT NULL OR a.sypolicyno IS NOT NULL) then '2'
+                when (SELECT count(1) FROM QW_GENJIN_MSG b WHERE a.lisenseno = b.lisenseno AND a.frameno = b.frameno AND a.engineno = b.engineno and a.oldjqpolicyno = b.oldjqpolicyno and  a.oldsypolicyno = b.oldsypolicyno and  a.oldjqenddate = b.oldjqenddate) > 0 then
+                    (SELECT genjin_status FROM
+                        (
+                            select * from (select t.*, row_number() over(partition by t.lisenseno, t.frameno, t.engineno, t.oldjqpolicyno, t.oldsypolicyno,t.oldjqenddate order by t.update_time desc) ss from QW_GENJIN_MSG t) where ss = 1
+                        ) b
+                        WHERE a.lisenseno = b.lisenseno
+                        AND a.frameno = b.frameno
+                        AND a.engineno = b.engineno
+                        AND a.oldjqpolicyno = b.oldjqpolicyno
+                        AND a.oldsypolicyno = b.oldsypolicyno
+                        AND a.oldjqenddate = b.oldjqenddate
+                    )
+                else '0'
+            end as status,
+            a.accountcom,
+            a.oldaccountcom,
+            a.oldaccountuser,
+            a.is_audit,
+            case a.is_audit when '1' then '通过' else '不通过' end isAuditName,
+            a.law_id as lawIdName,
+            a.law_id,
+            NVl2(a.genjin_user,'1','0') as allotStatus,
+            a.old_jbr,
+            a.proposalno
+        FROM
+            QW_RENEWAL_FRAMENO_LIST a
+        <where>
+            <if test="comcode != null and comcode !=''">
+                <choose>
+                    <when test="comcode.startsWith('37')">
+                        AND a.oldaccountcom IN (
+                        select companycode from cd_gglevelcompany@dblink_statdw  where level1com=#{comcode} or level2com=#{comcode} or level3com=#{comcode}or level4com=#{comcode} or level5com=#{comcode}
+                        )
+                    </when>
+                    <otherwise>
+                        AND a.comcode IN (
+                        select companycode from cd_gglevelcompany@dblink_statdw  where level1com=#{comcode} or level2com=#{comcode} or level3com=#{comcode}or level4com=#{comcode} or level5com=#{comcode}
+                        )
+                    </otherwise>
+                </choose>
+            </if>
+            <if test="comcodeNotin != null and comcodeNotin.size()>0">
+                <foreach collection="comcodeNotin" item="item" index="i" >
+                    and a.comcode not like  #{item} || '%'
+                </foreach>
+            </if>
+            <if test="dfComcode != null and dfComcode !=''">
+                <choose>
+                    <when test="comcode.startsWith('37')">
+                        AND a.oldaccountcom IN (
+                        select comcode
+                        from SaCompany@dblink_sales
+                        where validstatus = '1'
+                        start with comcode = #{dfComcode}
+                        connect by prior comcode = uppercomcode
+                        and prior comcode != comcode
+                        )
+                    </when>
+                    <otherwise>
+                        AND a.comcode IN (
+                        select comcode
+                        from SaCompany@dblink_sales
+                        where validstatus = '1'
+                        start with comcode = #{dfComcode}
+                        connect by prior comcode = uppercomcode
+                        and prior comcode != comcode
+                        )
+                    </otherwise>
+                </choose>
+            </if>
+            <if test="yearStr != null and yearStr !=''">
+                <if test="carFlag != null and carFlag !='' and carFlag == '1'.toString()">
+                    AND   to_char(a.oldjqstartdate,'yyyy') =#{yearStr}
+                </if>
+                <if test="carFlag == null or carFlag =='' or carFlag != '1'.toString()">
+                    AND  (to_char(a.oldjqstartdate,'yyyy') =#{yearStr}
+                    OR
+                    to_char(a.oldsystartdate,'yyyy') =#{yearStr}
+                    )
+                </if>
+            </if>
+            <if test="netpointcode != null and netpointcode.length > 0">
+                AND a.netpointcode in
+                <foreach collection="netpointcode" index="item" item="item" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="agentcode != null and agentcode.length > 0">
+                AND a.agentcode in
+                <foreach collection="agentcode" index="item" item="item" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="lisenseno != null and lisenseno !=''">
+                AND a.lisenseno like #{lisenseno} ||'%'
+            </if>
+            <if test="appliname != null and appliname !=''">
+                AND a.appliname like '%'||#{appliname}||'%'
+            </if>
+            <if test="startDate != null and endDate !=null">
+                <if test="carFlag != null and carFlag !='' and carFlag == '1'.toString()">
+                    AND  trunc(A.OLDJQENDDATE) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+                </if>
+                <if test="carFlag == null or carFlag =='' or carFlag != '1'.toString()">
+                    AND (trunc(A.OLDSYENDDATE) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+                    OR
+                    trunc(A.OLDJQENDDATE) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+                    )
+                </if>
+            </if>
+            <if test="isAudit != null and isAudit !=''" >
+                <choose>
+                    <when test="isAudit == '1'.toString()">
+                        AND a.is_audit = #{isAudit}
+                    </when>
+                    <otherwise>
+                        AND (a.is_audit = #{isAudit} or a.is_audit is null)
+                    </otherwise>
+                </choose>
+            </if>
+            <if test="status != null and status !=''" >
+                <if test="status ==2">
+                    AND (a.jqpolicyno IS NOT NULL OR a.sypolicyno IS NOT NULL)
+                </if>
+                <if test="status ==1">
+                    AND EXISTS (SELECT 1 FROM (select *
+                    from (select t.*,
+                            row_number() over(partition by t.lisenseno, t.frameno,t.engineno, t.oldjqpolicyno, t.oldsypolicyno,t.oldjqenddate order by t.update_time desc) ss
+                            from QW_GENJIN_MSG t )
+                            where ss = 1
+                        ) b WHERE a.lisenseno=b.lisenseno AND a.frameno=b.frameno AND  a.engineno=b.engineno and a.oldjqpolicyno = b.oldjqpolicyno and  a.oldsypolicyno = b.oldsypolicyno and a.oldjqenddate = b.oldjqenddate AND b.GENJIN_STATUS='1')
+                    AND a.jqpolicyno IS  NULL AND  a.sypolicyno IS  NULL
+                </if>
+                <if test="status ==3">
+                    AND EXISTS (SELECT 1 FROM (select *
+                    from (select t.*,
+                    row_number() over(partition by t.lisenseno, t.frameno,t.engineno, t.oldjqpolicyno, t.oldsypolicynoorder,t.oldjqenddate by t.update_time desc) ss
+                    from QW_GENJIN_MSG t )
+                    where ss = 1
+                    ) b WHERE a.lisenseno=b.lisenseno AND a.frameno=b.frameno AND  a.engineno=b.engineno and a.oldjqpolicyno = b.oldjqpolicyno and  a.oldsypolicyno = b.oldsypolicyno and a.oldjqenddate = b.oldjqenddate AND b.GENJIN_STATUS='3')
+                    AND a.jqpolicyno IS  NULL AND  a.sypolicyno IS  NULL
+                </if>
+                <if test="status ==0">
+                    AND
+                    (NOT EXISTS (SELECT 1 FROM QW_GENJIN_MSG b WHERE a.lisenseno=b.lisenseno AND a.frameno=b.frameno AND  a.engineno=b.engineno and a.oldjqpolicyno = b.oldjqpolicyno and  a.oldsypolicyno = b.oldsypolicyno and a.oldjqenddate = b.oldjqenddate )
+                        OR
+                        EXISTS (SELECT 1 FROM (select *
+                    from (select t.*,
+                    row_number() over(partition by t.lisenseno, t.frameno,t.engineno,t.oldjqpolicyno, t.oldsypolicyno,t.oldjqenddate order by t.update_time desc) ss
+                    from QW_GENJIN_MSG t )
+                    where ss = 1
+                    ) b WHERE a.lisenseno=b.lisenseno AND a.frameno=b.frameno AND  a.engineno=b.engineno and a.oldjqpolicyno = b.oldjqpolicyno and  a.oldsypolicyno = b.oldsypolicyno  and a.oldjqenddate = b.oldjqenddate  AND b.GENJIN_STATUS='0'))
+                    AND a.jqpolicyno IS  NULL AND  a.sypolicyno IS  NULL
+                </if>
+            </if>
+        </where>
+    </select>
+
+</mapper>

+ 25 - 0
linkwe-chinacoal/bin/src/main/resources/mapper/modules/xxxt/renewal/NocarfeeMsgMapper.xml

@@ -0,0 +1,25 @@
+<?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.linkwechat.coal.modules.xxxt.renewal.mapper.NocarfeeMsgMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.linkwechat.coal.modules.xxxt.renewal.domain.entity.NocarfeeMsg">
+        <result column="POLICYNO" property="policyno" />
+        <result column="JBRCODE" property="jbrcode" />
+        <result column="PHONE" property="phone" />
+        <result column="MSG" property="msg" />
+        <result column="STATUS" property="status" />
+        <result column="SENDDATE" property="senddate" />
+        <result column="REMARK1" property="remark1" />
+        <result column="REMARK2" property="remark2" />
+        <result column="REMARK3" property="remark3" />
+        <result column="REMARK4" property="remark4" />
+        <result column="REMARK5" property="remark5" />
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="Base_Column_List">
+        POLICYNO, JBRCODE, PHONE, MSG, STATUS, SENDDATE, REMARK1, REMARK2, REMARK3, REMARK4, REMARK5
+    </sql>
+
+</mapper>

+ 13 - 0
linkwe-chinacoal/bin/src/main/resources/mapper/modules/xxxt/renewal/ProcedureMapper.xml

@@ -0,0 +1,13 @@
+<?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.linkwechat.coal.modules.xxxt.renewal.mapper.ProcedureMapper">
+
+    <update id="callUpdateRenewalCar4" statementType="CALLABLE" parameterType="HashMap">
+        {call UPDATE_RENEWAL_CAR4(
+                #{v_batchno, mode=IN},
+                #{v_flag, mode=OUT, jdbcType=VARCHAR},
+                #{v_mes, mode=OUT, jdbcType=VARCHAR}
+              )}
+    </update>
+
+</mapper>

+ 37 - 0
linkwe-chinacoal/bin/src/main/resources/mapper/modules/xxxt/renewal/QwBaiduMapper.xml

@@ -0,0 +1,37 @@
+<?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.linkwechat.coal.modules.xxxt.renewal.mapper.QwBaiduMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.linkwechat.coal.modules.xxxt.renewal.domain.entity.QwBaidu">
+        <result column="REQ_ID" property="reqId" />
+        <result column="LICENSE_NO" property="licenseNo" />
+        <result column="END_DATE" property="endDate" />
+        <result column="MOBILE" property="mobile" />
+        <result column="RETURN_CODE" property="returnCode" />
+        <result column="RETURN_MESSAGE" property="returnMessage" />
+        <result column="TH_ID" property="thId" />
+        <result column="END_TYPE" property="endType" />
+        <result column="END_TYPE_REASON" property="endTypeReason" />
+        <result column="CONTACT_UUID" property="contactUuid" />
+        <result column="DURATION_TIME_LEN" property="durationTimeLen" />
+        <result column="RINGING_TIME_LEN" property="ringingTimeLen" />
+        <result column="TALKING_TIME_LEN" property="talkingTimeLen" />
+        <result column="TRANS_RESULT" property="transResult" />
+        <result column="SIP_CODE" property="sipCode" />
+        <result column="SIP_INFO" property="sipInfo" />
+        <result column="RETURN_DATE" property="returnDate" />
+        <result column="CRT_DATE" property="crtDate" />
+        <result column="CRT_USER" property="crtUser" />
+        <result column="UPD_DATE" property="updDate" />
+        <result column="UPD_USER" property="updUser" />
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="Base_Column_List">
+        REQ_ID, LICENSE_NO, END_DATE, MOBILE, RETURN_CODE, RETURN_MESSAGE, TH_ID, END_TYPE, END_TYPE_REASON, CONTACT_UUID, DURATION_TIME_LEN, RINGING_TIME_LEN, TALKING_TIME_LEN,
+        TRANS_RESULT, SIP_CODE, SIP_INFO,
+        RETURN_DATE, CRT_DATE, CRT_USER, UPD_DATE, UPD_USER
+    </sql>
+
+</mapper>

+ 382 - 0
linkwe-chinacoal/bin/src/main/resources/mapper/modules/xxxt/renewal/QwCarHfListMapper.xml

@@ -0,0 +1,382 @@
+<?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.linkwechat.coal.modules.xxxt.renewal.mapper.QwCarHfListMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.linkwechat.coal.modules.xxxt.renewal.domain.entity.QwCarHfList">
+        <id column="LISENSENO" property="lisenseno" />
+        <result column="FRAMENO" property="frameno" />
+        <result column="ENGINENO" property="engineno" />
+        <result column="MODELCNAME" property="modelcname" />
+        <result column="COMCODE" property="comcode" />
+        <result column="COMPANYCNAME" property="companycname" />
+        <result column="AGENTCODE" property="agentcode" />
+        <result column="AGENTNAME" property="agentname" />
+        <result column="NETPOINTCODE" property="netpointcode" />
+        <result column="NETPOINTSNAME" property="netpointsname" />
+        <result column="SALESMANCODE" property="salesmancode" />
+        <result column="USERCNAME" property="usercname" />
+        <result column="ACCOUNTUSERCODE" property="accountusercode" />
+        <result column="ACCOUNTUSERNAME" property="accountusername" />
+        <result column="ACCOUNTCOMCODE" property="accountcomcode" />
+        <result column="ACCOUNTCOMNAME" property="accountcomname" />
+        <result column="JQPOLICYNO" property="jqpolicyno" />
+        <result column="JQSTARTDATE" property="jqstartdate" />
+        <result column="JQENDDATE" property="jqenddate" />
+        <result column="JQSUMPRE" property="jqsumpre" />
+        <result column="SYPOLICYNO" property="sypolicyno" />
+        <result column="SYSTARTDATE" property="systartdate" />
+        <result column="SYENDDATE" property="syenddate" />
+        <result column="SYSUMPRE" property="sysumpre" />
+        <result column="APPLICODE" property="applicode" />
+        <result column="APPLINAME" property="appliname" />
+        <result column="APPCONTACTPHONE" property="appcontactphone" />
+        <result column="RYTYPE" property="rytype" />
+        <result column="ACCEPTDATE" property="acceptdate" />
+        <result column="SUMPAYTAX" property="sumpaytax" />
+        <result column="RELATEDRISKCODE" property="relatedriskcode" />
+        <result column="UPDATEDATE" property="updatedate" />
+        <result column="STATUS" property="status" />
+        <result column="GENJIN_USER" property="genjinUser" />
+        <result column="GENJIN_USER_NAME" property="genjinUserName" />
+        <result column="ALLOT_DATE" property="allotDate" />
+        <result column="ALLOT_USER" property="allotUser" />
+        <result column="TURNOVERCODE" property="turnovercode" />
+        <result column="TURNOVERMSG" property="turnovermsg" />
+        <result column="ALLOTCODE" property="allotcode" />
+        <result column="ALLOTMSG" property="allotmsg" />
+    </resultMap>
+
+    <resultMap id="BaseVoResultMap" extends="BaseResultMap" type="com.linkwechat.coal.modules.xxxt.renewal.domain.vo.QwCarHfListVo">
+        <result column="syJqEnddate" property="syJqEnddate" />
+        <result column="syJqStartdate" property="syJqStartdate" />
+        <result column="allotStatus" property="allotStatus" />
+        <result column="allotStatusName" property="allotStatusName" />
+        <result column="statusName" property="statusName" />
+
+        <association property="qwCarHfMsg"
+                     javaType="com.linkwechat.coal.modules.xxxt.renewal.domain.vo.QwCarHfMsgVo"
+                     select="com.linkwechat.coal.modules.xxxt.renewal.mapper.QwCarHfMsgMapper.selectYydateByPolicyno"
+                     column="{jqpolicyno=JQPOLICYNO, sypolicyno=SYPOLICYNO}">
+            <result column="YYDATE" property="yydate" />
+            <result column="HFUSER" property="hfuser" />
+            <result column="HFDATE" property="hfdate" />
+            <result column="HFMSG" property="hfmsg" />
+            <result column="HFTYPE" property="hftype" />
+            <result column="hftypeName" property="hftypeName" />
+            <result column="STATUS" property="status" />
+            <result column="statusName" property="statusName" />
+        </association>
+
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="Base_Column_List">
+        LISENSENO, FRAMENO, ENGINENO, MODELCNAME, COMCODE, COMPANYCNAME, AGENTCODE, AGENTNAME, NETPOINTCODE, NETPOINTSNAME, SALESMANCODE, USERCNAME, ACCOUNTUSERCODE, ACCOUNTUSERNAME, ACCOUNTCOMCODE, ACCOUNTCOMNAME, JQPOLICYNO, JQSTARTDATE, JQENDDATE, JQSUMPRE, SYPOLICYNO, SYSTARTDATE, SYENDDATE, SYSUMPRE, APPLICODE, APPLINAME, APPCONTACTPHONE, RYTYPE, ACCEPTDATE, SUMPAYTAX, RELATEDRISKCODE, UPDATEDATE, STATUS, GENJIN_USER, GENJIN_USER_NAME, ALLOT_DATE, ALLOT_USER, TURNOVERCODE, TURNOVERMSG, ALLOTCODE, ALLOTMSG
+    </sql>
+    <update id="updateGenjinUser">
+        update qw_car_hf_list a
+        set
+            a.GENJIN_USER=#{acceptuser},
+            a.GENJIN_USER_NAME = #{acceptusername},
+            a.ALLOT_USER=#{turnoveruser},
+            a.ALLOT_DATE = #{turnoverDate, jdbcType=TIMESTAMP},
+            a.ALLOTCODE = #{turnovercode},
+            a.ALLOTMSG = NVL2(a.ALLOTMSG, a.ALLOTMSG || ',' || #{turnovercode}, #{turnovercode})
+        where
+            a.LISENSENO = #{qwRenewalAllot.lisenseno}
+            AND a.FRAMENO =#{qwRenewalAllot.frameno}
+            AND a.ENGINENO =#{qwRenewalAllot.engineno}
+            AND a.jqpolicyno =#{qwRenewalAllot.jqpolicyno}
+            <if test="qwRenewalAllot.sypolicyno == null or qwRenewalAllot.sypolicyno ==''">
+                AND a.sypolicyno ='0'
+            </if>
+            <if test="qwRenewalAllot.sypolicyno != null and qwRenewalAllot.sypolicyno !=''">
+                AND a.sypolicyno = #{qwRenewalAllot.sypolicyno}
+            </if>
+    </update>
+    <update id="updateTurnover">
+        update QW_RENEWAL_FRAMENO_LIST a
+        set
+        a.GENJIN_USER=#{acceptuser},
+        a.GENJIN_USER_NAME = #{acceptusername},
+        a.TURNOVERCODE = #{turnovercode},
+        a.TURNOVERMSG = NVL2(a.TURNOVERMSG, a.TURNOVERMSG || ',' || #{turnovercode}, #{turnovercode})
+        where
+        a.LISENSENO = #{qwRenewalAllot.lisenseno}
+        AND a.FRAMENO =#{qwRenewalAllot.frameno}
+        AND a.ENGINENO =#{qwRenewalAllot.engineno}
+        AND a.jqpolicyno =#{qwRenewalAllot.jqpolicyno}
+        <if test="qwRenewalAllot.sypolicyno == null or qwRenewalAllot.sypolicyno ==''">
+            AND a.sypolicyno ='0'
+        </if>
+        <if test="qwRenewalAllot.sypolicyno != null and qwRenewalAllot.sypolicyno !=''">
+            AND a.sypolicyno = #{qwRenewalAllot.sypolicyno}
+        </if>
+    </update>
+    <select id="selectWhere" resultMap="BaseVoResultMap">
+        SELECT
+            a.lisenseno,
+            a.frameno,
+            a.engineno,
+            a.modelcname,
+            a.comcode,
+            a.companycname,
+            a.agentcode,
+            a.agentname,
+            a.netpointcode,
+            a.netpointsname,
+            a.salesmancode,
+            a.usercname,
+            a.jqpolicyno,
+            a.jqstartdate,
+            a.jqenddate,
+            a.jqsumpre,
+            decode(a.sypolicyno,'0','', a.sypolicyno ) sypolicyno,
+            a.systartdate,
+            a.syenddate,
+            a.sysumpre,
+            (nvl2(a.jqstartdate,'交:' || to_char(a.jqstartdate, 'yyyy-mm-dd'),'')
+            ||
+            nvl2(a.systartdate, '&lt;br/&gt;' || '商:' || to_char(a.systartdate, 'yyyy-mm-dd'), '')
+            ) as syJqStartdate,
+
+            (nvl2(a.jqenddate,'交:' || to_char(a.jqenddate, 'yyyy-mm-dd'),'')
+                ||
+                nvl2(a.syenddate, '&lt;br/&gt;' || '商:' || to_char(a.syenddate, 'yyyy-mm-dd'), '')
+            ) as syJqEnddate,
+            a.applicode,
+            a.appliname,
+            a.appcontactphone,
+            a.rytype,
+            a.acceptdate,
+            a.sumpaytax,
+            a.genjin_user,
+            a.genjin_user_name,
+            a.status,
+            a.updatedate,
+            nvl2(a.genjin_user,'1','0') as allotStatus,
+            a.accountusercode,
+            a.accountusername,
+            a.accountcomcode,
+            a.accountcomname,
+            a.turnovercode,
+            a.turnovermsg,
+            a.relatedriskcode,
+            (SELECT T.DICTVALUE FROM QW_SYS_DICT T WHERE T.DICTTYPE = 'QW_HFSTATUS' AND T.DICTCODE=a.STATUS) AS statusName,
+            (SELECT T.DICTVALUE FROM QW_SYS_DICT T WHERE T.DICTTYPE = 'APPLYRISK1' AND T.DICTCODE=a.RELATEDRISKCODE) AS relatedriskcodeName
+
+        FROM
+        qw_car_hf_list a
+        <if test="appointmentTimeStart != null and appointmentTimeEnd != null">
+            join (select
+            *
+            from (select t.*,
+                    row_number() over(partition by LISENSENO, FRAMENO, ENGINENO,  JQPOLICYNO, SYPOLICYNO order by NVL(t.YYDATE,t.HFDATE) desc) ss
+                    from qw_car_hf_msg t
+                )
+            where ss = 1) b
+            on a.lisenseno=b.lisenseno
+            and a.frameno=b.frameno
+            and a.engineno=b.engineno
+            and a.jqpolicyno=b.jqpolicyno
+            and a.sypolicyno=b.sypolicyno
+        </if>
+        <where>
+            <if test="appointmentTimeStart != null and appointmentTimeEnd != null">
+                and trunc(b.yydate) between trunc(#{appointmentTimeStart}) and trunc(#{appointmentTimeEnd})
+            </if>
+            <if test="comcode != null and comcode !=''">
+                AND a.comcode IN (
+                select companycode from cd_gglevelcompany@dblink_statdw  where level1com=#{comcode} or level2com=#{comcode} or level3com=#{comcode}or level4com=#{comcode} or level5com=#{comcode}
+                )
+            </if>
+            <if test="comcodeNotin != null and comcodeNotin.size()>0">
+                <foreach collection="comcodeNotin" item="item" index="i" >
+                    and a.comcode not like  #{item} || '%'
+                </foreach>
+            </if>
+            <if test="dfComcode != null and dfComcode !=''">
+                AND a.comcode IN (
+                    select comcode
+                    from SaCompany@dblink_sales
+                    where validstatus = '1'
+                    start with comcode = #{dfComcode}
+                    connect by prior comcode = uppercomcode
+                    and prior comcode != comcode
+                )
+            </if>
+            <if test="netpointcode != null and netpointcode.length > 0 ">
+                AND a.netpointcode in
+                <foreach collection="netpointcode" index="item" item="item" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="agentcode != null and agentcode.length > 0 ">
+                AND a.agentcode in
+                <foreach collection="agentcode" index="item" item="item" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="lisenseno != null and lisenseno !=''">
+                AND a.lisenseno like #{lisenseno} ||'%'
+            </if>
+            <if test="appcontactphone != null and appcontactphone !=''">
+                AND a.appcontactphone = #{appcontactphone}
+            </if>
+            <if test="frameno != null and frameno !=''">
+                AND a.frameno=#{frameno}
+            </if>
+            <if test="relatedriskcode != null and relatedriskcode !=''">
+                AND a.relatedriskcode=#{relatedriskcode}
+            </if>
+            <if test="appliname != null and appliname !=''">
+                AND a.appliname like '%'||#{appliname}||'%'
+            </if>
+            <if test="startDate != null and endDate !=null">
+                <if test="carFlag != null and carFlag !='' and carFlag == '1'.toString()">
+                    AND  trunc(a.ACCEPTDATE) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+                    AND  (a.sypolicyno ='0' or a.sypolicyno is null)
+                </if>
+                <if test="carFlag == null or carFlag =='' or carFlag != '1'.toString()">
+                    AND  trunc(a.ACCEPTDATE) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+                </if>
+            </if>
+            <if test="status != null and status !=''" >
+                AND a.status=#{status}
+            </if>
+            <if test="genjinUserName != null and genjinUserName !=''" >
+                AND (a.GENJIN_USER in(
+                select usercode from sauser@dblink_sales t where t.username like '%' || #{genjinUserName} || '%'
+                union all
+                select netpointcode from prpdnetpoint@dblink_sales t where t.netpointname like '%' || #{genjinUserName} || '%'
+                )
+                or a.GENJIN_USER_NAME like  '%' || #{genjinUserName} || '%')
+            </if>
+            <if test="genjinUser != null and genjinUser !=''" >
+                AND a.GENJIN_USER =#{genjinUser}
+            </if>
+            <if test="allotStatus != null and allotStatus !=''">
+                <if test="allotStatus == 1">
+                    AND a.GENJIN_USER is not null
+                </if>
+                <if test="allotStatus == 0">
+                    AND a.GENJIN_USER is null
+                </if>
+            </if>
+        </where>
+    </select>
+    <select id="hfmsgList" resultType="com.linkwechat.coal.modules.xxxt.renewal.domain.vo.QwCarHfMsgListVo">
+        SELECT
+            a.lisenseno,
+            a.frameno,
+            a.engineno,
+            a.modelcname,
+            a.comcode,
+            a.companycname,
+            a.jqpolicyno,
+            a.jqstartdate,
+            a.jqenddate,
+            a.jqsumpre,
+            decode(a.sypolicyno,'0','', a.sypolicyno ) sypolicyno,
+            a.systartdate,
+            a.syenddate,
+            a.sysumpre,
+            (nvl2(a.jqstartdate,'交:' || to_char(a.jqstartdate, 'yyyy-mm-dd'),'')
+            ||
+            nvl2(a.systartdate, '&lt;br/&gt;' || '商:' || to_char(a.systartdate, 'yyyy-mm-dd'), '')
+            ) as syJqStartdate,
+            (NVL2(a.jqenddate,'交:' || to_char(a.jqenddate, 'yyyy-MM-dd'),'')
+                || NVL2(a.syenddate, '&lt;br/&gt;' || '商:' || to_char(a.syenddate, 'yyyy-MM-dd'), '')
+            ) AS syJqEnddate,
+            a.applicode,
+            a.appliname,
+            a.appcontactphone,
+            a.rytype,
+            a.acceptdate,
+            a.sumpaytax,
+            (case a.relatedriskcode
+                when '1' then
+                '单交'
+                when '2' then
+                '交三'
+                when '3' then
+                '主全'
+                else
+                '其他'
+                end) relatedriskcode,
+            g.hfuser,
+            g.hfusername,
+            g.hfdate,
+            g.status,
+            g.hftype,
+            g.hfmsg,
+            g.yydate,
+            (SELECT T.DICTVALUE FROM QW_SYS_DICT T WHERE T.DICTTYPE = 'QW_HFSTATUS' AND T.DICTCODE=g.STATUS) AS statusName,
+            (SELECT T.DICTVALUE FROM QW_SYS_DICT T WHERE T.DICTTYPE = 'QW_HFTYPE' AND T.DICTCODE=g.HFTYPE) AS hftypeName
+        FROM
+        (
+        <if test="appointmentTimeStart != null and appointmentTimeEnd !=null" >
+            select *
+            from (select t.*,
+            row_number() over(partition by LISENSENO, FRAMENO, ENGINENO, JQPOLICYNO, SYPOLICYNO order by YYDATE desc) ss
+            from QW_CAR_HF_MSG  t where t.YYDATE is not null)
+            where ss = 1
+        </if>
+        <if test="appointmentTimeStart == null or appointmentTimeEnd == null" >
+            QW_CAR_HF_MSG
+        </if>
+        ) g
+        left join  qw_car_hf_list a
+        on a.lisenseno=g.lisenseno
+        and a.frameno=g.frameno
+        and g.engineno=a.engineno
+        and a.jqpolicyno=g.jqpolicyno
+        and a.sypolicyno=g.sypolicyno
+        <where>
+            <if test="comcode != null and comcode !=''">
+                AND a.comcode IN (
+                    select companycode from cd_gglevelcompany@dblink_statdw  where level1com=#{comcode} or level2com=#{comcode} or level3com=#{comcode}or level4com=#{comcode} or level5com=#{comcode}
+                )
+            </if>
+            <if test="comcodeNotin != null and comcodeNotin.size()>0">
+                <foreach collection="comcodeNotin" item="item" index="i" >
+                    and a.comcode not like  #{item} || '%'
+                </foreach>
+            </if>
+            <if test="dfComcode != null and dfComcode !=''">
+                <choose>
+                    <when test="dfComcode != '00'">
+                        AND a.comcode like #{dfComcode} || '%'
+                    </when>
+                    <otherwise>
+                    </otherwise>
+                </choose>
+            </if>
+            <if test="lisenseno != null and lisenseno !=''">
+                AND a.lisenseno like #{lisenseno} ||'%'
+            </if>
+            <if test="appliname != null and appliname !=''">
+                AND a.appliname like '%'||#{appliname}||'%'
+            </if>
+            <if test="status != null and status !=''" >
+                AND g.status=#{status}
+            </if>
+            <if test="appcontactphone != null and appcontactphone !=''" >
+                AND a.appcontactphone=#{appcontactphone}
+            </if>
+            <if test="startDate != null and endDate !=null" >
+                AND trunc(g.hfdate) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+            </if>
+            <if test="appointmentTimeStart != null and appointmentTimeEnd !=null" >
+                AND trunc(g.yydate) between trunc(#{appointmentTimeStart, jdbcType=TIMESTAMP}) and trunc(#{appointmentTimeEnd, jdbcType=TIMESTAMP})
+            </if>
+            <if test="hfuser != null and hfuser !=''" >
+                AND g.hfuser=#{hfuser}
+            </if>
+        </where>
+        order by g.HFDATE desc, g.YYDATE desc, g.lisenseno,g.frameno,g.engineno
+    </select>
+
+
+</mapper>

+ 76 - 0
linkwe-chinacoal/bin/src/main/resources/mapper/modules/xxxt/renewal/QwCarHfMsgMapper.xml

@@ -0,0 +1,76 @@
+<?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.linkwechat.coal.modules.xxxt.renewal.mapper.QwCarHfMsgMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.linkwechat.coal.modules.xxxt.renewal.domain.entity.QwCarHfMsg">
+        <result column="KEY_ID" property="keyId" />
+        <result column="LISENSENO" property="lisenseno" />
+        <result column="FRAMENO" property="frameno" />
+        <result column="ENGINENO" property="engineno" />
+        <result column="JQPOLICYNO" property="jqpolicyno" />
+        <result column="SYPOLICYNO" property="sypolicyno" />
+        <result column="APPLICODE" property="applicode" />
+        <result column="APPLINAME" property="appliname" />
+        <result column="STATUS" property="status" />
+        <result column="HFTYPE" property="hftype" />
+        <result column="HFMSG" property="hfmsg" />
+        <result column="YYDATE" property="yydate" />
+        <result column="HFUSER" property="hfuser" />
+        <result column="HFUSERNAME" property="hfusername" />
+        <result column="HFDATE" property="hfdate" />
+        <result column="UPUSER" property="upuser" />
+        <result column="UPUSERNAME" property="upusername" />
+        <result column="UPDATEDATE" property="updatedate" />
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="Base_Column_List">
+        KEY_ID, LISENSENO, FRAMENO, ENGINENO, JQPOLICYNO, SYPOLICYNO, APPLICODE, APPLINAME,
+        STATUS, HFTYPE, HFMSG, YYDATE, HFUSER, HFUSERNAME, HFDATE, UPUSER, UPUSERNAME, UPDATEDATE
+    </sql>
+    <select id="selectYydateByPolicyno"
+            resultType="com.linkwechat.coal.modules.xxxt.renewal.domain.vo.QwCarHfMsgVo">
+        select
+        <include refid="Base_Column_List"/>,
+        (SELECT T.DICTVALUE FROM QW_SYS_DICT T WHERE T.DICTTYPE = 'QW_HFTYPE' AND T.DICTCODE=A.HFTYPE) AS hftypeName,
+        (SELECT T.DICTVALUE FROM QW_SYS_DICT T WHERE T.DICTTYPE = 'QW_HFSTATUS' AND T.DICTCODE=A.STATUS) AS statusName
+        from (select t.*,
+        row_number() over(partition by t.jqpolicyno, t.sypolicyno order by NVL(t.yydate,t.hfdate) desc) ss
+        from QW_CAR_HF_MSG t
+        where t.jqpolicyno = #{jqpolicyno,jdbcType=VARCHAR} and t.sypolicyno = NVL(#{sypolicyno,jdbcType=VARCHAR}, '0')) A
+        where ss = 1
+    </select>
+    <select id="selectHf" resultType="com.linkwechat.coal.modules.xxxt.renewal.domain.vo.QwCarHfMsgVo">
+        SELECT
+                <include refid="Base_Column_List"/>,
+               (SELECT T.DICTVALUE FROM QW_SYS_DICT T WHERE T.DICTTYPE = 'QW_HFSTATUS' AND T.DICTCODE=A.STATUS) AS statusName,
+               (SELECT T.DICTVALUE FROM QW_SYS_DICT T WHERE T.DICTTYPE = 'QW_HFTYPE' AND T.DICTCODE=A.HFTYPE) AS hftypeName
+        FROM QW_CAR_HF_MSG a
+        WHERE 1=1
+        <if test="engineno != null and engineno!=''">
+            AND a.ENGINENO=#{engineno}
+        </if>
+        <if test="frameno != null and frameno!=''">
+            AND a.FRAMENO=#{frameno}
+        </if>
+        <if test="lisenseno != null and lisenseno!=''">
+            AND a.LISENSENO=#{lisenseno}
+        </if>
+        <if test="jqpolicyno != null and jqpolicyno != ''" >
+            AND a.jqpolicyno = #{jqpolicyno}
+        </if>
+        <if test="sypolicyno != null and sypolicyno != ''" >
+            AND a.sypolicyno = #{sypolicyno}
+        </if>
+        <if test="sypolicyno == null or sypolicyno == ''" >
+            AND a.sypolicyno = '0'
+        </if>
+        <if test="hfuser != null and hfuser != ''" >
+            AND (a.HFUSER like #{hfuser} || '%'  OR  a.UPUSER like #{hfuser} || '%')
+        </if>
+        ORDER BY a.UPDATEDATE DESC, a.HFDATE DESC
+    </select>
+
+
+</mapper>

+ 202 - 0
linkwe-chinacoal/bin/src/main/resources/mapper/modules/xxxt/renewal/QwFcXBMsgMapper.xml

@@ -0,0 +1,202 @@
+<?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.linkwechat.coal.modules.xxxt.renewal.mapper.QwFcXBMsgMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.linkwechat.coal.modules.xxxt.renewal.domain.entity.XuBaoFc">
+        <result column="STATDATE" property="statDate" />
+        <result column="PROVINCE" property="province" />
+        <result column="POLICYNO" property="policyno" />
+        <result column="PAYREFFEE" property="payrefFee" />
+        <result column="ENDDATE" property="endDate" />
+        <result column="APPLINAME" property="appliname" />
+        <result column="EWMCD" property="ewmcd" />
+        <result column="FADM2" property="fadm2" />
+        <result column="FADM1" property="fadm1" />
+        <result column="FAMC2" property="famc2" />
+        <result column="FAMC1" property="famc1" />
+        <result column="FAYXBZ" property="fayxbz" />
+        <result column="RISKCODE" property="riskcode" />
+        <result column="RISKNAME" property="riskname" />
+        <result column="COMCODE" property="comcode" />
+        <result column="OPERTOR" property="opertor" />
+        <result column="USERCODE" property="usercode" />
+        <result column="NETPOINTCODE" property="netpointCode" />
+        <result column="AGENTCODE" property="agentCode" />
+        <result column="AGREEMENTCODE" property="agreementCode" />
+        <result column="USERCODE_NEW" property="userCodeNew" />
+        <result column="NETPOINTCODE_NEW" property="netpointCodeNew" />
+        <result column="AGENTCODE_NEW" property="agentCodeNew" />
+        <result column="AGREEMENTCODE_NEW" property="agreementCodeNew" />
+        <result column="REMAKE" property="remake" />
+        <result column="FADM_NEW" property="fadmNew" />
+        <result column="FAMC_NEW" property="famcNew" />
+        <result column="APPLINAME" property="appliname" />
+        <result column="MOBILE" property="mobile" />
+        <result column="PROURL" property="prourl" />
+        <result column="MSGCONTENT" property="msgContent" />
+        <result column="SENDSTATUS" property="sendStatus" />
+        <result column="SENDERRORMSG" property="sendErrorMsg" />
+        <result column="WXURL" property="wxUrl" />
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="Base_Column_List">
+
+    </sql>
+    <select id="selectXuBaoMsg" resultType="com.linkwechat.coal.modules.xxxt.renewal.domain.vo.XuBaoFcVo">
+        select trunc(statdate) statdate,
+        a.policyno ,
+        a.enddate ,
+        a.appliname ,
+        a.mobile ,
+        a.fadm1 ,
+        a.famc1 ,
+        a.comcode ,
+        (select n.comcname from sacompany@dblink_sales n
+        where n.comcode = a.comcode) comcname,
+        a.netpointcode ,
+        (select n.netpointname
+        from prpdnetpoint@dblink_sales n
+        where n.netpointcode = a.netpointcode) netpointname,
+        a.agentcode ,
+        (select n.agentname
+        from prpdagent@dblink_sales n
+        where n.agentcode = a.agentcode) agentname,
+        a.usercode ,
+        (select n.username
+        from sauser@dblink_sales n
+        where n.usercode = a.usercode and n.validstatus = '1') username,
+        a.fadm_new fadmNew,
+        a.famc_new famcNew,
+        a.netpointcode_new netpointcodeNew,
+        (select n.netpointname
+        from prpdnetpoint@dblink_sales n
+        where n.netpointcode = a.netpointcode_new) netpointnameNew,
+        a.agentcode_new agentcodeNew,
+        (select n.agentname
+        from prpdagent@dblink_sales n
+        where n.agentcode = a.agentcode_new) agentnameNew,
+        a.usercode_new usercodeNew,
+        (select n.username
+        from sauser@dblink_sales n
+        where n.usercode = a.usercode_new and n.validstatus = '1') usernameNew,
+        a.prourl  prourl,
+        a.wxurl ,
+        a.msgcontent ,
+        decode(a.sendstatus,'0','未发送','1','已发送') sendstatus,
+        a.senderrormsg,
+        a.email,
+        a.emailcontent emailContent
+        from XUBAO_FC a
+        WHERE 1 = 1
+        <if test="startDate != null" >
+            AND trunc(a.statdate) &gt;= #{startDate,jdbcType=TIMESTAMP}
+        </if>
+        <if test="endDate != null" >
+            AND trunc(a.statdate) &lt;= #{endDate,jdbcType=TIMESTAMP}
+        </if>
+        <if test="comcode != null and comcode != ''" >
+            AND a.comcode in (Select comcode from saCompany@dblink_sales  Start With comcode = #{comcode,jdbcType=VARCHAR}
+            Connect By Prior comcode = uppercomcode and prior comcode != comcode and validstatus = '1')
+        </if>
+        <if test="mobile != null and mobile != ''" >
+            AND a.mobile = #{mobile}
+        </if>
+        order by a.enddate
+    </select>
+    <select id="hasRenewalCount" resultType="com.linkwechat.coal.modules.xxxt.renewal.domain.vo.QwRenewalCarYxVo">
+        select
+        t.policyno,
+        t.endorseno,
+        t.comcode,
+        (select n.comcname from sacompany@dblink_sales n
+        where n.comcode = t.comcode) comcname,
+        t.netpointcode,
+        (select n.netpointname
+        from prpdnetpoint@dblink_sales n
+        where n.netpointcode = t.netpointcode) netpointname,
+        t.acceptdate,
+        t.startdate,
+        t.enddate,
+        t.sumgrosspremium,
+        t.sumnotaxpremium,
+        t.riskcode,
+        t.carowner,
+        t.appliname,
+        t.insuredname,
+        t.privince,
+        t.city,
+        t.licenseno,
+        t.frameno,
+        t.engineno,
+        t.brandname,
+        t.newusenatureshow,
+        t.newcarusetype,
+        t.usercode,
+        a.username username,
+        t.operatorcode,
+        (select n.usercname from gguser@cx_dblink n where n.usercode = t.operatorcode) operatorname ,
+        t.agentcode,
+        (select n.agentname
+        from prpdagent@dblink_sales n
+        where n.agentcode = t.agentcode) agentname,
+        t.accountuser,
+        (select n.username
+        from sauser@dblink_sales n
+        where n.usercode = t.accountuser) accountusername,
+        t.businesssource,
+        (case when t.oldrelatedriskcode = '1' and t.relatedriskcode = '2' then '是' else '否'end ) as djzjs,
+        t.MAINPOLICYNO,
+        t.OLDMAINPOLICYNO,
+        t.RELATEDRISKCODE,
+        t.OLDRELATEDRISKCODE,
+        t.REMARK1,
+        t.REMARK2,
+        t.REMARK3
+        from QW_RENEWAL_CAR_YX_LIST t
+        left join sauser@dblink_sales  a
+        on t.usercode = a.usercode
+        where  1=1
+        <if test="comcodeco != null and comcodeco !=''">
+            AND t.comcode in (Select comcode from saCompany@dblink_sales  Start With comcode = #{comcodeco,jdbcType=VARCHAR}
+            Connect By Prior comcode = uppercomcode and prior comcode != comcode and validstatus = '1')
+        </if>
+        <if test="comcodeNotin != null and comcodeNotin.size()>0">
+            <foreach collection="comcodeNotin" item="item" index="i" >
+                and t.comcode not like  #{item} || '%'
+            </foreach>
+        </if>
+        <if test="startDate != null" >
+            AND trunc(t.acceptdate) &gt;= #{startDate,jdbcType=TIMESTAMP}
+        </if>
+        <if test="endDate != null" >
+            AND trunc(t.acceptdate) &lt;= #{endDate,jdbcType=TIMESTAMP}
+        </if>
+        <if test="username != null and username != ''">
+            and t.username = #{username}
+        </if>
+        <if test="djzjs != null and djzjs != ''">
+            and t.oldrelatedriskcode='1' and t.relatedriskcode='2'
+        </if>
+        <if test="netpointcode != null  and netpointcode.length > 0">
+            AND t.netpointcode in
+            <foreach collection="netpointcode" index="item" item="item" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        <if test="agentcode != null  and agentcode.length > 0">
+            AND t.agentcode in
+            <foreach collection="agentcode" index="item" item="item" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        <if test="licenseno != null and licenseno != ''">
+            and t.licenseno = #{licenseno}
+        </if>
+        <if test="frameno != null and frameno != ''">
+            and t.frameno = #{frameno}
+        </if>
+    </select>
+
+</mapper>

+ 137 - 0
linkwe-chinacoal/bin/src/main/resources/mapper/modules/xxxt/renewal/QwGenjinMsgMapper.xml

@@ -0,0 +1,137 @@
+<?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.linkwechat.coal.modules.xxxt.renewal.mapper.QwGenjinMsgMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.linkwechat.coal.modules.xxxt.renewal.domain.entity.QwGenjinMsg">
+        <result column="KEY_ID" property="keyId" />
+        <result column="LISENSENO" property="lisenseno" />
+        <result column="FRAMENO" property="frameno" />
+        <result column="ENGINENO" property="engineno" />
+        <result column="APPLICODE" property="applicode" />
+        <result column="APPLINAME" property="appliname" />
+        <result column="GENJIN_FUN" property="genjinFun" />
+        <result column="GENJIN_STATUS" property="genjinStatus" />
+        <result column="ISSUE_DESIRE" property="issueDesire" />
+        <result column="APPLITYPE" property="applitype" />
+        <result column="APPOINTMENT_TIME" property="appointmentTime" />
+        <result column="APPOINTMENT_REMAKE" property="appointmentRemake" />
+        <result column="CREATE_BY" property="createBy" />
+        <result column="CREATE_TIME" property="createTime" />
+        <result column="UPDATE_BY" property="updateBy" />
+        <result column="UPDATE_TIME" property="updateTime" />
+        <result column="GENJIN_TIME" property="genjinTime" />
+        <result column="GENJIN_USER" property="genjinUser" />
+        <result column="OLDJQPOLICYNO" property="oldjqpolicyno" />
+        <result column="OLDSYPOLICYNO" property="oldsypolicyno" />
+        <result column="OLDJQENDDATE" property="oldjqenddate" />
+    </resultMap>
+    <resultMap id="BaseVoResultMap" type="com.linkwechat.coal.modules.xxxt.renewal.domain.vo.QwGenjinMsgVo" extends="BaseResultMap">
+        <result column="genjinUserName" property="genjinUserName" />
+        <result column="genjinFunName" property="genjinFunName" />
+        <result column="genjinStatusName" property="genjinStatusName" />
+        <result column="issueDesireName" property="issueDesireName" />
+        <result column="applitypeName" property="applitypeName" />
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="Base_Column_List">
+        KEY_ID, LISENSENO, FRAMENO, ENGINENO, APPLICODE, APPLINAME, GENJIN_FUN, GENJIN_STATUS, ISSUE_DESIRE, APPLITYPE, APPOINTMENT_TIME, APPOINTMENT_REMAKE, CREATE_BY, CREATE_TIME, UPDATE_BY, UPDATE_TIME,
+        GENJIN_USER, GENJIN_TIME, OLDJQPOLICYNO, OLDSYPOLICYNO,OLDJQENDDATE
+    </sql>
+    <select id="select" resultMap="BaseVoResultMap">
+        SELECT
+            a.KEY_ID,
+            a.LISENSENO,
+            a.FRAMENO,
+            a.ENGINENO,
+            a.OLDJQPOLICYNO,
+            a.OLDSYPOLICYNO,
+            a.APPLICODE,
+            a.APPLINAME,
+            a.GENJIN_FUN,
+            (SELECT T.DICTVALUE FROM QW_SYS_DICT T WHERE T.DICTTYPE='GENJIN_FUN' AND T.DICTCODE=a.GENJIN_FUN) genjinFunName,
+            a.GENJIN_STATUS,
+            (SELECT T.DICTVALUE FROM QW_SYS_DICT T WHERE T.DICTTYPE='GENJIN_STATUS' AND T.DICTCODE=a.GENJIN_STATUS) genjinStatusName,
+            a.ISSUE_DESIRE,
+            (SELECT T.DICTVALUE FROM QW_SYS_DICT T WHERE T.DICTTYPE='ISSUE_DESIRE' AND T.DICTCODE=a.ISSUE_DESIRE) issueDesireName,
+            a.APPLITYPE,
+            (SELECT T.DICTVALUE FROM QW_SYS_DICT T WHERE T.DICTTYPE='APPLITYPE' AND T.DICTCODE=a.APPLITYPE) applitypeName,
+            a.APPOINTMENT_TIME,
+            a.APPOINTMENT_REMAKE,
+            a.CREATE_BY,
+            a.CREATE_TIME,
+            a.UPDATE_BY,
+            a.UPDATE_TIME,
+            a.GENJIN_USER,
+            a.GENJIN_TIME,
+            NVL((select username from sauser@dblink_sales t where t.usercode=a.GENJIN_USER),
+            (select NETPOINTNAME from prpdnetpoint@dblink_sales t where t.NETPOINTCODE=a.GENJIN_USER)) AS genjinUserName,
+            a.OLDJQENDDATE
+        FROM QW_GENJIN_MSG a
+        WHERE 1=1
+        <choose>
+            <when test="policyno != null and policyno != ''">
+                AND a.oldjqpolicyno = #{policyno}
+            </when>
+            <otherwise>
+                <if test="engineno != null and engineno!=''">
+                    AND a.ENGINENO=#{engineno}
+                </if>
+                <if test="frameno != null and frameno!=''">
+                    AND a.FRAMENO=#{frameno}
+                </if>
+                <if test="lisenseno != null and lisenseno!=''">
+                    AND a.LISENSENO=#{lisenseno}
+                </if>
+                <if test="oldjqpolicyno != null and oldjqpolicyno != ''" >
+                    AND a.oldjqpolicyno = #{oldjqpolicyno}
+                </if>
+                <if test="oldsypolicyno != null and oldsypolicyno != ''" >
+                    AND a.oldsypolicyno = #{oldsypolicyno}
+                </if>
+                <if test="oldsypolicyno == null or oldsypolicyno == ''" >
+                    AND a.oldsypolicyno = '0'
+                </if>
+                <if test="oldjqenddate != null" >
+                    AND trunc(a.oldjqenddate) = trunc(#{oldjqenddate})
+                </if>
+            </otherwise>
+        </choose>
+        <if test="createBy != null and createBy != ''" >
+            AND (a.CREATE_BY like #{createBy} || '%'  OR  a.UPDATE_BY like #{createBy} || '%')
+        </if>
+        ORDER BY a.UPDATE_TIME DESC, a.CREATE_TIME DESC
+    </select>
+    <select id="selectAppointmentTimeByPolicyno6"
+            resultType="com.linkwechat.coal.modules.xxxt.renewal.domain.entity.QwGenjinMsg">
+       select
+       <include refid="Base_Column_List"/>
+       from (select t.*,
+                    row_number() over(partition by t.oldjqpolicyno,  t.oldsypolicyno, t.oldjqenddate, t.lisenseno, t.frameno, t.engineno order by NVL(t.appointment_time,t.CREATE_TIME) desc) ss
+               from QW_GENJIN_MSG t
+              where t.oldjqpolicyno = #{oldjqpolicyno}
+                  and t.oldsypolicyno = nvl(#{oldsypolicyno,jdbcType=VARCHAR}, '0')
+                  and  trunc(t.oldjqenddate) = trunc(#{oldjqenddate})
+                  and t.lisenseno = #{lisenseno}
+                  and t.frameno = #{frameno}
+                  and t.engineno = #{engineno}
+              )
+       where ss = 1
+        <if test="appointmentTimeStart != null and appointmentTimeEnd != null">
+            and trunc(appointment_time) between trunc(#{appointmentTimeStart, jdbcType=TIMESTAMP}) and trunc(#{appointmentTimeEnd, jdbcType=TIMESTAMP})
+        </if>
+    </select>
+    <select id="selectAppointmentTimeByPolicyno"
+            resultType="com.linkwechat.coal.modules.xxxt.renewal.domain.entity.QwGenjinMsg">
+        select
+        <include refid="Base_Column_List"/>
+        from (select t.*,
+        row_number() over(partition by t.oldjqpolicyno order by NVL(t.appointment_time,t.CREATE_TIME) desc) ss
+        from QW_GENJIN_MSG t
+        where t.oldjqpolicyno = #{policyno}
+        )
+        where ss = 1
+    </select>
+
+</mapper>

+ 199 - 0
linkwe-chinacoal/bin/src/main/resources/mapper/modules/xxxt/renewal/QwMidRenewalGfListMapper.xml

@@ -0,0 +1,199 @@
+<?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.linkwechat.coal.modules.xxxt.renewal.mapper.QwMidRenewalGfListMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.linkwechat.coal.modules.xxxt.renewal.domain.entity.QwMidRenewalGfList">
+        <id column="POLICYNO" property="policyno" />
+        <result column="STATDATE" property="statdate" />
+        <result column="COMCODE" property="comcode" />
+        <result column="NETPOINTCODE" property="netpointcode" />
+        <result column="AGENTCODE" property="agentcode" />
+        <result column="USERCODE" property="usercode" />
+        <result column="C_PLAN_CODE" property="cplanCode" />
+        <result column="C_PLAN_NAME" property="cplanName" />
+        <result column="RISKCODE" property="riskcode" />
+        <result column="APPLYCODE" property="applycode" />
+        <result column="APPLYNAME" property="applyname" />
+        <result column="APPLYPHONE" property="applyphone" />
+        <result column="INSUREDCODE" property="insuredcode" />
+        <result column="INSUREDNAME" property="insuredname" />
+        <result column="SUMPREMIUM" property="sumpremium" />
+        <result column="NOTAXPREMIUM" property="notaxpremium" />
+        <result column="PAYDATE" property="paydate" />
+        <result column="STARTDATE" property="startdate" />
+        <result column="ENDDATE" property="enddate" />
+        <result column="POLICYNO_N" property="policynoN" />
+        <result column="COMCODE_N" property="comcodeN" />
+        <result column="NETPOINTCODE_N" property="netpointcodeN" />
+        <result column="AGENTCODE_N" property="agentcodeN" />
+        <result column="USERCODE_N" property="usercodeN" />
+        <result column="C_PLAN_CODE_N" property="cplanCodeN" />
+        <result column="C_PLAN_NAME_N" property="cplanNameN" />
+        <result column="C_FLAG" property="cflag" />
+        <result column="EMAIL" property="email" />
+        <result column="STATUS" property="status" />
+        <result column="GENJIN_USER" property="genjinUser" />
+        <result column="GENJIN_USER_NAME" property="genjinUserName" />
+        <result column="ACCOUNTUSER" property="accountuser" />
+        <result column="ALLOT_DATE" property="allotDate" />
+        <result column="ALLOT_USER" property="allotUser" />
+        <result column="TURNOVERCODE" property="turnovercode" />
+        <result column="TURNOVERMSG" property="turnovermsg" />
+        <result column="ALLOTCODE" property="allotcode" />
+        <result column="ALLOTMSG" property="allotmsg" />
+        <result column="UPDATEDATE" property="updatedate" />
+    </resultMap>
+    <resultMap id="VoBaseResultMap" type="com.linkwechat.coal.modules.xxxt.renewal.domain.vo.NoCarRenewalListVo">
+        <id column="POLICYNO" property="policyno" />
+        <result column="COMNAME" property="comname" />
+        <result column="NETPOINTNAME" property="netpointname" />
+        <result column="AGENTNAME" property="agentname" />
+        <result column="USERNAME" property="username" />
+        <result column="RISKNAME" property="riskname" />
+        <result column="comcodeNname" property="comcodeNname" />
+        <result column="netpointcodeNname" property="netpointcodeNname" />
+        <result column="agentcodeNname" property="agentcodeNname" />
+        <result column="usercodeNname" property="usercodeNname" />
+        <result column="ACCOUNTUSERNAME" property="accountusername" />
+        <result column="allotStatus" property="allotStatus" />
+        <association property="qwGenjinMsg"
+                     javaType="com.linkwechat.coal.modules.xxxt.renewal.domain.entity.QwGenjinMsg"
+                     select="com.linkwechat.coal.modules.xxxt.renewal.mapper.QwGenjinMsgMapper.selectAppointmentTimeByPolicyno"
+                     column="POLICYNO">
+            <result column="APPOINTMENT_TIME" property="appointmentTime" />
+            <result column="APPOINTMENT_REMAKE" property="appointmentRemake" />
+            <result column="OLDJQPOLICYNO" property="oldjqpolicyno" />
+        </association>
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="Base_Column_List">
+        STATDATE, POLICYNO, COMCODE, NETPOINTCODE, AGENTCODE, USERCODE, C_PLAN_CODE, C_PLAN_NAME, RISKCODE, APPLYCODE, APPLYNAME, APPLYPHONE, INSUREDCODE, INSUREDNAME, SUMPREMIUM, NOTAXPREMIUM, PAYDATE, STARTDATE, ENDDATE, POLICYNO_N, COMCODE_N, NETPOINTCODE_N, AGENTCODE_N, USERCODE_N, C_PLAN_CODE_N, C_PLAN_NAME_N, C_FLAG, EMAIL, STATUS, GENJIN_USER, GENJIN_USER_NAME, ACCOUNTUSER, ALLOT_DATE, ALLOT_USER, TURNOVERCODE, TURNOVERMSG, ALLOTCODE, ALLOTMSG, UPDATEDATE
+    </sql>
+    <update id="updateGenjinUser">
+        update QW_MID_RENEWAL_GF_LIST a
+        set
+        a.GENJIN_USER=#{userId},
+        a.GENJIN_USER_NAME = #{userName},
+        a.ALLOT_USER=#{allotUser},
+        a.ALLOT_DATE = #{allotDate, jdbcType=TIMESTAMP},
+        a.ALLOTCODE = #{turnovercode},
+        a.ALLOTMSG = NVL2(a.ALLOTMSG, a.ALLOTMSG || ',' || #{turnovercode}, #{turnovercode})
+        where a.policyno =#{qwRenewalAllot.policyno}
+    </update>
+    <update id="updateTurnover">
+        update QW_MID_RENEWAL_GF_LIST a
+        set
+        a.GENJIN_USER=#{userId},
+        a.GENJIN_USER_NAME = #{userName},
+        a.TURNOVERCODE = #{turnovercode},
+        a.TURNOVERMSG = NVL2(a.TURNOVERMSG, a.TURNOVERMSG || ',' || #{turnovercode}, #{turnovercode})
+        where a.policyno =#{qwRenewalAllot.policyno}
+    </update>
+    <select id="selectWhere" resultMap="VoBaseResultMap">
+        SELECT <include refid="Base_Column_List"/>,
+        (select comcname from SaCompany@dblink_sales t where t.comcode=a.comcode) COMNAME,
+        (select netpointname from prpdnetpoint@dblink_sales t where t.netpointcode=a.netpointcode) NETPOINTNAME,
+        (select agentname from prpdagent@dblink_sales t where t.agentcode=a.agentcode) AGENTNAME,
+        (select username from sauser@dblink_sales t where t.usercode=a.usercode) USERNAME,
+        (select riskcname from prpdrisk@dblink_sales t where t.riskcode=a.riskcode) RISKNAME,
+
+        (select comcname from SaCompany@dblink_sales t where t.comcode=a.COMCODE_N) comcodeNname,
+        (select netpointname from prpdnetpoint@dblink_sales t where t.netpointcode=a.NETPOINTCODE_N) netpointcodeNname,
+        (select agentname from prpdagent@dblink_sales t where t.agentcode=a.AGENTCODE_N) agentcodeNname,
+        (select username from sauser@dblink_sales t where t.usercode=a.USERCODE_N) usercodeNname,
+        NVL((select username from sauser@dblink_sales t where t.usercode=a.accountuser),
+            (select t.codecname || '--' || t.remark from ggcode@cx_dblink t where t.codetype = 'HandlerAccount' and t.codecode=a.accountuser)
+        ) as accountusername,
+        NVL2(a.GENJIN_USER,'1','0') AS allotstatus
+
+        FROM QW_MID_RENEWAL_GF_LIST a
+        <where>
+            <if test="comcode != null and comcode !=''">
+                AND a.comcode IN (
+                select comcode
+                    from SaCompany@dblink_sales
+                    where validstatus = '1'
+                    start with comcode = #{comcode}
+                    connect by prior comcode = uppercomcode
+                    and prior comcode != comcode
+                )
+            </if>
+            <if test="dfComcode != null and dfComcode !=''">
+                AND a.comcode IN (
+                select comcode
+                from SaCompany@dblink_sales
+                where validstatus = '1'
+                start with comcode = #{dfComcode}
+                connect by prior comcode = uppercomcode
+                and prior comcode != comcode
+                )
+            </if>
+            <if test="comcodeNotin != null and comcodeNotin.size()>0">
+                <foreach collection="comcodeNotin" item="item" index="i" >
+                    and a.comcode not like  #{item} || '%'
+                </foreach>
+            </if>
+            <if test="netpointcode != null and netpointcode.length > 0 ">
+                AND a.netpointcode in
+                <foreach collection="netpointcode" index="item" item="item" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="agentcode != null and agentcode.length > 0 ">
+                AND a.agentcode in
+                <foreach collection="agentcode" index="item" item="item" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="riskcode != null and riskcode.length > 0 ">
+                AND a.riskcode in
+                <foreach collection="riskcode" index="item" item="item" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="appliname != null and appliname !=''">
+                AND (a.applyname like '%'||#{appliname}||'%'
+                or a.INSUREDNAME like '%'||#{appliname}||'%')
+            </if>
+            <if test="startDate != null and endDate !=null">
+                AND trunc(A.ENDDATE) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+            </if>
+            <if test="status != null and status !=''" >
+                <if test="status == 0 " >
+                    AND (a.status=#{status} or a.status is null)
+                </if>
+                <if test="status != 0 " >
+                    AND a.status=#{status}
+                </if>
+            </if>
+
+            <if test="genjinUserName != null and genjinUserName !=''" >
+                AND (a.GENJIN_USER in(
+                        select usercode from sauser@dblink_sales t where t.username like '%' || #{genjinUserName} || '%'
+                        union all
+                        select netpointcode from prpdnetpoint@dblink_sales t where t.netpointname like '%' || #{genjinUserName} || '%'
+                        )
+                    or
+                        a.GENJIN_USER_NAME like  '%' || #{genjinUserName} || '%')
+            </if>
+            <if test="genjinUser != null and genjinUser !=''" >
+                AND a.GENJIN_USER =#{genjinUser}
+            </if>
+            <if test="allotStatus != null and allotStatus !=''">
+                <if test="allotStatus == 1">
+                    AND a.GENJIN_USER is not null
+                </if>
+                <if test="allotStatus == 0">
+                    AND a.GENJIN_USER is null
+                </if>
+            </if>
+            <if test="cplanName != null and cplanName !=''" >
+                AND a.C_PLAN_NAME like '%' || #{cplanName} || '%'
+            </if>
+        </where>
+        ORDER BY a.enddate DESC
+    </select>
+
+</mapper>

+ 21 - 0
linkwe-chinacoal/bin/src/main/resources/mapper/modules/xxxt/renewal/QwOneRenewalMapper.xml

@@ -0,0 +1,21 @@
+<?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.linkwechat.coal.modules.xxxt.renewal.mapper.QwOneRenewalMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.linkwechat.coal.modules.xxxt.renewal.domain.entity.QwOneRenewal">
+        <result column="USER_ID" property="userId" />
+        <result column="USER_NAME" property="userName" />
+        <result column="RENEWALURL" property="renewalurl" />
+        <result column="CREATE_DATE" property="createDate" />
+        <result column="TYPE" property="type" />
+        <result column="POLICYNO" property="policyno" />
+        <result column="CODE" property="code" />
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="Base_Column_List">
+        USER_ID, USER_NAME, RENEWALURL, CREATE_DATE, TYPE, POLICYNO, CODE
+    </sql>
+
+</mapper>

+ 49 - 0
linkwe-chinacoal/bin/src/main/resources/mapper/modules/xxxt/renewal/QwRenewalCarSalesConfigMapper.xml

@@ -0,0 +1,49 @@
+<?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.linkwechat.coal.modules.xxxt.renewal.mapper.QwRenewalCarSalesConfigMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.linkwechat.coal.modules.xxxt.renewal.domain.entity.QwRenewalCarSalesConfig">
+        <result column="COMCODE" property="comcode" />
+        <result column="USERNAME" property="username" />
+        <result column="QW_USERCODE" property="qwUsercode" />
+        <result column="PHONE" property="phone" />
+        <result column="ROLENAME" property="rolename" />
+        <result column="NETPOINTCODE" property="netpointcode" />
+        <result column="NETPOINTNAME" property="netpointname" />
+        <result column="OPERATORCODE" property="operatorcode" />
+        <result column="STATUS" property="status" />
+        <result column="REMARK" property="remark" />
+        <result column="OPERATEDATE" property="operatedate" />
+        <result column="REMARK1" property="remark1" />
+        <result column="REMARK2" property="remark2" />
+        <result column="REMARK3" property="remark3" />
+        <result column="REMARK4" property="remark4" />
+        <result column="REMARK5" property="remark5" />
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="Base_Column_List">
+        COMCODE, USERNAME, QW_USERCODE, PHONE, ROLENAME, NETPOINTCODE, NETPOINTNAME, OPERATORCODE, STATUS, REMARK, OPERATEDATE, REMARK1, REMARK2, REMARK3, REMARK4, REMARK5
+    </sql>
+    <select id="selectNetdesc" resultType="java.util.Map">
+        SELECT
+            NETPOINTCODE,
+            OPERATORCODE,
+            (NETPOINTCODE || '-' || NETPOINTNAME ||'-' || OPERATORCODE) as NETDESC
+        FROM QW_RENEWAL_CAR_SALES_CONFIG
+        <where>
+            <if test="qwUsercode != null and qwUsercode !=''">
+                AND QW_USERCODE = #{qwUsercode}
+            </if>
+            <if test="phone != null and phone !=''">
+                AND PHONE = #{phone}
+            </if>
+            <if test="comcode != null and comcode !=''">
+                AND  #{comcode} like COMCODE || '%'
+            </if>
+        </where>
+    </select>
+
+
+</mapper>

+ 880 - 0
linkwe-chinacoal/bin/src/main/resources/mapper/modules/xxxt/renewal/QwRenewalFramenoListMapper.xml

@@ -0,0 +1,880 @@
+<?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.linkwechat.coal.modules.xxxt.renewal.mapper.QwRenewalFramenoListMapper" >
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap"  type="com.linkwechat.coal.modules.xxxt.renewal.domain.entity.QwRenewalFramenoList">
+        <result column="LISENSENO" property="lisenseno" />
+        <result column="FRAMENO" property="frameno" />
+        <result column="ENGINENO" property="engineno" />
+        <result column="MODELCNAME" property="modelcname" />
+        <result column="COMCODE" property="comcode" />
+        <result column="COMPANYCNAME" property="companycname" />
+        <result column="AGENTCODE" property="agentcode" />
+        <result column="AGENTNAME" property="agentname" />
+        <result column="NETPOINTCODE" property="netpointcode" />
+        <result column="NETPOINTSNAME" property="netpointsname" />
+        <result column="SALESMANCODE" property="salesmancode" />
+        <result column="USERCNAME" property="usercname" />
+        <result column="OLDJQPOLICYNO" property="oldjqpolicyno" />
+        <result column="OLDJQSTARTDATE" property="oldjqstartdate" />
+        <result column="OLDJQENDDATE" property="oldjqenddate" />
+        <result column="OLDSYPOLICYNO" property="oldsypolicyno" />
+        <result column="OLDSYSTARTDATE" property="oldsystartdate" />
+        <result column="OLDSYENDDATE" property="oldsyenddate"/>
+        <result column="APPLICODE" property="applicode" />
+        <result column="APPLINAME" property="appliname" />
+        <result column="APPCONTACTPHONE" property="appcontactphone" />
+        <result column="JQPOLICYNO" property="jqpolicyno" />
+        <result column="SYPOLICYNO" property="sypolicyno" />
+        <result column="NEWCARUSETYPE" property="newcarusetype" />
+        <result column="NEWCARKIND" property="newcarkind" />
+        <result column="NEWCARKINDSUB" property="newcarkindsub" />
+        <result column="LAW_ID" property="lawId" />
+        <result column="IS_AUDIT" property="isAudit" />
+        <result column="GENJIN_USER" property="genjinUser" />
+        <result column="STATUS" property="status" />
+        <result column="JQ_RENEWAL_USER" property="jqRenewalUser" />
+
+        <result column="UPDATEDATE" property="updatedate" />
+        <result column="APPLYRISK" property="applyrisk" />
+        <result column="POLICYYEAR" property="policyyear" />
+        <result column="STATDAY" property="statday" />
+        <result column="OLDENDDATE" property="oldenddate" />
+        <result column="SY_RENEWAL_USER" property="syRenewalUser" />
+        <result column="GENJIN_USER_NAME" property="genjinUserName" />
+        <result column="ACCOUNTUSER" property="accountuser" />
+
+        <result column="ALLOT_DATE" property="allotDate" />
+        <result column="ALLOT_USER" property="allotUser" />
+        <result column="ALLOTCODE" property="allotcode" />
+        <result column="ALLOTMSG" property="allotmsg" />
+
+        <result column="TURNOVERCODE" property="turnovercode" />
+        <result column="TURNOVERMSG" property="turnovermsg" />
+
+        <result column="ACCOUNTCOM" property="accountcom" />
+        <result column="OLDACCOUNTCOM" property="oldaccountcom" />
+        <result column="OLDACCOUNTUSER" property="oldaccountuser" />
+        <result column="RELATEDRISKCODE" property="relatedriskcode" />
+        <result column="OLD_JBR" property="oldJbr" />
+        <result column="PROPOSALNO" property="proposalno" />
+    </resultMap>
+    <resultMap id="BaseVoResultMap" extends="BaseResultMap" type="com.linkwechat.coal.modules.xxxt.renewal.domain.vo.QwRenewalFramenoListVo">
+        <result column="renewalUserName" property="renewalUserName" />
+        <result column="syRenewalUserName" property="syRenewalUserName" />
+        <result column="syJqEnddate" property="syJqEnddate" />
+        <result column="syJqStartdate" property="syJqStartdate" />
+        <result column="jqstartdate" property="jqstartdate" />
+        <result column="jqenddate" property="jqenddate" />
+        <result column="systartdate" property="systartdate" />
+        <result column="syenddate" property="syenddate" />
+        <result column="seatcount" property="seatcount" />
+        <result column="enrolldate" property="enrolldate" />
+        <result column="purchaseprice" property="purchaseprice" />
+        <result column="exhaustscale" property="exhaustscale" />
+        <result column="brandnamecode" property="brandnamecode" />
+        <result column="allotstatus" property="allotStatus" />
+
+        <!-- 本年保单 字段 -->
+        <result column="tn_insuredhabits"  			property="tnInsuredhabits" />
+        <result column="tn_startdate"               property="tnStartdate" />
+        <result column="tn_enddate"                 property="tnEnddate" />
+        <result column="tn_jqdiscount"              property="tnJqdiscount" />
+        <result column="tn_lastsyc27"               property="tnLastsyc27" />
+        <result column="tn_lastsyc29"               property="tnLastsyc29" />
+        <result column="tn_sydiscount"              property="tnSydiscount" />
+        <result column="tn_policyno"                property="tnPolicyno" />
+        <result column="tn_subproposalno"           property="tnSubproposalno" />
+        <result column="tn_kind"                    property="tnKind" />
+        <result column="tn_jqsumgrosspremium"       property="tnJqsumgrosspremium" />
+        <result column="tn_sysumgrosspremium"       property="tnSysumgrosspremium" />
+        <result column="tn_jqscfeerate"             property="tnJqscfeerate" />
+        <result column="tn_syscfeerate"             property="tnSyscfeerate" />
+        <result column="tn_finaldiscount"           property="tnFinaldiscount" />
+        <result column="tn_zmscore"                 property="tnZmscore" />
+        <result column="tn_autobuyflag"             property="tnAutobuyflag" />
+        <result column="tn_unautobuyreason"         property="tnUnautobuyreason" />
+        <result column="tn_nofinaldiscount"         property="tnNofinaldiscount" />
+        <result column="tn_finaldiscounttop"        property="tnFinaldiscounttop" />
+        <result column="tn_zzxslower"               property="tnZzxslower" />
+
+    </resultMap>
+    <resultMap id="BaseVoAssociationResultMap" extends="BaseVoResultMap" type="com.linkwechat.coal.modules.xxxt.renewal.domain.vo.QwRenewalFramenoListVo">
+        <result  column="appointmentTimeStart" property="appointmentTimeStart" />
+        <result  column="appointmentTimeEnd" property="appointmentTimeEnd" />
+        <association property="accountuserName" column="accountuser" select="com.linkwechat.coal.modules.xxxt.renewal.mapper.QwRenewalFramenoListMapper.selectByAccountuserName"/>
+        <association property="genjinUserName"
+                     column="{genjinUser=GENJIN_USER, genjinUserName=GENJIN_USER_NAME}"
+                     select="com.linkwechat.coal.modules.xxxt.renewal.mapper.QwRenewalFramenoListMapper.selectByGenjinUserName">
+        </association>
+        <association property="qwGenjinMsg"
+                     javaType="com.linkwechat.coal.modules.xxxt.renewal.domain.entity.QwGenjinMsg"
+                     select="com.linkwechat.coal.modules.xxxt.renewal.mapper.QwGenjinMsgMapper.selectAppointmentTimeByPolicyno6"
+                     column="{
+                     lisenseno=LISENSENO,
+                     frameno=FRAMENO,
+                     engineno=ENGINENO,
+                     oldjqpolicyno=OLDJQPOLICYNO,
+                     oldsypolicyno=OLDSYPOLICYNO,
+                     oldjqenddate=OLDJQENDDATE,
+                     appointmentTimeStart=appointmentTimeStart,
+                     appointmentTimeEnd=appointmentTimeEnd
+                     }">
+
+            <result column="APPOINTMENT_TIME" property="appointmentTime" />
+            <result column="APPOINTMENT_REMAKE" property="appointmentRemake" />
+            <result column="OLDJQPOLICYNO" property="oldjqpolicyno" />
+        </association>
+
+    </resultMap>
+    <!-- 通用查询结果列 -->
+    <sql id="Base_Column_List">
+        LISENSENO, FRAMENO, ENGINENO, MODELCNAME, COMCODE, COMPANYCNAME, AGENTCODE, AGENTNAME, NETPOINTCODE, NETPOINTSNAME, SALESMANCODE,
+        USERCNAME, OLDJQPOLICYNO, OLDJQSTARTDATE, OLDJQENDDATE, OLDSYPOLICYNO, OLDSYSTARTDATE, OLDSYENDDATE, APPLICODE, APPLINAME,
+        APPCONTACTPHONE, JQPOLICYNO, SYPOLICYNO, NEWCARUSETYPE, NEWCARKIND, NEWCARKINDSUB, LAW_ID, IS_AUDIT, GENJIN_USER, STATUS, JQ_RENEWAL_USER,
+        UPDATEDATE, APPLYRISK, POLICYYEAR, STATDAY,OLDENDDATE,SY_RENEWAL_USER, GENJIN_USER_NAME, ACCOUNTUSER, ALLOT_DATE, ALLOT_USER,
+        ALLOTCODE, ALLOTMSG, TURNOVERCODE, TURNOVERMSG, OLD_JBR
+    </sql>
+    <update id="updateGenjinUser">
+        update QW_RENEWAL_FRAMENO_LIST a
+        set
+        a.GENJIN_USER=#{userId},
+        a.GENJIN_USER_NAME = #{userName},
+        a.ALLOT_USER=#{allotUser},
+        a.ALLOT_DATE = #{allotDate, jdbcType=TIMESTAMP},
+        a.ALLOTCODE = #{turnovercode},
+        a.ALLOTMSG = NVL2(a.ALLOTMSG, a.ALLOTMSG || ',' || #{turnovercode}, #{turnovercode})
+        where
+        a.LISENSENO = #{qwRenewalAllot.lisenseno}
+        AND a.FRAMENO =#{qwRenewalAllot.frameno}
+        AND a.ENGINENO =#{qwRenewalAllot.engineno}
+        AND a.oldjqpolicyno =#{qwRenewalAllot.oldjqpolicyno}
+        AND trunc(a.oldjqenddate) =trunc(#{qwRenewalAllot.oldjqenddate})
+        <if test="qwRenewalAllot.oldsypolicyno == null or qwRenewalAllot.oldsypolicyno ==''">
+            AND a.oldsypolicyno ='0'
+        </if>
+        <if test="qwRenewalAllot.oldsypolicyno != null and qwRenewalAllot.oldsypolicyno !=''">
+            AND a.oldsypolicyno = #{qwRenewalAllot.oldsypolicyno}
+        </if>
+
+    </update>
+    <select id="selectAllotcodeIsNull" resultType="int">
+        select count(1) from QW_RENEWAL_FRAMENO_LIST a
+        where
+        a.ALLOTCODE IS NULL
+        and a.LISENSENO = #{qwRenewalAllot.lisenseno}
+        AND a.FRAMENO =#{qwRenewalAllot.frameno}
+        AND a.ENGINENO =#{qwRenewalAllot.engineno}
+        AND a.oldjqpolicyno =#{qwRenewalAllot.oldjqpolicyno}
+        AND trunc(a.oldjqenddate) =trunc(#{qwRenewalAllot.oldjqenddate})
+        <if test="qwRenewalAllot.oldsypolicyno == null or qwRenewalAllot.oldsypolicyno ==''">
+            AND a.oldsypolicyno ='0'
+        </if>
+        <if test="qwRenewalAllot.oldsypolicyno != null and qwRenewalAllot.oldsypolicyno !=''">
+            AND a.oldsypolicyno = #{qwRenewalAllot.oldsypolicyno}
+        </if>
+    </select>
+    <update id="updateTurnover">
+        update QW_RENEWAL_FRAMENO_LIST a
+        set
+        a.GENJIN_USER=#{userId},
+        a.GENJIN_USER_NAME = #{userName},
+        a.TURNOVERCODE = #{turnovercode},
+        a.TURNOVERMSG = NVL2(a.TURNOVERMSG, a.TURNOVERMSG || ',' || #{turnovercode}, #{turnovercode})
+        where
+        a.LISENSENO = #{qwRenewalAllot.lisenseno}
+        AND a.FRAMENO =#{qwRenewalAllot.frameno}
+        AND a.ENGINENO =#{qwRenewalAllot.engineno}
+        AND a.oldjqpolicyno =#{qwRenewalAllot.oldjqpolicyno}
+        AND trunc(a.oldjqenddate) =trunc(#{qwRenewalAllot.oldjqenddate})
+        <if test="qwRenewalAllot.oldsypolicyno == null or qwRenewalAllot.oldsypolicyno ==''">
+            AND a.oldsypolicyno ='0'
+        </if>
+        <if test="qwRenewalAllot.oldsypolicyno != null and qwRenewalAllot.oldsypolicyno !=''">
+            AND a.oldsypolicyno = #{qwRenewalAllot.oldsypolicyno}
+        </if>
+    </update>
+    <select id="selectByAccountuserName" resultType="string">
+        <if test="accountuser != null and accountuser !=''">
+            SELECT NVL((select username from sauser@dblink_sales t where t.usercode=#{accountuser}),
+            (select t.codecname || '--' || t.remark from ggcode@cx_dblink t where t.codetype = 'HandlerAccount' and t.codecode=#{accountuser})
+            ) as accountusername
+            from DUAL
+        </if>
+    </select>
+    <select id="selectByGenjinUserName" resultType="string">
+        <if test="genjinUserName == null or genjinUserName ==''" >
+            SELECT
+            NVL((select username from sauser@dblink_sales t where t.usercode=#{genjinUser}),
+            (select NETPOINTNAME from prpdnetpoint@dblink_sales t where t.NETPOINTCODE=#{genjinUser}))AS genjinUserName
+            from DUAL
+        </if>
+        <if test="genjinUserName != null and genjinUserName !=''" >
+            SELECT
+            #{genjinUserName} AS genjinUserName
+            from DUAL
+        </if>
+    </select>
+    <sql id="Base_Column_List_selectWhere">
+        SELECT
+        a.lisenseno,
+        a.frameno,
+        a.engineno,
+        a.modelcname,
+        a.comcode,
+        a.companycname,
+        a.agentcode,
+        a.agentname,
+        a.netpointcode,
+        a.netpointsname,
+        a.salesmancode,
+        a.usercname,
+        a.oldjqpolicyno,
+        a.oldjqstartdate,
+        a.oldjqenddate,
+        decode(a.oldsypolicyno,'0','', a.oldsypolicyno ) oldsypolicyno,
+        a.oldsystartdate,
+        a.oldsyenddate,
+
+        NVL2(a.oldjqstartdate,'交:' || to_char(a.oldjqstartdate, 'yyyy-MM-dd'),'')
+        ||
+        NVL2(a.oldsystartdate, '&lt;br/&gt;' || '商:' || to_char(a.oldsystartdate, 'yyyy-MM-dd'), '') AS syJqStartdate,
+
+        NVL2(a.oldjqenddate,'交:' || to_char(a.oldjqenddate, 'yyyy-MM-dd'),'')
+        ||
+        NVL2(a.oldsyenddate, '&lt;br/&gt;' || '商:' || to_char(a.oldsyenddate, 'yyyy-MM-dd'), '') AS syJqEnddate,
+        a.applicode,
+        a.appliname,
+        a.appcontactphone,
+        a.jqpolicyno,
+        a.sypolicyno,
+        a.newcarusetype,
+        a.newcarkind,
+        a.newcarkindsub,
+        a.LAW_ID,
+        a.IS_AUDIT,
+        a.GENJIN_USER,
+        a.GENJIN_USER_NAME,
+        a.STATUS,
+        a.JQ_RENEWAL_USER,
+        jq.NETPOINTNAME AS renewalUserName,
+        a.UPDATEDATE,
+        a.APPLYRISK,
+        a.POLICYYEAR,
+        a.STATDAY,
+        a.OLDENDDATE,
+        a.SY_RENEWAL_USER,
+        sy.NETPOINTNAME AS syRenewalUserName,
+        NVL2(a.GENJIN_USER,'1','0') AS allotstatus,
+        NVL(a.ACCOUNTUSER, a.OLDACCOUNTUSER) ACCOUNTUSER,
+        a.TURNOVERCODE,
+        a.TURNOVERMSG,
+        a.RELATEDRISKCODE,
+        a.OLD_JBR,
+        a.PROPOSALNO,
+        #{appointmentTimeStart} as appointmentTimeStart,
+        #{appointmentTimeEnd} as appointmentTimeEnd,
+
+        case d.insuredhabits
+            when '1' then '单交'
+            when '2' then '交三'
+            when '3' then '主全'
+            else ''
+        end as tn_insuredhabits,
+        d.startdate as tn_startdate,
+        d.enddate as tn_enddate,
+        d.jqdiscount as tn_jqdiscount,
+        d.lastsyc27 as tn_lastsyc27,
+        d.lastsyc29 as tn_lastsyc29,
+        d.sydiscount as tn_sydiscount,
+        d.policyno as tn_policyno,
+        d.subproposalno as tn_subproposalno,
+        d.kind as tn_kind,
+        d.jqsumgrosspremium as tn_jqsumgrosspremium,
+        d.sysumgrosspremium as tn_sysumgrosspremium,
+        d.jqscfeerate as tn_jqscfeerate,
+        d.syscfeerate as tn_syscfeerate,
+        d.finaldiscount as tn_finaldiscount,
+        d.zmscore as tn_zmscore,
+        case d.autobuyflag when '1' then '满足' else '不满足' end as tn_autobuyflag,
+        d.unautobuyreason as tn_unautobuyreason,
+        d.nofinaldiscount as tn_nofinaldiscount,
+        d.finaldiscounttop as tn_finaldiscounttop,
+        d.zzxslower as tn_zzxslower
+        FROM
+        QW_RENEWAL_FRAMENO_LIST a
+        <if test="appointmentTimeStart != null and appointmentTimeEnd != null">
+            join (select
+            *
+            from (select t.*,
+            row_number() over(partition by LISENSENO, FRAMENO, ENGINENO,  OLDJQPOLICYNO, OLDSYPOLICYNO, OLDJQENDDATE order by NVL(t.appointment_time,t.CREATE_TIME) desc) ss
+            from QW_GENJIN_MSG t
+            )
+            where ss = 1) b
+            on a.lisenseno=b.lisenseno
+            and a.frameno=b.frameno
+            and a.engineno=b.engineno
+            and a.oldjqpolicyno=b.oldjqpolicyno
+            and a.oldsypolicyno=b.oldsypolicyno
+            and a.oldjqenddate=b.oldjqenddate
+        </if>
+        LEFT JOIN prpdnetpoint@dblink_sales jq ON jq.NETPOINTCODE = a.JQ_RENEWAL_USER
+        LEFT JOIN prpdnetpoint@dblink_sales sy ON sy.NETPOINTCODE = a.SY_RENEWAL_USER
+        left join gusimulateresultform d
+            on a.oldjqpolicyno = d.jqpolicyno
+            and a.oldsypolicyno=d.sypolicyno
+            and a.proposalno=d.proposalno
+        <where>
+            <if test="appointmentTimeStart != null and appointmentTimeEnd != null">
+                AND trunc(b.appointment_time) between trunc(#{appointmentTimeStart}) and trunc(#{appointmentTimeEnd})
+            </if>
+            <if test="comcode != null and comcode !=''">
+                <choose>
+                    <when test="comcode.startsWith('37')">
+                        AND a.oldaccountcom IN (
+                        select companycode from cd_gglevelcompany@dblink_statdw  where level1com=#{comcode} or level2com=#{comcode} or level3com=#{comcode}or level4com=#{comcode} or level5com=#{comcode}
+                        )
+                    </when>
+                    <otherwise>
+                        AND a.comcode IN (
+                        select companycode from cd_gglevelcompany@dblink_statdw  where level1com=#{comcode} or level2com=#{comcode} or level3com=#{comcode}or level4com=#{comcode} or level5com=#{comcode}
+                        )
+                    </otherwise>
+                </choose>
+            </if>
+            <if test="comcodeNotin != null and comcodeNotin.size()>0">
+                <foreach collection="comcodeNotin" item="item" index="i" >
+                    and a.comcode not like  #{item} || '%'
+                </foreach>
+            </if>
+            <if test="dfComcode != null and dfComcode !=''">
+                <choose>
+                    <when test="comcode.startsWith('37')">
+                        AND a.oldaccountcom IN (
+                        select comcode
+                        from SaCompany@dblink_sales
+                        where validstatus = '1'
+                        start with comcode = #{dfComcode}
+                        connect by prior comcode = uppercomcode
+                        and prior comcode != comcode
+                        )
+                    </when>
+                    <otherwise>
+                        AND a.comcode IN (
+                        select comcode
+                        from SaCompany@dblink_sales
+                        where validstatus = '1'
+                        start with comcode = #{dfComcode}
+                        connect by prior comcode = uppercomcode
+                        and prior comcode != comcode
+                        )
+                    </otherwise>
+                </choose>
+            </if>
+            <if test="netpointcode != null and netpointcode.length > 0 ">
+                AND a.netpointcode in
+                <foreach collection="netpointcode" index="item" item="item" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="agentcode != null and agentcode.length > 0 ">
+                AND a.agentcode in
+                <foreach collection="agentcode" index="item" item="item" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="lisenseno != null and lisenseno !=''">
+                AND a.lisenseno like #{lisenseno} ||'%'
+            </if>
+            <if test="appcontactphone != null and appcontactphone !=''">
+                AND a.appcontactphone = #{appcontactphone}
+            </if>
+            <if test="frameno != null and frameno !=''">
+                AND a.frameno=#{frameno}
+            </if>
+            <if test="engineno != null and engineno !=''">
+                AND a.engineno=#{engineno}
+            </if>
+            <if test="oldjqpolicyno != null and oldjqpolicyno !=''">
+                AND a.oldjqpolicyno=#{oldjqpolicyno}
+            </if>
+            <if test="oldsypolicyno != null and oldsypolicyno !=''">
+                AND a.oldsypolicyno=#{oldsypolicyno}
+            </if>
+            <if test="relatedriskcode != null and relatedriskcode !=''">
+                AND a.relatedriskcode=#{relatedriskcode}
+            </if>
+            <if test="appliname != null and appliname !=''">
+                AND a.appliname like '%'||#{appliname}||'%'
+            </if>
+            <if test="accountuserName != null and accountuserName !=''">
+                AND NVL(a.ACCOUNTUSER, a.OLDACCOUNTUSER) in (
+                select usercode from sauser@dblink_sales t where t.username like '%'||#{accountuserName}||'%'
+                union all
+                select codecode from ggcode@cx_dblink t
+                where t.codetype = 'HandlerAccount' and
+                t.codecname like '%'||#{accountuserName}||'%'
+                )
+            </if>
+            <if test="startDate != null and endDate !=null">
+                <if test="carFlag != null and carFlag !='' and carFlag == '1'.toString()">
+                    AND  trunc(a.OLDJQENDDATE) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+                </if>
+                <if test="carFlag == null or carFlag =='' or carFlag != '1'.toString()">
+                    AND (trunc(a.OLDSYENDDATE) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+                    OR
+                    trunc(a.OLDJQENDDATE) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+                    )
+                </if>
+            </if>
+            <if test="yearStr != null and yearStr !=''">
+                <if test="carFlag != null and carFlag !='' and carFlag == '1'.toString()">
+                    AND   to_char(a.oldjqstartdate,'yyyy') =#{yearStr}
+                </if>
+                <if test="carFlag == null or carFlag =='' or carFlag != '1'.toString()">
+                    AND  (to_char(a.oldjqstartdate,'yyyy') =#{yearStr}
+                    OR
+                    to_char(a.oldsystartdate,'yyyy') =#{yearStr}
+                    )
+                </if>
+            </if>
+
+            <if test="status != null and status !=''" >
+                <choose>
+                    <when test="funType != null and funType !='' and funType == '1'.toString()">
+                        AND a.status in('0','7','1')
+                    </when>
+                    <otherwise>
+                        AND a.status=#{status}
+                    </otherwise>
+                </choose>
+            </if>
+            <if test="lawId != null and lawId !=''" >
+                AND a.law_id=#{lawId}
+            </if>
+            <if test="isAudit != null and isAudit == 1" >
+                AND a.is_audit=#{isAudit}
+            </if>
+            <if test="isAudit != null and isAudit !=''" >
+                <choose>
+                    <when test="isAudit == 1">
+                        AND a.is_audit=#{isAudit}
+                    </when>
+                    <otherwise>
+                        AND a.is_audit is null
+                    </otherwise>
+                </choose>
+            </if>
+            <if test="isAudit == null or isAudit == ''" >
+                AND a.is_audit='1'
+            </if>
+            <if test="genjinUserName != null and genjinUserName !=''" >
+                AND (a.GENJIN_USER in(
+                select usercode from sauser@dblink_sales t where t.username like '%' || #{genjinUserName} || '%'
+                union all
+                select netpointcode from prpdnetpoint@dblink_sales t where t.netpointname like '%' || #{genjinUserName} || '%'
+                )
+                or a.GENJIN_USER_NAME like  '%' || #{genjinUserName} || '%')
+            </if>
+            <if test="genjinUserList != null and genjinUserList.size() > 0">
+                AND a.GENJIN_USER in
+                <foreach collection="genjinUserList" index="item" item="item" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="genjinUser != null and genjinUser !=''">
+                AND a.GENJIN_USER =#{genjinUser}
+            </if>
+            <if test="genjinUserNullFlag != null and genjinUserNullFlag !='' and genjinUserNullFlag == '0'.toString()">
+                AND a.GENJIN_USER is not null
+            </if>
+            <if test="allotStatus != null and allotStatus !='' ">
+                <if test="allotStatus == 1">
+                    AND a.GENJIN_USER is not null
+                </if>
+                <if test="allotStatus == 0">
+                    AND a.GENJIN_USER is null
+                </if>
+            </if>
+            <if test="renewalUserName != null and renewalUserName !=''" >
+                AND a.JQ_RENEWAL_USER in(
+                select usercode from sauser@dblink_sales t where t.username like '%' || #{renewalUserName} || '%'
+                union all
+                select netpointcode from prpdnetpoint@dblink_sales t where t.netpointname like '%' || #{renewalUserName} || '%'
+                )
+            </if>
+        </where>
+        order by a.oldjqenddate desc
+    </sql>
+    <select id="selectWhere" resultMap="BaseVoAssociationResultMap" >
+        <include refid="Base_Column_List_selectWhere"/>
+    </select>
+    <select id="selectWhereExport" resultMap="BaseVoResultMap" >
+        <include refid="Base_Column_List_selectWhere"/>
+    </select>
+    <select id="selectByPolicyno"
+            resultType="com.linkwechat.coal.modules.xxxt.renewal.domain.vo.QwRenewalFramenoListVo">
+        SELECT
+            t1.startdate as jqstartdate,
+            t1.enddate as jqenddate,
+            t1.SEATCOUNT as seatcount,
+            t1.ENROLLDATE enrolldate,
+            t1.PURCHASEPRICE purchaseprice,
+            t1.EXHAUSTSCALE exhaustscale,
+            t1.BRANDNAMECODE brandnamecode
+        FROM
+            MID_CB_NEWPOLICY_DIM_CAR@dblink_statdw t1
+        WHERE t1.policyno=#{policyno}
+    </select>
+    <select id="selectGenjinWhere"
+            resultType="com.linkwechat.coal.modules.xxxt.renewal.domain.vo.QwRenewalFramenoGenjinListVo">
+        SELECT
+        a.lisenseno,
+        a.frameno,
+        a.engineno,
+        a.modelcname,
+        a.comcode,
+        a.companycname,
+        a.oldjqpolicyno,
+        a.oldjqstartdate,
+        a.oldjqenddate,
+        decode(a.oldsypolicyno,'0','', a.oldsypolicyno ) oldsypolicyno,
+        a.oldsystartdate,
+        a.oldsyenddate,
+        NVL2(a.oldjqstartdate,'交:' || to_char(a.oldjqstartdate, 'yyyy-MM-dd'),'')
+        ||
+        NVL2(a.oldsystartdate, '&lt;br/&gt;' || '商:' || to_char(a.oldsystartdate, 'yyyy-MM-dd'), '') AS syJqStartdate,
+
+        NVL2(a.oldjqenddate,'交:' || to_char(a.oldjqenddate, 'yyyy-MM-dd'),'')
+        ||
+        NVL2(a.oldsyenddate, '&lt;br/&gt;' || '商:' || to_char(a.oldsyenddate, 'yyyy-MM-dd'), '') AS syJqEnddate,
+
+        a.applicode,
+        a.appliname,
+        a.appcontactphone,
+        a.jqpolicyno,
+        a.sypolicyno,
+        a.newcarusetype,
+        a.newcarkind,
+        a.newcarkindsub,
+        g.genjin_user,
+        NVL((select username from sauser@dblink_sales t where t.usercode=g.GENJIN_USER),
+        (select NETPOINTNAME from prpdnetpoint@dblink_sales t where t.NETPOINTCODE=g.GENJIN_USER))AS genjinUserName,
+        g.GENJIN_FUN,
+        (SELECT t.dictvalue
+        FROM qw_sys_dict t
+        where t.dicttype = 'GENJIN_FUN'
+        and t.dictcode = g.GENJIN_FUN) genjinFunName,
+        g.GENJIN_STATUS as status,
+        g.ISSUE_DESIRE,
+        (SELECT t.dictvalue
+        FROM qw_sys_dict t
+        where t.dicttype = 'ISSUE_DESIRE'
+        and t.dictcode = g.ISSUE_DESIRE) issueDesireName,
+        g.APPLITYPE,
+        (SELECT t.dictvalue
+        FROM qw_sys_dict t
+        where t.dicttype = 'APPLITYPE'
+        and t.dictcode = g.APPLITYPE) applitypeName,
+        g.APPOINTMENT_TIME,
+        g.APPOINTMENT_REMAKE,
+        g.GENJIN_TIME ,
+        g.CREATE_BY ,
+        g.CREATE_TIME,
+        a.PROPOSALNO
+        FROM
+        (
+        <if test="appointmentTimeStart != null and appointmentTimeEnd !=null" >
+            select *
+            from (select t.*,
+            row_number() over(partition by LISENSENO, FRAMENO, ENGINENO, OLDJQPOLICYNO, OLDSYPOLICYNO, OLDJQENDDATE order by appointment_time desc) ss
+            from QW_GENJIN_MSG  t where t.appointment_time is not null)
+            where ss = 1
+        </if>
+        <if test="appointmentTimeStart == null or appointmentTimeEnd == null" >
+            QW_GENJIN_MSG
+        </if>
+        ) g
+        join  QW_RENEWAL_FRAMENO_LIST a
+        on a.lisenseno=g.lisenseno
+        and a.frameno=g.frameno
+        and g.engineno=a.engineno
+        and a.oldjqpolicyno=g.oldjqpolicyno
+        and a.oldsypolicyno=g.oldsypolicyno
+        and a.oldjqenddate=g.oldjqenddate
+        <where>
+            <if test="comcode != null and comcode !=''">
+                <choose>
+                    <when test="comcode.startsWith('37')">
+                        AND a.oldaccountcom IN (
+                        select companycode from cd_gglevelcompany@dblink_statdw  where level1com=#{comcode} or level2com=#{comcode} or level3com=#{comcode}or level4com=#{comcode} or level5com=#{comcode}
+                        )
+                    </when>
+                    <otherwise>
+                        AND a.comcode IN (
+                        select companycode from cd_gglevelcompany@dblink_statdw  where level1com=#{comcode} or level2com=#{comcode} or level3com=#{comcode}or level4com=#{comcode} or level5com=#{comcode}
+                        )
+                    </otherwise>
+                </choose>
+            </if>
+            <if test="comcodeNotin != null and comcodeNotin.size()>0">
+                <foreach collection="comcodeNotin" item="item" index="i" >
+                    and a.comcode not like  #{item} || '%'
+                </foreach>
+            </if>
+            <if test="dfComcode != null and dfComcode !=''">
+                <choose>
+                    <when test="comcode.startsWith('37')">
+                        AND a.oldaccountcom like #{comcode} || '%'
+                    </when>
+                    <when test="dfComcode != '00'">
+                        AND a.comcode like #{dfComcode} || '%'
+                    </when>
+                    <otherwise>
+                    </otherwise>
+                </choose>
+            </if>
+            <if test="lisenseno != null and lisenseno !=''">
+                AND a.lisenseno like #{lisenseno} ||'%'
+            </if>
+            <if test="appliname != null and appliname !=''">
+                AND a.appliname like '%'||#{appliname}||'%'
+            </if>
+            <if test="status != null and status !=''" >
+                AND g.GENJIN_STATUS=#{status}
+            </if>
+            <if test="appcontactphone != null and appcontactphone !=''" >
+                AND a.appcontactphone=#{appcontactphone}
+            </if>
+            <if test="yearStr != null and yearStr !=''">
+                AND  (to_char(a.oldjqstartdate,'yyyy') =#{yearStr}
+                OR
+                to_char(a.oldsystartdate,'yyyy') =#{yearStr}
+                )
+            </if>
+            <if test="startDate != null and endDate !=null" >
+                AND trunc(g.create_time) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+            </if>
+            <if test="appointmentTimeStart != null and appointmentTimeEnd !=null" >
+                AND trunc(g.appointment_time) between trunc(#{appointmentTimeStart, jdbcType=TIMESTAMP}) and trunc(#{appointmentTimeEnd, jdbcType=TIMESTAMP})
+            </if>
+            <if test="genjinUserList != null and genjinUserList.size() > 0">
+                AND g.CREATE_BY in
+                <foreach collection="genjinUserList" index="item" item="item" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="createBy != null and createBy !=''">
+                AND g.CREATE_BY=#{createBy}
+            </if>
+            <if test="genjinUserNullFlag != null and genjinUserNullFlag !='' and genjinUserNullFlag == '0'.toString()">
+                AND g.CREATE_BY is not null
+            </if>
+        </where>
+        order by g.create_time desc, g.genjin_time desc, g.lisenseno,g.frameno,g.engineno
+    </select>
+    <select id="selectGenjinWhereNoCar"
+            resultType="com.linkwechat.coal.modules.xxxt.renewal.domain.vo.NoCarRenewalGenjinListVo">
+        SELECT
+        a.policyno,
+        a.comcode,
+        a.enddate syJqEnddate,
+        a.c_plan_code,
+        a.c_plan_name,
+        a.riskcode,
+        (select riskcname from prpdrisk@dblink_sales t where t.riskcode=a.riskcode) RISKNAME,
+        a.applycode,
+        a.applyname,
+        a.applyphone,
+        a.insuredcode,
+        a.insuredname,
+        a.sumpremium,
+        a.notaxpremium,
+        a.paydate,
+
+        g.genjin_user,
+        NVL((select username
+        from sauser@dblink_sales t
+        where t.usercode = g.GENJIN_USER),
+        (select NETPOINTNAME
+        from prpdnetpoint@dblink_sales t
+        where t.NETPOINTCODE = g.GENJIN_USER)) AS genjinUserName,
+        g.GENJIN_FUN,
+        g.GENJIN_STATUS as status,
+        g.ISSUE_DESIRE,
+        g.APPLITYPE,
+        g.APPOINTMENT_TIME,
+        g.APPOINTMENT_REMAKE,
+        g.GENJIN_TIME,
+        g.CREATE_BY,
+        g.CREATE_TIME
+        FROM QW_GENJIN_MSG g
+        join QW_MID_RENEWAL_GF_LIST a
+        on g.oldjqpolicyno = a.policyno
+        <where>
+            <if test="comcode != null and comcode !=''">
+                AND a.comcode IN (
+                select companycode from cd_gglevelcompany@dblink_statdw  where level1com=#{comcode} or level2com=#{comcode} or level3com=#{comcode}or level4com=#{comcode} or level5com=#{comcode}
+                )
+            </if>
+            <if test="comcodeNotin != null and comcodeNotin.size()>0">
+                <foreach collection="comcodeNotin" item="item" index="i" >
+                    and a.comcode not like  #{item} || '%'
+                </foreach>
+            </if>
+            <if test="dfComcode != null and dfComcode !=''">
+                AND a.comcode IN (
+                select comcode
+                from SaCompany@dblink_sales
+                where validstatus = '1'
+                start with comcode = #{dfComcode}
+                connect by prior comcode = uppercomcode
+                and prior comcode != comcode
+                )
+            </if>
+            <if test="policyno != null and policyno !=''">
+                AND a.policyno = #{policyno}
+            </if>
+            <if test="appliname != null and appliname !=''">
+                AND a.applyname like '%'||#{appliname}||'%'
+            </if>
+            <if test="status != null and status !=''" >
+                AND g.GENJIN_STATUS=#{status}
+            </if>
+            <if test="startDate != null and endDate !=null" >
+                AND trunc(g.create_time) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+            </if>
+            <if test="appointmentTimeStart != null and appointmentTimeEnd !=null" >
+                AND trunc(g.appointment_time) between trunc(#{appointmentTimeStart, jdbcType=TIMESTAMP}) and trunc(#{appointmentTimeEnd, jdbcType=TIMESTAMP})
+            </if>
+            <if test="genjinUserList != null and genjinUserList.size() > 0">
+                AND g.CREATE_BY in
+                <foreach collection="genjinUserList" index="item" item="item" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="createBy != null and createBy !=''">
+                AND g.CREATE_BY=#{createBy}
+            </if>
+            <if test="genjinUserNullFlag != null and genjinUserNullFlag !='' and genjinUserNullFlag == '0'.toString()">
+                AND g.CREATE_BY is not null
+            </if>
+        </where>
+        order by g.create_time desc, g.genjin_time desc, g.OLDJQPOLICYNO
+    </select>
+    <select id="selectPolicyno"
+            resultType="com.linkwechat.coal.modules.xxxt.renewal.domain.vo.QwRenewalPolicynoListVo">
+        SELECT
+        a.applicode,
+        a.appliname,
+        a.appcontactphone,
+        a.lisenseno,
+        a.frameno,
+        a.engineno,
+        a.oldjqpolicyno,
+        a.oldjqstartdate,
+        a.oldjqenddate,
+        decode(oldsypolicyno,'0','', oldsypolicyno) as oldsypolicyno,
+        a.oldsystartdate,
+        a.oldsyenddate,
+        NVL2(decode(oldsypolicyno,'0','', oldsypolicyno),
+        ('交:'|| oldjqpolicyno || '&lt;br/&gt;' || '商:'|| oldsypolicyno  ), ('交:'|| oldjqpolicyno)
+        ) as jqSyPolicyno,
+        NVL2(a.oldjqenddate,'交:' || to_char(a.oldjqstartdate, 'yyyy/MM/dd') || '-' || to_char(a.oldjqenddate, 'yyyy/MM/dd'),'')
+        ||
+        NVL2(a.oldsyenddate, '&lt;br/&gt; ' || '商:' || to_char(a.oldsystartdate, 'yyyy/MM/dd') || '-' || to_char(a.oldsyenddate, 'yyyy/MM/dd'), '')
+        AS startEnddate
+        FROM QW_RENEWAL_FRAMENO_LIST a
+        where a.appcontactphone in
+        <foreach collection="phones" item="item" index="item" open="(" separator="," close=")" >
+            #{item}
+        </foreach>
+        <if test="dfComcode != null and dfComcode !=''">
+            AND a.comcode IN (
+            select comcode
+            from SaCompany@dblink_sales
+            where validstatus = '1'
+            start with comcode = #{dfComcode}
+            connect by prior comcode = uppercomcode
+            and prior comcode != comcode
+            )
+        </if>
+        ORDER BY a.oldenddate DESC
+    </select>
+    <select id="selectMobileAndPolicyno"
+            resultType="com.linkwechat.coal.modules.xxxt.renewal.domain.entity.QwRenewalFramenoList">
+        SELECT
+        a.oldjqpolicyno,
+        a.oldsypolicyno,
+        a.appcontactphone
+        FROM QW_RENEWAL_FRAMENO_LIST a
+        <where>
+            <if test="lisenseno != null and lisenseno !=''">
+                AND a.lisenseno = #{lisenseno}
+            </if>
+            <if test="frameno != null and frameno !=''">
+                AND a.frameno=#{frameno}
+            </if>
+            <if test="engineno != null and engineno !=''">
+                AND a.engineno=#{engineno}
+            </if>
+            <if test="oldjqpolicyno != null and oldjqpolicyno !=''">
+                AND a.oldjqpolicyno=#{oldjqpolicyno}
+            </if>
+            <if test="oldjqenddate1 != null">
+                AND trunc(a.oldjqenddate) = trunc(#{oldjqenddate1})
+            </if>
+            <if test="oldsypolicyno != null and oldsypolicyno !=''">
+                AND a.oldsypolicyno=#{oldsypolicyno}
+            </if>
+            <if test="oldsypolicyno == null or oldsypolicyno ==''">
+                AND a.oldsypolicyno = '0'
+            </if>
+        </where>
+
+    </select>
+    <select id="selectMobile"
+            resultType="com.linkwechat.coal.modules.xxxt.renewal.domain.entity.QwRenewalFramenoList">
+        SELECT
+        a.oldjqpolicyno,
+        a.oldsypolicyno,
+        a.appcontactphone,
+        a.oldjqenddate,
+        a.oldsyenddate,
+        a.lisenseno
+        FROM QW_RENEWAL_FRAMENO_LIST a
+        where a.LISENSENO = #{qwRenewalAllot.lisenseno}
+        AND a.FRAMENO =#{qwRenewalAllot.frameno}
+        AND a.ENGINENO =#{qwRenewalAllot.engineno}
+        AND a.oldjqpolicyno =#{qwRenewalAllot.oldjqpolicyno}
+        <if test="qwRenewalAllot.oldsypolicyno == null or qwRenewalAllot.oldsypolicyno ==''">
+            AND a.oldsypolicyno ='0'
+        </if>
+        <if test="qwRenewalAllot.oldsypolicyno != null and qwRenewalAllot.oldsypolicyno !=''">
+            AND a.oldsypolicyno = #{qwRenewalAllot.oldsypolicyno}
+        </if>
+    </select>
+    <select id="selectByKey"
+            resultType="com.linkwechat.coal.modules.xxxt.renewal.domain.entity.QwRenewalFramenoList">
+        SELECT
+            <include refid="Base_Column_List"/>
+        FROM
+            QW_RENEWAL_FRAMENO_LIST A
+        where a.LISENSENO = #{lisenseno}
+        AND a.FRAMENO =#{frameno}
+        AND a.ENGINENO =#{engineno}
+        AND a.oldjqpolicyno =#{oldjqpolicyno}
+        <if test="oldjqenddate != null">
+            AND trunc(a.oldjqenddate) = trunc(#{oldjqenddate})
+        </if>
+        <if test="oldsypolicyno == null or oldsypolicyno ==''">
+            AND a.oldsypolicyno ='0'
+        </if>
+        <if test="oldsypolicyno != null and oldsypolicyno !=''">
+            AND a.oldsypolicyno = #{oldsypolicyno}
+        </if>
+    </select>
+
+
+</mapper>

+ 537 - 0
linkwe-chinacoal/bin/src/main/resources/mapper/modules/xxxt/renewal/QwRenewalFramenoOtherlistMapper.xml

@@ -0,0 +1,537 @@
+<?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.linkwechat.coal.modules.xxxt.renewal.mapper.QwRenewalFramenoOtherlistMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.linkwechat.coal.modules.xxxt.renewal.domain.entity.QwRenewalFramenoOtherlist">
+        <id column="LISENSENO" property="lisenseno" />
+        <result column="FRAMENO" property="frameno" />
+        <result column="ENGINENO" property="engineno" />
+        <result column="MODELCNAME" property="modelcname" />
+        <result column="COMCODE" property="comcode" />
+        <result column="COMPANYCNAME" property="companycname" />
+        <result column="AGENTCODE" property="agentcode" />
+        <result column="AGENTNAME" property="agentname" />
+        <result column="NETPOINTCODE" property="netpointcode" />
+        <result column="NETPOINTSNAME" property="netpointsname" />
+        <result column="SALESMANCODE" property="salesmancode" />
+        <result column="USERCNAME" property="usercname" />
+        <result column="OLDJQPOLICYNO" property="oldjqpolicyno" />
+        <result column="OLDJQSTARTDATE" property="oldjqstartdate" />
+        <result column="OLDJQENDDATE" property="oldjqenddate" />
+        <result column="OLDSYPOLICYNO" property="oldsypolicyno" />
+        <result column="OLDSYSTARTDATE" property="oldsystartdate" />
+        <result column="OLDSYENDDATE" property="oldsyenddate" />
+        <result column="APPLICODE" property="applicode" />
+        <result column="APPLINAME" property="appliname" />
+        <result column="APPCONTACTPHONE" property="appcontactphone" />
+        <result column="JQPOLICYNO" property="jqpolicyno" />
+        <result column="SYPOLICYNO" property="sypolicyno" />
+        <result column="NEWCARUSETYPE" property="newcarusetype" />
+        <result column="NEWCARKIND" property="newcarkind" />
+        <result column="NEWCARKINDSUB" property="newcarkindsub" />
+        <result column="LAW_ID" property="lawId" />
+        <result column="IS_AUDIT" property="isAudit" />
+        <result column="GENJIN_USER" property="genjinUser" />
+        <result column="STATUS" property="status" />
+        <result column="JQ_RENEWAL_USER" property="jqRenewalUser" />
+        <result column="UPDATEDATE" property="updatedate" />
+        <result column="APPLYRISK" property="applyrisk" />
+        <result column="POLICYYEAR" property="policyyear" />
+        <result column="STATDAY" property="statday" />
+        <result column="OLDENDDATE" property="oldenddate" />
+        <result column="SY_RENEWAL_USER" property="syRenewalUser" />
+        <result column="OLD_JQ_NEWSUMPRE" property="oldJqNewsumpre" />
+        <result column="OLD_SY_NEWSUMPRE" property="oldSyNewsumpre" />
+        <result column="JQ_NEWSUMPRE" property="jqNewsumpre" />
+        <result column="SY_NEWSUMPRE" property="syNewsumpre" />
+        <result column="GENJIN_USER_NAME" property="genjinUserName" />
+        <result column="ACCOUNTUSER" property="accountuser" />
+        <result column="ALLOT_DATE" property="allotDate" />
+        <result column="ALLOT_USER" property="allotUser" />
+        <result column="SALESCLERK" property="salesclerk" />
+        <result column="MANAGERCODE" property="managercode" />
+        <result column="TURNOVERCODE" property="turnovercode" />
+        <result column="TURNOVERMSG" property="turnovermsg" />
+        <result column="ALLOTCODE" property="allotcode" />
+        <result column="ALLOTMSG" property="allotmsg" />
+        <result column="ACCOUNTCOM" property="accountcom" />
+        <result column="OLDACCOUNTCOM" property="oldaccountcom" />
+        <result column="OLDACCOUNTUSER" property="oldaccountuser" />
+        <result column="RELATEDRISKCODE" property="relatedriskcode" />
+        <result column="XUBAODAYS" property="xubaodays" />
+        <result column="GENJIN_BATCHNO" property="genjinBatchno" />
+        <result column="SYS_ALLOT_STATUS" property="sysAllotStatus" />
+        <result column="OLD_JBR" property="oldJbr" />
+    </resultMap>
+    <resultMap id="BaseVoOtherlistResultMap" extends="BaseResultMap" type="com.linkwechat.coal.modules.xxxt.renewal.domain.vo.QwRenewalFramenoOtherlistVo">
+        <result  column="statusName" property="statusName" />
+        <result  column="allotStatusName" property="allotStatusName" />
+        <result  column="relatedriskcodeName" property="relatedriskcodeName" />
+        <result  column="appointmentTimeStart" property="appointmentTimeStart" />
+        <result  column="appointmentTimeEnd" property="appointmentTimeEnd" />
+        <association property="qwGenjinMsg"
+                     javaType="com.linkwechat.coal.modules.xxxt.renewal.domain.entity.QwGenjinMsg"
+                     select="com.linkwechat.coal.modules.xxxt.renewal.mapper.QwGenjinMsgMapper.selectAppointmentTimeByPolicyno6"
+                     column="{
+                     lisenseno=LISENSENO,
+                     frameno=FRAMENO,
+                     engineno=ENGINENO,
+                     oldjqpolicyno=OLDJQPOLICYNO,
+                     oldsypolicyno=OLDSYPOLICYNO,
+                     oldjqenddate=OLDJQENDDATE,
+                     appointmentTimeStart=appointmentTimeStart,
+                     appointmentTimeEnd=appointmentTimeEnd
+                     }">
+            <result column="APPOINTMENT_TIME" property="appointmentTime" />
+            <result column="APPOINTMENT_REMAKE" property="appointmentRemake" />
+            <result column="OLDJQPOLICYNO" property="oldjqpolicyno" />
+        </association>
+
+    </resultMap>
+    <resultMap id="BaseVoOtherlistResultMap2" extends="BaseResultMap" type="com.linkwechat.coal.modules.xxxt.renewal.domain.vo.QwRenewalFramenoOtherlistVo2">
+        <result  column="statusName" property="statusName" />
+        <result  column="allotStatusName" property="allotStatusName" />
+        <result  column="relatedriskcodeName" property="relatedriskcodeName" />
+        <result  column="appointmentTimeStart" property="appointmentTimeStart" />
+        <result  column="appointmentTimeEnd" property="appointmentTimeEnd" />
+        <association property="qwGenjinMsg"
+                     javaType="com.linkwechat.coal.modules.xxxt.renewal.domain.entity.QwGenjinMsg"
+                     select="com.linkwechat.coal.modules.xxxt.renewal.mapper.QwGenjinMsgMapper.selectAppointmentTimeByPolicyno6"
+                     column="{
+                     lisenseno=LISENSENO,
+                     frameno=FRAMENO,
+                     engineno=ENGINENO,
+                     oldjqpolicyno=OLDJQPOLICYNO,
+                     oldsypolicyno=OLDSYPOLICYNO,
+                     oldjqenddate=OLDJQENDDATE,
+                     appointmentTimeStart=appointmentTimeStart,
+                     appointmentTimeEnd=appointmentTimeEnd
+                     }">
+            <result column="APPOINTMENT_TIME" property="appointmentTime" />
+            <result column="APPOINTMENT_REMAKE" property="appointmentRemake" />
+            <result column="OLDJQPOLICYNO" property="oldjqpolicyno" />
+        </association>
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="Base_Column_List">
+        LISENSENO, FRAMENO, ENGINENO, MODELCNAME, COMCODE, COMPANYCNAME, AGENTCODE, AGENTNAME, NETPOINTCODE, NETPOINTSNAME, SALESMANCODE, USERCNAME, OLDJQPOLICYNO, OLDJQSTARTDATE, OLDJQENDDATE, OLDSYPOLICYNO, OLDSYSTARTDATE, OLDSYENDDATE, APPLICODE, APPLINAME, APPCONTACTPHONE, JQPOLICYNO, SYPOLICYNO, NEWCARUSETYPE, NEWCARKIND, NEWCARKINDSUB, LAW_ID, IS_AUDIT, GENJIN_USER, STATUS, JQ_RENEWAL_USER, UPDATEDATE, APPLYRISK, POLICYYEAR, STATDAY, OLDENDDATE, SY_RENEWAL_USER, OLD_JQ_NEWSUMPRE, OLD_SY_NEWSUMPRE, JQ_NEWSUMPRE, SY_NEWSUMPRE, GENJIN_USER_NAME, ACCOUNTUSER, ALLOT_DATE, ALLOT_USER, SALESCLERK, MANAGERCODE, TURNOVERCODE, TURNOVERMSG, ALLOTCODE, ALLOTMSG, ACCOUNTCOM, OLDACCOUNTCOM, OLDACCOUNTUSER, RELATEDRISKCODE, XUBAODAYS, GENJIN_BATCHNO, SYS_ALLOT_STATUS, OLD_JBR
+    </sql>
+    <sql id="Base_Column_List_selectWhere">
+        SELECT  /*+ LEADING(b a) USE_NL(a) */
+        a.lisenseno,
+        a.frameno,
+        a.engineno,
+        a.modelcname,
+        a.comcode,
+        a.companycname,
+        a.agentcode,
+        a.agentname,
+        a.netpointcode,
+        a.netpointsname,
+        a.salesmancode,
+        a.usercname,
+        a.oldjqpolicyno,
+        a.oldjqstartdate,
+        a.oldjqenddate,
+        decode(a.oldsypolicyno,'0','', a.oldsypolicyno ) oldsypolicyno,
+        a.oldsystartdate,
+        a.oldsyenddate,
+        NVL2(a.oldjqstartdate,'交:' || to_char(a.oldjqstartdate, 'yyyy-MM-dd'),'')
+        ||
+        NVL2(a.oldsystartdate, '&lt;br/&gt;' || '商:' || to_char(a.oldsystartdate, 'yyyy-MM-dd'), '') AS syJqStartdate,
+
+        NVL2(a.oldjqenddate,'交:' || to_char(a.oldjqenddate, 'yyyy-MM-dd'),'')
+        ||
+        NVL2(a.oldsyenddate, '&lt;br/&gt;' || '商:' || to_char(a.oldsyenddate, 'yyyy-MM-dd'), '') AS syJqEnddate,
+        a.applicode,
+        a.appliname,
+        a.appcontactphone,
+        a.jqpolicyno,
+        a.sypolicyno,
+        a.newcarusetype,
+        a.newcarkind,
+        a.newcarkindsub,
+        a.LAW_ID,
+        a.IS_AUDIT,
+        a.GENJIN_USER,
+        a.GENJIN_USER_NAME,
+        a.STATUS,
+        a.JQ_RENEWAL_USER,
+        a.UPDATEDATE,
+        a.APPLYRISK,
+        a.POLICYYEAR,
+        a.STATDAY,
+        a.OLDENDDATE,
+        a.SY_RENEWAL_USER,
+        NVL2(a.GENJIN_USER,'1','0') AS allotstatus,
+        NVL2(a.GENJIN_USER,'已分配','未分配') AS allotStatusName,
+        NVL(a.ACCOUNTUSER, a.OLDACCOUNTUSER) ACCOUNTUSER,
+        a.TURNOVERCODE,
+        a.TURNOVERMSG,
+        a.RELATEDRISKCODE,
+        a.OLD_JBR,
+        (SELECT T.DICTVALUE FROM QW_SYS_DICT T WHERE T.DICTTYPE = 'GENJIN_STATUS' AND T.DICTCODE=a.STATUS) AS statusName,
+        (SELECT T.DICTVALUE FROM QW_SYS_DICT T WHERE T.DICTTYPE = 'APPLYRISK1' AND T.DICTCODE=a.RELATEDRISKCODE) AS relatedriskcodeName,
+        #{appointmentTimeStart} as appointmentTimeStart,
+        #{appointmentTimeEnd} as appointmentTimeEnd
+        FROM
+        QW_RENEWAL_FRAMENO_OTHERLIST a
+        <if test="appointmentTimeStart != null and appointmentTimeEnd != null">
+            join (select
+            *
+            from (select t.*,
+            row_number() over(partition by LISENSENO, FRAMENO, ENGINENO,  OLDJQPOLICYNO, OLDSYPOLICYNO, OLDJQENDDATE order by NVL(t.appointment_time,t.CREATE_TIME) desc) ss
+            from QW_GENJIN_MSG t
+            )
+            where ss = 1) b
+            on a.lisenseno=b.lisenseno
+            and a.frameno=b.frameno
+            and a.engineno=b.engineno
+            and a.oldjqpolicyno=b.oldjqpolicyno
+            and a.oldsypolicyno=b.oldsypolicyno
+            and a.oldjqenddate=b.oldjqenddate
+        </if>
+        <where>
+            <if test="appointmentTimeStart != null and appointmentTimeEnd != null">
+                AND trunc(b.appointment_time) between trunc(#{appointmentTimeStart}) and trunc(#{appointmentTimeEnd})
+            </if>
+            <if test="comcode != null and comcode !=''">
+                <choose>
+                    <when test="comcode.startsWith('37')">
+                        AND a.oldaccountcom IN (
+                        select companycode from cd_gglevelcompany@dblink_statdw  where level1com=#{comcode} or level2com=#{comcode} or level3com=#{comcode}or level4com=#{comcode} or level5com=#{comcode}
+                        )
+                    </when>
+                    <otherwise>
+                        AND a.comcode IN (
+                        select companycode from cd_gglevelcompany@dblink_statdw  where level1com=#{comcode} or level2com=#{comcode} or level3com=#{comcode}or level4com=#{comcode} or level5com=#{comcode}
+                        )
+                    </otherwise>
+                </choose>
+            </if>
+            <if test="comcodeNotin != null and comcodeNotin.size()>0">
+                <foreach collection="comcodeNotin" item="item" index="i" >
+                    and a.comcode not like  #{item} || '%'
+                </foreach>
+            </if>
+            <if test="dfComcode != null and dfComcode !=''">
+                <choose>
+                    <when test="comcode.startsWith('37')">
+                        AND a.oldaccountcom IN (
+                        select comcode
+                        from SaCompany@dblink_sales
+                        where validstatus = '1'
+                        start with comcode = #{dfComcode}
+                        connect by prior comcode = uppercomcode
+                        and prior comcode != comcode
+                        )
+                    </when>
+                    <otherwise>
+                        AND a.comcode IN (
+                        select comcode
+                        from SaCompany@dblink_sales
+                        where validstatus = '1'
+                        start with comcode = #{dfComcode}
+                        connect by prior comcode = uppercomcode
+                        and prior comcode != comcode
+                        )
+                    </otherwise>
+                </choose>
+            </if>
+            <if test="lisenseno != null and lisenseno !=''">
+                AND a.lisenseno like #{lisenseno} ||'%'
+            </if>
+            <if test="appcontactphone != null and appcontactphone !=''">
+                AND a.appcontactphone = #{appcontactphone}
+            </if>
+            <if test="frameno != null and frameno !=''">
+                AND a.frameno=#{frameno}
+            </if>
+            <if test="engineno != null and engineno !=''">
+                AND a.engineno=#{engineno}
+            </if>
+            <if test="oldjqpolicyno != null and oldjqpolicyno !=''">
+                AND a.oldjqpolicyno=#{oldjqpolicyno}
+            </if>
+            <if test="oldsypolicyno != null and oldsypolicyno !=''">
+                AND a.oldsypolicyno=#{oldsypolicyno}
+            </if>
+            <if test="relatedriskcode != null and relatedriskcode !=''">
+                AND a.relatedriskcode=#{relatedriskcode}
+            </if>
+            <if test="appliname != null and appliname !=''">
+                AND a.appliname like '%'||#{appliname}||'%'
+            </if>
+            <if test="startDate != null and endDate !=null">
+                <if test="carFlag != null and carFlag !='' and carFlag == '1'.toString()">
+                    AND  trunc(a.OLDJQENDDATE) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+                </if>
+                <if test="carFlag == null or carFlag =='' or carFlag != '1'.toString()">
+                    AND (trunc(a.OLDSYENDDATE) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+                    OR
+                    trunc(a.OLDJQENDDATE) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+                    )
+                </if>
+            </if>
+            <if test="yearStr != null and yearStr !=''">
+                <if test="carFlag != null and carFlag !='' and carFlag == '1'.toString()">
+                    AND   to_char(a.oldjqstartdate,'yyyy') =#{yearStr}
+                </if>
+                <if test="carFlag == null or carFlag =='' or carFlag != '1'.toString()">
+                    AND  (to_char(a.oldjqstartdate,'yyyy') =#{yearStr}
+                    OR
+                    to_char(a.oldsystartdate,'yyyy') =#{yearStr}
+                    )
+                </if>
+            </if>
+            <if test="status != null and status !=''" >
+                AND a.status=#{status}
+            </if>
+            <if test="genjinUserName != null and genjinUserName !=''" >
+                AND a.GENJIN_USER_NAME like  '%' || #{genjinUserName} || '%')
+            </if>
+            <if test="genjinUserList != null and genjinUserList.size() > 0">
+                AND a.GENJIN_USER in
+                <foreach collection="genjinUserList" index="item" item="item" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="genjinUser != null and genjinUser !=''">
+                AND a.GENJIN_USER =#{genjinUser}
+            </if>
+            <if test="genjinUserNullFlag != null and genjinUserNullFlag !='' and genjinUserNullFlag == '0'.toString()">
+                AND a.GENJIN_USER is not null
+            </if>
+            <if test="allotStatus != null and allotStatus !='' ">
+                <if test="allotStatus == 1">
+                    AND a.GENJIN_USER is not null
+                </if>
+                <if test="allotStatus == 0">
+                    AND a.GENJIN_USER is null
+                </if>
+            </if>
+        </where>
+    </sql>
+    <update id="updateGenjinUser">
+        update QW_RENEWAL_FRAMENO_OTHERLIST a
+        set
+        a.GENJIN_USER=#{userId},
+        a.GENJIN_USER_NAME = #{userName},
+        a.ALLOT_USER=#{allotUser},
+        a.ALLOT_DATE = #{allotDate, jdbcType=TIMESTAMP},
+        a.ALLOTCODE = #{turnovercode},
+        a.ALLOTMSG = NVL2(a.ALLOTMSG, a.ALLOTMSG || ',' || #{turnovercode}, #{turnovercode})
+        where
+        a.LISENSENO = #{qwRenewalAllot.lisenseno}
+        AND a.FRAMENO =#{qwRenewalAllot.frameno}
+        AND a.ENGINENO =#{qwRenewalAllot.engineno}
+        AND a.oldjqpolicyno =#{qwRenewalAllot.oldjqpolicyno}
+        AND trunc(a.oldjqenddate) =trunc(#{qwRenewalAllot.oldjqenddate})
+        <if test="qwRenewalAllot.oldsypolicyno == null or qwRenewalAllot.oldsypolicyno ==''">
+            AND a.oldsypolicyno ='0'
+        </if>
+        <if test="qwRenewalAllot.oldsypolicyno != null and qwRenewalAllot.oldsypolicyno !=''">
+            AND a.oldsypolicyno = #{qwRenewalAllot.oldsypolicyno}
+        </if>
+    </update>
+    <update id="updateTurnover">
+        update QW_RENEWAL_FRAMENO_OTHERLIST a
+        set
+        a.GENJIN_USER=#{userId},
+        a.GENJIN_USER_NAME = #{userName},
+        a.TURNOVERCODE = #{turnovercode},
+        a.TURNOVERMSG = NVL2(a.TURNOVERMSG, a.TURNOVERMSG || ',' || #{turnovercode}, #{turnovercode})
+        where
+        a.LISENSENO = #{qwRenewalAllot.lisenseno}
+        AND a.FRAMENO =#{qwRenewalAllot.frameno}
+        AND a.ENGINENO =#{qwRenewalAllot.engineno}
+        AND a.oldjqpolicyno =#{qwRenewalAllot.oldjqpolicyno}
+        AND trunc(a.oldjqenddate) =trunc(#{qwRenewalAllot.oldjqenddate})
+        <if test="qwRenewalAllot.oldsypolicyno == null or qwRenewalAllot.oldsypolicyno ==''">
+            AND a.oldsypolicyno ='0'
+        </if>
+        <if test="qwRenewalAllot.oldsypolicyno != null and qwRenewalAllot.oldsypolicyno !=''">
+            AND a.oldsypolicyno = #{qwRenewalAllot.oldsypolicyno}
+        </if>
+    </update>
+    <select id="selectWhere" resultMap="BaseVoOtherlistResultMap" >
+        <include refid="Base_Column_List_selectWhere"/>
+    </select>
+    <select id="selectWhere2"
+            resultMap="BaseVoOtherlistResultMap2">
+        <include refid="Base_Column_List_selectWhere"/>
+    </select>
+    <select id="selectAllotcodeIsNull" resultType="java.lang.Integer">
+        select count(1) from QW_RENEWAL_FRAMENO_OTHERLIST a
+        where
+        a.ALLOTCODE IS NULL
+        and a.LISENSENO = #{qwRenewalAllot.lisenseno}
+        AND a.FRAMENO =#{qwRenewalAllot.frameno}
+        AND a.ENGINENO =#{qwRenewalAllot.engineno}
+        AND a.oldjqpolicyno =#{qwRenewalAllot.oldjqpolicyno}
+        AND trunc(a.oldjqenddate) =trunc(#{qwRenewalAllot.oldjqenddate})
+        <if test="qwRenewalAllot.oldsypolicyno == null or qwRenewalAllot.oldsypolicyno ==''">
+            AND a.oldsypolicyno ='0'
+        </if>
+        <if test="qwRenewalAllot.oldsypolicyno != null and qwRenewalAllot.oldsypolicyno !=''">
+            AND a.oldsypolicyno = #{qwRenewalAllot.oldsypolicyno}
+        </if>
+    </select>
+    <select id="selectGenjinWhere"
+            resultType="com.linkwechat.coal.modules.xxxt.renewal.domain.vo.QwRenewalFramenoOtherGenjinListVo">
+        SELECT
+        a.lisenseno,
+        a.frameno,
+        a.engineno,
+        a.modelcname,
+        a.comcode,
+        a.companycname,
+        a.oldjqpolicyno,
+        a.oldjqstartdate,
+        a.oldjqenddate,
+        decode(a.oldsypolicyno,'0','', a.oldsypolicyno ) oldsypolicyno,
+        a.oldsystartdate,
+        a.oldsyenddate,
+        NVL2(a.oldjqstartdate,'交:' || to_char(a.oldjqstartdate, 'yyyy-MM-dd'),'')
+        ||
+        NVL2(a.oldsystartdate, '&lt;br/&gt;' || '商:' || to_char(a.oldsystartdate, 'yyyy-MM-dd'), '') AS syJqStartdate,
+
+        NVL2(a.oldjqenddate,'交:' || to_char(a.oldjqenddate, 'yyyy-MM-dd'),'')
+        ||
+        NVL2(a.oldsyenddate, '&lt;br/&gt;' || '商:' || to_char(a.oldsyenddate, 'yyyy-MM-dd'), '') AS syJqEnddate,
+
+        a.applicode,
+        a.appliname,
+        a.appcontactphone,
+        a.jqpolicyno,
+        a.sypolicyno,
+        a.newcarusetype,
+        a.newcarkind,
+        a.newcarkindsub,
+        a.genjin_user,
+        a.GENJIN_USER_NAME,
+        g.GENJIN_FUN,
+        g.GENJIN_STATUS as status,
+        g.ISSUE_DESIRE,
+        g.APPLITYPE,
+        g.APPOINTMENT_TIME,
+        g.APPOINTMENT_REMAKE,
+        g.GENJIN_TIME ,
+        g.CREATE_BY ,
+        g.CREATE_TIME
+        FROM
+        (
+        <if test="appointmentTimeStart != null and appointmentTimeEnd !=null" >
+            select *
+            from (select t.*,
+            row_number() over(partition by LISENSENO, FRAMENO, ENGINENO, OLDJQPOLICYNO, OLDSYPOLICYNO, OLDJQENDDATE order by appointment_time desc) ss
+            from QW_GENJIN_MSG  t where t.appointment_time is not null)
+            where ss = 1
+        </if>
+        <if test="appointmentTimeStart == null or appointmentTimeEnd == null" >
+            QW_GENJIN_MSG
+        </if>
+        ) g
+        join  QW_RENEWAL_FRAMENO_OTHERLIST a
+        on a.lisenseno=g.lisenseno
+        and a.frameno=g.frameno
+        and g.engineno=a.engineno
+        and a.oldjqpolicyno=g.oldjqpolicyno
+        and a.oldsypolicyno=g.oldsypolicyno
+        and a.oldjqenddate=g.oldjqenddate
+        <where>
+            <if test="comcode != null and comcode !=''">
+                <choose>
+                    <when test="comcode.startsWith('37')">
+                        AND a.oldaccountcom IN (
+                        select companycode from cd_gglevelcompany@dblink_statdw  where level1com=#{comcode} or level2com=#{comcode} or level3com=#{comcode}or level4com=#{comcode} or level5com=#{comcode}
+                        )
+                    </when>
+                    <otherwise>
+                        AND a.comcode IN (
+                        select companycode from cd_gglevelcompany@dblink_statdw  where level1com=#{comcode} or level2com=#{comcode} or level3com=#{comcode}or level4com=#{comcode} or level5com=#{comcode}
+                        )
+                    </otherwise>
+                </choose>
+            </if>
+            <if test="comcodeNotin != null and comcodeNotin.size()>0">
+                <foreach collection="comcodeNotin" item="item" index="i" >
+                    and a.comcode not like  #{item} || '%'
+                </foreach>
+            </if>
+            <if test="dfComcode != null and dfComcode !=''">
+                <choose>
+                    <when test="comcode.startsWith('37')">
+                        AND a.oldaccountcom like #{comcode} || '%'
+                    </when>
+                    <when test="dfComcode != '00'">
+                        AND a.comcode like #{dfComcode} || '%'
+                    </when>
+                    <otherwise>
+                    </otherwise>
+                </choose>
+            </if>
+            <if test="lisenseno != null and lisenseno !=''">
+                AND a.lisenseno like #{lisenseno} ||'%'
+            </if>
+            <if test="appliname != null and appliname !=''">
+                AND a.appliname like '%'||#{appliname}||'%'
+            </if>
+            <if test="status != null and status !=''" >
+                AND g.GENJIN_STATUS=#{status}
+            </if>
+            <if test="appcontactphone != null and appcontactphone !=''" >
+                AND a.appcontactphone=#{appcontactphone}
+            </if>
+            <if test="yearStr != null and yearStr !=''">
+                AND  (to_char(a.oldjqstartdate,'yyyy') =#{yearStr}
+                OR
+                to_char(a.oldsystartdate,'yyyy') =#{yearStr}
+                )
+            </if>
+            <if test="startDate != null and endDate !=null" >
+                AND trunc(g.create_time) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+            </if>
+            <if test="appointmentTimeStart != null and appointmentTimeEnd !=null" >
+                AND trunc(g.appointment_time) between trunc(#{appointmentTimeStart, jdbcType=TIMESTAMP}) and trunc(#{appointmentTimeEnd, jdbcType=TIMESTAMP})
+            </if>
+            <if test="genjinUserList != null and genjinUserList.size() > 0">
+                AND g.CREATE_BY in
+                <foreach collection="genjinUserList" index="item" item="item" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="createBy != null and createBy !=''">
+                AND g.CREATE_BY=#{createBy}
+            </if>
+            <if test="genjinUserNullFlag != null and genjinUserNullFlag !='' and genjinUserNullFlag == '0'.toString()">
+                AND g.CREATE_BY is not null
+            </if>
+        </where>
+        order by g.create_time desc, g.genjin_time desc, g.lisenseno,g.frameno,g.engineno
+    </select>
+    <select id="selectByKey"
+            resultType="com.linkwechat.coal.modules.xxxt.renewal.domain.entity.QwRenewalFramenoOtherlist">
+        SELECT
+        <include refid="Base_Column_List"/>
+        FROM
+        QW_RENEWAL_FRAMENO_OTHERLIST A
+        where a.LISENSENO = #{lisenseno}
+        AND a.FRAMENO =#{frameno}
+        AND a.ENGINENO =#{engineno}
+        AND a.oldjqpolicyno =#{oldjqpolicyno}
+        <if test="oldjqenddate != null">
+            AND trunc(a.oldjqenddate) =trunc(#{oldjqenddate})
+        </if>
+        <if test="oldsypolicyno == null or oldsypolicyno ==''">
+            AND a.oldsypolicyno ='0'
+        </if>
+        <if test="oldsypolicyno != null and oldsypolicyno !=''">
+            AND a.oldsypolicyno = #{oldsypolicyno}
+        </if>
+    </select>
+
+
+</mapper>

+ 43 - 0
linkwe-chinacoal/bin/src/main/resources/mapper/modules/xxxt/renewal/QwRenewalImportDataMapper.xml

@@ -0,0 +1,43 @@
+<?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.linkwechat.coal.modules.xxxt.renewal.mapper.QwRenewalImportDataMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.linkwechat.coal.modules.xxxt.renewal.domain.entity.QwRenewalImportData">
+        <id column="POLICYNO" property="policyno" />
+        <result column="BATCHNO" property="batchno" />
+        <result column="COMCODE" property="comcode" />
+        <result column="RISKCODE" property="riskcode" />
+        <result column="RISKNAME" property="riskname" />
+        <result column="STARTDATE" property="startdate" />
+        <result column="ENDDATE" property="enddate" />
+        <result column="PREMIUM" property="premium" />
+        <result column="APPLINAME" property="appliname" />
+        <result column="APPLIPHONE" property="appliphone" />
+        <result column="INSUREDNAME" property="insuredname" />
+        <result column="INSUREDPHONE" property="insuredphone" />
+        <result column="CXCS" property="cxcs" />
+        <result column="YJPK" property="yjpk" />
+        <result column="WJPK" property="wjpk" />
+        <result column="CARUSETYPE" property="carusetype" />
+        <result column="CAROWNER" property="carowner" />
+        <result column="CARAGE" property="carage" />
+        <result column="ENGINENO" property="engineno" />
+        <result column="NEWCARKIND" property="newcarkind" />
+        <result column="MODELCNAME" property="modelcname" />
+        <result column="LISENSENO" property="lisenseno" />
+        <result column="FRAMENO" property="frameno" />
+        <result column="XCGZJ" property="xcgzj" />
+        <result column="YWLY" property="ywly" />
+        <result column="DW" property="dw" />
+        <result column="REMARK1" property="remark1" />
+        <result column="REMARK2" property="remark2" />
+        <result column="REMARK3" property="remark3" />
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="Base_Column_List">
+        BATCHNO, COMCODE, POLICYNO, RISKCODE, RISKNAME, STARTDATE, ENDDATE, PREMIUM, APPLINAME, APPLIPHONE, INSUREDNAME, INSUREDPHONE, CXCS, YJPK, WJPK, CARUSETYPE, CAROWNER, CARAGE, ENGINENO, NEWCARKIND, MODELCNAME, LISENSENO, FRAMENO, XCGZJ, YWLY, DW, REMARK1, REMARK2, REMARK3
+    </sql>
+
+</mapper>

+ 23 - 0
linkwe-chinacoal/bin/src/main/resources/mapper/modules/xxxt/renewal/QwRenewalImportStatusMapper.xml

@@ -0,0 +1,23 @@
+<?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.linkwechat.coal.modules.xxxt.renewal.mapper.QwRenewalImportStatusMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.linkwechat.coal.modules.xxxt.renewal.domain.entity.QwRenewalImportStatus">
+        <id column="BATCHNO" property="batchno" />
+        <result column="FILENAME" property="filename" />
+        <result column="OPERATOR" property="operator" />
+        <result column="OPERATETIME" property="operatetime" />
+        <result column="STATUS" property="status" />
+        <result column="STATUS_REMARK" property="statusRemark" />
+        <result column="REMARK1" property="remark1" />
+        <result column="REMARK2" property="remark2" />
+        <result column="REMARK3" property="remark3" />
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="Base_Column_List">
+        BATCHNO, FILENAME, OPERATOR, OPERATETIME, STATUS, STATUS_REMARK, REMARK1, REMARK2, REMARK3
+    </sql>
+
+</mapper>

+ 150 - 0
linkwe-chinacoal/bin/src/main/resources/mapper/modules/xxxt/renewal/QwRenewalLawMapper.xml

@@ -0,0 +1,150 @@
+<?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.linkwechat.coal.modules.xxxt.renewal.mapper.QwRenewalLawMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.linkwechat.coal.modules.xxxt.renewal.domain.entity.QwRenewalLaw">
+        <id column="LAW_ID" property="lawId" />
+        <result column="COMCODE" property="comcode" />
+        <result column="AGENTCODE" property="agentcode" />
+        <result column="NETPOINTCODE" property="netpointcode" />
+        <result column="APPLYRISK" property="applyrisk" />
+        <result column="NEWCARUSETYPE" property="newcarusetype" />
+        <result column="NEWCARKIND" property="newcarkind" />
+        <result column="POLICYYEAR" property="policyyear" />
+        <result column="STATDAY" property="statday" />
+        <result column="GENJIN_USER" property="genjinUser" />
+        <result column="VALIDSTATUS" property="validstatus" />
+        <result column="REMAKE1" property="remake1" />
+        <result column="REMAKE2" property="remake2" />
+        <result column="REMAKE3" property="remake3" />
+        <result column="REMAKE4" property="remake4" />
+        <result column="REMAKE5" property="remake5" />
+        <result column="UPDATE_BY" property="updateBy" />
+        <result column="UPDATE_DATE" property="updateDate" />
+        <result column="CREATE_BY" property="createBy" />
+        <result column="CREATE_DATE" property="createDate" />
+    </resultMap>
+    <resultMap id="BaseVoResultMap" type="com.linkwechat.coal.modules.xxxt.renewal.domain.vo.QwRenewalLawVo" extends="BaseResultMap">
+        <result column="comname" property="comname" />
+        <result column="agentname" property="agentname" />
+        <result column="netpointname" property="netpointname" />
+        <result column="genjinUserName" property="genjinUserName" />
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="Base_Column_List">
+        LAW_ID, COMCODE, AGENTCODE, NETPOINTCODE, APPLYRISK, NEWCARUSETYPE, NEWCARKIND, POLICYYEAR, STATDAY, GENJIN_USER, VALIDSTATUS, REMAKE1, REMAKE2, REMAKE3, REMAKE4, REMAKE5, UPDATE_BY, UPDATE_DATE,
+        CREATE_BY, CREATE_DATE
+    </sql>
+    <update id="updateValidstatus">
+        UPDATE QW_RENEWAL_LAW
+        SET VALIDSTATUS=#{validstatus, jdbcType=VARCHAR},
+        UPDATE_BY=#{updateBy, jdbcType=VARCHAR},
+        UPDATE_DATE=#{updateDate, jdbcType=TIMESTAMP}
+        WHERE LAW_ID=#{lawId}
+    </update>
+    <select id="select" resultMap="BaseVoResultMap">
+        SELECT
+            a.LAW_ID,
+            a.COMCODE,
+            (select t.comcname from sacompany@dblink_sales t where t.comcode=a.COMCODE) as comname,
+            a.AGENTCODE,
+            (select t.agentname from prpdagent@dblink_sales t where t.AGENTCODE=a.AGENTCODE) as agentname,
+            a.NETPOINTCODE,
+            (select t.netpointname from prpdnetpoint@dblink_sales t where t.NETPOINTCODE=a.NETPOINTCODE) as netpointname,
+            a.APPLYRISK,
+            a.NEWCARUSETYPE,
+            a.NEWCARKIND,
+            a.POLICYYEAR,
+            a.STATDAY,
+            a.GENJIN_USER,
+            NVL((select username from sauser@dblink_sales t where t.usercode=a.GENJIN_USER),
+            (select NETPOINTNAME from prpdnetpoint@dblink_sales t where t.NETPOINTCODE=a.GENJIN_USER)) AS genjinUserName,
+            a.VALIDSTATUS,
+            a.REMAKE1,
+            a.REMAKE2,
+            a.REMAKE3,
+            a.REMAKE4,
+            a.REMAKE5,
+            a.UPDATE_BY,
+            a.UPDATE_DATE,
+            a.CREATE_BY,
+            a.CREATE_DATE
+        FROM QW_Renewal_law a
+        <where>
+            <if test="lawId != null and lawId !=''">
+                AND a.LAW_ID = #{lawId}
+            </if>
+            <if test="dfComcode != null and dfComcode !=''">
+                AND a.comcode  IN (
+                select comcode
+                from SaCompany@dblink_sales
+                where validstatus = '1'
+                start with comcode = #{dfComcode}
+                connect by prior comcode = uppercomcode
+                and prior comcode != comcode
+                )
+            </if>
+            <if test="comcode != null and comcode !=''">
+                AND a.comcode  IN (
+                select comcode
+                from SaCompany@dblink_sales
+                where validstatus = '1'
+                start with comcode = #{comcode}
+                connect by prior comcode = uppercomcode
+                and prior comcode != comcode
+                )
+            </if>
+            <if test="agentcode != null and agentcode !=''">
+                AND a.agentcode = #{agentcode}
+            </if>
+            <if test="netpointcode != null and netpointcode !=''">
+                AND a.netpointcode = #{netpointcode}
+            </if>
+            <if test="applyrisk != null">
+                AND a.applyrisk = #{applyrisk}
+            </if>
+            <if test="newcarusetype != null and newcarusetype !=''">
+                AND a.newcarusetype = #{newcarusetype}
+            </if>
+            <if test="newcarkind != null and newcarkind !=''">
+                AND a.newcarkind = #{newcarkind}
+            </if>
+            <if test="policyyear != null and policyyear !=''">
+                AND a.policyyear = #{policyyear}
+            </if>
+            <if test="statday != null and statday !=''">
+                AND a.statday = #{statday}
+            </if>
+            <if test="genjinUser != null and genjinUser !=''">
+                AND a.GENJIN_USER = #{genjinUser}
+            </if>
+            <choose>
+                <when test="validstatus != null and validstatus !=''">
+                    AND a.validstatus = #{validstatus}
+                </when>
+                <otherwise>
+                    AND a.validstatus = '1'
+                </otherwise>
+            </choose>
+            <if test="remake1 != null and remake1 !=''">
+                AND a.remake1 = #{remake1}
+            </if>
+            <if test="remake2 != null and remake2 !=''">
+                AND a.remake2 = #{remake2}
+            </if>
+            <if test="remake3 != null and remake3 !=''">
+                AND a.remake3 = #{remake3}
+            </if>
+            <if test="remake4 != null and remake4 !=''">
+                AND a.remake4 = #{remake4}
+            </if>
+            <if test="remake5 != null and remake5 !=''">
+                AND a.remake5 = #{remake5}
+            </if>
+        </where>
+        ORDER BY a.UPDATE_DATE DESC
+    </select>
+
+</mapper>

+ 94 - 0
linkwe-chinacoal/bin/src/main/resources/mapper/modules/xxxt/renewal/QwRenewalLawNMapper.xml

@@ -0,0 +1,94 @@
+<?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.linkwechat.coal.modules.xxxt.renewal.mapper.QwRenewalLawNMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.linkwechat.coal.modules.xxxt.renewal.domain.entity.QwRenewalLawN">
+        <id column="LAW_ID" property="lawId" />
+        <result column="COMCODE" property="comcode" />
+        <result column="XUBAO_DAYS" property="xubaoDays" />
+        <result column="GENJIN_TYPE" property="genjinType" />
+        <result column="NETPOINTCODE" property="netpointcode" />
+        <result column="AGENTCODE" property="agentcode" />
+        <result column="QUDAO_FZR" property="qudaoFzr" />
+        <result column="GENJIN_DAYS" property="genjinDays" />
+        <result column="WAIHU_FLAG" property="waihuFlag" />
+        <result column="WAIHU_FZR" property="waihuFzr" />
+        <result column="VALIDSTATUS" property="validstatus" />
+        <result column="REMAKE1" property="remake1" />
+        <result column="REMAKE2" property="remake2" />
+        <result column="REMAKE3" property="remake3" />
+        <result column="REMAKE4" property="remake4" />
+        <result column="REMAKE5" property="remake5" />
+        <result column="UPDATE_BY" property="updateBy" />
+        <result column="UPDATE_DATE" property="updateDate" />
+        <result column="CREATE_BY" property="createBy" />
+        <result column="CREATE_DATE" property="createDate" />
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="Base_Column_List">
+        A.LAW_ID, A.COMCODE, A.XUBAO_DAYS, A.GENJIN_TYPE, A.NETPOINTCODE,
+        A.AGENTCODE, A.QUDAO_FZR, A.GENJIN_DAYS, A.WAIHU_FLAG, A.WAIHU_FZR,
+        A.VALIDSTATUS,
+        A.REMAKE1, A.REMAKE2, A.REMAKE3, A.REMAKE4, A.REMAKE5,
+        A.UPDATE_BY, A.UPDATE_DATE, A.CREATE_BY, A.CREATE_DATE
+    </sql>
+    <sql id="Base_Column_List1">
+        LAW_ID, COMCODE, XUBAO_DAYS, GENJIN_TYPE, NETPOINTCODE,
+        AGENTCODE, QUDAO_FZR, GENJIN_DAYS, WAIHU_FLAG, WAIHU_FZR,
+        VALIDSTATUS,
+        REMAKE1, REMAKE2, REMAKE3, REMAKE4, REMAKE5,
+        UPDATE_BY, UPDATE_DATE, CREATE_BY, CREATE_DATE
+    </sql>
+    <insert id="bak">
+        INSERT INTO QW_RENEWAL_LAW_N_HIS(UPD_ID, <include refid="Base_Column_List1"/>)
+        SELECT #{updId}, <include refid="Base_Column_List"/> FROM QW_RENEWAL_LAW_N A WHERE A.LAW_ID=#{lawId}
+    </insert>
+    <select id="selectLawN" resultType="com.linkwechat.coal.modules.xxxt.renewal.domain.vo.QwRenewalLawNVo">
+        SELECT <include refid="Base_Column_List"/>,
+        (select t.comcname from sacompany@dblink_sales t where t.comcode=A.COMCODE) as comname,
+        (select t.agentname from prpdagent@dblink_sales t where t.AGENTCODE=A.AGENTCODE) as agentname,
+        (select t.netpointname from prpdnetpoint@dblink_sales t where t.NETPOINTCODE=A.NETPOINTCODE) as netpointname
+        FROM QW_RENEWAL_LAW_N A
+        <where>
+            <if test="lawId != null and lawId !=''">
+                AND A.LAW_ID = #{lawId}
+            </if>
+            <if test="comcode != null and comcode !=''">
+                AND A.COMCODE IN (
+                select comcode
+                from SaCompany@dblink_sales
+                where validstatus = '1'
+                start with comcode = #{comcode}
+                connect by prior comcode = uppercomcode
+                and prior comcode != comcode
+                )
+            </if>
+            <if test="dfComcode != null and dfComcode !=''">
+                AND A.COMCODE IN (
+                select comcode
+                from SaCompany@dblink_sales
+                where validstatus = '1'
+                start with comcode = #{dfComcode}
+                connect by prior comcode = uppercomcode
+                and prior comcode != comcode
+                )
+            </if>
+            <if test="genjinType != null and genjinType !=''">
+                AND A.GENJIN_TYPE = #{genjinType}
+            </if>
+            <if test="netpointcode != null and netpointcode !=''">
+                AND A.NETPOINTCODE = #{netpointcode}
+            </if>
+            <if test="agentcode != null and agentcode !=''">
+                AND A.AGENTCODE = #{agentcode}
+            </if>
+            <if test="validstatus != null and validstatus !=''">
+                AND A.VALIDSTATUS = #{validstatus}
+            </if>
+        </where>
+        ORDER BY A.COMCODE, A.AGENTCODE, A.NETPOINTCODE DESC
+    </select>
+
+</mapper>

+ 29 - 0
linkwe-chinacoal/bin/src/main/resources/mapper/modules/xxxt/renewal/QwRenewalTurnoverMapper.xml

@@ -0,0 +1,29 @@
+<?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.linkwechat.coal.modules.xxxt.renewal.mapper.QwRenewalTurnoverMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.linkwechat.coal.modules.xxxt.renewal.domain.entity.QwRenewalTurnover">
+        <result column="TURNOVERCODE" property="turnovercode" jdbcType="VARCHAR"/>
+        <result column="TURNOVERUSER" property="turnoveruser" jdbcType="VARCHAR"/>
+        <result column="TURNOVERUSERNAME" property="turnoverusername" jdbcType="VARCHAR"/>
+        <result column="TURNOVERDATE" property="turnoverdate" jdbcType="TIMESTAMP"/>
+        <result column="ACCEPTUSER" property="acceptuser" jdbcType="VARCHAR"/>
+        <result column="ACCEPTUSERNAME" property="acceptusername" jdbcType="VARCHAR"/>
+        <result column="TURNOVERINFO" property="turnoverinfo" jdbcType="VARCHAR"/>
+        <result column="CRTDATE" property="crtdate" jdbcType="TIMESTAMP"/>
+        <result column="CRTUSER" property="crtuser" jdbcType="VARCHAR"/>
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="Base_Column_List">
+        TURNOVERCODE, TURNOVERUSER, TURNOVERUSERNAME, TURNOVERDATE, ACCEPTUSER, ACCEPTUSERNAME, TURNOVERINFO, CRTDATE, CRTUSER
+    </sql>
+    <select id="selectByKey"
+            resultMap="BaseResultMap">
+        SELECT <include refid="Base_Column_List"/>
+            FROM QW_RENEWAL_TURNOVER
+        WHERE TURNOVERCODE = #{turnovercode}
+    </select>
+
+</mapper>

+ 2106 - 0
linkwe-chinacoal/bin/src/main/resources/mapper/modules/xxxt/renewal/QwSqlScriptMapper.xml

@@ -0,0 +1,2106 @@
+<?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.linkwechat.coal.modules.xxxt.renewal.mapper.QwSqlScriptMapper">
+
+    <select id="selectBjjl" resultType="com.linkwechat.coal.modules.xxxt.renewal.domain.vo.BjjlVo">
+        select distinct
+            a.proposalno  proposalno,
+            a.inputdate,
+            f.underwriteind,
+            a.appliname   appliname,
+            a.inputdate operatedate,
+            nvl(jqSuminsured,0) jqSuminsured,
+            nvl(jqSumgrosspremium,0) jqSumgrosspremium,
+            nvl(sySuminsured,0) sySuminsured,
+            nvl(sySumgrosspremium,0) sySumgrosspremium,
+            f.operatorcode,
+            #{lisenseno} as lisenseno,
+            nvl(tax.sumpaytax,0) sumpaytax,
+            (nvl(tax.sumpaytax,0)+nvl(jqSumgrosspremium,0)+nvl(sySumgrosspremium,0)) sumgrosspremium
+        from guproposalmain@${dblink} a
+        left join (select max(proposalno) proposalno,
+            max(case when riskcode = '0330' then
+                SUMINSURED
+                end) jqSuminsured,
+            max(case when riskcode = '0330' then
+                b.SUMGROSSPREMIUM
+                end) jqSumgrosspremium,
+            max(case when riskcode like '036%' then
+                SUMINSURED
+                end) sySuminsured,
+            max(case when riskcode like '036%' then
+                b.SUMGROSSPREMIUM
+                end) sySumgrosspremium
+            from guproposalrisk@${dblink} b
+            where exists (select 1
+                from guproposalitemmotor@${dblink} t
+                where b.proposalno = t.proposalno
+                and t.licenseno = #{lisenseno})
+                group by b.proposalno) c
+            on c.proposalno = a.proposalno
+        left join guproposalitemmotor@${dblink} d
+            on a.proposalno = d.proposalno
+        left join QW_RENEWAL_FRAMENO_LIST e
+            on e.lisenseno = d.licenseno
+        LEFT JOIN guproposalmain@${dblink} f
+            on a.proposalno = f.proposalno
+        left join guproposalcarshiptax@${dblink} tax
+            on a.proposalno = tax.proposalno
+        where a.wechatopenid like '%'||#{phone}||'%'
+            and trunc(a.inputdate)
+            between
+                (trunc(LEAST(NVL(e.OLDSYENDDATE, e.OLDJQENDDATE), e.OLDJQENDDATE)) - 60)
+                AND
+                (trunc(greatest(NVL(e.OLDSYENDDATE, e.OLDJQENDDATE), e.OLDJQENDDATE)) + 10) --原保单终保时间前60天到终保时间范围内的报价记录
+            AND d.licenseno = #{lisenseno}
+
+        order by a.inputdate desc
+    </select>
+    <select id="selectSyxRisk" resultType="com.linkwechat.coal.modules.xxxt.renewal.domain.vo.HisInsureVo$SyxRisk">
+        SELECT
+            a.kindcode,
+            b.kindcname kindcname,
+            sum(a.notaxpremium)  notaxpremium,
+            sum(a.amount) amount
+        FROM mid_cb_premium_kind_all@dblink_statdw a
+        left join cd_kind0616@dblink_statdw b
+            on a.riskcode = b.riskcode
+            and a.kindcode = b.kindcode
+        WHERE a.policyno = #{sypolicyno}
+        group by a.kindcode,b.kindcname
+        order by a.kindcode
+    </select>
+    <select id="selectSumSyx" resultType="com.linkwechat.coal.modules.xxxt.renewal.domain.vo.HisInsureVo$Syx">
+        select
+            aa.policyno ,
+            aa.premium ,
+            bb.discount ,
+            bb.ncdfactor ,
+            bb.ClaimAdjust as claimAdjust
+        from
+            (SELECT a.policyno     ,
+                sum(a.premium) premium
+            FROM mid_cb_premium_kind_all@dblink_statdw a
+            WHERE a.policyno = #{sypolicyno}
+            group by a.policyno) aa
+        left join
+            (SELECT distinct a.policyno ,
+                a.discount     ,--建议折扣率
+                a.ncdfactor    ,--无赔优调整系数
+                b.ClaimAdjust   --交通违法调整系数
+            FROM mid_cb_premium_kind_all@dblink_statdw a
+            left join (select subpolicyno, rate / 100 as ClaimAdjust
+               from ODS.ODS_gupolicyriskprofit@dblink_statdw
+              where profitcode in ('C09', 'G09')) b
+            on a.policyno = b.subpolicyno
+            WHERE a.policyno = #{sypolicyno})bb
+        on bb.policyno=aa.policyno
+    </select>
+    <select id="selectSumJqx" resultType="com.linkwechat.coal.modules.xxxt.renewal.domain.vo.HisInsureVo$Jqx">
+    select
+        aa.policyno policyno,
+        aa.premium premium,
+        aa.amount amount,
+        bb.SUMPAYTAX sumpaytax
+    from (  SELECT policyno, sum(a.premium) premium, sum(a.amount) amount
+            FROM mid_cb_premium_kind_all@dblink_statdw a
+            WHERE a.policyno = #{jqpolicyno}
+            group by policyno) aa
+    left join (select subpolicyno policyno, sum(nvl(SUMPAYTAX, 0)) SUMPAYTAX
+        from ods.ODS_GUPOLICYCOPYCARSHIPTAX@dblink_statdw
+        where subpolicyno = #{jqpolicyno}
+        group by subpolicyno) bb
+    on bb.policyno = aa.policyno
+    </select>
+    <select id="selectClaim" resultType="com.linkwechat.coal.modules.xxxt.renewal.domain.vo.HisClaimVo">
+        SELECT
+            a.policyno,
+            a.registno registno,
+            a.claimno claimno,
+            a.damagedate damagedate,
+            a.claimdate claimdate,
+            dam.name name,
+            a.damageaddress damageaddress,
+            decode(c.injuredflag, '1', '是', '否') injuredflag,
+            decode(a.REPLACEREPAYFLAG, '1', '是', '否') replacerepayflag,
+            case
+                when b.endcaseflag = '4' then
+                '是'
+                else
+                '否'
+                end endcaseflag,
+            decode(a.ZEROENDFLAG, '1', '是', '否') zeroendflag,
+            b.endcasedate as endcasedate,
+            case
+                when b.claimno is null then
+                '未结案'
+                else
+                '已结案'
+                end as claimstatus,
+            c.sumpaid as sumpaid,
+            decode(a.policyno, NVL(#{oldjqpolicyno, jdbcType=VARCHAR},''), '交强险',NVL(#{oldsypolicyno, jdbcType=VARCHAR},''), '商业险', '' ) policynoType
+        FROM mid_lp_newclaim_dim_car@dblink_statdw a
+        left join mid_lp_endcase_all@dblink_statdw b
+            on a.claimno = b.claimno
+            and b.endcaseflag not in ('2', '5')
+        left join (SELECT loss.claimno,
+                    sum(nvl(loss.injuredflag, 0)) injuredflag,
+                    sum(sumpaid) sumpaid
+                    FROM mid_lp_settleloss_risk_all@dblink_statdw loss
+                    group by loss.claimno) c
+                on a.claimno = c.claimno
+        left join
+            (select cxyy.codecode as id,
+            cxyy.codecname as name
+            from bistat.cd_ggcode@dblink_statdw cxyy
+            WHERE CODETYPE = 'DamageCode'
+            ) dam
+            on   a.damagereason=dam.id
+        WHERE a.policyno in(#{oldjqpolicyno, jdbcType=VARCHAR}, #{oldsypolicyno, jdbcType=VARCHAR})
+    </select>
+    <select id="carCount" resultType="com.linkwechat.coal.modules.xxxt.renewal.domain.vo.CarCountVo">
+        SELECT t.comcode,
+               (SELECT a.comcname FROM SaCompany@dblink_sales a where a.comcode=t.comcode) as comcname,
+               sum(t.day_ying) day_ying, sum(t.day_yi)day_yi,(sum(t.day_lv) || '%') day_lv,
+               sum(t.month_ying)month_ying, sum(t.month_yi)month_yi,(sum(t.month_lv)  || '%')month_lv,
+               sum(t.year_ying)year_ying, sum(t.year_yi)year_yi,(sum(t.year_lv)  || '%')year_lv
+        FROM (
+                -- 昨日
+                SELECT aaa.comcode,
+                   sum(aaa.ying) day_ying,
+                   sum(aaa.yi) day_yi,
+                   DECODE(sum(aaa.ying),
+                          0,
+                          0,
+                          (ROUND(sum(aaa.yi) / sum(aaa.ying), 4) * 100)) as day_lv,
+                   0 month_ying,
+                   0 month_yi,
+                   0 month_lv,
+                   0 year_ying,
+                   0 year_yi,
+                   0 year_lv
+                FROM (SELECT substr(a.comcode, 1, 4) comcode, count(1) ying, 0 as yi -- 应续保数量
+                          FROM QW_RENEWAL_FRAMENO_LIST a
+                         where
+                            (
+                            TO_CHAR(trunc(a.oldjqenddate), 'yyyy-MM-dd') = TO_CHAR(sysdate-1, 'yyyy-MM-dd')
+                            or TO_CHAR(trunc(a.oldsyenddate), 'yyyy-MM-dd') = TO_CHAR(sysdate-1, 'yyyy-MM-dd')
+                            )
+                            <if test="comcodeNotin != null and comcodeNotin.size()>0">
+                                <foreach collection="comcodeNotin" item="item" index="i" >
+                                    and a.comcode not like  #{item} || '%'
+                                </foreach>
+                            </if>
+                            <if test="genjinUserList != null and genjinUserList.size() > 0">
+                                AND a.GENJIN_USER in
+                                <foreach collection="genjinUserList" index="item" item="item" open="(" close=")" separator=",">
+                                    #{item}
+                                </foreach>
+                            </if>
+                            <if test="genjinUser != null and genjinUser !=''">
+                                AND a.GENJIN_USER =#{genjinUser}
+                            </if>
+                            <if test="genjinUserNullFlag != null and genjinUserNullFlag !='' and genjinUserNullFlag == '0'.toString()">
+                                AND a.GENJIN_USER is not null
+                            </if>
+                         group by substr(a.comcode, 1, 4)
+                        union all
+                        SELECT substr(a.comcode, 1, 4) comcode, 0, count(1) yi -- 已续保数量
+                          FROM QW_RENEWAL_FRAMENO_LIST a
+                         where (
+                                TO_CHAR(trunc(a.oldjqenddate), 'yyyy-MM-dd') = TO_CHAR(sysdate-1, 'yyyy-MM-dd')
+                                or TO_CHAR(trunc(a.oldsyenddate), 'yyyy-MM-dd') = TO_CHAR(sysdate-1, 'yyyy-MM-dd')
+                                )
+                            <if test="comcodeNotin != null and comcodeNotin.size()>0">
+                                <foreach collection="comcodeNotin" item="item" index="i" >
+                                    and a.comcode not like  #{item} || '%'
+                                </foreach>
+                            </if>
+                            <if test="genjinUserList != null and genjinUserList.size() > 0">
+                                AND a.GENJIN_USER in
+                                <foreach collection="genjinUserList" index="item" item="item" open="(" close=")" separator=",">
+                                    #{item}
+                                </foreach>
+                            </if>
+                            <if test="genjinUser != null and genjinUser !=''">
+                                AND a.GENJIN_USER =#{genjinUser}
+                            </if>
+                            <if test="genjinUserNullFlag != null and genjinUserNullFlag !='' and genjinUserNullFlag == '0'.toString()">
+                                AND a.GENJIN_USER is not null
+                            </if>
+                           and (a.jqpolicyno is not null or a.sypolicyno is not null)
+                         group by substr(a.comcode, 1, 4)) aaa
+                group by aaa.comcode
+                union all
+                 -- 本月
+                SELECT aaa.comcode,
+                       0,
+                       0,
+                       0,
+                       sum(aaa.ying) ying,
+                       sum(aaa.yi) yi,
+                       DECODE(sum(aaa.ying),
+                              0,
+                              0,
+                              (ROUND(sum(aaa.yi) / sum(aaa.ying), 4) * 100)),
+                       0,
+                       0,
+                       0
+                FROM (SELECT substr(a.comcode, 1, 4) comcode, count(1) ying, 0 as yi -- 应续保数量
+                          FROM QW_RENEWAL_FRAMENO_LIST a
+                         where
+                            (
+                            TO_CHAR(trunc(a.oldjqenddate), 'yyyy-MM') = TO_CHAR(sysdate, 'yyyy-MM')
+                            or TO_CHAR(trunc(a.oldsyenddate), 'yyyy-MM') = TO_CHAR(sysdate, 'yyyy-MM')
+                            )
+                        <if test="comcodeNotin != null and comcodeNotin.size()>0">
+                            <foreach collection="comcodeNotin" item="item" index="i" >
+                                and a.comcode not like  #{item} || '%'
+                            </foreach>
+                        </if>
+                        <if test="genjinUserList != null and genjinUserList.size() > 0">
+                            AND a.GENJIN_USER in
+                            <foreach collection="genjinUserList" index="item" item="item" open="(" close=")" separator=",">
+                                #{item}
+                            </foreach>
+                        </if>
+                        <if test="genjinUser != null and genjinUser !=''">
+                            AND a.GENJIN_USER =#{genjinUser}
+                        </if>
+                        <if test="genjinUserNullFlag != null and genjinUserNullFlag !='' and genjinUserNullFlag == '0'.toString()">
+                            AND a.GENJIN_USER is not null
+                        </if>
+                         group by substr(a.comcode, 1, 4)
+                        union all
+                        SELECT substr(a.comcode, 1, 4) comcode, 0, count(1) yi -- 已续保数量
+                          FROM QW_RENEWAL_FRAMENO_LIST a
+                         where (
+                                TO_CHAR(trunc(a.oldjqenddate), 'yyyy-MM') = TO_CHAR(sysdate, 'yyyy-MM')
+                                or TO_CHAR(trunc(a.oldsyenddate), 'yyyy-MM') = TO_CHAR(sysdate, 'yyyy-MM')
+                                )
+                            <if test="comcodeNotin != null and comcodeNotin.size()>0">
+                                <foreach collection="comcodeNotin" item="item" index="i" >
+                                    and a.comcode not like  #{item} || '%'
+                                </foreach>
+                            </if>
+                            <if test="genjinUserList != null and genjinUserList.size() > 0">
+                                AND a.GENJIN_USER in
+                                <foreach collection="genjinUserList" index="item" item="item" open="(" close=")" separator=",">
+                                    #{item}
+                                </foreach>
+                            </if>
+                            <if test="genjinUser != null and genjinUser !=''">
+                                AND a.GENJIN_USER =#{genjinUser}
+                            </if>
+                            <if test="genjinUserNullFlag != null and genjinUserNullFlag !='' and genjinUserNullFlag == '0'.toString()">
+                                AND a.GENJIN_USER is not null
+                            </if>
+                           and (a.jqpolicyno is not null or a.sypolicyno is not null)
+                         group by substr(a.comcode, 1, 4)) aaa
+                group by aaa.comcode
+                union all
+                -- 本年
+                SELECT aaa.comcode,
+                       0,
+                       0,
+                       0,
+                       0,
+                       0,
+                       0,
+                       sum(aaa.ying) ying,
+                       sum(aaa.yi) yi,
+                       DECODE(sum(aaa.ying),
+                              0,
+                              0,
+                              (ROUND(sum(aaa.yi) / sum(aaa.ying), 4) * 100))
+                FROM (SELECT substr(a.comcode, 1, 4) comcode, count(1) ying, 0 as yi -- 应续保数量
+                          FROM QW_RENEWAL_FRAMENO_LIST a
+                         where (
+                                TO_CHAR(trunc(a.oldjqenddate), 'yyyy') = TO_CHAR(sysdate, 'yyyy')
+                                or TO_CHAR(trunc(a.oldsyenddate), 'yyyy') = TO_CHAR(sysdate, 'yyyy')
+                                )
+                        <if test="comcodeNotin != null and comcodeNotin.size()>0">
+                            <foreach collection="comcodeNotin" item="item" index="i" >
+                                and a.comcode not like  #{item} || '%'
+                            </foreach>
+                        </if>
+                        <if test="genjinUserList != null and genjinUserList.size() > 0">
+                            AND a.GENJIN_USER in
+                            <foreach collection="genjinUserList" index="item" item="item" open="(" close=")" separator=",">
+                                #{item}
+                            </foreach>
+                        </if>
+                        <if test="genjinUser != null and genjinUser !=''">
+                            AND a.GENJIN_USER =#{genjinUser}
+                        </if>
+                        <if test="genjinUserNullFlag != null and genjinUserNullFlag !='' and genjinUserNullFlag == '0'.toString()">
+                            AND a.GENJIN_USER is not null
+                        </if>
+                         group by substr(a.comcode, 1, 4)
+                        union all
+                        SELECT substr(a.comcode, 1, 4) comcode, 0, count(1) yi -- 已续保数量
+                          FROM QW_RENEWAL_FRAMENO_LIST a
+                         where (
+                                TO_CHAR(trunc(a.oldjqenddate), 'yyyy') = TO_CHAR(sysdate, 'yyyy')
+                                or TO_CHAR(trunc(a.oldsyenddate), 'yyyy') = TO_CHAR(sysdate, 'yyyy')
+                                )
+                            <if test="comcodeNotin != null and comcodeNotin.size()>0">
+                                <foreach collection="comcodeNotin" item="item" index="i" >
+                                    and a.comcode not like  #{item} || '%'
+                                </foreach>
+                            </if>
+                            <if test="genjinUserList != null and genjinUserList.size() > 0">
+                                AND a.GENJIN_USER in
+                                <foreach collection="genjinUserList" index="item" item="item" open="(" close=")" separator=",">
+                                    #{item}
+                                </foreach>
+                            </if>
+                            <if test="genjinUser != null and genjinUser !=''">
+                                AND a.GENJIN_USER =#{genjinUser}
+                            </if>
+                            <if test="genjinUserNullFlag != null and genjinUserNullFlag !='' and genjinUserNullFlag == '0'.toString()">
+                                AND a.GENJIN_USER is not null
+                            </if>
+                           and (a.jqpolicyno is not null or a.sypolicyno is not null)
+                         group by substr(a.comcode, 1, 4)) aaa
+                group by aaa.comcode
+
+        <if test="comcodeLength == 2">
+            union all
+            -- 昨日
+            SELECT aaa.comcode,
+            sum(aaa.ying) day_ying,
+            sum(aaa.yi) day_yi,
+            DECODE(sum(aaa.ying),
+            0,
+            0,
+            (ROUND(sum(aaa.yi) / sum(aaa.ying), 4) * 100)) as day_lv,
+            0 month_ying,
+            0 month_yi,
+            0 month_lv,
+            0 year_ying,
+            0 year_yi,
+            0 year_lv
+            FROM (SELECT substr(a.comcode, 1, 2) comcode, count(1) ying, 0 as yi -- 应续保数量
+            FROM QW_RENEWAL_FRAMENO_LIST a
+            where (
+                    TO_CHAR(trunc(a.oldjqenddate), 'yyyy-MM-dd') = TO_CHAR(sysdate-1, 'yyyy-MM-dd')
+                    or TO_CHAR(trunc(a.oldsyenddate), 'yyyy-MM-dd') = TO_CHAR(sysdate-1, 'yyyy-MM-dd')
+                    )
+            <if test="comcodeNotin != null and comcodeNotin.size()>0">
+                <foreach collection="comcodeNotin" item="item" index="i" >
+                    and a.comcode not like  #{item} || '%'
+                </foreach>
+            </if>
+            <if test="genjinUserList != null and genjinUserList.size() > 0">
+                AND a.GENJIN_USER in
+                <foreach collection="genjinUserList" index="item" item="item" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="genjinUser != null and genjinUser !=''">
+                AND a.GENJIN_USER =#{genjinUser}
+            </if>
+            <if test="genjinUserNullFlag != null and genjinUserNullFlag !='' and genjinUserNullFlag == '0'.toString()">
+                AND a.GENJIN_USER is not null
+            </if>
+            group by substr(a.comcode, 1, 2)
+            union all
+            SELECT substr(a.comcode, 1, 2) comcode, 0, count(1) yi -- 已续保数量
+            FROM QW_RENEWAL_FRAMENO_LIST a
+            where (
+                TO_CHAR(trunc(a.oldjqenddate), 'yyyy-MM-dd') = TO_CHAR(sysdate-1, 'yyyy-MM-dd')
+                or TO_CHAR(trunc(a.oldsyenddate), 'yyyy-MM-dd') = TO_CHAR(sysdate-1, 'yyyy-MM-dd')
+                )
+            <if test="comcodeNotin != null and comcodeNotin.size()>0">
+                <foreach collection="comcodeNotin" item="item" index="i" >
+                    and a.comcode not like  #{item} || '%'
+                </foreach>
+            </if>
+            <if test="genjinUserList != null and genjinUserList.size() > 0">
+                AND a.GENJIN_USER in
+                <foreach collection="genjinUserList" index="item" item="item" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="genjinUser != null and genjinUser !=''">
+                AND a.GENJIN_USER =#{genjinUser}
+            </if>
+            <if test="genjinUserNullFlag != null and genjinUserNullFlag !='' and genjinUserNullFlag == '0'.toString()">
+                AND a.GENJIN_USER is not null
+            </if>
+            and (a.jqpolicyno is not null or a.sypolicyno is not null)
+            group by substr(a.comcode, 1, 2)) aaa
+            group by aaa.comcode
+            union all
+            -- 本月
+            SELECT aaa.comcode,
+            0,
+            0,
+            0,
+            sum(aaa.ying) ying,
+            sum(aaa.yi) yi,
+            DECODE(sum(aaa.ying),
+            0,
+            0,
+            (ROUND(sum(aaa.yi) / sum(aaa.ying), 4) * 100)),
+            0,
+            0,
+            0
+            FROM (SELECT substr(a.comcode, 1, 2) comcode, count(1) ying, 0 as yi -- 应续保数量
+            FROM QW_RENEWAL_FRAMENO_LIST a
+            where (
+            TO_CHAR(trunc(a.oldjqenddate), 'yyyy-MM') = TO_CHAR(sysdate, 'yyyy-MM')
+            or TO_CHAR(trunc(a.oldsyenddate), 'yyyy-MM') = TO_CHAR(sysdate, 'yyyy-MM')
+            )
+            <if test="comcodeNotin != null and comcodeNotin.size()>0">
+                <foreach collection="comcodeNotin" item="item" index="i" >
+                    and a.comcode not like  #{item} || '%'
+                </foreach>
+            </if>
+            <if test="genjinUserList != null and genjinUserList.size() > 0">
+                AND a.GENJIN_USER in
+                <foreach collection="genjinUserList" index="item" item="item" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="genjinUser != null and genjinUser !=''">
+                AND a.GENJIN_USER =#{genjinUser}
+            </if>
+            <if test="genjinUserNullFlag != null and genjinUserNullFlag !='' and genjinUserNullFlag == '0'.toString()">
+                AND a.GENJIN_USER is not null
+            </if>
+            group by substr(a.comcode, 1, 2)
+            union all
+            SELECT substr(a.comcode, 1, 2) comcode, 0, count(1) yi -- 已续保数量
+            FROM QW_RENEWAL_FRAMENO_LIST a
+            where (
+                TO_CHAR(trunc(a.oldjqenddate), 'yyyy-MM') = TO_CHAR(sysdate, 'yyyy-MM')
+                or TO_CHAR(trunc(a.oldsyenddate), 'yyyy-MM') = TO_CHAR(sysdate, 'yyyy-MM')
+                )
+            <if test="comcodeNotin != null and comcodeNotin.size()>0">
+                <foreach collection="comcodeNotin" item="item" index="i" >
+                    and a.comcode not like  #{item} || '%'
+                </foreach>
+            </if>
+            <if test="genjinUserList != null and genjinUserList.size() > 0">
+                AND a.GENJIN_USER in
+                <foreach collection="genjinUserList" index="item" item="item" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="genjinUser != null and genjinUser !=''">
+                AND a.GENJIN_USER =#{genjinUser}
+            </if>
+            <if test="genjinUserNullFlag != null and genjinUserNullFlag !='' and genjinUserNullFlag == '0'.toString()">
+                AND a.GENJIN_USER is not null
+            </if>
+            and (a.jqpolicyno is not null or a.sypolicyno is not null)
+            group by substr(a.comcode, 1, 2)) aaa
+            group by aaa.comcode
+            union all
+            -- 本年
+            SELECT aaa.comcode,
+            0,
+            0,
+            0,
+            0,
+            0,
+            0,
+            sum(aaa.ying) ying,
+            sum(aaa.yi) yi,
+            DECODE(sum(aaa.ying),
+            0,
+            0,
+            (ROUND(sum(aaa.yi) / sum(aaa.ying), 4) * 100))
+            FROM (SELECT substr(a.comcode, 1, 2) comcode, count(1) ying, 0 as yi -- 应续保数量
+            FROM QW_RENEWAL_FRAMENO_LIST a
+            where (
+                    TO_CHAR(trunc(a.oldjqenddate), 'yyyy') = TO_CHAR(sysdate, 'yyyy')
+                    or TO_CHAR(trunc(a.oldsyenddate), 'yyyy') = TO_CHAR(sysdate, 'yyyy')
+                    )
+            <if test="comcodeNotin != null and comcodeNotin.size()>0">
+                <foreach collection="comcodeNotin" item="item" index="i" >
+                    and a.comcode not like  #{item} || '%'
+                </foreach>
+            </if>
+            <if test="genjinUserList != null and genjinUserList.size() > 0">
+                AND a.GENJIN_USER in
+                <foreach collection="genjinUserList" index="item" item="item" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="genjinUser != null and genjinUser !=''">
+                AND a.GENJIN_USER =#{genjinUser}
+            </if>
+            <if test="genjinUserNullFlag != null and genjinUserNullFlag !='' and genjinUserNullFlag == '0'.toString()">
+                AND a.GENJIN_USER is not null
+            </if>
+            group by substr(a.comcode, 1, 2)
+            union all
+            SELECT substr(a.comcode, 1, 2) comcode, 0, count(1) yi -- 已续保数量
+            FROM QW_RENEWAL_FRAMENO_LIST a
+            where (
+                    TO_CHAR(trunc(a.oldjqenddate), 'yyyy') = TO_CHAR(sysdate, 'yyyy')
+                    or TO_CHAR(trunc(a.oldsyenddate), 'yyyy') = TO_CHAR(sysdate, 'yyyy')
+                    )
+            <if test="comcodeNotin != null and comcodeNotin.size()>0">
+                <foreach collection="comcodeNotin" item="item" index="i" >
+                    and a.comcode not like  #{item} || '%'
+                </foreach>
+            </if>
+            <if test="genjinUserList != null and genjinUserList.size() > 0">
+                AND a.GENJIN_USER in
+                <foreach collection="genjinUserList" index="item" item="item" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="genjinUser != null and genjinUser !=''">
+                AND a.GENJIN_USER =#{genjinUser}
+            </if>
+            <if test="genjinUserNullFlag != null and genjinUserNullFlag !='' and genjinUserNullFlag == '0'.toString()">
+                AND a.GENJIN_USER is not null
+            </if>
+            and (a.jqpolicyno is not null or a.sypolicyno is not null)
+            group by substr(a.comcode, 1, 2)) aaa
+            group by aaa.comcode
+        </if>
+
+        ) t where t.comcode IN (
+            select comcode
+            from SaCompany@dblink_sales
+            where validstatus = '1'
+            start with comcode = #{comcode}
+            connect by prior comcode = uppercomcode
+            and prior comcode != comcode
+        )
+        <if test="dfComcode != null and dfComcode !=''">
+            AND t.comcode IN (
+                select comcode
+                from SaCompany@dblink_sales
+                where validstatus = '1'
+                start with comcode = #{dfComcode}
+                connect by prior comcode = uppercomcode
+                and prior comcode != comcode
+            )
+        </if>
+        <if test="comcodeNotin != null and comcodeNotin.size()>0">
+            <foreach collection="comcodeNotin" item="item" index="i" >
+                and t.comcode not like  #{item} || '%'
+            </foreach>
+        </if>
+        group by t.comcode
+        order by t.comcode
+    </select>
+    <select id="renewalLv" resultType="com.linkwechat.coal.modules.xxxt.renewal.domain.vo.RenewalLvVo">
+        SELECT t.comcode,
+        (SELECT a.comcname FROM SaCompany@dblink_sales a where a.comcode=t.comcode) as comcname,
+        sum(t.ying_count) ying_count,
+        sum(t.yi_count) yi_count,
+        (DECODE(sum(t.ying_count),0, 0,(ROUND(sum(t.yi_count) / sum(t.ying_count), 4) * 100)) || '%') lv_count,
+        ROUND(sum(t.ying_fee), 2) ying_fee,
+        ROUND(sum(t.yi_fee),2) yi_fee,
+        (DECODE(sum(t.ying_fee),0,0,(ROUND(sum(t.yi_fee) / sum(t.ying_fee), 4) * 100))|| '%') lv_fee
+        FROM (
+        SELECT aaa.comcode,
+        sum(aaa.ying) ying_count,
+        sum(aaa.yi) yi_count,
+        0 as ying_fee,
+        0 yi_fee
+        FROM (
+        -- 应续保数量
+        SELECT
+        substr(a.comcode, 1, 4) comcode, count(1) ying, 0 as yi
+        FROM QW_RENEWAL_FRAMENO_LIST a
+        where
+            (
+                trunc(a.oldjqenddate) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+                or
+                trunc(a.oldsyenddate) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+            )
+        <if test="comcodeNotin != null and comcodeNotin.size()>0">
+            <foreach collection="comcodeNotin" item="item" index="i" >
+                and a.comcode not like  #{item} || '%'
+            </foreach>
+        </if>
+        <if test="genjinUserList != null and genjinUserList.size() > 0">
+            AND a.GENJIN_USER in
+            <foreach collection="genjinUserList" index="item" item="item" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        <if test="genjinUser != null and genjinUser !=''">
+            AND a.GENJIN_USER =#{genjinUser}
+        </if>
+        <if test="genjinUserNullFlag != null and genjinUserNullFlag !='' and genjinUserNullFlag == '0'.toString()">
+            AND a.GENJIN_USER is not null
+        </if>
+
+        group by substr(a.comcode, 1, 4)
+
+        -- 已续保数量
+        union all
+        SELECT
+        substr(a.comcode, 1, 4) comcode, 0, count(1) yi
+        FROM QW_RENEWAL_FRAMENO_LIST a
+        where
+            (
+                trunc(a.oldjqenddate) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+                or
+                trunc(a.oldsyenddate) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+            )
+        <if test="comcodeNotin != null and comcodeNotin.size()>0">
+            <foreach collection="comcodeNotin" item="item" index="i" >
+                and a.comcode not like  #{item} || '%'
+            </foreach>
+        </if>
+        <if test="genjinUserList != null and genjinUserList.size() > 0">
+            AND a.GENJIN_USER in
+            <foreach collection="genjinUserList" index="item" item="item" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        <if test="genjinUser != null and genjinUser !=''">
+            AND a.GENJIN_USER =#{genjinUser}
+        </if>
+        <if test="genjinUserNullFlag != null and genjinUserNullFlag !='' and genjinUserNullFlag == '0'.toString()">
+            AND a.GENJIN_USER is not null
+        </if>
+
+        and (a.jqpolicyno is not null or a.sypolicyno is not null)
+        group by substr(a.comcode, 1, 4)
+        ) aaa
+        group by aaa.comcode
+
+        union all
+
+        SELECT aaa.comcode,0,0,
+        sum(aaa.ying) ying,
+        sum(aaa.yi) yi
+        FROM (
+        -- 应续保保费(oldjqpolicyno)
+        SELECT
+        substr(a.comcode, 1, 4) comcode, sum(nvl(a.old_jq_newsumpre,0)) ying, 0 yi
+        FROM QW_RENEWAL_FRAMENO_LIST a
+        where
+        (
+            trunc(a.oldjqenddate) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+        )
+        <if test="comcodeNotin != null and comcodeNotin.size()>0">
+            <foreach collection="comcodeNotin" item="item" index="i" >
+                and a.comcode not like  #{item} || '%'
+            </foreach>
+        </if>
+        <if test="genjinUserList != null and genjinUserList.size() > 0">
+            AND a.GENJIN_USER in
+            <foreach collection="genjinUserList" index="item" item="item" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        <if test="genjinUser != null and genjinUser !=''">
+            AND a.GENJIN_USER =#{genjinUser}
+        </if>
+        <if test="genjinUserNullFlag != null and genjinUserNullFlag !='' and genjinUserNullFlag == '0'.toString()">
+            AND a.GENJIN_USER is not null
+        </if>
+
+        group by substr(a.comcode, 1, 4)
+
+        -- 应续保保费(oldsypolicyno)
+        union all
+        SELECT
+        substr(a.comcode, 1, 4) comcode, sum(nvl(a.old_sy_newsumpre,0)) ying, 0 yi
+        FROM QW_RENEWAL_FRAMENO_LIST a
+        where
+        (
+            trunc(a.oldsyenddate) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+        )
+        <if test="comcodeNotin != null and comcodeNotin.size()>0">
+            <foreach collection="comcodeNotin" item="item" index="i" >
+                and a.comcode not like  #{item} || '%'
+            </foreach>
+        </if>
+        <if test="genjinUserList != null and genjinUserList.size() > 0">
+            AND a.GENJIN_USER in
+            <foreach collection="genjinUserList" index="item" item="item" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        <if test="genjinUser != null and genjinUser !=''">
+            AND a.GENJIN_USER =#{genjinUser}
+        </if>
+        <if test="genjinUserNullFlag != null and genjinUserNullFlag !='' and genjinUserNullFlag == '0'.toString()">
+            AND a.GENJIN_USER is not null
+        </if>
+
+        group by substr(a.comcode, 1, 4)
+
+        -- 已续保保费(jqpolicyno)
+        union all
+        SELECT
+        substr(a.comcode, 1, 4) comcode, 0, sum(nvl(a.jq_newsumpre, 0)) yi
+        FROM QW_RENEWAL_FRAMENO_LIST a
+        where
+        (
+        trunc(a.oldjqenddate) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+        )
+        <if test="comcodeNotin != null and comcodeNotin.size()>0">
+            <foreach collection="comcodeNotin" item="item" index="i" >
+                and a.comcode not like  #{item} || '%'
+            </foreach>
+        </if>
+        <if test="genjinUserList != null and genjinUserList.size() > 0">
+            AND a.GENJIN_USER in
+            <foreach collection="genjinUserList" index="item" item="item" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        <if test="genjinUser != null and genjinUser !=''">
+            AND a.GENJIN_USER =#{genjinUser}
+        </if>
+        <if test="genjinUserNullFlag != null and genjinUserNullFlag !='' and genjinUserNullFlag == '0'.toString()">
+            AND a.GENJIN_USER is not null
+        </if>
+
+        and a.jqpolicyno is not null
+        group by substr(a.comcode, 1, 4)
+
+        -- 已续保保费(sypolicyno)
+        union all
+        SELECT
+        substr(a.comcode, 1, 4) comcode, 0, sum(nvl(a.sy_newsumpre, 0)) yi
+        FROM QW_RENEWAL_FRAMENO_LIST a
+        where
+        (
+        trunc(a.oldsyenddate) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+        )
+        <if test="comcodeNotin != null and comcodeNotin.size()>0">
+            <foreach collection="comcodeNotin" item="item" index="i" >
+                and a.comcode not like  #{item} || '%'
+            </foreach>
+        </if>
+        <if test="genjinUserList != null and genjinUserList.size() > 0">
+            AND a.GENJIN_USER in
+            <foreach collection="genjinUserList" index="item" item="item" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        <if test="genjinUser != null and genjinUser !=''">
+            AND a.GENJIN_USER =#{genjinUser}
+        </if>
+        <if test="genjinUserNullFlag != null and genjinUserNullFlag !='' and genjinUserNullFlag == '0'.toString()">
+            AND a.GENJIN_USER is not null
+        </if>
+
+        and a.sypolicyno is not null
+        group by substr(a.comcode, 1, 4)
+        ) aaa
+        group by aaa.comcode
+        <if test="comcodeLength == 2">
+            union all
+                SELECT aaa.comcode,
+                    sum(aaa.ying) ying_count,
+                    sum(aaa.yi) yi_count,
+                    0 as ying_fee,
+                    0 yi_fee
+                FROM (
+                    -- 应续保数量
+                    SELECT
+                    substr(a.comcode, 1, 2) comcode, count(1) ying, 0 as yi
+                    FROM QW_RENEWAL_FRAMENO_LIST a
+                    where
+                    (
+                    trunc(a.oldjqenddate) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+                    or
+                    trunc(a.oldsyenddate) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+                    )
+                    <if test="comcodeNotin != null and comcodeNotin.size()>0">
+                        <foreach collection="comcodeNotin" item="item" index="i" >
+                            and a.comcode not like  #{item} || '%'
+                        </foreach>
+                    </if>
+                    <if test="genjinUserList != null and genjinUserList.size() > 0">
+                        AND a.GENJIN_USER in
+                        <foreach collection="genjinUserList" index="item" item="item" open="(" close=")" separator=",">
+                            #{item}
+                        </foreach>
+                    </if>
+                    <if test="genjinUser != null and genjinUser !=''">
+                        AND a.GENJIN_USER =#{genjinUser}
+                    </if>
+                    <if test="genjinUserNullFlag != null and genjinUserNullFlag !='' and genjinUserNullFlag == '0'.toString()">
+                        AND a.GENJIN_USER is not null
+                    </if>
+
+            group by substr(a.comcode, 1, 2)
+
+                    -- 已续保数量
+                    union all
+                    SELECT
+                    substr(a.comcode, 1, 2) comcode, 0, count(1) yi
+                    FROM QW_RENEWAL_FRAMENO_LIST a
+                    where
+                    (
+                    trunc(a.oldjqenddate) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+                    or
+                    trunc(a.oldsyenddate) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+                    )
+                    <if test="comcodeNotin != null and comcodeNotin.size()>0">
+                        <foreach collection="comcodeNotin" item="item" index="i" >
+                            and a.comcode not like  #{item} || '%'
+                        </foreach>
+                    </if>
+                    <if test="genjinUserList != null and genjinUserList.size() > 0">
+                        AND a.GENJIN_USER in
+                        <foreach collection="genjinUserList" index="item" item="item" open="(" close=")" separator=",">
+                            #{item}
+                        </foreach>
+                    </if>
+                    <if test="genjinUser != null and genjinUser !=''">
+                        AND a.GENJIN_USER =#{genjinUser}
+                    </if>
+                    <if test="genjinUserNullFlag != null and genjinUserNullFlag !='' and genjinUserNullFlag == '0'.toString()">
+                        AND a.GENJIN_USER is not null
+                    </if>
+
+            and (a.jqpolicyno is not null or a.sypolicyno is not null)
+                    group by substr(a.comcode, 1, 2)
+                    ) aaa
+                    group by aaa.comcode
+
+                    union all
+
+                    SELECT aaa.comcode,0,0,
+                    sum(aaa.ying) ying,
+                    sum(aaa.yi) yi
+                    FROM (
+                    -- 应续保保费(oldjqpolicyno)
+                    SELECT
+                    substr(a.comcode, 1, 2) comcode, sum(nvl(a.old_jq_newsumpre,0)) ying, 0 yi
+                    FROM QW_RENEWAL_FRAMENO_LIST a
+                    where
+                    (
+                    trunc(a.oldjqenddate) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+                    )
+                    <if test="comcodeNotin != null and comcodeNotin.size()>0">
+                        <foreach collection="comcodeNotin" item="item" index="i" >
+                            and a.comcode not like  #{item} || '%'
+                        </foreach>
+                    </if>
+                    <if test="genjinUserList != null and genjinUserList.size() > 0">
+                        AND a.GENJIN_USER in
+                        <foreach collection="genjinUserList" index="item" item="item" open="(" close=")" separator=",">
+                            #{item}
+                        </foreach>
+                    </if>
+                    <if test="genjinUser != null and genjinUser !=''">
+                        AND a.GENJIN_USER =#{genjinUser}
+                    </if>
+                    <if test="genjinUserNullFlag != null and genjinUserNullFlag !='' and genjinUserNullFlag == '0'.toString()">
+                        AND a.GENJIN_USER is not null
+                    </if>
+
+            group by substr(a.comcode, 1, 2)
+
+                    -- 应续保保费(oldsypolicyno)
+                    union all
+                    SELECT
+                    substr(a.comcode, 1, 2) comcode, sum(nvl(a.old_sy_newsumpre,0)) ying, 0 yi
+                    FROM QW_RENEWAL_FRAMENO_LIST a
+                    where
+                    (
+                    trunc(a.oldsyenddate) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+                    )
+                    <if test="comcodeNotin != null and comcodeNotin.size()>0">
+                        <foreach collection="comcodeNotin" item="item" index="i" >
+                            and a.comcode not like  #{item} || '%'
+                        </foreach>
+                    </if>
+                    <if test="genjinUserList != null and genjinUserList.size() > 0">
+                        AND a.GENJIN_USER in
+                        <foreach collection="genjinUserList" index="item" item="item" open="(" close=")" separator=",">
+                            #{item}
+                        </foreach>
+                    </if>
+                    <if test="genjinUser != null and genjinUser !=''">
+                        AND a.GENJIN_USER =#{genjinUser}
+                    </if>
+                    <if test="genjinUserNullFlag != null and genjinUserNullFlag !='' and genjinUserNullFlag == '0'.toString()">
+                        AND a.GENJIN_USER is not null
+                    </if>
+
+            group by substr(a.comcode, 1, 2)
+
+                    -- 已续保保费(jqpolicyno)
+                    union all
+                    SELECT
+                    substr(a.comcode, 1, 2) comcode, 0, sum(nvl(a.jq_newsumpre, 0)) yi
+                    FROM QW_RENEWAL_FRAMENO_LIST a
+                    where
+                    (
+                    trunc(a.oldjqenddate) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+                    )
+                    <if test="comcodeNotin != null and comcodeNotin.size()>0">
+                        <foreach collection="comcodeNotin" item="item" index="i" >
+                            and a.comcode not like  #{item} || '%'
+                        </foreach>
+                    </if>
+                    <if test="genjinUserList != null and genjinUserList.size() > 0">
+                        AND a.GENJIN_USER in
+                        <foreach collection="genjinUserList" index="item" item="item" open="(" close=")" separator=",">
+                            #{item}
+                        </foreach>
+                    </if>
+                    <if test="genjinUser != null and genjinUser !=''">
+                        AND a.GENJIN_USER =#{genjinUser}
+                    </if>
+                    <if test="genjinUserNullFlag != null and genjinUserNullFlag !='' and genjinUserNullFlag == '0'.toString()">
+                        AND a.GENJIN_USER is not null
+                    </if>
+
+            and a.jqpolicyno is not null
+                    group by substr(a.comcode, 1, 2)
+
+                    -- 已续保保费(sypolicyno)
+                    union all
+                    SELECT
+                    substr(a.comcode, 1, 2) comcode, 0, sum(nvl(a.sy_newsumpre, 0)) yi
+                    FROM QW_RENEWAL_FRAMENO_LIST a
+                    where
+                    (
+                    trunc(a.oldsyenddate) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+                    )
+                    <if test="comcodeNotin != null and comcodeNotin.size()>0">
+                        <foreach collection="comcodeNotin" item="item" index="i" >
+                            and a.comcode not like  #{item} || '%'
+                        </foreach>
+                    </if>
+                    <if test="genjinUserList != null and genjinUserList.size() > 0">
+                        AND a.GENJIN_USER in
+                        <foreach collection="genjinUserList" index="item" item="item" open="(" close=")" separator=",">
+                            #{item}
+                        </foreach>
+                    </if>
+                    <if test="genjinUser != null and genjinUser !=''">
+                        AND a.GENJIN_USER =#{genjinUser}
+                    </if>
+                    <if test="genjinUserNullFlag != null and genjinUserNullFlag !='' and genjinUserNullFlag == '0'.toString()">
+                        AND a.GENJIN_USER is not null
+                    </if>
+
+            and a.sypolicyno is not null
+                    group by substr(a.comcode, 1, 2)
+                ) aaa
+                group by aaa.comcode
+
+        </if>
+
+        ) t where t.comcode IN (
+                    select comcode
+                    from SaCompany@dblink_sales
+                    where validstatus = '1'
+                    start with comcode = #{comcode}
+                    connect by prior comcode = uppercomcode
+                    and prior comcode != comcode
+                )
+        <if test="dfComcode != null and dfComcode !=''">
+            AND t.comcode IN (
+                select comcode
+                from SaCompany@dblink_sales
+                where validstatus = '1'
+                start with comcode = #{dfComcode}
+                connect by prior comcode = uppercomcode
+                and prior comcode != comcode
+            )
+        </if>
+        <if test="comcodeNotin != null and comcodeNotin.size()>0">
+            <foreach collection="comcodeNotin" item="item" index="i" >
+                and t.comcode not like  #{item} || '%'
+            </foreach>
+        </if>
+        group by t.comcode
+        order by t.comcode
+    </select>
+    <select id="fcRenewalLv" resultType="com.linkwechat.coal.modules.xxxt.renewal.domain.vo.RenewalLvVo">
+        SELECT
+            t.comcode,
+            (SELECT a.comcname FROM SaCompany@dblink_sales a where a.comcode=t.comcode) as comcname,
+            sum(t.ying_count) ying_count,
+            sum(t.yi_count) yi_count,
+            (to_char(DECODE(sum(t.ying_count),0, 0,(ROUND(sum(t.yi_count) / sum(t.ying_count), 4) * 100)),'FM9999999990.00') || '%') lv_count,
+            ROUND(sum(t.ying_fee), 2) ying_fee,
+            ROUND(sum(t.yi_fee),2) yi_fee,
+            (to_char(DECODE(sum(t.ying_fee),0,0,(ROUND(sum(t.yi_fee) / sum(t.ying_fee), 4) * 100)),'FM9999999990.00')|| '%') lv_fee
+        FROM (
+            SELECT
+                aaa.comcode,
+                sum(aaa.ying) ying_count,
+                sum(aaa.yi) yi_count,
+                0 as ying_fee,
+                0 yi_fee
+            FROM (
+                    -- 应续保数量
+                    SELECT
+                        substr(a.comcode, 1, 4) comcode, count(1) ying, 0 as yi
+                    FROM QW_MID_RENEWAL_GF_LIST a
+                    where trunc(a.enddate) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+                    group by substr(a.comcode, 1, 4)
+
+                    -- 已续保数量
+                    union all
+                    SELECT
+                        substr(a.comcode, 1, 4) comcode, 0, count(1) yi
+                    FROM QW_MID_RENEWAL_GF_LIST a
+                    where trunc(a.enddate) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+                        and (a.POLICYNO_N is not null)
+                    group by substr(a.comcode, 1, 4)
+                ) aaa
+                group by aaa.comcode
+
+            union all
+
+            SELECT
+                aaa.comcode,0,0,
+                sum(aaa.ying) ying,
+                sum(aaa.yi) yi
+            FROM (
+                -- 应续保保费
+                SELECT
+                    substr(a.comcode, 1, 4) comcode, sum(nvl(a.SUMPREMIUM,0)) ying, 0 yi
+                FROM QW_MID_RENEWAL_GF_LIST a
+                where
+                    trunc(a.enddate) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+                group by substr(a.comcode, 1, 4)
+
+                -- 已续保保费
+                union all
+                SELECT
+                    substr(a.comcode, 1, 4) comcode, 0, sum(nvl(a.SUMPREMIUM, 0)) yi
+                FROM QW_MID_RENEWAL_GF_LIST a
+                where
+                    trunc(a.enddate) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+                and a.POLICYNO_N is not null
+                group by substr(a.comcode, 1, 4)
+            ) aaa
+            group by aaa.comcode
+            <if test="comcodeLength == 2">
+            union all
+            SELECT
+                aaa.comcode,
+                sum(aaa.ying) ying_count,
+                sum(aaa.yi) yi_count,
+                0 as ying_fee,
+                0 yi_fee
+            FROM (
+                -- 应续保数量
+                SELECT
+                    substr(a.comcode, 1, 2) comcode, count(1) ying, 0 as yi
+                FROM QW_MID_RENEWAL_GF_LIST a
+                where
+                trunc(a.enddate) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+                group by substr(a.comcode, 1, 2)
+                -- 已续保数量
+                union all
+                SELECT
+                    substr(a.comcode, 1, 2) comcode, 0, count(1) yi
+                FROM QW_MID_RENEWAL_GF_LIST a
+                where
+                    trunc(a.enddate) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+                and a.POLICYNO_N is not null
+                group by substr(a.comcode, 1, 2)
+            ) aaa
+            group by aaa.comcode
+            union all
+            SELECT
+                aaa.comcode,0,0,
+                sum(aaa.ying) ying,
+                sum(aaa.yi) yi
+            FROM (
+                -- 应续保保费
+                SELECT
+                    substr(a.comcode, 1, 2) comcode, sum(nvl(a.SUMPREMIUM,0)) ying, 0 yi
+                FROM QW_MID_RENEWAL_GF_LIST a
+                where
+                    trunc(a.enddate) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+                group by substr(a.comcode, 1, 2)
+                -- 已续保保费
+                union all
+                SELECT
+                    substr(a.comcode, 1, 2) comcode, 0, sum(nvl(a.SUMPREMIUM, 0)) yi
+                FROM QW_MID_RENEWAL_GF_LIST a
+                where
+                    trunc(a.enddate) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+                and a.POLICYNO_N is not null
+                group by substr(a.comcode, 1, 2)
+            ) aaa
+            group by aaa.comcode
+        </if>
+        ) t where t.comcode IN (
+            select comcode
+            from SaCompany@dblink_sales
+            where validstatus = '1'
+            start with comcode = #{comcode}
+            connect by prior comcode = uppercomcode
+            and prior comcode != comcode
+        )
+        <if test="dfComcode != null and dfComcode !=''">
+            AND t.comcode IN (
+            select comcode
+            from SaCompany@dblink_sales
+            where validstatus = '1'
+            start with comcode = #{dfComcode}
+            connect by prior comcode = uppercomcode
+            and prior comcode != comcode
+            )
+        </if>
+        group by t.comcode
+        order by t.comcode
+    </select>
+    <select id="cplanRenewalLv"
+            resultType="com.linkwechat.coal.modules.xxxt.renewal.domain.vo.CPlanRenewalLvVo">
+        SELECT
+        t.comcode,t.c_plan_code as cplancode,
+        nvl(t.c_plan_name, (select tt.riskcname from prpdrisk@dblink_sales tt where tt.riskcode=t.c_plan_code)) cplanname,
+        (SELECT a.comcname FROM SaCompany@dblink_sales a where a.comcode=t.comcode) as comcname,
+        sum(t.ying_count) ying_count,
+        sum(t.yi_count) yi_count,
+        (to_char(DECODE(sum(t.ying_count),0, 0,(ROUND(sum(t.yi_count) / sum(t.ying_count), 4) * 100)),'FM9999999990.00') || '%') lv_count,
+        ROUND(sum(t.ying_fee), 2) ying_fee,
+        ROUND(sum(t.yi_fee),2) yi_fee,
+        (to_char(DECODE(sum(t.ying_fee),0,0,(ROUND(sum(t.yi_fee) / sum(t.ying_fee), 4) * 100)),'FM9999999990.00')|| '%') lv_fee
+        FROM (
+        SELECT
+        aaa.comcode, aaa.c_plan_code, aaa.c_plan_name,
+        sum(aaa.ying) ying_count,
+        sum(aaa.yi) yi_count,
+        0 as ying_fee,
+        0 yi_fee
+        FROM (
+        -- 应续保数量
+        SELECT
+        substr(a.comcode, 1, 4) comcode, nvl(a.c_plan_code, a.riskcode) c_plan_code, a.c_plan_name, count(1) ying, 0 as yi
+        FROM QW_MID_RENEWAL_GF_LIST a
+        where trunc(a.enddate) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+        group by substr(a.comcode, 1, 4), nvl(a.c_plan_code, a.riskcode), a.c_plan_name
+
+        -- 已续保数量
+        union all
+        SELECT
+        substr(a.comcode, 1, 4) comcode, nvl(a.c_plan_code, a.riskcode) c_plan_code, a.c_plan_name, 0, count(1) yi
+        FROM QW_MID_RENEWAL_GF_LIST a
+        where trunc(a.enddate) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+        and (a.POLICYNO_N is not null)
+        group by substr(a.comcode, 1, 4), nvl(a.c_plan_code, a.riskcode), a.c_plan_name
+        ) aaa
+        group by aaa.comcode, aaa.c_plan_code, aaa.c_plan_name
+
+        union all
+
+        SELECT
+        aaa.comcode, aaa.c_plan_code, aaa.c_plan_name,0,0,
+        sum(aaa.ying) ying,
+        sum(aaa.yi) yi
+        FROM (
+        -- 应续保保费
+        SELECT
+        substr(a.comcode, 1, 4) comcode, nvl(a.c_plan_code, a.riskcode) c_plan_code, a.c_plan_name, sum(nvl(a.SUMPREMIUM,0)) ying, 0 yi
+        FROM QW_MID_RENEWAL_GF_LIST a
+        where
+        trunc(a.enddate) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+        group by substr(a.comcode, 1, 4), nvl(a.c_plan_code, a.riskcode), a.c_plan_name
+
+        -- 已续保保费
+        union all
+        SELECT
+        substr(a.comcode, 1, 4) comcode, nvl(a.c_plan_code, a.riskcode) c_plan_code, a.c_plan_name, 0, sum(nvl(a.SUMPREMIUM, 0)) yi
+        FROM QW_MID_RENEWAL_GF_LIST a
+        where
+        trunc(a.enddate) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+        and a.POLICYNO_N is not null
+        group by substr(a.comcode, 1, 4), nvl(a.c_plan_code, a.riskcode), a.c_plan_name
+        ) aaa
+        group by aaa.comcode, aaa.c_plan_code, aaa.c_plan_name
+        ) t where 1=1
+        and t.comcode IN (
+            select comcode
+            from SaCompany@dblink_sales
+            where validstatus = '1'
+            start with comcode = #{comcode}
+            connect by prior comcode = uppercomcode
+            and prior comcode != comcode
+        )
+        <if test="dfComcode != null and dfComcode !=''">
+            AND t.comcode IN (
+            select comcode
+            from SaCompany@dblink_sales
+            where validstatus = '1'
+            start with comcode = #{dfComcode}
+            connect by prior comcode = uppercomcode
+            and prior comcode != comcode
+            )
+        </if>
+        group by t.comcode, t.c_plan_code, t.c_plan_name
+        order by t.comcode, t.c_plan_code
+    </select>
+    <select id="renewalFun" resultType="com.linkwechat.coal.modules.xxxt.renewal.domain.vo.RenewalFunVo">
+    SELECT
+        aaa.comcode,
+        (SELECT a.comcname FROM SaCompany@dblink_sales a where a.comcode=aaa.comcode) as comcname,
+        sum(aaa.ying_lisenseno) ying_Car_Count,
+        sum(aaa.send_count)send_count,
+        sum(aaa.genjin_count)genjin_count,
+        sum(aaa.baojia_count)baojia_count,
+        sum(aaa.suncess_count)suncess_count
+    FROM (
+        -- 应续车辆
+        SELECT
+            substr(a.comcode, 1, 4) comcode, count(1) ying_lisenseno, 0 send_count, 0 genjin_count, 0 baojia_count, 0 suncess_count
+        FROM QW_RENEWAL_FRAMENO_LIST a
+        where
+            (
+                trunc(a.oldjqenddate) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+                or
+                trunc(a.oldsyenddate) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+            )
+        <if test="comcodeNotin != null and comcodeNotin.size()>0">
+            <foreach collection="comcodeNotin" item="item" index="i" >
+                and a.comcode not like  #{item} || '%'
+            </foreach>
+        </if>
+        <if test="genjinUserList != null and genjinUserList.size() > 0">
+            AND a.GENJIN_USER in
+            <foreach collection="genjinUserList" index="item" item="item" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        <if test="genjinUser != null and genjinUser !=''">
+            AND a.GENJIN_USER =#{genjinUser}
+        </if>
+        <if test="genjinUserNullFlag != null and genjinUserNullFlag !='' and genjinUserNullFlag == '0'.toString()">
+            AND a.GENJIN_USER is not null
+        </if>
+
+
+        group by substr(a.comcode, 1, 4)
+
+        -- 跟进次数
+        union all
+        SELECT
+            substr(a.comcode, 1, 4) comcode, 0 , 0 , count(b.key_id) as genjin_count ,0,0
+        FROM QW_RENEWAL_FRAMENO_LIST a
+        join qw_genjin_msg b
+            on a.lisenseno=b.lisenseno and a.FRAMENO=b.FRAMENO and a.ENGINENO=b.ENGINENO
+        where
+            (
+            trunc(a.oldjqenddate) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+            or
+            trunc(a.oldsyenddate) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+            )
+        <if test="comcodeNotin != null and comcodeNotin.size()>0">
+            <foreach collection="comcodeNotin" item="item" index="i" >
+                and a.comcode not like  #{item} || '%'
+            </foreach>
+        </if>
+        <if test="genjinUserList != null and genjinUserList.size() > 0">
+            AND a.GENJIN_USER in
+            <foreach collection="genjinUserList" index="item" item="item" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        <if test="genjinUser != null and genjinUser !=''">
+            AND a.GENJIN_USER =#{genjinUser}
+        </if>
+        <if test="genjinUserNullFlag != null and genjinUserNullFlag !='' and genjinUserNullFlag == '0'.toString()">
+            AND a.GENJIN_USER is not null
+        </if>
+
+        group by substr(a.comcode, 1, 4)
+
+        -- 报价次数
+        union all
+        SELECT
+            substr(a.comcode, 1, 4) comcode, 0, 0,0,count(1),0
+        FROM QW_RENEWAL_FRAMENO_LIST a
+        join QW_RENEWAL_BAOJIA_msg b
+            on a.lisenseno=b.LICENSENO
+            and a.FRAMENO=b.FRAMENO
+            and a.ENGINENO=b.ENGINENO
+        where
+            (
+            trunc(a.oldjqenddate) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+            or
+            trunc(a.oldsyenddate) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+            )
+        <if test="comcodeNotin != null and comcodeNotin.size()>0">
+            <foreach collection="comcodeNotin" item="item" index="i" >
+                and a.comcode not like  #{item} || '%'
+            </foreach>
+        </if>
+        <if test="genjinUserList != null and genjinUserList.size() > 0">
+            AND a.GENJIN_USER in
+            <foreach collection="genjinUserList" index="item" item="item" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        <if test="genjinUser != null and genjinUser !=''">
+            AND a.GENJIN_USER =#{genjinUser}
+        </if>
+        <if test="genjinUserNullFlag != null and genjinUserNullFlag !='' and genjinUserNullFlag == '0'.toString()">
+            AND a.GENJIN_USER is not null
+        </if>
+
+        and b.OPERATEDATE between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+        group by substr(a.comcode, 1, 4)
+
+        -- 成交量
+        union all
+        SELECT
+            substr(a.comcode, 1, 4) comcode, 0, 0,0,0,count(1) suncess_count
+        FROM QW_RENEWAL_FRAMENO_LIST a
+        where
+        (
+        trunc(a.oldjqenddate) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+        or
+        trunc(a.oldsyenddate) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+        )
+        <if test="comcodeNotin != null and comcodeNotin.size()>0">
+            <foreach collection="comcodeNotin" item="item" index="i" >
+                and a.comcode not like  #{item} || '%'
+            </foreach>
+        </if>
+        <if test="genjinUserList != null and genjinUserList.size() > 0">
+            AND a.GENJIN_USER in
+            <foreach collection="genjinUserList" index="item" item="item" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        <if test="genjinUser != null and genjinUser !=''">
+            AND a.GENJIN_USER =#{genjinUser}
+        </if>
+        <if test="genjinUserNullFlag != null and genjinUserNullFlag !='' and genjinUserNullFlag == '0'.toString()">
+            AND a.GENJIN_USER is not null
+        </if>
+
+        and (a.jqpolicyno is not null or a.sypolicyno is not null)
+        group by substr(a.comcode, 1, 4)
+
+        <if test="comcodeLength == 2">
+        union all
+            -- 应续车辆
+            SELECT
+            substr(a.comcode, 1, 2) comcode, count(1) ying_lisenseno, 0 send_count, 0 genjin_count, 0 baojia_count, 0 suncess_count
+            FROM QW_RENEWAL_FRAMENO_LIST a
+            where
+            (
+            trunc(a.oldjqenddate) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+            or
+            trunc(a.oldsyenddate) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+            )
+            <if test="comcodeNotin != null and comcodeNotin.size()>0">
+                <foreach collection="comcodeNotin" item="item" index="i" >
+                    and a.comcode not like  #{item} || '%'
+                </foreach>
+            </if>
+            <if test="genjinUserList != null and genjinUserList.size() > 0">
+                AND a.GENJIN_USER in
+                <foreach collection="genjinUserList" index="item" item="item" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="genjinUser != null and genjinUser !=''">
+                AND a.GENJIN_USER =#{genjinUser}
+            </if>
+            <if test="genjinUserNullFlag != null and genjinUserNullFlag !='' and genjinUserNullFlag == '0'.toString()">
+                AND a.GENJIN_USER is not null
+            </if>
+
+            group by substr(a.comcode, 1, 2)
+
+            -- 跟进次数
+            union all
+            SELECT
+            substr(a.comcode, 1, 2) comcode, 0 , 0 , count(b.key_id) as genjin_count ,0,0
+            FROM QW_RENEWAL_FRAMENO_LIST a
+            join qw_genjin_msg b
+            on a.lisenseno=b.lisenseno and a.FRAMENO=b.FRAMENO and a.ENGINENO=b.ENGINENO
+            where
+            (
+            trunc(a.oldjqenddate) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+            or
+            trunc(a.oldsyenddate) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+            )
+            <if test="comcodeNotin != null and comcodeNotin.size()>0">
+                <foreach collection="comcodeNotin" item="item" index="i" >
+                    and a.comcode not like  #{item} || '%'
+                </foreach>
+            </if>
+            <if test="genjinUserList != null and genjinUserList.size() > 0">
+                AND a.GENJIN_USER in
+                <foreach collection="genjinUserList" index="item" item="item" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="genjinUser != null and genjinUser !=''">
+                AND a.GENJIN_USER =#{genjinUser}
+            </if>
+            <if test="genjinUserNullFlag != null and genjinUserNullFlag !='' and genjinUserNullFlag == '0'.toString()">
+                AND a.GENJIN_USER is not null
+            </if>
+
+            group by substr(a.comcode, 1, 2)
+
+            -- 报价次数
+            union all
+            SELECT
+            substr(a.comcode, 1, 2) comcode, 0, 0,0,count(1),0
+            FROM QW_RENEWAL_FRAMENO_LIST a
+            join QW_RENEWAL_BAOJIA_msg b
+            on a.lisenseno=b.LICENSENO
+            and a.FRAMENO=b.FRAMENO
+            and a.ENGINENO=b.ENGINENO
+            where
+            (
+            trunc(a.oldjqenddate) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+            or
+            trunc(a.oldsyenddate) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+            )
+            <if test="comcodeNotin != null and comcodeNotin.size()>0">
+                <foreach collection="comcodeNotin" item="item" index="i" >
+                    and a.comcode not like  #{item} || '%'
+                </foreach>
+            </if>
+            <if test="genjinUserList != null and genjinUserList.size() > 0">
+                AND a.GENJIN_USER in
+                <foreach collection="genjinUserList" index="item" item="item" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="genjinUser != null and genjinUser !=''">
+                AND a.GENJIN_USER =#{genjinUser}
+            </if>
+            <if test="genjinUserNullFlag != null and genjinUserNullFlag !='' and genjinUserNullFlag == '0'.toString()">
+                AND a.GENJIN_USER is not null
+            </if>
+
+            and b.OPERATEDATE between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+            group by substr(a.comcode, 1, 2)
+
+            -- 成交量
+            union all
+            SELECT
+            substr(a.comcode, 1, 2) comcode, 0, 0,0,0,count(1) suncess_count
+            FROM QW_RENEWAL_FRAMENO_LIST a
+            where
+            (
+            trunc(a.oldjqenddate) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+            or
+            trunc(a.oldsyenddate) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+            )
+            <if test="comcodeNotin != null and comcodeNotin.size()>0">
+                <foreach collection="comcodeNotin" item="item" index="i" >
+                    and a.comcode not like  #{item} || '%'
+                </foreach>
+            </if>
+            <if test="genjinUserList != null and genjinUserList.size() > 0">
+                AND a.GENJIN_USER in
+                <foreach collection="genjinUserList" index="item" item="item" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="genjinUser != null and genjinUser !=''">
+                AND a.GENJIN_USER =#{genjinUser}
+            </if>
+            <if test="genjinUserNullFlag != null and genjinUserNullFlag !='' and genjinUserNullFlag == '0'.toString()">
+                AND a.GENJIN_USER is not null
+            </if>
+
+            and (a.jqpolicyno is not null or a.sypolicyno is not null)
+            group by substr(a.comcode, 1, 2)
+        </if>
+    ) aaa
+    where aaa.comcode IN (
+            select comcode
+            from SaCompany@dblink_sales
+            where validstatus = '1'
+            start with comcode = #{comcode}
+            connect by prior comcode = uppercomcode
+            and prior comcode != comcode
+        )
+    <if test="dfComcode != null and dfComcode !=''">
+        AND aaa.comcode IN (
+            select comcode
+            from SaCompany@dblink_sales
+            where validstatus = '1'
+            start with comcode = #{dfComcode}
+            connect by prior comcode = uppercomcode
+            and prior comcode != comcode
+        )
+    </if>
+    <if test="comcodeNotin != null and comcodeNotin.size()>0">
+        <foreach collection="comcodeNotin" item="item" index="i" >
+            and aaa.comcode not like  #{item} || '%'
+        </foreach>
+    </if>
+    group by aaa.comcode
+    order by aaa.comcode
+    </select>
+    <select id="renewalUser" resultType="com.linkwechat.coal.modules.xxxt.renewal.domain.vo.RenewalUserVo">
+        select
+               genjin_user as userId,
+               nvl2(genjin_user_name,
+                    genjin_user_name,
+                    NVL((select t.username
+                          from sauser@dblink_sales t
+                         where t.usercode = genjin_user),
+                        (select t.netpointname
+                           from prpdnetpoint@dblink_sales t
+                          where t.netpointcode = genjin_user))) userName,
+               sum(countSum) countSum,
+               sum(genjinSum) genjinSum,
+               sum(genjinCount) genjinCount,
+               sum(xbCount) xbCount
+          from (
+                -- 任务总数
+                SELECT
+                        genjin_user,
+                        genjin_user_name,
+                        count(1) countSum,
+                        0 genjinSum,
+                        0 genjinCount,
+                        0 xbCount
+                  FROM QW_RENEWAL_FRAMENO_LIST a
+                 where a.comcode IN (
+                        select comcode
+                        from SaCompany@dblink_sales
+                        where validstatus = '1'
+                        start with comcode = #{comcode}
+                        connect by prior comcode = uppercomcode
+                        and prior comcode != comcode
+                        )
+                    <if test="dfComcode != null and dfComcode !=''">
+                        AND a.comcode IN (
+                        select comcode
+                        from SaCompany@dblink_sales
+                        where validstatus = '1'
+                        start with comcode = #{dfComcode}
+                        connect by prior comcode = uppercomcode
+                        and prior comcode != comcode
+                        )
+                    </if>
+                    <if test="comcodeNotin != null and comcodeNotin.size()>0">
+                        <foreach collection="comcodeNotin" item="item" index="i" >
+                            and a.comcode not like  #{item} || '%'
+                        </foreach>
+                    </if>
+                    <if test="genjinUserList != null and genjinUserList.size() > 0">
+                        AND a.GENJIN_USER in
+                        <foreach collection="genjinUserList" index="item" item="item" open="(" close=")" separator=",">
+                            #{item}
+                        </foreach>
+                    </if>
+                    <if test="genjinUser != null and genjinUser !=''">
+                        AND a.GENJIN_USER =#{genjinUser}
+                    </if>
+                    <if test="genjinUserNullFlag != null and genjinUserNullFlag !='' and genjinUserNullFlag == '0'.toString()">
+                        AND a.GENJIN_USER is not null
+                    </if>
+
+        and (
+                        trunc(a.oldjqenddate) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+                        or
+                        trunc(a.oldsyenddate) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+                        )
+                 group by a.genjin_user, a.genjin_user_name
+                union all
+                -- 跟进总数
+                SELECT
+                       a.genjin_user,
+                       genjin_user_name,
+                       0 as countSum,
+                       count(1) genjinSum,
+                       0,
+                       0
+                  FROM QW_RENEWAL_FRAMENO_LIST a
+                 where a.comcode IN (
+                    select comcode
+                    from SaCompany@dblink_sales
+                    where validstatus = '1'
+                    start with comcode = #{comcode}
+                    connect by prior comcode = uppercomcode
+                    and prior comcode != comcode
+                    )
+                    <if test="dfComcode != null and dfComcode !=''">
+                        AND a.comcode IN (
+                        select comcode
+                        from SaCompany@dblink_sales
+                        where validstatus = '1'
+                        start with comcode = #{dfComcode}
+                        connect by prior comcode = uppercomcode
+                        and prior comcode != comcode
+                        )
+                    </if>
+                    <if test="comcodeNotin != null and comcodeNotin.size()>0">
+                        <foreach collection="comcodeNotin" item="item" index="i" >
+                            and a.comcode not like  #{item} || '%'
+                        </foreach>
+                    </if>
+                    <if test="genjinUserList != null and genjinUserList.size() > 0">
+                        AND a.GENJIN_USER in
+                        <foreach collection="genjinUserList" index="item" item="item" open="(" close=")" separator=",">
+                            #{item}
+                        </foreach>
+                    </if>
+                    <if test="genjinUser != null and genjinUser !=''">
+                        AND a.GENJIN_USER =#{genjinUser}
+                    </if>
+                    <if test="genjinUserNullFlag != null and genjinUserNullFlag !='' and genjinUserNullFlag == '0'.toString()">
+                        AND a.GENJIN_USER is not null
+                    </if>
+
+        and (
+                        trunc(a.oldjqenddate) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+                        or
+                        trunc(a.oldsyenddate) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+                        )
+                   and exists (SELECT 1
+                          FROM QW_genjin_msg t
+                         where t.lisenseno = a.lisenseno
+                           and t.frameno = a.frameno
+                           and t.engineno = a.engineno
+                           and t.oldjqpolicyno = a.oldjqpolicyno
+                           and t.oldsypolicyno = a.oldsypolicyno
+                           and t.oldjqenddate = a.oldjqenddate
+                    )
+                 group by a.genjin_user, a.genjin_user_name
+                union all
+                -- 跟进记录
+                SELECT
+                       a.genjin_user,
+                       a. genjin_user_name,
+                       0 countSum,
+                       0 genjinSum,
+                       count(1) as genjinCount,
+                       0 as xbCount
+                  FROM QW_RENEWAL_FRAMENO_LIST a
+                  join QW_genjin_msg b
+                    on b.lisenseno = a.lisenseno
+                   and b.frameno = a.frameno
+                   and b.engineno = a.engineno
+                   and b.oldjqpolicyno = a.oldjqpolicyno
+                   and b.oldsypolicyno = a.oldsypolicyno
+                   and b.oldjqenddate = a.oldjqenddate
+                 where a.comcode IN (
+                        select comcode
+                        from SaCompany@dblink_sales
+                        where validstatus = '1'
+                        start with comcode = #{comcode}
+                        connect by prior comcode = uppercomcode
+                        and prior comcode != comcode
+                        )
+                    <if test="dfComcode != null and dfComcode !=''">
+                        AND a.comcode IN (
+                        select comcode
+                        from SaCompany@dblink_sales
+                        where validstatus = '1'
+                        start with comcode = #{dfComcode}
+                        connect by prior comcode = uppercomcode
+                        and prior comcode != comcode
+                        )
+                    </if>
+                    <if test="comcodeNotin != null and comcodeNotin.size()>0">
+                        <foreach collection="comcodeNotin" item="item" index="i" >
+                            and a.comcode not like  #{item} || '%'
+                        </foreach>
+                    </if>
+                    <if test="genjinUserList != null and genjinUserList.size() > 0">
+                        AND a.GENJIN_USER in
+                        <foreach collection="genjinUserList" index="item" item="item" open="(" close=")" separator=",">
+                            #{item}
+                        </foreach>
+                    </if>
+                    <if test="genjinUser != null and genjinUser !=''">
+                        AND a.GENJIN_USER =#{genjinUser}
+                    </if>
+                    <if test="genjinUserNullFlag != null and genjinUserNullFlag !='' and genjinUserNullFlag == '0'.toString()">
+                        AND a.GENJIN_USER is not null
+                    </if>
+
+        and (
+                        trunc(a.oldjqenddate) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+                        or
+                        trunc(a.oldsyenddate) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+                        )
+                 group by a.genjin_user, a.genjin_user_name
+                union all
+                -- 续保数量(续保成功-外呼业务)
+                SELECT
+                       a.genjin_user,
+                       a. genjin_user_name,
+                       0 countSum,
+                       0 genjinSum,
+                       0 genjinCount,
+                       count(1) as xbCount
+                  FROM QW_RENEWAL_FRAMENO_LIST a
+                 where a.comcode IN (
+                        select comcode
+                        from SaCompany@dblink_sales
+                        where validstatus = '1'
+                        start with comcode = #{comcode}
+                        connect by prior comcode = uppercomcode
+                        and prior comcode != comcode
+                        )
+                    <if test="dfComcode != null and dfComcode !=''">
+                        AND a.comcode IN (
+                        select comcode
+                        from SaCompany@dblink_sales
+                        where validstatus = '1'
+                        start with comcode = #{dfComcode}
+                        connect by prior comcode = uppercomcode
+                        and prior comcode != comcode
+                        )
+                    </if>
+                    <if test="comcodeNotin != null and comcodeNotin.size()>0">
+                        <foreach collection="comcodeNotin" item="item" index="i" >
+                            and a.comcode not like  #{item} || '%'
+                        </foreach>
+                    </if>
+                    <if test="genjinUserList != null and genjinUserList.size() > 0">
+                        AND a.GENJIN_USER in
+                        <foreach collection="genjinUserList" index="item" item="item" open="(" close=")" separator=",">
+                            #{item}
+                        </foreach>
+                    </if>
+                    <if test="genjinUser != null and genjinUser !=''">
+                        AND a.GENJIN_USER =#{genjinUser}
+                    </if>
+                    <if test="genjinUserNullFlag != null and genjinUserNullFlag !='' and genjinUserNullFlag == '0'.toString()">
+                        AND a.GENJIN_USER is not null
+                    </if>
+
+        and a.status = '6'
+                   and (
+                        trunc(a.oldjqenddate) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+                        or
+                        trunc(a.oldsyenddate) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+                        )
+                 group by a.genjin_user, a.genjin_user_name) aaa
+                 where aaa.genjin_user is not null
+         group by genjin_user, genjin_user_name
+         ORDER BY xbCount desc
+
+    </select>
+    <select id="monthRenewalLv"
+            resultType="com.linkwechat.coal.modules.xxxt.renewal.domain.vo.MonthRenewalLvVo">
+        SELECT
+            substr(enddate, 6) "month",
+            sum(sum_all) sumAll,
+            sum(sum_yi) sumYi,
+            (round(sum(sum_yi)/sum(sum_all)*100, 2) ) AS lvYi
+          FROM (
+           -- 应续
+          SELECT enddate, count(1) sum_all, 0 sum_yi
+                  FROM (select distinct *
+                          from (SELECT to_char(a.oldjqenddate, 'yyyy-MM') enddate,
+                                       a.lisenseno,
+                                       a.frameno,
+                                       a.engineno,
+                                       a.jqpolicyno,
+                                       a.sypolicyno
+                                  FROM QW_RENEWAL_FRAMENO_LIST a
+                                 where to_char(a.oldjqenddate, 'yyyy') = #{yearStr}
+                                    <if test="comcode != '00'">
+                                        AND substr(a.comcode, 1, ${comcodeLength2}) = #{comcode}
+                                    </if>
+                                    <if test="comcodeNotin != null and comcodeNotin.size()>0">
+                                        <foreach collection="comcodeNotin" item="item" index="i" >
+                                            and a.comcode not like  #{item} || '%'
+                                        </foreach>
+                                    </if>
+                                <if test="genjinUserList != null and genjinUserList.size() > 0">
+                                    AND a.GENJIN_USER in
+                                    <foreach collection="genjinUserList" index="item" item="item" open="(" close=")" separator=",">
+                                        #{item}
+                                    </foreach>
+                                </if>
+                                <if test="genjinUser != null and genjinUser !=''">
+                                    AND a.GENJIN_USER =#{genjinUser}
+                                </if>
+                                <if test="genjinUserNullFlag != null and genjinUserNullFlag !='' and genjinUserNullFlag == '0'.toString()">
+                                    AND a.GENJIN_USER is not null
+                                </if>
+
+        union all
+                                SELECT to_char(a.oldsyenddate, 'yyyy-MM') enddate,
+                                       a.lisenseno,
+                                       a.frameno,
+                                       a.engineno,
+                                       a.jqpolicyno,
+                                       a.sypolicyno
+                                  FROM QW_RENEWAL_FRAMENO_LIST a
+                                 where to_char(a.oldsyenddate, 'yyyy') = #{yearStr}
+                                    <if test="comcode != '00'">
+                                        AND substr(a.comcode, 1, ${comcodeLength2}) = #{comcode}
+                                    </if>
+                                    <if test="comcodeNotin != null and comcodeNotin.size()>0">
+                                        <foreach collection="comcodeNotin" item="item" index="i" >
+                                            and a.comcode not like  #{item} || '%'
+                                        </foreach>
+                                    </if>
+        <if test="genjinUserList != null and genjinUserList.size() > 0">
+            AND a.GENJIN_USER in
+            <foreach collection="genjinUserList" index="item" item="item" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        <if test="genjinUser != null and genjinUser !=''">
+            AND a.GENJIN_USER =#{genjinUser}
+        </if>
+        <if test="genjinUserNullFlag != null and genjinUserNullFlag !='' and genjinUserNullFlag == '0'.toString()">
+            AND a.GENJIN_USER is not null
+        </if>
+
+        ))
+                 group by enddate
+                union all
+
+                -- 已续
+                SELECT enddate, 0, count(1) sum_yi
+                  FROM (select distinct *
+                          from (SELECT to_char(a.oldjqenddate, 'yyyy-MM') enddate,
+                                       a.lisenseno,
+                                       a.frameno,
+                                       a.engineno,
+                                       a.jqpolicyno,
+                                       a.sypolicyno
+                                  FROM QW_RENEWAL_FRAMENO_LIST a
+                                 where to_char(a.oldjqenddate, 'yyyy') = #{yearStr}
+                                    <if test="comcode != '00'">
+                                        AND substr(a.comcode, 1, ${comcodeLength2}) = #{comcode}
+                                    </if>
+                                    <if test="comcodeNotin != null and comcodeNotin.size()>0">
+                                        <foreach collection="comcodeNotin" item="item" index="i" >
+                                            and a.comcode not like  #{item} || '%'
+                                        </foreach>
+                                    </if>
+        <if test="genjinUserList != null and genjinUserList.size() > 0">
+            AND a.GENJIN_USER in
+            <foreach collection="genjinUserList" index="item" item="item" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        <if test="genjinUser != null and genjinUser !=''">
+            AND a.GENJIN_USER =#{genjinUser}
+        </if>
+        <if test="genjinUserNullFlag != null and genjinUserNullFlag !='' and genjinUserNullFlag == '0'.toString()">
+            AND a.GENJIN_USER is not null
+        </if>
+
+        and (a.jqpolicyno is not null or a.sypolicyno is not null)
+                                union all
+                                SELECT to_char(a.oldsyenddate, 'yyyy-MM') enddate,
+                                       a.lisenseno,
+                                       a.frameno,
+                                       a.engineno,
+                                       a.jqpolicyno,
+                                       a.sypolicyno
+                                  FROM QW_RENEWAL_FRAMENO_LIST a
+                                 where to_char(a.oldsyenddate, 'yyyy') = #{yearStr}
+                                    <if test="comcode != '00'">
+                                        AND substr(a.comcode, 1, ${comcodeLength2}) = #{comcode}
+                                    </if>
+                                    <if test="comcodeNotin != null and comcodeNotin.size()>0">
+                                        <foreach collection="comcodeNotin" item="item" index="i" >
+                                            and a.comcode not like  #{item} || '%'
+                                        </foreach>
+                                    </if>
+        <if test="genjinUserList != null and genjinUserList.size() > 0">
+            AND a.GENJIN_USER in
+            <foreach collection="genjinUserList" index="item" item="item" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        <if test="genjinUser != null and genjinUser !=''">
+            AND a.GENJIN_USER =#{genjinUser}
+        </if>
+        <if test="genjinUserNullFlag != null and genjinUserNullFlag !='' and genjinUserNullFlag == '0'.toString()">
+            AND a.GENJIN_USER is not null
+        </if>
+
+        and (a.jqpolicyno is not null or a.sypolicyno is not null)))
+                 group by enddate)
+         group by enddate
+         ORDER BY enddate
+    </select>
+    <select id="fcMonthRenewalLv"
+            resultType="com.linkwechat.coal.modules.xxxt.renewal.domain.vo.FcMonthRenewalLvVo">
+        SELECT
+            substr(enddate, 6) "month",
+            sum(sum_all) SUMALL,
+            sum(sum_yi) SUMYI,
+            (round(sum(sum_yi) / sum(sum_all) * 100, 2)) AS LVYI,
+            sum(SUMPREMIUM) SUMPREMIUM,
+            sum(SUMPREMIUM_YI) SUMPREMIUMYI,
+            (round(sum(SUMPREMIUM_YI) / sum(SUMPREMIUM) * 100, 2)) AS LVSUMPREMIUM
+        FROM (
+            -- 应续
+            SELECT
+                enddate,
+                count(1) sum_all,
+                0 sum_yi,
+                sum(SUMPREMIUM) SUMPREMIUM,
+                0 SUMPREMIUM_YI
+            FROM (select distinct *
+                from (SELECT to_char(a.enddate, 'yyyy-MM') enddate,
+                    a.policyno,
+                    a.SUMPREMIUM
+                    FROM QW_MID_RENEWAL_GF_LIST a
+                    where to_char(a.enddate, 'yyyy') = #{yearStr}
+                    <if test="comcode != '00'">
+                        AND substr(a.comcode, 1, ${comcodeLength2}) = #{comcode}
+                    </if>
+                    )
+                )
+            group by enddate
+            union all
+
+            -- 已续
+            SELECT
+                enddate, 0, count(1) sum_yi, 0, sum(SUMPREMIUM) SUMPREMIUM_YI
+            FROM (select distinct *
+                from (SELECT to_char(a.enddate, 'yyyy-MM') enddate,
+                        a.POLICYNO_N,
+                        a.SUMPREMIUM
+                        FROM QW_MID_RENEWAL_GF_LIST a
+                        where to_char(a.enddate, 'yyyy') = #{yearStr}
+                        and a.POLICYNO_N is not null
+                        <if test="comcode != '00'">
+                            AND substr(a.COMCODE_N, 1, ${comcodeLength2}) = #{comcode}
+                        </if>
+                    )
+                )
+            group by enddate
+        )
+        group by enddate
+        ORDER BY enddate
+    </select>
+    <select id="selectByPolicyno" resultType="java.lang.Double">
+        SELECT round(sum(a.premium),2) premium
+        FROM mid_cb_premium_kind_all@dblink_statdw a
+        WHERE a.policyno = #{policyno}
+        group by policyno
+    </select>
+    <select id="sendMsgCount" resultType="com.linkwechat.coal.modules.xxxt.renewal.domain.vo.SendCountVo">
+        SELECT
+            m.comcode,
+            (SELECT t.comcname FROM SaCompany@dblink_sales t where t.comcode=m.comcode) as comcname,
+            m.policyno,
+            '' applycode,
+            m.appliname applyname,
+            m.mobile applyphone,
+            m.mobile phone,
+            m.enddate,
+            NVL((SELECT t.dictvalue
+            FROM QW_SYS_DICT t
+            where t.dicttype = 'SOURCE'
+            and t.dictcode = c.source),
+            c.source) source,
+            a.senddate,
+            c.operatetime,
+            m.wxurl duan_url,
+            m.prourl chang_url
+        FROM xubao_fc m
+        left join NOCARFEE_MSG a
+            on m.policyno=a.policyno and trunc(m.statdate)=trunc(a.senddate)
+        left join xubao_fc_log c
+            on m.policyno = c.plyno
+        WHERE 1=1
+        AND m.comcode IN (
+            select comcode
+            from SaCompany@dblink_sales
+            where validstatus = '1'
+            start with comcode = #{comcode}
+            connect by prior comcode = uppercomcode
+            and prior comcode != comcode
+        )
+        <if test="dfComcode != null and dfComcode !=''">
+            AND m.comcode IN (
+                select comcode
+                from SaCompany@dblink_sales
+                where validstatus = '1'
+                start with comcode = #{dfComcode}
+                connect by prior comcode = uppercomcode
+                and prior comcode != comcode
+            )
+        </if>
+        <if test="startDate != null and endDate != null">
+            and trunc(m.enddate) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+        </if>
+        <if test="phone != null and phone != ''">
+            and m.mobile = #{phone}
+        </if>
+        ORDER BY a.senddate DESC
+    </select>
+    <select id="selectByMainpolicyno" resultType="com.linkwechat.coal.modules.xxxt.renewal.domain.vo.CarVo">
+        select distinct
+            motor.licenseno licenseno,
+            re.insuredname name,
+            fun_aes_decrypt(re.contactphoneno) mobile
+        from guproposalitemmotor@${dblink} motor, guproposalrelatedparty@${dblink} re
+        where motor.proposalno = re.proposalno
+        and re.proposalno = #{mainpolicyno}
+    </select>
+    <select id="xbrwzztj" resultType="com.linkwechat.coal.modules.xxxt.renewal.domain.vo.XbrwzztjVo">
+        SELECT
+            a.genjin_user genjinUser,
+            a.genjin_user_name genjinUserName,
+            count(1) yiCount,
+            SUM(CASE WHEN a.status ='1' THEN 1 ELSE 0 END) AS zhengzaiCount,
+            SUM(CASE WHEN a.status ='6' THEN 1 ELSE 0 END) AS grokCount,
+            SUM(a.JQ_NEWSUMPRE ) + SUM(a.SY_NEWSUMPRE) AS grokFee,
+            round(SUM(CASE WHEN a.status ='6' THEN 1 ELSE 0 END)/count(1) *100, 2) AS grlv,
+            SUM(CASE WHEN a.status ='2' THEN 1 ELSE 0 END) AS zrokCount,
+            (SUM(CASE WHEN a.status ='2' THEN 1 ELSE 0 END) + SUM(CASE WHEN a.status ='6' THEN 1 ELSE 0 END)) AS allokCount,
+            round((SUM(CASE WHEN a.status ='2' THEN 1 ELSE 0 END) + SUM(CASE WHEN a.status ='6' THEN 1 ELSE 0 END))/count(1) *100, 2) AS alllv,
+            '' remake
+        FROM QW_RENEWAL_FRAMENO_LIST  a
+        WHERE
+            a.comcode IN (select companycode
+                from cd_gglevelcompany@dblink_statdw
+                where level1com = #{comcode}
+                or level2com = #{comcode}
+                or level3com = #{comcode}
+                or level4com = #{comcode}
+                or level5com = #{comcode})
+        and a.comcode IN (select companycode
+                from cd_gglevelcompany@dblink_statdw
+                where level1com = #{dfComcode}
+                or level2com = #{dfComcode}
+                or level3com = #{dfComcode}
+                or level4com = #{dfComcode}
+                or level5com = #{dfComcode})
+        AND (trunc(a.OLDSYENDDATE) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+            OR
+            trunc(a.OLDJQENDDATE) between trunc(#{startDate, jdbcType=TIMESTAMP}) and trunc(#{endDate, jdbcType=TIMESTAMP})
+          )
+        AND a.is_audit = '1'
+        AND a.genjin_user is not null
+        <if test="genjinUserIdList != null">
+        AND a.genjin_user in
+            <foreach collection="genjinUserIdList" index="i" item="item" open="(" close=")" separator=" union all ">
+                select #{item} from dual
+            </foreach>
+        </if>
+        <if test="genjinUserName != null and genjinUserName !=''">
+            AND a.genjin_user_name like '%' || #{genjinUserName} || '%'
+        </if>
+        <if test="yearStr != null and yearStr !=''">
+            AND  (to_char(a.oldjqstartdate,'yyyy') =#{yearStr}
+            OR
+            to_char(a.oldsystartdate,'yyyy') =#{yearStr}
+            )
+        </if>
+        group by a.genjin_user,a.genjin_user_name
+    </select>
+
+
+</mapper>

+ 316 - 0
linkwe-chinacoal/bin/src/main/resources/mapper/modules/xxxt/system/DictMapper.xml

@@ -0,0 +1,316 @@
+<?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.linkwechat.coal.modules.xxxt.system.mapper.DictMapper">
+    <resultMap id="DictVoResult" type="com.linkwechat.coal.modules.xxxt.system.domain.vo.DictVo">
+        <result property="dicttype" column="dicttype"/>
+        <result property="dictcode" column="dictcode"/>
+        <result property="dictvalue" column="dictvalue"/>
+        <result property="parentId" column="parentId"/>
+        <result property="codevalue" column="codevalue"/>
+    </resultMap>
+    <select id="selectSacompany" resultMap="DictVoResult">
+        select
+            comcode as dictcode,
+            comcname as dictvalue,
+            (comcode ||'--' || comcname) as codevalue,
+            uppercomcode as parentId,
+            #{dicttype} as dicttype
+        from SaCompany@dblink_sales
+        where validstatus = '1'
+          and comcode not like '000%'
+          and comcode not like '99%'
+        <if test="comcodeNotin != null and comcodeNotin.size()>0">
+            <foreach collection="comcodeNotin" item="item" index="i" >
+                and comcode not like  #{item} || '%'
+            </foreach>
+        </if>
+        <choose>
+            <when test="dictcode != null and dictcode !=''">
+                start with comcode = #{dictcode}
+            </when>
+            <otherwise>
+                start with comcode = '00'
+            </otherwise>
+        </choose>
+
+        connect by prior comcode = uppercomcode
+               and prior comcode != comcode
+    </select>
+    <select id="selectSacompanyLength3Level" resultMap="DictVoResult">
+        select
+            comcode as dictcode,
+            comcname as dictvalue,
+            (comcode ||'--' || comcname) as codevalue,
+            uppercomcode as parentId,
+            #{dicttype} as dicttype
+        from SaCompany@dblink_sales
+        where validstatus = '1' and comcode not like '000%' and comcode not like '99%'
+        <if test="comcodeNotin != null and comcodeNotin.size()>0">
+            <foreach collection="comcodeNotin" item="item" index="i">
+                and comcode not like  #{item} || '%'
+            </foreach>
+        </if>
+        and length(comcode) &lt;=4
+        <choose>
+            <when test="dictcode != null and dictcode !=''">
+                start with comcode = #{dictcode}
+            </when>
+            <otherwise>
+                start with comcode = '00'
+            </otherwise>
+        </choose>
+        connect by prior comcode = uppercomcode
+        and prior comcode != comcode
+    </select>
+    <select id="selectParentcomcode" resultMap="DictVoResult">
+        select
+            comcode as dictcode,
+            comcname as dictvalue,
+            (comcode ||'--' || comcname) as codevalue,
+            uppercomcode as parentId,
+            #{dicttype} as dicttype
+        from SaCompany@dblink_sales
+        where validstatus = '1'
+        and comcode = (select
+            distinct uppercomcode
+            from SaCompany@dblink_sales
+            where validstatus = '1'
+            and comcode = #{comcode})
+    </select>
+    <select id="selectPrpdnetpoint" resultMap="DictVoResult">
+        SELECT DISTINCT
+            a.netpointcode as dictcode,
+            a.netpointsname as dictvalue,
+            (a.netpointcode ||'--' || a.netpointsname) as codevalue,
+            #{dicttype} as dicttype
+        FROM prpdnetpoint@dblink_sales a
+        left join SaCompany@dblink_sales b
+        on a.comcode = b.comcode
+        <if test="agentcode != null and agentcode !='' ">
+            left join prpdnetpointagent@dblink_sales c
+            on a.netpointcode=c.netpointcode and c.validstatus='1'
+        </if>
+        where 1=1
+        <if test="comcode != null and comcode !='' ">
+            and b.comcode in (select comcode
+                from SaCompany@dblink_sales
+                where validstatus = '1'
+                start with comcode = #{comcode}
+                connect by prior comcode = uppercomcode
+                and prior comcode != comcode
+            )
+        </if>
+        <if test="agentcode != null and agentcode !='' ">
+            and c.agentcode = #{agentcode}
+        </if>
+        <if test="dictcode != null and dictcode !='' ">
+            and a.netpointcode = #{dictcode}
+        </if>
+        <if test="dictvalue != null and dictvalue !='' ">
+            and a.netpointsname like '%' || #{dictvalue} || '%'
+        </if>
+        order by a.netpointcode
+    </select>
+    <select id="selectPrpdnetpointNew" resultType="com.linkwechat.coal.modules.xxxt.system.domain.vo.DictVo">
+        SELECT DISTINCT
+        a.netpointcode as dictcode,
+        a.netpointsname as dictvalue,
+        (a.netpointcode ||'--' || a.netpointsname) as codevalue,
+        #{dicttype} as dicttype
+        FROM qw_renewal_frameno_list_com a
+        where a.netpointcode is not null
+        <if test="comcode != null and comcode !='' ">
+            and a.comcode in (select comcode
+            from SaCompany@dblink_sales
+            where validstatus = '1'
+            start with comcode = #{comcode}
+            connect by prior comcode = uppercomcode
+            and prior comcode != comcode
+            )
+        </if>
+        <if test="dictcode != null and dictcode !='' ">
+            and a.netpointcode = #{dictcode}
+        </if>
+        <if test="dictvalue != null and dictvalue !='' ">
+            and a.netpointsname like '%' || #{dictvalue} || '%'
+        </if>
+        order by a.netpointcode
+    </select>
+    <select id="selectPrpdnetpointSales" resultType="com.linkwechat.coal.modules.xxxt.system.domain.vo.DictVo">
+        SELECT DISTINCT
+        a.netpointcode as dictcode,
+        a.netpointsname as dictvalue,
+        (a.netpointcode ||'--' || a.netpointsname) as codevalue,
+        #{dicttype} as dicttype
+        FROM prpdnetpoint@dblink_sales a
+        left join SaCompany@dblink_sales b
+        on a.comcode = b.comcode
+        <if test="agentcode != null and agentcode !='' ">
+            left join prpdnetpointagent@dblink_sales c
+            on a.netpointcode=c.netpointcode and c.validstatus='1'
+        </if>
+        where a.validstatus='1'
+        <if test="comcode != null and comcode !='' ">
+            and b.comcode in (select comcode
+            from SaCompany@dblink_sales
+            where validstatus = '1'
+            start with comcode = #{comcode}
+            connect by prior comcode = uppercomcode
+            and prior comcode != comcode
+            )
+        </if>
+        <if test="agentcode != null and agentcode !='' ">
+            and c.agentcode = #{agentcode}
+        </if>
+        <if test="dictcode != null and dictcode !='' ">
+            and a.netpointcode = #{dictcode}
+        </if>
+        <if test="dictvalue != null and dictvalue !='' ">
+            and a.netpointsname like '%' || #{dictvalue} || '%'
+        </if>
+        order by a.netpointcode
+    </select>
+
+    <select id="selectPrpdagent" resultMap="DictVoResult">
+        SELECT distinct
+            a.agentcode as dictcode,
+            a.agentname as dictvalue,
+            (a.agentcode ||'--' || a.agentname) as codevalue,
+            #{dicttype} as dicttype
+        FROM (SELECT aa.agentcode,aa.agentname, aa.comcode FROM QW_RENEWAL_FRAMENO_LIST aa
+            union
+            SELECT distinct aa.agentcode, bb.agentname, bb.comcode
+            FROM QW_MID_RENEWAL_GF_LIST aa
+            left join prpdagent@dblink_sales bb
+            on aa.agentcode = bb.agentcode
+        ) a
+        where a.agentcode is not null
+        <if test="comcode != null and comcode !='' ">
+            and a.comcode in (select comcode
+            from SaCompany@dblink_sales
+            where validstatus = '1'
+            start with comcode = #{comcode}
+            connect by prior comcode = uppercomcode
+            and prior comcode != comcode
+            )
+        </if>
+        <if test="dictcode != null and dictcode !='' ">
+            and a.agentcode = #{dictcode}
+        </if>
+        <if test="dictvalue != null and dictvalue !='' ">
+            and a.agentname like '%' || #{dictvalue} || '%'
+        </if>
+        order by a.agentcode
+    </select>
+    <select id="selectPrpdagentNew" resultType="com.linkwechat.coal.modules.xxxt.system.domain.vo.DictVo">
+        SELECT distinct
+        a.agentcode as dictcode,
+        a.agentname as dictvalue,
+        (a.agentcode ||'--' || a.agentname) as codevalue,
+        #{dicttype} as dicttype
+        FROM qw_renewal_frameno_list_com a
+        where a.agentcode is not null
+        <if test="comcode != null and comcode !='' ">
+            and a.comcode in (select comcode
+            from SaCompany@dblink_sales
+            where validstatus = '1'
+            start with comcode = #{comcode}
+            connect by prior comcode = uppercomcode
+            and prior comcode != comcode
+            )
+        </if>
+        <if test="dictcode != null and dictcode !='' ">
+            and a.agentcode = #{dictcode}
+        </if>
+        <if test="dictvalue != null and dictvalue !='' ">
+            and a.agentname like '%' || #{dictvalue} || '%'
+        </if>
+        order by a.agentcode
+    </select>
+    <select id="selectPrpdagentSales" resultMap="DictVoResult">
+        SELECT distinct
+        a.agentcode as dictcode,
+        a.agentname as dictvalue,
+        (a.agentcode ||'--' || a.agentname) as codevalue,
+        #{dicttype} as dicttype
+        FROM prpdagent@dblink_sales a
+        where a.validstatus='1'
+        <if test="comcode != null and comcode !='' ">
+            and a.comcode in (select comcode
+            from SaCompany@dblink_sales
+            where validstatus = '1'
+            start with comcode = #{comcode}
+            connect by prior comcode = uppercomcode
+            and prior comcode != comcode
+            )
+        </if>
+        <if test="dictcode != null and dictcode !='' ">
+            and a.agentcode = #{dictcode}
+        </if>
+        <if test="dictvalue != null and dictvalue !='' ">
+            and a.agentname like '%' || #{dictvalue} || '%'
+        </if>
+        order by a.agentcode
+    </select>
+    <select id="selectSauser" resultMap="DictVoResult">
+        SELECT
+        a.usercode as dictcode,
+        a.username as dictvalue,
+        (a.usercode ||'--' || a.username) as codevalue,
+        #{dicttype} as dicttype
+        FROM sauser@dblink_sales a
+        left join SaCompany@dblink_sales b
+        on a.comcode = b.comcode
+        where a.validstatus = '1'
+        <if test="comcode != null and comcode !='' ">
+            and b.comcode in (select comcode
+            from SaCompany@dblink_sales
+            where validstatus = '1'
+            <if test="comcodeNotin != null and comcodeNotin.size()>0">
+                <foreach collection="comcodeNotin" item="item" index="i" >
+                    and comcode not like  #{item} || '%'
+                </foreach>
+            </if>
+            start with comcode = #{comcode}
+            connect by prior comcode = uppercomcode
+            and prior comcode != comcode
+            )
+        </if>
+        <if test="dictcode != null and dictcode !='' ">
+            and a.usercode = #{dictcode}
+        </if>
+        <if test="dictvalue != null and dictvalue !='' ">
+            and a.username like '%' || #{dictvalue} || '%'
+        </if>
+        order by a.usercode
+    </select>
+    <select id="cxDblinkDict" resultMap="DictVoResult">
+        SELECT
+            a.codecode as dictcode,
+            a.codecname as dictvalue,
+            (a.codecode ||'--' || a.codecname) as codevalue,
+            #{dicttype} as dicttype
+        FROM ggcode@cx_dblink a
+        where a.validind = '1'
+        AND a.codetype = #{codetype}
+        order by a.displayno
+    </select>
+    <select id="selectPrpdrisk" resultType="com.linkwechat.coal.modules.xxxt.system.domain.vo.DictVo">
+        SELECT distinct
+        a.riskcode as dictcode,
+        a.riskcname as dictvalue,
+        (a.riskcode ||'--' || a.riskcname) as codevalue,
+        #{dicttype} as dicttype
+        FROM prpdrisk@dblink_sales a
+        where a.riskcode is not null and a.validstatus = '1'
+        <if test="dictcode != null and dictcode !='' ">
+            and a.riskcode = #{dictcode}
+        </if>
+        <if test="dictvalue != null and dictvalue !='' ">
+            and a.riskcname like '%' || #{dictvalue} || '%'
+        </if>
+        order by a.riskcode
+    </select>
+
+
+</mapper>

+ 28 - 0
linkwe-chinacoal/bin/src/main/resources/mapper/modules/xxxt/system/PrpdagentMapper.xml

@@ -0,0 +1,28 @@
+<?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.linkwechat.coal.modules.xxxt.system.mapper.PrpdagentMapper">
+    <resultMap id="PrpdagentResult" type="com.linkwechat.coal.modules.xxxt.system.domain.entity.Prpdagent">
+        <result property="agentcode" column="agentcode"/>
+        <result property="agentname" column="agentname"/>
+        <result property="agenttype" column="agenttype"/>
+        <result property="comcode" column="comcode"/>
+    </resultMap>
+    <select id="selectPrpdagent" resultMap="PrpdagentResult">
+        SELECT a.agentcode, a.agentname
+        FROM prpdagent@dblink_sales a
+        left join SaCompany@dblink_sales b
+        on a.comcode = b.comcode
+        where a.validstatus = '1'
+        <if test="comcode != null and comcode !='' ">
+            and b.comcode = #{comcode}
+        </if>
+        <if test="agentcode != null and agentcode !='' ">
+            and a.agentcode = #{agentcode}
+        </if>
+        <if test="agentname != null and agentname !='' ">
+            and a.agentname like '%'|| #{agentname} || '%'
+        </if>
+
+    </select>
+
+</mapper>

+ 30 - 0
linkwe-chinacoal/bin/src/main/resources/mapper/modules/xxxt/system/PrpdnetpointMapper.xml

@@ -0,0 +1,30 @@
+<?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.linkwechat.coal.modules.xxxt.system.mapper.PrpdnetpointMapper">
+
+    <resultMap id="PrpdnetpointResult" type="com.linkwechat.coal.modules.xxxt.system.domain.entity.Prpdnetpoint">
+        <result property="netpointcode" column="netpointcode"/>
+        <result property="netpointname" column="netpointname"/>
+        <result property="comcode" column="comcode"/>
+    </resultMap>
+
+    <select id="selectPrpdnetpoint" resultMap="PrpdnetpointResult">
+        SELECT a.netpointcode, a.netpointname
+        FROM prpdnetpoint@dblink_sales a
+        left join SaCompany@dblink_sales b
+        on a.comcode = b.comcode
+        where a.validstatus = '1'
+        <if test="comcode != null and comcode !='' ">
+            and b.comcode = #{comcode}
+        </if>
+        <if test="netpointcode != null and netpointcode !='' ">
+            and a.netpointcode = #{netpointcode}
+        </if>
+        <if test="netpointname != null and netpointname !='' ">
+            and a.netpointname like '%' || #{netpointcode} || '%'
+        </if>
+        order by a.netpointcode
+    </select>
+
+
+</mapper>

+ 34 - 0
linkwe-chinacoal/bin/src/main/resources/mapper/modules/xxxt/system/QwComcodeDeptMapper.xml

@@ -0,0 +1,34 @@
+<?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.linkwechat.coal.modules.xxxt.system.mapper.QwComcodeDeptMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.linkwechat.coal.modules.xxxt.system.domain.entity.QwComcodeDept">
+        <id column="COMCODE" property="comcode" />
+        <result column="COMNAME" property="comname" />
+        <result column="UPPERCOMCODE" property="uppercomcode" />
+        <result column="DEPT_ID" property="deptId" />
+        <result column="VALIDSTATUS" property="validstatus" />
+        <result column="UPDATE_DATE" property="updateDate" />
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="Base_Column_List">
+        COMCODE, COMNAME, UPPERCOMCODE, DEPT_ID, VALIDSTATUS, UPDATE_DATE
+    </sql>
+    <delete id="deleteByComcode">
+        delete from QW_COMCODE_DEPT where COMCODE=#{comcode}
+    </delete>
+    <select id="selectByComcode"
+            resultType="com.linkwechat.coal.modules.xxxt.system.domain.entity.QwComcodeDept">
+        SELECT <include refid="Base_Column_List"/>
+        FROM QW_COMCODE_DEPT A
+        WHERE A.COMCODE=#{comcode}
+    </select>
+    <select id="selectByDeptIdLike" resultType="com.linkwechat.coal.modules.xxxt.system.domain.entity.QwComcodeDept">
+        SELECT <include refid="Base_Column_List"/>
+        FROM QW_COMCODE_DEPT A
+        where a.DEPT_ID like '%,'|| #{deptId} ||',%' or a.DEPT_ID like '%' || #{deptId}
+    </select>
+
+</mapper>

+ 65 - 0
linkwe-chinacoal/bin/src/main/resources/mapper/modules/xxxt/system/QwSysDictMapper.xml

@@ -0,0 +1,65 @@
+<?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.linkwechat.coal.modules.xxxt.system.mapper.QwSysDictMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.linkwechat.coal.modules.xxxt.system.domain.entity.QwSysDict">
+        <id column="id" property="id" />
+        <result column="dicttype" property="dicttype" />
+        <result column="dictcode" property="dictcode" />
+        <result column="dictvalue" property="dictvalue" />
+        <result column="dictsort" property="dictsort" />
+        <result column="status" property="status" />
+        <result column="create_time" property="createTime" />
+        <result column="create_by" property="createBy" />
+        <result column="is_default" property="isDefault" />
+        <result column="dictlabel" property="dictlabel" />
+        <result column="remake" property="remake" />
+        <result column="parentdictcode" property="parentdictcode" />
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="Base_Column_List">
+        id, dicttype, dictcode, dictvalue, dictsort, status, create_time, create_by, is_default, dictlabel, remake, parentdictcode
+    </sql>
+    <select id="select" resultType="com.linkwechat.coal.modules.xxxt.system.domain.vo.DictVo">
+        SELECT
+            <include refid="Base_Column_List"/>,
+            (dictcode||'--'||dictvalue) as codevalue,
+            is_default as  isDefault
+        FROM qw_sys_dict
+        <where>
+            status = '1'
+            <if test="dicttype != null and dicttype !=''">
+                AND dicttype = UPPER(#{dicttype})
+            </if>
+            <if test="dictvalue != null and dictvalue !=''">
+                AND dictvalue LIKE '%' || #{dictvalue} || '%'
+            </if>
+            <if test="parentdictcode != null and parentdictcode !=''">
+                AND parentdictcode = #{parentdictcode}
+            </if>
+<!--            <if test="dfComcode != null and dfComcode !=''">-->
+<!--                AND parentdictcode in(-->
+<!--                    Select comcode-->
+<!--                    from saCompany@dblink_sales-->
+<!--                    Start With comcode = #{dfComcode,jdbcType=VARCHAR}-->
+<!--                    Connect By Prior comcode = uppercomcode-->
+<!--                    and prior comcode != comcode-->
+<!--                    and validstatus = '1')-->
+
+<!--            </if>-->
+        </where>
+        ORDER BY dictsort ASC
+    </select>
+    <select id="selectAll" resultType="com.linkwechat.coal.modules.xxxt.system.domain.vo.DictVo">
+        SELECT
+        <include refid="Base_Column_List"/>,
+        (dictcode||'--'||dictvalue) as codevalue,
+        is_default as isDefault
+        FROM qw_sys_dict
+        where status = '1'
+        ORDER BY dicttype,dictsort ASC
+    </select>
+
+</mapper>

+ 26 - 0
linkwe-chinacoal/bin/src/main/resources/mapper/modules/xxxt/system/QwUserDeptMapper.xml

@@ -0,0 +1,26 @@
+<?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.linkwechat.coal.modules.xxxt.system.mapper.QwUserDeptMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.linkwechat.coal.modules.xxxt.system.domain.entity.QwUserDept">
+        <result column="user_id" property="userId" />
+        <result column="user_name" property="userName" />
+        <result column="comcode" property="comcode" />
+        <result column="validstatus" property="validstatus" />
+        <result column="update_by" property="updateBy" />
+        <result column="update_date" property="updateDate" />
+        <result column="create_by" property="createBy" />
+        <result column="create_date" property="createDate" />
+        <result column="comcode_notin" property="comcodeNotin" />
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="Base_Column_List">
+        user_id, user_name, comcode, validstatus, update_by, update_date, create_by, create_date,comcode_notin
+    </sql>
+    <select id="selectCom" resultType="java.util.Map">
+        SELECT a.comcode
+        from qw_user_dept a
+    </select>
+</mapper>

+ 33 - 0
linkwe-chinacoal/bin/src/main/resources/mapper/modules/xxxt/system/SacompanyMapper.xml

@@ -0,0 +1,33 @@
+<?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.linkwechat.coal.modules.xxxt.system.mapper.SacompanyMapper">
+    <resultMap id="SacompanyResult" type="com.linkwechat.coal.modules.xxxt.system.domain.entity.Sacompany">
+        <result property="comcode" column="comcode"/>
+        <result property="comcname" column="comcname"/>
+        <result property="uppercomcode" column="uppercomcode"/>
+    </resultMap>
+
+    <select id="selectSacompany" resultMap="SacompanyResult">
+        select comcode, comcname, uppercomcode
+        from SaCompany@dblink_sales
+        where validstatus = '1'
+        <choose>
+            <when test="comcode != null and comcode !=''">
+                start with comcode = #{comcode}
+            </when>
+            <otherwise>
+                start with comcode = '00'
+            </otherwise>
+        </choose>
+        connect by prior comcode = uppercomcode
+               and prior comcode != comcode
+    </select>
+    <select id="selectOne" resultType="com.linkwechat.coal.modules.xxxt.system.domain.entity.Sacompany">
+        SELECT comcode, comcname, uppercomcode
+        from SaCompany@dblink_sales
+        where validstatus = '1'
+        AND comcode=#{comcode}
+    </select>
+
+
+</mapper>

+ 24 - 0
linkwe-chinacoal/bin/src/main/resources/spy.properties

@@ -0,0 +1,24 @@
+#3.2.1\u4EE5\u4E0A\u4F7F\u7528
+modulelist=com.baomidou.mybatisplus.extension.p6spy.MybatisPlusLogFactory,com.p6spy.engine.outage.P6OutageFactory
+#3.2.1\u4EE5\u4E0B\u4F7F\u7528\u6216\u8005\u4E0D\u914D\u7F6E
+#modulelist=com.p6spy.engine.logging.P6LogFactory,com.p6spy.engine.outage.P6OutageFactory
+# \u81EA\u5B9A\u4E49\u65E5\u5FD7\u6253\u5370
+logMessageFormat=com.baomidou.mybatisplus.extension.p6spy.P6SpyLogger
+#\u65E5\u5FD7\u8F93\u51FA\u5230\u63A7\u5236\u53F0
+appender=com.baomidou.mybatisplus.extension.p6spy.StdoutLogger
+# \u4F7F\u7528\u65E5\u5FD7\u7CFB\u7EDF\u8BB0\u5F55 sql
+#appender=com.p6spy.engine.spy.appender.Slf4JLogger
+# \u8BBE\u7F6E p6spy driver \u4EE3\u7406
+deregisterdrivers=true
+# \u53D6\u6D88JDBC URL\u524D\u7F00
+useprefix=true
+# \u914D\u7F6E\u8BB0\u5F55 Log \u4F8B\u5916,\u53EF\u53BB\u6389\u7684\u7ED3\u679C\u96C6\u6709error,info,batch,debug,statement,commit,rollback,result,resultset.
+excludecategories=info,debug,result,commit,resultset
+# \u65E5\u671F\u683C\u5F0F
+dateformat=yyyy-MM-dd HH:mm:ss
+# \u5B9E\u9645\u9A71\u52A8\u53EF\u591A\u4E2A
+#driverlist=oracle.jdbc.driver.OracleDriver
+# \u662F\u5426\u5F00\u542F\u6162SQL\u8BB0\u5F55
+outagedetection=true
+# \u6162SQL\u8BB0\u5F55\u6807\u51C6 2 \u79D2
+outagedetectioninterval=2

+ 340 - 0
linkwe-common/bin/pom.xml

@@ -0,0 +1,340 @@
+<?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">
+    <parent>
+        <artifactId>linkwechat-cloud</artifactId>
+        <groupId>com.linkwechat</groupId>
+        <version>3.1.0</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>linkwe-common</artifactId>
+
+    <description>
+        common通用工具
+    </description>
+
+    <properties>
+        <java.version>1.8</java.version>
+        <maven.compiler.source>1.8</maven.compiler.source>
+        <maven.compiler.target>1.8</maven.compiler.target>
+    </properties>
+
+    <dependencies>
+
+        <!-- Spring框架基本的核心工具 -->
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-context-support</artifactId>
+        </dependency>
+
+        <!-- SpringWeb模块 -->
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-web</artifactId>
+        </dependency>
+
+        <!-- spring security 安全认证 -->
+        <!--<dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-security</artifactId>
+        </dependency>-->
+
+        <!-- pagehelper 分页插件 -->
+        <dependency>
+            <groupId>com.github.pagehelper</groupId>
+            <artifactId>pagehelper-spring-boot-starter</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.json</groupId>
+            <artifactId>json</artifactId>
+            <version>20250517</version>
+        </dependency>
+
+        <!-- 自定义验证注解 -->
+        <dependency>
+            <groupId>javax.validation</groupId>
+            <artifactId>validation-api</artifactId>
+        </dependency>
+
+        <!-- JSON工具类 -->
+        <dependency>
+            <groupId>com.fasterxml.jackson.core</groupId>
+            <artifactId>jackson-databind</artifactId>
+        </dependency>
+
+        <!-- 阿里JSON解析器 -->
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>fastjson</artifactId>
+        </dependency>
+
+        <!-- io常用工具类 -->
+        <dependency>
+            <groupId>commons-io</groupId>
+            <artifactId>commons-io</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-lang3</artifactId>
+        </dependency>
+
+        <!-- 文件上传工具类 -->
+        <dependency>
+            <groupId>commons-fileupload</groupId>
+            <artifactId>commons-fileupload</artifactId>
+        </dependency>
+
+        <!-- excel工具 -->
+        <dependency>
+            <groupId>org.apache.poi</groupId>
+            <artifactId>poi-ooxml-schemas</artifactId>
+        </dependency>
+
+        <!-- yml解析器 -->
+        <dependency>
+            <groupId>org.yaml</groupId>
+            <artifactId>snakeyaml</artifactId>
+        </dependency>
+
+        <!--Token生成与解析-->
+        <dependency>
+            <groupId>io.jsonwebtoken</groupId>
+            <artifactId>jjwt</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>io.vertx</groupId>
+            <artifactId>vertx-core</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>io.vertx</groupId>
+            <artifactId>vertx-web-client</artifactId>
+        </dependency>
+
+        <!-- redis 缓存操作 -->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-data-redis</artifactId>
+        </dependency>
+
+        <!-- pool 对象池 -->
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-pool2</artifactId>
+        </dependency>
+
+        <!-- 解析客户端操作系统、浏览器等 -->
+        <dependency>
+            <groupId>eu.bitwalker</groupId>
+            <artifactId>UserAgentUtils</artifactId>
+        </dependency>
+
+        <!-- servlet包 -->
+        <dependency>
+            <groupId>javax.servlet</groupId>
+            <artifactId>javax.servlet-api</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <scope>compile</scope>
+        </dependency>
+
+
+        <!--防止进入swagger页面报类型转换错误,排除2.9.2中的引用,手动增加1.5.21版本-->
+        <dependency>
+            <groupId>io.swagger</groupId>
+            <artifactId>swagger-annotations</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>io.swagger</groupId>
+            <artifactId>swagger-models</artifactId>
+        </dependency>
+
+        <!-- swagger2-UI-->
+        <dependency>
+            <groupId>io.springfox</groupId>
+            <artifactId>springfox-swagger-ui</artifactId>
+        </dependency>
+
+
+        <!-- https://mvnrepository.com/artifact/com.esotericsoftware/reflectasm -->
+        <dependency>
+            <groupId>com.esotericsoftware</groupId>
+            <artifactId>reflectasm</artifactId>
+        </dependency>
+
+
+        <dependency>
+            <groupId>cn.hutool</groupId>
+            <artifactId>hutool-all</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.google.zxing</groupId>
+            <artifactId>core</artifactId>
+        </dependency>
+
+
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-boot-starter</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>p6spy</groupId>
+            <artifactId>p6spy</artifactId>
+        </dependency>
+
+        <!--动态添加属性和方法开始-->
+        <dependency>
+            <groupId>commons-beanutils</groupId>
+            <artifactId>commons-beanutils</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>cglib</groupId>
+            <artifactId>cglib-nodep</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.thoughtworks.xstream</groupId>
+            <artifactId>xstream</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.dom4j</groupId>
+            <artifactId>dom4j</artifactId>
+        </dependency>
+        <!--动态添加属性和方法结束-->
+
+        <dependency>
+            <groupId>com.github.binarywang</groupId>
+            <artifactId>weixin-java-cp</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.qcloud</groupId>
+            <artifactId>cos_api</artifactId>
+        </dependency>
+
+        <!-- 增加RSA PKCS1解密支持 -->
+        <dependency>
+            <groupId>org.bouncycastle</groupId>
+            <artifactId>bcprov-jdk15on</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.bouncycastle</groupId>
+            <artifactId>bcpg-jdk15on</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.bouncycastle</groupId>
+            <artifactId>bcpkix-jdk15on</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-aop</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.github.jsqlparser</groupId>
+            <artifactId>jsqlparser</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.github.penggle</groupId>
+            <artifactId>kaptcha</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-test</artifactId>
+        </dependency>
+
+        <!-- spring cloud -->
+
+        <!-- SpringCloud Openfeign -->
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-openfeign</artifactId>
+        </dependency>
+
+        <!-- SpringCloud Loadbalancer -->
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-loadbalancer</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>transmittable-thread-local</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.dtflys.forest</groupId>
+            <artifactId>forest-spring-boot-starter</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>easyexcel</artifactId>
+        </dependency>
+
+
+        <dependency>
+            <groupId>com.aliyun.oss</groupId>
+            <artifactId>aliyun-sdk-oss</artifactId>
+        </dependency>
+
+        <!--邮件发送-->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-mail</artifactId>
+        </dependency>
+        <!--图片合并-->
+        <dependency>
+            <groupId>com.freewayso</groupId>
+            <artifactId>image-combiner</artifactId>
+            <version>2.6.3</version>
+        </dependency>
+
+        <dependency>
+            <groupId>ma.glasnost.orika</groupId>
+            <artifactId>orika-core</artifactId>
+            <version>1.5.2</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.hibernate</groupId>
+            <artifactId>hibernate-core</artifactId>
+            <version>5.6.15.Final</version>
+        </dependency>
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>druid-spring-boot-starter</artifactId>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <source>8</source>
+                    <target>8</target>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>

+ 124 - 0
linkwe-fileservice/bin/pom.xml

@@ -0,0 +1,124 @@
+<?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">
+    <parent>
+        <artifactId>linkwechat-cloud</artifactId>
+        <groupId>com.linkwechat</groupId>
+        <version>3.1.0</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>linkwe-fileservice</artifactId>
+
+    <description>
+        linkwe-fileservice文件服务
+    </description>
+
+    <properties>
+        <java.version>1.8</java.version>
+        <maven.compiler.source>1.8</maven.compiler.source>
+        <maven.compiler.target>1.8</maven.compiler.target>
+        <minio.version>8.3.3</minio.version>
+        <fastdfs.version>1.27.2</fastdfs.version>
+    </properties>
+
+    <dependencies>
+        <!-- SpringBoot -->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+
+        <!-- SpringCloud Alibaba Nacos -->
+        <dependency>
+            <groupId>com.alibaba.cloud</groupId>
+            <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
+        </dependency>
+
+        <!-- SpringCloud Alibaba Nacos Config -->
+        <dependency>
+            <groupId>com.alibaba.cloud</groupId>
+            <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
+        </dependency>
+
+        <!-- SpringCloud Alibaba Sentinel -->
+        <dependency>
+            <groupId>com.alibaba.cloud</groupId>
+            <artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
+        </dependency>
+
+        <!-- FastDFS -->
+        <dependency>
+            <groupId>com.github.tobato</groupId>
+            <artifactId>fastdfs-client</artifactId>
+            <version>${fastdfs.version}</version>
+        </dependency>
+
+        <!--    mysql    -->
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+        </dependency>
+
+        <!-- Minio -->
+        <dependency>
+            <groupId>io.minio</groupId>
+            <artifactId>minio</artifactId>
+            <version>${minio.version}</version>
+        </dependency>
+
+        <!-- Swagger -->
+        <dependency>
+            <groupId>io.springfox</groupId>
+            <artifactId>springfox-swagger-ui</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>io.springfox</groupId>
+            <artifactId>springfox-swagger2</artifactId>
+        </dependency>
+
+        <!-- Linkwechat Dependencies -->
+        <dependency>
+            <groupId>com.linkwechat</groupId>
+            <artifactId>linkwe-common</artifactId>
+        </dependency>
+<!--        <dependency>-->
+<!--            <groupId>com.linkwechat</groupId>-->
+<!--            <artifactId>linkwe-service</artifactId>-->
+<!--        </dependency>-->
+
+        <!-- javacv start -->
+        <dependency>
+            <groupId>org.bytedeco</groupId>
+            <artifactId>javacv</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.bytedeco.javacpp-presets</groupId>
+            <artifactId>ffmpeg-platform</artifactId>
+        </dependency>
+
+
+    </dependencies>
+
+
+    <build>
+        <finalName>lw-file</finalName>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+                <version>2.3.3.RELEASE</version>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>repackage</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>

+ 11 - 0
linkwe-fileservice/bin/src/main/resources/banner.txt

@@ -0,0 +1,11 @@
+${AnsiColor.GREEN}
+  _     _       _   __        __    ____ _           _   _____ _ _
+ | |   (_)_ __ | | _\ \      / /__ / ___| |__   __ _| |_|  ___(_) | ___
+ | |   | | '_ \| |/ /\ \ /\ / / _ \ |   | '_ \ / _` | __| |_  | | |/ _ \
+ | |___| | | | |   <  \ V  V /  __/ |___| | | | (_| | |_|  _| | | |  __/
+ |_____|_|_| |_|_|\_\  \_/\_/ \___|\____|_| |_|\__,_|\__|_|   |_|_|\___|
+
+${AnsiColor.WHITE}
+
+Spring Application Name: ${spring.application.name}
+Spring Application Name: ${spring.application.name}

+ 203 - 0
linkwe-fileservice/bin/src/main/resources/logback-spring.xml

@@ -0,0 +1,203 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration scan="true" scanPeriod="60 seconds" debug="false">
+    <!-- 日志输出格式 -->
+    <property name="log.pattern" value="%d{yyyy-MM-dd HH:mm:ss.SSS,CTT} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
+
+    <!--  邮件 -->
+    <!-- SMTP server的地址,必需指定。如网易的SMTP服务器地址是: smtp.163.com -->
+    <property name="smtpHost" value="smtp.163.com"/><!--填入要发送邮件的smtp服务器地址-->
+    <!-- SMTP server的端口地址。默认值:25 -->
+    <property name="smtpPort" value="25"/>
+    <!-- 发送邮件账号,默认为null -->
+    <property name="username" value="*"/><!--发件人账号-->
+    <!-- 发送邮件密码,默认为null -->
+    <property name="password" value="*"/><!--发件人密码-->
+    <!-- 如果设置为true,appender将会使用SSL连接到日志服务器。默认值:false -->
+    <property name="SSL" value="true"/>
+    <!-- 指定发送到那个邮箱,可设置多个<to>属性,指定多个目的邮箱 -->
+    <property name="email_to" value="*"/>
+    <!--收件人账号多个可以逗号隔开-->
+    <!-- 指定发件人名称。如果设置成“&lt;ADMIN&gt; ”,则邮件发件人将会是“<ADMIN> ” -->
+    <property name="email_from" value="1" />
+    <!-- 指定emial的标题,它需要满足PatternLayout中的格式要求。如果设置成“Log: %logger - %msg ”,就案例来讲,则发送邮件时,标题为“【Error】: com.foo.Bar - Hello World ”。 默认值:"%logger{20} - %m". -->
+    <property name="email_subject" value="【linkwechat-file】【Error】: %logger" />
+
+
+    <property name="app_name" value="linkwe-file"/>
+    <!-- 日志根目录-->
+    <springProperty scope="context" name="log.path" source="logging.path"
+                    defaultValue="./logs/linkwe-file"/>
+
+    <!-- 控制台输出 -->
+    <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
+        <encoder>
+            <pattern>${log.pattern}</pattern>
+        </encoder>
+    </appender>
+
+    <!-- 系统日志输出 -->
+    <!-- 循环文件输出(基于时间戳的分文件,是实际项目中用途最广的一种情况) -->
+    <appender name="file_debug" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <file>${log.path}/debug/${app_name}.debug.log</file>
+        <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+            <!-- rollover daily -->
+            <fileNamePattern>${log.path}/debug/${app_name}_%d{yyyy-MM-dd}.debug.%i.log</fileNamePattern>
+            <!-- each file should be at most 100MB, keep 60 days worth of history, but at most 20GB -->
+            <maxFileSize>50MB</maxFileSize>
+            <maxHistory>30</maxHistory>
+            <totalSizeCap>10GB</totalSizeCap>
+        </rollingPolicy>
+        <encoder>
+            <pattern>${log.pattern}</pattern>
+        </encoder>
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <level>DEBUG</level>
+            <onMatch>ACCEPT</onMatch>
+            <onMismatch>DENY</onMismatch>
+        </filter>
+    </appender>
+    <!-- 异步输出 -->
+    <appender name="arollingfile_debug" class="ch.qos.logback.classic.AsyncAppender">
+        <!-- 不丢失日志.默认的,如果队列的80%已满,则会丢弃TRACT、DEBUG、INFO级别的日志 -->
+        <discardingThreshold>0</discardingThreshold>
+        <!-- 更改默认的队列的深度,该值会影响性能.默认值为256 -->
+        <queueSize>1</queueSize>
+        <!-- 添加附加的appender,最多只能添加一个 -->
+        <appender-ref ref="file_debug"/>
+    </appender>
+
+    <!-- 循环文件输出(基于时间戳的分文件,是实际项目中用途最广的一种情况) -->
+    <appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <file>${log.path}/info/${app_name}.info.log</file>
+        <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+            <!-- rollover daily -->
+            <fileNamePattern>${log.path}/info/${app_name}_%d{yyyy-MM-dd}.info.%i.log</fileNamePattern>
+            <!-- each file should be at most 100MB, keep 60 days worth of history, but at most 20GB -->
+            <maxFileSize>50MB</maxFileSize>
+            <maxHistory>30</maxHistory>
+            <totalSizeCap>10GB</totalSizeCap>
+        </rollingPolicy>
+        <encoder>
+            <pattern>${log.pattern}</pattern>
+        </encoder>
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <level>INFO</level>
+            <onMatch>ACCEPT</onMatch>
+            <onMismatch>DENY</onMismatch>
+        </filter>
+    </appender>
+    <!-- 异步输出 -->
+    <appender name="arollingfile_info" class="ch.qos.logback.classic.AsyncAppender">
+        <!-- 不丢失日志.默认的,如果队列的80%已满,则会丢弃TRACT、DEBUG、INFO级别的日志 -->
+        <discardingThreshold>0</discardingThreshold>
+        <!-- 更改默认的队列的深度,该值会影响性能.默认值为256 -->
+        <queueSize>1</queueSize>
+        <!-- 添加附加的appender,最多只能添加一个 -->
+        <appender-ref ref="file_info"/>
+    </appender>
+
+    <!-- 循环文件输出(基于时间戳的分文件,是实际项目中用途最广的一种情况) -->
+    <appender name="file_warn" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <file>${log.path}/warn/${app_name}.warn.log</file>
+        <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+            <!-- rollover daily -->
+            <fileNamePattern>${log.path}/warn/${app_name}_%d{yyyy-MM-dd}.warn.%i.log</fileNamePattern>
+            <!-- each file should be at most 100MB, keep 60 days worth of history, but at most 20GB -->
+            <maxFileSize>50MB</maxFileSize>
+            <maxHistory>30</maxHistory>
+            <totalSizeCap>10GB</totalSizeCap>
+        </rollingPolicy>
+        <encoder>
+            <pattern>${log.pattern}</pattern>
+        </encoder>
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <level>WARN</level>
+            <onMatch>ACCEPT</onMatch>
+            <onMismatch>DENY</onMismatch>
+        </filter>
+    </appender>
+    <!-- 异步输出 -->
+    <appender name="arollingfile_warn" class="ch.qos.logback.classic.AsyncAppender">
+        <!-- 不丢失日志.默认的,如果队列的80%已满,则会丢弃TRACT、DEBUG、INFO级别的日志 -->
+        <discardingThreshold>0</discardingThreshold>
+        <!-- 更改默认的队列的深度,该值会影响性能.默认值为256 -->
+        <queueSize>1</queueSize>
+        <!-- 添加附加的appender,最多只能添加一个 -->
+        <appender-ref ref="file_warn"/>
+    </appender>
+
+    <!-- 循环文件输出(基于时间戳的分文件,是实际项目中用途最广的一种情况) -->
+    <appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <file>${log.path}/error/${app_name}.error.log</file>
+        <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+            <!-- rollover daily -->
+            <fileNamePattern>${log.path}/error/${app_name}_%d{yyyy-MM-dd}.error.%i.log</fileNamePattern>
+            <!-- each file should be at most 100MB, keep 60 days worth of history, but at most 20GB -->
+            <maxFileSize>50MB</maxFileSize>
+            <maxHistory>30</maxHistory>
+            <totalSizeCap>10GB</totalSizeCap>
+        </rollingPolicy>
+        <encoder>
+            <pattern>${log.pattern}</pattern>
+        </encoder>
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <level>ERROR</level>
+            <onMatch>ACCEPT</onMatch>
+            <onMismatch>DENY</onMismatch>
+        </filter>
+    </appender>
+    <!-- 异步输出 -->
+    <appender name="arollingfile_error" class="ch.qos.logback.classic.AsyncAppender">
+        <!-- 不丢失日志.默认的,如果队列的80%已满,则会丢弃TRACT、DEBUG、INFO级别的日志 -->
+        <discardingThreshold>0</discardingThreshold>
+        <!-- 更改默认的队列的深度,该值会影响性能.默认值为256 -->
+        <queueSize>1</queueSize>
+        <!-- 添加附加的appender,最多只能添加一个 -->
+        <appender-ref ref="file_error"/>
+    </appender>
+
+    <!-- ERROR邮件发送 -->
+    <appender name="EMAIL" class="ch.qos.logback.classic.net.SMTPAppender">
+        <smtpHost>${smtpHost}</smtpHost>
+        <smtpPort>${smtpPort}</smtpPort>
+        <username>${username}</username>
+        <password>${password}</password>
+        <!-- <asynchronousSending>true</asynchronousSending>-->
+        <SSL>${SSL}</SSL>
+        <!--<STARTTLS>true</STARTTLS>-->
+        <to>${email_to}</to>
+        <from>${email_from}</from>
+        <subject>${email_subject}</subject>
+        <!-- html格式-->
+        <layout class="ch.qos.logback.classic.html.HTMLLayout">
+            <Pattern>%date%level%thread%logger{0}%line%message</Pattern>
+        </layout>
+        <!-- 这里采用等级过滤器 指定等级相符才发送 -->
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <level>ERROR</level>
+            <onMatch>ACCEPT</onMatch>
+            <onMismatch>DENY</onMismatch>
+        </filter>
+        <cyclicBufferTracker class="ch.qos.logback.core.spi.CyclicBufferTracker">
+            <!-- 每个电子邮件只发送一个日志条目 -->
+            <bufferSize>1</bufferSize>
+        </cyclicBufferTracker>
+    </appender>
+
+
+    <!-- 系统模块日志级别控制  -->
+    <logger name="cn.linkwechat" level="info" />
+    <!-- Spring日志级别控制  -->
+    <logger name="org.springframework" level="warn" />
+
+    <!--系统操作日志-->
+    <root level="info">
+        <appender-ref ref="console" />
+        <appender-ref ref="arollingfile_debug" />
+        <appender-ref ref="arollingfile_info" />
+        <appender-ref ref="arollingfile_warn" />
+        <appender-ref ref="arollingfile_error" />
+        <!-- <appender-ref ref="alarm_error" />-->
+        <appender-ref ref="EMAIL" />
+    </root>
+</configuration>

+ 60 - 0
linkwe-framework/bin/pom.xml

@@ -0,0 +1,60 @@
+<?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">
+    <parent>
+        <artifactId>linkwechat-cloud</artifactId>
+        <groupId>com.linkwechat</groupId>
+        <version>3.1.0</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>linkwe-framework</artifactId>
+
+    <description>
+        framework框架核心
+    </description>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <source>1.8</source>
+                    <target>1.8</target>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+    <dependencies>
+
+        <!-- SpringBoot Web容器 -->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+
+        <!-- SpringBoot 拦截器 -->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-aop</artifactId>
+        </dependency>
+
+        <!-- spring security 安全认证 -->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-security</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.linkwechat</groupId>
+            <artifactId>linkwe-common</artifactId>
+        </dependency>
+
+
+    </dependencies>
+
+</project>

+ 128 - 0
linkwe-gateway/bin/pom.xml

@@ -0,0 +1,128 @@
+<?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">
+    <parent>
+        <artifactId>linkwechat-cloud</artifactId>
+        <groupId>com.linkwechat</groupId>
+        <version>3.1.0</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>linkwe-gateway</artifactId>
+
+    <properties>
+        <java.version>1.8</java.version>
+        <maven.compiler.source>1.8</maven.compiler.source>
+        <maven.compiler.target>1.8</maven.compiler.target>
+    </properties>
+
+    <dependencies>
+        <!-- SpringCloud Gateway -->
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-gateway</artifactId>
+            <version>3.1.1</version>
+        </dependency>
+
+        <!-- SpringCloud Alibaba Nacos -->
+        <dependency>
+            <groupId>com.alibaba.cloud</groupId>
+            <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
+            <version>2021.1</version>
+        </dependency>
+
+        <!-- SpringCloud Alibaba Nacos Config -->
+        <dependency>
+            <groupId>com.alibaba.cloud</groupId>
+            <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
+            <version>2021.1</version>
+        </dependency>
+
+        <!-- SpringCloud Alibaba Sentinel -->
+        <dependency>
+            <groupId>com.alibaba.cloud</groupId>
+            <artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
+            <version>2021.1</version>
+        </dependency>
+
+        <!-- SpringCloud Alibaba Sentinel Gateway -->
+        <dependency>
+            <groupId>com.alibaba.cloud</groupId>
+            <artifactId>spring-cloud-alibaba-sentinel-gateway</artifactId>
+            <version>2021.1</version>
+        </dependency>
+
+        <!-- Sentinel Datasource Nacos -->
+        <dependency>
+            <groupId>com.alibaba.csp</groupId>
+            <artifactId>sentinel-datasource-nacos</artifactId>
+            <version>1.8.0</version>
+        </dependency>
+
+        <!-- SpringBoot Actuator -->
+      <!--  <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-actuator</artifactId>
+        </dependency>-->
+
+        <!--验证码 -->
+        <dependency>
+            <groupId>com.github.penggle</groupId>
+            <artifactId>kaptcha</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>io.netty</groupId>
+            <artifactId>netty-all</artifactId>
+        </dependency>
+
+
+        <!-- 阿里数据库连接池 -->
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>druid-spring-boot-starter</artifactId>
+        </dependency>
+
+        
+
+
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.linkwechat</groupId>
+            <artifactId>linkwe-common</artifactId>
+            <version>3.1.0</version>
+        </dependency>
+
+        <dependency>
+            <groupId>io.springfox</groupId>
+            <artifactId>springfox-swagger-common</artifactId>
+            <version>2.9.2</version>
+            <scope>compile</scope>
+        </dependency>
+
+    </dependencies>
+
+    <build>
+        <finalName>lw-gateway</finalName>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+                <version>2.3.3.RELEASE</version>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>repackage</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+</project>

+ 12 - 0
linkwe-gateway/bin/src/main/resources/banner.txt

@@ -0,0 +1,12 @@
+${AnsiColor.GREEN}
+
+  _     _       _   __        __    ____ _           _    ____       _     __        __
+ | |   (_)_ __ | | _\ \      / /__ / ___| |__   __ _| |_ / ___| __ _| |_ __\ \      / /_ _ _   _
+ | |   | | '_ \| |/ /\ \ /\ / / _ \ |   | '_ \ / _` | __| |  _ / _` | __/ _ \ \ /\ / / _` | | | |
+ | |___| | | | |   <  \ V  V /  __/ |___| | | | (_| | |_| |_| | (_| | ||  __/\ V  V / (_| | |_| |
+ |_____|_|_| |_|_|\_\  \_/\_/ \___|\____|_| |_|\__,_|\__|\____|\__,_|\__\___| \_/\_/ \__,_|\__, |
+                                                                                           |___/
+${AnsiColor.WHITE}
+
+Spring Boot Version: ${spring-boot.version}
+Spring Application Name: ${spring.application.name}

+ 202 - 0
linkwe-gateway/bin/src/main/resources/logback-spring.xml

@@ -0,0 +1,202 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration scan="true" scanPeriod="60 seconds" debug="false">
+   <!-- 日志输出格式 -->
+	<property name="log.pattern" value="%d{yyyy-MM-dd HH:mm:ss.SSS,CTT} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
+
+    <!--  邮件 -->
+    <!-- SMTP server的地址,必需指定。如网易的SMTP服务器地址是: smtp.163.com -->
+    <property name="smtpHost" value="smtp.163.com"/><!--填入要发送邮件的smtp服务器地址-->
+    <!-- SMTP server的端口地址。默认值:25 -->
+    <property name="smtpPort" value="25"/>
+    <!-- 发送邮件账号,默认为null -->
+    <property name="username" value="*"/><!--发件人账号-->
+    <!-- 发送邮件密码,默认为null -->
+    <property name="password" value="*"/><!--发件人密码-->
+    <!-- 如果设置为true,appender将会使用SSL连接到日志服务器。默认值:false -->
+    <property name="SSL" value="true"/>
+    <!-- 指定发送到那个邮箱,可设置多个<to>属性,指定多个目的邮箱 -->
+    <property name="email_to" value="*"/>
+    <!--收件人账号多个可以逗号隔开-->
+    <!-- 指定发件人名称。如果设置成“&lt;ADMIN&gt; ”,则邮件发件人将会是“<ADMIN> ” -->
+    <property name="email_from" value="1" />
+    <!-- 指定emial的标题,它需要满足PatternLayout中的格式要求。如果设置成“Log: %logger - %msg ”,就案例来讲,则发送邮件时,标题为“【Error】: com.foo.Bar - Hello World ”。 默认值:"%logger{20} - %m". -->
+    <property name="email_subject" value="【linkwechat-gateway】【Error】: %logger" />
+
+    <property name="app_name" value="linkwe-gateway"/>
+    <!-- 日志根目录-->
+    <springProperty scope="context" name="log.path" source="logging.path"
+                    defaultValue="./logs/linkwe-gateway"/>
+
+    <!-- 控制台输出 -->
+    <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
+        <encoder>
+            <pattern>${log.pattern}</pattern>
+        </encoder>
+    </appender>
+
+    <!-- 系统日志输出 -->
+    <!-- 循环文件输出(基于时间戳的分文件,是实际项目中用途最广的一种情况) -->
+    <appender name="file_debug" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <file>${log.path}/debug/${app_name}.debug.log</file>
+        <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+            <!-- rollover daily -->
+            <fileNamePattern>${log.path}/debug/${app_name}_%d{yyyy-MM-dd}.debug.%i.log</fileNamePattern>
+            <!-- each file should be at most 100MB, keep 60 days worth of history, but at most 20GB -->
+            <maxFileSize>50MB</maxFileSize>
+            <maxHistory>30</maxHistory>
+            <totalSizeCap>10GB</totalSizeCap>
+        </rollingPolicy>
+        <encoder>
+            <pattern>${log.pattern}</pattern>
+        </encoder>
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <level>DEBUG</level>
+            <onMatch>ACCEPT</onMatch>
+            <onMismatch>DENY</onMismatch>
+        </filter>
+    </appender>
+    <!-- 异步输出 -->
+    <appender name="arollingfile_debug" class="ch.qos.logback.classic.AsyncAppender">
+        <!-- 不丢失日志.默认的,如果队列的80%已满,则会丢弃TRACT、DEBUG、INFO级别的日志 -->
+        <discardingThreshold>0</discardingThreshold>
+        <!-- 更改默认的队列的深度,该值会影响性能.默认值为256 -->
+        <queueSize>1</queueSize>
+        <!-- 添加附加的appender,最多只能添加一个 -->
+        <appender-ref ref="file_debug"/>
+    </appender>
+
+    <!-- 循环文件输出(基于时间戳的分文件,是实际项目中用途最广的一种情况) -->
+    <appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <file>${log.path}/info/${app_name}.info.log</file>
+        <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+            <!-- rollover daily -->
+            <fileNamePattern>${log.path}/info/${app_name}_%d{yyyy-MM-dd}.info.%i.log</fileNamePattern>
+            <!-- each file should be at most 100MB, keep 60 days worth of history, but at most 20GB -->
+            <maxFileSize>50MB</maxFileSize>
+            <maxHistory>30</maxHistory>
+            <totalSizeCap>10GB</totalSizeCap>
+        </rollingPolicy>
+        <encoder>
+            <pattern>${log.pattern}</pattern>
+        </encoder>
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <level>INFO</level>
+            <onMatch>ACCEPT</onMatch>
+            <onMismatch>DENY</onMismatch>
+        </filter>
+    </appender>
+    <!-- 异步输出 -->
+    <appender name="arollingfile_info" class="ch.qos.logback.classic.AsyncAppender">
+        <!-- 不丢失日志.默认的,如果队列的80%已满,则会丢弃TRACT、DEBUG、INFO级别的日志 -->
+        <discardingThreshold>0</discardingThreshold>
+        <!-- 更改默认的队列的深度,该值会影响性能.默认值为256 -->
+        <queueSize>1</queueSize>
+        <!-- 添加附加的appender,最多只能添加一个 -->
+        <appender-ref ref="file_info"/>
+    </appender>
+
+    <!-- 循环文件输出(基于时间戳的分文件,是实际项目中用途最广的一种情况) -->
+    <appender name="file_warn" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <file>${log.path}/warn/${app_name}.warn.log</file>
+        <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+            <!-- rollover daily -->
+            <fileNamePattern>${log.path}/warn/${app_name}_%d{yyyy-MM-dd}.warn.%i.log</fileNamePattern>
+            <!-- each file should be at most 100MB, keep 60 days worth of history, but at most 20GB -->
+            <maxFileSize>50MB</maxFileSize>
+            <maxHistory>30</maxHistory>
+            <totalSizeCap>10GB</totalSizeCap>
+        </rollingPolicy>
+        <encoder>
+            <pattern>${log.pattern}</pattern>
+        </encoder>
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <level>WARN</level>
+            <onMatch>ACCEPT</onMatch>
+            <onMismatch>DENY</onMismatch>
+        </filter>
+    </appender>
+    <!-- 异步输出 -->
+    <appender name="arollingfile_warn" class="ch.qos.logback.classic.AsyncAppender">
+        <!-- 不丢失日志.默认的,如果队列的80%已满,则会丢弃TRACT、DEBUG、INFO级别的日志 -->
+        <discardingThreshold>0</discardingThreshold>
+        <!-- 更改默认的队列的深度,该值会影响性能.默认值为256 -->
+        <queueSize>1</queueSize>
+        <!-- 添加附加的appender,最多只能添加一个 -->
+        <appender-ref ref="file_warn"/>
+    </appender>
+
+    <!-- 循环文件输出(基于时间戳的分文件,是实际项目中用途最广的一种情况) -->
+    <appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <file>${log.path}/error/${app_name}.error.log</file>
+        <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+            <!-- rollover daily -->
+            <fileNamePattern>${log.path}/error/${app_name}_%d{yyyy-MM-dd}.error.%i.log</fileNamePattern>
+            <!-- each file should be at most 100MB, keep 60 days worth of history, but at most 20GB -->
+            <maxFileSize>50MB</maxFileSize>
+            <maxHistory>30</maxHistory>
+            <totalSizeCap>10GB</totalSizeCap>
+        </rollingPolicy>
+        <encoder>
+            <pattern>${log.pattern}</pattern>
+        </encoder>
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <level>ERROR</level>
+            <onMatch>ACCEPT</onMatch>
+            <onMismatch>DENY</onMismatch>
+        </filter>
+    </appender>
+    <!-- 异步输出 -->
+    <appender name="arollingfile_error" class="ch.qos.logback.classic.AsyncAppender">
+        <!-- 不丢失日志.默认的,如果队列的80%已满,则会丢弃TRACT、DEBUG、INFO级别的日志 -->
+        <discardingThreshold>0</discardingThreshold>
+        <!-- 更改默认的队列的深度,该值会影响性能.默认值为256 -->
+        <queueSize>1</queueSize>
+        <!-- 添加附加的appender,最多只能添加一个 -->
+        <appender-ref ref="file_error"/>
+    </appender>
+
+    <!-- ERROR邮件发送 -->
+    <appender name="EMAIL" class="ch.qos.logback.classic.net.SMTPAppender">
+        <smtpHost>${smtpHost}</smtpHost>
+        <smtpPort>${smtpPort}</smtpPort>
+        <username>${username}</username>
+        <password>${password}</password>
+        <!-- <asynchronousSending>true</asynchronousSending>-->
+        <SSL>${SSL}</SSL>
+        <!--<STARTTLS>true</STARTTLS>-->
+        <to>${email_to}</to>
+        <from>${email_from}</from>
+        <subject>${email_subject}</subject>
+        <!-- html格式-->
+        <layout class="ch.qos.logback.classic.html.HTMLLayout">
+            <Pattern>%date%level%thread%logger{0}%line%message</Pattern>
+        </layout>
+        <!-- 这里采用等级过滤器 指定等级相符才发送 -->
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <level>ERROR</level>
+            <onMatch>ACCEPT</onMatch>
+            <onMismatch>DENY</onMismatch>
+        </filter>
+        <cyclicBufferTracker class="ch.qos.logback.core.spi.CyclicBufferTracker">
+            <!-- 每个电子邮件只发送一个日志条目 -->
+            <bufferSize>1</bufferSize>
+        </cyclicBufferTracker>
+    </appender>
+
+
+    <!-- 系统模块日志级别控制  -->
+    <logger name="cn.linkwechat" level="info" />
+    <!-- Spring日志级别控制  -->
+    <logger name="org.springframework" level="warn" />
+
+    <!--系统操作日志-->
+    <root level="info">
+        <appender-ref ref="console" />
+        <appender-ref ref="arollingfile_debug" />
+        <appender-ref ref="arollingfile_info" />
+        <appender-ref ref="arollingfile_warn" />
+        <appender-ref ref="arollingfile_error" />
+        <!-- <appender-ref ref="alarm_error" />-->
+        <appender-ref ref="EMAIL" />
+    </root>
+</configuration>

+ 4 - 1
linkwe-gateway/pom.xml

@@ -78,13 +78,16 @@
             <artifactId>netty-all</artifactId>
         </dependency>
 
-
         <!-- 阿里数据库连接池 -->
         <dependency>
             <groupId>com.alibaba</groupId>
             <artifactId>druid-spring-boot-starter</artifactId>
         </dependency>
 
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>dynamic-datasource-spring-boot-starter</artifactId>
+        </dependency>
 
         <dependency>
             <groupId>mysql</groupId>

+ 149 - 0
linkwe-scheduler/bin/pom.xml

@@ -0,0 +1,149 @@
+<?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">
+    <parent>
+        <artifactId>linkwechat-cloud</artifactId>
+        <groupId>com.linkwechat</groupId>
+        <version>3.1.0</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>linkwe-scheduler</artifactId>
+
+    <description>
+        linkwe-scheduler 定时任务模块
+    </description>
+
+    <properties>
+        <java.version>1.8</java.version>
+        <maven.compiler.source>1.8</maven.compiler.source>
+        <maven.compiler.target>1.8</maven.compiler.target>
+        <xxl-job.version>2.3.1</xxl-job.version>
+    </properties>
+
+    <dependencies>
+        <!-- SpringBoot -->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+
+        <!-- SpringCloud Alibaba Nacos -->
+        <dependency>
+            <groupId>com.alibaba.cloud</groupId>
+            <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
+        </dependency>
+
+        <!-- SpringCloud Alibaba Nacos Config -->
+        <dependency>
+            <groupId>com.alibaba.cloud</groupId>
+            <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
+        </dependency>
+
+        <!-- SpringCloud Alibaba Sentinel -->
+        <!--<dependency>
+            <groupId>com.alibaba.cloud</groupId>
+            <artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
+        </dependency>-->
+
+        <!-- SpringBoot Actuator -->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-actuator</artifactId>
+        </dependency>
+
+        <!-- LinkWechat Service -->
+        <dependency>
+            <groupId>com.linkwechat</groupId>
+            <artifactId>linkwe-service</artifactId>
+        </dependency>
+        <!-- 定时任务 -->
+        <dependency>
+            <groupId>com.xuxueli</groupId>
+            <artifactId>xxl-job-core</artifactId>
+            <version>${xxl-job.version}</version>
+        </dependency>
+
+
+        <!-- Swagger -->
+        <dependency>
+            <groupId>io.springfox</groupId>
+            <artifactId>springfox-swagger-ui</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>io.springfox</groupId>
+            <artifactId>springfox-swagger2</artifactId>
+        </dependency>
+
+        <!-- 阿里数据库连接池 -->
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>druid-spring-boot-starter</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.junit.jupiter</groupId>
+            <artifactId>junit-jupiter</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <!--mybatis-plus多数据源配置-->
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>dynamic-datasource-spring-boot-starter</artifactId>
+            <version>3.4.0</version>
+        </dependency>
+
+        <!--mybatis-plus多数据源配置-->
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-boot-starter</artifactId>
+        </dependency>
+        <!--    oracle    -->
+
+        <!--    mysql    -->
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>p6spy</groupId>
+            <artifactId>p6spy</artifactId>
+        </dependency>
+
+    </dependencies>
+
+    <build>
+        <finalName>lw-scheduler</finalName>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+                <version>2.3.3.RELEASE</version>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>repackage</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+</project>

+ 0 - 0
linkwe-scheduler/bin/src/main/resources/META-INF/services/com.linkwechat.scheduler.processor.IPowerJobProcessor


+ 11 - 0
linkwe-scheduler/bin/src/main/resources/banner.txt

@@ -0,0 +1,11 @@
+${AnsiColor.GREEN}
+  _     _       _   __        __    ____ _           _   ____       _              _       _
+ | |   (_)_ __ | | _\ \      / /__ / ___| |__   __ _| |_/ ___|  ___| |__   ___  __| |_   _| | ___ _ __
+ | |   | | '_ \| |/ /\ \ /\ / / _ \ |   | '_ \ / _` | __\___ \ / __| '_ \ / _ \/ _` | | | | |/ _ \ '__|
+ | |___| | | | |   <  \ V  V /  __/ |___| | | | (_| | |_ ___) | (__| | | |  __/ (_| | |_| | |  __/ |
+ |_____|_|_| |_|_|\_\  \_/\_/ \___|\____|_| |_|\__,_|\__|____/ \___|_| |_|\___|\__,_|\__,_|_|\___|_|
+
+${AnsiColor.WHITE}
+
+Spring Application Name: ${spring.application.name}
+Spring Application Name: ${spring.application.name}

+ 203 - 0
linkwe-scheduler/bin/src/main/resources/logback-spring.xml

@@ -0,0 +1,203 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration scan="true" scanPeriod="60 seconds" debug="false">
+    <!-- 日志输出格式 -->
+    <property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
+
+    <!--  邮件 -->
+    <!-- SMTP server的地址,必需指定。如网易的SMTP服务器地址是: smtp.163.com -->
+    <property name="smtpHost" value="smtp.163.com"/><!--填入要发送邮件的smtp服务器地址-->
+    <!-- SMTP server的端口地址。默认值:25 -->
+    <property name="smtpPort" value="25"/>
+    <!-- 发送邮件账号,默认为null -->
+    <property name="username" value="*"/><!--发件人账号-->
+    <!-- 发送邮件密码,默认为null -->
+    <property name="password" value="*"/><!--发件人密码-->
+    <!-- 如果设置为true,appender将会使用SSL连接到日志服务器。默认值:false -->
+    <property name="SSL" value="true"/>
+    <!-- 指定发送到那个邮箱,可设置多个<to>属性,指定多个目的邮箱 -->
+    <property name="email_to" value="*"/>
+    <!--收件人账号多个可以逗号隔开-->
+    <!-- 指定发件人名称。如果设置成“&lt;ADMIN&gt; ”,则邮件发件人将会是“<ADMIN> ” -->
+    <property name="email_from" value="1" />
+    <!-- 指定emial的标题,它需要满足PatternLayout中的格式要求。如果设置成“Log: %logger - %msg ”,就案例来讲,则发送邮件时,标题为“【Error】: com.foo.Bar - Hello World ”。 默认值:"%logger{20} - %m". -->
+    <property name="email_subject" value="【linkwechat-scheduler】【Error】: %logger" />
+
+
+    <property name="app_name" value="linkwe-scheduler"/>
+    <!-- 日志根目录-->
+    <springProperty scope="context" name="log.path" source="logging.path"
+                    defaultValue="./logs/linkwe-scheduler"/>
+
+    <!-- 控制台输出 -->
+    <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
+        <encoder>
+            <pattern>${log.pattern}</pattern>
+        </encoder>
+    </appender>
+
+    <!-- 系统日志输出 -->
+    <!-- 循环文件输出(基于时间戳的分文件,是实际项目中用途最广的一种情况) -->
+    <appender name="file_debug" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <file>${log.path}/debug/${app_name}.debug.log</file>
+        <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+            <!-- rollover daily -->
+            <fileNamePattern>${log.path}/debug/${app_name}_%d{yyyy-MM-dd}.debug.%i.log</fileNamePattern>
+            <!-- each file should be at most 100MB, keep 60 days worth of history, but at most 20GB -->
+            <maxFileSize>50MB</maxFileSize>
+            <maxHistory>30</maxHistory>
+            <totalSizeCap>10GB</totalSizeCap>
+        </rollingPolicy>
+        <encoder>
+            <pattern>${log.pattern}</pattern>
+        </encoder>
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <level>DEBUG</level>
+            <onMatch>ACCEPT</onMatch>
+            <onMismatch>DENY</onMismatch>
+        </filter>
+    </appender>
+    <!-- 异步输出 -->
+    <appender name="arollingfile_debug" class="ch.qos.logback.classic.AsyncAppender">
+        <!-- 不丢失日志.默认的,如果队列的80%已满,则会丢弃TRACT、DEBUG、INFO级别的日志 -->
+        <discardingThreshold>0</discardingThreshold>
+        <!-- 更改默认的队列的深度,该值会影响性能.默认值为256 -->
+        <queueSize>1</queueSize>
+        <!-- 添加附加的appender,最多只能添加一个 -->
+        <appender-ref ref="file_debug"/>
+    </appender>
+
+    <!-- 循环文件输出(基于时间戳的分文件,是实际项目中用途最广的一种情况) -->
+    <appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <file>${log.path}/info/${app_name}.info.log</file>
+        <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+            <!-- rollover daily -->
+            <fileNamePattern>${log.path}/info/${app_name}_%d{yyyy-MM-dd}.info.%i.log</fileNamePattern>
+            <!-- each file should be at most 100MB, keep 60 days worth of history, but at most 20GB -->
+            <maxFileSize>50MB</maxFileSize>
+            <maxHistory>30</maxHistory>
+            <totalSizeCap>10GB</totalSizeCap>
+        </rollingPolicy>
+        <encoder>
+            <pattern>${log.pattern}</pattern>
+        </encoder>
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <level>INFO</level>
+            <onMatch>ACCEPT</onMatch>
+            <onMismatch>DENY</onMismatch>
+        </filter>
+    </appender>
+    <!-- 异步输出 -->
+    <appender name="arollingfile_info" class="ch.qos.logback.classic.AsyncAppender">
+        <!-- 不丢失日志.默认的,如果队列的80%已满,则会丢弃TRACT、DEBUG、INFO级别的日志 -->
+        <discardingThreshold>0</discardingThreshold>
+        <!-- 更改默认的队列的深度,该值会影响性能.默认值为256 -->
+        <queueSize>1</queueSize>
+        <!-- 添加附加的appender,最多只能添加一个 -->
+        <appender-ref ref="file_info"/>
+    </appender>
+
+    <!-- 循环文件输出(基于时间戳的分文件,是实际项目中用途最广的一种情况) -->
+    <appender name="file_warn" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <file>${log.path}/warn/${app_name}.warn.log</file>
+        <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+            <!-- rollover daily -->
+            <fileNamePattern>${log.path}/warn/${app_name}_%d{yyyy-MM-dd}.warn.%i.log</fileNamePattern>
+            <!-- each file should be at most 100MB, keep 60 days worth of history, but at most 20GB -->
+            <maxFileSize>50MB</maxFileSize>
+            <maxHistory>30</maxHistory>
+            <totalSizeCap>10GB</totalSizeCap>
+        </rollingPolicy>
+        <encoder>
+            <pattern>${log.pattern}</pattern>
+        </encoder>
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <level>WARN</level>
+            <onMatch>ACCEPT</onMatch>
+            <onMismatch>DENY</onMismatch>
+        </filter>
+    </appender>
+    <!-- 异步输出 -->
+    <appender name="arollingfile_warn" class="ch.qos.logback.classic.AsyncAppender">
+        <!-- 不丢失日志.默认的,如果队列的80%已满,则会丢弃TRACT、DEBUG、INFO级别的日志 -->
+        <discardingThreshold>0</discardingThreshold>
+        <!-- 更改默认的队列的深度,该值会影响性能.默认值为256 -->
+        <queueSize>1</queueSize>
+        <!-- 添加附加的appender,最多只能添加一个 -->
+        <appender-ref ref="file_warn"/>
+    </appender>
+
+    <!-- 循环文件输出(基于时间戳的分文件,是实际项目中用途最广的一种情况) -->
+    <appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <file>${log.path}/error/${app_name}.error.log</file>
+        <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+            <!-- rollover daily -->
+            <fileNamePattern>${log.path}/error/${app_name}_%d{yyyy-MM-dd}.error.%i.log</fileNamePattern>
+            <!-- each file should be at most 100MB, keep 60 days worth of history, but at most 20GB -->
+            <maxFileSize>50MB</maxFileSize>
+            <maxHistory>30</maxHistory>
+            <totalSizeCap>10GB</totalSizeCap>
+        </rollingPolicy>
+        <encoder>
+            <pattern>${log.pattern}</pattern>
+        </encoder>
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <level>ERROR</level>
+            <onMatch>ACCEPT</onMatch>
+            <onMismatch>DENY</onMismatch>
+        </filter>
+    </appender>
+    <!-- 异步输出 -->
+    <appender name="arollingfile_error" class="ch.qos.logback.classic.AsyncAppender">
+        <!-- 不丢失日志.默认的,如果队列的80%已满,则会丢弃TRACT、DEBUG、INFO级别的日志 -->
+        <discardingThreshold>0</discardingThreshold>
+        <!-- 更改默认的队列的深度,该值会影响性能.默认值为256 -->
+        <queueSize>1</queueSize>
+        <!-- 添加附加的appender,最多只能添加一个 -->
+        <appender-ref ref="file_error"/>
+    </appender>
+
+    <!-- ERROR邮件发送 -->
+    <appender name="EMAIL" class="ch.qos.logback.classic.net.SMTPAppender">
+        <smtpHost>${smtpHost}</smtpHost>
+        <smtpPort>${smtpPort}</smtpPort>
+        <username>${username}</username>
+        <password>${password}</password>
+        <!-- <asynchronousSending>true</asynchronousSending>-->
+        <SSL>${SSL}</SSL>
+        <!--<STARTTLS>true</STARTTLS>-->
+        <to>${email_to}</to>
+        <from>${email_from}</from>
+        <subject>${email_subject}</subject>
+        <!-- html格式-->
+        <layout class="ch.qos.logback.classic.html.HTMLLayout">
+            <Pattern>%date%level%thread%logger{0}%line%message</Pattern>
+        </layout>
+        <!-- 这里采用等级过滤器 指定等级相符才发送 -->
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <level>ERROR</level>
+            <onMatch>ACCEPT</onMatch>
+            <onMismatch>DENY</onMismatch>
+        </filter>
+        <cyclicBufferTracker class="ch.qos.logback.core.spi.CyclicBufferTracker">
+            <!-- 每个电子邮件只发送一个日志条目 -->
+            <bufferSize>1</bufferSize>
+        </cyclicBufferTracker>
+    </appender>
+
+
+    <!-- 系统模块日志级别控制  -->
+    <logger name="cn.linkwechat" level="info" />
+    <!-- Spring日志级别控制  -->
+    <logger name="org.springframework" level="warn" />
+
+    <!--系统操作日志-->
+    <root level="info">
+        <appender-ref ref="console" />
+        <appender-ref ref="arollingfile_debug" />
+        <appender-ref ref="arollingfile_info" />
+        <appender-ref ref="arollingfile_warn" />
+        <appender-ref ref="arollingfile_error" />
+        <!-- <appender-ref ref="alarm_error" />-->
+        <appender-ref ref="EMAIL" />
+    </root>
+</configuration>

+ 67 - 0
linkwe-scheduler/bin/src/main/resources/mapper/modules/xxxt/CarDblinkMapper.xml

@@ -0,0 +1,67 @@
+<?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.linkwechat.scheduler.modules.xxxt.mapper.CarDblinkMapper" >
+
+    <select id="select" resultType="com.linkwechat.scheduler.modules.xxxt.domain.entity.CarDblinkTag">
+        select
+            a.proposalno,
+            a.companycode,
+            b.insuredcode,
+            b.insuredname,
+            to_char(b.birthdate, 'yyyy-mm-dd') birthdate,
+            (case b.sex
+             when '1' then
+              '男'
+             when '2' then
+              '女'
+             else
+              '其他'
+            end) sex,
+            fun_aes_decrypt(b.contactphoneno) contactphoneno,
+            c.brandname,
+            c.purchaseprice,
+            (case c.chgownerflag
+             when '01' then
+              '过户车'
+             when '02' then
+              '过户车'
+             when '0' then
+              '非过户车'
+             else
+              '其他'
+            end) chgownerflag,
+            (case c.secondhandcarflag
+             when '1' then
+              '二手车'
+             when '0' then
+              '非二手车'
+             else
+              '其他'
+            end) secondhandcarflag,
+            to_char(a.operatedate, 'yyyy-mm-dd') operatedate,
+            (case a.renewind
+             when '1' then
+              '续保'
+             else
+              '新保'
+            end) renewind,
+            (case a.relatedriskcode
+             when '1' then
+              '单交'
+             when '2' then
+              '交三'
+             when '3' then
+              '主全'
+             else
+              '其他'
+            end) relatedriskcode
+        from gupolicymain@cx_dblink         a,
+        gupolicyrelatedparty@cx_dblink b,
+        gupolicyitemmotor@cx_dblink    c
+        where a.policyno = b.policyno
+        and b.policyno = c.policyno
+        and c.itemno = '1'
+        and a.proposalno = #{proposalno}
+
+    </select>
+</mapper>

Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff