作者 王勇

车辆调度系统,初次提交

正在显示 41 个修改的文件 包含 4418 行增加0 行删除

要显示太多修改。

为保证性能只显示 41 of 41+ 个文件。

  1 +HELP.md
  2 +target/
  3 +!.mvn/wrapper/maven-wrapper.jar
  4 +!**/src/main/**
  5 +!**/src/test/**
  6 +
  7 +### STS ###
  8 +.apt_generated
  9 +.classpath
  10 +.factorypath
  11 +.project
  12 +.settings
  13 +.springBeans
  14 +.sts4-cache
  15 +
  16 +### IntelliJ IDEA ###
  17 +.idea
  18 +*.iws
  19 +*.iml
  20 +*.ipr
  21 +
  22 +### NetBeans ###
  23 +/nbproject/private/
  24 +/nbbuild/
  25 +/dist/
  26 +/nbdist/
  27 +/.nb-gradle/
  28 +build/
  29 +
  30 +### VS Code ###
  31 +.vscode/
  1 +/*
  2 + * Copyright 2007-present the original author or authors.
  3 + *
  4 + * Licensed under the Apache License, Version 2.0 (the "License");
  5 + * you may not use this file except in compliance with the License.
  6 + * You may obtain a copy of the License at
  7 + *
  8 + * https://www.apache.org/licenses/LICENSE-2.0
  9 + *
  10 + * Unless required by applicable law or agreed to in writing, software
  11 + * distributed under the License is distributed on an "AS IS" BASIS,
  12 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13 + * See the License for the specific language governing permissions and
  14 + * limitations under the License.
  15 + */
  16 +
  17 +import java.net.*;
  18 +import java.io.*;
  19 +import java.nio.channels.*;
  20 +import java.util.Properties;
  21 +
  22 +public class MavenWrapperDownloader {
  23 +
  24 + private static final String WRAPPER_VERSION = "0.5.6";
  25 + /**
  26 + * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
  27 + */
  28 + private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
  29 + + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
  30 +
  31 + /**
  32 + * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
  33 + * use instead of the default one.
  34 + */
  35 + private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
  36 + ".mvn/wrapper/maven-wrapper.properties";
  37 +
  38 + /**
  39 + * Path where the maven-wrapper.jar will be saved to.
  40 + */
  41 + private static final String MAVEN_WRAPPER_JAR_PATH =
  42 + ".mvn/wrapper/maven-wrapper.jar";
  43 +
  44 + /**
  45 + * Name of the property which should be used to override the default download url for the wrapper.
  46 + */
  47 + private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
  48 +
  49 + public static void main(String args[]) {
  50 + System.out.println("- Downloader started");
  51 + File baseDirectory = new File(args[0]);
  52 + System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
  53 +
  54 + // If the maven-wrapper.properties exists, read it and check if it contains a custom
  55 + // wrapperUrl parameter.
  56 + File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
  57 + String url = DEFAULT_DOWNLOAD_URL;
  58 + if (mavenWrapperPropertyFile.exists()) {
  59 + FileInputStream mavenWrapperPropertyFileInputStream = null;
  60 + try {
  61 + mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
  62 + Properties mavenWrapperProperties = new Properties();
  63 + mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
  64 + url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
  65 + } catch (IOException e) {
  66 + System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
  67 + } finally {
  68 + try {
  69 + if (mavenWrapperPropertyFileInputStream != null) {
  70 + mavenWrapperPropertyFileInputStream.close();
  71 + }
  72 + } catch (IOException e) {
  73 + // Ignore ...
  74 + }
  75 + }
  76 + }
  77 + System.out.println("- Downloading from: " + url);
  78 +
  79 + File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
  80 + if (!outputFile.getParentFile().exists()) {
  81 + if (!outputFile.getParentFile().mkdirs()) {
  82 + System.out.println(
  83 + "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
  84 + }
  85 + }
  86 + System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
  87 + try {
  88 + downloadFileFromURL(url, outputFile);
  89 + System.out.println("Done");
  90 + System.exit(0);
  91 + } catch (Throwable e) {
  92 + System.out.println("- Error downloading");
  93 + e.printStackTrace();
  94 + System.exit(1);
  95 + }
  96 + }
  97 +
  98 + private static void downloadFileFromURL(String urlString, File destination) throws Exception {
  99 + if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
  100 + String username = System.getenv("MVNW_USERNAME");
  101 + char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
  102 + Authenticator.setDefault(new Authenticator() {
  103 + @Override
  104 + protected PasswordAuthentication getPasswordAuthentication() {
  105 + return new PasswordAuthentication(username, password);
  106 + }
  107 + });
  108 + }
  109 + URL website = new URL(urlString);
  110 + ReadableByteChannel rbc;
  111 + rbc = Channels.newChannel(website.openStream());
  112 + FileOutputStream fos = new FileOutputStream(destination);
  113 + fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
  114 + fos.close();
  115 + rbc.close();
  116 + }
  117 +
  118 +}
不能预览此文件类型
  1 +distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
  2 +wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!--参考文档链接:https://blog.csdn.net/qq_34912478/article/details/80877132-->
  3 +<!-- 日志级别从低到高分为TRACE < DEBUG < INFO < WARN < ERROR < FATAL,如果设置为WARN,则低于WARN的信息都不会输出 -->
  4 +<!-- scan:当此属性设置为true时,配置文件如果发生改变,将会被重新加载,默认值为true -->
  5 +<!-- scanPeriod:设置监测配置文件是否有修改的时间间隔,如果没有给出时间单位,默认单位是毫秒。当scan为true时,此属性生效。默认的时间间隔为1分钟。 -->
  6 +<!-- debug:当此属性设置为true时,将打印出logback内部日志信息,实时查看logback运行状态。默认值为false。 -->
  7 +<configuration scan="true" scanPeriod="10 seconds">
  8 +
  9 + <!--<include resource="org/springframework/boot/logging/logback/base.xml" />-->
  10 +
  11 + <contextName>logback</contextName>
  12 + <!-- name的值是变量的名称,value的值时变量定义的值。通过定义的值会被插入到logger上下文中。定义变量后,可以使“${}”来使用变量。 -->
  13 + <property name="log.path" value="./logs" />
  14 +
  15 + <!-- 彩色日志 -->
  16 + <!-- 彩色日志依赖的渲染类 -->
  17 + <conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter" />
  18 + <conversionRule conversionWord="wex" converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter" />
  19 + <conversionRule conversionWord="wEx" converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter" />
  20 + <!-- 彩色日志格式 -->
  21 + <property name="CONSOLE_LOG_PATTERN" value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
  22 +
  23 +
  24 + <!--输出到控制台-->
  25 + <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
  26 + <!--此日志appender是为开发使用,只配置最底级别,控制台输出的日志级别是大于或等于此级别的日志信息-->
  27 + <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
  28 + <level>debug</level>
  29 + </filter>
  30 + <encoder>
  31 + <Pattern>${CONSOLE_LOG_PATTERN}</Pattern>
  32 + <!-- 设置字符集 windows系统这里设置成GBK-->
  33 + <charset>UTF-8</charset>
  34 + </encoder>
  35 + </appender>
  36 +
  37 +
  38 + <!--输出到文件-->
  39 +
  40 + <!-- 时间滚动输出 level为 DEBUG 日志 -->
  41 + <appender name="DEBUG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
  42 + <!-- 正在记录的日志文件的路径及文件名 -->
  43 + <file>${log.path}/log_debug.log</file>
  44 + <!--日志文件输出格式-->
  45 + <encoder>
  46 + <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
  47 + <charset>UTF-8</charset> <!-- 设置字符集 -->
  48 + </encoder>
  49 + <!-- 日志记录器的滚动策略,按日期,按大小记录 -->
  50 + <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
  51 + <!-- 日志归档 -->
  52 + <fileNamePattern>${log.path}/debug/log-debug-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
  53 + <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
  54 + <maxFileSize>100MB</maxFileSize>
  55 + </timeBasedFileNamingAndTriggeringPolicy>
  56 + <!--日志文件保留天数-->
  57 + <maxHistory>15</maxHistory>
  58 + </rollingPolicy>
  59 + <!-- 此日志文件只记录debug级别的 -->
  60 + <filter class="ch.qos.logback.classic.filter.LevelFilter">
  61 + <level>debug</level>
  62 + <onMatch>ACCEPT</onMatch>
  63 + <onMismatch>DENY</onMismatch>
  64 + </filter>
  65 + </appender>
  66 +
  67 + <!-- 时间滚动输出 level为 INFO 日志 -->
  68 + <appender name="INFO_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
  69 + <!-- 正在记录的日志文件的路径及文件名 -->
  70 + <file>${log.path}/log_info.log</file>
  71 + <!--日志文件输出格式-->
  72 + <encoder>
  73 + <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
  74 + <charset>UTF-8</charset>
  75 + </encoder>
  76 + <!-- 日志记录器的滚动策略,按日期,按大小记录 -->
  77 + <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
  78 + <!-- 每天日志归档路径以及格式 -->
  79 + <fileNamePattern>${log.path}/info/log-info-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
  80 + <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
  81 + <maxFileSize>100MB</maxFileSize>
  82 + </timeBasedFileNamingAndTriggeringPolicy>
  83 + <!--日志文件保留天数-->
  84 + <maxHistory>15</maxHistory>
  85 + </rollingPolicy>
  86 + <!-- 此日志文件只记录info级别的 -->
  87 + <filter class="ch.qos.logback.classic.filter.LevelFilter">
  88 + <level>info</level>
  89 + <onMatch>ACCEPT</onMatch>
  90 + <onMismatch>DENY</onMismatch>
  91 + </filter>
  92 + </appender>
  93 +
  94 + <!-- 时间滚动输出 level为 WARN 日志 -->
  95 + <appender name="WARN_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
  96 + <!-- 正在记录的日志文件的路径及文件名 -->
  97 + <file>${log.path}/log_warn.log</file>
  98 + <!--日志文件输出格式-->
  99 + <encoder>
  100 + <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
  101 + <charset>UTF-8</charset> <!-- 此处设置字符集 -->
  102 + </encoder>
  103 + <!-- 日志记录器的滚动策略,按日期,按大小记录 -->
  104 + <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
  105 + <fileNamePattern>${log.path}/warn/log-warn-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
  106 + <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
  107 + <maxFileSize>100MB</maxFileSize>
  108 + </timeBasedFileNamingAndTriggeringPolicy>
  109 + <!--日志文件保留天数-->
  110 + <maxHistory>15</maxHistory>
  111 + </rollingPolicy>
  112 + <!-- 此日志文件只记录warn级别的 -->
  113 + <filter class="ch.qos.logback.classic.filter.LevelFilter">
  114 + <level>warn</level>
  115 + <onMatch>ACCEPT</onMatch>
  116 + <onMismatch>DENY</onMismatch>
  117 + </filter>
  118 + </appender>
  119 +
  120 +
  121 + <!-- 时间滚动输出 level为 ERROR 日志 -->
  122 + <appender name="ERROR_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
  123 + <!-- 正在记录的日志文件的路径及文件名 -->
  124 + <file>${log.path}/log_error.log</file>
  125 + <!--日志文件输出格式-->
  126 + <encoder>
  127 + <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
  128 + <charset>UTF-8</charset> <!-- 此处设置字符集 -->
  129 + </encoder>
  130 + <!-- 日志记录器的滚动策略,按日期,按大小记录 -->
  131 + <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
  132 + <fileNamePattern>${log.path}/error/log-error-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
  133 + <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
  134 + <maxFileSize>100MB</maxFileSize>
  135 + </timeBasedFileNamingAndTriggeringPolicy>
  136 + <!--日志文件保留天数-->
  137 + <maxHistory>15</maxHistory>
  138 + </rollingPolicy>
  139 + <!-- 此日志文件只记录ERROR级别的 -->
  140 + <filter class="ch.qos.logback.classic.filter.LevelFilter">
  141 + <level>ERROR</level>
  142 + <onMatch>ACCEPT</onMatch>
  143 + <onMismatch>DENY</onMismatch>
  144 + </filter>
  145 + </appender>
  146 +
  147 + <!-- 时间滚动输出 level为 trace 日志 -->
  148 + <appender name="TRACE_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
  149 + <!-- 正在记录的日志文件的路径及文件名 -->
  150 + <file>${log.path}/log_trace.log</file>
  151 + <!--日志文件输出格式-->
  152 + <encoder>
  153 + <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
  154 + <charset>UTF-8</charset> <!-- 此处设置字符集 -->
  155 + </encoder>
  156 + <!-- 日志记录器的滚动策略,按日期,按大小记录 -->
  157 + <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
  158 + <fileNamePattern>${log.path}/trace/log-trace-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
  159 + <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
  160 + <maxFileSize>100MB</maxFileSize>
  161 + </timeBasedFileNamingAndTriggeringPolicy>
  162 + <!--日志文件保留天数-->
  163 + <maxHistory>15</maxHistory>
  164 + </rollingPolicy>
  165 + <!-- 此日志文件只记录trace级别的 -->
  166 + <filter class="ch.qos.logback.classic.filter.LevelFilter">
  167 + <level>TRACE</level>
  168 + <onMatch>ACCEPT</onMatch>
  169 + <onMismatch>DENY</onMismatch>
  170 + </filter>
  171 + </appender>
  172 +
  173 +
  174 + <!--
  175 + <logger>用来设置某一个包或者具体的某一个类的日志打印级别、
  176 + 以及指定<appender>。<logger>仅有一个name属性,
  177 + 一个可选的level和一个可选的addtivity属性。
  178 + name:用来指定受此logger约束的某一个包或者具体的某一个类。
  179 + level:用来设置打印级别,大小写无关:TRACE, DEBUG, INFO, WARN, ERROR, ALL 和 OFF,
  180 + 还有一个特俗值INHERITED或者同义词NULL,代表强制执行上级的级别。
  181 + 如果未设置此属性,那么当前logger将会继承上级的级别。
  182 + addtivity:是否向上级logger传递打印信息。默认是true。
  183 + -->
  184 + <!--<logger name="org.springframework.web" level="info"/>-->
  185 + <!--<logger name="org.springframework.scheduling.annotation.ScheduledAnnotationBeanPostProcessor" level="INFO"/>-->
  186 + <!--
  187 + 使用mybatis的时候,sql语句是debug下才会打印,而这里我们只配置了info,所以想要查看sql语句的话,有以下两种操作:
  188 + 第一种把<root level="info">改成<root level="DEBUG">这样就会打印sql,不过这样日志那边会出现很多其他消息
  189 + 第二种就是单独给dao下目录配置debug模式,代码如下,这样配置sql语句会打印,其他还是正常info级别:
  190 + -->
  191 +
  192 +
  193 + <!--
  194 + root节点是必选节点,用来指定最基础的日志输出级别,只有一个level属性
  195 + level:用来设置打印级别,大小写无关:TRACE, DEBUG, INFO, WARN, ERROR, ALL 和 OFF,
  196 + 不能设置为INHERITED或者同义词NULL。默认是DEBUG
  197 + 可以包含零个或多个元素,标识这个appender将会添加到这个logger。
  198 + -->
  199 + <!--<logger name="com.tianbo.analysis" level="trace">-->
  200 + <!--<appender-ref ref="CONSOLE" />-->
  201 + <!--<appender-ref ref="TRACE_FILE" />-->
  202 + <!--<appender-ref ref="DEBUG_FILE" />-->
  203 + <!--<appender-ref ref="INFO_FILE" />-->
  204 + <!--<appender-ref ref="WARN_FILE" />-->
  205 + <!--<appender-ref ref="ERROR_FILE" />-->
  206 + <!--</logger>-->
  207 +
  208 + <!--开发环境:打印控制台-->
  209 + <springProfile name="dev">
  210 + <logger name="org.springframework" level="info"/>
  211 + <logger name="com.sunyo.wlpt.nmms.mapper" level="debug">
  212 + <appender-ref ref="CONSOLE" />
  213 + <appender-ref ref="DEBUG_FILE" />
  214 + </logger>
  215 + <logger name="org.apache.tomcat" level="info" />
  216 + <root level="info">
  217 + <appender-ref ref="CONSOLE" />
  218 + <appender-ref ref="TRACE_FILE" />
  219 + <appender-ref ref="DEBUG_FILE" />
  220 + <appender-ref ref="INFO_FILE" />
  221 + <appender-ref ref="WARN_FILE" />
  222 + <appender-ref ref="ERROR_FILE" />
  223 + </root>
  224 + </springProfile>
  225 +
  226 + <!--生产环境:输出到文件-->
  227 + <springProfile name="pro">
  228 + <logger name="org.springframework" level="INFO"/>
  229 + <root level="info">
  230 + <appender-ref ref="CONSOLE" />
  231 + <appender-ref ref="DEBUG_FILE" />
  232 + <appender-ref ref="INFO_FILE" />
  233 + <appender-ref ref="ERROR_FILE" />
  234 + <appender-ref ref="WARN_FILE" />
  235 + <appender-ref ref="TRACE_FILE" />
  236 + </root>
  237 + </springProfile>
  238 +
  239 +</configuration>
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<configuration scan="ture" scanPeriod="60 seconds" debug="false">
  3 +
  4 + <springProperty scope="context" name="appname" source="logback.appname"/>
  5 + <springProperty scope="context" name="logdir" source="logback.logdir"/>
  6 + <!--文件名-->
  7 + <contextName>${appname}</contextName>
  8 +
  9 + <!--输出到控制面板-->
  10 + <appender name="consoleLog1" class="ch.qos.logback.core.ConsoleAppender">
  11 + <!-- layout输出方式输出-->
  12 + <layout class="ch.qos.logback.classic.PatternLayout">
  13 + <pattern>%d [%thread] %-5level %logger{36} - %msg%n</pattern>
  14 + </layout>
  15 + </appender>
  16 + <!--输出到控制面板-->
  17 + <appender name="consoleLog" class="ch.qos.logback.core.ConsoleAppender">
  18 + <encoder>
  19 + <pattern>%d [%thread] %-5level %logger{36} - %msg%n</pattern>
  20 + </encoder>
  21 + </appender>
  22 + <!--输出info级别日志-->
  23 + <appender name="fileInfoLog" class="ch.qos.logback.core.rolling.RollingFileAppender">
  24 + <filter class="ch.qos.logback.classic.filter.LevelFilter">
  25 + <!--过滤 Error-->
  26 + <level>ERROR</level>
  27 + <!--匹配到就禁止-->
  28 + <onMatch>DENY</onMatch>
  29 + <!--没有匹配到就允许-->
  30 + <onMismatch>ACCEPT</onMismatch>
  31 + </filter>
  32 + <!--<File>../logs</File>-->
  33 + <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
  34 + <FileNamePattern>${logdir}/info.${appname}.%d{yyyy-MM-dd}.log</FileNamePattern>
  35 + <maxHistory>100</maxHistory>
  36 + <totalSizeCap>100MB</totalSizeCap>
  37 + </rollingPolicy>
  38 + <encoder>
  39 + <charset>UTF-8</charset>
  40 + <pattern>%d [%thread] %-5level %logger{36} %line - %msg%n</pattern>
  41 + </encoder>
  42 + </appender>
  43 + <!--输出Error级别日志-->
  44 + <!--<appender name="fileErrorLog" class="ch.qos.logback.core.rolling.RollingFileAppender">-->
  45 + <!--<filter class="ch.qos.logback.classic.filter.LevelFilter">-->
  46 + <!--&lt;!&ndash;过滤 Error &ndash;&gt;-->
  47 + <!--<level>ERROR</level>-->
  48 + <!--</filter>-->
  49 + <!--&lt;!&ndash;<File>../logs</File>&ndash;&gt;-->
  50 + <!--<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">-->
  51 + <!--<FileNamePattern>${logdir}/error.${appname}.%d{yyyy-MM-dd}.log</FileNamePattern>-->
  52 + <!--<maxHistory>100</maxHistory>-->
  53 + <!--<totalSizeCap>100MB</totalSizeCap>-->
  54 + <!--</rollingPolicy>-->
  55 + <!--<encoder>-->
  56 + <!--<charset>UTF-8</charset>-->
  57 + <!--<pattern>%d [%thread] %-5level %logger{36} %line - %msg%n</pattern>-->
  58 + <!--</encoder>-->
  59 + <!--</appender>-->
  60 + <!--监控下列类的所有日志,定义输出级别-->
  61 + <logger name="java.sql.PreparedStatement" level="DEBUG" additivity="false">
  62 + <appender-ref ref="consoleLog"/>
  63 + </logger>    
  64 + <logger name="java.sql.Connection" level="DEBUG" additivity="false"> 
  65 + <appender-ref ref="consoleLog"/>
  66 + </logger>  
  67 + <logger name="java.sql.Statement" level="DEBUG" additivity="false">
  68 + <appender-ref ref="consoleLog"/>
  69 + </logger>    
  70 + <logger name="com.ibatis" level="DEBUG" additivity="false">
  71 + <appender-ref ref="consoleLog"/>
  72 + </logger>    
  73 + <logger name="com.ibatis.common.jdbc.SimpleDataSource" level="DEBUG" additivity="false">
  74 + <appender-ref ref="consoleLog"/>
  75 + </logger>    
  76 + <logger name="com.ibatis.common.jdbc.ScriptRunner" level="DEBUG" additivity="false">
  77 + <appender-ref ref="consoleLog"/>
  78 + </logger>    
  79 + <logger name="com.ibatis.sqlmap.engine.impl.SqlMapClientDelegate" level="DEBUG" additivity="false">
  80 + <appender-ref ref="consoleLog"/>
  81 + </logger> 
  82 + <!--输出-->
  83 + <root level="INFO">
  84 + <appender-ref ref="consoleLog"/>
  85 + <!--<appender-ref ref="consoleLog"/>-->
  86 + <appender-ref ref="fileInfoLog"/>
  87 + <!--<appender-ref ref="fileErrorLog"/>-->
  88 + </root>
  89 +
  90 +</configuration>
  1 +#!/bin/sh
  2 +# ----------------------------------------------------------------------------
  3 +# Licensed to the Apache Software Foundation (ASF) under one
  4 +# or more contributor license agreements. See the NOTICE file
  5 +# distributed with this work for additional information
  6 +# regarding copyright ownership. The ASF licenses this file
  7 +# to you under the Apache License, Version 2.0 (the
  8 +# "License"); you may not use this file except in compliance
  9 +# with the License. You may obtain a copy of the License at
  10 +#
  11 +# https://www.apache.org/licenses/LICENSE-2.0
  12 +#
  13 +# Unless required by applicable law or agreed to in writing,
  14 +# software distributed under the License is distributed on an
  15 +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  16 +# KIND, either express or implied. See the License for the
  17 +# specific language governing permissions and limitations
  18 +# under the License.
  19 +# ----------------------------------------------------------------------------
  20 +
  21 +# ----------------------------------------------------------------------------
  22 +# Maven Start Up Batch script
  23 +#
  24 +# Required ENV vars:
  25 +# ------------------
  26 +# JAVA_HOME - location of a JDK home dir
  27 +#
  28 +# Optional ENV vars
  29 +# -----------------
  30 +# M2_HOME - location of maven2's installed home dir
  31 +# MAVEN_OPTS - parameters passed to the Java VM when running Maven
  32 +# e.g. to debug Maven itself, use
  33 +# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
  34 +# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
  35 +# ----------------------------------------------------------------------------
  36 +
  37 +if [ -z "$MAVEN_SKIP_RC" ] ; then
  38 +
  39 + if [ -f /etc/mavenrc ] ; then
  40 + . /etc/mavenrc
  41 + fi
  42 +
  43 + if [ -f "$HOME/.mavenrc" ] ; then
  44 + . "$HOME/.mavenrc"
  45 + fi
  46 +
  47 +fi
  48 +
  49 +# OS specific support. $var _must_ be set to either true or false.
  50 +cygwin=false;
  51 +darwin=false;
  52 +mingw=false
  53 +case "`uname`" in
  54 + CYGWIN*) cygwin=true ;;
  55 + MINGW*) mingw=true;;
  56 + Darwin*) darwin=true
  57 + # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
  58 + # See https://developer.apple.com/library/mac/qa/qa1170/_index.html
  59 + if [ -z "$JAVA_HOME" ]; then
  60 + if [ -x "/usr/libexec/java_home" ]; then
  61 + export JAVA_HOME="`/usr/libexec/java_home`"
  62 + else
  63 + export JAVA_HOME="/Library/Java/Home"
  64 + fi
  65 + fi
  66 + ;;
  67 +esac
  68 +
  69 +if [ -z "$JAVA_HOME" ] ; then
  70 + if [ -r /etc/gentoo-release ] ; then
  71 + JAVA_HOME=`java-config --jre-home`
  72 + fi
  73 +fi
  74 +
  75 +if [ -z "$M2_HOME" ] ; then
  76 + ## resolve links - $0 may be a link to maven's home
  77 + PRG="$0"
  78 +
  79 + # need this for relative symlinks
  80 + while [ -h "$PRG" ] ; do
  81 + ls=`ls -ld "$PRG"`
  82 + link=`expr "$ls" : '.*-> \(.*\)$'`
  83 + if expr "$link" : '/.*' > /dev/null; then
  84 + PRG="$link"
  85 + else
  86 + PRG="`dirname "$PRG"`/$link"
  87 + fi
  88 + done
  89 +
  90 + saveddir=`pwd`
  91 +
  92 + M2_HOME=`dirname "$PRG"`/..
  93 +
  94 + # make it fully qualified
  95 + M2_HOME=`cd "$M2_HOME" && pwd`
  96 +
  97 + cd "$saveddir"
  98 + # echo Using m2 at $M2_HOME
  99 +fi
  100 +
  101 +# For Cygwin, ensure paths are in UNIX format before anything is touched
  102 +if $cygwin ; then
  103 + [ -n "$M2_HOME" ] &&
  104 + M2_HOME=`cygpath --unix "$M2_HOME"`
  105 + [ -n "$JAVA_HOME" ] &&
  106 + JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
  107 + [ -n "$CLASSPATH" ] &&
  108 + CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
  109 +fi
  110 +
  111 +# For Mingw, ensure paths are in UNIX format before anything is touched
  112 +if $mingw ; then
  113 + [ -n "$M2_HOME" ] &&
  114 + M2_HOME="`(cd "$M2_HOME"; pwd)`"
  115 + [ -n "$JAVA_HOME" ] &&
  116 + JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
  117 +fi
  118 +
  119 +if [ -z "$JAVA_HOME" ]; then
  120 + javaExecutable="`which javac`"
  121 + if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
  122 + # readlink(1) is not available as standard on Solaris 10.
  123 + readLink=`which readlink`
  124 + if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
  125 + if $darwin ; then
  126 + javaHome="`dirname \"$javaExecutable\"`"
  127 + javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
  128 + else
  129 + javaExecutable="`readlink -f \"$javaExecutable\"`"
  130 + fi
  131 + javaHome="`dirname \"$javaExecutable\"`"
  132 + javaHome=`expr "$javaHome" : '\(.*\)/bin'`
  133 + JAVA_HOME="$javaHome"
  134 + export JAVA_HOME
  135 + fi
  136 + fi
  137 +fi
  138 +
  139 +if [ -z "$JAVACMD" ] ; then
  140 + if [ -n "$JAVA_HOME" ] ; then
  141 + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
  142 + # IBM's JDK on AIX uses strange locations for the executables
  143 + JAVACMD="$JAVA_HOME/jre/sh/java"
  144 + else
  145 + JAVACMD="$JAVA_HOME/bin/java"
  146 + fi
  147 + else
  148 + JAVACMD="`which java`"
  149 + fi
  150 +fi
  151 +
  152 +if [ ! -x "$JAVACMD" ] ; then
  153 + echo "Error: JAVA_HOME is not defined correctly." >&2
  154 + echo " We cannot execute $JAVACMD" >&2
  155 + exit 1
  156 +fi
  157 +
  158 +if [ -z "$JAVA_HOME" ] ; then
  159 + echo "Warning: JAVA_HOME environment variable is not set."
  160 +fi
  161 +
  162 +CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
  163 +
  164 +# traverses directory structure from process work directory to filesystem root
  165 +# first directory with .mvn subdirectory is considered project base directory
  166 +find_maven_basedir() {
  167 +
  168 + if [ -z "$1" ]
  169 + then
  170 + echo "Path not specified to find_maven_basedir"
  171 + return 1
  172 + fi
  173 +
  174 + basedir="$1"
  175 + wdir="$1"
  176 + while [ "$wdir" != '/' ] ; do
  177 + if [ -d "$wdir"/.mvn ] ; then
  178 + basedir=$wdir
  179 + break
  180 + fi
  181 + # workaround for JBEAP-8937 (on Solaris 10/Sparc)
  182 + if [ -d "${wdir}" ]; then
  183 + wdir=`cd "$wdir/.."; pwd`
  184 + fi
  185 + # end of workaround
  186 + done
  187 + echo "${basedir}"
  188 +}
  189 +
  190 +# concatenates all lines of a file
  191 +concat_lines() {
  192 + if [ -f "$1" ]; then
  193 + echo "$(tr -s '\n' ' ' < "$1")"
  194 + fi
  195 +}
  196 +
  197 +BASE_DIR=`find_maven_basedir "$(pwd)"`
  198 +if [ -z "$BASE_DIR" ]; then
  199 + exit 1;
  200 +fi
  201 +
  202 +##########################################################################################
  203 +# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
  204 +# This allows using the maven wrapper in projects that prohibit checking in binary data.
  205 +##########################################################################################
  206 +if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
  207 + if [ "$MVNW_VERBOSE" = true ]; then
  208 + echo "Found .mvn/wrapper/maven-wrapper.jar"
  209 + fi
  210 +else
  211 + if [ "$MVNW_VERBOSE" = true ]; then
  212 + echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
  213 + fi
  214 + if [ -n "$MVNW_REPOURL" ]; then
  215 + jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
  216 + else
  217 + jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
  218 + fi
  219 + while IFS="=" read key value; do
  220 + case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
  221 + esac
  222 + done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
  223 + if [ "$MVNW_VERBOSE" = true ]; then
  224 + echo "Downloading from: $jarUrl"
  225 + fi
  226 + wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
  227 + if $cygwin; then
  228 + wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"`
  229 + fi
  230 +
  231 + if command -v wget > /dev/null; then
  232 + if [ "$MVNW_VERBOSE" = true ]; then
  233 + echo "Found wget ... using wget"
  234 + fi
  235 + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
  236 + wget "$jarUrl" -O "$wrapperJarPath"
  237 + else
  238 + wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath"
  239 + fi
  240 + elif command -v curl > /dev/null; then
  241 + if [ "$MVNW_VERBOSE" = true ]; then
  242 + echo "Found curl ... using curl"
  243 + fi
  244 + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
  245 + curl -o "$wrapperJarPath" "$jarUrl" -f
  246 + else
  247 + curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f
  248 + fi
  249 +
  250 + else
  251 + if [ "$MVNW_VERBOSE" = true ]; then
  252 + echo "Falling back to using Java to download"
  253 + fi
  254 + javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
  255 + # For Cygwin, switch paths to Windows format before running javac
  256 + if $cygwin; then
  257 + javaClass=`cygpath --path --windows "$javaClass"`
  258 + fi
  259 + if [ -e "$javaClass" ]; then
  260 + if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
  261 + if [ "$MVNW_VERBOSE" = true ]; then
  262 + echo " - Compiling MavenWrapperDownloader.java ..."
  263 + fi
  264 + # Compiling the Java class
  265 + ("$JAVA_HOME/bin/javac" "$javaClass")
  266 + fi
  267 + if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
  268 + # Running the downloader
  269 + if [ "$MVNW_VERBOSE" = true ]; then
  270 + echo " - Running MavenWrapperDownloader.java ..."
  271 + fi
  272 + ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
  273 + fi
  274 + fi
  275 + fi
  276 +fi
  277 +##########################################################################################
  278 +# End of extension
  279 +##########################################################################################
  280 +
  281 +export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
  282 +if [ "$MVNW_VERBOSE" = true ]; then
  283 + echo $MAVEN_PROJECTBASEDIR
  284 +fi
  285 +MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
  286 +
  287 +# For Cygwin, switch paths to Windows format before running java
  288 +if $cygwin; then
  289 + [ -n "$M2_HOME" ] &&
  290 + M2_HOME=`cygpath --path --windows "$M2_HOME"`
  291 + [ -n "$JAVA_HOME" ] &&
  292 + JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
  293 + [ -n "$CLASSPATH" ] &&
  294 + CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
  295 + [ -n "$MAVEN_PROJECTBASEDIR" ] &&
  296 + MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
  297 +fi
  298 +
  299 +# Provide a "standardized" way to retrieve the CLI args that will
  300 +# work with both Windows and non-Windows executions.
  301 +MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
  302 +export MAVEN_CMD_LINE_ARGS
  303 +
  304 +WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
  305 +
  306 +exec "$JAVACMD" \
  307 + $MAVEN_OPTS \
  308 + -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
  309 + "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
  310 + ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
  1 +@REM ----------------------------------------------------------------------------
  2 +@REM Licensed to the Apache Software Foundation (ASF) under one
  3 +@REM or more contributor license agreements. See the NOTICE file
  4 +@REM distributed with this work for additional information
  5 +@REM regarding copyright ownership. The ASF licenses this file
  6 +@REM to you under the Apache License, Version 2.0 (the
  7 +@REM "License"); you may not use this file except in compliance
  8 +@REM with the License. You may obtain a copy of the License at
  9 +@REM
  10 +@REM https://www.apache.org/licenses/LICENSE-2.0
  11 +@REM
  12 +@REM Unless required by applicable law or agreed to in writing,
  13 +@REM software distributed under the License is distributed on an
  14 +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  15 +@REM KIND, either express or implied. See the License for the
  16 +@REM specific language governing permissions and limitations
  17 +@REM under the License.
  18 +@REM ----------------------------------------------------------------------------
  19 +
  20 +@REM ----------------------------------------------------------------------------
  21 +@REM Maven Start Up Batch script
  22 +@REM
  23 +@REM Required ENV vars:
  24 +@REM JAVA_HOME - location of a JDK home dir
  25 +@REM
  26 +@REM Optional ENV vars
  27 +@REM M2_HOME - location of maven2's installed home dir
  28 +@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
  29 +@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending
  30 +@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
  31 +@REM e.g. to debug Maven itself, use
  32 +@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
  33 +@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
  34 +@REM ----------------------------------------------------------------------------
  35 +
  36 +@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
  37 +@echo off
  38 +@REM set title of command window
  39 +title %0
  40 +@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
  41 +@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
  42 +
  43 +@REM set %HOME% to equivalent of $HOME
  44 +if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
  45 +
  46 +@REM Execute a user defined script before this one
  47 +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
  48 +@REM check for pre script, once with legacy .bat ending and once with .cmd ending
  49 +if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
  50 +if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
  51 +:skipRcPre
  52 +
  53 +@setlocal
  54 +
  55 +set ERROR_CODE=0
  56 +
  57 +@REM To isolate internal variables from possible post scripts, we use another setlocal
  58 +@setlocal
  59 +
  60 +@REM ==== START VALIDATION ====
  61 +if not "%JAVA_HOME%" == "" goto OkJHome
  62 +
  63 +echo.
  64 +echo Error: JAVA_HOME not found in your environment. >&2
  65 +echo Please set the JAVA_HOME variable in your environment to match the >&2
  66 +echo location of your Java installation. >&2
  67 +echo.
  68 +goto error
  69 +
  70 +:OkJHome
  71 +if exist "%JAVA_HOME%\bin\java.exe" goto init
  72 +
  73 +echo.
  74 +echo Error: JAVA_HOME is set to an invalid directory. >&2
  75 +echo JAVA_HOME = "%JAVA_HOME%" >&2
  76 +echo Please set the JAVA_HOME variable in your environment to match the >&2
  77 +echo location of your Java installation. >&2
  78 +echo.
  79 +goto error
  80 +
  81 +@REM ==== END VALIDATION ====
  82 +
  83 +:init
  84 +
  85 +@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
  86 +@REM Fallback to current working directory if not found.
  87 +
  88 +set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
  89 +IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
  90 +
  91 +set EXEC_DIR=%CD%
  92 +set WDIR=%EXEC_DIR%
  93 +:findBaseDir
  94 +IF EXIST "%WDIR%"\.mvn goto baseDirFound
  95 +cd ..
  96 +IF "%WDIR%"=="%CD%" goto baseDirNotFound
  97 +set WDIR=%CD%
  98 +goto findBaseDir
  99 +
  100 +:baseDirFound
  101 +set MAVEN_PROJECTBASEDIR=%WDIR%
  102 +cd "%EXEC_DIR%"
  103 +goto endDetectBaseDir
  104 +
  105 +:baseDirNotFound
  106 +set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
  107 +cd "%EXEC_DIR%"
  108 +
  109 +:endDetectBaseDir
  110 +
  111 +IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
  112 +
  113 +@setlocal EnableExtensions EnableDelayedExpansion
  114 +for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
  115 +@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
  116 +
  117 +:endReadAdditionalConfig
  118 +
  119 +SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
  120 +set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
  121 +set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
  122 +
  123 +set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
  124 +
  125 +FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
  126 + IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
  127 +)
  128 +
  129 +@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
  130 +@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
  131 +if exist %WRAPPER_JAR% (
  132 + if "%MVNW_VERBOSE%" == "true" (
  133 + echo Found %WRAPPER_JAR%
  134 + )
  135 +) else (
  136 + if not "%MVNW_REPOURL%" == "" (
  137 + SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
  138 + )
  139 + if "%MVNW_VERBOSE%" == "true" (
  140 + echo Couldn't find %WRAPPER_JAR%, downloading it ...
  141 + echo Downloading from: %DOWNLOAD_URL%
  142 + )
  143 +
  144 + powershell -Command "&{"^
  145 + "$webclient = new-object System.Net.WebClient;"^
  146 + "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
  147 + "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
  148 + "}"^
  149 + "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^
  150 + "}"
  151 + if "%MVNW_VERBOSE%" == "true" (
  152 + echo Finished downloading %WRAPPER_JAR%
  153 + )
  154 +)
  155 +@REM End of extension
  156 +
  157 +@REM Provide a "standardized" way to retrieve the CLI args that will
  158 +@REM work with both Windows and non-Windows executions.
  159 +set MAVEN_CMD_LINE_ARGS=%*
  160 +
  161 +%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
  162 +if ERRORLEVEL 1 goto error
  163 +goto end
  164 +
  165 +:error
  166 +set ERROR_CODE=1
  167 +
  168 +:end
  169 +@endlocal & set ERROR_CODE=%ERROR_CODE%
  170 +
  171 +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
  172 +@REM check for post script, once with legacy .bat ending and once with .cmd ending
  173 +if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
  174 +if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
  175 +:skipRcPost
  176 +
  177 +@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
  178 +if "%MAVEN_BATCH_PAUSE%" == "on" pause
  179 +
  180 +if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
  181 +
  182 +exit /B %ERROR_CODE%
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  3 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
  4 + <modelVersion>4.0.0</modelVersion>
  5 + <parent>
  6 + <groupId>org.springframework.boot</groupId>
  7 + <artifactId>spring-boot-starter-parent</artifactId>
  8 + <version>2.1.7.RELEASE</version>
  9 + <relativePath/> <!-- lookup parent from repository -->
  10 + </parent>
  11 + <groupId>com.sunyo</groupId>
  12 + <artifactId>dispatch_sys</artifactId>
  13 + <version>0.0.1-SNAPSHOT</version>
  14 + <name>dispatch_sys</name>
  15 + <description>车辆调度系统</description>
  16 +
  17 + <properties>
  18 + <java.version>1.8</java.version>
  19 + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  20 + <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
  21 + <spring-cloud.version>Greenwich.SR2</spring-cloud.version>
  22 + </properties>
  23 +
  24 + <dependencies>
  25 + <!-- SpringBoot start -->
  26 + <dependency>
  27 + <groupId>org.springframework.boot</groupId>
  28 + <artifactId>spring-boot-starter</artifactId>
  29 + </dependency>
  30 +
  31 + <dependency>
  32 + <groupId>org.springframework.boot</groupId>
  33 + <artifactId>spring-boot-starter-web</artifactId>
  34 + </dependency>
  35 + <!-- SpringBoot end -->
  36 +
  37 + <!-- SpringCloud start -->
  38 + <dependency>
  39 + <groupId>org.springframework.cloud</groupId>
  40 + <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
  41 + </dependency>
  42 +
  43 + <dependency>
  44 + <groupId>org.springframework.cloud</groupId>
  45 + <artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
  46 + </dependency>
  47 +
  48 + <dependency>
  49 + <groupId>org.springframework.cloud</groupId>
  50 + <artifactId>spring-cloud-starter-openfeign</artifactId>
  51 + </dependency>
  52 +
  53 + <dependency>
  54 + <groupId>org.springframework.cloud</groupId>
  55 + <artifactId>spring-cloud-starter-zipkin</artifactId>
  56 + </dependency>
  57 +
  58 + <dependency>
  59 + <groupId>de.codecentric</groupId>
  60 + <artifactId>spring-boot-admin-starter-client</artifactId>
  61 + <version>2.2.0</version>
  62 + </dependency>
  63 + <dependency>
  64 + <groupId>org.springframework.boot</groupId>
  65 + <artifactId>spring-boot-starter-actuator</artifactId>
  66 + </dependency>
  67 + <!-- SpringCloud end -->
  68 +
  69 + <!-- database start -->
  70 + <dependency>
  71 + <groupId>mysql</groupId>
  72 + <artifactId>mysql-connector-java</artifactId>
  73 + <scope>runtime</scope>
  74 + </dependency>
  75 +
  76 + <dependency>
  77 + <groupId>org.mybatis.spring.boot</groupId>
  78 + <artifactId>mybatis-spring-boot-starter</artifactId>
  79 + <version>2.1.1</version>
  80 + </dependency>
  81 +
  82 + <dependency>
  83 + <groupId>com.github.pagehelper</groupId>
  84 + <artifactId>pagehelper-spring-boot-starter</artifactId>
  85 + <version>1.2.12</version>
  86 + </dependency>
  87 +
  88 + <dependency>
  89 + <groupId>com.alibaba</groupId>
  90 + <artifactId>druid-spring-boot-starter</artifactId>
  91 + <version>1.1.9</version>
  92 + </dependency>
  93 + <!-- database end -->
  94 +
  95 + <!-- tools start -->
  96 + <dependency>
  97 + <groupId>org.projectlombok</groupId>
  98 + <artifactId>lombok</artifactId>
  99 + <optional>true</optional>
  100 + </dependency>
  101 +
  102 + <dependency>
  103 + <groupId>log4j</groupId>
  104 + <artifactId>log4j</artifactId>
  105 + <version>1.2.17</version>
  106 + </dependency>
  107 +
  108 + <dependency>
  109 + <groupId>io.springfox</groupId>
  110 + <artifactId>springfox-swagger2</artifactId>
  111 + <version>2.9.2</version>
  112 + </dependency>
  113 +
  114 + <dependency>
  115 + <groupId>io.springfox</groupId>
  116 + <artifactId>springfox-swagger-ui</artifactId>
  117 + <version>2.9.2</version>
  118 + </dependency>
  119 +
  120 + <dependency>
  121 + <groupId>com.alibaba</groupId>
  122 + <artifactId>fastjson</artifactId>
  123 + <version>1.2.49</version>
  124 + </dependency>
  125 + <!-- tools end -->
  126 +
  127 + <!-- test start -->
  128 + <dependency>
  129 + <groupId>org.springframework.boot</groupId>
  130 + <artifactId>spring-boot-starter-test</artifactId>
  131 + <scope>test</scope>
  132 + <exclusions>
  133 + <exclusion>
  134 + <groupId>org.junit.vintage</groupId>
  135 + <artifactId>junit-vintage-engine</artifactId>
  136 + </exclusion>
  137 + </exclusions>
  138 + </dependency>
  139 + <!-- test end -->
  140 +
  141 + <!--others modules start -->
  142 + <dependency>
  143 + <groupId>com.tianbo</groupId>
  144 + <artifactId>util</artifactId>
  145 + <version>1.0-SNAPSHOT</version>
  146 + <scope>compile</scope>
  147 + </dependency>
  148 + <!--others modules end -->
  149 +
  150 + </dependencies>
  151 +
  152 + <dependencyManagement>
  153 + <dependencies>
  154 + <dependency>
  155 + <groupId>org.springframework.cloud</groupId>
  156 + <artifactId>spring-cloud-dependencies</artifactId>
  157 + <version>${spring-cloud.version}</version>
  158 + <type>pom</type>
  159 + <scope>import</scope>
  160 + </dependency>
  161 + </dependencies>
  162 + </dependencyManagement>
  163 +
  164 + <build>
  165 + <plugins>
  166 + <plugin>
  167 + <groupId>org.springframework.boot</groupId>
  168 + <artifactId>spring-boot-maven-plugin</artifactId>
  169 + <configuration>
  170 + <mainClass>com.sunyo.wlpt.dispatch.DispatchSysApplication</mainClass>
  171 + </configuration>
  172 + </plugin>
  173 + </plugins>
  174 + </build>
  175 +
  176 + <repositories>
  177 + <repository>
  178 + <id>spring-snapshots</id>
  179 + <name>Spring Snapshots</name>
  180 + <url>https://repo.spring.io/snapshot</url>
  181 + <snapshots>
  182 + <enabled>true</enabled>
  183 + </snapshots>
  184 + </repository>
  185 + <repository>
  186 + <id>spring-milestones</id>
  187 + <name>Spring Milestones</name>
  188 + <url>https://repo.spring.io/milestone</url>
  189 + <snapshots>
  190 + <enabled>false</enabled>
  191 + </snapshots>
  192 + </repository>
  193 + </repositories>
  194 +
  195 +</project>
  1 +package com.sunyo.wlpt.dispatch;
  2 +
  3 +import org.mybatis.spring.annotation.MapperScan;
  4 +import org.springframework.boot.SpringApplication;
  5 +import org.springframework.boot.autoconfigure.SpringBootApplication;
  6 +import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
  7 +import org.springframework.cloud.openfeign.EnableFeignClients;
  8 +import org.springframework.transaction.annotation.EnableTransactionManagement;
  9 +
  10 +/**
  11 + * @author 子诚
  12 + * Description:程序入口类
  13 + */
  14 +@SpringBootApplication
  15 +@MapperScan("com.sunyo.wlpt.dispatch.mapper")
  16 +@EnableFeignClients
  17 +@EnableEurekaClient
  18 +@EnableTransactionManagement
  19 +public class DispatchSysApplication {
  20 +
  21 + public static void main(String[] args) {
  22 + SpringApplication.run(DispatchSysApplication.class, args);
  23 + }
  24 +
  25 +}
  1 +package com.sunyo.wlpt.dispatch.config;
  2 +
  3 +import org.springframework.context.EnvironmentAware;
  4 +import org.springframework.context.annotation.Bean;
  5 +import org.springframework.context.annotation.Configuration;
  6 +import org.springframework.core.env.Environment;
  7 +import org.springframework.core.env.Profiles;
  8 +import springfox.documentation.RequestHandler;
  9 +import springfox.documentation.builders.ApiInfoBuilder;
  10 +import springfox.documentation.builders.PathSelectors;
  11 +import springfox.documentation.builders.RequestHandlerSelectors;
  12 +import springfox.documentation.service.ApiInfo;
  13 +import springfox.documentation.service.Contact;
  14 +import springfox.documentation.service.VendorExtension;
  15 +import springfox.documentation.spi.DocumentationType;
  16 +import springfox.documentation.spring.web.plugins.Docket;
  17 +import springfox.documentation.swagger2.annotations.EnableSwagger2;
  18 +
  19 +import java.util.ArrayList;
  20 +
  21 +/**
  22 + * @author 子诚
  23 + * Description:
  24 + * 时间:2020/4/21 11:32
  25 + */
  26 +
  27 +@Configuration
  28 +@EnableSwagger2
  29 +public class SwaggerConfig {
  30 + @Bean
  31 + public Docket docket(Environment environment) {
  32 + //设置要显示的swagger环境
  33 + Profiles profiles = Profiles.of("dev", "test");
  34 + //通过environment.acceptsProfiles,判定是否处在自己设置的环境中
  35 + boolean flag = environment.acceptsProfiles(profiles);
  36 + //版本类型是swagger2
  37 + return new Docket(DocumentationType.SWAGGER_2)
  38 + //通过调用自定义方法apiInfo,获得文档的主要信息
  39 + .apiInfo(apiInfo())
  40 + //分组
  41 + .groupName("子诚")
  42 + //如果是自己设置的环境,就是true,即打开swagger
  43 + .enable(true)
  44 +
  45 + .select()
  46 + //RequestHandlerSelectors,配置要扫描接口的方式
  47 + //basePackage:配置要扫描的包,扫描该包下面的API注解
  48 + .apis(RequestHandlerSelectors.basePackage("com.sunyo.wlpt.dispatch.controller"))
  49 + //PathSelectors.any(),扫描全部;none(),全部都不扫描;withMethodAnnotation:扫描方法上的注解
  50 +
  51 + //paths:过滤什么路径
  52 + .paths(PathSelectors.any())
  53 + .build();
  54 + }
  55 +
  56 + /**
  57 + * 配置swagger信息==apiInfo
  58 + * @return
  59 + */
  60 + private ApiInfo apiInfo() {
  61 + //作者信息
  62 + Contact contact = new Contact("子诚", "http://127.0.0.1:9999", "523186180@qq.com");
  63 + return new ApiInfo(
  64 + "车辆调度系统",
  65 + "春花秋月,夏日冬雪",
  66 + "1.0",
  67 + "http://127.0.0.1:9999",
  68 + contact,
  69 + "Apache 2.0",
  70 + "http://www.apache.org/licenses/LICENSE-2.0",
  71 + new ArrayList<VendorExtension>());
  72 + }
  73 +}
  1 +package com.sunyo.wlpt.dispatch.controller;
  2 +
  3 +
  4 +import com.sunyo.wlpt.dispatch.domain.DispatchNote;
  5 +import com.sunyo.wlpt.dispatch.domain.VehicleInfo;
  6 +import com.sunyo.wlpt.dispatch.response.ResultJson;
  7 +import com.sunyo.wlpt.dispatch.service.DispatchNoteService;
  8 +import com.sunyo.wlpt.dispatch.service.VehicleInfoService;
  9 +import io.swagger.annotations.Api;
  10 +import io.swagger.annotations.ApiOperation;
  11 +import org.apache.ibatis.annotations.Update;
  12 +import org.springframework.beans.factory.annotation.Autowired;
  13 +import org.springframework.web.bind.annotation.*;
  14 +
  15 +import java.util.Date;
  16 +import java.util.List;
  17 +
  18 +import static java.util.stream.Collectors.toList;
  19 +
  20 +/**
  21 + * @author 子诚
  22 + * Description:调度车辆
  23 + * 时间:2020/4/21 16:44
  24 + */
  25 +@Api(value = "调度车辆业务")
  26 +@RequestMapping("dispatch")
  27 +@RestController
  28 +public class DispatchController {
  29 +
  30 + @Autowired
  31 + private VehicleInfoService vehicleInfoService;
  32 +
  33 + @Autowired
  34 + private DispatchNoteService dispatchNoteService;
  35 +
  36 + @ApiOperation(value = "我要调度车辆")
  37 + @PostMapping("/dispatch")
  38 + public ResultJson<VehicleInfo> dispatch(@RequestBody DispatchNote req) {
  39 + //返回前端的
  40 + ResultJson<VehicleInfo> result = new ResultJson<>();
  41 +
  42 + /**
  43 + * 1.获取到用户的需求
  44 + */
  45 + Integer vehicleNumber = req.getVehicleNumber();
  46 + String vehicleType = req.getVehicleType();
  47 + // 匹配车辆条件,车辆状态为空闲(1)
  48 + String vehicleStatus = "1";
  49 + // 2.根据用户的需求(车辆类型、数量进行匹配)
  50 + List<VehicleInfo> vehicleInfoList = vehicleInfoService.dispatchVehicle(vehicleType, vehicleStatus);
  51 + // 3.对查询出来的结果进行匹配
  52 + if (vehicleInfoList.size() >= vehicleNumber) {
  53 + //取出前(需求)个
  54 + List<VehicleInfo> needList = vehicleInfoList.stream()
  55 + .limit(vehicleNumber)
  56 + .collect(toList());
  57 + for (int i = 0; i < needList.size(); i++) {
  58 + /**
  59 + * 1、通知车牌号为 XX 的车被调用,任务地点:场站位置;业务类型:XXXX
  60 + * //获取车牌号
  61 + * needList.get(i).getLicensePlateNumber();
  62 + * //获取场站位置
  63 + * req.getStation();
  64 + * //获取业务类型
  65 + * req.getDispatchType();
  66 + * //获取用户的姓名
  67 + * req.getUserName();
  68 + * //获取用户的联系方式
  69 + * req.getUserMobile();
  70 + */
  71 +
  72 + //2.修改车辆状态
  73 + needList.get(i).setVehicleStatus("2");
  74 + // 将车辆状态设置为执行状态
  75 + vehicleInfoService.updateByPrimaryKey(needList.get(i));
  76 + /**
  77 + * 3.生成调度表业务
  78 + */
  79 + // 生成调度记录表
  80 + DispatchNote dispatchNote = new DispatchNote();
  81 + //记录表,设置用户的姓名
  82 + dispatchNote.setUserName(req.getUserName());
  83 + //记录表,设置用户的联系方式
  84 + dispatchNote.setUserMobile(req.getUserMobile());
  85 + //记录表,设置调度业务类型
  86 + dispatchNote.setDispatchType(req.getDispatchType());
  87 + //记录表,设置场站位置
  88 + dispatchNote.setStation(req.getStation());
  89 + //记录表,每条记录表的车辆数为1
  90 + dispatchNote.setVehicleNumber(1);
  91 + //记录表,设置车辆类型
  92 + dispatchNote.setVehicleType(req.getVehicleType());
  93 + //记录表,设置记录状态为执行状态(2)
  94 + dispatchNote.setStatus("2");
  95 + // 生成调度记录表
  96 + dispatchNoteService.insertSelective(dispatchNote);
  97 + }
  98 + //车辆匹配成功,返回车辆信息
  99 + result.setData((VehicleInfo) needList);
  100 + result.setCode("200");
  101 + result.setMsg("车辆调度成功!");
  102 + } else {
  103 + //车辆匹配失败
  104 + result.setCode("400");
  105 + result.setMsg("车辆繁忙,请稍后重试!");
  106 + }
  107 + return result;
  108 + }
  109 +
  110 + @ApiOperation(value = "开始工作", notes = "车辆被调度后,开始工作的时刻")
  111 + @PutMapping("/startTask")
  112 + public void startTask(@RequestBody DispatchNote req) {
  113 + /**
  114 + * 设置调度记录表,开始任务时间(由客户端传递过来,比较精确)
  115 + */
  116 + dispatchNoteService.updateByPrimaryKeySelective(req);
  117 + }
  118 +
  119 + @ApiOperation(value = "完成工作", notes = "车辆被调度后,完成工作的时刻")
  120 + @PutMapping("/completeTask")
  121 + public void completeTask(@RequestBody DispatchNote req) {
  122 + /**
  123 + * 车辆信息表,修改
  124 + * 1.设置车辆信息表,为空闲状态(1)
  125 + * 2.设置车辆信息表开始空闲时间(任务的完成时间)
  126 + */
  127 + // 根据记录表中的车牌号,获取到车辆信息
  128 + String licensePlateNumber = req.getLicensePlateNumber();
  129 + VehicleInfo vehicleInfo = vehicleInfoService.selectByLPN(licensePlateNumber);
  130 + //设置车辆信息表,为空闲状态(1)
  131 + vehicleInfo.setVehicleStatus("1");
  132 + //设置车辆信息表,开始空闲时间(任务的完成时间)
  133 + vehicleInfo.setFreetime(req.getEndTime());
  134 + vehicleInfoService.updateByPrimaryKeySelective(vehicleInfo);
  135 + /**
  136 + * 调度记录表,修改
  137 + * 1.设置调度记录,完成时间(由客户端传递过来,比较精确)
  138 + * 2.设置调度记录,完成状态(1)
  139 + */
  140 + req.setStatus("1");
  141 + dispatchNoteService.updateByPrimaryKeySelective(req);
  142 + }
  143 +
  144 + @ApiOperation("取消调度车辆")
  145 + @PutMapping("/cancel")
  146 + public ResultJson cancel(@RequestBody DispatchNote req) {
  147 + ResultJson<DispatchNote> result = new ResultJson<>();
  148 + // 根据记录表中的车牌号,获取到车辆信息
  149 + String licensePlateNumber = req.getLicensePlateNumber();
  150 + VehicleInfo vehicleInfo = vehicleInfoService.selectByLPN(licensePlateNumber);
  151 + // 判断,车辆是否为执行状态(2)?
  152 + String workingStatus = "2";
  153 + if (workingStatus.equals(vehicleInfo.getVehicleStatus())) {
  154 + //车辆状态,为执行状态(2),判断调度记录表开始时间是否为null
  155 + if (req.getBeginTime() == null) {
  156 + // 调度记录表的任务开始时间为null
  157 + //设置车辆状态,为空闲状态("1")
  158 + vehicleInfo.setVehicleStatus("1");
  159 + //设置车辆,开始空闲时间
  160 + vehicleInfo.setFreetime(new Date());
  161 + vehicleInfoService.updateByPrimaryKeySelective(vehicleInfo);
  162 + //将调度记录表的状态修改为撤销(取消)状态("3")
  163 + req.setStatus("3");
  164 + dispatchNoteService.updateByPrimaryKeySelective(req);
  165 + result.setMsg("该调度车辆,已经取消");
  166 + } else {
  167 + result.setMsg("请求,人工介入");
  168 + }
  169 + } else {
  170 + //车辆的状态不是执行状态(2),将调度记录表的状态修改为撤销(取消)状态("3")
  171 + req.setStatus("3");
  172 + dispatchNoteService.updateByPrimaryKeySelective(req);
  173 + result.setMsg("该调度车辆,已经取消");
  174 + }
  175 + return result;
  176 + }
  177 +}
  1 +package com.sunyo.wlpt.dispatch.controller;
  2 +
  3 +import com.github.pagehelper.PageInfo;
  4 +import com.sunyo.wlpt.dispatch.domain.DispatchNote;
  5 +import com.sunyo.wlpt.dispatch.domain.VehicleInfo;
  6 +import com.sunyo.wlpt.dispatch.response.ResultJson;
  7 +import com.sunyo.wlpt.dispatch.service.DispatchNoteService;
  8 +import com.sunyo.wlpt.dispatch.service.VehicleInfoService;
  9 +import com.sunyo.wlpt.dispatch.utils.GetUUID;
  10 +import io.swagger.annotations.Api;
  11 +import io.swagger.annotations.ApiOperation;
  12 +import org.springframework.beans.factory.annotation.Autowired;
  13 +import org.springframework.web.bind.annotation.*;
  14 +
  15 +import java.util.Date;
  16 +
  17 +/**
  18 + * @author 子诚
  19 + * Description:
  20 + * 时间:2020/4/24 20:30
  21 + */
  22 +@Api("调度记录信息,业务")
  23 +@RequestMapping("dispatchNote")
  24 +@RestController
  25 +public class DispatchNoteController {
  26 + @Autowired
  27 + private DispatchNoteService dispatchNoteService;
  28 + @Autowired
  29 + private VehicleInfoService vehicleInfoService;
  30 +
  31 + /**
  32 + * 获取,调度记录信息列表
  33 + */
  34 + @GetMapping("/selectDispatchNoteList")
  35 + public ResultJson<PageInfo> selectDispatchNoteList(
  36 + @RequestParam(value = "userName", required = false) String userName,
  37 + @RequestParam(value = "userMobile", required = false) String userMobile,
  38 + @RequestParam(value = "dispatchType", required = false) String dispatchType,
  39 + @RequestParam(value = "gmtCreate", required = false) Date gmtCreate,
  40 + @RequestParam(value = "endTime", required = false) Date endTime,
  41 + @RequestParam(value = "status", required = false) String status,
  42 + @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
  43 + @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
  44 + ResultJson<PageInfo> result = new ResultJson<>();
  45 + DispatchNote dispatchNote = new DispatchNote();
  46 + /**
  47 + * 用户端查询,需要四个参数:
  48 + * 1.用户姓名(前端必填);2.用户电话(前端必填);3.业务类型;4.创建时间
  49 + *
  50 + * 管理员端查询,需要六个参数(没有必填):
  51 + * 1.用户姓名;2.用户电话;3.创建时间;4.完成时间
  52 + * 5.业务类型;6.记录状态
  53 + */
  54 +
  55 + if ("".equals(userName)) {
  56 + //获取参数,用户姓名
  57 + dispatchNote.setUserName(userName);
  58 + }
  59 + if ("".equals(userMobile)) {
  60 + //获取参数,用户联系方式
  61 + dispatchNote.setUserMobile(userMobile);
  62 + }
  63 + if ("".equals(dispatchType)) {
  64 + //获取参数,业务类型
  65 + dispatchNote.setDispatchType(dispatchType);
  66 + }
  67 + if (null != gmtCreate) {
  68 + //获取参数,创建时间
  69 + dispatchNote.setGmtCreate(gmtCreate);
  70 + }
  71 + if ("".equals(status)) {
  72 + //获取参数,记录表状态
  73 + dispatchNote.setStatus(status);
  74 + }
  75 + if (null != endTime) {
  76 + //获取参数,任务结束(完成)时间
  77 + dispatchNote.setEndTime(endTime);
  78 + }
  79 + PageInfo pageInfo = dispatchNoteService.selectDispatchNoteList(dispatchNote, pageNum, pageSize);
  80 + if (pageInfo.getTotal() > 0) {
  81 + result.setData(pageInfo);
  82 + result.setMsg("查询调度记录,成功");
  83 + } else {
  84 + result.setCode("400");
  85 + result.setMsg("查询调度记录,失败");
  86 + }
  87 + return result;
  88 + }
  89 +
  90 + @ApiOperation("删除调度记录信息")
  91 + @DeleteMapping("/updateDispatchNote")
  92 + public ResultJson<DispatchNote> deleteDispatchNote(@RequestBody DispatchNote dispatchNote) {
  93 + ResultJson<DispatchNote> result = new ResultJson<>();
  94 + /**
  95 + * 如果调度记录为执行状态("2")
  96 + * 则将对应车辆的状态,修改为空闲状态("1"),并设置开始空闲时间
  97 + */
  98 + String status = "2";
  99 + if (status.equals(dispatchNote.getStatus())) {
  100 + String licensePlateNumber = dispatchNote.getLicensePlateNumber();
  101 + //根据车牌号查询到车辆信息
  102 + VehicleInfo vehicleInfo = vehicleInfoService.selectByLPN(licensePlateNumber);
  103 + //设置车辆信息表,为空闲状态(1)
  104 + vehicleInfo.setVehicleStatus("1");
  105 + //设置车辆信息,开始空闲时间
  106 + vehicleInfo.setFreetime(new Date());
  107 + //根据主键,选择性修改
  108 + vehicleInfoService.updateByPrimaryKeySelective(vehicleInfo);
  109 + }
  110 + int num = dispatchNoteService.deleteByPrimaryKey(dispatchNote.getId());
  111 + if (num > 0) {
  112 + result.setMsg("删除调度记录信息,成功");
  113 + } else {
  114 + result.setCode("400");
  115 + result.setMsg("删除调度记录信息,失败");
  116 + }
  117 + return result;
  118 + }
  119 +
  120 + @ApiOperation("编辑调度记录信息")
  121 + @PutMapping("/updateDispatchNote")
  122 + public ResultJson<DispatchNote> updateDispatchNote(@RequestBody DispatchNote dispatchNote) {
  123 + ResultJson<DispatchNote> result = new ResultJson<>();
  124 + //设置调度记录,操作类型,修改(2)
  125 + dispatchNote.setOperation("2");
  126 + int num = dispatchNoteService.updateByPrimaryKeySelective(dispatchNote);
  127 + if (num > 0) {
  128 + result.setMsg("修改调度记录信息,成功");
  129 + } else {
  130 + result.setCode("400");
  131 + result.setMsg("修改调度记录信息,失败");
  132 + }
  133 + return result;
  134 + }
  135 +
  136 + @ApiOperation("增加调度记录信息")
  137 + @PostMapping("/insertDispatchNote")
  138 + public ResultJson<DispatchNote> insertDispatchNote(@RequestBody DispatchNote dispatchNote) {
  139 + ResultJson<DispatchNote> result = new ResultJson<>();
  140 + //设置调度记录,id值(uuid)
  141 + dispatchNote.setId(GetUUID.getuuid());
  142 + //设置调度记录,车辆数量为1辆
  143 + dispatchNote.setVehicleNumber(1);
  144 + //设置调度记录,操作类型,新增(1)
  145 + dispatchNote.setOperation("1");
  146 + int num = dispatchNoteService.insertSelective(dispatchNote);
  147 + if (num > 0) {
  148 + result.setMsg("添加调度记录信息,成功");
  149 + } else {
  150 + result.setCode("400");
  151 + result.setMsg("添加调度记录信息,失败");
  152 + }
  153 + return result;
  154 + }
  155 +}
  1 +package com.sunyo.wlpt.dispatch.controller;
  2 +
  3 +import com.github.pagehelper.PageInfo;
  4 +import com.sunyo.wlpt.dispatch.domain.DriverInfo;
  5 +import com.sunyo.wlpt.dispatch.response.ResultJson;
  6 +import com.sunyo.wlpt.dispatch.service.DriverInfoService;
  7 +import com.sunyo.wlpt.dispatch.utils.GetUUID;
  8 +import io.swagger.annotations.Api;
  9 +import io.swagger.annotations.ApiOperation;
  10 +import org.springframework.beans.factory.annotation.Autowired;
  11 +import org.springframework.web.bind.annotation.*;
  12 +
  13 +/**
  14 + * @author 子诚
  15 + * Description:
  16 + * 时间:2020/4/26 14:04
  17 + */
  18 +@Api("驾驶员信息管理")
  19 +@RequestMapping("/driverInfo")
  20 +@RestController
  21 +public class DriverInfoController {
  22 + @Autowired
  23 + private DriverInfoService driverInfoService;
  24 +
  25 +
  26 + @ApiOperation("获取驾驶员列表")
  27 + @GetMapping("/selectDriverInfoList")
  28 + public ResultJson<PageInfo> selectDriverInfoList(
  29 + @RequestParam(value = "driverName", required = false) String driverName,
  30 + @RequestParam(value = "driverMobile", required = false) String driverMobile,
  31 + @RequestParam(value = "driverCompany", required = false) String driverCompany,
  32 + @RequestParam(value = "driverStatus", required = false) String driverStatus,
  33 + @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
  34 + @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
  35 + ResultJson<PageInfo> result = new ResultJson<>();
  36 + DriverInfo driverInfo = new DriverInfo();
  37 + if ("".equals(driverName)) {
  38 + //获取参数,驾驶员姓名
  39 + driverInfo.setDriverName(driverName);
  40 + }
  41 + if ("".equals(driverMobile)) {
  42 + //获取参数,驾驶员联系方式
  43 + driverInfo.setDriverMobile(driverMobile);
  44 + }
  45 + if ("".equals(driverCompany)) {
  46 + //获取参数,驾驶员所属公司
  47 + driverInfo.setDriverCompany(driverCompany);
  48 + }
  49 + if ("".equals(driverStatus)) {
  50 + //获取参数,驾驶员状态
  51 + driverInfo.setDriverStatus(driverStatus);
  52 + }
  53 + PageInfo pageInfo = driverInfoService.selectDriverInfoList(driverInfo, pageNum, pageSize);
  54 + if (pageInfo.getTotal() > 0) {
  55 + result.setData(pageInfo);
  56 + result.setMsg("查询驾驶员信息列表,成功");
  57 + } else {
  58 + result.setCode("400");
  59 + result.setMsg("查询驾驶员信息列表,失败");
  60 + }
  61 + return result;
  62 + }
  63 +
  64 + @ApiOperation("删除驾驶员信息")
  65 + @DeleteMapping("/deleteDriverInfo")
  66 + public ResultJson deleteDriverInfo(@RequestBody DriverInfo driverInfo) {
  67 + ResultJson result = new ResultJson();
  68 + /**
  69 + * 删除驾驶员信息,根据主键删除
  70 + */
  71 + int num = driverInfoService.deleteByPrimaryKey(driverInfo.getId());
  72 + if (num > 0) {
  73 + result.setMsg("删除驾驶员信息,成功");
  74 + } else {
  75 + result.setCode("400");
  76 + result.setMsg("删除驾驶员信息,失败");
  77 + }
  78 + return result;
  79 + }
  80 +
  81 + @ApiOperation("编辑驾驶员信息")
  82 + @PutMapping("/updateDriverInfo")
  83 + public ResultJson updateDriverInfo(@RequestBody DriverInfo driverInfo) {
  84 + ResultJson result = new ResultJson();
  85 + /**
  86 + * 编辑驾驶员信息,根据主键选择性修改
  87 + */
  88 + int num = driverInfoService.updateByPrimaryKeySelective(driverInfo);
  89 + if (num > 0) {
  90 + result.setMsg("编辑驾驶员信息,成功");
  91 + } else {
  92 + result.setCode("400");
  93 + result.setMsg("编辑驾驶员信息,失败");
  94 + }
  95 + return result;
  96 + }
  97 +
  98 + @ApiOperation("增加驾驶员信息")
  99 + @PostMapping("/insertDriverInfo")
  100 + public ResultJson insertDriverInfo(@RequestBody DriverInfo driverInfo) {
  101 + ResultJson result = new ResultJson();
  102 + //设置驾驶员信息主键,UUID
  103 + driverInfo.setId(GetUUID.getuuid());
  104 + /**
  105 + * 选择性插入,驾驶员信息
  106 + */
  107 + //新增的驾驶员的状态为 空闲状态("1")
  108 + driverInfo.setDriverStatus("1");
  109 + int num = driverInfoService.insertSelective(driverInfo);
  110 + if (num > 0) {
  111 + result.setMsg("新增驾驶员信息,成功");
  112 + } else {
  113 + result.setCode("400");
  114 + result.setMsg("新增驾驶员信息,失败");
  115 + }
  116 + return result;
  117 + }
  118 +}
  1 +package com.sunyo.wlpt.dispatch.controller;
  2 +
  3 +import com.github.pagehelper.PageInfo;
  4 +import com.sunyo.wlpt.dispatch.domain.VehicleInfo;
  5 +import com.sunyo.wlpt.dispatch.response.ResultJson;
  6 +import com.sunyo.wlpt.dispatch.service.VehicleInfoService;
  7 +import com.sunyo.wlpt.dispatch.utils.GetUUID;
  8 +import io.swagger.annotations.Api;
  9 +import io.swagger.annotations.ApiOperation;
  10 +import org.springframework.beans.factory.annotation.Autowired;
  11 +import org.springframework.web.bind.annotation.*;
  12 +
  13 +import java.util.Date;
  14 +
  15 +/**
  16 + * @author 子诚
  17 + * Description:
  18 + * 时间:2020/4/24 17:03
  19 + */
  20 +@Api("车辆信息")
  21 +@RequestMapping("vehicleInfo")
  22 +@RestController
  23 +public class VehicleInfoController {
  24 + @Autowired
  25 + private VehicleInfoService vehicleInfoService;
  26 +
  27 + @ApiOperation("获取车辆列表")
  28 + @GetMapping("/selectVehicleInfoList")
  29 + public ResultJson<PageInfo> selectVehicleInfoList(
  30 + @RequestParam(value = "vehicleStatus", required = false) String vehicleStatus,
  31 + @RequestParam(value = "vehicleType", required = false) String vehicleType,
  32 + @RequestParam(value = "licensePlateNumber", required = false) String licensePlateNumber,
  33 + @RequestParam(value = "vehicleCompany", required = false) String vehicleCompany,
  34 + @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
  35 + @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
  36 +
  37 + ResultJson<PageInfo> result = new ResultJson<>();
  38 + VehicleInfo vehicleInfo = new VehicleInfo();
  39 + if ("".equals(vehicleStatus)) {
  40 + //获取参数,车辆状态
  41 + vehicleInfo.setVehicleStatus(vehicleStatus);
  42 + }
  43 + if ("".equals(vehicleType)) {
  44 + //获取参数,车辆类型
  45 + vehicleInfo.setVehicleType(vehicleType);
  46 + }
  47 + if ("".equals(licensePlateNumber)) {
  48 + //获取参数,车牌号
  49 + vehicleInfo.setLicensePlateNumber(licensePlateNumber);
  50 + }
  51 + if ("".equals(vehicleCompany)) {
  52 + //获取参数,公司名
  53 + vehicleInfo.setVehicleCompany(vehicleCompany);
  54 + }
  55 + PageInfo pageInfo = vehicleInfoService.selectVehicleInfoList(vehicleInfo, pageNum, pageSize);
  56 + if (pageInfo.getTotal() > 0) {
  57 + result.setData(pageInfo);
  58 + result.setMsg("获取车辆列表,成功");
  59 + } else {
  60 + result.setCode("400");
  61 + result.setMsg("获取车辆列表,失败");
  62 + }
  63 + return result;
  64 + }
  65 + /**
  66 + * 单个查询
  67 + */
  68 + /**
  69 + * 增加
  70 + */
  71 + @ApiOperation("添加车辆信息")
  72 + @PostMapping("/insertVehicleInfo")
  73 + public ResultJson insertVehicleInfo(@RequestBody VehicleInfo vehicleInfo) {
  74 + ResultJson result = new ResultJson<>();
  75 + //设置车辆id,(uuid)
  76 + vehicleInfo.setId(GetUUID.getuuid());
  77 + //设置车辆状态,为空闲状态
  78 + vehicleInfo.setVehicleStatus("1");
  79 + //设置车辆开始空闲时间
  80 + vehicleInfo.setFreetime(new Date());
  81 + int num = vehicleInfoService.insertSelective(vehicleInfo);
  82 + if (num > 0) {
  83 + result.setMsg("添加车辆信息,成功");
  84 + } else {
  85 + result.setCode("400");
  86 + result.setMsg("添加车辆信息,失败");
  87 + }
  88 + return result;
  89 + }
  90 +
  91 + /**
  92 + * 修改
  93 + */
  94 + @ApiOperation("修改车辆信息")
  95 + @PutMapping("/updateVehicleInfo")
  96 + public ResultJson updateVehicleInfo(@RequestBody VehicleInfo vehicleInfo) {
  97 + ResultJson result = new ResultJson<>();
  98 + int num = vehicleInfoService.updateByPrimaryKeySelective(vehicleInfo);
  99 + if (num > 0) {
  100 + result.setMsg("修改车辆信息,成功");
  101 + } else {
  102 + result.setCode("400");
  103 + result.setMsg("修改车辆信息,失败");
  104 + }
  105 + return result;
  106 + }
  107 +
  108 + /**
  109 + * 删除
  110 + */
  111 + @ApiOperation("删除车辆信息")
  112 + @DeleteMapping("/deleteVehicleInfo")
  113 + public ResultJson deleteVehicleInfo(@RequestBody VehicleInfo vehicleInfo) {
  114 + ResultJson result = new ResultJson<>();
  115 + int num = vehicleInfoService.deleteByPrimaryKey(vehicleInfo.getId());
  116 + if (num > 0) {
  117 + result.setMsg("删除车辆信息,成功");
  118 + } else {
  119 + result.setCode("400");
  120 + result.setMsg("删除车辆信息,失败");
  121 + }
  122 + return result;
  123 + }
  124 +}
  1 +package com.sunyo.wlpt.dispatch.domain;
  2 +
  3 +import java.io.Serializable;
  4 +import java.util.UUID;
  5 +
  6 +import lombok.AllArgsConstructor;
  7 +import lombok.Data;
  8 +import lombok.NoArgsConstructor;
  9 +
  10 +/**
  11 + * @author 子诚
  12 + * Description:公司信息实体类
  13 + * 时间:2020/4/21 14:29
  14 + */
  15 +
  16 +@Data
  17 +@AllArgsConstructor
  18 +@NoArgsConstructor
  19 +public class CompanyInfo implements Serializable {
  20 +
  21 + private static final long serialVersionUID = 1L;
  22 +
  23 + /**
  24 + * 公司信息编号uuid
  25 + */
  26 + private String id = UUID.randomUUID().toString().replaceAll("-", "");
  27 +
  28 + /**
  29 + * 公司名称
  30 + */
  31 + private String companyName;
  32 +
  33 + /**
  34 + * 公司地址
  35 + */
  36 + private String companyAddress;
  37 +
  38 + /**
  39 + * 公司联系方式
  40 + */
  41 + private String companyMobile;
  42 +
  43 + /**
  44 + * 公司社会信用代码
  45 + */
  46 + private String companyId;
  47 +
  48 + /**
  49 + * 公司法定代表人
  50 + */
  51 + private String companyRepresentative;
  52 +}
  1 +package com.sunyo.wlpt.dispatch.domain;
  2 +
  3 +import java.io.Serializable;
  4 +import java.util.UUID;
  5 +
  6 +import lombok.AllArgsConstructor;
  7 +import lombok.Data;
  8 +import lombok.NoArgsConstructor;
  9 +
  10 +/**
  11 + * @author 子诚
  12 + * Description:调度业务实体类
  13 + * 时间:2020/4/21 15:16
  14 + */
  15 +
  16 +@Data
  17 +@AllArgsConstructor
  18 +@NoArgsConstructor
  19 +public class DispatchBusiness implements Serializable {
  20 +
  21 + private static final long serialVersionUID = 1L;
  22 +
  23 + /**
  24 + * 调度业务编号uuid
  25 + */
  26 + private String id = UUID.randomUUID().toString().replaceAll("-", "");
  27 +
  28 + /**
  29 + * 调度业务类型;进站送货,出站提货,货物调拨,货物流转
  30 + */
  31 + private String dispatchType;
  32 +
  33 +}
  1 +package com.sunyo.wlpt.dispatch.domain;
  2 +
  3 +import java.io.Serializable;
  4 +import java.util.Date;
  5 +import java.util.UUID;
  6 +
  7 +import com.fasterxml.jackson.annotation.JsonFormat;
  8 +import lombok.AllArgsConstructor;
  9 +import lombok.Data;
  10 +import lombok.NoArgsConstructor;
  11 +import org.springframework.format.annotation.DateTimeFormat;
  12 +
  13 +/**
  14 + * @author 子诚
  15 + * Description:
  16 + * 时间:2020/4/22 15:32
  17 + */
  18 +
  19 +@Data
  20 +@AllArgsConstructor
  21 +@NoArgsConstructor
  22 +public class DispatchNote implements Serializable {
  23 + /**
  24 + * 调度记录编号uuid
  25 + */
  26 + private String id = UUID.randomUUID().toString().replaceAll("-", "");
  27 +
  28 + /**
  29 + * 用户姓名
  30 + */
  31 + private String userName;
  32 +
  33 + /**
  34 + * 用户联系方式
  35 + */
  36 + private String userMobile;
  37 +
  38 + /**
  39 + * 车辆数量,单位:辆
  40 + */
  41 + private Integer vehicleNumber;
  42 +
  43 + /**
  44 + * 车辆类型:1.重型货车;2.中型货车;3.轻型货车;4.微型货车;5.拖车;6.叉车
  45 + */
  46 + private String vehicleType;
  47 +
  48 + /**
  49 + * 车牌号码
  50 + */
  51 + private String licensePlateNumber;
  52 +
  53 + /**
  54 + * 驾驶员姓名
  55 + */
  56 + private String driverName;
  57 +
  58 + /**
  59 + * 驾驶员联系方式
  60 + */
  61 + private String driverMobile;
  62 +
  63 + /**
  64 + * 调度业务类型
  65 + */
  66 + private String dispatchType;
  67 +
  68 + /**
  69 + * 场站位置
  70 + */
  71 + private String station;
  72 +
  73 + /**
  74 + * 记录状态:1.完成状态;2.执行状态;3、取消(撤销)状态
  75 + */
  76 + private String status;
  77 +
  78 + /**
  79 + * 调度记录(任务)创建时间
  80 + */
  81 + @DateTimeFormat(pattern = "yyyy-MM-dd")
  82 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
  83 + private Date gmtCreate;
  84 +
  85 + /**
  86 + * 调度记录修改时间
  87 + */
  88 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
  89 + private Date gmtModified;
  90 +
  91 + /**
  92 + * 任务开始时间
  93 + */
  94 + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  95 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
  96 + private Date beginTime;
  97 +
  98 + /**
  99 + * 任务完成时间
  100 + */
  101 + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  102 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
  103 + private Date endTime;
  104 +
  105 + /**
  106 + * 操作类型:1.新增;2.修改;3.删除
  107 + */
  108 + private String operation;
  109 +
  110 + private static final long serialVersionUID = 1L;
  111 +}
  1 +package com.sunyo.wlpt.dispatch.domain;
  2 +
  3 +import java.io.Serializable;
  4 +import java.util.Date;
  5 +import java.util.UUID;
  6 +
  7 +import com.fasterxml.jackson.annotation.JsonFormat;
  8 +import lombok.AllArgsConstructor;
  9 +import lombok.Data;
  10 +import lombok.NoArgsConstructor;
  11 +
  12 +/**
  13 + * @author 子诚
  14 + * Description:驶员信息实体类
  15 + * 时间:2020/4/21 15:16
  16 + */
  17 +@Data
  18 +@AllArgsConstructor
  19 +@NoArgsConstructor
  20 +public class DriverInfo implements Serializable {
  21 + /**
  22 + * 驾驶员信息编号uuid
  23 + */
  24 + private String id = UUID.randomUUID().toString().replaceAll("-", "");
  25 +
  26 + /**
  27 + * 驾驶员姓名
  28 + */
  29 + private String driverName;
  30 +
  31 + /**
  32 + * 身份证号码
  33 + */
  34 + private String driverId;
  35 +
  36 + /**
  37 + * 驾驶证号码
  38 + */
  39 + private String driverLicenseNumber;
  40 +
  41 + /**
  42 + * 驾驶员联系方式
  43 + */
  44 + private String driverMobile;
  45 +
  46 + /**
  47 + * 工号
  48 + */
  49 + private String jobNumber;
  50 +
  51 + /**
  52 + * 驾驶员职位:大队长,班长,副班长,员工
  53 + */
  54 + private String driverPosition;
  55 +
  56 + /**
  57 + * 驾驶员所属公司名称
  58 + */
  59 + private String driverCompany;
  60 +
  61 + /**
  62 + * 驾驶员信息创建时间
  63 + */
  64 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
  65 + private Date gmtCreate;
  66 +
  67 + /**
  68 + * 驾驶员信息修改时间
  69 + */
  70 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
  71 + private Date gmtModified;
  72 +
  73 + /**
  74 + * 驾驶员状态:1.空闲状态;2.执行状态;3.轮休状态;.请假状态
  75 + */
  76 + private String driverStatus;
  77 +
  78 + private static final long serialVersionUID = 1L;
  79 +}
  1 +package com.sunyo.wlpt.dispatch.domain;
  2 +
  3 +import java.io.Serializable;
  4 +import java.util.Date;
  5 +import java.util.UUID;
  6 +
  7 +import com.fasterxml.jackson.annotation.JsonFormat;
  8 +import lombok.AllArgsConstructor;
  9 +import lombok.Data;
  10 +import lombok.NoArgsConstructor;
  11 +import org.springframework.format.annotation.DateTimeFormat;
  12 +
  13 +/**
  14 + * @author 子诚
  15 + * Description:车辆信息实体类
  16 + * 时间:2020/4/21 15:16
  17 + */
  18 +@Data
  19 +@AllArgsConstructor
  20 +@NoArgsConstructor
  21 +public class VehicleInfo implements Serializable {
  22 +
  23 + private static final long serialVersionUID = 1L;
  24 +
  25 + /**
  26 + * 车辆信息编号uuid
  27 + */
  28 + private String id = UUID.randomUUID().toString().replaceAll("-", "");
  29 +
  30 + /**
  31 + * 车牌号码
  32 + */
  33 + private String licensePlateNumber;
  34 +
  35 + /**
  36 + * 行驶证号码
  37 + */
  38 + private String drivingLicenseNumber;
  39 +
  40 + /**
  41 + * 是否有挂车?1,有挂车;0,没有挂车
  42 + */
  43 + private String isTrailer;
  44 +
  45 + /**
  46 + * 挂车所属车辆的车牌号
  47 + */
  48 + private String trailerNumber;
  49 +
  50 + /**
  51 + * 车辆类型:1.重型货车;2.中型货车;3.轻型货车;4.微型货车;5.拖车;6.叉车
  52 + */
  53 + private String vehicleType;
  54 +
  55 + /**
  56 + * 车辆载重,单位为Kg
  57 + */
  58 + private String vehicleLoad;
  59 +
  60 + /**
  61 + * 车辆信息创建时间
  62 + */
  63 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
  64 + private Date gmtCreate;
  65 +
  66 + /**
  67 + * 车辆信息修改时间
  68 + */
  69 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
  70 + private Date gmtModified;
  71 +
  72 + /**
  73 + * 车辆状态:1.空闲状态;2.执行状态;3、在修状态;4.损坏未修状态;5.保养状态
  74 + */
  75 + private String vehicleStatus;
  76 +
  77 + /**
  78 + * 车辆开始空闲的时间
  79 + */
  80 + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  81 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
  82 + private Date freetime;
  83 +
  84 + /**
  85 + * 车辆优先级(1,最好,2次之)
  86 + */
  87 + private Integer priority;
  88 +
  89 + /**
  90 + * 车辆所属公司名称
  91 + */
  92 + private String vehicleCompany;
  93 +
  94 +
  95 +}
  1 +package com.sunyo.wlpt.dispatch.mapper;
  2 +
  3 +import com.sunyo.wlpt.dispatch.domain.CompanyInfo;
  4 +import java.util.List;
  5 +
  6 +import org.apache.ibatis.annotations.Mapper;
  7 +import org.apache.ibatis.annotations.Param;
  8 +
  9 +/**
  10 + * @author 子诚
  11 + * Description:
  12 + * 时间:2020/4/21 14:29
  13 + */
  14 +@Mapper
  15 +public interface CompanyInfoMapper {
  16 + int deleteByPrimaryKey(String id);
  17 +
  18 + int insert(CompanyInfo record);
  19 +
  20 + int insertOrUpdate(CompanyInfo record);
  21 +
  22 + int insertOrUpdateSelective(CompanyInfo record);
  23 +
  24 + int insertSelective(CompanyInfo record);
  25 +
  26 + CompanyInfo selectByPrimaryKey(String id);
  27 +
  28 + int updateByPrimaryKeySelective(CompanyInfo record);
  29 +
  30 + int updateByPrimaryKey(CompanyInfo record);
  31 +
  32 + int updateBatch(List<CompanyInfo> list);
  33 +
  34 + int updateBatchSelective(List<CompanyInfo> list);
  35 +
  36 + int batchInsert(@Param("list") List<CompanyInfo> list);
  37 +}
  1 +package com.sunyo.wlpt.dispatch.mapper;
  2 +
  3 +import com.sunyo.wlpt.dispatch.domain.DispatchBusiness;
  4 +
  5 +import java.util.List;
  6 +
  7 +import org.apache.ibatis.annotations.Mapper;
  8 +import org.apache.ibatis.annotations.Param;
  9 +
  10 +/**
  11 + * @author 子诚
  12 + * Description:
  13 + * 时间:2020/4/21 15:16
  14 + */
  15 +@Mapper
  16 +public interface DispatchBusinessMapper {
  17 + int deleteByPrimaryKey(String id);
  18 +
  19 + int insert(DispatchBusiness record);
  20 +
  21 + int insertOrUpdate(DispatchBusiness record);
  22 +
  23 + int insertOrUpdateSelective(DispatchBusiness record);
  24 +
  25 + int insertSelective(DispatchBusiness record);
  26 +
  27 + DispatchBusiness selectByPrimaryKey(String id);
  28 +
  29 + int updateByPrimaryKeySelective(DispatchBusiness record);
  30 +
  31 + int updateByPrimaryKey(DispatchBusiness record);
  32 +
  33 + int updateBatch(List<DispatchBusiness> list);
  34 +
  35 + int updateBatchSelective(List<DispatchBusiness> list);
  36 +
  37 + int batchInsert(@Param("list") List<DispatchBusiness> list);
  38 +}
  1 +package com.sunyo.wlpt.dispatch.mapper;
  2 +
  3 +import com.sunyo.wlpt.dispatch.domain.DispatchNote;
  4 +import org.apache.ibatis.annotations.Mapper;
  5 +import org.apache.ibatis.annotations.Param;
  6 +
  7 +import java.util.List;
  8 +
  9 +/**
  10 + * @author 子诚
  11 + * Description:
  12 + * 时间:2020/4/22 15:32
  13 + */
  14 +@Mapper
  15 +public interface DispatchNoteMapper {
  16 + /**
  17 + * 分页查询,调度记录列表
  18 + *
  19 + * @param record
  20 + * @return
  21 + */
  22 + List<DispatchNote> selectVehicleInfoList(DispatchNote record);
  23 +
  24 + int deleteByPrimaryKey(String id);
  25 +
  26 + int insert(DispatchNote record);
  27 +
  28 + int insertOrUpdate(DispatchNote record);
  29 +
  30 + int insertOrUpdateSelective(DispatchNote record);
  31 +
  32 + int insertSelective(DispatchNote record);
  33 +
  34 + DispatchNote selectByPrimaryKey(String id);
  35 +
  36 + int updateByPrimaryKeySelective(DispatchNote record);
  37 +
  38 + int updateByPrimaryKey(DispatchNote record);
  39 +
  40 + int updateBatch(List<DispatchNote> list);
  41 +
  42 + int updateBatchSelective(List<DispatchNote> list);
  43 +
  44 + int batchInsert(@Param("list") List<DispatchNote> list);
  45 +}
  1 +package com.sunyo.wlpt.dispatch.mapper;
  2 +
  3 +import com.sunyo.wlpt.dispatch.domain.DriverInfo;
  4 +
  5 +import java.util.List;
  6 +
  7 +import org.apache.ibatis.annotations.Mapper;
  8 +import org.apache.ibatis.annotations.Param;
  9 +
  10 +/**
  11 + * @author 子诚
  12 + * Description:
  13 + * 时间:2020/4/21 15:16
  14 + */
  15 +@Mapper
  16 +public interface DriverInfoMapper {
  17 +
  18 + /**
  19 + * 分页查询,驾驶员信息列表
  20 + *
  21 + * @param record
  22 + * @return
  23 + */
  24 + List<DriverInfo> selectDriverInfoList(DriverInfo record);
  25 +
  26 + int deleteByPrimaryKey(String id);
  27 +
  28 + int insert(DriverInfo record);
  29 +
  30 + int insertOrUpdate(DriverInfo record);
  31 +
  32 + int insertOrUpdateSelective(DriverInfo record);
  33 +
  34 + int insertSelective(DriverInfo record);
  35 +
  36 + DriverInfo selectByPrimaryKey(String id);
  37 +
  38 + int updateByPrimaryKeySelective(DriverInfo record);
  39 +
  40 + int updateByPrimaryKey(DriverInfo record);
  41 +
  42 + int updateBatch(List<DriverInfo> list);
  43 +
  44 + int updateBatchSelective(List<DriverInfo> list);
  45 +
  46 + int batchInsert(@Param("list") List<DriverInfo> list);
  47 +}
  1 +package com.sunyo.wlpt.dispatch.mapper;
  2 +
  3 +import com.sunyo.wlpt.dispatch.domain.VehicleInfo;
  4 +
  5 +import java.util.List;
  6 +
  7 +import org.apache.ibatis.annotations.Mapper;
  8 +import org.apache.ibatis.annotations.Param;
  9 +
  10 +/**
  11 + * @author 子诚
  12 + * Description:
  13 + * 时间:2020/4/21 15:16
  14 + */
  15 +@Mapper
  16 +public interface VehicleInfoMapper {
  17 +
  18 + /**
  19 + * 调度车辆方法
  20 + */
  21 + List<VehicleInfo> dispatchVehicle(@Param("vehicleType") String vehicleType, @Param("vehicleStatus") String vehicleStatus);
  22 +
  23 + /**
  24 + * 分页查询,车辆列表
  25 + */
  26 + List<VehicleInfo> selectVehicleInfoList(VehicleInfo record);
  27 +
  28 + /**
  29 + * 删除,根据主键
  30 + *
  31 + * @param id
  32 + * @return
  33 + */
  34 + int deleteByPrimaryKey(String id);
  35 +
  36 + int insert(VehicleInfo record);
  37 +
  38 + int insertOrUpdate(VehicleInfo record);
  39 +
  40 + int insertOrUpdateSelective(VehicleInfo record);
  41 +
  42 + int insertSelective(VehicleInfo record);
  43 +
  44 + VehicleInfo selectByPrimaryKey(String id);
  45 +
  46 + /**
  47 + * 根据车牌号查询车辆信息
  48 + */
  49 + VehicleInfo selectByLPN(String licensePlateNumber);
  50 +
  51 + /**
  52 + * 选择性修改,根据主键id
  53 + */
  54 + int updateByPrimaryKeySelective(VehicleInfo record);
  55 +
  56 + int updateByPrimaryKey(VehicleInfo record);
  57 +
  58 + int updateBatch(List<VehicleInfo> list);
  59 +
  60 + int updateBatchSelective(List<VehicleInfo> list);
  61 +
  62 + int batchInsert(@Param("list") List<VehicleInfo> list);
  63 +}
  1 +package com.sunyo.wlpt.dispatch.response;
  2 +
  3 +import lombok.Data;
  4 +
  5 +import java.io.Serializable;
  6 +
  7 +/**
  8 + * @author 子诚
  9 + * Description:
  10 + * 时间:2020/4/24 10:06
  11 + */
  12 +@Data
  13 +public class ResultJson<T> implements Serializable {
  14 +
  15 + private static final long serialVersionUID = 1L;
  16 +
  17 + /**
  18 + * 响应业务状态,默认为200
  19 + */
  20 + private String code = "200";
  21 + /**
  22 + * 响应消息
  23 + */
  24 + private String msg = "";
  25 + /**
  26 + * 响应数据
  27 + */
  28 + private T data;
  29 + /**
  30 + * JWT令牌
  31 + */
  32 + private String jwtToken;
  33 + /**
  34 + * 无参,构造方法
  35 + */
  36 + public ResultJson() {
  37 + }
  38 +
  39 + /**
  40 + * 有参,构造方法;
  41 + * 重载
  42 + */
  43 + public ResultJson(String code) {
  44 + this.code = code;
  45 + }
  46 + public ResultJson(T data) {
  47 + this.data = data;
  48 + }
  49 +
  50 + public ResultJson(String code, String msg) {
  51 + this.code = code;
  52 + this.msg = msg;
  53 + }
  54 +
  55 + public ResultJson(String code, String msg, T data) {
  56 + this.code = code;
  57 + this.msg = msg;
  58 + this.data = data;
  59 + }
  60 +}
  1 +package com.sunyo.wlpt.dispatch.service;
  2 +
  3 +import com.sunyo.wlpt.dispatch.domain.CompanyInfo;
  4 +
  5 +import java.util.List;
  6 +
  7 +/**
  8 + * @author 子诚
  9 + * Description:
  10 + * 时间:2020/4/21 14:29
  11 + */
  12 +public interface CompanyInfoService {
  13 +
  14 +
  15 + int deleteByPrimaryKey(String id);
  16 +
  17 + int insert(CompanyInfo record);
  18 +
  19 + int insertOrUpdate(CompanyInfo record);
  20 +
  21 + int insertOrUpdateSelective(CompanyInfo record);
  22 +
  23 + int insertSelective(CompanyInfo record);
  24 +
  25 + CompanyInfo selectByPrimaryKey(String id);
  26 +
  27 + int updateByPrimaryKeySelective(CompanyInfo record);
  28 +
  29 + int updateByPrimaryKey(CompanyInfo record);
  30 +
  31 + int updateBatch(List<CompanyInfo> list);
  32 +
  33 + int updateBatchSelective(List<CompanyInfo> list);
  34 +
  35 + int batchInsert(List<CompanyInfo> list);
  36 +
  37 +}
  1 +package com.sunyo.wlpt.dispatch.service;
  2 +
  3 +import java.util.List;
  4 +
  5 +import com.sunyo.wlpt.dispatch.domain.DispatchBusiness;
  6 +
  7 +/**
  8 + * @author 子诚
  9 + * Description:
  10 + * 时间:2020/4/21 15:16
  11 + */
  12 +public interface DispatchBusinessService {
  13 +
  14 +
  15 + int deleteByPrimaryKey(String id);
  16 +
  17 + int insert(DispatchBusiness record);
  18 +
  19 + int insertOrUpdate(DispatchBusiness record);
  20 +
  21 + int insertOrUpdateSelective(DispatchBusiness record);
  22 +
  23 + int insertSelective(DispatchBusiness record);
  24 +
  25 + DispatchBusiness selectByPrimaryKey(String id);
  26 +
  27 + int updateByPrimaryKeySelective(DispatchBusiness record);
  28 +
  29 + int updateByPrimaryKey(DispatchBusiness record);
  30 +
  31 + int updateBatch(List<DispatchBusiness> list);
  32 +
  33 + int updateBatchSelective(List<DispatchBusiness> list);
  34 +
  35 + int batchInsert(List<DispatchBusiness> list);
  36 +
  37 +}
  1 +package com.sunyo.wlpt.dispatch.service;
  2 +
  3 +import com.github.pagehelper.PageInfo;
  4 +import com.sunyo.wlpt.dispatch.domain.DispatchNote;
  5 +
  6 +import java.util.List;
  7 +
  8 +/**
  9 + * @author 子诚
  10 + * Description:调度列表Service
  11 + * 时间:2020/4/21 19:20
  12 + */
  13 +public interface DispatchNoteService {
  14 + /**
  15 + * 获取调度列表
  16 + *
  17 + * @param dispatchNote
  18 + * @param pageNum
  19 + * @param pageSize
  20 + * @return
  21 + */
  22 + PageInfo selectDispatchNoteList(DispatchNote dispatchNote, Integer pageNum, Integer pageSize);
  23 +
  24 + int deleteByPrimaryKey(String id);
  25 +
  26 + int insert(DispatchNote record);
  27 +
  28 + int insertOrUpdate(DispatchNote record);
  29 +
  30 + int insertOrUpdateSelective(DispatchNote record);
  31 +
  32 + int insertSelective(DispatchNote record);
  33 +
  34 + DispatchNote selectByPrimaryKey(String id);
  35 +
  36 + int updateByPrimaryKeySelective(DispatchNote record);
  37 +
  38 + int updateByPrimaryKey(DispatchNote record);
  39 +
  40 + int updateBatch(List<DispatchNote> list);
  41 +
  42 + int updateBatchSelective(List<DispatchNote> list);
  43 +
  44 + int batchInsert(List<DispatchNote> list);
  45 +
  46 +}
  47 +
  48 +
  1 +package com.sunyo.wlpt.dispatch.service;
  2 +
  3 +import com.github.pagehelper.PageInfo;
  4 +import com.sunyo.wlpt.dispatch.domain.DriverInfo;
  5 +
  6 +import java.util.List;
  7 +
  8 +/**
  9 + * @author 子诚
  10 + * Description:
  11 + * 时间:2020/4/21 15:16
  12 + */
  13 +public interface DriverInfoService {
  14 + /**
  15 + * 分页查询驾驶员信息列表
  16 + */
  17 + PageInfo selectDriverInfoList(DriverInfo driverInfo, Integer pageNum, Integer pageSize);
  18 +
  19 + int deleteByPrimaryKey(String id);
  20 +
  21 + int insert(DriverInfo record);
  22 +
  23 + int insertOrUpdate(DriverInfo record);
  24 +
  25 + int insertOrUpdateSelective(DriverInfo record);
  26 +
  27 + int insertSelective(DriverInfo record);
  28 +
  29 + DriverInfo selectByPrimaryKey(String id);
  30 +
  31 + int updateByPrimaryKeySelective(DriverInfo record);
  32 +
  33 + int updateByPrimaryKey(DriverInfo record);
  34 +
  35 + int updateBatch(List<DriverInfo> list);
  36 +
  37 + int updateBatchSelective(List<DriverInfo> list);
  38 +
  39 + int batchInsert(List<DriverInfo> list);
  40 +
  41 +}
  1 +package com.sunyo.wlpt.dispatch.service;
  2 +
  3 +import java.util.List;
  4 +
  5 +import com.github.pagehelper.PageInfo;
  6 +import com.sunyo.wlpt.dispatch.domain.VehicleInfo;
  7 +
  8 +/**
  9 + * @author 子诚
  10 + * Description:
  11 + * 时间:2020/4/21 15:16
  12 + */
  13 +public interface VehicleInfoService {
  14 +
  15 +
  16 + /**
  17 + * 调度车辆方法
  18 + *
  19 + * @param vehicleType
  20 + * @param vehicleStatus
  21 + * @return
  22 + */
  23 + List<VehicleInfo> dispatchVehicle(String vehicleType, String vehicleStatus);
  24 +
  25 +
  26 + /**
  27 + * 查询车辆信息,by车牌号
  28 + *
  29 + * @param licensePlateNumber
  30 + * @return
  31 + */
  32 + VehicleInfo selectByLPN(String licensePlateNumber);
  33 +
  34 + /**
  35 + * 获取车辆列表
  36 + *
  37 + * @param vehicleInfo
  38 + * @param pageNum
  39 + * @param pageSize
  40 + * @return
  41 + */
  42 + PageInfo selectVehicleInfoList(VehicleInfo vehicleInfo, Integer pageNum, Integer pageSize);
  43 +
  44 + int deleteByPrimaryKey(String id);
  45 +
  46 + int insert(VehicleInfo record);
  47 +
  48 + int insertOrUpdate(VehicleInfo record);
  49 +
  50 + int insertOrUpdateSelective(VehicleInfo record);
  51 +
  52 + int insertSelective(VehicleInfo record);
  53 +
  54 + VehicleInfo selectByPrimaryKey(String id);
  55 +
  56 + int updateByPrimaryKeySelective(VehicleInfo record);
  57 +
  58 + int updateByPrimaryKey(VehicleInfo record);
  59 +
  60 + int updateBatch(List<VehicleInfo> list);
  61 +
  62 + int updateBatchSelective(List<VehicleInfo> list);
  63 +
  64 + int batchInsert(List<VehicleInfo> list);
  65 +
  66 +}
  1 +package com.sunyo.wlpt.dispatch.service.impl;
  2 +
  3 +import org.springframework.stereotype.Service;
  4 +
  5 +import javax.annotation.Resource;
  6 +
  7 +import com.sunyo.wlpt.dispatch.mapper.CompanyInfoMapper;
  8 +import com.sunyo.wlpt.dispatch.domain.CompanyInfo;
  9 +
  10 +import java.util.List;
  11 +
  12 +import com.sunyo.wlpt.dispatch.service.CompanyInfoService;
  13 +
  14 +/**
  15 + * @author 子诚
  16 + * Description:
  17 + * 时间:2020/4/21 14:29
  18 + */
  19 +@Service
  20 +public class CompanyInfoServiceImpl implements CompanyInfoService {
  21 +
  22 + @Resource
  23 + private CompanyInfoMapper companyInfoMapper;
  24 +
  25 + @Override
  26 + public int deleteByPrimaryKey(String id) {
  27 + return companyInfoMapper.deleteByPrimaryKey(id);
  28 + }
  29 +
  30 + @Override
  31 + public int insert(CompanyInfo record) {
  32 + return companyInfoMapper.insert(record);
  33 + }
  34 +
  35 + @Override
  36 + public int insertOrUpdate(CompanyInfo record) {
  37 + return companyInfoMapper.insertOrUpdate(record);
  38 + }
  39 +
  40 + @Override
  41 + public int insertOrUpdateSelective(CompanyInfo record) {
  42 + return companyInfoMapper.insertOrUpdateSelective(record);
  43 + }
  44 +
  45 + @Override
  46 + public int insertSelective(CompanyInfo record) {
  47 + return companyInfoMapper.insertSelective(record);
  48 + }
  49 +
  50 + @Override
  51 + public CompanyInfo selectByPrimaryKey(String id) {
  52 + return companyInfoMapper.selectByPrimaryKey(id);
  53 + }
  54 +
  55 + @Override
  56 + public int updateByPrimaryKeySelective(CompanyInfo record) {
  57 + return companyInfoMapper.updateByPrimaryKeySelective(record);
  58 + }
  59 +
  60 + @Override
  61 + public int updateByPrimaryKey(CompanyInfo record) {
  62 + return companyInfoMapper.updateByPrimaryKey(record);
  63 + }
  64 +
  65 + @Override
  66 + public int updateBatch(List<CompanyInfo> list) {
  67 + return companyInfoMapper.updateBatch(list);
  68 + }
  69 +
  70 + @Override
  71 + public int updateBatchSelective(List<CompanyInfo> list) {
  72 + return companyInfoMapper.updateBatchSelective(list);
  73 + }
  74 +
  75 + @Override
  76 + public int batchInsert(List<CompanyInfo> list) {
  77 + return companyInfoMapper.batchInsert(list);
  78 + }
  79 +
  80 +}
  1 +package com.sunyo.wlpt.dispatch.service.impl;
  2 +
  3 +import org.springframework.stereotype.Service;
  4 +
  5 +import javax.annotation.Resource;
  6 +import java.util.List;
  7 +
  8 +import com.sunyo.wlpt.dispatch.mapper.DispatchBusinessMapper;
  9 +import com.sunyo.wlpt.dispatch.domain.DispatchBusiness;
  10 +import com.sunyo.wlpt.dispatch.service.DispatchBusinessService;
  11 +
  12 +/**
  13 + * @author 子诚
  14 + * Description:
  15 + * 时间:2020/4/21 15:16
  16 + */
  17 +@Service
  18 +public class DispatchBusinessServiceImpl implements DispatchBusinessService {
  19 +
  20 + @Resource
  21 + private DispatchBusinessMapper dispatchBusinessMapper;
  22 +
  23 + @Override
  24 + public int deleteByPrimaryKey(String id) {
  25 + return dispatchBusinessMapper.deleteByPrimaryKey(id);
  26 + }
  27 +
  28 + @Override
  29 + public int insert(DispatchBusiness record) {
  30 + return dispatchBusinessMapper.insert(record);
  31 + }
  32 +
  33 + @Override
  34 + public int insertOrUpdate(DispatchBusiness record) {
  35 + return dispatchBusinessMapper.insertOrUpdate(record);
  36 + }
  37 +
  38 + @Override
  39 + public int insertOrUpdateSelective(DispatchBusiness record) {
  40 + return dispatchBusinessMapper.insertOrUpdateSelective(record);
  41 + }
  42 +
  43 + @Override
  44 + public int insertSelective(DispatchBusiness record) {
  45 + return dispatchBusinessMapper.insertSelective(record);
  46 + }
  47 +
  48 + @Override
  49 + public DispatchBusiness selectByPrimaryKey(String id) {
  50 + return dispatchBusinessMapper.selectByPrimaryKey(id);
  51 + }
  52 +
  53 + @Override
  54 + public int updateByPrimaryKeySelective(DispatchBusiness record) {
  55 + return dispatchBusinessMapper.updateByPrimaryKeySelective(record);
  56 + }
  57 +
  58 + @Override
  59 + public int updateByPrimaryKey(DispatchBusiness record) {
  60 + return dispatchBusinessMapper.updateByPrimaryKey(record);
  61 + }
  62 +
  63 + @Override
  64 + public int updateBatch(List<DispatchBusiness> list) {
  65 + return dispatchBusinessMapper.updateBatch(list);
  66 + }
  67 +
  68 + @Override
  69 + public int updateBatchSelective(List<DispatchBusiness> list) {
  70 + return dispatchBusinessMapper.updateBatchSelective(list);
  71 + }
  72 +
  73 + @Override
  74 + public int batchInsert(List<DispatchBusiness> list) {
  75 + return dispatchBusinessMapper.batchInsert(list);
  76 + }
  77 +
  78 +}
  1 +package com.sunyo.wlpt.dispatch.service.impl;
  2 +
  3 +import com.github.pagehelper.PageHelper;
  4 +import com.github.pagehelper.PageInfo;
  5 +import com.sunyo.wlpt.dispatch.domain.VehicleInfo;
  6 +import org.springframework.stereotype.Service;
  7 +
  8 +import javax.annotation.Resource;
  9 +
  10 +import com.sunyo.wlpt.dispatch.domain.DispatchNote;
  11 +
  12 +import java.util.List;
  13 +
  14 +import com.sunyo.wlpt.dispatch.mapper.DispatchNoteMapper;
  15 +import com.sunyo.wlpt.dispatch.service.DispatchNoteService;
  16 +
  17 +/**
  18 + * @author 子诚
  19 + * Description:
  20 + * 时间:2020/4/21 19:20
  21 + */
  22 +@Service
  23 +public class DispatchNoteServiceImpl implements DispatchNoteService {
  24 +
  25 + @Resource
  26 + private DispatchNoteMapper dispatchNoteMapper;
  27 +
  28 + @Override
  29 + public PageInfo selectDispatchNoteList(DispatchNote dispatchNote, Integer pageNum, Integer pageSize) {
  30 + List<DispatchNote> dispatchNoteList = dispatchNoteMapper.selectVehicleInfoList(dispatchNote);
  31 + //使用pagehelper
  32 + PageHelper.startPage(pageNum, pageSize);
  33 + PageInfo<VehicleInfo> pageInfo = new PageInfo(dispatchNoteList);
  34 + return pageInfo;
  35 + }
  36 +
  37 + @Override
  38 + public int deleteByPrimaryKey(String id) {
  39 + return dispatchNoteMapper.deleteByPrimaryKey(id);
  40 + }
  41 +
  42 + @Override
  43 + public int insert(DispatchNote record) {
  44 + return dispatchNoteMapper.insert(record);
  45 + }
  46 +
  47 + @Override
  48 + public int insertOrUpdate(DispatchNote record) {
  49 + return dispatchNoteMapper.insertOrUpdate(record);
  50 + }
  51 +
  52 + @Override
  53 + public int insertOrUpdateSelective(DispatchNote record) {
  54 + return dispatchNoteMapper.insertOrUpdateSelective(record);
  55 + }
  56 +
  57 + @Override
  58 + public int insertSelective(DispatchNote record) {
  59 + return dispatchNoteMapper.insertSelective(record);
  60 + }
  61 +
  62 + @Override
  63 + public DispatchNote selectByPrimaryKey(String id) {
  64 + return dispatchNoteMapper.selectByPrimaryKey(id);
  65 + }
  66 +
  67 + @Override
  68 + public int updateByPrimaryKeySelective(DispatchNote record) {
  69 + return dispatchNoteMapper.updateByPrimaryKeySelective(record);
  70 + }
  71 +
  72 + @Override
  73 + public int updateByPrimaryKey(DispatchNote record) {
  74 + return dispatchNoteMapper.updateByPrimaryKey(record);
  75 + }
  76 +
  77 + @Override
  78 + public int updateBatch(List<DispatchNote> list) {
  79 + return dispatchNoteMapper.updateBatch(list);
  80 + }
  81 +
  82 + @Override
  83 + public int updateBatchSelective(List<DispatchNote> list) {
  84 + return dispatchNoteMapper.updateBatchSelective(list);
  85 + }
  86 +
  87 + @Override
  88 + public int batchInsert(List<DispatchNote> list) {
  89 + return dispatchNoteMapper.batchInsert(list);
  90 + }
  91 +
  92 +}
  93 +
  94 +
  1 +package com.sunyo.wlpt.dispatch.service.impl;
  2 +
  3 +import com.github.pagehelper.PageHelper;
  4 +import com.github.pagehelper.PageInfo;
  5 +import com.sunyo.wlpt.dispatch.domain.VehicleInfo;
  6 +import org.springframework.stereotype.Service;
  7 +
  8 +import javax.annotation.Resource;
  9 +
  10 +import com.sunyo.wlpt.dispatch.domain.DriverInfo;
  11 +
  12 +import java.util.List;
  13 +
  14 +import com.sunyo.wlpt.dispatch.mapper.DriverInfoMapper;
  15 +import com.sunyo.wlpt.dispatch.service.DriverInfoService;
  16 +
  17 +/**
  18 + * @author 子诚
  19 + * Description:
  20 + * 时间:2020/4/21 15:16
  21 + */
  22 +@Service
  23 +public class DriverInfoServiceImpl implements DriverInfoService {
  24 +
  25 + @Resource
  26 + private DriverInfoMapper driverInfoMapper;
  27 +
  28 + /**
  29 + * 分页查询,驾驶员信息列表
  30 + */
  31 + @Override
  32 + public PageInfo selectDriverInfoList(DriverInfo driverInfo, Integer pageNum, Integer pageSize) {
  33 + List<DriverInfo> driverInfoList = driverInfoMapper.selectDriverInfoList(driverInfo);
  34 + PageHelper.startPage(pageNum, pageSize);
  35 + PageInfo<VehicleInfo> pageInfo = new PageInfo(driverInfoList);
  36 + return pageInfo;
  37 + }
  38 +
  39 + @Override
  40 + public int deleteByPrimaryKey(String id) {
  41 + return driverInfoMapper.deleteByPrimaryKey(id);
  42 + }
  43 +
  44 + @Override
  45 + public int insert(DriverInfo record) {
  46 + return driverInfoMapper.insert(record);
  47 + }
  48 +
  49 + @Override
  50 + public int insertOrUpdate(DriverInfo record) {
  51 + return driverInfoMapper.insertOrUpdate(record);
  52 + }
  53 +
  54 + @Override
  55 + public int insertOrUpdateSelective(DriverInfo record) {
  56 + return driverInfoMapper.insertOrUpdateSelective(record);
  57 + }
  58 +
  59 + @Override
  60 + public int insertSelective(DriverInfo record) {
  61 + return driverInfoMapper.insertSelective(record);
  62 + }
  63 +
  64 + @Override
  65 + public DriverInfo selectByPrimaryKey(String id) {
  66 + return driverInfoMapper.selectByPrimaryKey(id);
  67 + }
  68 +
  69 + @Override
  70 + public int updateByPrimaryKeySelective(DriverInfo record) {
  71 + return driverInfoMapper.updateByPrimaryKeySelective(record);
  72 + }
  73 +
  74 + @Override
  75 + public int updateByPrimaryKey(DriverInfo record) {
  76 + return driverInfoMapper.updateByPrimaryKey(record);
  77 + }
  78 +
  79 + @Override
  80 + public int updateBatch(List<DriverInfo> list) {
  81 + return driverInfoMapper.updateBatch(list);
  82 + }
  83 +
  84 + @Override
  85 + public int updateBatchSelective(List<DriverInfo> list) {
  86 + return driverInfoMapper.updateBatchSelective(list);
  87 + }
  88 +
  89 + @Override
  90 + public int batchInsert(List<DriverInfo> list) {
  91 + return driverInfoMapper.batchInsert(list);
  92 + }
  93 +
  94 +}
  1 +package com.sunyo.wlpt.dispatch.service.impl;
  2 +
  3 +import com.github.pagehelper.PageHelper;
  4 +import com.github.pagehelper.PageInfo;
  5 +import org.springframework.stereotype.Service;
  6 +
  7 +import javax.annotation.Resource;
  8 +import java.util.List;
  9 +
  10 +import com.sunyo.wlpt.dispatch.domain.VehicleInfo;
  11 +import com.sunyo.wlpt.dispatch.mapper.VehicleInfoMapper;
  12 +import com.sunyo.wlpt.dispatch.service.VehicleInfoService;
  13 +
  14 +/**
  15 + * @author 子诚
  16 + * Description:
  17 + * 时间:2020/4/21 15:16
  18 + */
  19 +@Service
  20 +public class VehicleInfoServiceImpl implements VehicleInfoService {
  21 +
  22 + @Resource
  23 + private VehicleInfoMapper vehicleInfoMapper;
  24 +
  25 + /**
  26 + * 调度车辆方法
  27 + *
  28 + * @param vehicleType:车辆类型
  29 + * @param vehicleStatus:车辆状态
  30 + * @return List<VehicleInfo>
  31 + */
  32 + @Override
  33 + public List<VehicleInfo> dispatchVehicle(String vehicleType, String vehicleStatus) {
  34 + return vehicleInfoMapper.dispatchVehicle(vehicleType, vehicleStatus);
  35 + }
  36 +
  37 + /**
  38 + * 查询车辆信息,by车牌号
  39 + */
  40 + @Override
  41 + public VehicleInfo selectByLPN(String licensePlateNumber) {
  42 + return vehicleInfoMapper.selectByLPN(licensePlateNumber);
  43 + }
  44 +
  45 + /**
  46 + * 获取车辆列表
  47 + *
  48 + * @param vehicleInfo
  49 + * @param pageNum
  50 + * @param pageSize
  51 + * @return
  52 + */
  53 + @Override
  54 + public PageInfo selectVehicleInfoList(VehicleInfo vehicleInfo, Integer pageNum, Integer pageSize) {
  55 + List<VehicleInfo> vehicleInfoList = vehicleInfoMapper.selectVehicleInfoList(vehicleInfo);
  56 + // 使用 PageHelper 分页插件
  57 + PageHelper.startPage(pageNum, pageSize);
  58 + PageInfo<VehicleInfo> pageInfo = new PageInfo(vehicleInfoList);
  59 + return pageInfo;
  60 + }
  61 +
  62 + @Override
  63 + public int deleteByPrimaryKey(String id) {
  64 + return vehicleInfoMapper.deleteByPrimaryKey(id);
  65 + }
  66 +
  67 + @Override
  68 + public int insert(VehicleInfo record) {
  69 + return vehicleInfoMapper.insert(record);
  70 + }
  71 +
  72 + @Override
  73 + public int insertOrUpdate(VehicleInfo record) {
  74 + return vehicleInfoMapper.insertOrUpdate(record);
  75 + }
  76 +
  77 + @Override
  78 + public int insertOrUpdateSelective(VehicleInfo record) {
  79 + return vehicleInfoMapper.insertOrUpdateSelective(record);
  80 + }
  81 +
  82 + @Override
  83 + public int insertSelective(VehicleInfo record) {
  84 + return vehicleInfoMapper.insertSelective(record);
  85 + }
  86 +
  87 + @Override
  88 + public VehicleInfo selectByPrimaryKey(String id) {
  89 + return vehicleInfoMapper.selectByPrimaryKey(id);
  90 + }
  91 +
  92 + @Override
  93 + public int updateByPrimaryKeySelective(VehicleInfo record) {
  94 + return vehicleInfoMapper.updateByPrimaryKeySelective(record);
  95 + }
  96 +
  97 + @Override
  98 + public int updateByPrimaryKey(VehicleInfo record) {
  99 + return vehicleInfoMapper.updateByPrimaryKey(record);
  100 + }
  101 +
  102 + @Override
  103 + public int updateBatch(List<VehicleInfo> list) {
  104 + return vehicleInfoMapper.updateBatch(list);
  105 + }
  106 +
  107 + @Override
  108 + public int updateBatchSelective(List<VehicleInfo> list) {
  109 + return vehicleInfoMapper.updateBatchSelective(list);
  110 + }
  111 +
  112 + @Override
  113 + public int batchInsert(List<VehicleInfo> list) {
  114 + return vehicleInfoMapper.batchInsert(list);
  115 + }
  116 +
  117 +}
  1 +package com.sunyo.wlpt.dispatch.utils;
  2 +
  3 +import java.util.UUID;
  4 +
  5 +/**
  6 + * @author 子诚
  7 + * Description:
  8 + * 时间:2020/4/24 17:44
  9 + */
  10 +public class GetUUID {
  11 + public static String getuuid(){
  12 + return UUID.randomUUID().toString().replaceAll("-", "");
  13 + }
  14 +}
  1 +# 服务配置
  2 +server:
  3 + port: 9999
  4 +# spring 配置
  5 +spring:
  6 + application:
  7 + name: dispatch-system
  8 + profiles:
  9 + active: dev
  10 + # 链路追踪配置
  11 + zipkin:
  12 + base-url: http://192.168.1.63:9411
  13 + sleuth:
  14 + sampler:
  15 + probability: 1
  16 + # 数据库信息配置
  17 + datasource:
  18 + druid:
  19 + driver-class-name: com.mysql.cj.jdbc.Driver
  20 + username: 110
  21 + password: QAHqCJf2kFYCLirM
  22 + url: jdbc:mysql://118.31.66.166:3306/dispatch_sys?characterEncoding=utf8&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true
  23 +
  24 + initial-size: 10
  25 + max-active: 50
  26 + min-idle: 5
  27 + max-wait: 60000
  28 + # \u5F00\u542F\u7F13\u5B58preparedStatement(PSCache)
  29 + pool-prepared-statements: true
  30 + # \u542F\u7528PSCache\u540E\uFF0C\u6307\u5B9A\u6BCF\u4E2A\u8FDE\u63A5\u4E0APSCache\u7684\u5927\u5C0F
  31 + max-pool-prepared-statement-per-connection-size: 20
  32 + # \u7528\u6765\u68C0\u6D4B\u8FDE\u63A5\u662F\u5426\u6709\u6548\u7684sql
  33 + validation-query: select 'x'
  34 + # \u7533\u8BF7\u8FDE\u63A5\u65F6\u4E0D\u68C0\u6D4B\u8FDE\u63A5\u662F\u5426\u6709\u6548
  35 + test-on-borrow: false
  36 + # \u5F52\u8FD8\u8FDE\u63A5\u65F6\u4E0D\u68C0\u6D4B\u8FDE\u63A5\u662F\u5426\u6709\u6548
  37 + test-on-return: false
  38 + # \u7533\u8BF7\u8FDE\u63A5\u65F6\u68C0\u6D4B\uFF0C\u5982\u679C\u7A7A\u95F2\u65F6\u95F4\u5927\u4E8EtimeBetweenEvictionRunsMillis\uFF0C\u6267\u884CvalidationQuery\u68C0\u6D4B\u8FDE\u63A5\u662F\u5426\u6709\u6548\uFF08\u4E0D\u5F71\u54CD\u6027\u80FD\uFF09
  39 + test-while-idle: true
  40 + # \u68C0\u6D4B\u8FDE\u63A5\u7684\u95F4\u9694\u65F6\u95F4\uFF0C\u82E5\u8FDE\u63A5\u7A7A\u95F2\u65F6\u95F4 >= minEvictableIdleTimeMillis\uFF0C\u5219\u5173\u95ED\u7269\u7406\u8FDE\u63A5
  41 + time-between-eviction-runs-millis: 60000
  42 + # \u8FDE\u63A5\u4FDD\u6301\u7A7A\u95F2\u800C\u4E0D\u88AB\u9A71\u9010\u7684\u6700\u5C0F\u65F6\u95F4(ms)
  43 + min-evictable-idle-time-millis: 300000
  44 + # \u914D\u7F6E\u76D1\u63A7\u7EDF\u8BA1\u62E6\u622A\u7684filters\uFF08\u4E0D\u914D\u7F6E\u5219\u76D1\u63A7\u754C\u9762sql\u65E0\u6CD5\u7EDF\u8BA1\uFF09\uFF0C\u76D1\u63A7\u7EDF\u8BA1filter:stat\uFF0C\u65E5\u5FD7filter:log4j\uFF0C\u9632\u5FA1sql\u6CE8\u5165filter:wall
  45 + filters: stat,wall
  46 + # \u652F\u6301\u5408\u5E76\u591A\u4E2ADruidDataSource\u7684\u76D1\u63A7\u6570\u636E
  47 + use-global-data-source-stat: true
  48 + # \u901A\u8FC7connectProperties\u5C5E\u6027\u6765\u6253\u5F00mergeSql(Sql\u5408\u5E76)\u529F\u80FD\uFF1B\u6162SQL\u8BB0\u5F55(\u914D\u7F6E\u8D85\u8FC75\u79D2\u5C31\u662F\u6162\uFF0C\u9ED8\u8BA4\u662F3\u79D2)
  49 + connection-properties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
  50 +
  51 + type: com.alibaba.druid.pool.DruidDataSource
  52 +
  53 + # json\u65F6\u95F4\u683C\u5F0F\u8BBE\u7F6E \u51FA\u6E2F\u7406\u8D27\u88C5\u5378\u65F6\u95F4\u62A5\u9519
  54 +# jackson:
  55 +# time-zone: GMT+8
  56 +# date-format: YYYY-MM-dd HH:mm:ss
  57 +
  58 +# mybatis配置
  59 +mybatis:
  60 + mapper-locations: classpath:mapper/*.xml
  61 + type-aliases-package: com.sunyo.wlpt.dispatch.domain
  62 +
  63 +
  64 +# 日志打印
  65 +logging:
  66 + config: config/logback-dev.xml
  67 +logback:
  68 + appname: dispatch-system
  69 + logdir: ./log
  70 +
  71 +#eureka client
  72 +eureka:
  73 + instance:
  74 + #eureka\u670D\u52A1\u5668\u9875\u9762\u4E2Dstatus\u7684\u8BF7\u6C42\u8DEF\u5F84
  75 + status-page-url: http://${eureka.instance.hostname}:${server.port}/index
  76 + prefer-ip-address: true
  77 + instance-id: ${spring.cloud.client.ip-address}:${server.port}
  78 + hostname: ${spring.cloud.client.ip-address}
  79 + client:
  80 + healthcheck:
  81 + enabled: true
  82 + service-url:
  83 + defaultZone: http://192.168.1.53:12345/eureka/
  84 +# defaultZone: http://localhost:12345/eureka/
  85 +feign:
  86 + hystrix:
  87 + enabled: true
  88 +# boot admin
  89 +management:
  90 + endpoints:
  91 + enabled-by-default: true
  92 + web:
  93 + exposure:
  94 + include: ["*"]
  95 + endpoint:
  96 + health:
  97 + show-details: always
  98 + shutdown:
  99 + enabled: true
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3 +<mapper namespace="com.sunyo.wlpt.dispatch.mapper.CompanyInfoMapper">
  4 + <resultMap id="BaseResultMap" type="com.sunyo.wlpt.dispatch.domain.CompanyInfo">
  5 + <!--@mbg.generated-->
  6 + <!--@Table company_info-->
  7 + <id column="id" jdbcType="VARCHAR" property="id" />
  8 + <result column="company_name" jdbcType="VARCHAR" property="companyName" />
  9 + <result column="company_address" jdbcType="VARCHAR" property="companyAddress" />
  10 + <result column="company_mobile" jdbcType="VARCHAR" property="companyMobile" />
  11 + <result column="company_id" jdbcType="VARCHAR" property="companyId" />
  12 + <result column="company_representative" jdbcType="VARCHAR" property="companyRepresentative" />
  13 + </resultMap>
  14 + <sql id="Base_Column_List">
  15 + <!--@mbg.generated-->
  16 + id, company_name, company_address, company_mobile, company_id, company_representative
  17 + </sql>
  18 + <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
  19 + <!--@mbg.generated-->
  20 + select
  21 + <include refid="Base_Column_List" />
  22 + from company_info
  23 + where id = #{id,jdbcType=VARCHAR}
  24 + </select>
  25 + <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
  26 + <!--@mbg.generated-->
  27 + delete from company_info
  28 + where id = #{id,jdbcType=VARCHAR}
  29 + </delete>
  30 + <insert id="insert" parameterType="com.sunyo.wlpt.dispatch.domain.CompanyInfo">
  31 + <!--@mbg.generated-->
  32 + insert into company_info (id, company_name, company_address,
  33 + company_mobile, company_id, company_representative
  34 + )
  35 + values (#{id,jdbcType=VARCHAR}, #{companyName,jdbcType=VARCHAR}, #{companyAddress,jdbcType=VARCHAR},
  36 + #{companyMobile,jdbcType=VARCHAR}, #{companyId,jdbcType=VARCHAR}, #{companyRepresentative,jdbcType=VARCHAR}
  37 + )
  38 + </insert>
  39 + <insert id="insertSelective" parameterType="com.sunyo.wlpt.dispatch.domain.CompanyInfo">
  40 + <!--@mbg.generated-->
  41 + insert into company_info
  42 + <trim prefix="(" suffix=")" suffixOverrides=",">
  43 + <if test="id != null">
  44 + id,
  45 + </if>
  46 + <if test="companyName != null">
  47 + company_name,
  48 + </if>
  49 + <if test="companyAddress != null">
  50 + company_address,
  51 + </if>
  52 + <if test="companyMobile != null">
  53 + company_mobile,
  54 + </if>
  55 + <if test="companyId != null">
  56 + company_id,
  57 + </if>
  58 + <if test="companyRepresentative != null">
  59 + company_representative,
  60 + </if>
  61 + </trim>
  62 + <trim prefix="values (" suffix=")" suffixOverrides=",">
  63 + <if test="id != null">
  64 + #{id,jdbcType=VARCHAR},
  65 + </if>
  66 + <if test="companyName != null">
  67 + #{companyName,jdbcType=VARCHAR},
  68 + </if>
  69 + <if test="companyAddress != null">
  70 + #{companyAddress,jdbcType=VARCHAR},
  71 + </if>
  72 + <if test="companyMobile != null">
  73 + #{companyMobile,jdbcType=VARCHAR},
  74 + </if>
  75 + <if test="companyId != null">
  76 + #{companyId,jdbcType=VARCHAR},
  77 + </if>
  78 + <if test="companyRepresentative != null">
  79 + #{companyRepresentative,jdbcType=VARCHAR},
  80 + </if>
  81 + </trim>
  82 + </insert>
  83 + <update id="updateByPrimaryKeySelective" parameterType="com.sunyo.wlpt.dispatch.domain.CompanyInfo">
  84 + <!--@mbg.generated-->
  85 + update company_info
  86 + <set>
  87 + <if test="companyName != null">
  88 + company_name = #{companyName,jdbcType=VARCHAR},
  89 + </if>
  90 + <if test="companyAddress != null">
  91 + company_address = #{companyAddress,jdbcType=VARCHAR},
  92 + </if>
  93 + <if test="companyMobile != null">
  94 + company_mobile = #{companyMobile,jdbcType=VARCHAR},
  95 + </if>
  96 + <if test="companyId != null">
  97 + company_id = #{companyId,jdbcType=VARCHAR},
  98 + </if>
  99 + <if test="companyRepresentative != null">
  100 + company_representative = #{companyRepresentative,jdbcType=VARCHAR},
  101 + </if>
  102 + </set>
  103 + where id = #{id,jdbcType=VARCHAR}
  104 + </update>
  105 + <update id="updateByPrimaryKey" parameterType="com.sunyo.wlpt.dispatch.domain.CompanyInfo">
  106 + <!--@mbg.generated-->
  107 + update company_info
  108 + set company_name = #{companyName,jdbcType=VARCHAR},
  109 + company_address = #{companyAddress,jdbcType=VARCHAR},
  110 + company_mobile = #{companyMobile,jdbcType=VARCHAR},
  111 + company_id = #{companyId,jdbcType=VARCHAR},
  112 + company_representative = #{companyRepresentative,jdbcType=VARCHAR}
  113 + where id = #{id,jdbcType=VARCHAR}
  114 + </update>
  115 + <update id="updateBatch" parameterType="java.util.List">
  116 + <!--@mbg.generated-->
  117 + update company_info
  118 + <trim prefix="set" suffixOverrides=",">
  119 + <trim prefix="company_name = case" suffix="end,">
  120 + <foreach collection="list" index="index" item="item">
  121 + when id = #{item.id,jdbcType=VARCHAR} then #{item.companyName,jdbcType=VARCHAR}
  122 + </foreach>
  123 + </trim>
  124 + <trim prefix="company_address = case" suffix="end,">
  125 + <foreach collection="list" index="index" item="item">
  126 + when id = #{item.id,jdbcType=VARCHAR} then #{item.companyAddress,jdbcType=VARCHAR}
  127 + </foreach>
  128 + </trim>
  129 + <trim prefix="company_mobile = case" suffix="end,">
  130 + <foreach collection="list" index="index" item="item">
  131 + when id = #{item.id,jdbcType=VARCHAR} then #{item.companyMobile,jdbcType=VARCHAR}
  132 + </foreach>
  133 + </trim>
  134 + <trim prefix="company_id = case" suffix="end,">
  135 + <foreach collection="list" index="index" item="item">
  136 + when id = #{item.id,jdbcType=VARCHAR} then #{item.companyId,jdbcType=VARCHAR}
  137 + </foreach>
  138 + </trim>
  139 + <trim prefix="company_representative = case" suffix="end,">
  140 + <foreach collection="list" index="index" item="item">
  141 + when id = #{item.id,jdbcType=VARCHAR} then #{item.companyRepresentative,jdbcType=VARCHAR}
  142 + </foreach>
  143 + </trim>
  144 + </trim>
  145 + where id in
  146 + <foreach close=")" collection="list" item="item" open="(" separator=", ">
  147 + #{item.id,jdbcType=VARCHAR}
  148 + </foreach>
  149 + </update>
  150 + <update id="updateBatchSelective" parameterType="java.util.List">
  151 + <!--@mbg.generated-->
  152 + update company_info
  153 + <trim prefix="set" suffixOverrides=",">
  154 + <trim prefix="company_name = case" suffix="end,">
  155 + <foreach collection="list" index="index" item="item">
  156 + <if test="item.companyName != null">
  157 + when id = #{item.id,jdbcType=VARCHAR} then #{item.companyName,jdbcType=VARCHAR}
  158 + </if>
  159 + </foreach>
  160 + </trim>
  161 + <trim prefix="company_address = case" suffix="end,">
  162 + <foreach collection="list" index="index" item="item">
  163 + <if test="item.companyAddress != null">
  164 + when id = #{item.id,jdbcType=VARCHAR} then #{item.companyAddress,jdbcType=VARCHAR}
  165 + </if>
  166 + </foreach>
  167 + </trim>
  168 + <trim prefix="company_mobile = case" suffix="end,">
  169 + <foreach collection="list" index="index" item="item">
  170 + <if test="item.companyMobile != null">
  171 + when id = #{item.id,jdbcType=VARCHAR} then #{item.companyMobile,jdbcType=VARCHAR}
  172 + </if>
  173 + </foreach>
  174 + </trim>
  175 + <trim prefix="company_id = case" suffix="end,">
  176 + <foreach collection="list" index="index" item="item">
  177 + <if test="item.companyId != null">
  178 + when id = #{item.id,jdbcType=VARCHAR} then #{item.companyId,jdbcType=VARCHAR}
  179 + </if>
  180 + </foreach>
  181 + </trim>
  182 + <trim prefix="company_representative = case" suffix="end,">
  183 + <foreach collection="list" index="index" item="item">
  184 + <if test="item.companyRepresentative != null">
  185 + when id = #{item.id,jdbcType=VARCHAR} then #{item.companyRepresentative,jdbcType=VARCHAR}
  186 + </if>
  187 + </foreach>
  188 + </trim>
  189 + </trim>
  190 + where id in
  191 + <foreach close=")" collection="list" item="item" open="(" separator=", ">
  192 + #{item.id,jdbcType=VARCHAR}
  193 + </foreach>
  194 + </update>
  195 + <insert id="batchInsert" parameterType="map">
  196 + <!--@mbg.generated-->
  197 + insert into company_info
  198 + (id, company_name, company_address, company_mobile, company_id, company_representative
  199 + )
  200 + values
  201 + <foreach collection="list" item="item" separator=",">
  202 + (#{item.id,jdbcType=VARCHAR}, #{item.companyName,jdbcType=VARCHAR}, #{item.companyAddress,jdbcType=VARCHAR},
  203 + #{item.companyMobile,jdbcType=VARCHAR}, #{item.companyId,jdbcType=VARCHAR}, #{item.companyRepresentative,jdbcType=VARCHAR}
  204 + )
  205 + </foreach>
  206 + </insert>
  207 + <insert id="insertOrUpdate" parameterType="com.sunyo.wlpt.dispatch.domain.CompanyInfo">
  208 + <!--@mbg.generated-->
  209 + insert into company_info
  210 + (id, company_name, company_address, company_mobile, company_id, company_representative
  211 + )
  212 + values
  213 + (#{id,jdbcType=VARCHAR}, #{companyName,jdbcType=VARCHAR}, #{companyAddress,jdbcType=VARCHAR},
  214 + #{companyMobile,jdbcType=VARCHAR}, #{companyId,jdbcType=VARCHAR}, #{companyRepresentative,jdbcType=VARCHAR}
  215 + )
  216 + on duplicate key update
  217 + id = #{id,jdbcType=VARCHAR},
  218 + company_name = #{companyName,jdbcType=VARCHAR},
  219 + company_address = #{companyAddress,jdbcType=VARCHAR},
  220 + company_mobile = #{companyMobile,jdbcType=VARCHAR},
  221 + company_id = #{companyId,jdbcType=VARCHAR},
  222 + company_representative = #{companyRepresentative,jdbcType=VARCHAR}
  223 + </insert>
  224 + <insert id="insertOrUpdateSelective" parameterType="com.sunyo.wlpt.dispatch.domain.CompanyInfo">
  225 + <!--@mbg.generated-->
  226 + insert into company_info
  227 + <trim prefix="(" suffix=")" suffixOverrides=",">
  228 + <if test="id != null">
  229 + id,
  230 + </if>
  231 + <if test="companyName != null">
  232 + company_name,
  233 + </if>
  234 + <if test="companyAddress != null">
  235 + company_address,
  236 + </if>
  237 + <if test="companyMobile != null">
  238 + company_mobile,
  239 + </if>
  240 + <if test="companyId != null">
  241 + company_id,
  242 + </if>
  243 + <if test="companyRepresentative != null">
  244 + company_representative,
  245 + </if>
  246 + </trim>
  247 + values
  248 + <trim prefix="(" suffix=")" suffixOverrides=",">
  249 + <if test="id != null">
  250 + #{id,jdbcType=VARCHAR},
  251 + </if>
  252 + <if test="companyName != null">
  253 + #{companyName,jdbcType=VARCHAR},
  254 + </if>
  255 + <if test="companyAddress != null">
  256 + #{companyAddress,jdbcType=VARCHAR},
  257 + </if>
  258 + <if test="companyMobile != null">
  259 + #{companyMobile,jdbcType=VARCHAR},
  260 + </if>
  261 + <if test="companyId != null">
  262 + #{companyId,jdbcType=VARCHAR},
  263 + </if>
  264 + <if test="companyRepresentative != null">
  265 + #{companyRepresentative,jdbcType=VARCHAR},
  266 + </if>
  267 + </trim>
  268 + on duplicate key update
  269 + <trim suffixOverrides=",">
  270 + <if test="id != null">
  271 + id = #{id,jdbcType=VARCHAR},
  272 + </if>
  273 + <if test="companyName != null">
  274 + company_name = #{companyName,jdbcType=VARCHAR},
  275 + </if>
  276 + <if test="companyAddress != null">
  277 + company_address = #{companyAddress,jdbcType=VARCHAR},
  278 + </if>
  279 + <if test="companyMobile != null">
  280 + company_mobile = #{companyMobile,jdbcType=VARCHAR},
  281 + </if>
  282 + <if test="companyId != null">
  283 + company_id = #{companyId,jdbcType=VARCHAR},
  284 + </if>
  285 + <if test="companyRepresentative != null">
  286 + company_representative = #{companyRepresentative,jdbcType=VARCHAR},
  287 + </if>
  288 + </trim>
  289 + </insert>
  290 +</mapper>
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3 +<mapper namespace="com.sunyo.wlpt.dispatch.mapper.DispatchBusinessMapper">
  4 + <resultMap id="BaseResultMap" type="com.sunyo.wlpt.dispatch.domain.DispatchBusiness">
  5 + <!--@mbg.generated-->
  6 + <!--@Table dispatch_business-->
  7 + <id column="id" jdbcType="VARCHAR" property="id" />
  8 + <result column="dispatch_type" jdbcType="VARCHAR" property="dispatchType" />
  9 + </resultMap>
  10 + <sql id="Base_Column_List">
  11 + <!--@mbg.generated-->
  12 + id, dispatch_type
  13 + </sql>
  14 + <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
  15 + <!--@mbg.generated-->
  16 + select
  17 + <include refid="Base_Column_List" />
  18 + from dispatch_business
  19 + where id = #{id,jdbcType=VARCHAR}
  20 + </select>
  21 + <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
  22 + <!--@mbg.generated-->
  23 + delete from dispatch_business
  24 + where id = #{id,jdbcType=VARCHAR}
  25 + </delete>
  26 + <insert id="insert" parameterType="com.sunyo.wlpt.dispatch.domain.DispatchBusiness">
  27 + <!--@mbg.generated-->
  28 + insert into dispatch_business (id, dispatch_type)
  29 + values (#{id,jdbcType=VARCHAR}, #{dispatchType,jdbcType=VARCHAR})
  30 + </insert>
  31 + <insert id="insertSelective" parameterType="com.sunyo.wlpt.dispatch.domain.DispatchBusiness">
  32 + <!--@mbg.generated-->
  33 + insert into dispatch_business
  34 + <trim prefix="(" suffix=")" suffixOverrides=",">
  35 + <if test="id != null">
  36 + id,
  37 + </if>
  38 + <if test="dispatchType != null">
  39 + dispatch_type,
  40 + </if>
  41 + </trim>
  42 + <trim prefix="values (" suffix=")" suffixOverrides=",">
  43 + <if test="id != null">
  44 + #{id,jdbcType=VARCHAR},
  45 + </if>
  46 + <if test="dispatchType != null">
  47 + #{dispatchType,jdbcType=VARCHAR},
  48 + </if>
  49 + </trim>
  50 + </insert>
  51 + <update id="updateByPrimaryKeySelective" parameterType="com.sunyo.wlpt.dispatch.domain.DispatchBusiness">
  52 + <!--@mbg.generated-->
  53 + update dispatch_business
  54 + <set>
  55 + <if test="dispatchType != null">
  56 + dispatch_type = #{dispatchType,jdbcType=VARCHAR},
  57 + </if>
  58 + </set>
  59 + where id = #{id,jdbcType=VARCHAR}
  60 + </update>
  61 + <update id="updateByPrimaryKey" parameterType="com.sunyo.wlpt.dispatch.domain.DispatchBusiness">
  62 + <!--@mbg.generated-->
  63 + update dispatch_business
  64 + set dispatch_type = #{dispatchType,jdbcType=VARCHAR}
  65 + where id = #{id,jdbcType=VARCHAR}
  66 + </update>
  67 + <update id="updateBatch" parameterType="java.util.List">
  68 + <!--@mbg.generated-->
  69 + update dispatch_business
  70 + <trim prefix="set" suffixOverrides=",">
  71 + <trim prefix="dispatch_type = case" suffix="end,">
  72 + <foreach collection="list" index="index" item="item">
  73 + when id = #{item.id,jdbcType=VARCHAR} then #{item.dispatchType,jdbcType=VARCHAR}
  74 + </foreach>
  75 + </trim>
  76 + </trim>
  77 + where id in
  78 + <foreach close=")" collection="list" item="item" open="(" separator=", ">
  79 + #{item.id,jdbcType=VARCHAR}
  80 + </foreach>
  81 + </update>
  82 + <update id="updateBatchSelective" parameterType="java.util.List">
  83 + <!--@mbg.generated-->
  84 + update dispatch_business
  85 + <trim prefix="set" suffixOverrides=",">
  86 + <trim prefix="dispatch_type = case" suffix="end,">
  87 + <foreach collection="list" index="index" item="item">
  88 + <if test="item.dispatchType != null">
  89 + when id = #{item.id,jdbcType=VARCHAR} then #{item.dispatchType,jdbcType=VARCHAR}
  90 + </if>
  91 + </foreach>
  92 + </trim>
  93 + </trim>
  94 + where id in
  95 + <foreach close=")" collection="list" item="item" open="(" separator=", ">
  96 + #{item.id,jdbcType=VARCHAR}
  97 + </foreach>
  98 + </update>
  99 + <insert id="batchInsert" parameterType="map">
  100 + <!--@mbg.generated-->
  101 + insert into dispatch_business
  102 + (id, dispatch_type)
  103 + values
  104 + <foreach collection="list" item="item" separator=",">
  105 + (#{item.id,jdbcType=VARCHAR}, #{item.dispatchType,jdbcType=VARCHAR})
  106 + </foreach>
  107 + </insert>
  108 + <insert id="insertOrUpdate" parameterType="com.sunyo.wlpt.dispatch.domain.DispatchBusiness">
  109 + <!--@mbg.generated-->
  110 + insert into dispatch_business
  111 + (id, dispatch_type)
  112 + values
  113 + (#{id,jdbcType=VARCHAR}, #{dispatchType,jdbcType=VARCHAR})
  114 + on duplicate key update
  115 + id = #{id,jdbcType=VARCHAR},
  116 + dispatch_type = #{dispatchType,jdbcType=VARCHAR}
  117 + </insert>
  118 + <insert id="insertOrUpdateSelective" parameterType="com.sunyo.wlpt.dispatch.domain.DispatchBusiness">
  119 + <!--@mbg.generated-->
  120 + insert into dispatch_business
  121 + <trim prefix="(" suffix=")" suffixOverrides=",">
  122 + <if test="id != null">
  123 + id,
  124 + </if>
  125 + <if test="dispatchType != null">
  126 + dispatch_type,
  127 + </if>
  128 + </trim>
  129 + values
  130 + <trim prefix="(" suffix=")" suffixOverrides=",">
  131 + <if test="id != null">
  132 + #{id,jdbcType=VARCHAR},
  133 + </if>
  134 + <if test="dispatchType != null">
  135 + #{dispatchType,jdbcType=VARCHAR},
  136 + </if>
  137 + </trim>
  138 + on duplicate key update
  139 + <trim suffixOverrides=",">
  140 + <if test="id != null">
  141 + id = #{id,jdbcType=VARCHAR},
  142 + </if>
  143 + <if test="dispatchType != null">
  144 + dispatch_type = #{dispatchType,jdbcType=VARCHAR},
  145 + </if>
  146 + </trim>
  147 + </insert>
  148 +</mapper>
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3 +<mapper namespace="com.sunyo.wlpt.dispatch.mapper.DispatchNoteMapper">
  4 + <resultMap id="BaseResultMap" type="com.sunyo.wlpt.dispatch.domain.DispatchNote">
  5 + <!--@mbg.generated-->
  6 + <!--@Table dispatch_note-->
  7 + <id column="id" jdbcType="VARCHAR" property="id"/>
  8 + <result column="user_name" jdbcType="VARCHAR" property="userName"/>
  9 + <result column="user_mobile" jdbcType="VARCHAR" property="userMobile"/>
  10 + <result column="vehicle_number" jdbcType="INTEGER" property="vehicleNumber"/>
  11 + <result column="vehicle_type" jdbcType="VARCHAR" property="vehicleType"/>
  12 + <result column="license_plate_number" jdbcType="VARCHAR" property="licensePlateNumber"/>
  13 + <result column="driver_name" jdbcType="VARCHAR" property="driverName"/>
  14 + <result column="driver_mobile" jdbcType="VARCHAR" property="driverMobile"/>
  15 + <result column="dispatch_type" jdbcType="VARCHAR" property="dispatchType"/>
  16 + <result column="station" jdbcType="VARCHAR" property="station"/>
  17 + <result column="status" jdbcType="VARCHAR" property="status"/>
  18 + <result column="gmt_create" jdbcType="TIMESTAMP" property="gmtCreate"/>
  19 + <result column="gmt_modified" jdbcType="TIMESTAMP" property="gmtModified"/>
  20 + <result column="begin_time" jdbcType="TIMESTAMP" property="beginTime"/>
  21 + <result column="end_time" jdbcType="TIMESTAMP" property="endTime"/>
  22 + <result column="operation" jdbcType="VARCHAR" property="operation"/>
  23 + </resultMap>
  24 + <sql id="Base_Column_List">
  25 + <!--@mbg.generated-->
  26 + id, user_name, user_mobile, vehicle_number, vehicle_type, license_plate_number, driver_name,
  27 + driver_mobile, dispatch_type, station, `status`, gmt_create, gmt_modified, begin_time,
  28 + end_time, `operation`
  29 + </sql>
  30 + <!-- 获取调度记录列表 -->
  31 + <select id="selectVehicleInfoList" parameterType="com.sunyo.wlpt.dispatch.domain.DispatchNote"
  32 + resultMap="BaseResultMap">
  33 + select
  34 + <include refid="Base_Column_List"/>
  35 + from dispatch_note
  36 + <where>
  37 + <trim suffixOverrides=",">
  38 + <!-- 用户姓名 -->
  39 + <if test="userName != null and userName != ''">
  40 + user_name = #{userName,jdbcType=VARCHAR},
  41 + </if>
  42 + <!-- 用户联系方式 -->
  43 + <if test="userMobile != null and userMobile != ''">
  44 + AND user_mobile = #{userMobile,jdbcType=VARCHAR},
  45 + </if>
  46 + <!-- 业务类型 -->
  47 + <if test="dispatchType != null and dispatchType != ''">
  48 + AND dispatch_type = #{dispatchType,jdbcType=VARCHAR},
  49 + </if>
  50 + <!-- 记录表状态 -->
  51 + <if test="status != null and status != ''">
  52 + AND status = #{status,jdbcType=VARCHAR},
  53 + </if>
  54 + <!-- 任务创建时间 -->
  55 + <if test="gmtCreate != null">
  56 + AND DATE_FORMAT(gmt_create,'%Y-%m-%d') = #{gmtCreate,jdbcType=TIMESTAMP},
  57 + </if>
  58 + <!-- 任务(结束)完成时间 -->
  59 + <if test="endTime != null">
  60 + AND DATE_FORMAT(end_time,'%Y-%m-%d') = #{endTime,jdbcType=TIMESTAMP}
  61 + </if>
  62 + </trim>
  63 + </where>
  64 + </select>
  65 +
  66 + <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
  67 + <!--@mbg.generated-->
  68 + select
  69 + <include refid="Base_Column_List"/>
  70 + from dispatch_note
  71 + where id = #{id,jdbcType=VARCHAR}
  72 + </select>
  73 + <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
  74 + <!--@mbg.generated-->
  75 + delete from dispatch_note
  76 + where id = #{id,jdbcType=VARCHAR}
  77 + </delete>
  78 + <insert id="insert" parameterType="com.sunyo.wlpt.dispatch.domain.DispatchNote">
  79 + <!--@mbg.generated-->
  80 + insert into dispatch_note (id, user_name, user_mobile,
  81 + vehicle_number, vehicle_type, license_plate_number,
  82 + driver_name, driver_mobile, dispatch_type,
  83 + station, `status`, gmt_create,
  84 + gmt_modified, begin_time, end_time,
  85 + `operation`)
  86 + values (#{id,jdbcType=VARCHAR}, #{userName,jdbcType=VARCHAR}, #{userMobile,jdbcType=VARCHAR},
  87 + #{vehicleNumber,jdbcType=INTEGER}, #{vehicleType,jdbcType=VARCHAR}, #{licensePlateNumber,jdbcType=VARCHAR},
  88 + #{driverName,jdbcType=VARCHAR}, #{driverMobile,jdbcType=VARCHAR}, #{dispatchType,jdbcType=VARCHAR},
  89 + #{station,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{gmtCreate,jdbcType=TIMESTAMP},
  90 + #{gmtModified,jdbcType=TIMESTAMP}, #{beginTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP},
  91 + #{operation,jdbcType=VARCHAR})
  92 + </insert>
  93 + <insert id="insertSelective" parameterType="com.sunyo.wlpt.dispatch.domain.DispatchNote">
  94 + <!--@mbg.generated-->
  95 + insert into dispatch_note
  96 + <trim prefix="(" suffix=")" suffixOverrides=",">
  97 + <if test="id != null">
  98 + id,
  99 + </if>
  100 + <if test="userName != null">
  101 + user_name,
  102 + </if>
  103 + <if test="userMobile != null">
  104 + user_mobile,
  105 + </if>
  106 + <if test="vehicleNumber != null">
  107 + vehicle_number,
  108 + </if>
  109 + <if test="vehicleType != null">
  110 + vehicle_type,
  111 + </if>
  112 + <if test="licensePlateNumber != null">
  113 + license_plate_number,
  114 + </if>
  115 + <if test="driverName != null">
  116 + driver_name,
  117 + </if>
  118 + <if test="driverMobile != null">
  119 + driver_mobile,
  120 + </if>
  121 + <if test="dispatchType != null">
  122 + dispatch_type,
  123 + </if>
  124 + <if test="station != null">
  125 + station,
  126 + </if>
  127 + <if test="status != null">
  128 + `status`,
  129 + </if>
  130 + <if test="gmtCreate != null">
  131 + gmt_create,
  132 + </if>
  133 + <if test="gmtModified != null">
  134 + gmt_modified,
  135 + </if>
  136 + <if test="beginTime != null">
  137 + begin_time,
  138 + </if>
  139 + <if test="endTime != null">
  140 + end_time,
  141 + </if>
  142 + <if test="operation != null">
  143 + `operation`,
  144 + </if>
  145 + </trim>
  146 + <trim prefix="values (" suffix=")" suffixOverrides=",">
  147 + <if test="id != null">
  148 + #{id,jdbcType=VARCHAR},
  149 + </if>
  150 + <if test="userName != null">
  151 + #{userName,jdbcType=VARCHAR},
  152 + </if>
  153 + <if test="userMobile != null">
  154 + #{userMobile,jdbcType=VARCHAR},
  155 + </if>
  156 + <if test="vehicleNumber != null">
  157 + #{vehicleNumber,jdbcType=INTEGER},
  158 + </if>
  159 + <if test="vehicleType != null">
  160 + #{vehicleType,jdbcType=VARCHAR},
  161 + </if>
  162 + <if test="licensePlateNumber != null">
  163 + #{licensePlateNumber,jdbcType=VARCHAR},
  164 + </if>
  165 + <if test="driverName != null">
  166 + #{driverName,jdbcType=VARCHAR},
  167 + </if>
  168 + <if test="driverMobile != null">
  169 + #{driverMobile,jdbcType=VARCHAR},
  170 + </if>
  171 + <if test="dispatchType != null">
  172 + #{dispatchType,jdbcType=VARCHAR},
  173 + </if>
  174 + <if test="station != null">
  175 + #{station,jdbcType=VARCHAR},
  176 + </if>
  177 + <if test="status != null">
  178 + #{status,jdbcType=VARCHAR},
  179 + </if>
  180 + <if test="gmtCreate != null">
  181 + #{gmtCreate,jdbcType=TIMESTAMP},
  182 + </if>
  183 + <if test="gmtModified != null">
  184 + #{gmtModified,jdbcType=TIMESTAMP},
  185 + </if>
  186 + <if test="beginTime != null">
  187 + #{beginTime,jdbcType=TIMESTAMP},
  188 + </if>
  189 + <if test="endTime != null">
  190 + #{endTime,jdbcType=TIMESTAMP},
  191 + </if>
  192 + <if test="operation != null">
  193 + #{operation,jdbcType=VARCHAR},
  194 + </if>
  195 + </trim>
  196 + </insert>
  197 + <update id="updateByPrimaryKeySelective" parameterType="com.sunyo.wlpt.dispatch.domain.DispatchNote">
  198 + <!--@mbg.generated-->
  199 + update dispatch_note
  200 + <set>
  201 + <if test="userName != null">
  202 + user_name = #{userName,jdbcType=VARCHAR},
  203 + </if>
  204 + <if test="userMobile != null">
  205 + user_mobile = #{userMobile,jdbcType=VARCHAR},
  206 + </if>
  207 + <if test="vehicleNumber != null">
  208 + vehicle_number = #{vehicleNumber,jdbcType=INTEGER},
  209 + </if>
  210 + <if test="vehicleType != null">
  211 + vehicle_type = #{vehicleType,jdbcType=VARCHAR},
  212 + </if>
  213 + <if test="licensePlateNumber != null">
  214 + license_plate_number = #{licensePlateNumber,jdbcType=VARCHAR},
  215 + </if>
  216 + <if test="driverName != null">
  217 + driver_name = #{driverName,jdbcType=VARCHAR},
  218 + </if>
  219 + <if test="driverMobile != null">
  220 + driver_mobile = #{driverMobile,jdbcType=VARCHAR},
  221 + </if>
  222 + <if test="dispatchType != null">
  223 + dispatch_type = #{dispatchType,jdbcType=VARCHAR},
  224 + </if>
  225 + <if test="station != null">
  226 + station = #{station,jdbcType=VARCHAR},
  227 + </if>
  228 + <if test="status != null">
  229 + `status` = #{status,jdbcType=VARCHAR},
  230 + </if>
  231 + <if test="gmtCreate != null">
  232 + gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
  233 + </if>
  234 + <if test="gmtModified != null">
  235 + gmt_modified = #{gmtModified,jdbcType=TIMESTAMP},
  236 + </if>
  237 + <if test="beginTime != null">
  238 + begin_time = #{beginTime,jdbcType=TIMESTAMP},
  239 + </if>
  240 + <if test="endTime != null">
  241 + end_time = #{endTime,jdbcType=TIMESTAMP},
  242 + </if>
  243 + <if test="operation != null">
  244 + `operation` = #{operation,jdbcType=VARCHAR},
  245 + </if>
  246 + </set>
  247 + where id = #{id,jdbcType=VARCHAR}
  248 + </update>
  249 + <update id="updateByPrimaryKey" parameterType="com.sunyo.wlpt.dispatch.domain.DispatchNote">
  250 + <!--@mbg.generated-->
  251 + update dispatch_note
  252 + set user_name = #{userName,jdbcType=VARCHAR},
  253 + user_mobile = #{userMobile,jdbcType=VARCHAR},
  254 + vehicle_number = #{vehicleNumber,jdbcType=INTEGER},
  255 + vehicle_type = #{vehicleType,jdbcType=VARCHAR},
  256 + license_plate_number = #{licensePlateNumber,jdbcType=VARCHAR},
  257 + driver_name = #{driverName,jdbcType=VARCHAR},
  258 + driver_mobile = #{driverMobile,jdbcType=VARCHAR},
  259 + dispatch_type = #{dispatchType,jdbcType=VARCHAR},
  260 + station = #{station,jdbcType=VARCHAR},
  261 + `status` = #{status,jdbcType=VARCHAR},
  262 + gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
  263 + gmt_modified = #{gmtModified,jdbcType=TIMESTAMP},
  264 + begin_time = #{beginTime,jdbcType=TIMESTAMP},
  265 + end_time = #{endTime,jdbcType=TIMESTAMP},
  266 + `operation` = #{operation,jdbcType=VARCHAR}
  267 + where id = #{id,jdbcType=VARCHAR}
  268 + </update>
  269 + <update id="updateBatch" parameterType="java.util.List">
  270 + <!--@mbg.generated-->
  271 + update dispatch_note
  272 + <trim prefix="set" suffixOverrides=",">
  273 + <trim prefix="user_name = case" suffix="end,">
  274 + <foreach collection="list" index="index" item="item">
  275 + when id = #{item.id,jdbcType=VARCHAR} then #{item.userName,jdbcType=VARCHAR}
  276 + </foreach>
  277 + </trim>
  278 + <trim prefix="user_mobile = case" suffix="end,">
  279 + <foreach collection="list" index="index" item="item">
  280 + when id = #{item.id,jdbcType=VARCHAR} then #{item.userMobile,jdbcType=VARCHAR}
  281 + </foreach>
  282 + </trim>
  283 + <trim prefix="vehicle_number = case" suffix="end,">
  284 + <foreach collection="list" index="index" item="item">
  285 + when id = #{item.id,jdbcType=VARCHAR} then #{item.vehicleNumber,jdbcType=INTEGER}
  286 + </foreach>
  287 + </trim>
  288 + <trim prefix="vehicle_type = case" suffix="end,">
  289 + <foreach collection="list" index="index" item="item">
  290 + when id = #{item.id,jdbcType=VARCHAR} then #{item.vehicleType,jdbcType=VARCHAR}
  291 + </foreach>
  292 + </trim>
  293 + <trim prefix="license_plate_number = case" suffix="end,">
  294 + <foreach collection="list" index="index" item="item">
  295 + when id = #{item.id,jdbcType=VARCHAR} then #{item.licensePlateNumber,jdbcType=VARCHAR}
  296 + </foreach>
  297 + </trim>
  298 + <trim prefix="driver_name = case" suffix="end,">
  299 + <foreach collection="list" index="index" item="item">
  300 + when id = #{item.id,jdbcType=VARCHAR} then #{item.driverName,jdbcType=VARCHAR}
  301 + </foreach>
  302 + </trim>
  303 + <trim prefix="driver_mobile = case" suffix="end,">
  304 + <foreach collection="list" index="index" item="item">
  305 + when id = #{item.id,jdbcType=VARCHAR} then #{item.driverMobile,jdbcType=VARCHAR}
  306 + </foreach>
  307 + </trim>
  308 + <trim prefix="dispatch_type = case" suffix="end,">
  309 + <foreach collection="list" index="index" item="item">
  310 + when id = #{item.id,jdbcType=VARCHAR} then #{item.dispatchType,jdbcType=VARCHAR}
  311 + </foreach>
  312 + </trim>
  313 + <trim prefix="station = case" suffix="end,">
  314 + <foreach collection="list" index="index" item="item">
  315 + when id = #{item.id,jdbcType=VARCHAR} then #{item.station,jdbcType=VARCHAR}
  316 + </foreach>
  317 + </trim>
  318 + <trim prefix="`status` = case" suffix="end,">
  319 + <foreach collection="list" index="index" item="item">
  320 + when id = #{item.id,jdbcType=VARCHAR} then #{item.status,jdbcType=VARCHAR}
  321 + </foreach>
  322 + </trim>
  323 + <trim prefix="gmt_create = case" suffix="end,">
  324 + <foreach collection="list" index="index" item="item">
  325 + when id = #{item.id,jdbcType=VARCHAR} then #{item.gmtCreate,jdbcType=TIMESTAMP}
  326 + </foreach>
  327 + </trim>
  328 + <trim prefix="gmt_modified = case" suffix="end,">
  329 + <foreach collection="list" index="index" item="item">
  330 + when id = #{item.id,jdbcType=VARCHAR} then #{item.gmtModified,jdbcType=TIMESTAMP}
  331 + </foreach>
  332 + </trim>
  333 + <trim prefix="begin_time = case" suffix="end,">
  334 + <foreach collection="list" index="index" item="item">
  335 + when id = #{item.id,jdbcType=VARCHAR} then #{item.beginTime,jdbcType=TIMESTAMP}
  336 + </foreach>
  337 + </trim>
  338 + <trim prefix="end_time = case" suffix="end,">
  339 + <foreach collection="list" index="index" item="item">
  340 + when id = #{item.id,jdbcType=VARCHAR} then #{item.endTime,jdbcType=TIMESTAMP}
  341 + </foreach>
  342 + </trim>
  343 + <trim prefix="`operation` = case" suffix="end,">
  344 + <foreach collection="list" index="index" item="item">
  345 + when id = #{item.id,jdbcType=VARCHAR} then #{item.operation,jdbcType=VARCHAR}
  346 + </foreach>
  347 + </trim>
  348 + </trim>
  349 + where id in
  350 + <foreach close=")" collection="list" item="item" open="(" separator=", ">
  351 + #{item.id,jdbcType=VARCHAR}
  352 + </foreach>
  353 + </update>
  354 + <update id="updateBatchSelective" parameterType="java.util.List">
  355 + <!--@mbg.generated-->
  356 + update dispatch_note
  357 + <trim prefix="set" suffixOverrides=",">
  358 + <trim prefix="user_name = case" suffix="end,">
  359 + <foreach collection="list" index="index" item="item">
  360 + <if test="item.userName != null">
  361 + when id = #{item.id,jdbcType=VARCHAR} then #{item.userName,jdbcType=VARCHAR}
  362 + </if>
  363 + </foreach>
  364 + </trim>
  365 + <trim prefix="user_mobile = case" suffix="end,">
  366 + <foreach collection="list" index="index" item="item">
  367 + <if test="item.userMobile != null">
  368 + when id = #{item.id,jdbcType=VARCHAR} then #{item.userMobile,jdbcType=VARCHAR}
  369 + </if>
  370 + </foreach>
  371 + </trim>
  372 + <trim prefix="vehicle_number = case" suffix="end,">
  373 + <foreach collection="list" index="index" item="item">
  374 + <if test="item.vehicleNumber != null">
  375 + when id = #{item.id,jdbcType=VARCHAR} then #{item.vehicleNumber,jdbcType=INTEGER}
  376 + </if>
  377 + </foreach>
  378 + </trim>
  379 + <trim prefix="vehicle_type = case" suffix="end,">
  380 + <foreach collection="list" index="index" item="item">
  381 + <if test="item.vehicleType != null">
  382 + when id = #{item.id,jdbcType=VARCHAR} then #{item.vehicleType,jdbcType=VARCHAR}
  383 + </if>
  384 + </foreach>
  385 + </trim>
  386 + <trim prefix="license_plate_number = case" suffix="end,">
  387 + <foreach collection="list" index="index" item="item">
  388 + <if test="item.licensePlateNumber != null">
  389 + when id = #{item.id,jdbcType=VARCHAR} then #{item.licensePlateNumber,jdbcType=VARCHAR}
  390 + </if>
  391 + </foreach>
  392 + </trim>
  393 + <trim prefix="driver_name = case" suffix="end,">
  394 + <foreach collection="list" index="index" item="item">
  395 + <if test="item.driverName != null">
  396 + when id = #{item.id,jdbcType=VARCHAR} then #{item.driverName,jdbcType=VARCHAR}
  397 + </if>
  398 + </foreach>
  399 + </trim>
  400 + <trim prefix="driver_mobile = case" suffix="end,">
  401 + <foreach collection="list" index="index" item="item">
  402 + <if test="item.driverMobile != null">
  403 + when id = #{item.id,jdbcType=VARCHAR} then #{item.driverMobile,jdbcType=VARCHAR}
  404 + </if>
  405 + </foreach>
  406 + </trim>
  407 + <trim prefix="dispatch_type = case" suffix="end,">
  408 + <foreach collection="list" index="index" item="item">
  409 + <if test="item.dispatchType != null">
  410 + when id = #{item.id,jdbcType=VARCHAR} then #{item.dispatchType,jdbcType=VARCHAR}
  411 + </if>
  412 + </foreach>
  413 + </trim>
  414 + <trim prefix="station = case" suffix="end,">
  415 + <foreach collection="list" index="index" item="item">
  416 + <if test="item.station != null">
  417 + when id = #{item.id,jdbcType=VARCHAR} then #{item.station,jdbcType=VARCHAR}
  418 + </if>
  419 + </foreach>
  420 + </trim>
  421 + <trim prefix="`status` = case" suffix="end,">
  422 + <foreach collection="list" index="index" item="item">
  423 + <if test="item.status != null">
  424 + when id = #{item.id,jdbcType=VARCHAR} then #{item.status,jdbcType=VARCHAR}
  425 + </if>
  426 + </foreach>
  427 + </trim>
  428 + <trim prefix="gmt_create = case" suffix="end,">
  429 + <foreach collection="list" index="index" item="item">
  430 + <if test="item.gmtCreate != null">
  431 + when id = #{item.id,jdbcType=VARCHAR} then #{item.gmtCreate,jdbcType=TIMESTAMP}
  432 + </if>
  433 + </foreach>
  434 + </trim>
  435 + <trim prefix="gmt_modified = case" suffix="end,">
  436 + <foreach collection="list" index="index" item="item">
  437 + <if test="item.gmtModified != null">
  438 + when id = #{item.id,jdbcType=VARCHAR} then #{item.gmtModified,jdbcType=TIMESTAMP}
  439 + </if>
  440 + </foreach>
  441 + </trim>
  442 + <trim prefix="begin_time = case" suffix="end,">
  443 + <foreach collection="list" index="index" item="item">
  444 + <if test="item.beginTime != null">
  445 + when id = #{item.id,jdbcType=VARCHAR} then #{item.beginTime,jdbcType=TIMESTAMP}
  446 + </if>
  447 + </foreach>
  448 + </trim>
  449 + <trim prefix="end_time = case" suffix="end,">
  450 + <foreach collection="list" index="index" item="item">
  451 + <if test="item.endTime != null">
  452 + when id = #{item.id,jdbcType=VARCHAR} then #{item.endTime,jdbcType=TIMESTAMP}
  453 + </if>
  454 + </foreach>
  455 + </trim>
  456 + <trim prefix="`operation` = case" suffix="end,">
  457 + <foreach collection="list" index="index" item="item">
  458 + <if test="item.operation != null">
  459 + when id = #{item.id,jdbcType=VARCHAR} then #{item.operation,jdbcType=VARCHAR}
  460 + </if>
  461 + </foreach>
  462 + </trim>
  463 + </trim>
  464 + where id in
  465 + <foreach close=")" collection="list" item="item" open="(" separator=", ">
  466 + #{item.id,jdbcType=VARCHAR}
  467 + </foreach>
  468 + </update>
  469 + <insert id="batchInsert" parameterType="map">
  470 + <!--@mbg.generated-->
  471 + insert into dispatch_note
  472 + (id, user_name, user_mobile, vehicle_number, vehicle_type, license_plate_number,
  473 + driver_name, driver_mobile, dispatch_type, station, `status`, gmt_create, gmt_modified,
  474 + begin_time, end_time, `operation`)
  475 + values
  476 + <foreach collection="list" item="item" separator=",">
  477 + (#{item.id,jdbcType=VARCHAR}, #{item.userName,jdbcType=VARCHAR}, #{item.userMobile,jdbcType=VARCHAR},
  478 + #{item.vehicleNumber,jdbcType=INTEGER}, #{item.vehicleType,jdbcType=VARCHAR},
  479 + #{item.licensePlateNumber,jdbcType=VARCHAR},
  480 + #{item.driverName,jdbcType=VARCHAR}, #{item.driverMobile,jdbcType=VARCHAR},
  481 + #{item.dispatchType,jdbcType=VARCHAR},
  482 + #{item.station,jdbcType=VARCHAR}, #{item.status,jdbcType=VARCHAR}, #{item.gmtCreate,jdbcType=TIMESTAMP},
  483 + #{item.gmtModified,jdbcType=TIMESTAMP}, #{item.beginTime,jdbcType=TIMESTAMP},
  484 + #{item.endTime,jdbcType=TIMESTAMP},
  485 + #{item.operation,jdbcType=VARCHAR})
  486 + </foreach>
  487 + </insert>
  488 + <insert id="insertOrUpdate" parameterType="com.sunyo.wlpt.dispatch.domain.DispatchNote">
  489 + <!--@mbg.generated-->
  490 + insert into dispatch_note
  491 + (id, user_name, user_mobile, vehicle_number, vehicle_type, license_plate_number,
  492 + driver_name, driver_mobile, dispatch_type, station, `status`, gmt_create, gmt_modified,
  493 + begin_time, end_time, `operation`)
  494 + values
  495 + (#{id,jdbcType=VARCHAR}, #{userName,jdbcType=VARCHAR}, #{userMobile,jdbcType=VARCHAR},
  496 + #{vehicleNumber,jdbcType=INTEGER}, #{vehicleType,jdbcType=VARCHAR}, #{licensePlateNumber,jdbcType=VARCHAR},
  497 + #{driverName,jdbcType=VARCHAR}, #{driverMobile,jdbcType=VARCHAR}, #{dispatchType,jdbcType=VARCHAR},
  498 + #{station,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{gmtCreate,jdbcType=TIMESTAMP},
  499 + #{gmtModified,jdbcType=TIMESTAMP}, #{beginTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP},
  500 + #{operation,jdbcType=VARCHAR})
  501 + on duplicate key update
  502 + id = #{id,jdbcType=VARCHAR},
  503 + user_name = #{userName,jdbcType=VARCHAR},
  504 + user_mobile = #{userMobile,jdbcType=VARCHAR},
  505 + vehicle_number = #{vehicleNumber,jdbcType=INTEGER},
  506 + vehicle_type = #{vehicleType,jdbcType=VARCHAR},
  507 + license_plate_number = #{licensePlateNumber,jdbcType=VARCHAR},
  508 + driver_name = #{driverName,jdbcType=VARCHAR},
  509 + driver_mobile = #{driverMobile,jdbcType=VARCHAR},
  510 + dispatch_type = #{dispatchType,jdbcType=VARCHAR},
  511 + station = #{station,jdbcType=VARCHAR},
  512 + `status` = #{status,jdbcType=VARCHAR},
  513 + gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
  514 + gmt_modified = #{gmtModified,jdbcType=TIMESTAMP},
  515 + begin_time = #{beginTime,jdbcType=TIMESTAMP},
  516 + end_time = #{endTime,jdbcType=TIMESTAMP},
  517 + `operation` = #{operation,jdbcType=VARCHAR}
  518 + </insert>
  519 + <insert id="insertOrUpdateSelective" parameterType="com.sunyo.wlpt.dispatch.domain.DispatchNote">
  520 + <!--@mbg.generated-->
  521 + insert into dispatch_note
  522 + <trim prefix="(" suffix=")" suffixOverrides=",">
  523 + <if test="id != null">
  524 + id,
  525 + </if>
  526 + <if test="userName != null">
  527 + user_name,
  528 + </if>
  529 + <if test="userMobile != null">
  530 + user_mobile,
  531 + </if>
  532 + <if test="vehicleNumber != null">
  533 + vehicle_number,
  534 + </if>
  535 + <if test="vehicleType != null">
  536 + vehicle_type,
  537 + </if>
  538 + <if test="licensePlateNumber != null">
  539 + license_plate_number,
  540 + </if>
  541 + <if test="driverName != null">
  542 + driver_name,
  543 + </if>
  544 + <if test="driverMobile != null">
  545 + driver_mobile,
  546 + </if>
  547 + <if test="dispatchType != null">
  548 + dispatch_type,
  549 + </if>
  550 + <if test="station != null">
  551 + station,
  552 + </if>
  553 + <if test="status != null">
  554 + `status`,
  555 + </if>
  556 + <if test="gmtCreate != null">
  557 + gmt_create,
  558 + </if>
  559 + <if test="gmtModified != null">
  560 + gmt_modified,
  561 + </if>
  562 + <if test="beginTime != null">
  563 + begin_time,
  564 + </if>
  565 + <if test="endTime != null">
  566 + end_time,
  567 + </if>
  568 + <if test="operation != null">
  569 + `operation`,
  570 + </if>
  571 + </trim>
  572 + values
  573 + <trim prefix="(" suffix=")" suffixOverrides=",">
  574 + <if test="id != null">
  575 + #{id,jdbcType=VARCHAR},
  576 + </if>
  577 + <if test="userName != null">
  578 + #{userName,jdbcType=VARCHAR},
  579 + </if>
  580 + <if test="userMobile != null">
  581 + #{userMobile,jdbcType=VARCHAR},
  582 + </if>
  583 + <if test="vehicleNumber != null">
  584 + #{vehicleNumber,jdbcType=INTEGER},
  585 + </if>
  586 + <if test="vehicleType != null">
  587 + #{vehicleType,jdbcType=VARCHAR},
  588 + </if>
  589 + <if test="licensePlateNumber != null">
  590 + #{licensePlateNumber,jdbcType=VARCHAR},
  591 + </if>
  592 + <if test="driverName != null">
  593 + #{driverName,jdbcType=VARCHAR},
  594 + </if>
  595 + <if test="driverMobile != null">
  596 + #{driverMobile,jdbcType=VARCHAR},
  597 + </if>
  598 + <if test="dispatchType != null">
  599 + #{dispatchType,jdbcType=VARCHAR},
  600 + </if>
  601 + <if test="station != null">
  602 + #{station,jdbcType=VARCHAR},
  603 + </if>
  604 + <if test="status != null">
  605 + #{status,jdbcType=VARCHAR},
  606 + </if>
  607 + <if test="gmtCreate != null">
  608 + #{gmtCreate,jdbcType=TIMESTAMP},
  609 + </if>
  610 + <if test="gmtModified != null">
  611 + #{gmtModified,jdbcType=TIMESTAMP},
  612 + </if>
  613 + <if test="beginTime != null">
  614 + #{beginTime,jdbcType=TIMESTAMP},
  615 + </if>
  616 + <if test="endTime != null">
  617 + #{endTime,jdbcType=TIMESTAMP},
  618 + </if>
  619 + <if test="operation != null">
  620 + #{operation,jdbcType=VARCHAR},
  621 + </if>
  622 + </trim>
  623 + on duplicate key update
  624 + <trim suffixOverrides=",">
  625 + <if test="id != null">
  626 + id = #{id,jdbcType=VARCHAR},
  627 + </if>
  628 + <if test="userName != null">
  629 + user_name = #{userName,jdbcType=VARCHAR},
  630 + </if>
  631 + <if test="userMobile != null">
  632 + user_mobile = #{userMobile,jdbcType=VARCHAR},
  633 + </if>
  634 + <if test="vehicleNumber != null">
  635 + vehicle_number = #{vehicleNumber,jdbcType=INTEGER},
  636 + </if>
  637 + <if test="vehicleType != null">
  638 + vehicle_type = #{vehicleType,jdbcType=VARCHAR},
  639 + </if>
  640 + <if test="licensePlateNumber != null">
  641 + license_plate_number = #{licensePlateNumber,jdbcType=VARCHAR},
  642 + </if>
  643 + <if test="driverName != null">
  644 + driver_name = #{driverName,jdbcType=VARCHAR},
  645 + </if>
  646 + <if test="driverMobile != null">
  647 + driver_mobile = #{driverMobile,jdbcType=VARCHAR},
  648 + </if>
  649 + <if test="dispatchType != null">
  650 + dispatch_type = #{dispatchType,jdbcType=VARCHAR},
  651 + </if>
  652 + <if test="station != null">
  653 + station = #{station,jdbcType=VARCHAR},
  654 + </if>
  655 + <if test="status != null">
  656 + `status` = #{status,jdbcType=VARCHAR},
  657 + </if>
  658 + <if test="gmtCreate != null">
  659 + gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
  660 + </if>
  661 + <if test="gmtModified != null">
  662 + gmt_modified = #{gmtModified,jdbcType=TIMESTAMP},
  663 + </if>
  664 + <if test="beginTime != null">
  665 + begin_time = #{beginTime,jdbcType=TIMESTAMP},
  666 + </if>
  667 + <if test="endTime != null">
  668 + end_time = #{endTime,jdbcType=TIMESTAMP},
  669 + </if>
  670 + <if test="operation != null">
  671 + `operation` = #{operation,jdbcType=VARCHAR},
  672 + </if>
  673 + </trim>
  674 + </insert>
  675 +
  676 +</mapper>