作者 王勇

车辆调度系统,初次提交

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

要显示太多修改。

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

HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**
!**/src/test/**
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
### VS Code ###
.vscode/
... ...
/*
* Copyright 2007-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import java.net.*;
import java.io.*;
import java.nio.channels.*;
import java.util.Properties;
public class MavenWrapperDownloader {
private static final String WRAPPER_VERSION = "0.5.6";
/**
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
*/
private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
+ WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
/**
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
* use instead of the default one.
*/
private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
".mvn/wrapper/maven-wrapper.properties";
/**
* Path where the maven-wrapper.jar will be saved to.
*/
private static final String MAVEN_WRAPPER_JAR_PATH =
".mvn/wrapper/maven-wrapper.jar";
/**
* Name of the property which should be used to override the default download url for the wrapper.
*/
private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
public static void main(String args[]) {
System.out.println("- Downloader started");
File baseDirectory = new File(args[0]);
System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
// If the maven-wrapper.properties exists, read it and check if it contains a custom
// wrapperUrl parameter.
File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
String url = DEFAULT_DOWNLOAD_URL;
if (mavenWrapperPropertyFile.exists()) {
FileInputStream mavenWrapperPropertyFileInputStream = null;
try {
mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
Properties mavenWrapperProperties = new Properties();
mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
} catch (IOException e) {
System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
} finally {
try {
if (mavenWrapperPropertyFileInputStream != null) {
mavenWrapperPropertyFileInputStream.close();
}
} catch (IOException e) {
// Ignore ...
}
}
}
System.out.println("- Downloading from: " + url);
File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
if (!outputFile.getParentFile().exists()) {
if (!outputFile.getParentFile().mkdirs()) {
System.out.println(
"- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
}
}
System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
try {
downloadFileFromURL(url, outputFile);
System.out.println("Done");
System.exit(0);
} catch (Throwable e) {
System.out.println("- Error downloading");
e.printStackTrace();
System.exit(1);
}
}
private static void downloadFileFromURL(String urlString, File destination) throws Exception {
if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
String username = System.getenv("MVNW_USERNAME");
char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
Authenticator.setDefault(new Authenticator() {
@Override
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(username, password);
}
});
}
URL website = new URL(urlString);
ReadableByteChannel rbc;
rbc = Channels.newChannel(website.openStream());
FileOutputStream fos = new FileOutputStream(destination);
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
fos.close();
rbc.close();
}
}
... ...
不能预览此文件类型
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
... ...
<?xml version="1.0" encoding="UTF-8"?>
<!--参考文档链接:https://blog.csdn.net/qq_34912478/article/details/80877132-->
<!-- 日志级别从低到高分为TRACE < DEBUG < INFO < WARN < ERROR < FATAL,如果设置为WARN,则低于WARN的信息都不会输出 -->
<!-- scan:当此属性设置为true时,配置文件如果发生改变,将会被重新加载,默认值为true -->
<!-- scanPeriod:设置监测配置文件是否有修改的时间间隔,如果没有给出时间单位,默认单位是毫秒。当scan为true时,此属性生效。默认的时间间隔为1分钟。 -->
<!-- debug:当此属性设置为true时,将打印出logback内部日志信息,实时查看logback运行状态。默认值为false。 -->
<configuration scan="true" scanPeriod="10 seconds">
<!--<include resource="org/springframework/boot/logging/logback/base.xml" />-->
<contextName>logback</contextName>
<!-- name的值是变量的名称,value的值时变量定义的值。通过定义的值会被插入到logger上下文中。定义变量后,可以使“${}”来使用变量。 -->
<property name="log.path" value="./logs" />
<!-- 彩色日志 -->
<!-- 彩色日志依赖的渲染类 -->
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter" />
<conversionRule conversionWord="wex" converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter" />
<conversionRule conversionWord="wEx" converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter" />
<!-- 彩色日志格式 -->
<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}}"/>
<!--输出到控制台-->
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<!--此日志appender是为开发使用,只配置最底级别,控制台输出的日志级别是大于或等于此级别的日志信息-->
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>debug</level>
</filter>
<encoder>
<Pattern>${CONSOLE_LOG_PATTERN}</Pattern>
<!-- 设置字符集 windows系统这里设置成GBK-->
<charset>UTF-8</charset>
</encoder>
</appender>
<!--输出到文件-->
<!-- 时间滚动输出 level为 DEBUG 日志 -->
<appender name="DEBUG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文件的路径及文件名 -->
<file>${log.path}/log_debug.log</file>
<!--日志文件输出格式-->
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
<charset>UTF-8</charset> <!-- 设置字符集 -->
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志归档 -->
<fileNamePattern>${log.path}/debug/log-debug-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文件保留天数-->
<maxHistory>15</maxHistory>
</rollingPolicy>
<!-- 此日志文件只记录debug级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>debug</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 时间滚动输出 level为 INFO 日志 -->
<appender name="INFO_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文件的路径及文件名 -->
<file>${log.path}/log_info.log</file>
<!--日志文件输出格式-->
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
<charset>UTF-8</charset>
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 每天日志归档路径以及格式 -->
<fileNamePattern>${log.path}/info/log-info-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文件保留天数-->
<maxHistory>15</maxHistory>
</rollingPolicy>
<!-- 此日志文件只记录info级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>info</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 时间滚动输出 level为 WARN 日志 -->
<appender name="WARN_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文件的路径及文件名 -->
<file>${log.path}/log_warn.log</file>
<!--日志文件输出格式-->
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
<charset>UTF-8</charset> <!-- 此处设置字符集 -->
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${log.path}/warn/log-warn-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文件保留天数-->
<maxHistory>15</maxHistory>
</rollingPolicy>
<!-- 此日志文件只记录warn级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>warn</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 时间滚动输出 level为 ERROR 日志 -->
<appender name="ERROR_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文件的路径及文件名 -->
<file>${log.path}/log_error.log</file>
<!--日志文件输出格式-->
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
<charset>UTF-8</charset> <!-- 此处设置字符集 -->
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${log.path}/error/log-error-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文件保留天数-->
<maxHistory>15</maxHistory>
</rollingPolicy>
<!-- 此日志文件只记录ERROR级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>ERROR</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 时间滚动输出 level为 trace 日志 -->
<appender name="TRACE_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文件的路径及文件名 -->
<file>${log.path}/log_trace.log</file>
<!--日志文件输出格式-->
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
<charset>UTF-8</charset> <!-- 此处设置字符集 -->
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${log.path}/trace/log-trace-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文件保留天数-->
<maxHistory>15</maxHistory>
</rollingPolicy>
<!-- 此日志文件只记录trace级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>TRACE</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!--
<logger>用来设置某一个包或者具体的某一个类的日志打印级别、
以及指定<appender>。<logger>仅有一个name属性,
一个可选的level和一个可选的addtivity属性。
name:用来指定受此logger约束的某一个包或者具体的某一个类。
level:用来设置打印级别,大小写无关:TRACE, DEBUG, INFO, WARN, ERROR, ALL 和 OFF,
还有一个特俗值INHERITED或者同义词NULL,代表强制执行上级的级别。
如果未设置此属性,那么当前logger将会继承上级的级别。
addtivity:是否向上级logger传递打印信息。默认是true。
-->
<!--<logger name="org.springframework.web" level="info"/>-->
<!--<logger name="org.springframework.scheduling.annotation.ScheduledAnnotationBeanPostProcessor" level="INFO"/>-->
<!--
使用mybatis的时候,sql语句是debug下才会打印,而这里我们只配置了info,所以想要查看sql语句的话,有以下两种操作:
第一种把<root level="info">改成<root level="DEBUG">这样就会打印sql,不过这样日志那边会出现很多其他消息
第二种就是单独给dao下目录配置debug模式,代码如下,这样配置sql语句会打印,其他还是正常info级别:
-->
<!--
root节点是必选节点,用来指定最基础的日志输出级别,只有一个level属性
level:用来设置打印级别,大小写无关:TRACE, DEBUG, INFO, WARN, ERROR, ALL 和 OFF,
不能设置为INHERITED或者同义词NULL。默认是DEBUG
可以包含零个或多个元素,标识这个appender将会添加到这个logger。
-->
<!--<logger name="com.tianbo.analysis" level="trace">-->
<!--<appender-ref ref="CONSOLE" />-->
<!--<appender-ref ref="TRACE_FILE" />-->
<!--<appender-ref ref="DEBUG_FILE" />-->
<!--<appender-ref ref="INFO_FILE" />-->
<!--<appender-ref ref="WARN_FILE" />-->
<!--<appender-ref ref="ERROR_FILE" />-->
<!--</logger>-->
<!--开发环境:打印控制台-->
<springProfile name="dev">
<logger name="org.springframework" level="info"/>
<logger name="com.sunyo.wlpt.nmms.mapper" level="debug">
<appender-ref ref="CONSOLE" />
<appender-ref ref="DEBUG_FILE" />
</logger>
<logger name="org.apache.tomcat" level="info" />
<root level="info">
<appender-ref ref="CONSOLE" />
<appender-ref ref="TRACE_FILE" />
<appender-ref ref="DEBUG_FILE" />
<appender-ref ref="INFO_FILE" />
<appender-ref ref="WARN_FILE" />
<appender-ref ref="ERROR_FILE" />
</root>
</springProfile>
<!--生产环境:输出到文件-->
<springProfile name="pro">
<logger name="org.springframework" level="INFO"/>
<root level="info">
<appender-ref ref="CONSOLE" />
<appender-ref ref="DEBUG_FILE" />
<appender-ref ref="INFO_FILE" />
<appender-ref ref="ERROR_FILE" />
<appender-ref ref="WARN_FILE" />
<appender-ref ref="TRACE_FILE" />
</root>
</springProfile>
</configuration>
\ No newline at end of file
... ...
<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="ture" scanPeriod="60 seconds" debug="false">
<springProperty scope="context" name="appname" source="logback.appname"/>
<springProperty scope="context" name="logdir" source="logback.logdir"/>
<!--文件名-->
<contextName>${appname}</contextName>
<!--输出到控制面板-->
<appender name="consoleLog1" class="ch.qos.logback.core.ConsoleAppender">
<!-- layout输出方式输出-->
<layout class="ch.qos.logback.classic.PatternLayout">
<pattern>%d [%thread] %-5level %logger{36} - %msg%n</pattern>
</layout>
</appender>
<!--输出到控制面板-->
<appender name="consoleLog" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<!--输出info级别日志-->
<appender name="fileInfoLog" class="ch.qos.logback.core.rolling.RollingFileAppender">
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<!--过滤 Error-->
<level>ERROR</level>
<!--匹配到就禁止-->
<onMatch>DENY</onMatch>
<!--没有匹配到就允许-->
<onMismatch>ACCEPT</onMismatch>
</filter>
<!--<File>../logs</File>-->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<FileNamePattern>${logdir}/info.${appname}.%d{yyyy-MM-dd}.log</FileNamePattern>
<maxHistory>100</maxHistory>
<totalSizeCap>100MB</totalSizeCap>
</rollingPolicy>
<encoder>
<charset>UTF-8</charset>
<pattern>%d [%thread] %-5level %logger{36} %line - %msg%n</pattern>
</encoder>
</appender>
<!--输出Error级别日志-->
<!--<appender name="fileErrorLog" class="ch.qos.logback.core.rolling.RollingFileAppender">-->
<!--<filter class="ch.qos.logback.classic.filter.LevelFilter">-->
<!--&lt;!&ndash;过滤 Error &ndash;&gt;-->
<!--<level>ERROR</level>-->
<!--</filter>-->
<!--&lt;!&ndash;<File>../logs</File>&ndash;&gt;-->
<!--<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">-->
<!--<FileNamePattern>${logdir}/error.${appname}.%d{yyyy-MM-dd}.log</FileNamePattern>-->
<!--<maxHistory>100</maxHistory>-->
<!--<totalSizeCap>100MB</totalSizeCap>-->
<!--</rollingPolicy>-->
<!--<encoder>-->
<!--<charset>UTF-8</charset>-->
<!--<pattern>%d [%thread] %-5level %logger{36} %line - %msg%n</pattern>-->
<!--</encoder>-->
<!--</appender>-->
<!--监控下列类的所有日志,定义输出级别-->
<logger name="java.sql.PreparedStatement" level="DEBUG" additivity="false">
<appender-ref ref="consoleLog"/>
</logger>    
<logger name="java.sql.Connection" level="DEBUG" additivity="false"> 
<appender-ref ref="consoleLog"/>
</logger>  
<logger name="java.sql.Statement" level="DEBUG" additivity="false">
<appender-ref ref="consoleLog"/>
</logger>    
<logger name="com.ibatis" level="DEBUG" additivity="false">
<appender-ref ref="consoleLog"/>
</logger>    
<logger name="com.ibatis.common.jdbc.SimpleDataSource" level="DEBUG" additivity="false">
<appender-ref ref="consoleLog"/>
</logger>    
<logger name="com.ibatis.common.jdbc.ScriptRunner" level="DEBUG" additivity="false">
<appender-ref ref="consoleLog"/>
</logger>    
<logger name="com.ibatis.sqlmap.engine.impl.SqlMapClientDelegate" level="DEBUG" additivity="false">
<appender-ref ref="consoleLog"/>
</logger> 
<!--输出-->
<root level="INFO">
<appender-ref ref="consoleLog"/>
<!--<appender-ref ref="consoleLog"/>-->
<appender-ref ref="fileInfoLog"/>
<!--<appender-ref ref="fileErrorLog"/>-->
</root>
</configuration>
... ...
#!/bin/sh
# ----------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------
# Maven Start Up Batch script
#
# Required ENV vars:
# ------------------
# JAVA_HOME - location of a JDK home dir
#
# Optional ENV vars
# -----------------
# M2_HOME - location of maven2's installed home dir
# MAVEN_OPTS - parameters passed to the Java VM when running Maven
# e.g. to debug Maven itself, use
# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
# ----------------------------------------------------------------------------
if [ -z "$MAVEN_SKIP_RC" ] ; then
if [ -f /etc/mavenrc ] ; then
. /etc/mavenrc
fi
if [ -f "$HOME/.mavenrc" ] ; then
. "$HOME/.mavenrc"
fi
fi
# OS specific support. $var _must_ be set to either true or false.
cygwin=false;
darwin=false;
mingw=false
case "`uname`" in
CYGWIN*) cygwin=true ;;
MINGW*) mingw=true;;
Darwin*) darwin=true
# Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
# See https://developer.apple.com/library/mac/qa/qa1170/_index.html
if [ -z "$JAVA_HOME" ]; then
if [ -x "/usr/libexec/java_home" ]; then
export JAVA_HOME="`/usr/libexec/java_home`"
else
export JAVA_HOME="/Library/Java/Home"
fi
fi
;;
esac
if [ -z "$JAVA_HOME" ] ; then
if [ -r /etc/gentoo-release ] ; then
JAVA_HOME=`java-config --jre-home`
fi
fi
if [ -z "$M2_HOME" ] ; then
## resolve links - $0 may be a link to maven's home
PRG="$0"
# need this for relative symlinks
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG="`dirname "$PRG"`/$link"
fi
done
saveddir=`pwd`
M2_HOME=`dirname "$PRG"`/..
# make it fully qualified
M2_HOME=`cd "$M2_HOME" && pwd`
cd "$saveddir"
# echo Using m2 at $M2_HOME
fi
# For Cygwin, ensure paths are in UNIX format before anything is touched
if $cygwin ; then
[ -n "$M2_HOME" ] &&
M2_HOME=`cygpath --unix "$M2_HOME"`
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
[ -n "$CLASSPATH" ] &&
CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
fi
# For Mingw, ensure paths are in UNIX format before anything is touched
if $mingw ; then
[ -n "$M2_HOME" ] &&
M2_HOME="`(cd "$M2_HOME"; pwd)`"
[ -n "$JAVA_HOME" ] &&
JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
fi
if [ -z "$JAVA_HOME" ]; then
javaExecutable="`which javac`"
if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
# readlink(1) is not available as standard on Solaris 10.
readLink=`which readlink`
if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
if $darwin ; then
javaHome="`dirname \"$javaExecutable\"`"
javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
else
javaExecutable="`readlink -f \"$javaExecutable\"`"
fi
javaHome="`dirname \"$javaExecutable\"`"
javaHome=`expr "$javaHome" : '\(.*\)/bin'`
JAVA_HOME="$javaHome"
export JAVA_HOME
fi
fi
fi
if [ -z "$JAVACMD" ] ; then
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
else
JAVACMD="`which java`"
fi
fi
if [ ! -x "$JAVACMD" ] ; then
echo "Error: JAVA_HOME is not defined correctly." >&2
echo " We cannot execute $JAVACMD" >&2
exit 1
fi
if [ -z "$JAVA_HOME" ] ; then
echo "Warning: JAVA_HOME environment variable is not set."
fi
CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
# traverses directory structure from process work directory to filesystem root
# first directory with .mvn subdirectory is considered project base directory
find_maven_basedir() {
if [ -z "$1" ]
then
echo "Path not specified to find_maven_basedir"
return 1
fi
basedir="$1"
wdir="$1"
while [ "$wdir" != '/' ] ; do
if [ -d "$wdir"/.mvn ] ; then
basedir=$wdir
break
fi
# workaround for JBEAP-8937 (on Solaris 10/Sparc)
if [ -d "${wdir}" ]; then
wdir=`cd "$wdir/.."; pwd`
fi
# end of workaround
done
echo "${basedir}"
}
# concatenates all lines of a file
concat_lines() {
if [ -f "$1" ]; then
echo "$(tr -s '\n' ' ' < "$1")"
fi
}
BASE_DIR=`find_maven_basedir "$(pwd)"`
if [ -z "$BASE_DIR" ]; then
exit 1;
fi
##########################################################################################
# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
# This allows using the maven wrapper in projects that prohibit checking in binary data.
##########################################################################################
if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found .mvn/wrapper/maven-wrapper.jar"
fi
else
if [ "$MVNW_VERBOSE" = true ]; then
echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
fi
if [ -n "$MVNW_REPOURL" ]; then
jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
else
jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
fi
while IFS="=" read key value; do
case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
esac
done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
if [ "$MVNW_VERBOSE" = true ]; then
echo "Downloading from: $jarUrl"
fi
wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
if $cygwin; then
wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"`
fi
if command -v wget > /dev/null; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found wget ... using wget"
fi
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
wget "$jarUrl" -O "$wrapperJarPath"
else
wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath"
fi
elif command -v curl > /dev/null; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found curl ... using curl"
fi
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
curl -o "$wrapperJarPath" "$jarUrl" -f
else
curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f
fi
else
if [ "$MVNW_VERBOSE" = true ]; then
echo "Falling back to using Java to download"
fi
javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
# For Cygwin, switch paths to Windows format before running javac
if $cygwin; then
javaClass=`cygpath --path --windows "$javaClass"`
fi
if [ -e "$javaClass" ]; then
if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
if [ "$MVNW_VERBOSE" = true ]; then
echo " - Compiling MavenWrapperDownloader.java ..."
fi
# Compiling the Java class
("$JAVA_HOME/bin/javac" "$javaClass")
fi
if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
# Running the downloader
if [ "$MVNW_VERBOSE" = true ]; then
echo " - Running MavenWrapperDownloader.java ..."
fi
("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
fi
fi
fi
fi
##########################################################################################
# End of extension
##########################################################################################
export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
if [ "$MVNW_VERBOSE" = true ]; then
echo $MAVEN_PROJECTBASEDIR
fi
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
# For Cygwin, switch paths to Windows format before running java
if $cygwin; then
[ -n "$M2_HOME" ] &&
M2_HOME=`cygpath --path --windows "$M2_HOME"`
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
[ -n "$CLASSPATH" ] &&
CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
[ -n "$MAVEN_PROJECTBASEDIR" ] &&
MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
fi
# Provide a "standardized" way to retrieve the CLI args that will
# work with both Windows and non-Windows executions.
MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
export MAVEN_CMD_LINE_ARGS
WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
exec "$JAVACMD" \
$MAVEN_OPTS \
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
"-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
... ...
@REM ----------------------------------------------------------------------------
@REM Licensed to the Apache Software Foundation (ASF) under one
@REM or more contributor license agreements. See the NOTICE file
@REM distributed with this work for additional information
@REM regarding copyright ownership. The ASF licenses this file
@REM to you under the Apache License, Version 2.0 (the
@REM "License"); you may not use this file except in compliance
@REM with the License. You may obtain a copy of the License at
@REM
@REM https://www.apache.org/licenses/LICENSE-2.0
@REM
@REM Unless required by applicable law or agreed to in writing,
@REM software distributed under the License is distributed on an
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@REM KIND, either express or implied. See the License for the
@REM specific language governing permissions and limitations
@REM under the License.
@REM ----------------------------------------------------------------------------
@REM ----------------------------------------------------------------------------
@REM Maven Start Up Batch script
@REM
@REM Required ENV vars:
@REM JAVA_HOME - location of a JDK home dir
@REM
@REM Optional ENV vars
@REM M2_HOME - location of maven2's installed home dir
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
@REM e.g. to debug Maven itself, use
@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
@REM ----------------------------------------------------------------------------
@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
@echo off
@REM set title of command window
title %0
@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
@REM set %HOME% to equivalent of $HOME
if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
@REM Execute a user defined script before this one
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
@REM check for pre script, once with legacy .bat ending and once with .cmd ending
if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
:skipRcPre
@setlocal
set ERROR_CODE=0
@REM To isolate internal variables from possible post scripts, we use another setlocal
@setlocal
@REM ==== START VALIDATION ====
if not "%JAVA_HOME%" == "" goto OkJHome
echo.
echo Error: JAVA_HOME not found in your environment. >&2
echo Please set the JAVA_HOME variable in your environment to match the >&2
echo location of your Java installation. >&2
echo.
goto error
:OkJHome
if exist "%JAVA_HOME%\bin\java.exe" goto init
echo.
echo Error: JAVA_HOME is set to an invalid directory. >&2
echo JAVA_HOME = "%JAVA_HOME%" >&2
echo Please set the JAVA_HOME variable in your environment to match the >&2
echo location of your Java installation. >&2
echo.
goto error
@REM ==== END VALIDATION ====
:init
@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
@REM Fallback to current working directory if not found.
set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
set EXEC_DIR=%CD%
set WDIR=%EXEC_DIR%
:findBaseDir
IF EXIST "%WDIR%"\.mvn goto baseDirFound
cd ..
IF "%WDIR%"=="%CD%" goto baseDirNotFound
set WDIR=%CD%
goto findBaseDir
:baseDirFound
set MAVEN_PROJECTBASEDIR=%WDIR%
cd "%EXEC_DIR%"
goto endDetectBaseDir
:baseDirNotFound
set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
cd "%EXEC_DIR%"
:endDetectBaseDir
IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
@setlocal EnableExtensions EnableDelayedExpansion
for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
:endReadAdditionalConfig
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
)
@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
if exist %WRAPPER_JAR% (
if "%MVNW_VERBOSE%" == "true" (
echo Found %WRAPPER_JAR%
)
) else (
if not "%MVNW_REPOURL%" == "" (
SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
)
if "%MVNW_VERBOSE%" == "true" (
echo Couldn't find %WRAPPER_JAR%, downloading it ...
echo Downloading from: %DOWNLOAD_URL%
)
powershell -Command "&{"^
"$webclient = new-object System.Net.WebClient;"^
"if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
"$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
"}"^
"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^
"}"
if "%MVNW_VERBOSE%" == "true" (
echo Finished downloading %WRAPPER_JAR%
)
)
@REM End of extension
@REM Provide a "standardized" way to retrieve the CLI args that will
@REM work with both Windows and non-Windows executions.
set MAVEN_CMD_LINE_ARGS=%*
%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
if ERRORLEVEL 1 goto error
goto end
:error
set ERROR_CODE=1
:end
@endlocal & set ERROR_CODE=%ERROR_CODE%
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
@REM check for post script, once with legacy .bat ending and once with .cmd ending
if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
:skipRcPost
@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
if "%MAVEN_BATCH_PAUSE%" == "on" pause
if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
exit /B %ERROR_CODE%
... ...
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.7.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.sunyo</groupId>
<artifactId>dispatch_sys</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>dispatch_sys</name>
<description>车辆调度系统</description>
<properties>
<java.version>1.8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<spring-cloud.version>Greenwich.SR2</spring-cloud.version>
</properties>
<dependencies>
<!-- SpringBoot start -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- SpringBoot end -->
<!-- SpringCloud start -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-zipkin</artifactId>
</dependency>
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-starter-client</artifactId>
<version>2.2.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<!-- SpringCloud end -->
<!-- database start -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>2.1.1</version>
</dependency>
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>1.2.12</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>1.1.9</version>
</dependency>
<!-- database end -->
<!-- tools start -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.9.2</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.9.2</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.49</version>
</dependency>
<!-- tools end -->
<!-- test start -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- test end -->
<!--others modules start -->
<dependency>
<groupId>com.tianbo</groupId>
<artifactId>util</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<!--others modules end -->
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<mainClass>com.sunyo.wlpt.dispatch.DispatchSysApplication</mainClass>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
</project>
... ...
package com.sunyo.wlpt.dispatch;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.transaction.annotation.EnableTransactionManagement;
/**
* @author 子诚
* Description:程序入口类
*/
@SpringBootApplication
@MapperScan("com.sunyo.wlpt.dispatch.mapper")
@EnableFeignClients
@EnableEurekaClient
@EnableTransactionManagement
public class DispatchSysApplication {
public static void main(String[] args) {
SpringApplication.run(DispatchSysApplication.class, args);
}
}
... ...
package com.sunyo.wlpt.dispatch.config;
import org.springframework.context.EnvironmentAware;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;
import org.springframework.core.env.Profiles;
import springfox.documentation.RequestHandler;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.service.VendorExtension;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
import java.util.ArrayList;
/**
* @author 子诚
* Description:
* 时间:2020/4/21 11:32
*/
@Configuration
@EnableSwagger2
public class SwaggerConfig {
@Bean
public Docket docket(Environment environment) {
//设置要显示的swagger环境
Profiles profiles = Profiles.of("dev", "test");
//通过environment.acceptsProfiles,判定是否处在自己设置的环境中
boolean flag = environment.acceptsProfiles(profiles);
//版本类型是swagger2
return new Docket(DocumentationType.SWAGGER_2)
//通过调用自定义方法apiInfo,获得文档的主要信息
.apiInfo(apiInfo())
//分组
.groupName("子诚")
//如果是自己设置的环境,就是true,即打开swagger
.enable(true)
.select()
//RequestHandlerSelectors,配置要扫描接口的方式
//basePackage:配置要扫描的包,扫描该包下面的API注解
.apis(RequestHandlerSelectors.basePackage("com.sunyo.wlpt.dispatch.controller"))
//PathSelectors.any(),扫描全部;none(),全部都不扫描;withMethodAnnotation:扫描方法上的注解
//paths:过滤什么路径
.paths(PathSelectors.any())
.build();
}
/**
* 配置swagger信息==apiInfo
* @return
*/
private ApiInfo apiInfo() {
//作者信息
Contact contact = new Contact("子诚", "http://127.0.0.1:9999", "523186180@qq.com");
return new ApiInfo(
"车辆调度系统",
"春花秋月,夏日冬雪",
"1.0",
"http://127.0.0.1:9999",
contact,
"Apache 2.0",
"http://www.apache.org/licenses/LICENSE-2.0",
new ArrayList<VendorExtension>());
}
}
... ...
package com.sunyo.wlpt.dispatch.controller;
import com.sunyo.wlpt.dispatch.domain.DispatchNote;
import com.sunyo.wlpt.dispatch.domain.VehicleInfo;
import com.sunyo.wlpt.dispatch.response.ResultJson;
import com.sunyo.wlpt.dispatch.service.DispatchNoteService;
import com.sunyo.wlpt.dispatch.service.VehicleInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.ibatis.annotations.Update;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
import java.util.List;
import static java.util.stream.Collectors.toList;
/**
* @author 子诚
* Description:调度车辆
* 时间:2020/4/21 16:44
*/
@Api(value = "调度车辆业务")
@RequestMapping("dispatch")
@RestController
public class DispatchController {
@Autowired
private VehicleInfoService vehicleInfoService;
@Autowired
private DispatchNoteService dispatchNoteService;
@ApiOperation(value = "我要调度车辆")
@PostMapping("/dispatch")
public ResultJson<VehicleInfo> dispatch(@RequestBody DispatchNote req) {
//返回前端的
ResultJson<VehicleInfo> result = new ResultJson<>();
/**
* 1.获取到用户的需求
*/
Integer vehicleNumber = req.getVehicleNumber();
String vehicleType = req.getVehicleType();
// 匹配车辆条件,车辆状态为空闲(1)
String vehicleStatus = "1";
// 2.根据用户的需求(车辆类型、数量进行匹配)
List<VehicleInfo> vehicleInfoList = vehicleInfoService.dispatchVehicle(vehicleType, vehicleStatus);
// 3.对查询出来的结果进行匹配
if (vehicleInfoList.size() >= vehicleNumber) {
//取出前(需求)个
List<VehicleInfo> needList = vehicleInfoList.stream()
.limit(vehicleNumber)
.collect(toList());
for (int i = 0; i < needList.size(); i++) {
/**
* 1、通知车牌号为 XX 的车被调用,任务地点:场站位置;业务类型:XXXX
* //获取车牌号
* needList.get(i).getLicensePlateNumber();
* //获取场站位置
* req.getStation();
* //获取业务类型
* req.getDispatchType();
* //获取用户的姓名
* req.getUserName();
* //获取用户的联系方式
* req.getUserMobile();
*/
//2.修改车辆状态
needList.get(i).setVehicleStatus("2");
// 将车辆状态设置为执行状态
vehicleInfoService.updateByPrimaryKey(needList.get(i));
/**
* 3.生成调度表业务
*/
// 生成调度记录表
DispatchNote dispatchNote = new DispatchNote();
//记录表,设置用户的姓名
dispatchNote.setUserName(req.getUserName());
//记录表,设置用户的联系方式
dispatchNote.setUserMobile(req.getUserMobile());
//记录表,设置调度业务类型
dispatchNote.setDispatchType(req.getDispatchType());
//记录表,设置场站位置
dispatchNote.setStation(req.getStation());
//记录表,每条记录表的车辆数为1
dispatchNote.setVehicleNumber(1);
//记录表,设置车辆类型
dispatchNote.setVehicleType(req.getVehicleType());
//记录表,设置记录状态为执行状态(2)
dispatchNote.setStatus("2");
// 生成调度记录表
dispatchNoteService.insertSelective(dispatchNote);
}
//车辆匹配成功,返回车辆信息
result.setData((VehicleInfo) needList);
result.setCode("200");
result.setMsg("车辆调度成功!");
} else {
//车辆匹配失败
result.setCode("400");
result.setMsg("车辆繁忙,请稍后重试!");
}
return result;
}
@ApiOperation(value = "开始工作", notes = "车辆被调度后,开始工作的时刻")
@PutMapping("/startTask")
public void startTask(@RequestBody DispatchNote req) {
/**
* 设置调度记录表,开始任务时间(由客户端传递过来,比较精确)
*/
dispatchNoteService.updateByPrimaryKeySelective(req);
}
@ApiOperation(value = "完成工作", notes = "车辆被调度后,完成工作的时刻")
@PutMapping("/completeTask")
public void completeTask(@RequestBody DispatchNote req) {
/**
* 车辆信息表,修改
* 1.设置车辆信息表,为空闲状态(1)
* 2.设置车辆信息表开始空闲时间(任务的完成时间)
*/
// 根据记录表中的车牌号,获取到车辆信息
String licensePlateNumber = req.getLicensePlateNumber();
VehicleInfo vehicleInfo = vehicleInfoService.selectByLPN(licensePlateNumber);
//设置车辆信息表,为空闲状态(1)
vehicleInfo.setVehicleStatus("1");
//设置车辆信息表,开始空闲时间(任务的完成时间)
vehicleInfo.setFreetime(req.getEndTime());
vehicleInfoService.updateByPrimaryKeySelective(vehicleInfo);
/**
* 调度记录表,修改
* 1.设置调度记录,完成时间(由客户端传递过来,比较精确)
* 2.设置调度记录,完成状态(1)
*/
req.setStatus("1");
dispatchNoteService.updateByPrimaryKeySelective(req);
}
@ApiOperation("取消调度车辆")
@PutMapping("/cancel")
public ResultJson cancel(@RequestBody DispatchNote req) {
ResultJson<DispatchNote> result = new ResultJson<>();
// 根据记录表中的车牌号,获取到车辆信息
String licensePlateNumber = req.getLicensePlateNumber();
VehicleInfo vehicleInfo = vehicleInfoService.selectByLPN(licensePlateNumber);
// 判断,车辆是否为执行状态(2)?
String workingStatus = "2";
if (workingStatus.equals(vehicleInfo.getVehicleStatus())) {
//车辆状态,为执行状态(2),判断调度记录表开始时间是否为null
if (req.getBeginTime() == null) {
// 调度记录表的任务开始时间为null
//设置车辆状态,为空闲状态("1")
vehicleInfo.setVehicleStatus("1");
//设置车辆,开始空闲时间
vehicleInfo.setFreetime(new Date());
vehicleInfoService.updateByPrimaryKeySelective(vehicleInfo);
//将调度记录表的状态修改为撤销(取消)状态("3")
req.setStatus("3");
dispatchNoteService.updateByPrimaryKeySelective(req);
result.setMsg("该调度车辆,已经取消");
} else {
result.setMsg("请求,人工介入");
}
} else {
//车辆的状态不是执行状态(2),将调度记录表的状态修改为撤销(取消)状态("3")
req.setStatus("3");
dispatchNoteService.updateByPrimaryKeySelective(req);
result.setMsg("该调度车辆,已经取消");
}
return result;
}
}
... ...
package com.sunyo.wlpt.dispatch.controller;
import com.github.pagehelper.PageInfo;
import com.sunyo.wlpt.dispatch.domain.DispatchNote;
import com.sunyo.wlpt.dispatch.domain.VehicleInfo;
import com.sunyo.wlpt.dispatch.response.ResultJson;
import com.sunyo.wlpt.dispatch.service.DispatchNoteService;
import com.sunyo.wlpt.dispatch.service.VehicleInfoService;
import com.sunyo.wlpt.dispatch.utils.GetUUID;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
/**
* @author 子诚
* Description:
* 时间:2020/4/24 20:30
*/
@Api("调度记录信息,业务")
@RequestMapping("dispatchNote")
@RestController
public class DispatchNoteController {
@Autowired
private DispatchNoteService dispatchNoteService;
@Autowired
private VehicleInfoService vehicleInfoService;
/**
* 获取,调度记录信息列表
*/
@GetMapping("/selectDispatchNoteList")
public ResultJson<PageInfo> selectDispatchNoteList(
@RequestParam(value = "userName", required = false) String userName,
@RequestParam(value = "userMobile", required = false) String userMobile,
@RequestParam(value = "dispatchType", required = false) String dispatchType,
@RequestParam(value = "gmtCreate", required = false) Date gmtCreate,
@RequestParam(value = "endTime", required = false) Date endTime,
@RequestParam(value = "status", required = false) String status,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
ResultJson<PageInfo> result = new ResultJson<>();
DispatchNote dispatchNote = new DispatchNote();
/**
* 用户端查询,需要四个参数:
* 1.用户姓名(前端必填);2.用户电话(前端必填);3.业务类型;4.创建时间
*
* 管理员端查询,需要六个参数(没有必填):
* 1.用户姓名;2.用户电话;3.创建时间;4.完成时间
* 5.业务类型;6.记录状态
*/
if ("".equals(userName)) {
//获取参数,用户姓名
dispatchNote.setUserName(userName);
}
if ("".equals(userMobile)) {
//获取参数,用户联系方式
dispatchNote.setUserMobile(userMobile);
}
if ("".equals(dispatchType)) {
//获取参数,业务类型
dispatchNote.setDispatchType(dispatchType);
}
if (null != gmtCreate) {
//获取参数,创建时间
dispatchNote.setGmtCreate(gmtCreate);
}
if ("".equals(status)) {
//获取参数,记录表状态
dispatchNote.setStatus(status);
}
if (null != endTime) {
//获取参数,任务结束(完成)时间
dispatchNote.setEndTime(endTime);
}
PageInfo pageInfo = dispatchNoteService.selectDispatchNoteList(dispatchNote, pageNum, pageSize);
if (pageInfo.getTotal() > 0) {
result.setData(pageInfo);
result.setMsg("查询调度记录,成功");
} else {
result.setCode("400");
result.setMsg("查询调度记录,失败");
}
return result;
}
@ApiOperation("删除调度记录信息")
@DeleteMapping("/updateDispatchNote")
public ResultJson<DispatchNote> deleteDispatchNote(@RequestBody DispatchNote dispatchNote) {
ResultJson<DispatchNote> result = new ResultJson<>();
/**
* 如果调度记录为执行状态("2")
* 则将对应车辆的状态,修改为空闲状态("1"),并设置开始空闲时间
*/
String status = "2";
if (status.equals(dispatchNote.getStatus())) {
String licensePlateNumber = dispatchNote.getLicensePlateNumber();
//根据车牌号查询到车辆信息
VehicleInfo vehicleInfo = vehicleInfoService.selectByLPN(licensePlateNumber);
//设置车辆信息表,为空闲状态(1)
vehicleInfo.setVehicleStatus("1");
//设置车辆信息,开始空闲时间
vehicleInfo.setFreetime(new Date());
//根据主键,选择性修改
vehicleInfoService.updateByPrimaryKeySelective(vehicleInfo);
}
int num = dispatchNoteService.deleteByPrimaryKey(dispatchNote.getId());
if (num > 0) {
result.setMsg("删除调度记录信息,成功");
} else {
result.setCode("400");
result.setMsg("删除调度记录信息,失败");
}
return result;
}
@ApiOperation("编辑调度记录信息")
@PutMapping("/updateDispatchNote")
public ResultJson<DispatchNote> updateDispatchNote(@RequestBody DispatchNote dispatchNote) {
ResultJson<DispatchNote> result = new ResultJson<>();
//设置调度记录,操作类型,修改(2)
dispatchNote.setOperation("2");
int num = dispatchNoteService.updateByPrimaryKeySelective(dispatchNote);
if (num > 0) {
result.setMsg("修改调度记录信息,成功");
} else {
result.setCode("400");
result.setMsg("修改调度记录信息,失败");
}
return result;
}
@ApiOperation("增加调度记录信息")
@PostMapping("/insertDispatchNote")
public ResultJson<DispatchNote> insertDispatchNote(@RequestBody DispatchNote dispatchNote) {
ResultJson<DispatchNote> result = new ResultJson<>();
//设置调度记录,id值(uuid)
dispatchNote.setId(GetUUID.getuuid());
//设置调度记录,车辆数量为1辆
dispatchNote.setVehicleNumber(1);
//设置调度记录,操作类型,新增(1)
dispatchNote.setOperation("1");
int num = dispatchNoteService.insertSelective(dispatchNote);
if (num > 0) {
result.setMsg("添加调度记录信息,成功");
} else {
result.setCode("400");
result.setMsg("添加调度记录信息,失败");
}
return result;
}
}
... ...
package com.sunyo.wlpt.dispatch.controller;
import com.github.pagehelper.PageInfo;
import com.sunyo.wlpt.dispatch.domain.DriverInfo;
import com.sunyo.wlpt.dispatch.response.ResultJson;
import com.sunyo.wlpt.dispatch.service.DriverInfoService;
import com.sunyo.wlpt.dispatch.utils.GetUUID;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* @author 子诚
* Description:
* 时间:2020/4/26 14:04
*/
@Api("驾驶员信息管理")
@RequestMapping("/driverInfo")
@RestController
public class DriverInfoController {
@Autowired
private DriverInfoService driverInfoService;
@ApiOperation("获取驾驶员列表")
@GetMapping("/selectDriverInfoList")
public ResultJson<PageInfo> selectDriverInfoList(
@RequestParam(value = "driverName", required = false) String driverName,
@RequestParam(value = "driverMobile", required = false) String driverMobile,
@RequestParam(value = "driverCompany", required = false) String driverCompany,
@RequestParam(value = "driverStatus", required = false) String driverStatus,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
ResultJson<PageInfo> result = new ResultJson<>();
DriverInfo driverInfo = new DriverInfo();
if ("".equals(driverName)) {
//获取参数,驾驶员姓名
driverInfo.setDriverName(driverName);
}
if ("".equals(driverMobile)) {
//获取参数,驾驶员联系方式
driverInfo.setDriverMobile(driverMobile);
}
if ("".equals(driverCompany)) {
//获取参数,驾驶员所属公司
driverInfo.setDriverCompany(driverCompany);
}
if ("".equals(driverStatus)) {
//获取参数,驾驶员状态
driverInfo.setDriverStatus(driverStatus);
}
PageInfo pageInfo = driverInfoService.selectDriverInfoList(driverInfo, pageNum, pageSize);
if (pageInfo.getTotal() > 0) {
result.setData(pageInfo);
result.setMsg("查询驾驶员信息列表,成功");
} else {
result.setCode("400");
result.setMsg("查询驾驶员信息列表,失败");
}
return result;
}
@ApiOperation("删除驾驶员信息")
@DeleteMapping("/deleteDriverInfo")
public ResultJson deleteDriverInfo(@RequestBody DriverInfo driverInfo) {
ResultJson result = new ResultJson();
/**
* 删除驾驶员信息,根据主键删除
*/
int num = driverInfoService.deleteByPrimaryKey(driverInfo.getId());
if (num > 0) {
result.setMsg("删除驾驶员信息,成功");
} else {
result.setCode("400");
result.setMsg("删除驾驶员信息,失败");
}
return result;
}
@ApiOperation("编辑驾驶员信息")
@PutMapping("/updateDriverInfo")
public ResultJson updateDriverInfo(@RequestBody DriverInfo driverInfo) {
ResultJson result = new ResultJson();
/**
* 编辑驾驶员信息,根据主键选择性修改
*/
int num = driverInfoService.updateByPrimaryKeySelective(driverInfo);
if (num > 0) {
result.setMsg("编辑驾驶员信息,成功");
} else {
result.setCode("400");
result.setMsg("编辑驾驶员信息,失败");
}
return result;
}
@ApiOperation("增加驾驶员信息")
@PostMapping("/insertDriverInfo")
public ResultJson insertDriverInfo(@RequestBody DriverInfo driverInfo) {
ResultJson result = new ResultJson();
//设置驾驶员信息主键,UUID
driverInfo.setId(GetUUID.getuuid());
/**
* 选择性插入,驾驶员信息
*/
//新增的驾驶员的状态为 空闲状态("1")
driverInfo.setDriverStatus("1");
int num = driverInfoService.insertSelective(driverInfo);
if (num > 0) {
result.setMsg("新增驾驶员信息,成功");
} else {
result.setCode("400");
result.setMsg("新增驾驶员信息,失败");
}
return result;
}
}
... ...
package com.sunyo.wlpt.dispatch.controller;
import com.github.pagehelper.PageInfo;
import com.sunyo.wlpt.dispatch.domain.VehicleInfo;
import com.sunyo.wlpt.dispatch.response.ResultJson;
import com.sunyo.wlpt.dispatch.service.VehicleInfoService;
import com.sunyo.wlpt.dispatch.utils.GetUUID;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
/**
* @author 子诚
* Description:
* 时间:2020/4/24 17:03
*/
@Api("车辆信息")
@RequestMapping("vehicleInfo")
@RestController
public class VehicleInfoController {
@Autowired
private VehicleInfoService vehicleInfoService;
@ApiOperation("获取车辆列表")
@GetMapping("/selectVehicleInfoList")
public ResultJson<PageInfo> selectVehicleInfoList(
@RequestParam(value = "vehicleStatus", required = false) String vehicleStatus,
@RequestParam(value = "vehicleType", required = false) String vehicleType,
@RequestParam(value = "licensePlateNumber", required = false) String licensePlateNumber,
@RequestParam(value = "vehicleCompany", required = false) String vehicleCompany,
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
ResultJson<PageInfo> result = new ResultJson<>();
VehicleInfo vehicleInfo = new VehicleInfo();
if ("".equals(vehicleStatus)) {
//获取参数,车辆状态
vehicleInfo.setVehicleStatus(vehicleStatus);
}
if ("".equals(vehicleType)) {
//获取参数,车辆类型
vehicleInfo.setVehicleType(vehicleType);
}
if ("".equals(licensePlateNumber)) {
//获取参数,车牌号
vehicleInfo.setLicensePlateNumber(licensePlateNumber);
}
if ("".equals(vehicleCompany)) {
//获取参数,公司名
vehicleInfo.setVehicleCompany(vehicleCompany);
}
PageInfo pageInfo = vehicleInfoService.selectVehicleInfoList(vehicleInfo, pageNum, pageSize);
if (pageInfo.getTotal() > 0) {
result.setData(pageInfo);
result.setMsg("获取车辆列表,成功");
} else {
result.setCode("400");
result.setMsg("获取车辆列表,失败");
}
return result;
}
/**
* 单个查询
*/
/**
* 增加
*/
@ApiOperation("添加车辆信息")
@PostMapping("/insertVehicleInfo")
public ResultJson insertVehicleInfo(@RequestBody VehicleInfo vehicleInfo) {
ResultJson result = new ResultJson<>();
//设置车辆id,(uuid)
vehicleInfo.setId(GetUUID.getuuid());
//设置车辆状态,为空闲状态
vehicleInfo.setVehicleStatus("1");
//设置车辆开始空闲时间
vehicleInfo.setFreetime(new Date());
int num = vehicleInfoService.insertSelective(vehicleInfo);
if (num > 0) {
result.setMsg("添加车辆信息,成功");
} else {
result.setCode("400");
result.setMsg("添加车辆信息,失败");
}
return result;
}
/**
* 修改
*/
@ApiOperation("修改车辆信息")
@PutMapping("/updateVehicleInfo")
public ResultJson updateVehicleInfo(@RequestBody VehicleInfo vehicleInfo) {
ResultJson result = new ResultJson<>();
int num = vehicleInfoService.updateByPrimaryKeySelective(vehicleInfo);
if (num > 0) {
result.setMsg("修改车辆信息,成功");
} else {
result.setCode("400");
result.setMsg("修改车辆信息,失败");
}
return result;
}
/**
* 删除
*/
@ApiOperation("删除车辆信息")
@DeleteMapping("/deleteVehicleInfo")
public ResultJson deleteVehicleInfo(@RequestBody VehicleInfo vehicleInfo) {
ResultJson result = new ResultJson<>();
int num = vehicleInfoService.deleteByPrimaryKey(vehicleInfo.getId());
if (num > 0) {
result.setMsg("删除车辆信息,成功");
} else {
result.setCode("400");
result.setMsg("删除车辆信息,失败");
}
return result;
}
}
... ...
package com.sunyo.wlpt.dispatch.domain;
import java.io.Serializable;
import java.util.UUID;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author 子诚
* Description:公司信息实体类
* 时间:2020/4/21 14:29
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class CompanyInfo implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 公司信息编号uuid
*/
private String id = UUID.randomUUID().toString().replaceAll("-", "");
/**
* 公司名称
*/
private String companyName;
/**
* 公司地址
*/
private String companyAddress;
/**
* 公司联系方式
*/
private String companyMobile;
/**
* 公司社会信用代码
*/
private String companyId;
/**
* 公司法定代表人
*/
private String companyRepresentative;
}
... ...
package com.sunyo.wlpt.dispatch.domain;
import java.io.Serializable;
import java.util.UUID;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author 子诚
* Description:调度业务实体类
* 时间:2020/4/21 15:16
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class DispatchBusiness implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 调度业务编号uuid
*/
private String id = UUID.randomUUID().toString().replaceAll("-", "");
/**
* 调度业务类型;进站送货,出站提货,货物调拨,货物流转
*/
private String dispatchType;
}
... ...
package com.sunyo.wlpt.dispatch.domain;
import java.io.Serializable;
import java.util.Date;
import java.util.UUID;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
/**
* @author 子诚
* Description:
* 时间:2020/4/22 15:32
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class DispatchNote implements Serializable {
/**
* 调度记录编号uuid
*/
private String id = UUID.randomUUID().toString().replaceAll("-", "");
/**
* 用户姓名
*/
private String userName;
/**
* 用户联系方式
*/
private String userMobile;
/**
* 车辆数量,单位:辆
*/
private Integer vehicleNumber;
/**
* 车辆类型:1.重型货车;2.中型货车;3.轻型货车;4.微型货车;5.拖车;6.叉车
*/
private String vehicleType;
/**
* 车牌号码
*/
private String licensePlateNumber;
/**
* 驾驶员姓名
*/
private String driverName;
/**
* 驾驶员联系方式
*/
private String driverMobile;
/**
* 调度业务类型
*/
private String dispatchType;
/**
* 场站位置
*/
private String station;
/**
* 记录状态:1.完成状态;2.执行状态;3、取消(撤销)状态
*/
private String status;
/**
* 调度记录(任务)创建时间
*/
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date gmtCreate;
/**
* 调度记录修改时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date gmtModified;
/**
* 任务开始时间
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date beginTime;
/**
* 任务完成时间
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date endTime;
/**
* 操作类型:1.新增;2.修改;3.删除
*/
private String operation;
private static final long serialVersionUID = 1L;
}
... ...
package com.sunyo.wlpt.dispatch.domain;
import java.io.Serializable;
import java.util.Date;
import java.util.UUID;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author 子诚
* Description:驶员信息实体类
* 时间:2020/4/21 15:16
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class DriverInfo implements Serializable {
/**
* 驾驶员信息编号uuid
*/
private String id = UUID.randomUUID().toString().replaceAll("-", "");
/**
* 驾驶员姓名
*/
private String driverName;
/**
* 身份证号码
*/
private String driverId;
/**
* 驾驶证号码
*/
private String driverLicenseNumber;
/**
* 驾驶员联系方式
*/
private String driverMobile;
/**
* 工号
*/
private String jobNumber;
/**
* 驾驶员职位:大队长,班长,副班长,员工
*/
private String driverPosition;
/**
* 驾驶员所属公司名称
*/
private String driverCompany;
/**
* 驾驶员信息创建时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date gmtCreate;
/**
* 驾驶员信息修改时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date gmtModified;
/**
* 驾驶员状态:1.空闲状态;2.执行状态;3.轮休状态;.请假状态
*/
private String driverStatus;
private static final long serialVersionUID = 1L;
}
... ...
package com.sunyo.wlpt.dispatch.domain;
import java.io.Serializable;
import java.util.Date;
import java.util.UUID;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
/**
* @author 子诚
* Description:车辆信息实体类
* 时间:2020/4/21 15:16
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class VehicleInfo implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 车辆信息编号uuid
*/
private String id = UUID.randomUUID().toString().replaceAll("-", "");
/**
* 车牌号码
*/
private String licensePlateNumber;
/**
* 行驶证号码
*/
private String drivingLicenseNumber;
/**
* 是否有挂车?1,有挂车;0,没有挂车
*/
private String isTrailer;
/**
* 挂车所属车辆的车牌号
*/
private String trailerNumber;
/**
* 车辆类型:1.重型货车;2.中型货车;3.轻型货车;4.微型货车;5.拖车;6.叉车
*/
private String vehicleType;
/**
* 车辆载重,单位为Kg
*/
private String vehicleLoad;
/**
* 车辆信息创建时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date gmtCreate;
/**
* 车辆信息修改时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date gmtModified;
/**
* 车辆状态:1.空闲状态;2.执行状态;3、在修状态;4.损坏未修状态;5.保养状态
*/
private String vehicleStatus;
/**
* 车辆开始空闲的时间
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date freetime;
/**
* 车辆优先级(1,最好,2次之)
*/
private Integer priority;
/**
* 车辆所属公司名称
*/
private String vehicleCompany;
}
... ...
package com.sunyo.wlpt.dispatch.mapper;
import com.sunyo.wlpt.dispatch.domain.CompanyInfo;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* @author 子诚
* Description:
* 时间:2020/4/21 14:29
*/
@Mapper
public interface CompanyInfoMapper {
int deleteByPrimaryKey(String id);
int insert(CompanyInfo record);
int insertOrUpdate(CompanyInfo record);
int insertOrUpdateSelective(CompanyInfo record);
int insertSelective(CompanyInfo record);
CompanyInfo selectByPrimaryKey(String id);
int updateByPrimaryKeySelective(CompanyInfo record);
int updateByPrimaryKey(CompanyInfo record);
int updateBatch(List<CompanyInfo> list);
int updateBatchSelective(List<CompanyInfo> list);
int batchInsert(@Param("list") List<CompanyInfo> list);
}
... ...
package com.sunyo.wlpt.dispatch.mapper;
import com.sunyo.wlpt.dispatch.domain.DispatchBusiness;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* @author 子诚
* Description:
* 时间:2020/4/21 15:16
*/
@Mapper
public interface DispatchBusinessMapper {
int deleteByPrimaryKey(String id);
int insert(DispatchBusiness record);
int insertOrUpdate(DispatchBusiness record);
int insertOrUpdateSelective(DispatchBusiness record);
int insertSelective(DispatchBusiness record);
DispatchBusiness selectByPrimaryKey(String id);
int updateByPrimaryKeySelective(DispatchBusiness record);
int updateByPrimaryKey(DispatchBusiness record);
int updateBatch(List<DispatchBusiness> list);
int updateBatchSelective(List<DispatchBusiness> list);
int batchInsert(@Param("list") List<DispatchBusiness> list);
}
... ...
package com.sunyo.wlpt.dispatch.mapper;
import com.sunyo.wlpt.dispatch.domain.DispatchNote;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @author 子诚
* Description:
* 时间:2020/4/22 15:32
*/
@Mapper
public interface DispatchNoteMapper {
/**
* 分页查询,调度记录列表
*
* @param record
* @return
*/
List<DispatchNote> selectVehicleInfoList(DispatchNote record);
int deleteByPrimaryKey(String id);
int insert(DispatchNote record);
int insertOrUpdate(DispatchNote record);
int insertOrUpdateSelective(DispatchNote record);
int insertSelective(DispatchNote record);
DispatchNote selectByPrimaryKey(String id);
int updateByPrimaryKeySelective(DispatchNote record);
int updateByPrimaryKey(DispatchNote record);
int updateBatch(List<DispatchNote> list);
int updateBatchSelective(List<DispatchNote> list);
int batchInsert(@Param("list") List<DispatchNote> list);
}
... ...
package com.sunyo.wlpt.dispatch.mapper;
import com.sunyo.wlpt.dispatch.domain.DriverInfo;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* @author 子诚
* Description:
* 时间:2020/4/21 15:16
*/
@Mapper
public interface DriverInfoMapper {
/**
* 分页查询,驾驶员信息列表
*
* @param record
* @return
*/
List<DriverInfo> selectDriverInfoList(DriverInfo record);
int deleteByPrimaryKey(String id);
int insert(DriverInfo record);
int insertOrUpdate(DriverInfo record);
int insertOrUpdateSelective(DriverInfo record);
int insertSelective(DriverInfo record);
DriverInfo selectByPrimaryKey(String id);
int updateByPrimaryKeySelective(DriverInfo record);
int updateByPrimaryKey(DriverInfo record);
int updateBatch(List<DriverInfo> list);
int updateBatchSelective(List<DriverInfo> list);
int batchInsert(@Param("list") List<DriverInfo> list);
}
... ...
package com.sunyo.wlpt.dispatch.mapper;
import com.sunyo.wlpt.dispatch.domain.VehicleInfo;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* @author 子诚
* Description:
* 时间:2020/4/21 15:16
*/
@Mapper
public interface VehicleInfoMapper {
/**
* 调度车辆方法
*/
List<VehicleInfo> dispatchVehicle(@Param("vehicleType") String vehicleType, @Param("vehicleStatus") String vehicleStatus);
/**
* 分页查询,车辆列表
*/
List<VehicleInfo> selectVehicleInfoList(VehicleInfo record);
/**
* 删除,根据主键
*
* @param id
* @return
*/
int deleteByPrimaryKey(String id);
int insert(VehicleInfo record);
int insertOrUpdate(VehicleInfo record);
int insertOrUpdateSelective(VehicleInfo record);
int insertSelective(VehicleInfo record);
VehicleInfo selectByPrimaryKey(String id);
/**
* 根据车牌号查询车辆信息
*/
VehicleInfo selectByLPN(String licensePlateNumber);
/**
* 选择性修改,根据主键id
*/
int updateByPrimaryKeySelective(VehicleInfo record);
int updateByPrimaryKey(VehicleInfo record);
int updateBatch(List<VehicleInfo> list);
int updateBatchSelective(List<VehicleInfo> list);
int batchInsert(@Param("list") List<VehicleInfo> list);
}
... ...
package com.sunyo.wlpt.dispatch.response;
import lombok.Data;
import java.io.Serializable;
/**
* @author 子诚
* Description:
* 时间:2020/4/24 10:06
*/
@Data
public class ResultJson<T> implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 响应业务状态,默认为200
*/
private String code = "200";
/**
* 响应消息
*/
private String msg = "";
/**
* 响应数据
*/
private T data;
/**
* JWT令牌
*/
private String jwtToken;
/**
* 无参,构造方法
*/
public ResultJson() {
}
/**
* 有参,构造方法;
* 重载
*/
public ResultJson(String code) {
this.code = code;
}
public ResultJson(T data) {
this.data = data;
}
public ResultJson(String code, String msg) {
this.code = code;
this.msg = msg;
}
public ResultJson(String code, String msg, T data) {
this.code = code;
this.msg = msg;
this.data = data;
}
}
... ...
package com.sunyo.wlpt.dispatch.service;
import com.sunyo.wlpt.dispatch.domain.CompanyInfo;
import java.util.List;
/**
* @author 子诚
* Description:
* 时间:2020/4/21 14:29
*/
public interface CompanyInfoService {
int deleteByPrimaryKey(String id);
int insert(CompanyInfo record);
int insertOrUpdate(CompanyInfo record);
int insertOrUpdateSelective(CompanyInfo record);
int insertSelective(CompanyInfo record);
CompanyInfo selectByPrimaryKey(String id);
int updateByPrimaryKeySelective(CompanyInfo record);
int updateByPrimaryKey(CompanyInfo record);
int updateBatch(List<CompanyInfo> list);
int updateBatchSelective(List<CompanyInfo> list);
int batchInsert(List<CompanyInfo> list);
}
... ...
package com.sunyo.wlpt.dispatch.service;
import java.util.List;
import com.sunyo.wlpt.dispatch.domain.DispatchBusiness;
/**
* @author 子诚
* Description:
* 时间:2020/4/21 15:16
*/
public interface DispatchBusinessService {
int deleteByPrimaryKey(String id);
int insert(DispatchBusiness record);
int insertOrUpdate(DispatchBusiness record);
int insertOrUpdateSelective(DispatchBusiness record);
int insertSelective(DispatchBusiness record);
DispatchBusiness selectByPrimaryKey(String id);
int updateByPrimaryKeySelective(DispatchBusiness record);
int updateByPrimaryKey(DispatchBusiness record);
int updateBatch(List<DispatchBusiness> list);
int updateBatchSelective(List<DispatchBusiness> list);
int batchInsert(List<DispatchBusiness> list);
}
... ...
package com.sunyo.wlpt.dispatch.service;
import com.github.pagehelper.PageInfo;
import com.sunyo.wlpt.dispatch.domain.DispatchNote;
import java.util.List;
/**
* @author 子诚
* Description:调度列表Service
* 时间:2020/4/21 19:20
*/
public interface DispatchNoteService {
/**
* 获取调度列表
*
* @param dispatchNote
* @param pageNum
* @param pageSize
* @return
*/
PageInfo selectDispatchNoteList(DispatchNote dispatchNote, Integer pageNum, Integer pageSize);
int deleteByPrimaryKey(String id);
int insert(DispatchNote record);
int insertOrUpdate(DispatchNote record);
int insertOrUpdateSelective(DispatchNote record);
int insertSelective(DispatchNote record);
DispatchNote selectByPrimaryKey(String id);
int updateByPrimaryKeySelective(DispatchNote record);
int updateByPrimaryKey(DispatchNote record);
int updateBatch(List<DispatchNote> list);
int updateBatchSelective(List<DispatchNote> list);
int batchInsert(List<DispatchNote> list);
}
... ...
package com.sunyo.wlpt.dispatch.service;
import com.github.pagehelper.PageInfo;
import com.sunyo.wlpt.dispatch.domain.DriverInfo;
import java.util.List;
/**
* @author 子诚
* Description:
* 时间:2020/4/21 15:16
*/
public interface DriverInfoService {
/**
* 分页查询驾驶员信息列表
*/
PageInfo selectDriverInfoList(DriverInfo driverInfo, Integer pageNum, Integer pageSize);
int deleteByPrimaryKey(String id);
int insert(DriverInfo record);
int insertOrUpdate(DriverInfo record);
int insertOrUpdateSelective(DriverInfo record);
int insertSelective(DriverInfo record);
DriverInfo selectByPrimaryKey(String id);
int updateByPrimaryKeySelective(DriverInfo record);
int updateByPrimaryKey(DriverInfo record);
int updateBatch(List<DriverInfo> list);
int updateBatchSelective(List<DriverInfo> list);
int batchInsert(List<DriverInfo> list);
}
... ...
package com.sunyo.wlpt.dispatch.service;
import java.util.List;
import com.github.pagehelper.PageInfo;
import com.sunyo.wlpt.dispatch.domain.VehicleInfo;
/**
* @author 子诚
* Description:
* 时间:2020/4/21 15:16
*/
public interface VehicleInfoService {
/**
* 调度车辆方法
*
* @param vehicleType
* @param vehicleStatus
* @return
*/
List<VehicleInfo> dispatchVehicle(String vehicleType, String vehicleStatus);
/**
* 查询车辆信息,by车牌号
*
* @param licensePlateNumber
* @return
*/
VehicleInfo selectByLPN(String licensePlateNumber);
/**
* 获取车辆列表
*
* @param vehicleInfo
* @param pageNum
* @param pageSize
* @return
*/
PageInfo selectVehicleInfoList(VehicleInfo vehicleInfo, Integer pageNum, Integer pageSize);
int deleteByPrimaryKey(String id);
int insert(VehicleInfo record);
int insertOrUpdate(VehicleInfo record);
int insertOrUpdateSelective(VehicleInfo record);
int insertSelective(VehicleInfo record);
VehicleInfo selectByPrimaryKey(String id);
int updateByPrimaryKeySelective(VehicleInfo record);
int updateByPrimaryKey(VehicleInfo record);
int updateBatch(List<VehicleInfo> list);
int updateBatchSelective(List<VehicleInfo> list);
int batchInsert(List<VehicleInfo> list);
}
... ...
package com.sunyo.wlpt.dispatch.service.impl;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import com.sunyo.wlpt.dispatch.mapper.CompanyInfoMapper;
import com.sunyo.wlpt.dispatch.domain.CompanyInfo;
import java.util.List;
import com.sunyo.wlpt.dispatch.service.CompanyInfoService;
/**
* @author 子诚
* Description:
* 时间:2020/4/21 14:29
*/
@Service
public class CompanyInfoServiceImpl implements CompanyInfoService {
@Resource
private CompanyInfoMapper companyInfoMapper;
@Override
public int deleteByPrimaryKey(String id) {
return companyInfoMapper.deleteByPrimaryKey(id);
}
@Override
public int insert(CompanyInfo record) {
return companyInfoMapper.insert(record);
}
@Override
public int insertOrUpdate(CompanyInfo record) {
return companyInfoMapper.insertOrUpdate(record);
}
@Override
public int insertOrUpdateSelective(CompanyInfo record) {
return companyInfoMapper.insertOrUpdateSelective(record);
}
@Override
public int insertSelective(CompanyInfo record) {
return companyInfoMapper.insertSelective(record);
}
@Override
public CompanyInfo selectByPrimaryKey(String id) {
return companyInfoMapper.selectByPrimaryKey(id);
}
@Override
public int updateByPrimaryKeySelective(CompanyInfo record) {
return companyInfoMapper.updateByPrimaryKeySelective(record);
}
@Override
public int updateByPrimaryKey(CompanyInfo record) {
return companyInfoMapper.updateByPrimaryKey(record);
}
@Override
public int updateBatch(List<CompanyInfo> list) {
return companyInfoMapper.updateBatch(list);
}
@Override
public int updateBatchSelective(List<CompanyInfo> list) {
return companyInfoMapper.updateBatchSelective(list);
}
@Override
public int batchInsert(List<CompanyInfo> list) {
return companyInfoMapper.batchInsert(list);
}
}
... ...
package com.sunyo.wlpt.dispatch.service.impl;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import com.sunyo.wlpt.dispatch.mapper.DispatchBusinessMapper;
import com.sunyo.wlpt.dispatch.domain.DispatchBusiness;
import com.sunyo.wlpt.dispatch.service.DispatchBusinessService;
/**
* @author 子诚
* Description:
* 时间:2020/4/21 15:16
*/
@Service
public class DispatchBusinessServiceImpl implements DispatchBusinessService {
@Resource
private DispatchBusinessMapper dispatchBusinessMapper;
@Override
public int deleteByPrimaryKey(String id) {
return dispatchBusinessMapper.deleteByPrimaryKey(id);
}
@Override
public int insert(DispatchBusiness record) {
return dispatchBusinessMapper.insert(record);
}
@Override
public int insertOrUpdate(DispatchBusiness record) {
return dispatchBusinessMapper.insertOrUpdate(record);
}
@Override
public int insertOrUpdateSelective(DispatchBusiness record) {
return dispatchBusinessMapper.insertOrUpdateSelective(record);
}
@Override
public int insertSelective(DispatchBusiness record) {
return dispatchBusinessMapper.insertSelective(record);
}
@Override
public DispatchBusiness selectByPrimaryKey(String id) {
return dispatchBusinessMapper.selectByPrimaryKey(id);
}
@Override
public int updateByPrimaryKeySelective(DispatchBusiness record) {
return dispatchBusinessMapper.updateByPrimaryKeySelective(record);
}
@Override
public int updateByPrimaryKey(DispatchBusiness record) {
return dispatchBusinessMapper.updateByPrimaryKey(record);
}
@Override
public int updateBatch(List<DispatchBusiness> list) {
return dispatchBusinessMapper.updateBatch(list);
}
@Override
public int updateBatchSelective(List<DispatchBusiness> list) {
return dispatchBusinessMapper.updateBatchSelective(list);
}
@Override
public int batchInsert(List<DispatchBusiness> list) {
return dispatchBusinessMapper.batchInsert(list);
}
}
... ...
package com.sunyo.wlpt.dispatch.service.impl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.sunyo.wlpt.dispatch.domain.VehicleInfo;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import com.sunyo.wlpt.dispatch.domain.DispatchNote;
import java.util.List;
import com.sunyo.wlpt.dispatch.mapper.DispatchNoteMapper;
import com.sunyo.wlpt.dispatch.service.DispatchNoteService;
/**
* @author 子诚
* Description:
* 时间:2020/4/21 19:20
*/
@Service
public class DispatchNoteServiceImpl implements DispatchNoteService {
@Resource
private DispatchNoteMapper dispatchNoteMapper;
@Override
public PageInfo selectDispatchNoteList(DispatchNote dispatchNote, Integer pageNum, Integer pageSize) {
List<DispatchNote> dispatchNoteList = dispatchNoteMapper.selectVehicleInfoList(dispatchNote);
//使用pagehelper
PageHelper.startPage(pageNum, pageSize);
PageInfo<VehicleInfo> pageInfo = new PageInfo(dispatchNoteList);
return pageInfo;
}
@Override
public int deleteByPrimaryKey(String id) {
return dispatchNoteMapper.deleteByPrimaryKey(id);
}
@Override
public int insert(DispatchNote record) {
return dispatchNoteMapper.insert(record);
}
@Override
public int insertOrUpdate(DispatchNote record) {
return dispatchNoteMapper.insertOrUpdate(record);
}
@Override
public int insertOrUpdateSelective(DispatchNote record) {
return dispatchNoteMapper.insertOrUpdateSelective(record);
}
@Override
public int insertSelective(DispatchNote record) {
return dispatchNoteMapper.insertSelective(record);
}
@Override
public DispatchNote selectByPrimaryKey(String id) {
return dispatchNoteMapper.selectByPrimaryKey(id);
}
@Override
public int updateByPrimaryKeySelective(DispatchNote record) {
return dispatchNoteMapper.updateByPrimaryKeySelective(record);
}
@Override
public int updateByPrimaryKey(DispatchNote record) {
return dispatchNoteMapper.updateByPrimaryKey(record);
}
@Override
public int updateBatch(List<DispatchNote> list) {
return dispatchNoteMapper.updateBatch(list);
}
@Override
public int updateBatchSelective(List<DispatchNote> list) {
return dispatchNoteMapper.updateBatchSelective(list);
}
@Override
public int batchInsert(List<DispatchNote> list) {
return dispatchNoteMapper.batchInsert(list);
}
}
... ...
package com.sunyo.wlpt.dispatch.service.impl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.sunyo.wlpt.dispatch.domain.VehicleInfo;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import com.sunyo.wlpt.dispatch.domain.DriverInfo;
import java.util.List;
import com.sunyo.wlpt.dispatch.mapper.DriverInfoMapper;
import com.sunyo.wlpt.dispatch.service.DriverInfoService;
/**
* @author 子诚
* Description:
* 时间:2020/4/21 15:16
*/
@Service
public class DriverInfoServiceImpl implements DriverInfoService {
@Resource
private DriverInfoMapper driverInfoMapper;
/**
* 分页查询,驾驶员信息列表
*/
@Override
public PageInfo selectDriverInfoList(DriverInfo driverInfo, Integer pageNum, Integer pageSize) {
List<DriverInfo> driverInfoList = driverInfoMapper.selectDriverInfoList(driverInfo);
PageHelper.startPage(pageNum, pageSize);
PageInfo<VehicleInfo> pageInfo = new PageInfo(driverInfoList);
return pageInfo;
}
@Override
public int deleteByPrimaryKey(String id) {
return driverInfoMapper.deleteByPrimaryKey(id);
}
@Override
public int insert(DriverInfo record) {
return driverInfoMapper.insert(record);
}
@Override
public int insertOrUpdate(DriverInfo record) {
return driverInfoMapper.insertOrUpdate(record);
}
@Override
public int insertOrUpdateSelective(DriverInfo record) {
return driverInfoMapper.insertOrUpdateSelective(record);
}
@Override
public int insertSelective(DriverInfo record) {
return driverInfoMapper.insertSelective(record);
}
@Override
public DriverInfo selectByPrimaryKey(String id) {
return driverInfoMapper.selectByPrimaryKey(id);
}
@Override
public int updateByPrimaryKeySelective(DriverInfo record) {
return driverInfoMapper.updateByPrimaryKeySelective(record);
}
@Override
public int updateByPrimaryKey(DriverInfo record) {
return driverInfoMapper.updateByPrimaryKey(record);
}
@Override
public int updateBatch(List<DriverInfo> list) {
return driverInfoMapper.updateBatch(list);
}
@Override
public int updateBatchSelective(List<DriverInfo> list) {
return driverInfoMapper.updateBatchSelective(list);
}
@Override
public int batchInsert(List<DriverInfo> list) {
return driverInfoMapper.batchInsert(list);
}
}
... ...
package com.sunyo.wlpt.dispatch.service.impl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import com.sunyo.wlpt.dispatch.domain.VehicleInfo;
import com.sunyo.wlpt.dispatch.mapper.VehicleInfoMapper;
import com.sunyo.wlpt.dispatch.service.VehicleInfoService;
/**
* @author 子诚
* Description:
* 时间:2020/4/21 15:16
*/
@Service
public class VehicleInfoServiceImpl implements VehicleInfoService {
@Resource
private VehicleInfoMapper vehicleInfoMapper;
/**
* 调度车辆方法
*
* @param vehicleType:车辆类型
* @param vehicleStatus:车辆状态
* @return List<VehicleInfo>
*/
@Override
public List<VehicleInfo> dispatchVehicle(String vehicleType, String vehicleStatus) {
return vehicleInfoMapper.dispatchVehicle(vehicleType, vehicleStatus);
}
/**
* 查询车辆信息,by车牌号
*/
@Override
public VehicleInfo selectByLPN(String licensePlateNumber) {
return vehicleInfoMapper.selectByLPN(licensePlateNumber);
}
/**
* 获取车辆列表
*
* @param vehicleInfo
* @param pageNum
* @param pageSize
* @return
*/
@Override
public PageInfo selectVehicleInfoList(VehicleInfo vehicleInfo, Integer pageNum, Integer pageSize) {
List<VehicleInfo> vehicleInfoList = vehicleInfoMapper.selectVehicleInfoList(vehicleInfo);
// 使用 PageHelper 分页插件
PageHelper.startPage(pageNum, pageSize);
PageInfo<VehicleInfo> pageInfo = new PageInfo(vehicleInfoList);
return pageInfo;
}
@Override
public int deleteByPrimaryKey(String id) {
return vehicleInfoMapper.deleteByPrimaryKey(id);
}
@Override
public int insert(VehicleInfo record) {
return vehicleInfoMapper.insert(record);
}
@Override
public int insertOrUpdate(VehicleInfo record) {
return vehicleInfoMapper.insertOrUpdate(record);
}
@Override
public int insertOrUpdateSelective(VehicleInfo record) {
return vehicleInfoMapper.insertOrUpdateSelective(record);
}
@Override
public int insertSelective(VehicleInfo record) {
return vehicleInfoMapper.insertSelective(record);
}
@Override
public VehicleInfo selectByPrimaryKey(String id) {
return vehicleInfoMapper.selectByPrimaryKey(id);
}
@Override
public int updateByPrimaryKeySelective(VehicleInfo record) {
return vehicleInfoMapper.updateByPrimaryKeySelective(record);
}
@Override
public int updateByPrimaryKey(VehicleInfo record) {
return vehicleInfoMapper.updateByPrimaryKey(record);
}
@Override
public int updateBatch(List<VehicleInfo> list) {
return vehicleInfoMapper.updateBatch(list);
}
@Override
public int updateBatchSelective(List<VehicleInfo> list) {
return vehicleInfoMapper.updateBatchSelective(list);
}
@Override
public int batchInsert(List<VehicleInfo> list) {
return vehicleInfoMapper.batchInsert(list);
}
}
... ...
package com.sunyo.wlpt.dispatch.utils;
import java.util.UUID;
/**
* @author 子诚
* Description:
* 时间:2020/4/24 17:44
*/
public class GetUUID {
public static String getuuid(){
return UUID.randomUUID().toString().replaceAll("-", "");
}
}
... ...
# 服务配置
server:
port: 9999
# spring 配置
spring:
application:
name: dispatch-system
profiles:
active: dev
# 链路追踪配置
zipkin:
base-url: http://192.168.1.63:9411
sleuth:
sampler:
probability: 1
# 数据库信息配置
datasource:
druid:
driver-class-name: com.mysql.cj.jdbc.Driver
username: 110
password: QAHqCJf2kFYCLirM
url: jdbc:mysql://118.31.66.166:3306/dispatch_sys?characterEncoding=utf8&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true
initial-size: 10
max-active: 50
min-idle: 5
max-wait: 60000
# \u5F00\u542F\u7F13\u5B58preparedStatement(PSCache)
pool-prepared-statements: true
# \u542F\u7528PSCache\u540E\uFF0C\u6307\u5B9A\u6BCF\u4E2A\u8FDE\u63A5\u4E0APSCache\u7684\u5927\u5C0F
max-pool-prepared-statement-per-connection-size: 20
# \u7528\u6765\u68C0\u6D4B\u8FDE\u63A5\u662F\u5426\u6709\u6548\u7684sql
validation-query: select 'x'
# \u7533\u8BF7\u8FDE\u63A5\u65F6\u4E0D\u68C0\u6D4B\u8FDE\u63A5\u662F\u5426\u6709\u6548
test-on-borrow: false
# \u5F52\u8FD8\u8FDE\u63A5\u65F6\u4E0D\u68C0\u6D4B\u8FDE\u63A5\u662F\u5426\u6709\u6548
test-on-return: false
# \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
test-while-idle: true
# \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
time-between-eviction-runs-millis: 60000
# \u8FDE\u63A5\u4FDD\u6301\u7A7A\u95F2\u800C\u4E0D\u88AB\u9A71\u9010\u7684\u6700\u5C0F\u65F6\u95F4(ms)
min-evictable-idle-time-millis: 300000
# \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
filters: stat,wall
# \u652F\u6301\u5408\u5E76\u591A\u4E2ADruidDataSource\u7684\u76D1\u63A7\u6570\u636E
use-global-data-source-stat: true
# \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)
connection-properties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
type: com.alibaba.druid.pool.DruidDataSource
# json\u65F6\u95F4\u683C\u5F0F\u8BBE\u7F6E \u51FA\u6E2F\u7406\u8D27\u88C5\u5378\u65F6\u95F4\u62A5\u9519
# jackson:
# time-zone: GMT+8
# date-format: YYYY-MM-dd HH:mm:ss
# mybatis配置
mybatis:
mapper-locations: classpath:mapper/*.xml
type-aliases-package: com.sunyo.wlpt.dispatch.domain
# 日志打印
logging:
config: config/logback-dev.xml
logback:
appname: dispatch-system
logdir: ./log
#eureka client
eureka:
instance:
#eureka\u670D\u52A1\u5668\u9875\u9762\u4E2Dstatus\u7684\u8BF7\u6C42\u8DEF\u5F84
status-page-url: http://${eureka.instance.hostname}:${server.port}/index
prefer-ip-address: true
instance-id: ${spring.cloud.client.ip-address}:${server.port}
hostname: ${spring.cloud.client.ip-address}
client:
healthcheck:
enabled: true
service-url:
defaultZone: http://192.168.1.53:12345/eureka/
# defaultZone: http://localhost:12345/eureka/
feign:
hystrix:
enabled: true
# boot admin
management:
endpoints:
enabled-by-default: true
web:
exposure:
include: ["*"]
endpoint:
health:
show-details: always
shutdown:
enabled: true
... ...
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.sunyo.wlpt.dispatch.mapper.CompanyInfoMapper">
<resultMap id="BaseResultMap" type="com.sunyo.wlpt.dispatch.domain.CompanyInfo">
<!--@mbg.generated-->
<!--@Table company_info-->
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="company_name" jdbcType="VARCHAR" property="companyName" />
<result column="company_address" jdbcType="VARCHAR" property="companyAddress" />
<result column="company_mobile" jdbcType="VARCHAR" property="companyMobile" />
<result column="company_id" jdbcType="VARCHAR" property="companyId" />
<result column="company_representative" jdbcType="VARCHAR" property="companyRepresentative" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, company_name, company_address, company_mobile, company_id, company_representative
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
<!--@mbg.generated-->
select
<include refid="Base_Column_List" />
from company_info
where id = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
<!--@mbg.generated-->
delete from company_info
where id = #{id,jdbcType=VARCHAR}
</delete>
<insert id="insert" parameterType="com.sunyo.wlpt.dispatch.domain.CompanyInfo">
<!--@mbg.generated-->
insert into company_info (id, company_name, company_address,
company_mobile, company_id, company_representative
)
values (#{id,jdbcType=VARCHAR}, #{companyName,jdbcType=VARCHAR}, #{companyAddress,jdbcType=VARCHAR},
#{companyMobile,jdbcType=VARCHAR}, #{companyId,jdbcType=VARCHAR}, #{companyRepresentative,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.sunyo.wlpt.dispatch.domain.CompanyInfo">
<!--@mbg.generated-->
insert into company_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="companyName != null">
company_name,
</if>
<if test="companyAddress != null">
company_address,
</if>
<if test="companyMobile != null">
company_mobile,
</if>
<if test="companyId != null">
company_id,
</if>
<if test="companyRepresentative != null">
company_representative,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="companyName != null">
#{companyName,jdbcType=VARCHAR},
</if>
<if test="companyAddress != null">
#{companyAddress,jdbcType=VARCHAR},
</if>
<if test="companyMobile != null">
#{companyMobile,jdbcType=VARCHAR},
</if>
<if test="companyId != null">
#{companyId,jdbcType=VARCHAR},
</if>
<if test="companyRepresentative != null">
#{companyRepresentative,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.sunyo.wlpt.dispatch.domain.CompanyInfo">
<!--@mbg.generated-->
update company_info
<set>
<if test="companyName != null">
company_name = #{companyName,jdbcType=VARCHAR},
</if>
<if test="companyAddress != null">
company_address = #{companyAddress,jdbcType=VARCHAR},
</if>
<if test="companyMobile != null">
company_mobile = #{companyMobile,jdbcType=VARCHAR},
</if>
<if test="companyId != null">
company_id = #{companyId,jdbcType=VARCHAR},
</if>
<if test="companyRepresentative != null">
company_representative = #{companyRepresentative,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.sunyo.wlpt.dispatch.domain.CompanyInfo">
<!--@mbg.generated-->
update company_info
set company_name = #{companyName,jdbcType=VARCHAR},
company_address = #{companyAddress,jdbcType=VARCHAR},
company_mobile = #{companyMobile,jdbcType=VARCHAR},
company_id = #{companyId,jdbcType=VARCHAR},
company_representative = #{companyRepresentative,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateBatch" parameterType="java.util.List">
<!--@mbg.generated-->
update company_info
<trim prefix="set" suffixOverrides=",">
<trim prefix="company_name = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=VARCHAR} then #{item.companyName,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="company_address = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=VARCHAR} then #{item.companyAddress,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="company_mobile = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=VARCHAR} then #{item.companyMobile,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="company_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=VARCHAR} then #{item.companyId,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="company_representative = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=VARCHAR} then #{item.companyRepresentative,jdbcType=VARCHAR}
</foreach>
</trim>
</trim>
where id in
<foreach close=")" collection="list" item="item" open="(" separator=", ">
#{item.id,jdbcType=VARCHAR}
</foreach>
</update>
<update id="updateBatchSelective" parameterType="java.util.List">
<!--@mbg.generated-->
update company_info
<trim prefix="set" suffixOverrides=",">
<trim prefix="company_name = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.companyName != null">
when id = #{item.id,jdbcType=VARCHAR} then #{item.companyName,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="company_address = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.companyAddress != null">
when id = #{item.id,jdbcType=VARCHAR} then #{item.companyAddress,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="company_mobile = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.companyMobile != null">
when id = #{item.id,jdbcType=VARCHAR} then #{item.companyMobile,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="company_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.companyId != null">
when id = #{item.id,jdbcType=VARCHAR} then #{item.companyId,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="company_representative = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.companyRepresentative != null">
when id = #{item.id,jdbcType=VARCHAR} then #{item.companyRepresentative,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
</trim>
where id in
<foreach close=")" collection="list" item="item" open="(" separator=", ">
#{item.id,jdbcType=VARCHAR}
</foreach>
</update>
<insert id="batchInsert" parameterType="map">
<!--@mbg.generated-->
insert into company_info
(id, company_name, company_address, company_mobile, company_id, company_representative
)
values
<foreach collection="list" item="item" separator=",">
(#{item.id,jdbcType=VARCHAR}, #{item.companyName,jdbcType=VARCHAR}, #{item.companyAddress,jdbcType=VARCHAR},
#{item.companyMobile,jdbcType=VARCHAR}, #{item.companyId,jdbcType=VARCHAR}, #{item.companyRepresentative,jdbcType=VARCHAR}
)
</foreach>
</insert>
<insert id="insertOrUpdate" parameterType="com.sunyo.wlpt.dispatch.domain.CompanyInfo">
<!--@mbg.generated-->
insert into company_info
(id, company_name, company_address, company_mobile, company_id, company_representative
)
values
(#{id,jdbcType=VARCHAR}, #{companyName,jdbcType=VARCHAR}, #{companyAddress,jdbcType=VARCHAR},
#{companyMobile,jdbcType=VARCHAR}, #{companyId,jdbcType=VARCHAR}, #{companyRepresentative,jdbcType=VARCHAR}
)
on duplicate key update
id = #{id,jdbcType=VARCHAR},
company_name = #{companyName,jdbcType=VARCHAR},
company_address = #{companyAddress,jdbcType=VARCHAR},
company_mobile = #{companyMobile,jdbcType=VARCHAR},
company_id = #{companyId,jdbcType=VARCHAR},
company_representative = #{companyRepresentative,jdbcType=VARCHAR}
</insert>
<insert id="insertOrUpdateSelective" parameterType="com.sunyo.wlpt.dispatch.domain.CompanyInfo">
<!--@mbg.generated-->
insert into company_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="companyName != null">
company_name,
</if>
<if test="companyAddress != null">
company_address,
</if>
<if test="companyMobile != null">
company_mobile,
</if>
<if test="companyId != null">
company_id,
</if>
<if test="companyRepresentative != null">
company_representative,
</if>
</trim>
values
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="companyName != null">
#{companyName,jdbcType=VARCHAR},
</if>
<if test="companyAddress != null">
#{companyAddress,jdbcType=VARCHAR},
</if>
<if test="companyMobile != null">
#{companyMobile,jdbcType=VARCHAR},
</if>
<if test="companyId != null">
#{companyId,jdbcType=VARCHAR},
</if>
<if test="companyRepresentative != null">
#{companyRepresentative,jdbcType=VARCHAR},
</if>
</trim>
on duplicate key update
<trim suffixOverrides=",">
<if test="id != null">
id = #{id,jdbcType=VARCHAR},
</if>
<if test="companyName != null">
company_name = #{companyName,jdbcType=VARCHAR},
</if>
<if test="companyAddress != null">
company_address = #{companyAddress,jdbcType=VARCHAR},
</if>
<if test="companyMobile != null">
company_mobile = #{companyMobile,jdbcType=VARCHAR},
</if>
<if test="companyId != null">
company_id = #{companyId,jdbcType=VARCHAR},
</if>
<if test="companyRepresentative != null">
company_representative = #{companyRepresentative,jdbcType=VARCHAR},
</if>
</trim>
</insert>
</mapper>
\ No newline at end of file
... ...
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.sunyo.wlpt.dispatch.mapper.DispatchBusinessMapper">
<resultMap id="BaseResultMap" type="com.sunyo.wlpt.dispatch.domain.DispatchBusiness">
<!--@mbg.generated-->
<!--@Table dispatch_business-->
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="dispatch_type" jdbcType="VARCHAR" property="dispatchType" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, dispatch_type
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
<!--@mbg.generated-->
select
<include refid="Base_Column_List" />
from dispatch_business
where id = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
<!--@mbg.generated-->
delete from dispatch_business
where id = #{id,jdbcType=VARCHAR}
</delete>
<insert id="insert" parameterType="com.sunyo.wlpt.dispatch.domain.DispatchBusiness">
<!--@mbg.generated-->
insert into dispatch_business (id, dispatch_type)
values (#{id,jdbcType=VARCHAR}, #{dispatchType,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.sunyo.wlpt.dispatch.domain.DispatchBusiness">
<!--@mbg.generated-->
insert into dispatch_business
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="dispatchType != null">
dispatch_type,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="dispatchType != null">
#{dispatchType,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.sunyo.wlpt.dispatch.domain.DispatchBusiness">
<!--@mbg.generated-->
update dispatch_business
<set>
<if test="dispatchType != null">
dispatch_type = #{dispatchType,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.sunyo.wlpt.dispatch.domain.DispatchBusiness">
<!--@mbg.generated-->
update dispatch_business
set dispatch_type = #{dispatchType,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateBatch" parameterType="java.util.List">
<!--@mbg.generated-->
update dispatch_business
<trim prefix="set" suffixOverrides=",">
<trim prefix="dispatch_type = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=VARCHAR} then #{item.dispatchType,jdbcType=VARCHAR}
</foreach>
</trim>
</trim>
where id in
<foreach close=")" collection="list" item="item" open="(" separator=", ">
#{item.id,jdbcType=VARCHAR}
</foreach>
</update>
<update id="updateBatchSelective" parameterType="java.util.List">
<!--@mbg.generated-->
update dispatch_business
<trim prefix="set" suffixOverrides=",">
<trim prefix="dispatch_type = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.dispatchType != null">
when id = #{item.id,jdbcType=VARCHAR} then #{item.dispatchType,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
</trim>
where id in
<foreach close=")" collection="list" item="item" open="(" separator=", ">
#{item.id,jdbcType=VARCHAR}
</foreach>
</update>
<insert id="batchInsert" parameterType="map">
<!--@mbg.generated-->
insert into dispatch_business
(id, dispatch_type)
values
<foreach collection="list" item="item" separator=",">
(#{item.id,jdbcType=VARCHAR}, #{item.dispatchType,jdbcType=VARCHAR})
</foreach>
</insert>
<insert id="insertOrUpdate" parameterType="com.sunyo.wlpt.dispatch.domain.DispatchBusiness">
<!--@mbg.generated-->
insert into dispatch_business
(id, dispatch_type)
values
(#{id,jdbcType=VARCHAR}, #{dispatchType,jdbcType=VARCHAR})
on duplicate key update
id = #{id,jdbcType=VARCHAR},
dispatch_type = #{dispatchType,jdbcType=VARCHAR}
</insert>
<insert id="insertOrUpdateSelective" parameterType="com.sunyo.wlpt.dispatch.domain.DispatchBusiness">
<!--@mbg.generated-->
insert into dispatch_business
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="dispatchType != null">
dispatch_type,
</if>
</trim>
values
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="dispatchType != null">
#{dispatchType,jdbcType=VARCHAR},
</if>
</trim>
on duplicate key update
<trim suffixOverrides=",">
<if test="id != null">
id = #{id,jdbcType=VARCHAR},
</if>
<if test="dispatchType != null">
dispatch_type = #{dispatchType,jdbcType=VARCHAR},
</if>
</trim>
</insert>
</mapper>
\ No newline at end of file
... ...
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.sunyo.wlpt.dispatch.mapper.DispatchNoteMapper">
<resultMap id="BaseResultMap" type="com.sunyo.wlpt.dispatch.domain.DispatchNote">
<!--@mbg.generated-->
<!--@Table dispatch_note-->
<id column="id" jdbcType="VARCHAR" property="id"/>
<result column="user_name" jdbcType="VARCHAR" property="userName"/>
<result column="user_mobile" jdbcType="VARCHAR" property="userMobile"/>
<result column="vehicle_number" jdbcType="INTEGER" property="vehicleNumber"/>
<result column="vehicle_type" jdbcType="VARCHAR" property="vehicleType"/>
<result column="license_plate_number" jdbcType="VARCHAR" property="licensePlateNumber"/>
<result column="driver_name" jdbcType="VARCHAR" property="driverName"/>
<result column="driver_mobile" jdbcType="VARCHAR" property="driverMobile"/>
<result column="dispatch_type" jdbcType="VARCHAR" property="dispatchType"/>
<result column="station" jdbcType="VARCHAR" property="station"/>
<result column="status" jdbcType="VARCHAR" property="status"/>
<result column="gmt_create" jdbcType="TIMESTAMP" property="gmtCreate"/>
<result column="gmt_modified" jdbcType="TIMESTAMP" property="gmtModified"/>
<result column="begin_time" jdbcType="TIMESTAMP" property="beginTime"/>
<result column="end_time" jdbcType="TIMESTAMP" property="endTime"/>
<result column="operation" jdbcType="VARCHAR" property="operation"/>
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, user_name, user_mobile, vehicle_number, vehicle_type, license_plate_number, driver_name,
driver_mobile, dispatch_type, station, `status`, gmt_create, gmt_modified, begin_time,
end_time, `operation`
</sql>
<!-- 获取调度记录列表 -->
<select id="selectVehicleInfoList" parameterType="com.sunyo.wlpt.dispatch.domain.DispatchNote"
resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from dispatch_note
<where>
<trim suffixOverrides=",">
<!-- 用户姓名 -->
<if test="userName != null and userName != ''">
user_name = #{userName,jdbcType=VARCHAR},
</if>
<!-- 用户联系方式 -->
<if test="userMobile != null and userMobile != ''">
AND user_mobile = #{userMobile,jdbcType=VARCHAR},
</if>
<!-- 业务类型 -->
<if test="dispatchType != null and dispatchType != ''">
AND dispatch_type = #{dispatchType,jdbcType=VARCHAR},
</if>
<!-- 记录表状态 -->
<if test="status != null and status != ''">
AND status = #{status,jdbcType=VARCHAR},
</if>
<!-- 任务创建时间 -->
<if test="gmtCreate != null">
AND DATE_FORMAT(gmt_create,'%Y-%m-%d') = #{gmtCreate,jdbcType=TIMESTAMP},
</if>
<!-- 任务(结束)完成时间 -->
<if test="endTime != null">
AND DATE_FORMAT(end_time,'%Y-%m-%d') = #{endTime,jdbcType=TIMESTAMP}
</if>
</trim>
</where>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
<!--@mbg.generated-->
select
<include refid="Base_Column_List"/>
from dispatch_note
where id = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
<!--@mbg.generated-->
delete from dispatch_note
where id = #{id,jdbcType=VARCHAR}
</delete>
<insert id="insert" parameterType="com.sunyo.wlpt.dispatch.domain.DispatchNote">
<!--@mbg.generated-->
insert into dispatch_note (id, user_name, user_mobile,
vehicle_number, vehicle_type, license_plate_number,
driver_name, driver_mobile, dispatch_type,
station, `status`, gmt_create,
gmt_modified, begin_time, end_time,
`operation`)
values (#{id,jdbcType=VARCHAR}, #{userName,jdbcType=VARCHAR}, #{userMobile,jdbcType=VARCHAR},
#{vehicleNumber,jdbcType=INTEGER}, #{vehicleType,jdbcType=VARCHAR}, #{licensePlateNumber,jdbcType=VARCHAR},
#{driverName,jdbcType=VARCHAR}, #{driverMobile,jdbcType=VARCHAR}, #{dispatchType,jdbcType=VARCHAR},
#{station,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{gmtCreate,jdbcType=TIMESTAMP},
#{gmtModified,jdbcType=TIMESTAMP}, #{beginTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP},
#{operation,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.sunyo.wlpt.dispatch.domain.DispatchNote">
<!--@mbg.generated-->
insert into dispatch_note
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="userName != null">
user_name,
</if>
<if test="userMobile != null">
user_mobile,
</if>
<if test="vehicleNumber != null">
vehicle_number,
</if>
<if test="vehicleType != null">
vehicle_type,
</if>
<if test="licensePlateNumber != null">
license_plate_number,
</if>
<if test="driverName != null">
driver_name,
</if>
<if test="driverMobile != null">
driver_mobile,
</if>
<if test="dispatchType != null">
dispatch_type,
</if>
<if test="station != null">
station,
</if>
<if test="status != null">
`status`,
</if>
<if test="gmtCreate != null">
gmt_create,
</if>
<if test="gmtModified != null">
gmt_modified,
</if>
<if test="beginTime != null">
begin_time,
</if>
<if test="endTime != null">
end_time,
</if>
<if test="operation != null">
`operation`,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="userName != null">
#{userName,jdbcType=VARCHAR},
</if>
<if test="userMobile != null">
#{userMobile,jdbcType=VARCHAR},
</if>
<if test="vehicleNumber != null">
#{vehicleNumber,jdbcType=INTEGER},
</if>
<if test="vehicleType != null">
#{vehicleType,jdbcType=VARCHAR},
</if>
<if test="licensePlateNumber != null">
#{licensePlateNumber,jdbcType=VARCHAR},
</if>
<if test="driverName != null">
#{driverName,jdbcType=VARCHAR},
</if>
<if test="driverMobile != null">
#{driverMobile,jdbcType=VARCHAR},
</if>
<if test="dispatchType != null">
#{dispatchType,jdbcType=VARCHAR},
</if>
<if test="station != null">
#{station,jdbcType=VARCHAR},
</if>
<if test="status != null">
#{status,jdbcType=VARCHAR},
</if>
<if test="gmtCreate != null">
#{gmtCreate,jdbcType=TIMESTAMP},
</if>
<if test="gmtModified != null">
#{gmtModified,jdbcType=TIMESTAMP},
</if>
<if test="beginTime != null">
#{beginTime,jdbcType=TIMESTAMP},
</if>
<if test="endTime != null">
#{endTime,jdbcType=TIMESTAMP},
</if>
<if test="operation != null">
#{operation,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.sunyo.wlpt.dispatch.domain.DispatchNote">
<!--@mbg.generated-->
update dispatch_note
<set>
<if test="userName != null">
user_name = #{userName,jdbcType=VARCHAR},
</if>
<if test="userMobile != null">
user_mobile = #{userMobile,jdbcType=VARCHAR},
</if>
<if test="vehicleNumber != null">
vehicle_number = #{vehicleNumber,jdbcType=INTEGER},
</if>
<if test="vehicleType != null">
vehicle_type = #{vehicleType,jdbcType=VARCHAR},
</if>
<if test="licensePlateNumber != null">
license_plate_number = #{licensePlateNumber,jdbcType=VARCHAR},
</if>
<if test="driverName != null">
driver_name = #{driverName,jdbcType=VARCHAR},
</if>
<if test="driverMobile != null">
driver_mobile = #{driverMobile,jdbcType=VARCHAR},
</if>
<if test="dispatchType != null">
dispatch_type = #{dispatchType,jdbcType=VARCHAR},
</if>
<if test="station != null">
station = #{station,jdbcType=VARCHAR},
</if>
<if test="status != null">
`status` = #{status,jdbcType=VARCHAR},
</if>
<if test="gmtCreate != null">
gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
</if>
<if test="gmtModified != null">
gmt_modified = #{gmtModified,jdbcType=TIMESTAMP},
</if>
<if test="beginTime != null">
begin_time = #{beginTime,jdbcType=TIMESTAMP},
</if>
<if test="endTime != null">
end_time = #{endTime,jdbcType=TIMESTAMP},
</if>
<if test="operation != null">
`operation` = #{operation,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.sunyo.wlpt.dispatch.domain.DispatchNote">
<!--@mbg.generated-->
update dispatch_note
set user_name = #{userName,jdbcType=VARCHAR},
user_mobile = #{userMobile,jdbcType=VARCHAR},
vehicle_number = #{vehicleNumber,jdbcType=INTEGER},
vehicle_type = #{vehicleType,jdbcType=VARCHAR},
license_plate_number = #{licensePlateNumber,jdbcType=VARCHAR},
driver_name = #{driverName,jdbcType=VARCHAR},
driver_mobile = #{driverMobile,jdbcType=VARCHAR},
dispatch_type = #{dispatchType,jdbcType=VARCHAR},
station = #{station,jdbcType=VARCHAR},
`status` = #{status,jdbcType=VARCHAR},
gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
gmt_modified = #{gmtModified,jdbcType=TIMESTAMP},
begin_time = #{beginTime,jdbcType=TIMESTAMP},
end_time = #{endTime,jdbcType=TIMESTAMP},
`operation` = #{operation,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateBatch" parameterType="java.util.List">
<!--@mbg.generated-->
update dispatch_note
<trim prefix="set" suffixOverrides=",">
<trim prefix="user_name = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=VARCHAR} then #{item.userName,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="user_mobile = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=VARCHAR} then #{item.userMobile,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="vehicle_number = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=VARCHAR} then #{item.vehicleNumber,jdbcType=INTEGER}
</foreach>
</trim>
<trim prefix="vehicle_type = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=VARCHAR} then #{item.vehicleType,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="license_plate_number = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=VARCHAR} then #{item.licensePlateNumber,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="driver_name = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=VARCHAR} then #{item.driverName,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="driver_mobile = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=VARCHAR} then #{item.driverMobile,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="dispatch_type = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=VARCHAR} then #{item.dispatchType,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="station = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=VARCHAR} then #{item.station,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="`status` = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=VARCHAR} then #{item.status,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="gmt_create = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=VARCHAR} then #{item.gmtCreate,jdbcType=TIMESTAMP}
</foreach>
</trim>
<trim prefix="gmt_modified = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=VARCHAR} then #{item.gmtModified,jdbcType=TIMESTAMP}
</foreach>
</trim>
<trim prefix="begin_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=VARCHAR} then #{item.beginTime,jdbcType=TIMESTAMP}
</foreach>
</trim>
<trim prefix="end_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=VARCHAR} then #{item.endTime,jdbcType=TIMESTAMP}
</foreach>
</trim>
<trim prefix="`operation` = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=VARCHAR} then #{item.operation,jdbcType=VARCHAR}
</foreach>
</trim>
</trim>
where id in
<foreach close=")" collection="list" item="item" open="(" separator=", ">
#{item.id,jdbcType=VARCHAR}
</foreach>
</update>
<update id="updateBatchSelective" parameterType="java.util.List">
<!--@mbg.generated-->
update dispatch_note
<trim prefix="set" suffixOverrides=",">
<trim prefix="user_name = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.userName != null">
when id = #{item.id,jdbcType=VARCHAR} then #{item.userName,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="user_mobile = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.userMobile != null">
when id = #{item.id,jdbcType=VARCHAR} then #{item.userMobile,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="vehicle_number = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.vehicleNumber != null">
when id = #{item.id,jdbcType=VARCHAR} then #{item.vehicleNumber,jdbcType=INTEGER}
</if>
</foreach>
</trim>
<trim prefix="vehicle_type = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.vehicleType != null">
when id = #{item.id,jdbcType=VARCHAR} then #{item.vehicleType,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="license_plate_number = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.licensePlateNumber != null">
when id = #{item.id,jdbcType=VARCHAR} then #{item.licensePlateNumber,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="driver_name = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.driverName != null">
when id = #{item.id,jdbcType=VARCHAR} then #{item.driverName,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="driver_mobile = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.driverMobile != null">
when id = #{item.id,jdbcType=VARCHAR} then #{item.driverMobile,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="dispatch_type = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.dispatchType != null">
when id = #{item.id,jdbcType=VARCHAR} then #{item.dispatchType,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="station = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.station != null">
when id = #{item.id,jdbcType=VARCHAR} then #{item.station,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="`status` = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.status != null">
when id = #{item.id,jdbcType=VARCHAR} then #{item.status,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="gmt_create = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.gmtCreate != null">
when id = #{item.id,jdbcType=VARCHAR} then #{item.gmtCreate,jdbcType=TIMESTAMP}
</if>
</foreach>
</trim>
<trim prefix="gmt_modified = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.gmtModified != null">
when id = #{item.id,jdbcType=VARCHAR} then #{item.gmtModified,jdbcType=TIMESTAMP}
</if>
</foreach>
</trim>
<trim prefix="begin_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.beginTime != null">
when id = #{item.id,jdbcType=VARCHAR} then #{item.beginTime,jdbcType=TIMESTAMP}
</if>
</foreach>
</trim>
<trim prefix="end_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.endTime != null">
when id = #{item.id,jdbcType=VARCHAR} then #{item.endTime,jdbcType=TIMESTAMP}
</if>
</foreach>
</trim>
<trim prefix="`operation` = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.operation != null">
when id = #{item.id,jdbcType=VARCHAR} then #{item.operation,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
</trim>
where id in
<foreach close=")" collection="list" item="item" open="(" separator=", ">
#{item.id,jdbcType=VARCHAR}
</foreach>
</update>
<insert id="batchInsert" parameterType="map">
<!--@mbg.generated-->
insert into dispatch_note
(id, user_name, user_mobile, vehicle_number, vehicle_type, license_plate_number,
driver_name, driver_mobile, dispatch_type, station, `status`, gmt_create, gmt_modified,
begin_time, end_time, `operation`)
values
<foreach collection="list" item="item" separator=",">
(#{item.id,jdbcType=VARCHAR}, #{item.userName,jdbcType=VARCHAR}, #{item.userMobile,jdbcType=VARCHAR},
#{item.vehicleNumber,jdbcType=INTEGER}, #{item.vehicleType,jdbcType=VARCHAR},
#{item.licensePlateNumber,jdbcType=VARCHAR},
#{item.driverName,jdbcType=VARCHAR}, #{item.driverMobile,jdbcType=VARCHAR},
#{item.dispatchType,jdbcType=VARCHAR},
#{item.station,jdbcType=VARCHAR}, #{item.status,jdbcType=VARCHAR}, #{item.gmtCreate,jdbcType=TIMESTAMP},
#{item.gmtModified,jdbcType=TIMESTAMP}, #{item.beginTime,jdbcType=TIMESTAMP},
#{item.endTime,jdbcType=TIMESTAMP},
#{item.operation,jdbcType=VARCHAR})
</foreach>
</insert>
<insert id="insertOrUpdate" parameterType="com.sunyo.wlpt.dispatch.domain.DispatchNote">
<!--@mbg.generated-->
insert into dispatch_note
(id, user_name, user_mobile, vehicle_number, vehicle_type, license_plate_number,
driver_name, driver_mobile, dispatch_type, station, `status`, gmt_create, gmt_modified,
begin_time, end_time, `operation`)
values
(#{id,jdbcType=VARCHAR}, #{userName,jdbcType=VARCHAR}, #{userMobile,jdbcType=VARCHAR},
#{vehicleNumber,jdbcType=INTEGER}, #{vehicleType,jdbcType=VARCHAR}, #{licensePlateNumber,jdbcType=VARCHAR},
#{driverName,jdbcType=VARCHAR}, #{driverMobile,jdbcType=VARCHAR}, #{dispatchType,jdbcType=VARCHAR},
#{station,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{gmtCreate,jdbcType=TIMESTAMP},
#{gmtModified,jdbcType=TIMESTAMP}, #{beginTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP},
#{operation,jdbcType=VARCHAR})
on duplicate key update
id = #{id,jdbcType=VARCHAR},
user_name = #{userName,jdbcType=VARCHAR},
user_mobile = #{userMobile,jdbcType=VARCHAR},
vehicle_number = #{vehicleNumber,jdbcType=INTEGER},
vehicle_type = #{vehicleType,jdbcType=VARCHAR},
license_plate_number = #{licensePlateNumber,jdbcType=VARCHAR},
driver_name = #{driverName,jdbcType=VARCHAR},
driver_mobile = #{driverMobile,jdbcType=VARCHAR},
dispatch_type = #{dispatchType,jdbcType=VARCHAR},
station = #{station,jdbcType=VARCHAR},
`status` = #{status,jdbcType=VARCHAR},
gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
gmt_modified = #{gmtModified,jdbcType=TIMESTAMP},
begin_time = #{beginTime,jdbcType=TIMESTAMP},
end_time = #{endTime,jdbcType=TIMESTAMP},
`operation` = #{operation,jdbcType=VARCHAR}
</insert>
<insert id="insertOrUpdateSelective" parameterType="com.sunyo.wlpt.dispatch.domain.DispatchNote">
<!--@mbg.generated-->
insert into dispatch_note
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="userName != null">
user_name,
</if>
<if test="userMobile != null">
user_mobile,
</if>
<if test="vehicleNumber != null">
vehicle_number,
</if>
<if test="vehicleType != null">
vehicle_type,
</if>
<if test="licensePlateNumber != null">
license_plate_number,
</if>
<if test="driverName != null">
driver_name,
</if>
<if test="driverMobile != null">
driver_mobile,
</if>
<if test="dispatchType != null">
dispatch_type,
</if>
<if test="station != null">
station,
</if>
<if test="status != null">
`status`,
</if>
<if test="gmtCreate != null">
gmt_create,
</if>
<if test="gmtModified != null">
gmt_modified,
</if>
<if test="beginTime != null">
begin_time,
</if>
<if test="endTime != null">
end_time,
</if>
<if test="operation != null">
`operation`,
</if>
</trim>
values
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="userName != null">
#{userName,jdbcType=VARCHAR},
</if>
<if test="userMobile != null">
#{userMobile,jdbcType=VARCHAR},
</if>
<if test="vehicleNumber != null">
#{vehicleNumber,jdbcType=INTEGER},
</if>
<if test="vehicleType != null">
#{vehicleType,jdbcType=VARCHAR},
</if>
<if test="licensePlateNumber != null">
#{licensePlateNumber,jdbcType=VARCHAR},
</if>
<if test="driverName != null">
#{driverName,jdbcType=VARCHAR},
</if>
<if test="driverMobile != null">
#{driverMobile,jdbcType=VARCHAR},
</if>
<if test="dispatchType != null">
#{dispatchType,jdbcType=VARCHAR},
</if>
<if test="station != null">
#{station,jdbcType=VARCHAR},
</if>
<if test="status != null">
#{status,jdbcType=VARCHAR},
</if>
<if test="gmtCreate != null">
#{gmtCreate,jdbcType=TIMESTAMP},
</if>
<if test="gmtModified != null">
#{gmtModified,jdbcType=TIMESTAMP},
</if>
<if test="beginTime != null">
#{beginTime,jdbcType=TIMESTAMP},
</if>
<if test="endTime != null">
#{endTime,jdbcType=TIMESTAMP},
</if>
<if test="operation != null">
#{operation,jdbcType=VARCHAR},
</if>
</trim>
on duplicate key update
<trim suffixOverrides=",">
<if test="id != null">
id = #{id,jdbcType=VARCHAR},
</if>
<if test="userName != null">
user_name = #{userName,jdbcType=VARCHAR},
</if>
<if test="userMobile != null">
user_mobile = #{userMobile,jdbcType=VARCHAR},
</if>
<if test="vehicleNumber != null">
vehicle_number = #{vehicleNumber,jdbcType=INTEGER},
</if>
<if test="vehicleType != null">
vehicle_type = #{vehicleType,jdbcType=VARCHAR},
</if>
<if test="licensePlateNumber != null">
license_plate_number = #{licensePlateNumber,jdbcType=VARCHAR},
</if>
<if test="driverName != null">
driver_name = #{driverName,jdbcType=VARCHAR},
</if>
<if test="driverMobile != null">
driver_mobile = #{driverMobile,jdbcType=VARCHAR},
</if>
<if test="dispatchType != null">
dispatch_type = #{dispatchType,jdbcType=VARCHAR},
</if>
<if test="station != null">
station = #{station,jdbcType=VARCHAR},
</if>
<if test="status != null">
`status` = #{status,jdbcType=VARCHAR},
</if>
<if test="gmtCreate != null">
gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
</if>
<if test="gmtModified != null">
gmt_modified = #{gmtModified,jdbcType=TIMESTAMP},
</if>
<if test="beginTime != null">
begin_time = #{beginTime,jdbcType=TIMESTAMP},
</if>
<if test="endTime != null">
end_time = #{endTime,jdbcType=TIMESTAMP},
</if>
<if test="operation != null">
`operation` = #{operation,jdbcType=VARCHAR},
</if>
</trim>
</insert>
</mapper>
... ...