Browse Source

新建选矿项目

recovery
zy_Java 5 years ago
parent
commit
d7b7274ab0
  1. 33
      beneficiation/.gitignore
  2. 322
      beneficiation/mvnw
  3. 182
      beneficiation/mvnw.cmd
  4. 72
      beneficiation/pom.xml
  5. 27
      beneficiation/src/main/java/com/ccsens/beneficiation/BeneficiationApplication.java
  6. 30
      beneficiation/src/main/java/com/ccsens/beneficiation/api/DebugController.java
  7. 52
      beneficiation/src/main/java/com/ccsens/beneficiation/api/WeightController.java
  8. 66
      beneficiation/src/main/java/com/ccsens/beneficiation/bean/dto/Message/BaseMessageDto.java
  9. 63
      beneficiation/src/main/java/com/ccsens/beneficiation/bean/dto/Message/BeneficiationMessageDto.java
  10. 52
      beneficiation/src/main/java/com/ccsens/beneficiation/bean/dto/WeightDto.java
  11. 150
      beneficiation/src/main/java/com/ccsens/beneficiation/bean/po/AdjustRecord.java
  12. 951
      beneficiation/src/main/java/com/ccsens/beneficiation/bean/po/AdjustRecordExample.java
  13. 117
      beneficiation/src/main/java/com/ccsens/beneficiation/bean/po/Equipment.java
  14. 771
      beneficiation/src/main/java/com/ccsens/beneficiation/bean/po/EquipmentExample.java
  15. 106
      beneficiation/src/main/java/com/ccsens/beneficiation/bean/po/Record.java
  16. 691
      beneficiation/src/main/java/com/ccsens/beneficiation/bean/po/RecordExample.java
  17. 117
      beneficiation/src/main/java/com/ccsens/beneficiation/bean/po/ThresholdValue.java
  18. 741
      beneficiation/src/main/java/com/ccsens/beneficiation/bean/po/ThresholdValueExample.java
  19. 106
      beneficiation/src/main/java/com/ccsens/beneficiation/bean/po/Weight.java
  20. 691
      beneficiation/src/main/java/com/ccsens/beneficiation/bean/po/WeightExample.java
  21. 37
      beneficiation/src/main/java/com/ccsens/beneficiation/bean/vo/WeightVo.java
  22. 31
      beneficiation/src/main/java/com/ccsens/beneficiation/config/BeanConfig.java
  23. 169
      beneficiation/src/main/java/com/ccsens/beneficiation/config/SpringConfig.java
  24. 56
      beneficiation/src/main/java/com/ccsens/beneficiation/config/SwaggerConfigure.java
  25. 159
      beneficiation/src/main/java/com/ccsens/beneficiation/intercept/MybatisInterceptor.java
  26. 12
      beneficiation/src/main/java/com/ccsens/beneficiation/persist/dao/RecordDao.java
  27. 30
      beneficiation/src/main/java/com/ccsens/beneficiation/persist/dao/WeightDao.java
  28. 30
      beneficiation/src/main/java/com/ccsens/beneficiation/persist/mapper/AdjustRecordMapper.java
  29. 30
      beneficiation/src/main/java/com/ccsens/beneficiation/persist/mapper/EquipmentMapper.java
  30. 30
      beneficiation/src/main/java/com/ccsens/beneficiation/persist/mapper/RecordMapper.java
  31. 30
      beneficiation/src/main/java/com/ccsens/beneficiation/persist/mapper/ThresholdValueMapper.java
  32. 30
      beneficiation/src/main/java/com/ccsens/beneficiation/persist/mapper/WeightMapper.java
  33. 60
      beneficiation/src/main/java/com/ccsens/beneficiation/rabbitMQ/RabbitController.java
  34. 10
      beneficiation/src/main/java/com/ccsens/beneficiation/service/IRecordService.java
  35. 25
      beneficiation/src/main/java/com/ccsens/beneficiation/service/IWeightService.java
  36. 128
      beneficiation/src/main/java/com/ccsens/beneficiation/service/RecordService.java
  37. 33
      beneficiation/src/main/java/com/ccsens/beneficiation/service/WeightService.java
  38. 30
      beneficiation/src/main/resources/application-common.yml
  39. 37
      beneficiation/src/main/resources/application-dev.yml
  40. 40
      beneficiation/src/main/resources/application-prod.yml
  41. 36
      beneficiation/src/main/resources/application-test.yml
  42. 6
      beneficiation/src/main/resources/application.yml
  43. 36
      beneficiation/src/main/resources/druid-dev.yml
  44. 33
      beneficiation/src/main/resources/druid-prod.yml
  45. 33
      beneficiation/src/main/resources/druid-test.yml
  46. 196
      beneficiation/src/main/resources/logback-spring.xml
  47. 19
      beneficiation/src/main/resources/mapper_dao/RecordDao.xml
  48. 73
      beneficiation/src/main/resources/mapper_dao/WeightDao.xml
  49. 323
      beneficiation/src/main/resources/mapper_raw/AdjustRecordMapper.xml
  50. 275
      beneficiation/src/main/resources/mapper_raw/EquipmentMapper.xml
  51. 258
      beneficiation/src/main/resources/mapper_raw/RecordMapper.xml
  52. 275
      beneficiation/src/main/resources/mapper_raw/ThresholdValueMapper.xml
  53. 258
      beneficiation/src/main/resources/mapper_raw/WeightMapper.xml
  54. 62
      beneficiation/src/main/resources/mybatis/mybatis-config.xml
  55. 3
      pom.xml
  56. 10
      tall/src/main/java/com/ccsens/tall/bean/dto/PluginDto.java
  57. 26
      tall/src/main/java/com/ccsens/tall/bean/vo/RoleVo.java
  58. 9
      tall/src/main/java/com/ccsens/tall/persist/dao/ProRoleDao.java
  59. 2
      tall/src/main/java/com/ccsens/tall/service/ExportWbsService.java
  60. 10
      tall/src/main/java/com/ccsens/tall/service/ITaskPluginService.java
  61. 15
      tall/src/main/java/com/ccsens/tall/service/ProMemberService.java
  62. 3
      tall/src/main/java/com/ccsens/tall/service/ProRoleService.java
  63. 5
      tall/src/main/java/com/ccsens/tall/service/ProTaskDetailService.java
  64. 11
      tall/src/main/java/com/ccsens/tall/service/TaskDeliverService.java
  65. 166
      tall/src/main/java/com/ccsens/tall/service/TaskPluginService.java
  66. 14
      tall/src/main/java/com/ccsens/tall/web/PluginController.java
  67. 4
      tall/src/main/resources/application-dev.yml
  68. 4
      tall/src/main/resources/application.yml
  69. 31
      tall/src/main/resources/mapper_dao/ProRoleDao.xml
  70. 1
      tall/src/main/resources/mapper_dao/SysProjectDao.xml
  71. 8
      tall/src/main/resources/mapper_dao/TaskDetailDao.xml
  72. 14
      util/src/main/java/com/ccsens/util/PoiUtil.java
  73. 3
      util/src/main/java/com/ccsens/util/SmsUtil.java
  74. 8
      util/src/main/java/com/ccsens/util/config/RabbitMQConfig.java
  75. 2
      wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/dto/Message/CarRecordMessageDto.java
  76. 4
      wisdomcar/src/main/resources/application.yml

33
beneficiation/.gitignore

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

322
beneficiation/mvnw

@ -0,0 +1,322 @@
#!/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 "$@"

182
beneficiation/mvnw.cmd

@ -0,0 +1,182 @@
@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%

72
beneficiation/pom.xml

@ -0,0 +1,72 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>ccsenscloud</artifactId>
<groupId>com.ccsens</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>beneficiation</artifactId>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<!--cloud 工具类-->
<dependency>
<artifactId>cloudutil</artifactId>
<groupId>com.ccsens</groupId>
<version>1.0-SNAPSHOT</version>
</dependency>
<!--util 工具类-->
<dependency>
<groupId>com.ccsens</groupId>
<artifactId>util</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-maven-plugin</artifactId>
<version>1.3.7</version>
<configuration>
<configurationFile>${basedir}/src/main/resources/mbg.xml</configurationFile>
<overwrite>true</overwrite>
</configuration>
<dependencies>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.34</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<mainClass>com.ccsens.beneficiation.BeneficiationApplication</mainClass>
<!--<skip>true</skip>-->
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

27
beneficiation/src/main/java/com/ccsens/beneficiation/BeneficiationApplication.java

@ -0,0 +1,27 @@
package com.ccsens.beneficiation;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.scheduling.annotation.EnableAsync;
/**
* @author
*/
@MapperScan(basePackages = {"com.ccsens.beneficiation.persist.*"})
@ServletComponentScan
@EnableAsync
//开启断路器功能
@EnableCircuitBreaker
@EnableFeignClients(basePackages = "com.ccsens.cloudutil.feign")
@SpringBootApplication(scanBasePackages = "com.ccsens")
public class BeneficiationApplication {
public static void main(String[] args) {
SpringApplication.run(BeneficiationApplication.class, args);
}
}

30
beneficiation/src/main/java/com/ccsens/beneficiation/api/DebugController.java

@ -0,0 +1,30 @@
package com.ccsens.beneficiation.api;
import com.ccsens.util.JsonResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
@Api(tags = "DEBUG" , description = "DebugController | ")
@RestController
@RequestMapping("/debug")
@Slf4j
public class DebugController {
@ApiOperation(value = "/测试",notes = "")
@ApiImplicitParams({
})
@RequestMapping(value="",method = RequestMethod.GET,produces = {"application/json;charset=UTF-8"})
public JsonResponse debug(HttpServletRequest request) throws Exception {
return JsonResponse.newInstance().ok("测试");
}
}

52
beneficiation/src/main/java/com/ccsens/beneficiation/api/WeightController.java

@ -0,0 +1,52 @@
package com.ccsens.beneficiation.api;
import com.ccsens.beneficiation.bean.dto.WeightDto;
import com.ccsens.beneficiation.bean.vo.WeightVo;
import com.ccsens.beneficiation.service.IWeightService;
import com.ccsens.cloudutil.annotation.MustLogin;
import com.ccsens.util.JsonResponse;
import com.ccsens.util.bean.dto.QueryDto;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
/**
* @author
*/
@Slf4j
@Api(tags = "皮带秤每天上传的重量统计相关" , description = "")
@RestController
@RequestMapping("/weight")
public class WeightController {
@Resource
private IWeightService weightService;
@MustLogin
@ApiOperation(value = "重量统计折线图", notes = "")
@RequestMapping(value = "/query", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<List<WeightVo.WeightDay>> queryWeight(@ApiParam @Validated @RequestBody QueryDto<WeightDto.GetWeightByDay> params) {
log.info("统计每天的重量:{}",params);
List<WeightVo.WeightDay> weightDay = weightService.queryWeightDay(params.getParam());
log.info("统计每天的重量成功");
return JsonResponse.newInstance().ok(weightDay);
}
@MustLogin
@ApiOperation(value = "重量累计表格", notes = "")
@RequestMapping(value = "/total", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<WeightVo.WeightTotal> queryWeightTotal(@ApiParam @Validated @RequestBody QueryDto<WeightDto.GetWeightTotal> params) {
log.info("重量累计表格:{}",params);
WeightVo.WeightTotal weightTotal = weightService.queryWeightTotal(params.getParam());
log.info("重量累计表格返回");
return JsonResponse.newInstance().ok(weightTotal);
}
}

66
beneficiation/src/main/java/com/ccsens/beneficiation/bean/dto/Message/BaseMessageDto.java

@ -0,0 +1,66 @@
package com.ccsens.beneficiation.bean.dto.Message;
import cn.hutool.core.collection.CollectionUtil;
import com.alibaba.fastjson.JSONObject;
import com.ccsens.util.bean.message.common.InMessage;
import lombok.Data;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
@Data
public class BaseMessageDto {
@Data
public static class MessageUser {
private Long id;
private Long userId; //本质上是authId //20190507 本质上是userId
private String nickname;
private String avatarUrl;
private boolean hasRead;
public MessageUser(){
hasRead = false;
}
public MessageUser(Long userId){
hasRead = false;
this.userId = userId;
}
public MessageUser(Long id,Long userId,String nickname,String avatarUrl){
this();
this.id = id;
this.userId = userId;
this.nickname = nickname;
this.avatarUrl = avatarUrl;
}
public static List<MessageUser> userIdToUsers(List<Long> userIds) {
List<MessageUser> users = new ArrayList<>();
userIds.forEach(userId ->{
users.add(new MessageUser(userId));
});
return users;
}
}
private Long time;
private String type;
private String event;
private Long projectId;
private MessageUser sender;
private List<MessageUser> receivers;
// private Object data;
public Set<String> receiversTransTos() {
Set<String> tos = new HashSet<>();
if (CollectionUtil.isEmpty(receivers)) {
return tos;
}
receivers.forEach(receiver -> {
InMessage.To to = new InMessage.To(receiver.getUserId());
tos.add(JSONObject.toJSONString(to));
});
return tos;
}
}

63
beneficiation/src/main/java/com/ccsens/beneficiation/bean/dto/Message/BeneficiationMessageDto.java

@ -0,0 +1,63 @@
package com.ccsens.beneficiation.bean.dto.Message;
import lombok.Data;
/**
* @author
*/
@Data
public class BeneficiationMessageDto {
/**
* 设备编号
*/
private String authId;
/**
* 类型 0变频器 1皮带秤 2电磁阀 3流量计 4电耳 5每日称重信息 6界限值 7触碰界限值后更改记录
*/
private Byte type;
/**
* 寄存器地址
*/
private int addr;
/**
* 类型对应的值
*/
private String value;
/**
* 版本号
*/
private String version;
/**
* 时间
*/
private Long time = System.currentTimeMillis();
public Byte getType(){
if(this.type != null){
return type;
}
switch (addr){
case 21:
return 0;
case 22:
return 1;
case 23:
return 2;
case 24:
return 3;
case 25:
return 4;
case 26:
return 5;
case 27:
case 28:
case 29:
return 6;
case 30: //触碰到的界限的信息()
return 7;
default:
return type;
}
}
}

52
beneficiation/src/main/java/com/ccsens/beneficiation/bean/dto/WeightDto.java

@ -0,0 +1,52 @@
package com.ccsens.beneficiation.bean.dto;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* @author
*/
@Data
public class WeightDto {
@Data
@ApiModel("统计重量信息")
public static class GetWeightByDay {
@ApiModelProperty("设备id(皮带秤id)默认1")
private Long equipmentId = 1L;
@ApiModelProperty("开始时间 不传默认查询全部")
private Date startTime;
@ApiModelProperty("结束时间 不传默认查询全部")
private Date endTime;
@ApiModelProperty("查询颗粒度 0天 1周 2月 3年 默认天")
private int dateType;
@JsonIgnore
private String dateTypeStr;
public String getDateTypeStr() {
switch (dateType){
case 1:
return "%Y-%u";
case 2:
return "%Y-%m";
case 3:
return "%Y";
default:
return "%Y-%m-%d";
}
}
}
@Data
@ApiModel("查询重量累计")
public static class GetWeightTotal {
@ApiModelProperty("日期 为空则默认当前")
private Date datetime;
}
}

150
beneficiation/src/main/java/com/ccsens/beneficiation/bean/po/AdjustRecord.java

@ -0,0 +1,150 @@
package com.ccsens.beneficiation.bean.po;
import java.io.Serializable;
import java.util.Date;
public class AdjustRecord implements Serializable {
private Long id;
private Long time;
private Long monitoringId;
private String monitoringValue;
private Long thresholdId;
private Long equipmentId;
private String beforeValue;
private String afterValue;
private Long operator;
private Date createdAt;
private Date updatedAt;
private Byte recStatus;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getTime() {
return time;
}
public void setTime(Long time) {
this.time = time;
}
public Long getMonitoringId() {
return monitoringId;
}
public void setMonitoringId(Long monitoringId) {
this.monitoringId = monitoringId;
}
public String getMonitoringValue() {
return monitoringValue;
}
public void setMonitoringValue(String monitoringValue) {
this.monitoringValue = monitoringValue == null ? null : monitoringValue.trim();
}
public Long getThresholdId() {
return thresholdId;
}
public void setThresholdId(Long thresholdId) {
this.thresholdId = thresholdId;
}
public Long getEquipmentId() {
return equipmentId;
}
public void setEquipmentId(Long equipmentId) {
this.equipmentId = equipmentId;
}
public String getBeforeValue() {
return beforeValue;
}
public void setBeforeValue(String beforeValue) {
this.beforeValue = beforeValue == null ? null : beforeValue.trim();
}
public String getAfterValue() {
return afterValue;
}
public void setAfterValue(String afterValue) {
this.afterValue = afterValue == null ? null : afterValue.trim();
}
public Long getOperator() {
return operator;
}
public void setOperator(Long operator) {
this.operator = operator;
}
public Date getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public Date getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}
public Byte getRecStatus() {
return recStatus;
}
public void setRecStatus(Byte recStatus) {
this.recStatus = recStatus;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", time=").append(time);
sb.append(", monitoringId=").append(monitoringId);
sb.append(", monitoringValue=").append(monitoringValue);
sb.append(", thresholdId=").append(thresholdId);
sb.append(", equipmentId=").append(equipmentId);
sb.append(", beforeValue=").append(beforeValue);
sb.append(", afterValue=").append(afterValue);
sb.append(", operator=").append(operator);
sb.append(", createdAt=").append(createdAt);
sb.append(", updatedAt=").append(updatedAt);
sb.append(", recStatus=").append(recStatus);
sb.append("]");
return sb.toString();
}
}

951
beneficiation/src/main/java/com/ccsens/beneficiation/bean/po/AdjustRecordExample.java

@ -0,0 +1,951 @@
package com.ccsens.beneficiation.bean.po;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class AdjustRecordExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public AdjustRecordExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Long value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Long value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Long value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Long value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Long value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Long value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Long> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Long> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Long value1, Long value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Long value1, Long value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andTimeIsNull() {
addCriterion("time is null");
return (Criteria) this;
}
public Criteria andTimeIsNotNull() {
addCriterion("time is not null");
return (Criteria) this;
}
public Criteria andTimeEqualTo(Long value) {
addCriterion("time =", value, "time");
return (Criteria) this;
}
public Criteria andTimeNotEqualTo(Long value) {
addCriterion("time <>", value, "time");
return (Criteria) this;
}
public Criteria andTimeGreaterThan(Long value) {
addCriterion("time >", value, "time");
return (Criteria) this;
}
public Criteria andTimeGreaterThanOrEqualTo(Long value) {
addCriterion("time >=", value, "time");
return (Criteria) this;
}
public Criteria andTimeLessThan(Long value) {
addCriterion("time <", value, "time");
return (Criteria) this;
}
public Criteria andTimeLessThanOrEqualTo(Long value) {
addCriterion("time <=", value, "time");
return (Criteria) this;
}
public Criteria andTimeIn(List<Long> values) {
addCriterion("time in", values, "time");
return (Criteria) this;
}
public Criteria andTimeNotIn(List<Long> values) {
addCriterion("time not in", values, "time");
return (Criteria) this;
}
public Criteria andTimeBetween(Long value1, Long value2) {
addCriterion("time between", value1, value2, "time");
return (Criteria) this;
}
public Criteria andTimeNotBetween(Long value1, Long value2) {
addCriterion("time not between", value1, value2, "time");
return (Criteria) this;
}
public Criteria andMonitoringIdIsNull() {
addCriterion("monitoring_id is null");
return (Criteria) this;
}
public Criteria andMonitoringIdIsNotNull() {
addCriterion("monitoring_id is not null");
return (Criteria) this;
}
public Criteria andMonitoringIdEqualTo(Long value) {
addCriterion("monitoring_id =", value, "monitoringId");
return (Criteria) this;
}
public Criteria andMonitoringIdNotEqualTo(Long value) {
addCriterion("monitoring_id <>", value, "monitoringId");
return (Criteria) this;
}
public Criteria andMonitoringIdGreaterThan(Long value) {
addCriterion("monitoring_id >", value, "monitoringId");
return (Criteria) this;
}
public Criteria andMonitoringIdGreaterThanOrEqualTo(Long value) {
addCriterion("monitoring_id >=", value, "monitoringId");
return (Criteria) this;
}
public Criteria andMonitoringIdLessThan(Long value) {
addCriterion("monitoring_id <", value, "monitoringId");
return (Criteria) this;
}
public Criteria andMonitoringIdLessThanOrEqualTo(Long value) {
addCriterion("monitoring_id <=", value, "monitoringId");
return (Criteria) this;
}
public Criteria andMonitoringIdIn(List<Long> values) {
addCriterion("monitoring_id in", values, "monitoringId");
return (Criteria) this;
}
public Criteria andMonitoringIdNotIn(List<Long> values) {
addCriterion("monitoring_id not in", values, "monitoringId");
return (Criteria) this;
}
public Criteria andMonitoringIdBetween(Long value1, Long value2) {
addCriterion("monitoring_id between", value1, value2, "monitoringId");
return (Criteria) this;
}
public Criteria andMonitoringIdNotBetween(Long value1, Long value2) {
addCriterion("monitoring_id not between", value1, value2, "monitoringId");
return (Criteria) this;
}
public Criteria andMonitoringValueIsNull() {
addCriterion("monitoring_value is null");
return (Criteria) this;
}
public Criteria andMonitoringValueIsNotNull() {
addCriterion("monitoring_value is not null");
return (Criteria) this;
}
public Criteria andMonitoringValueEqualTo(String value) {
addCriterion("monitoring_value =", value, "monitoringValue");
return (Criteria) this;
}
public Criteria andMonitoringValueNotEqualTo(String value) {
addCriterion("monitoring_value <>", value, "monitoringValue");
return (Criteria) this;
}
public Criteria andMonitoringValueGreaterThan(String value) {
addCriterion("monitoring_value >", value, "monitoringValue");
return (Criteria) this;
}
public Criteria andMonitoringValueGreaterThanOrEqualTo(String value) {
addCriterion("monitoring_value >=", value, "monitoringValue");
return (Criteria) this;
}
public Criteria andMonitoringValueLessThan(String value) {
addCriterion("monitoring_value <", value, "monitoringValue");
return (Criteria) this;
}
public Criteria andMonitoringValueLessThanOrEqualTo(String value) {
addCriterion("monitoring_value <=", value, "monitoringValue");
return (Criteria) this;
}
public Criteria andMonitoringValueLike(String value) {
addCriterion("monitoring_value like", value, "monitoringValue");
return (Criteria) this;
}
public Criteria andMonitoringValueNotLike(String value) {
addCriterion("monitoring_value not like", value, "monitoringValue");
return (Criteria) this;
}
public Criteria andMonitoringValueIn(List<String> values) {
addCriterion("monitoring_value in", values, "monitoringValue");
return (Criteria) this;
}
public Criteria andMonitoringValueNotIn(List<String> values) {
addCriterion("monitoring_value not in", values, "monitoringValue");
return (Criteria) this;
}
public Criteria andMonitoringValueBetween(String value1, String value2) {
addCriterion("monitoring_value between", value1, value2, "monitoringValue");
return (Criteria) this;
}
public Criteria andMonitoringValueNotBetween(String value1, String value2) {
addCriterion("monitoring_value not between", value1, value2, "monitoringValue");
return (Criteria) this;
}
public Criteria andThresholdIdIsNull() {
addCriterion("threshold_id is null");
return (Criteria) this;
}
public Criteria andThresholdIdIsNotNull() {
addCriterion("threshold_id is not null");
return (Criteria) this;
}
public Criteria andThresholdIdEqualTo(Long value) {
addCriterion("threshold_id =", value, "thresholdId");
return (Criteria) this;
}
public Criteria andThresholdIdNotEqualTo(Long value) {
addCriterion("threshold_id <>", value, "thresholdId");
return (Criteria) this;
}
public Criteria andThresholdIdGreaterThan(Long value) {
addCriterion("threshold_id >", value, "thresholdId");
return (Criteria) this;
}
public Criteria andThresholdIdGreaterThanOrEqualTo(Long value) {
addCriterion("threshold_id >=", value, "thresholdId");
return (Criteria) this;
}
public Criteria andThresholdIdLessThan(Long value) {
addCriterion("threshold_id <", value, "thresholdId");
return (Criteria) this;
}
public Criteria andThresholdIdLessThanOrEqualTo(Long value) {
addCriterion("threshold_id <=", value, "thresholdId");
return (Criteria) this;
}
public Criteria andThresholdIdIn(List<Long> values) {
addCriterion("threshold_id in", values, "thresholdId");
return (Criteria) this;
}
public Criteria andThresholdIdNotIn(List<Long> values) {
addCriterion("threshold_id not in", values, "thresholdId");
return (Criteria) this;
}
public Criteria andThresholdIdBetween(Long value1, Long value2) {
addCriterion("threshold_id between", value1, value2, "thresholdId");
return (Criteria) this;
}
public Criteria andThresholdIdNotBetween(Long value1, Long value2) {
addCriterion("threshold_id not between", value1, value2, "thresholdId");
return (Criteria) this;
}
public Criteria andEquipmentIdIsNull() {
addCriterion("equipment_id is null");
return (Criteria) this;
}
public Criteria andEquipmentIdIsNotNull() {
addCriterion("equipment_id is not null");
return (Criteria) this;
}
public Criteria andEquipmentIdEqualTo(Long value) {
addCriterion("equipment_id =", value, "equipmentId");
return (Criteria) this;
}
public Criteria andEquipmentIdNotEqualTo(Long value) {
addCriterion("equipment_id <>", value, "equipmentId");
return (Criteria) this;
}
public Criteria andEquipmentIdGreaterThan(Long value) {
addCriterion("equipment_id >", value, "equipmentId");
return (Criteria) this;
}
public Criteria andEquipmentIdGreaterThanOrEqualTo(Long value) {
addCriterion("equipment_id >=", value, "equipmentId");
return (Criteria) this;
}
public Criteria andEquipmentIdLessThan(Long value) {
addCriterion("equipment_id <", value, "equipmentId");
return (Criteria) this;
}
public Criteria andEquipmentIdLessThanOrEqualTo(Long value) {
addCriterion("equipment_id <=", value, "equipmentId");
return (Criteria) this;
}
public Criteria andEquipmentIdIn(List<Long> values) {
addCriterion("equipment_id in", values, "equipmentId");
return (Criteria) this;
}
public Criteria andEquipmentIdNotIn(List<Long> values) {
addCriterion("equipment_id not in", values, "equipmentId");
return (Criteria) this;
}
public Criteria andEquipmentIdBetween(Long value1, Long value2) {
addCriterion("equipment_id between", value1, value2, "equipmentId");
return (Criteria) this;
}
public Criteria andEquipmentIdNotBetween(Long value1, Long value2) {
addCriterion("equipment_id not between", value1, value2, "equipmentId");
return (Criteria) this;
}
public Criteria andBeforeValueIsNull() {
addCriterion("before_value is null");
return (Criteria) this;
}
public Criteria andBeforeValueIsNotNull() {
addCriterion("before_value is not null");
return (Criteria) this;
}
public Criteria andBeforeValueEqualTo(String value) {
addCriterion("before_value =", value, "beforeValue");
return (Criteria) this;
}
public Criteria andBeforeValueNotEqualTo(String value) {
addCriterion("before_value <>", value, "beforeValue");
return (Criteria) this;
}
public Criteria andBeforeValueGreaterThan(String value) {
addCriterion("before_value >", value, "beforeValue");
return (Criteria) this;
}
public Criteria andBeforeValueGreaterThanOrEqualTo(String value) {
addCriterion("before_value >=", value, "beforeValue");
return (Criteria) this;
}
public Criteria andBeforeValueLessThan(String value) {
addCriterion("before_value <", value, "beforeValue");
return (Criteria) this;
}
public Criteria andBeforeValueLessThanOrEqualTo(String value) {
addCriterion("before_value <=", value, "beforeValue");
return (Criteria) this;
}
public Criteria andBeforeValueLike(String value) {
addCriterion("before_value like", value, "beforeValue");
return (Criteria) this;
}
public Criteria andBeforeValueNotLike(String value) {
addCriterion("before_value not like", value, "beforeValue");
return (Criteria) this;
}
public Criteria andBeforeValueIn(List<String> values) {
addCriterion("before_value in", values, "beforeValue");
return (Criteria) this;
}
public Criteria andBeforeValueNotIn(List<String> values) {
addCriterion("before_value not in", values, "beforeValue");
return (Criteria) this;
}
public Criteria andBeforeValueBetween(String value1, String value2) {
addCriterion("before_value between", value1, value2, "beforeValue");
return (Criteria) this;
}
public Criteria andBeforeValueNotBetween(String value1, String value2) {
addCriterion("before_value not between", value1, value2, "beforeValue");
return (Criteria) this;
}
public Criteria andAfterValueIsNull() {
addCriterion("after_value is null");
return (Criteria) this;
}
public Criteria andAfterValueIsNotNull() {
addCriterion("after_value is not null");
return (Criteria) this;
}
public Criteria andAfterValueEqualTo(String value) {
addCriterion("after_value =", value, "afterValue");
return (Criteria) this;
}
public Criteria andAfterValueNotEqualTo(String value) {
addCriterion("after_value <>", value, "afterValue");
return (Criteria) this;
}
public Criteria andAfterValueGreaterThan(String value) {
addCriterion("after_value >", value, "afterValue");
return (Criteria) this;
}
public Criteria andAfterValueGreaterThanOrEqualTo(String value) {
addCriterion("after_value >=", value, "afterValue");
return (Criteria) this;
}
public Criteria andAfterValueLessThan(String value) {
addCriterion("after_value <", value, "afterValue");
return (Criteria) this;
}
public Criteria andAfterValueLessThanOrEqualTo(String value) {
addCriterion("after_value <=", value, "afterValue");
return (Criteria) this;
}
public Criteria andAfterValueLike(String value) {
addCriterion("after_value like", value, "afterValue");
return (Criteria) this;
}
public Criteria andAfterValueNotLike(String value) {
addCriterion("after_value not like", value, "afterValue");
return (Criteria) this;
}
public Criteria andAfterValueIn(List<String> values) {
addCriterion("after_value in", values, "afterValue");
return (Criteria) this;
}
public Criteria andAfterValueNotIn(List<String> values) {
addCriterion("after_value not in", values, "afterValue");
return (Criteria) this;
}
public Criteria andAfterValueBetween(String value1, String value2) {
addCriterion("after_value between", value1, value2, "afterValue");
return (Criteria) this;
}
public Criteria andAfterValueNotBetween(String value1, String value2) {
addCriterion("after_value not between", value1, value2, "afterValue");
return (Criteria) this;
}
public Criteria andOperatorIsNull() {
addCriterion("operator is null");
return (Criteria) this;
}
public Criteria andOperatorIsNotNull() {
addCriterion("operator is not null");
return (Criteria) this;
}
public Criteria andOperatorEqualTo(Long value) {
addCriterion("operator =", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorNotEqualTo(Long value) {
addCriterion("operator <>", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorGreaterThan(Long value) {
addCriterion("operator >", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorGreaterThanOrEqualTo(Long value) {
addCriterion("operator >=", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorLessThan(Long value) {
addCriterion("operator <", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorLessThanOrEqualTo(Long value) {
addCriterion("operator <=", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorIn(List<Long> values) {
addCriterion("operator in", values, "operator");
return (Criteria) this;
}
public Criteria andOperatorNotIn(List<Long> values) {
addCriterion("operator not in", values, "operator");
return (Criteria) this;
}
public Criteria andOperatorBetween(Long value1, Long value2) {
addCriterion("operator between", value1, value2, "operator");
return (Criteria) this;
}
public Criteria andOperatorNotBetween(Long value1, Long value2) {
addCriterion("operator not between", value1, value2, "operator");
return (Criteria) this;
}
public Criteria andCreatedAtIsNull() {
addCriterion("created_at is null");
return (Criteria) this;
}
public Criteria andCreatedAtIsNotNull() {
addCriterion("created_at is not null");
return (Criteria) this;
}
public Criteria andCreatedAtEqualTo(Date value) {
addCriterion("created_at =", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotEqualTo(Date value) {
addCriterion("created_at <>", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThan(Date value) {
addCriterion("created_at >", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("created_at >=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThan(Date value) {
addCriterion("created_at <", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThanOrEqualTo(Date value) {
addCriterion("created_at <=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtIn(List<Date> values) {
addCriterion("created_at in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotIn(List<Date> values) {
addCriterion("created_at not in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtBetween(Date value1, Date value2) {
addCriterion("created_at between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotBetween(Date value1, Date value2) {
addCriterion("created_at not between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andUpdatedAtIsNull() {
addCriterion("updated_at is null");
return (Criteria) this;
}
public Criteria andUpdatedAtIsNotNull() {
addCriterion("updated_at is not null");
return (Criteria) this;
}
public Criteria andUpdatedAtEqualTo(Date value) {
addCriterion("updated_at =", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotEqualTo(Date value) {
addCriterion("updated_at <>", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtGreaterThan(Date value) {
addCriterion("updated_at >", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("updated_at >=", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtLessThan(Date value) {
addCriterion("updated_at <", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtLessThanOrEqualTo(Date value) {
addCriterion("updated_at <=", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtIn(List<Date> values) {
addCriterion("updated_at in", values, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotIn(List<Date> values) {
addCriterion("updated_at not in", values, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtBetween(Date value1, Date value2) {
addCriterion("updated_at between", value1, value2, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotBetween(Date value1, Date value2) {
addCriterion("updated_at not between", value1, value2, "updatedAt");
return (Criteria) this;
}
public Criteria andRecStatusIsNull() {
addCriterion("rec_status is null");
return (Criteria) this;
}
public Criteria andRecStatusIsNotNull() {
addCriterion("rec_status is not null");
return (Criteria) this;
}
public Criteria andRecStatusEqualTo(Byte value) {
addCriterion("rec_status =", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotEqualTo(Byte value) {
addCriterion("rec_status <>", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusGreaterThan(Byte value) {
addCriterion("rec_status >", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusGreaterThanOrEqualTo(Byte value) {
addCriterion("rec_status >=", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusLessThan(Byte value) {
addCriterion("rec_status <", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusLessThanOrEqualTo(Byte value) {
addCriterion("rec_status <=", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusIn(List<Byte> values) {
addCriterion("rec_status in", values, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotIn(List<Byte> values) {
addCriterion("rec_status not in", values, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusBetween(Byte value1, Byte value2) {
addCriterion("rec_status between", value1, value2, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotBetween(Byte value1, Byte value2) {
addCriterion("rec_status not between", value1, value2, "recStatus");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

117
beneficiation/src/main/java/com/ccsens/beneficiation/bean/po/Equipment.java

@ -0,0 +1,117 @@
package com.ccsens.beneficiation.bean.po;
import java.io.Serializable;
import java.util.Date;
public class Equipment implements Serializable {
private Long id;
private Byte type;
private String authId;
private String addr;
private String verion;
private Long operator;
private Date createdAt;
private Date updatedAt;
private Byte recStatus;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Byte getType() {
return type;
}
public void setType(Byte type) {
this.type = type;
}
public String getAuthId() {
return authId;
}
public void setAuthId(String authId) {
this.authId = authId == null ? null : authId.trim();
}
public String getAddr() {
return addr;
}
public void setAddr(String addr) {
this.addr = addr == null ? null : addr.trim();
}
public String getVerion() {
return verion;
}
public void setVerion(String verion) {
this.verion = verion == null ? null : verion.trim();
}
public Long getOperator() {
return operator;
}
public void setOperator(Long operator) {
this.operator = operator;
}
public Date getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public Date getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}
public Byte getRecStatus() {
return recStatus;
}
public void setRecStatus(Byte recStatus) {
this.recStatus = recStatus;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", type=").append(type);
sb.append(", authId=").append(authId);
sb.append(", addr=").append(addr);
sb.append(", verion=").append(verion);
sb.append(", operator=").append(operator);
sb.append(", createdAt=").append(createdAt);
sb.append(", updatedAt=").append(updatedAt);
sb.append(", recStatus=").append(recStatus);
sb.append("]");
return sb.toString();
}
}

771
beneficiation/src/main/java/com/ccsens/beneficiation/bean/po/EquipmentExample.java

@ -0,0 +1,771 @@
package com.ccsens.beneficiation.bean.po;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class EquipmentExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public EquipmentExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Long value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Long value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Long value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Long value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Long value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Long value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Long> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Long> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Long value1, Long value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Long value1, Long value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andTypeIsNull() {
addCriterion("type is null");
return (Criteria) this;
}
public Criteria andTypeIsNotNull() {
addCriterion("type is not null");
return (Criteria) this;
}
public Criteria andTypeEqualTo(Byte value) {
addCriterion("type =", value, "type");
return (Criteria) this;
}
public Criteria andTypeNotEqualTo(Byte value) {
addCriterion("type <>", value, "type");
return (Criteria) this;
}
public Criteria andTypeGreaterThan(Byte value) {
addCriterion("type >", value, "type");
return (Criteria) this;
}
public Criteria andTypeGreaterThanOrEqualTo(Byte value) {
addCriterion("type >=", value, "type");
return (Criteria) this;
}
public Criteria andTypeLessThan(Byte value) {
addCriterion("type <", value, "type");
return (Criteria) this;
}
public Criteria andTypeLessThanOrEqualTo(Byte value) {
addCriterion("type <=", value, "type");
return (Criteria) this;
}
public Criteria andTypeIn(List<Byte> values) {
addCriterion("type in", values, "type");
return (Criteria) this;
}
public Criteria andTypeNotIn(List<Byte> values) {
addCriterion("type not in", values, "type");
return (Criteria) this;
}
public Criteria andTypeBetween(Byte value1, Byte value2) {
addCriterion("type between", value1, value2, "type");
return (Criteria) this;
}
public Criteria andTypeNotBetween(Byte value1, Byte value2) {
addCriterion("type not between", value1, value2, "type");
return (Criteria) this;
}
public Criteria andAuthIdIsNull() {
addCriterion("auth_id is null");
return (Criteria) this;
}
public Criteria andAuthIdIsNotNull() {
addCriterion("auth_id is not null");
return (Criteria) this;
}
public Criteria andAuthIdEqualTo(String value) {
addCriterion("auth_id =", value, "authId");
return (Criteria) this;
}
public Criteria andAuthIdNotEqualTo(String value) {
addCriterion("auth_id <>", value, "authId");
return (Criteria) this;
}
public Criteria andAuthIdGreaterThan(String value) {
addCriterion("auth_id >", value, "authId");
return (Criteria) this;
}
public Criteria andAuthIdGreaterThanOrEqualTo(String value) {
addCriterion("auth_id >=", value, "authId");
return (Criteria) this;
}
public Criteria andAuthIdLessThan(String value) {
addCriterion("auth_id <", value, "authId");
return (Criteria) this;
}
public Criteria andAuthIdLessThanOrEqualTo(String value) {
addCriterion("auth_id <=", value, "authId");
return (Criteria) this;
}
public Criteria andAuthIdLike(String value) {
addCriterion("auth_id like", value, "authId");
return (Criteria) this;
}
public Criteria andAuthIdNotLike(String value) {
addCriterion("auth_id not like", value, "authId");
return (Criteria) this;
}
public Criteria andAuthIdIn(List<String> values) {
addCriterion("auth_id in", values, "authId");
return (Criteria) this;
}
public Criteria andAuthIdNotIn(List<String> values) {
addCriterion("auth_id not in", values, "authId");
return (Criteria) this;
}
public Criteria andAuthIdBetween(String value1, String value2) {
addCriterion("auth_id between", value1, value2, "authId");
return (Criteria) this;
}
public Criteria andAuthIdNotBetween(String value1, String value2) {
addCriterion("auth_id not between", value1, value2, "authId");
return (Criteria) this;
}
public Criteria andAddrIsNull() {
addCriterion("addr is null");
return (Criteria) this;
}
public Criteria andAddrIsNotNull() {
addCriterion("addr is not null");
return (Criteria) this;
}
public Criteria andAddrEqualTo(String value) {
addCriterion("addr =", value, "addr");
return (Criteria) this;
}
public Criteria andAddrNotEqualTo(String value) {
addCriterion("addr <>", value, "addr");
return (Criteria) this;
}
public Criteria andAddrGreaterThan(String value) {
addCriterion("addr >", value, "addr");
return (Criteria) this;
}
public Criteria andAddrGreaterThanOrEqualTo(String value) {
addCriterion("addr >=", value, "addr");
return (Criteria) this;
}
public Criteria andAddrLessThan(String value) {
addCriterion("addr <", value, "addr");
return (Criteria) this;
}
public Criteria andAddrLessThanOrEqualTo(String value) {
addCriterion("addr <=", value, "addr");
return (Criteria) this;
}
public Criteria andAddrLike(String value) {
addCriterion("addr like", value, "addr");
return (Criteria) this;
}
public Criteria andAddrNotLike(String value) {
addCriterion("addr not like", value, "addr");
return (Criteria) this;
}
public Criteria andAddrIn(List<String> values) {
addCriterion("addr in", values, "addr");
return (Criteria) this;
}
public Criteria andAddrNotIn(List<String> values) {
addCriterion("addr not in", values, "addr");
return (Criteria) this;
}
public Criteria andAddrBetween(String value1, String value2) {
addCriterion("addr between", value1, value2, "addr");
return (Criteria) this;
}
public Criteria andAddrNotBetween(String value1, String value2) {
addCriterion("addr not between", value1, value2, "addr");
return (Criteria) this;
}
public Criteria andVerionIsNull() {
addCriterion("verion is null");
return (Criteria) this;
}
public Criteria andVerionIsNotNull() {
addCriterion("verion is not null");
return (Criteria) this;
}
public Criteria andVerionEqualTo(String value) {
addCriterion("verion =", value, "verion");
return (Criteria) this;
}
public Criteria andVerionNotEqualTo(String value) {
addCriterion("verion <>", value, "verion");
return (Criteria) this;
}
public Criteria andVerionGreaterThan(String value) {
addCriterion("verion >", value, "verion");
return (Criteria) this;
}
public Criteria andVerionGreaterThanOrEqualTo(String value) {
addCriterion("verion >=", value, "verion");
return (Criteria) this;
}
public Criteria andVerionLessThan(String value) {
addCriterion("verion <", value, "verion");
return (Criteria) this;
}
public Criteria andVerionLessThanOrEqualTo(String value) {
addCriterion("verion <=", value, "verion");
return (Criteria) this;
}
public Criteria andVerionLike(String value) {
addCriterion("verion like", value, "verion");
return (Criteria) this;
}
public Criteria andVerionNotLike(String value) {
addCriterion("verion not like", value, "verion");
return (Criteria) this;
}
public Criteria andVerionIn(List<String> values) {
addCriterion("verion in", values, "verion");
return (Criteria) this;
}
public Criteria andVerionNotIn(List<String> values) {
addCriterion("verion not in", values, "verion");
return (Criteria) this;
}
public Criteria andVerionBetween(String value1, String value2) {
addCriterion("verion between", value1, value2, "verion");
return (Criteria) this;
}
public Criteria andVerionNotBetween(String value1, String value2) {
addCriterion("verion not between", value1, value2, "verion");
return (Criteria) this;
}
public Criteria andOperatorIsNull() {
addCriterion("operator is null");
return (Criteria) this;
}
public Criteria andOperatorIsNotNull() {
addCriterion("operator is not null");
return (Criteria) this;
}
public Criteria andOperatorEqualTo(Long value) {
addCriterion("operator =", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorNotEqualTo(Long value) {
addCriterion("operator <>", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorGreaterThan(Long value) {
addCriterion("operator >", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorGreaterThanOrEqualTo(Long value) {
addCriterion("operator >=", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorLessThan(Long value) {
addCriterion("operator <", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorLessThanOrEqualTo(Long value) {
addCriterion("operator <=", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorIn(List<Long> values) {
addCriterion("operator in", values, "operator");
return (Criteria) this;
}
public Criteria andOperatorNotIn(List<Long> values) {
addCriterion("operator not in", values, "operator");
return (Criteria) this;
}
public Criteria andOperatorBetween(Long value1, Long value2) {
addCriterion("operator between", value1, value2, "operator");
return (Criteria) this;
}
public Criteria andOperatorNotBetween(Long value1, Long value2) {
addCriterion("operator not between", value1, value2, "operator");
return (Criteria) this;
}
public Criteria andCreatedAtIsNull() {
addCriterion("created_at is null");
return (Criteria) this;
}
public Criteria andCreatedAtIsNotNull() {
addCriterion("created_at is not null");
return (Criteria) this;
}
public Criteria andCreatedAtEqualTo(Date value) {
addCriterion("created_at =", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotEqualTo(Date value) {
addCriterion("created_at <>", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThan(Date value) {
addCriterion("created_at >", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("created_at >=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThan(Date value) {
addCriterion("created_at <", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThanOrEqualTo(Date value) {
addCriterion("created_at <=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtIn(List<Date> values) {
addCriterion("created_at in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotIn(List<Date> values) {
addCriterion("created_at not in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtBetween(Date value1, Date value2) {
addCriterion("created_at between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotBetween(Date value1, Date value2) {
addCriterion("created_at not between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andUpdatedAtIsNull() {
addCriterion("updated_at is null");
return (Criteria) this;
}
public Criteria andUpdatedAtIsNotNull() {
addCriterion("updated_at is not null");
return (Criteria) this;
}
public Criteria andUpdatedAtEqualTo(Date value) {
addCriterion("updated_at =", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotEqualTo(Date value) {
addCriterion("updated_at <>", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtGreaterThan(Date value) {
addCriterion("updated_at >", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("updated_at >=", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtLessThan(Date value) {
addCriterion("updated_at <", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtLessThanOrEqualTo(Date value) {
addCriterion("updated_at <=", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtIn(List<Date> values) {
addCriterion("updated_at in", values, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotIn(List<Date> values) {
addCriterion("updated_at not in", values, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtBetween(Date value1, Date value2) {
addCriterion("updated_at between", value1, value2, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotBetween(Date value1, Date value2) {
addCriterion("updated_at not between", value1, value2, "updatedAt");
return (Criteria) this;
}
public Criteria andRecStatusIsNull() {
addCriterion("rec_status is null");
return (Criteria) this;
}
public Criteria andRecStatusIsNotNull() {
addCriterion("rec_status is not null");
return (Criteria) this;
}
public Criteria andRecStatusEqualTo(Byte value) {
addCriterion("rec_status =", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotEqualTo(Byte value) {
addCriterion("rec_status <>", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusGreaterThan(Byte value) {
addCriterion("rec_status >", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusGreaterThanOrEqualTo(Byte value) {
addCriterion("rec_status >=", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusLessThan(Byte value) {
addCriterion("rec_status <", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusLessThanOrEqualTo(Byte value) {
addCriterion("rec_status <=", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusIn(List<Byte> values) {
addCriterion("rec_status in", values, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotIn(List<Byte> values) {
addCriterion("rec_status not in", values, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusBetween(Byte value1, Byte value2) {
addCriterion("rec_status between", value1, value2, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotBetween(Byte value1, Byte value2) {
addCriterion("rec_status not between", value1, value2, "recStatus");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

106
beneficiation/src/main/java/com/ccsens/beneficiation/bean/po/Record.java

@ -0,0 +1,106 @@
package com.ccsens.beneficiation.bean.po;
import java.io.Serializable;
import java.util.Date;
public class Record implements Serializable {
private Long id;
private Long equipmentId;
private String value;
private Date time;
private Long operator;
private Date createdAt;
private Date updatedAt;
private Byte recStatus;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getEquipmentId() {
return equipmentId;
}
public void setEquipmentId(Long equipmentId) {
this.equipmentId = equipmentId;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value == null ? null : value.trim();
}
public Date getTime() {
return time;
}
public void setTime(Date time) {
this.time = time;
}
public Long getOperator() {
return operator;
}
public void setOperator(Long operator) {
this.operator = operator;
}
public Date getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public Date getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}
public Byte getRecStatus() {
return recStatus;
}
public void setRecStatus(Byte recStatus) {
this.recStatus = recStatus;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", equipmentId=").append(equipmentId);
sb.append(", value=").append(value);
sb.append(", time=").append(time);
sb.append(", operator=").append(operator);
sb.append(", createdAt=").append(createdAt);
sb.append(", updatedAt=").append(updatedAt);
sb.append(", recStatus=").append(recStatus);
sb.append("]");
return sb.toString();
}
}

691
beneficiation/src/main/java/com/ccsens/beneficiation/bean/po/RecordExample.java

@ -0,0 +1,691 @@
package com.ccsens.beneficiation.bean.po;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class RecordExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public RecordExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Long value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Long value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Long value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Long value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Long value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Long value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Long> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Long> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Long value1, Long value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Long value1, Long value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andEquipmentIdIsNull() {
addCriterion("equipment_id is null");
return (Criteria) this;
}
public Criteria andEquipmentIdIsNotNull() {
addCriterion("equipment_id is not null");
return (Criteria) this;
}
public Criteria andEquipmentIdEqualTo(Long value) {
addCriterion("equipment_id =", value, "equipmentId");
return (Criteria) this;
}
public Criteria andEquipmentIdNotEqualTo(Long value) {
addCriterion("equipment_id <>", value, "equipmentId");
return (Criteria) this;
}
public Criteria andEquipmentIdGreaterThan(Long value) {
addCriterion("equipment_id >", value, "equipmentId");
return (Criteria) this;
}
public Criteria andEquipmentIdGreaterThanOrEqualTo(Long value) {
addCriterion("equipment_id >=", value, "equipmentId");
return (Criteria) this;
}
public Criteria andEquipmentIdLessThan(Long value) {
addCriterion("equipment_id <", value, "equipmentId");
return (Criteria) this;
}
public Criteria andEquipmentIdLessThanOrEqualTo(Long value) {
addCriterion("equipment_id <=", value, "equipmentId");
return (Criteria) this;
}
public Criteria andEquipmentIdIn(List<Long> values) {
addCriterion("equipment_id in", values, "equipmentId");
return (Criteria) this;
}
public Criteria andEquipmentIdNotIn(List<Long> values) {
addCriterion("equipment_id not in", values, "equipmentId");
return (Criteria) this;
}
public Criteria andEquipmentIdBetween(Long value1, Long value2) {
addCriterion("equipment_id between", value1, value2, "equipmentId");
return (Criteria) this;
}
public Criteria andEquipmentIdNotBetween(Long value1, Long value2) {
addCriterion("equipment_id not between", value1, value2, "equipmentId");
return (Criteria) this;
}
public Criteria andValueIsNull() {
addCriterion("value is null");
return (Criteria) this;
}
public Criteria andValueIsNotNull() {
addCriterion("value is not null");
return (Criteria) this;
}
public Criteria andValueEqualTo(String value) {
addCriterion("value =", value, "value");
return (Criteria) this;
}
public Criteria andValueNotEqualTo(String value) {
addCriterion("value <>", value, "value");
return (Criteria) this;
}
public Criteria andValueGreaterThan(String value) {
addCriterion("value >", value, "value");
return (Criteria) this;
}
public Criteria andValueGreaterThanOrEqualTo(String value) {
addCriterion("value >=", value, "value");
return (Criteria) this;
}
public Criteria andValueLessThan(String value) {
addCriterion("value <", value, "value");
return (Criteria) this;
}
public Criteria andValueLessThanOrEqualTo(String value) {
addCriterion("value <=", value, "value");
return (Criteria) this;
}
public Criteria andValueLike(String value) {
addCriterion("value like", value, "value");
return (Criteria) this;
}
public Criteria andValueNotLike(String value) {
addCriterion("value not like", value, "value");
return (Criteria) this;
}
public Criteria andValueIn(List<String> values) {
addCriterion("value in", values, "value");
return (Criteria) this;
}
public Criteria andValueNotIn(List<String> values) {
addCriterion("value not in", values, "value");
return (Criteria) this;
}
public Criteria andValueBetween(String value1, String value2) {
addCriterion("value between", value1, value2, "value");
return (Criteria) this;
}
public Criteria andValueNotBetween(String value1, String value2) {
addCriterion("value not between", value1, value2, "value");
return (Criteria) this;
}
public Criteria andTimeIsNull() {
addCriterion("time is null");
return (Criteria) this;
}
public Criteria andTimeIsNotNull() {
addCriterion("time is not null");
return (Criteria) this;
}
public Criteria andTimeEqualTo(Date value) {
addCriterion("time =", value, "time");
return (Criteria) this;
}
public Criteria andTimeNotEqualTo(Date value) {
addCriterion("time <>", value, "time");
return (Criteria) this;
}
public Criteria andTimeGreaterThan(Date value) {
addCriterion("time >", value, "time");
return (Criteria) this;
}
public Criteria andTimeGreaterThanOrEqualTo(Date value) {
addCriterion("time >=", value, "time");
return (Criteria) this;
}
public Criteria andTimeLessThan(Date value) {
addCriterion("time <", value, "time");
return (Criteria) this;
}
public Criteria andTimeLessThanOrEqualTo(Date value) {
addCriterion("time <=", value, "time");
return (Criteria) this;
}
public Criteria andTimeIn(List<Date> values) {
addCriterion("time in", values, "time");
return (Criteria) this;
}
public Criteria andTimeNotIn(List<Date> values) {
addCriterion("time not in", values, "time");
return (Criteria) this;
}
public Criteria andTimeBetween(Date value1, Date value2) {
addCriterion("time between", value1, value2, "time");
return (Criteria) this;
}
public Criteria andTimeNotBetween(Date value1, Date value2) {
addCriterion("time not between", value1, value2, "time");
return (Criteria) this;
}
public Criteria andOperatorIsNull() {
addCriterion("operator is null");
return (Criteria) this;
}
public Criteria andOperatorIsNotNull() {
addCriterion("operator is not null");
return (Criteria) this;
}
public Criteria andOperatorEqualTo(Long value) {
addCriterion("operator =", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorNotEqualTo(Long value) {
addCriterion("operator <>", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorGreaterThan(Long value) {
addCriterion("operator >", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorGreaterThanOrEqualTo(Long value) {
addCriterion("operator >=", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorLessThan(Long value) {
addCriterion("operator <", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorLessThanOrEqualTo(Long value) {
addCriterion("operator <=", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorIn(List<Long> values) {
addCriterion("operator in", values, "operator");
return (Criteria) this;
}
public Criteria andOperatorNotIn(List<Long> values) {
addCriterion("operator not in", values, "operator");
return (Criteria) this;
}
public Criteria andOperatorBetween(Long value1, Long value2) {
addCriterion("operator between", value1, value2, "operator");
return (Criteria) this;
}
public Criteria andOperatorNotBetween(Long value1, Long value2) {
addCriterion("operator not between", value1, value2, "operator");
return (Criteria) this;
}
public Criteria andCreatedAtIsNull() {
addCriterion("created_at is null");
return (Criteria) this;
}
public Criteria andCreatedAtIsNotNull() {
addCriterion("created_at is not null");
return (Criteria) this;
}
public Criteria andCreatedAtEqualTo(Date value) {
addCriterion("created_at =", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotEqualTo(Date value) {
addCriterion("created_at <>", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThan(Date value) {
addCriterion("created_at >", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("created_at >=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThan(Date value) {
addCriterion("created_at <", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThanOrEqualTo(Date value) {
addCriterion("created_at <=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtIn(List<Date> values) {
addCriterion("created_at in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotIn(List<Date> values) {
addCriterion("created_at not in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtBetween(Date value1, Date value2) {
addCriterion("created_at between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotBetween(Date value1, Date value2) {
addCriterion("created_at not between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andUpdatedAtIsNull() {
addCriterion("updated_at is null");
return (Criteria) this;
}
public Criteria andUpdatedAtIsNotNull() {
addCriterion("updated_at is not null");
return (Criteria) this;
}
public Criteria andUpdatedAtEqualTo(Date value) {
addCriterion("updated_at =", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotEqualTo(Date value) {
addCriterion("updated_at <>", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtGreaterThan(Date value) {
addCriterion("updated_at >", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("updated_at >=", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtLessThan(Date value) {
addCriterion("updated_at <", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtLessThanOrEqualTo(Date value) {
addCriterion("updated_at <=", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtIn(List<Date> values) {
addCriterion("updated_at in", values, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotIn(List<Date> values) {
addCriterion("updated_at not in", values, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtBetween(Date value1, Date value2) {
addCriterion("updated_at between", value1, value2, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotBetween(Date value1, Date value2) {
addCriterion("updated_at not between", value1, value2, "updatedAt");
return (Criteria) this;
}
public Criteria andRecStatusIsNull() {
addCriterion("rec_status is null");
return (Criteria) this;
}
public Criteria andRecStatusIsNotNull() {
addCriterion("rec_status is not null");
return (Criteria) this;
}
public Criteria andRecStatusEqualTo(Byte value) {
addCriterion("rec_status =", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotEqualTo(Byte value) {
addCriterion("rec_status <>", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusGreaterThan(Byte value) {
addCriterion("rec_status >", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusGreaterThanOrEqualTo(Byte value) {
addCriterion("rec_status >=", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusLessThan(Byte value) {
addCriterion("rec_status <", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusLessThanOrEqualTo(Byte value) {
addCriterion("rec_status <=", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusIn(List<Byte> values) {
addCriterion("rec_status in", values, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotIn(List<Byte> values) {
addCriterion("rec_status not in", values, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusBetween(Byte value1, Byte value2) {
addCriterion("rec_status between", value1, value2, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotBetween(Byte value1, Byte value2) {
addCriterion("rec_status not between", value1, value2, "recStatus");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

117
beneficiation/src/main/java/com/ccsens/beneficiation/bean/po/ThresholdValue.java

@ -0,0 +1,117 @@
package com.ccsens.beneficiation.bean.po;
import java.io.Serializable;
import java.util.Date;
public class ThresholdValue implements Serializable {
private Long id;
private Byte type;
private Byte stages;
private Integer max;
private Integer min;
private Long operator;
private Date createdAt;
private Date updatedAt;
private Byte recStatus;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Byte getType() {
return type;
}
public void setType(Byte type) {
this.type = type;
}
public Byte getStages() {
return stages;
}
public void setStages(Byte stages) {
this.stages = stages;
}
public Integer getMax() {
return max;
}
public void setMax(Integer max) {
this.max = max;
}
public Integer getMin() {
return min;
}
public void setMin(Integer min) {
this.min = min;
}
public Long getOperator() {
return operator;
}
public void setOperator(Long operator) {
this.operator = operator;
}
public Date getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public Date getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}
public Byte getRecStatus() {
return recStatus;
}
public void setRecStatus(Byte recStatus) {
this.recStatus = recStatus;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", type=").append(type);
sb.append(", stages=").append(stages);
sb.append(", max=").append(max);
sb.append(", min=").append(min);
sb.append(", operator=").append(operator);
sb.append(", createdAt=").append(createdAt);
sb.append(", updatedAt=").append(updatedAt);
sb.append(", recStatus=").append(recStatus);
sb.append("]");
return sb.toString();
}
}

741
beneficiation/src/main/java/com/ccsens/beneficiation/bean/po/ThresholdValueExample.java

@ -0,0 +1,741 @@
package com.ccsens.beneficiation.bean.po;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class ThresholdValueExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public ThresholdValueExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Long value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Long value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Long value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Long value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Long value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Long value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Long> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Long> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Long value1, Long value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Long value1, Long value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andTypeIsNull() {
addCriterion("type is null");
return (Criteria) this;
}
public Criteria andTypeIsNotNull() {
addCriterion("type is not null");
return (Criteria) this;
}
public Criteria andTypeEqualTo(Byte value) {
addCriterion("type =", value, "type");
return (Criteria) this;
}
public Criteria andTypeNotEqualTo(Byte value) {
addCriterion("type <>", value, "type");
return (Criteria) this;
}
public Criteria andTypeGreaterThan(Byte value) {
addCriterion("type >", value, "type");
return (Criteria) this;
}
public Criteria andTypeGreaterThanOrEqualTo(Byte value) {
addCriterion("type >=", value, "type");
return (Criteria) this;
}
public Criteria andTypeLessThan(Byte value) {
addCriterion("type <", value, "type");
return (Criteria) this;
}
public Criteria andTypeLessThanOrEqualTo(Byte value) {
addCriterion("type <=", value, "type");
return (Criteria) this;
}
public Criteria andTypeIn(List<Byte> values) {
addCriterion("type in", values, "type");
return (Criteria) this;
}
public Criteria andTypeNotIn(List<Byte> values) {
addCriterion("type not in", values, "type");
return (Criteria) this;
}
public Criteria andTypeBetween(Byte value1, Byte value2) {
addCriterion("type between", value1, value2, "type");
return (Criteria) this;
}
public Criteria andTypeNotBetween(Byte value1, Byte value2) {
addCriterion("type not between", value1, value2, "type");
return (Criteria) this;
}
public Criteria andStagesIsNull() {
addCriterion("stages is null");
return (Criteria) this;
}
public Criteria andStagesIsNotNull() {
addCriterion("stages is not null");
return (Criteria) this;
}
public Criteria andStagesEqualTo(Byte value) {
addCriterion("stages =", value, "stages");
return (Criteria) this;
}
public Criteria andStagesNotEqualTo(Byte value) {
addCriterion("stages <>", value, "stages");
return (Criteria) this;
}
public Criteria andStagesGreaterThan(Byte value) {
addCriterion("stages >", value, "stages");
return (Criteria) this;
}
public Criteria andStagesGreaterThanOrEqualTo(Byte value) {
addCriterion("stages >=", value, "stages");
return (Criteria) this;
}
public Criteria andStagesLessThan(Byte value) {
addCriterion("stages <", value, "stages");
return (Criteria) this;
}
public Criteria andStagesLessThanOrEqualTo(Byte value) {
addCriterion("stages <=", value, "stages");
return (Criteria) this;
}
public Criteria andStagesIn(List<Byte> values) {
addCriterion("stages in", values, "stages");
return (Criteria) this;
}
public Criteria andStagesNotIn(List<Byte> values) {
addCriterion("stages not in", values, "stages");
return (Criteria) this;
}
public Criteria andStagesBetween(Byte value1, Byte value2) {
addCriterion("stages between", value1, value2, "stages");
return (Criteria) this;
}
public Criteria andStagesNotBetween(Byte value1, Byte value2) {
addCriterion("stages not between", value1, value2, "stages");
return (Criteria) this;
}
public Criteria andMaxIsNull() {
addCriterion("max is null");
return (Criteria) this;
}
public Criteria andMaxIsNotNull() {
addCriterion("max is not null");
return (Criteria) this;
}
public Criteria andMaxEqualTo(Integer value) {
addCriterion("max =", value, "max");
return (Criteria) this;
}
public Criteria andMaxNotEqualTo(Integer value) {
addCriterion("max <>", value, "max");
return (Criteria) this;
}
public Criteria andMaxGreaterThan(Integer value) {
addCriterion("max >", value, "max");
return (Criteria) this;
}
public Criteria andMaxGreaterThanOrEqualTo(Integer value) {
addCriterion("max >=", value, "max");
return (Criteria) this;
}
public Criteria andMaxLessThan(Integer value) {
addCriterion("max <", value, "max");
return (Criteria) this;
}
public Criteria andMaxLessThanOrEqualTo(Integer value) {
addCriterion("max <=", value, "max");
return (Criteria) this;
}
public Criteria andMaxIn(List<Integer> values) {
addCriterion("max in", values, "max");
return (Criteria) this;
}
public Criteria andMaxNotIn(List<Integer> values) {
addCriterion("max not in", values, "max");
return (Criteria) this;
}
public Criteria andMaxBetween(Integer value1, Integer value2) {
addCriterion("max between", value1, value2, "max");
return (Criteria) this;
}
public Criteria andMaxNotBetween(Integer value1, Integer value2) {
addCriterion("max not between", value1, value2, "max");
return (Criteria) this;
}
public Criteria andMinIsNull() {
addCriterion("min is null");
return (Criteria) this;
}
public Criteria andMinIsNotNull() {
addCriterion("min is not null");
return (Criteria) this;
}
public Criteria andMinEqualTo(Integer value) {
addCriterion("min =", value, "min");
return (Criteria) this;
}
public Criteria andMinNotEqualTo(Integer value) {
addCriterion("min <>", value, "min");
return (Criteria) this;
}
public Criteria andMinGreaterThan(Integer value) {
addCriterion("min >", value, "min");
return (Criteria) this;
}
public Criteria andMinGreaterThanOrEqualTo(Integer value) {
addCriterion("min >=", value, "min");
return (Criteria) this;
}
public Criteria andMinLessThan(Integer value) {
addCriterion("min <", value, "min");
return (Criteria) this;
}
public Criteria andMinLessThanOrEqualTo(Integer value) {
addCriterion("min <=", value, "min");
return (Criteria) this;
}
public Criteria andMinIn(List<Integer> values) {
addCriterion("min in", values, "min");
return (Criteria) this;
}
public Criteria andMinNotIn(List<Integer> values) {
addCriterion("min not in", values, "min");
return (Criteria) this;
}
public Criteria andMinBetween(Integer value1, Integer value2) {
addCriterion("min between", value1, value2, "min");
return (Criteria) this;
}
public Criteria andMinNotBetween(Integer value1, Integer value2) {
addCriterion("min not between", value1, value2, "min");
return (Criteria) this;
}
public Criteria andOperatorIsNull() {
addCriterion("operator is null");
return (Criteria) this;
}
public Criteria andOperatorIsNotNull() {
addCriterion("operator is not null");
return (Criteria) this;
}
public Criteria andOperatorEqualTo(Long value) {
addCriterion("operator =", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorNotEqualTo(Long value) {
addCriterion("operator <>", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorGreaterThan(Long value) {
addCriterion("operator >", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorGreaterThanOrEqualTo(Long value) {
addCriterion("operator >=", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorLessThan(Long value) {
addCriterion("operator <", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorLessThanOrEqualTo(Long value) {
addCriterion("operator <=", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorIn(List<Long> values) {
addCriterion("operator in", values, "operator");
return (Criteria) this;
}
public Criteria andOperatorNotIn(List<Long> values) {
addCriterion("operator not in", values, "operator");
return (Criteria) this;
}
public Criteria andOperatorBetween(Long value1, Long value2) {
addCriterion("operator between", value1, value2, "operator");
return (Criteria) this;
}
public Criteria andOperatorNotBetween(Long value1, Long value2) {
addCriterion("operator not between", value1, value2, "operator");
return (Criteria) this;
}
public Criteria andCreatedAtIsNull() {
addCriterion("created_at is null");
return (Criteria) this;
}
public Criteria andCreatedAtIsNotNull() {
addCriterion("created_at is not null");
return (Criteria) this;
}
public Criteria andCreatedAtEqualTo(Date value) {
addCriterion("created_at =", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotEqualTo(Date value) {
addCriterion("created_at <>", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThan(Date value) {
addCriterion("created_at >", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("created_at >=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThan(Date value) {
addCriterion("created_at <", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThanOrEqualTo(Date value) {
addCriterion("created_at <=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtIn(List<Date> values) {
addCriterion("created_at in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotIn(List<Date> values) {
addCriterion("created_at not in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtBetween(Date value1, Date value2) {
addCriterion("created_at between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotBetween(Date value1, Date value2) {
addCriterion("created_at not between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andUpdatedAtIsNull() {
addCriterion("updated_at is null");
return (Criteria) this;
}
public Criteria andUpdatedAtIsNotNull() {
addCriterion("updated_at is not null");
return (Criteria) this;
}
public Criteria andUpdatedAtEqualTo(Date value) {
addCriterion("updated_at =", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotEqualTo(Date value) {
addCriterion("updated_at <>", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtGreaterThan(Date value) {
addCriterion("updated_at >", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("updated_at >=", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtLessThan(Date value) {
addCriterion("updated_at <", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtLessThanOrEqualTo(Date value) {
addCriterion("updated_at <=", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtIn(List<Date> values) {
addCriterion("updated_at in", values, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotIn(List<Date> values) {
addCriterion("updated_at not in", values, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtBetween(Date value1, Date value2) {
addCriterion("updated_at between", value1, value2, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotBetween(Date value1, Date value2) {
addCriterion("updated_at not between", value1, value2, "updatedAt");
return (Criteria) this;
}
public Criteria andRecStatusIsNull() {
addCriterion("rec_status is null");
return (Criteria) this;
}
public Criteria andRecStatusIsNotNull() {
addCriterion("rec_status is not null");
return (Criteria) this;
}
public Criteria andRecStatusEqualTo(Byte value) {
addCriterion("rec_status =", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotEqualTo(Byte value) {
addCriterion("rec_status <>", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusGreaterThan(Byte value) {
addCriterion("rec_status >", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusGreaterThanOrEqualTo(Byte value) {
addCriterion("rec_status >=", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusLessThan(Byte value) {
addCriterion("rec_status <", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusLessThanOrEqualTo(Byte value) {
addCriterion("rec_status <=", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusIn(List<Byte> values) {
addCriterion("rec_status in", values, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotIn(List<Byte> values) {
addCriterion("rec_status not in", values, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusBetween(Byte value1, Byte value2) {
addCriterion("rec_status between", value1, value2, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotBetween(Byte value1, Byte value2) {
addCriterion("rec_status not between", value1, value2, "recStatus");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

106
beneficiation/src/main/java/com/ccsens/beneficiation/bean/po/Weight.java

@ -0,0 +1,106 @@
package com.ccsens.beneficiation.bean.po;
import java.io.Serializable;
import java.util.Date;
public class Weight implements Serializable {
private Long id;
private Long equipmentId;
private String weight;
private Date time;
private Long operator;
private Date createdAt;
private Date updatedAt;
private Byte recStatus;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getEquipmentId() {
return equipmentId;
}
public void setEquipmentId(Long equipmentId) {
this.equipmentId = equipmentId;
}
public String getWeight() {
return weight;
}
public void setWeight(String weight) {
this.weight = weight == null ? null : weight.trim();
}
public Date getTime() {
return time;
}
public void setTime(Date time) {
this.time = time;
}
public Long getOperator() {
return operator;
}
public void setOperator(Long operator) {
this.operator = operator;
}
public Date getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public Date getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}
public Byte getRecStatus() {
return recStatus;
}
public void setRecStatus(Byte recStatus) {
this.recStatus = recStatus;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", equipmentId=").append(equipmentId);
sb.append(", weight=").append(weight);
sb.append(", time=").append(time);
sb.append(", operator=").append(operator);
sb.append(", createdAt=").append(createdAt);
sb.append(", updatedAt=").append(updatedAt);
sb.append(", recStatus=").append(recStatus);
sb.append("]");
return sb.toString();
}
}

691
beneficiation/src/main/java/com/ccsens/beneficiation/bean/po/WeightExample.java

@ -0,0 +1,691 @@
package com.ccsens.beneficiation.bean.po;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class WeightExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public WeightExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Long value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Long value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Long value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Long value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Long value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Long value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Long> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Long> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Long value1, Long value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Long value1, Long value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andEquipmentIdIsNull() {
addCriterion("equipment_id is null");
return (Criteria) this;
}
public Criteria andEquipmentIdIsNotNull() {
addCriterion("equipment_id is not null");
return (Criteria) this;
}
public Criteria andEquipmentIdEqualTo(Long value) {
addCriterion("equipment_id =", value, "equipmentId");
return (Criteria) this;
}
public Criteria andEquipmentIdNotEqualTo(Long value) {
addCriterion("equipment_id <>", value, "equipmentId");
return (Criteria) this;
}
public Criteria andEquipmentIdGreaterThan(Long value) {
addCriterion("equipment_id >", value, "equipmentId");
return (Criteria) this;
}
public Criteria andEquipmentIdGreaterThanOrEqualTo(Long value) {
addCriterion("equipment_id >=", value, "equipmentId");
return (Criteria) this;
}
public Criteria andEquipmentIdLessThan(Long value) {
addCriterion("equipment_id <", value, "equipmentId");
return (Criteria) this;
}
public Criteria andEquipmentIdLessThanOrEqualTo(Long value) {
addCriterion("equipment_id <=", value, "equipmentId");
return (Criteria) this;
}
public Criteria andEquipmentIdIn(List<Long> values) {
addCriterion("equipment_id in", values, "equipmentId");
return (Criteria) this;
}
public Criteria andEquipmentIdNotIn(List<Long> values) {
addCriterion("equipment_id not in", values, "equipmentId");
return (Criteria) this;
}
public Criteria andEquipmentIdBetween(Long value1, Long value2) {
addCriterion("equipment_id between", value1, value2, "equipmentId");
return (Criteria) this;
}
public Criteria andEquipmentIdNotBetween(Long value1, Long value2) {
addCriterion("equipment_id not between", value1, value2, "equipmentId");
return (Criteria) this;
}
public Criteria andWeightIsNull() {
addCriterion("weight is null");
return (Criteria) this;
}
public Criteria andWeightIsNotNull() {
addCriterion("weight is not null");
return (Criteria) this;
}
public Criteria andWeightEqualTo(String value) {
addCriterion("weight =", value, "weight");
return (Criteria) this;
}
public Criteria andWeightNotEqualTo(String value) {
addCriterion("weight <>", value, "weight");
return (Criteria) this;
}
public Criteria andWeightGreaterThan(String value) {
addCriterion("weight >", value, "weight");
return (Criteria) this;
}
public Criteria andWeightGreaterThanOrEqualTo(String value) {
addCriterion("weight >=", value, "weight");
return (Criteria) this;
}
public Criteria andWeightLessThan(String value) {
addCriterion("weight <", value, "weight");
return (Criteria) this;
}
public Criteria andWeightLessThanOrEqualTo(String value) {
addCriterion("weight <=", value, "weight");
return (Criteria) this;
}
public Criteria andWeightLike(String value) {
addCriterion("weight like", value, "weight");
return (Criteria) this;
}
public Criteria andWeightNotLike(String value) {
addCriterion("weight not like", value, "weight");
return (Criteria) this;
}
public Criteria andWeightIn(List<String> values) {
addCriterion("weight in", values, "weight");
return (Criteria) this;
}
public Criteria andWeightNotIn(List<String> values) {
addCriterion("weight not in", values, "weight");
return (Criteria) this;
}
public Criteria andWeightBetween(String value1, String value2) {
addCriterion("weight between", value1, value2, "weight");
return (Criteria) this;
}
public Criteria andWeightNotBetween(String value1, String value2) {
addCriterion("weight not between", value1, value2, "weight");
return (Criteria) this;
}
public Criteria andTimeIsNull() {
addCriterion("time is null");
return (Criteria) this;
}
public Criteria andTimeIsNotNull() {
addCriterion("time is not null");
return (Criteria) this;
}
public Criteria andTimeEqualTo(Date value) {
addCriterion("time =", value, "time");
return (Criteria) this;
}
public Criteria andTimeNotEqualTo(Date value) {
addCriterion("time <>", value, "time");
return (Criteria) this;
}
public Criteria andTimeGreaterThan(Date value) {
addCriterion("time >", value, "time");
return (Criteria) this;
}
public Criteria andTimeGreaterThanOrEqualTo(Date value) {
addCriterion("time >=", value, "time");
return (Criteria) this;
}
public Criteria andTimeLessThan(Date value) {
addCriterion("time <", value, "time");
return (Criteria) this;
}
public Criteria andTimeLessThanOrEqualTo(Date value) {
addCriterion("time <=", value, "time");
return (Criteria) this;
}
public Criteria andTimeIn(List<Date> values) {
addCriterion("time in", values, "time");
return (Criteria) this;
}
public Criteria andTimeNotIn(List<Date> values) {
addCriterion("time not in", values, "time");
return (Criteria) this;
}
public Criteria andTimeBetween(Date value1, Date value2) {
addCriterion("time between", value1, value2, "time");
return (Criteria) this;
}
public Criteria andTimeNotBetween(Date value1, Date value2) {
addCriterion("time not between", value1, value2, "time");
return (Criteria) this;
}
public Criteria andOperatorIsNull() {
addCriterion("operator is null");
return (Criteria) this;
}
public Criteria andOperatorIsNotNull() {
addCriterion("operator is not null");
return (Criteria) this;
}
public Criteria andOperatorEqualTo(Long value) {
addCriterion("operator =", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorNotEqualTo(Long value) {
addCriterion("operator <>", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorGreaterThan(Long value) {
addCriterion("operator >", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorGreaterThanOrEqualTo(Long value) {
addCriterion("operator >=", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorLessThan(Long value) {
addCriterion("operator <", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorLessThanOrEqualTo(Long value) {
addCriterion("operator <=", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorIn(List<Long> values) {
addCriterion("operator in", values, "operator");
return (Criteria) this;
}
public Criteria andOperatorNotIn(List<Long> values) {
addCriterion("operator not in", values, "operator");
return (Criteria) this;
}
public Criteria andOperatorBetween(Long value1, Long value2) {
addCriterion("operator between", value1, value2, "operator");
return (Criteria) this;
}
public Criteria andOperatorNotBetween(Long value1, Long value2) {
addCriterion("operator not between", value1, value2, "operator");
return (Criteria) this;
}
public Criteria andCreatedAtIsNull() {
addCriterion("created_at is null");
return (Criteria) this;
}
public Criteria andCreatedAtIsNotNull() {
addCriterion("created_at is not null");
return (Criteria) this;
}
public Criteria andCreatedAtEqualTo(Date value) {
addCriterion("created_at =", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotEqualTo(Date value) {
addCriterion("created_at <>", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThan(Date value) {
addCriterion("created_at >", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("created_at >=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThan(Date value) {
addCriterion("created_at <", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThanOrEqualTo(Date value) {
addCriterion("created_at <=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtIn(List<Date> values) {
addCriterion("created_at in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotIn(List<Date> values) {
addCriterion("created_at not in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtBetween(Date value1, Date value2) {
addCriterion("created_at between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotBetween(Date value1, Date value2) {
addCriterion("created_at not between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andUpdatedAtIsNull() {
addCriterion("updated_at is null");
return (Criteria) this;
}
public Criteria andUpdatedAtIsNotNull() {
addCriterion("updated_at is not null");
return (Criteria) this;
}
public Criteria andUpdatedAtEqualTo(Date value) {
addCriterion("updated_at =", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotEqualTo(Date value) {
addCriterion("updated_at <>", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtGreaterThan(Date value) {
addCriterion("updated_at >", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("updated_at >=", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtLessThan(Date value) {
addCriterion("updated_at <", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtLessThanOrEqualTo(Date value) {
addCriterion("updated_at <=", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtIn(List<Date> values) {
addCriterion("updated_at in", values, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotIn(List<Date> values) {
addCriterion("updated_at not in", values, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtBetween(Date value1, Date value2) {
addCriterion("updated_at between", value1, value2, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotBetween(Date value1, Date value2) {
addCriterion("updated_at not between", value1, value2, "updatedAt");
return (Criteria) this;
}
public Criteria andRecStatusIsNull() {
addCriterion("rec_status is null");
return (Criteria) this;
}
public Criteria andRecStatusIsNotNull() {
addCriterion("rec_status is not null");
return (Criteria) this;
}
public Criteria andRecStatusEqualTo(Byte value) {
addCriterion("rec_status =", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotEqualTo(Byte value) {
addCriterion("rec_status <>", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusGreaterThan(Byte value) {
addCriterion("rec_status >", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusGreaterThanOrEqualTo(Byte value) {
addCriterion("rec_status >=", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusLessThan(Byte value) {
addCriterion("rec_status <", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusLessThanOrEqualTo(Byte value) {
addCriterion("rec_status <=", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusIn(List<Byte> values) {
addCriterion("rec_status in", values, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotIn(List<Byte> values) {
addCriterion("rec_status not in", values, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusBetween(Byte value1, Byte value2) {
addCriterion("rec_status between", value1, value2, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotBetween(Byte value1, Byte value2) {
addCriterion("rec_status not between", value1, value2, "recStatus");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

37
beneficiation/src/main/java/com/ccsens/beneficiation/bean/vo/WeightVo.java

@ -0,0 +1,37 @@
package com.ccsens.beneficiation.bean.vo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* @author
*/
@Data
public class WeightVo {
@Data
@ApiModel("查看的称重数据折线图")
public static class WeightDay {
@ApiModelProperty("日期")
private String date;
@ApiModelProperty("重量")
private double weight;
}
@Data
@ApiModel("重量累计")
public static class WeightTotal {
@ApiModelProperty("当天累计")
private double weightDay;
@ApiModelProperty("本周累计")
private double weightWeek;
@ApiModelProperty("本月累计")
private double weightMonth;
@ApiModelProperty("本年累计")
private double weightYear;
}
}

31
beneficiation/src/main/java/com/ccsens/beneficiation/config/BeanConfig.java

@ -0,0 +1,31 @@
package com.ccsens.beneficiation.config;
import com.ccsens.beneficiation.intercept.MybatisInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* @description:
* @author: wuHuiJuan
* @create: 2019/12/03 18:01
*/
@Configuration
public class BeanConfig {
// @Bean
// public static PropertySourcesPlaceholderConfigurer properties(){
// PropertySourcesPlaceholderConfigurer conf = new PropertySourcesPlaceholderConfigurer();
// YamlPropertiesFactoryBean yml = new YamlPropertiesFactoryBean();
// yml.setResources(new ClassPathResource("business.yml"));
// conf.setProperties(yml.getObject());
// return conf;
// }
/**
* 注册拦截器
*/
@Bean
public MybatisInterceptor mybatisInterceptor() {
MybatisInterceptor interceptor = new MybatisInterceptor();
return interceptor;
}
}

169
beneficiation/src/main/java/com/ccsens/beneficiation/config/SpringConfig.java

@ -0,0 +1,169 @@
package com.ccsens.beneficiation.config;
import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.util.IdUtil;
import com.ccsens.util.config.DruidProps;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.module.SimpleModule;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.MediaType;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.http.converter.StringHttpMessageConverter;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.web.servlet.config.annotation.*;
import javax.annotation.Resource;
import javax.sql.DataSource;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.List;
@Configuration
//public class SpringConfig extends WebMvcConfigurationSupport {
public class SpringConfig implements WebMvcConfigurer {
@Resource
private DruidProps druidPropsUtil;
@Value("${spring.snowflake.workerId}")
private String workerId;
@Value("${spring.snowflake.datacenterId}")
private String datacenterId;
/**
* 配置Converter
* @return
*/
@Bean
public HttpMessageConverter<String> responseStringConverter() {
StringHttpMessageConverter converter = new StringHttpMessageConverter(
Charset.forName("UTF-8"));
return converter;
}
@Bean
public HttpMessageConverter<Object> responseJsonConverter(){
MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter();
List<MediaType> mediaTypeList = new ArrayList<>();
mediaTypeList.add(MediaType.TEXT_HTML);
mediaTypeList.add(MediaType.APPLICATION_JSON_UTF8);
converter.setSupportedMediaTypes(mediaTypeList);
//converter.setObjectMapper();
ObjectMapper objectMapper = new ObjectMapper();
SimpleModule simpleModule = new SimpleModule();
simpleModule.addSerializer(Long.class, ToStringSerializer.instance);
simpleModule.addSerializer(Long.TYPE, ToStringSerializer.instance);
objectMapper.registerModule(simpleModule);
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
converter.setObjectMapper(objectMapper);
return converter;
}
@Override
public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
//super.configureMessageConverters(converters);
converters.add(responseStringConverter());
converters.add(responseJsonConverter());
}
@Override
public void configureContentNegotiation(ContentNegotiationConfigurer configurer) {
configurer.favorPathExtension(false);
}
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**").allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS")
// .allowedMethods("*") // 允许提交请求的方法,*表示全部允许
.allowedOrigins("*") // #允许向该服务器提交请求的URI,*表示全部允许
.allowCredentials(true) // 允许cookies跨域
.allowedHeaders("*") // #允许访问的头信息,*表示全部
.maxAge(18000L); // 预检请求的缓存时间(秒),即在这个时间段里,对于相同的跨域请求不会再预检了
}
/**
* 配置视图解析器 SpringBoot建议使用Thymeleaf代替jsp动态页面默认路径resources/template静态页面默认路径: resources/static
* @return
*/
// @Bean
// public ViewResolver getViewResolver() {
// InternalResourceViewResolver resolver = new InternalResourceViewResolver();
// resolver.setPrefix("/WEB-INF/views/");
// resolver.setSuffix(".jsp");
// return resolver;
// }
// @Override
// public void configureDefaultServletHandling(
// DefaultServletHandlerConfigurer configurer) {
// configurer.enable();
// }
/**
* 配置静态资源
*/
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("swagger-ui.html")
.addResourceLocations("classpath:/META-INF/resources/");
registry.addResourceHandler("/webjars/**")
.addResourceLocations("classpath:/META-INF/resources/webjars/");
registry.addResourceHandler("/uploads/**")
.addResourceLocations("file:///home/cloud/beneficiation/uploads/");
//super.addResourceHandlers(registry);
}
/**
* 配置拦截器
* @param registry
*/
@Override
public void addInterceptors(InterceptorRegistry registry) {
//addPathPatterns 用于添加拦截规则
//excludePathPatterns 用于排除拦截
// registry.addInterceptor(tokenInterceptor())
// .addPathPatterns("/projects/**")
// .addPathPatterns("/messages/**")
// .addPathPatterns("/users/**")
// .excludePathPatterns("/users/signin")
// .excludePathPatterns("/users/smscode")
// .excludePathPatterns("/users/signup")
// .excludePathPatterns("/users/password")
// .excludePathPatterns("/users/account")
// .excludePathPatterns("/users/token")
// .excludePathPatterns("/users/claims")
// .addPathPatterns("/plugins/**")
// .addPathPatterns("/delivers/**")
// .addPathPatterns("/tasks/**")
// .addPathPatterns("/members/**")
// .addPathPatterns("/templates/**")
// .addPathPatterns("/hardware/**");
//super.addInterceptors(registry);
}
//
// @Bean
// public TokenInterceptor tokenInterceptor(){
// return new TokenInterceptor();
// }
/**
* 配置数据源单数据源
*/
@Bean
public DataSource dataSource(){
return druidPropsUtil.createDruidDataSource();
}
@Bean
public Snowflake snowflake(){
// return new Snowflake(Long.valueOf(workerId),Long.valueOf(datacenterId));
return IdUtil.createSnowflake(Long.valueOf(workerId),Long.valueOf(datacenterId));
}
}

56
beneficiation/src/main/java/com/ccsens/beneficiation/config/SwaggerConfigure.java

@ -0,0 +1,56 @@
package com.ccsens.beneficiation.config;
import com.ccsens.util.WebConstant;
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ParameterBuilder;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.schema.ModelRef;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Parameter;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
import java.util.ArrayList;
import java.util.List;
@Configuration
@EnableSwagger2
@ConditionalOnExpression("${swagger.enable}")
//public class SwaggerConfigure extends WebMvcConfigurationSupport {
public class SwaggerConfigure /*implements WebMvcConfigurer*/ {
@Bean
public Docket customDocket() {
//
return new Docket(DocumentationType.SWAGGER_2)
.apiInfo(apiInfo())
.select()
.apis(RequestHandlerSelectors
.basePackage("com.ccsens.beneficiation.api"))
.build()
.globalOperationParameters(setHeaderToken());
}
private ApiInfo apiInfo() {
return new ApiInfo("Swagger Tall-game",//大标题 title
"This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.",//小标题
"1.0.0",//版本
"http://swagger.io/terms/",//termsOfServiceUrl
"zhangsan",//作者
"Apache 2.0",//链接显示文字
"http://www.apache.org/licenses/LICENSE-2.0.html"//网站链接
);
}
private List<Parameter> setHeaderToken() {
ParameterBuilder tokenPar = new ParameterBuilder();
List<Parameter> pars = new ArrayList<>();
tokenPar.name(WebConstant.HEADER_KEY_TOKEN).description("token")
.defaultValue(WebConstant.HEADER_KEY_TOKEN_PREFIX)
.modelRef(new ModelRef("string")).parameterType("header").required(false).build();
pars.add(tokenPar.build());
return pars;
}
}

159
beneficiation/src/main/java/com/ccsens/beneficiation/intercept/MybatisInterceptor.java

@ -0,0 +1,159 @@
package com.ccsens.beneficiation.intercept;
import cn.hutool.core.collection.CollectionUtil;
import com.ccsens.util.WebConstant;
import org.apache.ibatis.executor.Executor;
import org.apache.ibatis.mapping.BoundSql;
import org.apache.ibatis.mapping.MappedStatement;
import org.apache.ibatis.mapping.ResultMap;
import org.apache.ibatis.mapping.SqlSource;
import org.apache.ibatis.plugin.*;
import org.apache.ibatis.reflection.DefaultReflectorFactory;
import org.apache.ibatis.reflection.MetaObject;
import org.apache.ibatis.reflection.factory.DefaultObjectFactory;
import org.apache.ibatis.reflection.wrapper.DefaultObjectWrapperFactory;
import org.apache.ibatis.session.ResultHandler;
import org.apache.ibatis.session.RowBounds;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.List;
import java.util.Map;
import java.util.Properties;
/**
* @description:
* @author: wuHuiJuan
* @create: 2019/12/11 10:58
*/
@Intercepts({
@Signature(
type = Executor.class,
method = "query",
args = {MappedStatement.class, Object.class, RowBounds.class, ResultHandler.class}
)
})
public class MybatisInterceptor implements Interceptor {
@Override
public Object intercept(Invocation invocation) throws Throwable {
String selectByExample = "selectByExample";
String countByExample = "countByExample";
String countByExample2 = "selectByExample_COUNT";
String selectByPrimaryKey = "selectByPrimaryKey";
Object[] args = invocation.getArgs();
MappedStatement statement = (MappedStatement) args[0];
if (statement.getId().endsWith(selectByExample)
|| statement.getId().endsWith(countByExample)
|| statement.getId().endsWith(countByExample2)) {
//XXXExample
Object example = args[1];
addCondition(statement, example);
} else if (statement.getId().endsWith(selectByPrimaryKey)) {
BoundSql boundSql = statement.getBoundSql(args[1]);
String sql = boundSql.getSql() + " and rec_status = 0";
MappedStatement newStatement = newMappedStatement(statement, new BoundSqlSqlSource(boundSql));
MetaObject msObject = MetaObject.forObject(newStatement, new DefaultObjectFactory(), new DefaultObjectWrapperFactory(),new DefaultReflectorFactory());
msObject.setValue("sqlSource.boundSql.sql", sql);
args[0] = newStatement;
}
return invocation.proceed();
}
private void addCondition(MappedStatement statement, Object example) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException, ClassNotFoundException {
if (example instanceof Map) {
example = ((Map) example).get("_ORIGINAL_PARAMETER_OBJECT");
}
Method method = example.getClass().getMethod("getOredCriteria", null);
//获取到条件数组,第一个是Criteria
List list = (List) method.invoke(example);
if (CollectionUtil.isEmpty(list)) {
Class clazz = ((ResultMap) statement.getResultMaps().get(0)).getType();
String exampleName = clazz.getName() + "Example";
Object paramExample = Class.forName(exampleName).newInstance();
Method createCriteria = paramExample.getClass().getMethod("createCriteria");
Object criteria = createCriteria.invoke(paramExample);
Method andIsDelEqualTo = criteria.getClass().getMethod("andRecStatusEqualTo", Byte.class);
andIsDelEqualTo.invoke(criteria, WebConstant.REC_STATUS.Normal.value);
list.add(criteria);
} else {
Object criteria = list.get(0);
Method getCriteria = criteria.getClass().getMethod("getCriteria");
List params = (List) getCriteria.invoke(criteria);
boolean hasDel = false;
for (Object param : params) {
Method getCondition = param.getClass().getMethod("getCondition");
Object condition = getCondition.invoke(param);
if ("rec_status =".equals(condition)) {
hasDel = true;
}
}
if (!hasDel) {
Method andIsDelEqualTo = criteria.getClass().getMethod("andRecStatusEqualTo", Byte.class);
andIsDelEqualTo.invoke(criteria, WebConstant.REC_STATUS.Normal.value);
}
}
}
@Override
public Object plugin(Object target) {
return Plugin.wrap(target, this);
}
@Override
public void setProperties(Properties properties) {
}
private MappedStatement newMappedStatement(MappedStatement ms, SqlSource newSqlSource) {
MappedStatement.Builder builder =
new MappedStatement.Builder(ms.getConfiguration(), ms.getId(), newSqlSource, ms.getSqlCommandType());
builder.resource(ms.getResource());
builder.fetchSize(ms.getFetchSize());
builder.statementType(ms.getStatementType());
builder.keyGenerator(ms.getKeyGenerator());
if (ms.getKeyProperties() != null && ms.getKeyProperties().length != 0) {
StringBuilder keyProperties = new StringBuilder();
for (String keyProperty : ms.getKeyProperties()) {
keyProperties.append(keyProperty).append(",");
}
keyProperties.delete(keyProperties.length() - 1, keyProperties.length());
builder.keyProperty(keyProperties.toString());
}
builder.timeout(ms.getTimeout());
builder.parameterMap(ms.getParameterMap());
builder.resultMaps(ms.getResultMaps());
builder.resultSetType(ms.getResultSetType());
builder.cache(ms.getCache());
builder.flushCacheRequired(ms.isFlushCacheRequired());
builder.useCache(ms.isUseCache());
return builder.build();
}
// 定义一个内部辅助类,作用是包装sq
class BoundSqlSqlSource implements SqlSource {
private BoundSql boundSql;
public BoundSqlSqlSource(BoundSql boundSql) {
this.boundSql = boundSql;
}
@Override
public BoundSql getBoundSql(Object parameterObject) {
return boundSql;
}
}
}

12
beneficiation/src/main/java/com/ccsens/beneficiation/persist/dao/RecordDao.java

@ -0,0 +1,12 @@
package com.ccsens.beneficiation.persist.dao;
import com.ccsens.beneficiation.bean.po.Record;
import com.ccsens.beneficiation.persist.mapper.RecordMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
@Repository
public interface RecordDao extends RecordMapper {
Record getByTypeAndAuthId(@Param("type") byte type,@Param("authId")String authId);
}

30
beneficiation/src/main/java/com/ccsens/beneficiation/persist/dao/WeightDao.java

@ -0,0 +1,30 @@
package com.ccsens.beneficiation.persist.dao;
import com.ccsens.beneficiation.bean.dto.WeightDto;
import com.ccsens.beneficiation.bean.vo.WeightVo;
import com.ccsens.beneficiation.persist.mapper.WeightMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.Date;
import java.util.List;
/**
* @author
*/
@Repository
public interface WeightDao extends WeightMapper {
/**
* 统计称重数据
* @param param
* @return
*/
List<WeightVo.WeightDay> queryWeightDay(WeightDto.GetWeightByDay param);
/**
* 重量累计
* @param datetime
* @return
*/
WeightVo.WeightTotal queryWeightTotal(@Param("datetime") Date datetime);
}

30
beneficiation/src/main/java/com/ccsens/beneficiation/persist/mapper/AdjustRecordMapper.java

@ -0,0 +1,30 @@
package com.ccsens.beneficiation.persist.mapper;
import com.ccsens.beneficiation.bean.po.AdjustRecord;
import com.ccsens.beneficiation.bean.po.AdjustRecordExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface AdjustRecordMapper {
long countByExample(AdjustRecordExample example);
int deleteByExample(AdjustRecordExample example);
int deleteByPrimaryKey(Long id);
int insert(AdjustRecord record);
int insertSelective(AdjustRecord record);
List<AdjustRecord> selectByExample(AdjustRecordExample example);
AdjustRecord selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") AdjustRecord record, @Param("example") AdjustRecordExample example);
int updateByExample(@Param("record") AdjustRecord record, @Param("example") AdjustRecordExample example);
int updateByPrimaryKeySelective(AdjustRecord record);
int updateByPrimaryKey(AdjustRecord record);
}

30
beneficiation/src/main/java/com/ccsens/beneficiation/persist/mapper/EquipmentMapper.java

@ -0,0 +1,30 @@
package com.ccsens.beneficiation.persist.mapper;
import com.ccsens.beneficiation.bean.po.Equipment;
import com.ccsens.beneficiation.bean.po.EquipmentExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface EquipmentMapper {
long countByExample(EquipmentExample example);
int deleteByExample(EquipmentExample example);
int deleteByPrimaryKey(Long id);
int insert(Equipment record);
int insertSelective(Equipment record);
List<Equipment> selectByExample(EquipmentExample example);
Equipment selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") Equipment record, @Param("example") EquipmentExample example);
int updateByExample(@Param("record") Equipment record, @Param("example") EquipmentExample example);
int updateByPrimaryKeySelective(Equipment record);
int updateByPrimaryKey(Equipment record);
}

30
beneficiation/src/main/java/com/ccsens/beneficiation/persist/mapper/RecordMapper.java

@ -0,0 +1,30 @@
package com.ccsens.beneficiation.persist.mapper;
import com.ccsens.beneficiation.bean.po.Record;
import com.ccsens.beneficiation.bean.po.RecordExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface RecordMapper {
long countByExample(RecordExample example);
int deleteByExample(RecordExample example);
int deleteByPrimaryKey(Long id);
int insert(Record record);
int insertSelective(Record record);
List<Record> selectByExample(RecordExample example);
Record selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") Record record, @Param("example") RecordExample example);
int updateByExample(@Param("record") Record record, @Param("example") RecordExample example);
int updateByPrimaryKeySelective(Record record);
int updateByPrimaryKey(Record record);
}

30
beneficiation/src/main/java/com/ccsens/beneficiation/persist/mapper/ThresholdValueMapper.java

@ -0,0 +1,30 @@
package com.ccsens.beneficiation.persist.mapper;
import com.ccsens.beneficiation.bean.po.ThresholdValue;
import com.ccsens.beneficiation.bean.po.ThresholdValueExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface ThresholdValueMapper {
long countByExample(ThresholdValueExample example);
int deleteByExample(ThresholdValueExample example);
int deleteByPrimaryKey(Long id);
int insert(ThresholdValue record);
int insertSelective(ThresholdValue record);
List<ThresholdValue> selectByExample(ThresholdValueExample example);
ThresholdValue selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") ThresholdValue record, @Param("example") ThresholdValueExample example);
int updateByExample(@Param("record") ThresholdValue record, @Param("example") ThresholdValueExample example);
int updateByPrimaryKeySelective(ThresholdValue record);
int updateByPrimaryKey(ThresholdValue record);
}

30
beneficiation/src/main/java/com/ccsens/beneficiation/persist/mapper/WeightMapper.java

@ -0,0 +1,30 @@
package com.ccsens.beneficiation.persist.mapper;
import com.ccsens.beneficiation.bean.po.Weight;
import com.ccsens.beneficiation.bean.po.WeightExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface WeightMapper {
long countByExample(WeightExample example);
int deleteByExample(WeightExample example);
int deleteByPrimaryKey(Long id);
int insert(Weight record);
int insertSelective(Weight record);
List<Weight> selectByExample(WeightExample example);
Weight selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") Weight record, @Param("example") WeightExample example);
int updateByExample(@Param("record") Weight record, @Param("example") WeightExample example);
int updateByPrimaryKeySelective(Weight record);
int updateByPrimaryKey(Weight record);
}

60
beneficiation/src/main/java/com/ccsens/beneficiation/rabbitMQ/RabbitController.java

@ -0,0 +1,60 @@
package com.ccsens.beneficiation.rabbitMQ;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONObject;
import com.ccsens.beneficiation.bean.dto.Message.BeneficiationMessageDto;
import com.ccsens.beneficiation.service.IRecordService;
import com.ccsens.util.RedisUtil;
import com.ccsens.util.bean.message.common.OutMessage;
import com.ccsens.util.bean.message.common.OutMessageSet;
import com.ccsens.util.config.RabbitMQConfig;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.*;
/**
* @author
*/
@Slf4j
@Component
@RabbitListener(queues = RabbitMQConfig.BENEFICIATION)
public class RabbitController {
@Resource
private RedisUtil redisUtil;
@Resource
private IRecordService recordService;
private Logger logger = LoggerFactory.getLogger(RabbitController.class);
@RabbitHandler
public void process(String messageJson) {
logger.info("上传消息数据: {}", messageJson);
try {
OutMessageSet outMessageSet = JSONObject.parseObject(messageJson, OutMessageSet.class);
if (ObjectUtil.isNull(outMessageSet)) {
return;
}
Set<OutMessage> messageSet = outMessageSet.getMessageSet();
if (CollectionUtil.isEmpty(messageSet)) {
return;
}
messageSet.forEach(outMessage -> {
BeneficiationMessageDto carRecordMessageDto = JSONObject.parseObject(outMessage.getData(), BeneficiationMessageDto.class);
recordService.processMessage(carRecordMessageDto);
});
} catch (Exception e) {
log.error("消息JSON转换异常", e);
}
}
}

10
beneficiation/src/main/java/com/ccsens/beneficiation/service/IRecordService.java

@ -0,0 +1,10 @@
package com.ccsens.beneficiation.service;
import com.ccsens.beneficiation.bean.dto.Message.BeneficiationMessageDto;
public interface IRecordService {
/**
* 处理消息消息
*/
void processMessage(BeneficiationMessageDto carRecordMessageDto);
}

25
beneficiation/src/main/java/com/ccsens/beneficiation/service/IWeightService.java

@ -0,0 +1,25 @@
package com.ccsens.beneficiation.service;
import com.ccsens.beneficiation.bean.dto.WeightDto;
import com.ccsens.beneficiation.bean.vo.WeightVo;
import java.util.List;
/**
* @author
*/
public interface IWeightService {
/**
* 统计每天的重量数据
* @param param 设备id和开始结束时间
* @return 返回每天的称重信息
*/
List<WeightVo.WeightDay> queryWeightDay(WeightDto.GetWeightByDay param);
/**
* 重量累计
* @param param 日期
* @return 返回 分别的累计
*/
WeightVo.WeightTotal queryWeightTotal(WeightDto.GetWeightTotal param);
}

128
beneficiation/src/main/java/com/ccsens/beneficiation/service/RecordService.java

@ -0,0 +1,128 @@
package com.ccsens.beneficiation.service;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.lang.Snowflake;
import com.ccsens.beneficiation.bean.dto.Message.BeneficiationMessageDto;
import com.ccsens.beneficiation.bean.po.*;
import com.ccsens.beneficiation.persist.dao.RecordDao;
import com.ccsens.beneficiation.persist.mapper.AdjustRecordMapper;
import com.ccsens.beneficiation.persist.mapper.EquipmentMapper;
import com.ccsens.beneficiation.persist.mapper.ThresholdValueMapper;
import com.ccsens.beneficiation.persist.mapper.WeightMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
@Slf4j
@Service
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public class RecordService implements IRecordService{
@Resource
private RecordDao recordDao;
@Resource
private EquipmentMapper equipmentMapper;
@Resource
private Snowflake snowflake;
@Resource
private WeightMapper weightMapper;
@Resource
private ThresholdValueMapper thresholdValueMapper;
@Resource
private AdjustRecordMapper adjustRecordMapper;
@Override
public void processMessage(BeneficiationMessageDto beneficiation) {
//查找设备。没有则添加一个
Equipment equipment;
EquipmentExample equipmentExample = new EquipmentExample();
equipmentExample.createCriteria().andTypeEqualTo(beneficiation.getType()).andAuthIdEqualTo(beneficiation.getAuthId());
List<Equipment> equipmentList = equipmentMapper.selectByExample(equipmentExample);
if(CollectionUtil.isNotEmpty(equipmentList)){
equipment = equipmentList.get(0);
}else {
equipment = new Equipment();
equipment.setId(snowflake.nextId());
equipment.setType(beneficiation.getType());
equipment.setAuthId(beneficiation.getAuthId());
equipment.setVerion(beneficiation.getVersion());
equipmentMapper.insertSelective(equipment);
}
//判断类型
switch (beneficiation.getType()){
case 5:
//称重信息
Weight weight = new Weight();
weight.setId(snowflake.nextId());
weight.setEquipmentId(equipment.getId());
weight.setWeight(beneficiation.getValue());
weight.setTime(new Date(beneficiation.getTime()));
weightMapper.insertSelective(weight);
break;
case 6:
//添加界限值信息
break;
case 7:
//查找界限值信息
ThresholdValueExample thresholdValueExample = new ThresholdValueExample();
thresholdValueExample.createCriteria().andTypeEqualTo(equipment.getType()).andStagesEqualTo(Byte.parseByte(beneficiation.getValue()));
List<ThresholdValue> thresholdValueList = thresholdValueMapper.selectByExample(thresholdValueExample);
if(CollectionUtil.isNotEmpty(thresholdValueList)){
//添加调整记录
AdjustRecord adjustRecord = new AdjustRecord();
adjustRecord.setId(snowflake.nextId());
adjustRecord.setMonitoringId(equipment.getId());
adjustRecord.setThresholdId(thresholdValueList.get(0).getId());
adjustRecordMapper.insertSelective(adjustRecord);
}
break;
default:
//否则是设备基本信息
saveEquipmentRecord(beneficiation);
}
}
private void saveEquipmentRecord(BeneficiationMessageDto beneficiation) {
//查找设备。没有则添加一个
Long equipmentId;
EquipmentExample equipmentExample = new EquipmentExample();
equipmentExample.createCriteria().andTypeEqualTo(beneficiation.getType()).andAuthIdEqualTo(beneficiation.getAuthId());
List<Equipment> equipmentList = equipmentMapper.selectByExample(equipmentExample);
if(CollectionUtil.isNotEmpty(equipmentList)){
equipmentId = equipmentList.get(0).getId();
}else {
Equipment equipment = new Equipment();
equipment.setId(snowflake.nextId());
equipment.setType(beneficiation.getType());
equipment.setAuthId(beneficiation.getAuthId());
equipment.setVerion(beneficiation.getVersion());
equipmentMapper.insertSelective(equipment);
equipmentId = equipment.getId();
}
// 查询该设备上一条最新信息,如果值相同,则不添加
RecordExample recordExample = new RecordExample();
recordExample.createCriteria().andEquipmentIdEqualTo(equipmentId);
recordExample.setOrderByClause("time DESC Limit 1");
List<Record> records = recordDao.selectByExample(recordExample);
if(CollectionUtil.isEmpty(records)){
Record record = new Record();
record.setId(snowflake.nextId());
record.setEquipmentId(equipmentId);
record.setValue(beneficiation.getValue());
record.setTime(new Date(System.currentTimeMillis()));
recordDao.insertSelective(record);
}else if(!records.get(0).getValue().equalsIgnoreCase(beneficiation.getValue())){
Record record = new Record();
record.setId(snowflake.nextId());
record.setEquipmentId(equipmentId);
record.setValue(beneficiation.getValue());
record.setTime(new Date(System.currentTimeMillis()));
recordDao.insertSelective(record);
}
}
}

33
beneficiation/src/main/java/com/ccsens/beneficiation/service/WeightService.java

@ -0,0 +1,33 @@
package com.ccsens.beneficiation.service;
import com.ccsens.beneficiation.bean.dto.WeightDto;
import com.ccsens.beneficiation.bean.vo.WeightVo;
import com.ccsens.beneficiation.persist.dao.WeightDao;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;
/**
* @author
*/
@Slf4j
@Service
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public class WeightService implements IWeightService{
@Resource
private WeightDao weightDao;
@Override
public List<WeightVo.WeightDay> queryWeightDay(WeightDto.GetWeightByDay param) {
return weightDao.queryWeightDay(param);
}
@Override
public WeightVo.WeightTotal queryWeightTotal(WeightDto.GetWeightTotal param) {
return weightDao.queryWeightTotal(param.getDatetime());
}
}

30
beneficiation/src/main/resources/application-common.yml

@ -0,0 +1,30 @@
logging:
level:
com:
favorites: DEBUG
org:
hibernate: ERROR
springframework:
web: DEBUG
mybatis:
config-location: classpath:mybatis/mybatis-config.xml
mapper-locations: classpath*:mapper_*/*.xml
type-aliases-package: com.ccsens.mtpro.bean
#server:
# tomcat:
# uri-encoding: UTF-8
spring:
http:
encoding:
charset: UTF-8
enabled: true
force: true
log-request-details: true
servlet:
multipart:
max-file-size: 10MB
max-request-size: 100MB
snowflake:
datacenterId: 2
workerId: 2

37
beneficiation/src/main/resources/application-dev.yml

@ -0,0 +1,37 @@
server:
port: 7140
servlet:
context-path:
spring:
application:
name: beneficiation
datasource:
type: com.alibaba.druid.pool.DruidDataSource
rabbitmq:
# host: 192.144.182.42
# host: test.tall.wiki
host: 127.0.0.1
password: guest
port: 5672
username: guest
redis:
database: 0
host: 127.0.0.1
jedis:
pool:
max-active: 200
max-idle: 10
max-wait: -1ms
min-idle: 0
password: ''
port: 6379
timeout: 1000ms
swagger:
enable: true
file:
path: /home/cloud/beneficiation/uploads/
domain: https://test.tall.wiki/gateway/mt/
imgDomain: https://test.tall.wiki/gateway/beneficiation/uploads/
#gameMqName: game_status_wisdom
logging:
path:

40
beneficiation/src/main/resources/application-prod.yml

@ -0,0 +1,40 @@
server:
port: 7140
servlet:
context-path:
spring:
application:
name: beneficiation
datasource:
type: com.alibaba.druid.pool.DruidDataSource
rabbitmq:
host: 127.0.0.1
password: 111111
port: 5672
username: admin
redis:
database: 0
host: 127.0.0.1
jedis:
pool:
max-active: 200
max-idle: 10
max-wait: -1ms
min-idle: 0
# password: ''
password: 'areowqr!@43ef'
port: 6379
timeout: 1000ms
swagger:
enable: true
eureka:
instance:
ip-address: 192.144.182.42
gatewayUrl: https://www.tall.wiki/gateway/
notGatewayUrl: https://www.tall.wiki/
file:
path: /home/cloud/beneficiation/uploads/
signUpUrl: https://www.tall.wiki/compete/
domain: https://www.tall.wiki/gateway/beneficiation/
imgDomain: https://www.tall.wiki/gateway/beneficiation/uploads/

36
beneficiation/src/main/resources/application-test.yml

@ -0,0 +1,36 @@
server:
port: 7140
servlet:
context-path:
spring:
application:
name: beneficiation
datasource:
type: com.alibaba.druid.pool.DruidDataSource
rabbitmq:
host: 127.0.0.1
password: 111111
port: 5672
username: admin
redis:
database: 0
host: 127.0.0.1
jedis:
pool:
max-active: 200
max-idle: 10
max-wait: -1ms
min-idle: 0
password: ''
port: 6379
timeout: 1000ms
swagger:
enable: true
eureka:
instance:
ip-address: 192.168.0.99
file:
path: /home/cloud/beneficiation/uploads/
signUpUrl: https://test.tall.wiki/compete/
domain: https://test.tall.wiki/gateway/beneficiation/
imgDomain: https://test.tall.wiki/gateway/beneficiation/uploads/

6
beneficiation/src/main/resources/application.yml

@ -0,0 +1,6 @@
spring:
profiles:
active: prod
include: common, util-prod

36
beneficiation/src/main/resources/druid-dev.yml

@ -0,0 +1,36 @@
spring:
datasource:
druid:
connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
driverClassName: com.mysql.cj.jdbc.Driver
dynamicUrl: jdbc:mysql://localhost:3306/${schema}
filterExclusions: '*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*'
filterName: druidFilter
filterProfileEnable: true
filterUrlPattern: /*
filters: stat,wall
initialSize: 5
maxActive: 20
maxPoolPreparedStatementPerConnectionSize: 20
maxWait: 60000
minEvictableIdleTimeMillis: 300000
minIdle: 5
# password: 37080c1f223685592316b02dad8816c019290a476e54ebb638f9aa3ba8b6bdb9
password: 68073a279b399baa1fa12cf39bfbb65bfc1480ffee7b659ccc81cf19be8c4473
poolPreparedStatements: true
servletLogSlowSql: true
servletLoginPassword: 111111
servletLoginUsername: druid
servletName: druidServlet
servletResetEnable: true
servletUrlMapping: /druid/*
testOnBorrow: false
testOnReturn: false
testWhileIdle: true
timeBetweenEvictionRunsMillis: 60000
url: jdbc:mysql://49.233.89.188:3306/beneficiation?useUnicode=true&characterEncoding=UTF-8
# url: jdbc:mysql://127.0.0.1/mt?useUnicode=true&characterEncoding=UTF-8
username: root
validationQuery: SELECT 1 FROM DUAL
# env: CCSENS_GAME
env: CCSENS_TALL

33
beneficiation/src/main/resources/druid-prod.yml

@ -0,0 +1,33 @@
spring:
datasource:
druid:
connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
driverClassName: com.mysql.cj.jdbc.Driver
dynamicUrl: jdbc:mysql://localhost:3306/${schema}
filterExclusions: '*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*'
filterName: druidFilter
filterProfileEnable: true
filterUrlPattern: /*
filters: stat,wall
initialSize: 5
maxActive: 20
maxPoolPreparedStatementPerConnectionSize: 20
maxWait: 60000
minEvictableIdleTimeMillis: 300000
minIdle: 5
password:
poolPreparedStatements: true
servletLogSlowSql: true
servletLoginPassword: 111111
servletLoginUsername: druid
servletName: druidServlet
servletResetEnable: true
servletUrlMapping: /druid/*
testOnBorrow: false
testOnReturn: false
testWhileIdle: true
timeBetweenEvictionRunsMillis: 60000
url: jdbc:mysql://127.0.0.1/beneficiation?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true
username: root
validationQuery: SELECT 1 FROM DUAL
env: CCSENS_GAME

33
beneficiation/src/main/resources/druid-test.yml

@ -0,0 +1,33 @@
spring:
datasource:
druid:
connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
driverClassName: com.mysql.cj.jdbc.Driver
dynamicUrl: jdbc:mysql://localhost:3306/${schema}
filterExclusions: '*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*'
filterName: druidFilter
filterProfileEnable: true
filterUrlPattern: /*
filters: stat,wall
initialSize: 5
maxActive: 20
maxPoolPreparedStatementPerConnectionSize: 20
maxWait: 60000
minEvictableIdleTimeMillis: 300000
minIdle: 5
password: 68073a279b399baa1fa12cf39bfbb65bfc1480ffee7b659ccc81cf19be8c4473
poolPreparedStatements: true
servletLogSlowSql: true
servletLoginPassword: 111111
servletLoginUsername: druid
servletName: druidServlet
servletResetEnable: true
servletUrlMapping: /druid/*
testOnBorrow: false
testOnReturn: false
testWhileIdle: true
timeBetweenEvictionRunsMillis: 60000
url: jdbc:mysql://test.tall.wiki/beneficiation?useUnicode=true&characterEncoding=UTF-8
username: root
validationQuery: SELECT 1 FROM DUAL
env: CCSENS_TALL

196
beneficiation/src/main/resources/logback-spring.xml

@ -0,0 +1,196 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- 日志级别从低到高分为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="/home/cloud/ore/log/" />
<!-- 彩色日志 -->
<!-- 彩色日志依赖的渲染类 -->
<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>info</level>
</filter>
<encoder>
<Pattern>${CONSOLE_LOG_PATTERN}</Pattern>
<!-- 设置字符集 -->
<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>
<!--
<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。
-->
<!--开发环境:打印控制台-->
<springProfile name="dev">
<logger name="com.ccsens.ptpro.persist.*" level="debug"/>
</springProfile>
<root level="info">
<appender-ref ref="CONSOLE" />
<appender-ref ref="DEBUG_FILE" />
<appender-ref ref="INFO_FILE" />
<appender-ref ref="WARN_FILE" />
<appender-ref ref="ERROR_FILE" />
</root>
<!--生产环境:输出到文件-->
<!--<springProfile name="pro">-->
<!--<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" />-->
<!--</root>-->
<!--</springProfile>-->
</configuration>

19
beneficiation/src/main/resources/mapper_dao/RecordDao.xml

@ -0,0 +1,19 @@
<?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.ccsens.beneficiation.persist.dao.RecordDao">
<select id="getByTypeAndAuthId" resultType="com.ccsens.beneficiation.bean.po.Record">
SELECT
*
FROM
t_record r LEFT JOIN t_equipment e on r.equipment_id = e.id
WHERE
e.type = #{type}
and e.auth_id = #{authId}
and r.rec_status = 0
and e.rec_status = 0
ORDER BY r.time DESC
LIMIT 1
</select>
</mapper>

73
beneficiation/src/main/resources/mapper_dao/WeightDao.xml

@ -0,0 +1,73 @@
<?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.ccsens.beneficiation.persist.dao.WeightDao">
<select id="queryWeightDay" resultType="com.ccsens.beneficiation.bean.vo.WeightVo$WeightDay">
SELECT
DATE_FORMAT(time, #{dateTypeStr}) as date,
if(#{dateType} = 1,
CONCAT(DATE_FORMAT(time, '%Y'),'-',DATE_FORMAT(time, '%u')+1),
DATE_FORMAT(time, #{dateTypeStr},
)
as date,
sum(weight) as weight
FROM
t_weight
WHERE
equipment_id = #{equipmentId}
and rec_status = 0
<if test="startTime != null">
and time &gt;= startTime
</if>
<if test="endTime != null">
and time &lt;= endTime
</if>
GROUP BY DATE_FORMAT(time, #{dateTypeStr})
</select>
<select id="queryWeightTotal" resultType="com.ccsens.beneficiation.bean.vo.WeightVo$WeightTotal">
SELECT
SUM(CASE a.t WHEN 'day' THEN a.weight ELSE 0 END) as weightDay,
SUM(CASE a.t WHEN 'week' THEN a.weight ELSE 0 END) as weightWeek,
SUM(CASE a.t WHEN 'month' THEN a.weight ELSE 0 END) as weightMonth,
SUM(CASE a.t WHEN 'year' THEN a.weight ELSE 0 END) as weightYear
FROM
(
SELECT
sum(weight) as weight,
'day' as t
FROM
t_weight
WHERE
rec_status = 0
and DATE_FORMAT(time, '%Y-%m-%d') = DATE_FORMAT(#{datetime}, '%Y-%m-%d')
UNION ALL
SELECT
sum(weight) as weight,
'week' as t
FROM
t_weight
WHERE
rec_status = 0
and DATE_FORMAT(time, '%Y-%u') = DATE_FORMAT(#{datetime}, '%Y-%u')
UNION ALL
SELECT
sum(weight) as weight,
'month' as t
FROM
t_weight
WHERE
rec_status = 0
and DATE_FORMAT(time, '%Y-%m') = DATE_FORMAT(#{datetime}, '%Y-%m')
UNION ALL
SELECT
sum(weight) as weight,
'year' as t
FROM
t_weight
WHERE
rec_status = 0
and DATE_FORMAT(time, '%Y') = DATE_FORMAT(#{datetime}, '%Y')
) a
</select>
</mapper>

323
beneficiation/src/main/resources/mapper_raw/AdjustRecordMapper.xml

@ -0,0 +1,323 @@
<?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.ccsens.beneficiation.persist.mapper.AdjustRecordMapper">
<resultMap id="BaseResultMap" type="com.ccsens.beneficiation.bean.po.AdjustRecord">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="time" jdbcType="BIGINT" property="time" />
<result column="monitoring_id" jdbcType="BIGINT" property="monitoringId" />
<result column="monitoring_value" jdbcType="VARCHAR" property="monitoringValue" />
<result column="threshold_id" jdbcType="BIGINT" property="thresholdId" />
<result column="equipment_id" jdbcType="BIGINT" property="equipmentId" />
<result column="before_value" jdbcType="VARCHAR" property="beforeValue" />
<result column="after_value" jdbcType="VARCHAR" property="afterValue" />
<result column="operator" jdbcType="BIGINT" property="operator" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="rec_status" jdbcType="TINYINT" property="recStatus" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, time, monitoring_id, monitoring_value, threshold_id, equipment_id, before_value,
after_value, operator, created_at, updated_at, rec_status
</sql>
<select id="selectByExample" parameterType="com.ccsens.beneficiation.bean.po.AdjustRecordExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from t_adjust_record
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_adjust_record
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from t_adjust_record
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.ccsens.beneficiation.bean.po.AdjustRecordExample">
delete from t_adjust_record
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.ccsens.beneficiation.bean.po.AdjustRecord">
insert into t_adjust_record (id, time, monitoring_id,
monitoring_value, threshold_id, equipment_id,
before_value, after_value, operator,
created_at, updated_at, rec_status
)
values (#{id,jdbcType=BIGINT}, #{time,jdbcType=BIGINT}, #{monitoringId,jdbcType=BIGINT},
#{monitoringValue,jdbcType=VARCHAR}, #{thresholdId,jdbcType=BIGINT}, #{equipmentId,jdbcType=BIGINT},
#{beforeValue,jdbcType=VARCHAR}, #{afterValue,jdbcType=VARCHAR}, #{operator,jdbcType=BIGINT},
#{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT}
)
</insert>
<insert id="insertSelective" parameterType="com.ccsens.beneficiation.bean.po.AdjustRecord">
insert into t_adjust_record
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="time != null">
time,
</if>
<if test="monitoringId != null">
monitoring_id,
</if>
<if test="monitoringValue != null">
monitoring_value,
</if>
<if test="thresholdId != null">
threshold_id,
</if>
<if test="equipmentId != null">
equipment_id,
</if>
<if test="beforeValue != null">
before_value,
</if>
<if test="afterValue != null">
after_value,
</if>
<if test="operator != null">
operator,
</if>
<if test="createdAt != null">
created_at,
</if>
<if test="updatedAt != null">
updated_at,
</if>
<if test="recStatus != null">
rec_status,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="time != null">
#{time,jdbcType=BIGINT},
</if>
<if test="monitoringId != null">
#{monitoringId,jdbcType=BIGINT},
</if>
<if test="monitoringValue != null">
#{monitoringValue,jdbcType=VARCHAR},
</if>
<if test="thresholdId != null">
#{thresholdId,jdbcType=BIGINT},
</if>
<if test="equipmentId != null">
#{equipmentId,jdbcType=BIGINT},
</if>
<if test="beforeValue != null">
#{beforeValue,jdbcType=VARCHAR},
</if>
<if test="afterValue != null">
#{afterValue,jdbcType=VARCHAR},
</if>
<if test="operator != null">
#{operator,jdbcType=BIGINT},
</if>
<if test="createdAt != null">
#{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
#{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
#{recStatus,jdbcType=TINYINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.beneficiation.bean.po.AdjustRecordExample" resultType="java.lang.Long">
select count(*) from t_adjust_record
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update t_adjust_record
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.time != null">
time = #{record.time,jdbcType=BIGINT},
</if>
<if test="record.monitoringId != null">
monitoring_id = #{record.monitoringId,jdbcType=BIGINT},
</if>
<if test="record.monitoringValue != null">
monitoring_value = #{record.monitoringValue,jdbcType=VARCHAR},
</if>
<if test="record.thresholdId != null">
threshold_id = #{record.thresholdId,jdbcType=BIGINT},
</if>
<if test="record.equipmentId != null">
equipment_id = #{record.equipmentId,jdbcType=BIGINT},
</if>
<if test="record.beforeValue != null">
before_value = #{record.beforeValue,jdbcType=VARCHAR},
</if>
<if test="record.afterValue != null">
after_value = #{record.afterValue,jdbcType=VARCHAR},
</if>
<if test="record.operator != null">
operator = #{record.operator,jdbcType=BIGINT},
</if>
<if test="record.createdAt != null">
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
</if>
<if test="record.updatedAt != null">
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="record.recStatus != null">
rec_status = #{record.recStatus,jdbcType=TINYINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update t_adjust_record
set id = #{record.id,jdbcType=BIGINT},
time = #{record.time,jdbcType=BIGINT},
monitoring_id = #{record.monitoringId,jdbcType=BIGINT},
monitoring_value = #{record.monitoringValue,jdbcType=VARCHAR},
threshold_id = #{record.thresholdId,jdbcType=BIGINT},
equipment_id = #{record.equipmentId,jdbcType=BIGINT},
before_value = #{record.beforeValue,jdbcType=VARCHAR},
after_value = #{record.afterValue,jdbcType=VARCHAR},
operator = #{record.operator,jdbcType=BIGINT},
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
rec_status = #{record.recStatus,jdbcType=TINYINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.ccsens.beneficiation.bean.po.AdjustRecord">
update t_adjust_record
<set>
<if test="time != null">
time = #{time,jdbcType=BIGINT},
</if>
<if test="monitoringId != null">
monitoring_id = #{monitoringId,jdbcType=BIGINT},
</if>
<if test="monitoringValue != null">
monitoring_value = #{monitoringValue,jdbcType=VARCHAR},
</if>
<if test="thresholdId != null">
threshold_id = #{thresholdId,jdbcType=BIGINT},
</if>
<if test="equipmentId != null">
equipment_id = #{equipmentId,jdbcType=BIGINT},
</if>
<if test="beforeValue != null">
before_value = #{beforeValue,jdbcType=VARCHAR},
</if>
<if test="afterValue != null">
after_value = #{afterValue,jdbcType=VARCHAR},
</if>
<if test="operator != null">
operator = #{operator,jdbcType=BIGINT},
</if>
<if test="createdAt != null">
created_at = #{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
rec_status = #{recStatus,jdbcType=TINYINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.ccsens.beneficiation.bean.po.AdjustRecord">
update t_adjust_record
set time = #{time,jdbcType=BIGINT},
monitoring_id = #{monitoringId,jdbcType=BIGINT},
monitoring_value = #{monitoringValue,jdbcType=VARCHAR},
threshold_id = #{thresholdId,jdbcType=BIGINT},
equipment_id = #{equipmentId,jdbcType=BIGINT},
before_value = #{beforeValue,jdbcType=VARCHAR},
after_value = #{afterValue,jdbcType=VARCHAR},
operator = #{operator,jdbcType=BIGINT},
created_at = #{createdAt,jdbcType=TIMESTAMP},
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
rec_status = #{recStatus,jdbcType=TINYINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

275
beneficiation/src/main/resources/mapper_raw/EquipmentMapper.xml

@ -0,0 +1,275 @@
<?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.ccsens.beneficiation.persist.mapper.EquipmentMapper">
<resultMap id="BaseResultMap" type="com.ccsens.beneficiation.bean.po.Equipment">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="type" jdbcType="TINYINT" property="type" />
<result column="auth_id" jdbcType="VARCHAR" property="authId" />
<result column="addr" jdbcType="VARCHAR" property="addr" />
<result column="verion" jdbcType="VARCHAR" property="verion" />
<result column="operator" jdbcType="BIGINT" property="operator" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="rec_status" jdbcType="TINYINT" property="recStatus" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, type, auth_id, addr, verion, operator, created_at, updated_at, rec_status
</sql>
<select id="selectByExample" parameterType="com.ccsens.beneficiation.bean.po.EquipmentExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from t_equipment
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_equipment
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from t_equipment
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.ccsens.beneficiation.bean.po.EquipmentExample">
delete from t_equipment
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.ccsens.beneficiation.bean.po.Equipment">
insert into t_equipment (id, type, auth_id,
addr, verion, operator,
created_at, updated_at, rec_status
)
values (#{id,jdbcType=BIGINT}, #{type,jdbcType=TINYINT}, #{authId,jdbcType=VARCHAR},
#{addr,jdbcType=VARCHAR}, #{verion,jdbcType=VARCHAR}, #{operator,jdbcType=BIGINT},
#{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT}
)
</insert>
<insert id="insertSelective" parameterType="com.ccsens.beneficiation.bean.po.Equipment">
insert into t_equipment
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="type != null">
type,
</if>
<if test="authId != null">
auth_id,
</if>
<if test="addr != null">
addr,
</if>
<if test="verion != null">
verion,
</if>
<if test="operator != null">
operator,
</if>
<if test="createdAt != null">
created_at,
</if>
<if test="updatedAt != null">
updated_at,
</if>
<if test="recStatus != null">
rec_status,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="type != null">
#{type,jdbcType=TINYINT},
</if>
<if test="authId != null">
#{authId,jdbcType=VARCHAR},
</if>
<if test="addr != null">
#{addr,jdbcType=VARCHAR},
</if>
<if test="verion != null">
#{verion,jdbcType=VARCHAR},
</if>
<if test="operator != null">
#{operator,jdbcType=BIGINT},
</if>
<if test="createdAt != null">
#{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
#{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
#{recStatus,jdbcType=TINYINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.beneficiation.bean.po.EquipmentExample" resultType="java.lang.Long">
select count(*) from t_equipment
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update t_equipment
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.type != null">
type = #{record.type,jdbcType=TINYINT},
</if>
<if test="record.authId != null">
auth_id = #{record.authId,jdbcType=VARCHAR},
</if>
<if test="record.addr != null">
addr = #{record.addr,jdbcType=VARCHAR},
</if>
<if test="record.verion != null">
verion = #{record.verion,jdbcType=VARCHAR},
</if>
<if test="record.operator != null">
operator = #{record.operator,jdbcType=BIGINT},
</if>
<if test="record.createdAt != null">
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
</if>
<if test="record.updatedAt != null">
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="record.recStatus != null">
rec_status = #{record.recStatus,jdbcType=TINYINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update t_equipment
set id = #{record.id,jdbcType=BIGINT},
type = #{record.type,jdbcType=TINYINT},
auth_id = #{record.authId,jdbcType=VARCHAR},
addr = #{record.addr,jdbcType=VARCHAR},
verion = #{record.verion,jdbcType=VARCHAR},
operator = #{record.operator,jdbcType=BIGINT},
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
rec_status = #{record.recStatus,jdbcType=TINYINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.ccsens.beneficiation.bean.po.Equipment">
update t_equipment
<set>
<if test="type != null">
type = #{type,jdbcType=TINYINT},
</if>
<if test="authId != null">
auth_id = #{authId,jdbcType=VARCHAR},
</if>
<if test="addr != null">
addr = #{addr,jdbcType=VARCHAR},
</if>
<if test="verion != null">
verion = #{verion,jdbcType=VARCHAR},
</if>
<if test="operator != null">
operator = #{operator,jdbcType=BIGINT},
</if>
<if test="createdAt != null">
created_at = #{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
rec_status = #{recStatus,jdbcType=TINYINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.ccsens.beneficiation.bean.po.Equipment">
update t_equipment
set type = #{type,jdbcType=TINYINT},
auth_id = #{authId,jdbcType=VARCHAR},
addr = #{addr,jdbcType=VARCHAR},
verion = #{verion,jdbcType=VARCHAR},
operator = #{operator,jdbcType=BIGINT},
created_at = #{createdAt,jdbcType=TIMESTAMP},
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
rec_status = #{recStatus,jdbcType=TINYINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

258
beneficiation/src/main/resources/mapper_raw/RecordMapper.xml

@ -0,0 +1,258 @@
<?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.ccsens.beneficiation.persist.mapper.RecordMapper">
<resultMap id="BaseResultMap" type="com.ccsens.beneficiation.bean.po.Record">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="equipment_id" jdbcType="BIGINT" property="equipmentId" />
<result column="value" jdbcType="VARCHAR" property="value" />
<result column="time" jdbcType="TIMESTAMP" property="time" />
<result column="operator" jdbcType="BIGINT" property="operator" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="rec_status" jdbcType="TINYINT" property="recStatus" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, equipment_id, value, time, operator, created_at, updated_at, rec_status
</sql>
<select id="selectByExample" parameterType="com.ccsens.beneficiation.bean.po.RecordExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from t_record
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_record
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from t_record
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.ccsens.beneficiation.bean.po.RecordExample">
delete from t_record
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.ccsens.beneficiation.bean.po.Record">
insert into t_record (id, equipment_id, value,
time, operator, created_at,
updated_at, rec_status)
values (#{id,jdbcType=BIGINT}, #{equipmentId,jdbcType=BIGINT}, #{value,jdbcType=VARCHAR},
#{time,jdbcType=TIMESTAMP}, #{operator,jdbcType=BIGINT}, #{createdAt,jdbcType=TIMESTAMP},
#{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT})
</insert>
<insert id="insertSelective" parameterType="com.ccsens.beneficiation.bean.po.Record">
insert into t_record
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="equipmentId != null">
equipment_id,
</if>
<if test="value != null">
value,
</if>
<if test="time != null">
time,
</if>
<if test="operator != null">
operator,
</if>
<if test="createdAt != null">
created_at,
</if>
<if test="updatedAt != null">
updated_at,
</if>
<if test="recStatus != null">
rec_status,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="equipmentId != null">
#{equipmentId,jdbcType=BIGINT},
</if>
<if test="value != null">
#{value,jdbcType=VARCHAR},
</if>
<if test="time != null">
#{time,jdbcType=TIMESTAMP},
</if>
<if test="operator != null">
#{operator,jdbcType=BIGINT},
</if>
<if test="createdAt != null">
#{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
#{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
#{recStatus,jdbcType=TINYINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.beneficiation.bean.po.RecordExample" resultType="java.lang.Long">
select count(*) from t_record
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update t_record
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.equipmentId != null">
equipment_id = #{record.equipmentId,jdbcType=BIGINT},
</if>
<if test="record.value != null">
value = #{record.value,jdbcType=VARCHAR},
</if>
<if test="record.time != null">
time = #{record.time,jdbcType=TIMESTAMP},
</if>
<if test="record.operator != null">
operator = #{record.operator,jdbcType=BIGINT},
</if>
<if test="record.createdAt != null">
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
</if>
<if test="record.updatedAt != null">
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="record.recStatus != null">
rec_status = #{record.recStatus,jdbcType=TINYINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update t_record
set id = #{record.id,jdbcType=BIGINT},
equipment_id = #{record.equipmentId,jdbcType=BIGINT},
value = #{record.value,jdbcType=VARCHAR},
time = #{record.time,jdbcType=TIMESTAMP},
operator = #{record.operator,jdbcType=BIGINT},
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
rec_status = #{record.recStatus,jdbcType=TINYINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.ccsens.beneficiation.bean.po.Record">
update t_record
<set>
<if test="equipmentId != null">
equipment_id = #{equipmentId,jdbcType=BIGINT},
</if>
<if test="value != null">
value = #{value,jdbcType=VARCHAR},
</if>
<if test="time != null">
time = #{time,jdbcType=TIMESTAMP},
</if>
<if test="operator != null">
operator = #{operator,jdbcType=BIGINT},
</if>
<if test="createdAt != null">
created_at = #{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
rec_status = #{recStatus,jdbcType=TINYINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.ccsens.beneficiation.bean.po.Record">
update t_record
set equipment_id = #{equipmentId,jdbcType=BIGINT},
value = #{value,jdbcType=VARCHAR},
time = #{time,jdbcType=TIMESTAMP},
operator = #{operator,jdbcType=BIGINT},
created_at = #{createdAt,jdbcType=TIMESTAMP},
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
rec_status = #{recStatus,jdbcType=TINYINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

275
beneficiation/src/main/resources/mapper_raw/ThresholdValueMapper.xml

@ -0,0 +1,275 @@
<?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.ccsens.beneficiation.persist.mapper.ThresholdValueMapper">
<resultMap id="BaseResultMap" type="com.ccsens.beneficiation.bean.po.ThresholdValue">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="type" jdbcType="TINYINT" property="type" />
<result column="stages" jdbcType="TINYINT" property="stages" />
<result column="max" jdbcType="INTEGER" property="max" />
<result column="min" jdbcType="INTEGER" property="min" />
<result column="operator" jdbcType="BIGINT" property="operator" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="rec_status" jdbcType="TINYINT" property="recStatus" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, type, stages, max, min, operator, created_at, updated_at, rec_status
</sql>
<select id="selectByExample" parameterType="com.ccsens.beneficiation.bean.po.ThresholdValueExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from t_threshold_value
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_threshold_value
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from t_threshold_value
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.ccsens.beneficiation.bean.po.ThresholdValueExample">
delete from t_threshold_value
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.ccsens.beneficiation.bean.po.ThresholdValue">
insert into t_threshold_value (id, type, stages,
max, min, operator,
created_at, updated_at, rec_status
)
values (#{id,jdbcType=BIGINT}, #{type,jdbcType=TINYINT}, #{stages,jdbcType=TINYINT},
#{max,jdbcType=INTEGER}, #{min,jdbcType=INTEGER}, #{operator,jdbcType=BIGINT},
#{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT}
)
</insert>
<insert id="insertSelective" parameterType="com.ccsens.beneficiation.bean.po.ThresholdValue">
insert into t_threshold_value
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="type != null">
type,
</if>
<if test="stages != null">
stages,
</if>
<if test="max != null">
max,
</if>
<if test="min != null">
min,
</if>
<if test="operator != null">
operator,
</if>
<if test="createdAt != null">
created_at,
</if>
<if test="updatedAt != null">
updated_at,
</if>
<if test="recStatus != null">
rec_status,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="type != null">
#{type,jdbcType=TINYINT},
</if>
<if test="stages != null">
#{stages,jdbcType=TINYINT},
</if>
<if test="max != null">
#{max,jdbcType=INTEGER},
</if>
<if test="min != null">
#{min,jdbcType=INTEGER},
</if>
<if test="operator != null">
#{operator,jdbcType=BIGINT},
</if>
<if test="createdAt != null">
#{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
#{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
#{recStatus,jdbcType=TINYINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.beneficiation.bean.po.ThresholdValueExample" resultType="java.lang.Long">
select count(*) from t_threshold_value
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update t_threshold_value
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.type != null">
type = #{record.type,jdbcType=TINYINT},
</if>
<if test="record.stages != null">
stages = #{record.stages,jdbcType=TINYINT},
</if>
<if test="record.max != null">
max = #{record.max,jdbcType=INTEGER},
</if>
<if test="record.min != null">
min = #{record.min,jdbcType=INTEGER},
</if>
<if test="record.operator != null">
operator = #{record.operator,jdbcType=BIGINT},
</if>
<if test="record.createdAt != null">
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
</if>
<if test="record.updatedAt != null">
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="record.recStatus != null">
rec_status = #{record.recStatus,jdbcType=TINYINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update t_threshold_value
set id = #{record.id,jdbcType=BIGINT},
type = #{record.type,jdbcType=TINYINT},
stages = #{record.stages,jdbcType=TINYINT},
max = #{record.max,jdbcType=INTEGER},
min = #{record.min,jdbcType=INTEGER},
operator = #{record.operator,jdbcType=BIGINT},
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
rec_status = #{record.recStatus,jdbcType=TINYINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.ccsens.beneficiation.bean.po.ThresholdValue">
update t_threshold_value
<set>
<if test="type != null">
type = #{type,jdbcType=TINYINT},
</if>
<if test="stages != null">
stages = #{stages,jdbcType=TINYINT},
</if>
<if test="max != null">
max = #{max,jdbcType=INTEGER},
</if>
<if test="min != null">
min = #{min,jdbcType=INTEGER},
</if>
<if test="operator != null">
operator = #{operator,jdbcType=BIGINT},
</if>
<if test="createdAt != null">
created_at = #{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
rec_status = #{recStatus,jdbcType=TINYINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.ccsens.beneficiation.bean.po.ThresholdValue">
update t_threshold_value
set type = #{type,jdbcType=TINYINT},
stages = #{stages,jdbcType=TINYINT},
max = #{max,jdbcType=INTEGER},
min = #{min,jdbcType=INTEGER},
operator = #{operator,jdbcType=BIGINT},
created_at = #{createdAt,jdbcType=TIMESTAMP},
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
rec_status = #{recStatus,jdbcType=TINYINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

258
beneficiation/src/main/resources/mapper_raw/WeightMapper.xml

@ -0,0 +1,258 @@
<?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.ccsens.beneficiation.persist.mapper.WeightMapper">
<resultMap id="BaseResultMap" type="com.ccsens.beneficiation.bean.po.Weight">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="equipment_id" jdbcType="BIGINT" property="equipmentId" />
<result column="weight" jdbcType="VARCHAR" property="weight" />
<result column="time" jdbcType="TIMESTAMP" property="time" />
<result column="operator" jdbcType="BIGINT" property="operator" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="rec_status" jdbcType="TINYINT" property="recStatus" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, equipment_id, weight, time, operator, created_at, updated_at, rec_status
</sql>
<select id="selectByExample" parameterType="com.ccsens.beneficiation.bean.po.WeightExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from t_weight
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_weight
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from t_weight
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.ccsens.beneficiation.bean.po.WeightExample">
delete from t_weight
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.ccsens.beneficiation.bean.po.Weight">
insert into t_weight (id, equipment_id, weight,
time, operator, created_at,
updated_at, rec_status)
values (#{id,jdbcType=BIGINT}, #{equipmentId,jdbcType=BIGINT}, #{weight,jdbcType=VARCHAR},
#{time,jdbcType=TIMESTAMP}, #{operator,jdbcType=BIGINT}, #{createdAt,jdbcType=TIMESTAMP},
#{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT})
</insert>
<insert id="insertSelective" parameterType="com.ccsens.beneficiation.bean.po.Weight">
insert into t_weight
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="equipmentId != null">
equipment_id,
</if>
<if test="weight != null">
weight,
</if>
<if test="time != null">
time,
</if>
<if test="operator != null">
operator,
</if>
<if test="createdAt != null">
created_at,
</if>
<if test="updatedAt != null">
updated_at,
</if>
<if test="recStatus != null">
rec_status,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="equipmentId != null">
#{equipmentId,jdbcType=BIGINT},
</if>
<if test="weight != null">
#{weight,jdbcType=VARCHAR},
</if>
<if test="time != null">
#{time,jdbcType=TIMESTAMP},
</if>
<if test="operator != null">
#{operator,jdbcType=BIGINT},
</if>
<if test="createdAt != null">
#{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
#{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
#{recStatus,jdbcType=TINYINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.beneficiation.bean.po.WeightExample" resultType="java.lang.Long">
select count(*) from t_weight
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update t_weight
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.equipmentId != null">
equipment_id = #{record.equipmentId,jdbcType=BIGINT},
</if>
<if test="record.weight != null">
weight = #{record.weight,jdbcType=VARCHAR},
</if>
<if test="record.time != null">
time = #{record.time,jdbcType=TIMESTAMP},
</if>
<if test="record.operator != null">
operator = #{record.operator,jdbcType=BIGINT},
</if>
<if test="record.createdAt != null">
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
</if>
<if test="record.updatedAt != null">
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="record.recStatus != null">
rec_status = #{record.recStatus,jdbcType=TINYINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update t_weight
set id = #{record.id,jdbcType=BIGINT},
equipment_id = #{record.equipmentId,jdbcType=BIGINT},
weight = #{record.weight,jdbcType=VARCHAR},
time = #{record.time,jdbcType=TIMESTAMP},
operator = #{record.operator,jdbcType=BIGINT},
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
rec_status = #{record.recStatus,jdbcType=TINYINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.ccsens.beneficiation.bean.po.Weight">
update t_weight
<set>
<if test="equipmentId != null">
equipment_id = #{equipmentId,jdbcType=BIGINT},
</if>
<if test="weight != null">
weight = #{weight,jdbcType=VARCHAR},
</if>
<if test="time != null">
time = #{time,jdbcType=TIMESTAMP},
</if>
<if test="operator != null">
operator = #{operator,jdbcType=BIGINT},
</if>
<if test="createdAt != null">
created_at = #{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
rec_status = #{recStatus,jdbcType=TINYINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.ccsens.beneficiation.bean.po.Weight">
update t_weight
set equipment_id = #{equipmentId,jdbcType=BIGINT},
weight = #{weight,jdbcType=VARCHAR},
time = #{time,jdbcType=TIMESTAMP},
operator = #{operator,jdbcType=BIGINT},
created_at = #{createdAt,jdbcType=TIMESTAMP},
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
rec_status = #{recStatus,jdbcType=TINYINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

62
beneficiation/src/main/resources/mybatis/mybatis-config.xml

@ -0,0 +1,62 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
<!-- 全局参数 -->
<settings>
<!-- 打印SQL语句 -->
<setting name="logImpl" value="STDOUT_LOGGING" />
<!-- 使全局的映射器启用或禁用缓存。 -->
<setting name="cacheEnabled" value="true"/>
<!-- 全局启用或禁用延迟加载。当禁用时,所有关联对象都会即时加载。 -->
<setting name="lazyLoadingEnabled" value="true"/>
<!-- 当启用时,有延迟加载属性的对象在被调用时将会完全加载任意属性。否则,每种属性将会按需要加载。 -->
<setting name="aggressiveLazyLoading" value="true"/>
<!-- 是否允许单条sql 返回多个数据集 (取决于驱动的兼容性) default:true -->
<setting name="multipleResultSetsEnabled" value="true"/>
<!-- 是否可以使用列的别名 (取决于驱动的兼容性) default:true -->
<setting name="useColumnLabel" value="true"/>
<!-- 允许JDBC 生成主键。需要驱动器支持。如果设为了true,这个设置将强制使用被生成的主键,有一些驱动器不兼容不过仍然可以执行。 default:false -->
<setting name="useGeneratedKeys" value="true"/>
<!-- 指定 MyBatis 如何自动映射 数据基表的列 NONE:不隐射 PARTIAL:部分 FULL:全部 -->
<setting name="autoMappingBehavior" value="PARTIAL"/>
<!-- 这是默认的执行类型 (SIMPLE: 简单; REUSE: 执行器可能重复使用prepared statements语句;BATCH: 执行器可以重复执行语句和批量更新) -->
<setting name="defaultExecutorType" value="SIMPLE"/>
<!-- 使用驼峰命名法转换字段。 -->
<setting name="mapUnderscoreToCamelCase" value="true"/>
<!-- 设置本地缓存范围 session:就会有数据的共享 statement:语句范围 (这样就不会有数据的共享 ) defalut:session -->
<setting name="localCacheScope" value="SESSION"/>
<!-- 设置但JDBC类型为空时,某些驱动程序 要指定值,default:OTHER,插入空值时不需要指定类型 -->
<setting name="jdbcTypeForNull" value="NULL"/>
</settings>
<typeAliases>
<typeAlias alias="Integer" type="java.lang.Integer" />
<typeAlias alias="Long" type="java.lang.Long" />
<typeAlias alias="HashMap" type="java.util.HashMap" />
<typeAlias alias="LinkedHashMap" type="java.util.LinkedHashMap" />
<typeAlias alias="ArrayList" type="java.util.ArrayList" />
<typeAlias alias="LinkedList" type="java.util.LinkedList" />
<typeAlias alias="String" type="java.lang.String" />
</typeAliases>
<plugins>
<!-- com.github.pagehelper为PageHelper类所在包名 -->
<plugin interceptor="com.github.pagehelper.PageHelper">
<property name="dialect" value="mysql"/>
<!-- 该参数默认为false -->
<!-- 设置为true时,会将RowBounds第一个参数offset当成pageNum页码使用 -->
<!-- 和startPage中的pageNum效果一样-->
<property name="offsetAsPageNum" value="false"/>
<!-- 该参数默认为false -->
<!-- 设置为true时,使用RowBounds分页会进行count查询 -->
<property name="rowBoundsWithCount" value="false"/>
<property name="pageSizeZero" value="true"/>
<property name="reasonable" value="false"/>
<property name="supportMethodsArguments" value="false"/>
<property name="returnPageInfo" value="none"/>
</plugin>
</plugins>
</configuration>

3
pom.xml

@ -13,7 +13,8 @@
<!-- <module>game</module>--> <!-- <module>game</module>-->
<!-- <module>mt</module>--> <!-- <module>mt</module>-->
<module>wisdomcar</module> <module>wisdomcar</module>
<module>form</module> <module>beneficiation</module>
<!-- <module>form</module>-->
<!-- <module>signin</module>--> <!-- <module>signin</module>-->
<!-- <module>pims</module>--> <!-- <module>pims</module>-->
<!-- <module>health</module>--> <!-- <module>health</module>-->

10
tall/src/main/java/com/ccsens/tall/bean/dto/PluginDto.java

@ -114,4 +114,14 @@ public class PluginDto {
} }
} }
@Data
@ApiModel("获取每日会议记录")
public static class GetMinutesDay {
@ApiModelProperty("任务日期id")
@NotNull(message = "任务id不能为空")
private Long taskId;
}
} }

26
tall/src/main/java/com/ccsens/tall/bean/vo/RoleVo.java

@ -4,6 +4,8 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.util.List;
/** /**
* @author * @author
*/ */
@ -30,4 +32,28 @@ public class RoleVo {
@ApiModelProperty("userId") @ApiModelProperty("userId")
private Long userId; private Long userId;
} }
@Data
@ApiModel("角色下的任务")
public static class RoleTask{
@ApiModelProperty("角色id")
private Long roleId;
@ApiModelProperty("角色名")
private String roleName;
@ApiModelProperty("任务名")
private List<RoleTaskInfo> taskList;
}
@Data
@ApiModel("角色下的任务详情")
public static class RoleTaskInfo{
@ApiModelProperty("任务日期id")
private Long taskId;
@ApiModelProperty("任务详情id")
private Long detailId;
@ApiModelProperty("任务名")
private String taskName;
@ApiModelProperty("检查人")
private String checkerName;
}
} }

9
tall/src/main/java/com/ccsens/tall/persist/dao/ProRoleDao.java

@ -60,6 +60,15 @@ public interface ProRoleDao extends ProRoleMapper{
*/ */
List<RoleVo.RoleByProjectId> queryRoleByProjectId(@Param("projectId")Long projectId); List<RoleVo.RoleByProjectId> queryRoleByProjectId(@Param("projectId")Long projectId);
/**
* 获取项目下每个角色当天的任务
* @param projectId 项目id
* @param thisDayStartTime 今天的开始时间
* @param thisDayEndTime 今天的结束时间
* @return 返回
*/
List<RoleVo.RoleTask> getRoleTaskByProjectId(@Param("projectId")Long projectId, @Param("thisDayStartTime")long thisDayStartTime, @Param("thisDayEndTime")long thisDayEndTime);
// /** // /**
// * 查找项目下的所有成员的名字用“,”分隔 // * 查找项目下的所有成员的名字用“,”分隔
// * @param projectId 项目id // * @param projectId 项目id

2
tall/src/main/java/com/ccsens/tall/service/ExportWbsService.java

@ -14,7 +14,6 @@ import com.ccsens.tall.persist.dao.*;
import com.ccsens.util.PoiUtil; import com.ccsens.util.PoiUtil;
import com.ccsens.util.PropUtil; import com.ccsens.util.PropUtil;
import com.ccsens.util.WebConstant; import com.ccsens.util.WebConstant;
import lombok.Data;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.apache.poi.xssf.usermodel.XSSFWorkbook;
@ -24,7 +23,6 @@ import org.springframework.core.io.ResourceLoader;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.unit.DataUnit;
import java.io.*; import java.io.*;
import java.math.BigDecimal; import java.math.BigDecimal;

10
tall/src/main/java/com/ccsens/tall/service/ITaskPluginService.java

@ -5,6 +5,7 @@ import com.ccsens.tall.bean.po.ProTaskPlugin;
import com.ccsens.tall.bean.vo.PluginVo; import com.ccsens.tall.bean.vo.PluginVo;
import com.ccsens.tall.bean.vo.TaskVo; import com.ccsens.tall.bean.vo.TaskVo;
import java.io.FileNotFoundException;
import java.util.List; import java.util.List;
/** /**
@ -75,4 +76,13 @@ public interface ITaskPluginService {
* @return * @return
*/ */
PluginVo.PersonalTaskReport getPersonalTaskReport(Long projectId); PluginVo.PersonalTaskReport getPersonalTaskReport(Long projectId);
/**
* 获取每日会议纪要
* @param currentUserId userId
* @param getMinutesDay 任务日期id
* @param token roken
* @return 返回文件的访问路径下载路径和文件id
*/
List<PluginVo.MinutesInfo> saveMinutesDay(Long currentUserId, PluginDto.GetMinutesDay getMinutesDay, String token) throws FileNotFoundException, Exception;
} }

15
tall/src/main/java/com/ccsens/tall/service/ProMemberService.java

@ -322,11 +322,16 @@ public class ProMemberService implements IProMemberService {
} }
//添加用户关注项目信息 //添加用户关注项目信息
if(ObjectUtil.isNotNull(userId)) { if(ObjectUtil.isNotNull(userId)) {
UserAttention userAttention = new UserAttention(); //查找此用户是否以关注项目
userAttention.setId(snowflake.nextId()); UserAttentionExample attentionExample = new UserAttentionExample();
userAttention.setUserId(userId); attentionExample.createCriteria().andProjectIdEqualTo(saveMember.getProjectId()).andUserIdEqualTo(userId);
userAttention.setProjectId(saveMember.getProjectId()); if(userAttentionDao.countByExample(attentionExample) <= 0){
userAttentionDao.insertSelective(userAttention); UserAttention userAttention = new UserAttention();
userAttention.setId(snowflake.nextId());
userAttention.setUserId(userId);
userAttention.setProjectId(saveMember.getProjectId());
userAttentionDao.insertSelective(userAttention);
}
} }
} else { } else {
throw new BaseException(CodeEnum.NOT_POWER); throw new BaseException(CodeEnum.NOT_POWER);

3
tall/src/main/java/com/ccsens/tall/service/ProRoleService.java

@ -259,7 +259,7 @@ public class ProRoleService implements IProRoleService {
SysProject project = projectDao.selectByPrimaryKey(projectId); SysProject project = projectDao.selectByPrimaryKey(projectId);
if (ObjectUtil.isNotNull(project)) { if (ObjectUtil.isNotNull(project)) {
if (project.getCreatorId().longValue() == userId) { if (project.getCreatorId().longValue() == userId) {
power = 2; power = 3;
} }
List<ProRole> roles = getProRoleByProjectIdAndUserId(projectId, userId); List<ProRole> roles = getProRoleByProjectIdAndUserId(projectId, userId);
if (CollectionUtil.isNotEmpty(roles)) { if (CollectionUtil.isNotEmpty(roles)) {
@ -269,6 +269,7 @@ public class ProRoleService implements IProRoleService {
} }
} }
} }
log.info("查找userId:{}在项目:{}内的权限:{}",userId,projectId,power);
return power; return power;
} }

5
tall/src/main/java/com/ccsens/tall/service/ProTaskDetailService.java

@ -1343,7 +1343,8 @@ public class ProTaskDetailService implements IProTaskDetailService {
ObjectUtil.isNotNull(updateTaskInfo.getEndTime()) || ObjectUtil.isNotNull(updateTaskInfo.getEndTime()) ||
StrUtil.isNotEmpty(updateTaskInfo.getCycle())) { StrUtil.isNotEmpty(updateTaskInfo.getCycle())) {
//一级任务没有时间,不能修改 //一级任务没有时间,不能修改
if (taskDetail.getLevel() != 1 && taskDetail.getLevel() != 0) { // if (taskDetail.getLevel() != 1 && taskDetail.getLevel() != 0) {
if (taskDetail.getLevel() != 0) {
changeTime(taskDetail, updateTaskInfo.getBeginTime(), updateTaskInfo.getEndTime(), project); changeTime(taskDetail, updateTaskInfo.getBeginTime(), updateTaskInfo.getEndTime(), project);
if (StrUtil.isNotEmpty(updateTaskInfo.getCycle())) { if (StrUtil.isNotEmpty(updateTaskInfo.getCycle())) {
taskDetail.setCycle(updateTaskInfo.getCycle()); taskDetail.setCycle(updateTaskInfo.getCycle());
@ -1454,7 +1455,7 @@ public class ProTaskDetailService implements IProTaskDetailService {
throw new BaseException(CodeEnum.TIME_ERROR_PROJECT); throw new BaseException(CodeEnum.TIME_ERROR_PROJECT);
} }
if (taskDetail.getLevel() == 2) { if (taskDetail.getLevel() == 2 || taskDetail.getLevel() == 1) {
//组任务不能修改时间(组任务的时间是其子任务的最早和最晚的时间) //组任务不能修改时间(组任务的时间是其子任务的最早和最晚的时间)
if (taskDetail.getHasGroup() == 1) { if (taskDetail.getHasGroup() == 1) {
throw new BaseException(CodeEnum.HAS_GROUP_TIME_CHANGE); throw new BaseException(CodeEnum.HAS_GROUP_TIME_CHANGE);

11
tall/src/main/java/com/ccsens/tall/service/TaskDeliverService.java

@ -106,7 +106,8 @@ public class TaskDeliverService implements ITaskDeliverService {
if (CollectionUtil.isNotEmpty(postLogList)) { if (CollectionUtil.isNotEmpty(postLogList)) {
ProTaskDeliverPostLog postLog = postLogList.get(0); ProTaskDeliverPostLog postLog = postLogList.get(0);
SysCommitedFile file = commitedFileDao.selectByPrimaryKey(postLog.getFileId()); SysCommitedFile file = commitedFileDao.selectByPrimaryKey(postLog.getFileId());
deliverInfoByMvp.setUrl(WebConstant.TEST_URL_BASE + file.getPath()); // deliverInfoByMvp.setUrl(WebConstant.TEST_URL_BASE + file.getPath());
deliverInfoByMvp.setUrl(PropUtil.imgDomain + "/" + file.getPath());
ProTaskDeliverPostLogCheckerExample checkerExample = new ProTaskDeliverPostLogCheckerExample(); ProTaskDeliverPostLogCheckerExample checkerExample = new ProTaskDeliverPostLogCheckerExample();
checkerExample.createCriteria().andDeliverPostLogIdEqualTo(postLog.getId()); checkerExample.createCriteria().andDeliverPostLogIdEqualTo(postLog.getId());
@ -183,7 +184,7 @@ public class TaskDeliverService implements ITaskDeliverService {
ProRole role = proRoleDao.selectByPrimaryKey(taskDetail.getExecutorRole()); ProRole role = proRoleDao.selectByPrimaryKey(taskDetail.getExecutorRole());
Boolean isBelongRole = proMemberService.userIsBelongRole(currentUserId, role.getId(),null); Boolean isBelongRole = proMemberService.userIsBelongRole(currentUserId, role.getId(),null);
if (!role.getName().equalsIgnoreCase(WebConstant.ROLE_NAME.AllMember.phase) && !isBelongRole){ if (!role.getName().equalsIgnoreCase(WebConstant.ROLE_NAME.AllMember.phase) && !isBelongRole){
throw new BaseException(CodeEnum.NOT_CHECKER); throw new BaseException(CodeEnum.IS_NOT_EXECUTOR);
} }
//查找以前上传的不为历史信息的文件。改为历史信息 //查找以前上传的不为历史信息的文件。改为历史信息
ProTaskDeliverPostLogExample logExample = new ProTaskDeliverPostLogExample(); ProTaskDeliverPostLogExample logExample = new ProTaskDeliverPostLogExample();
@ -292,7 +293,8 @@ public class TaskDeliverService implements ITaskDeliverService {
List<ProjectVo.DeliverInfo> deliverInfoList = taskDeliverDao.selectByDeliverId(uploadDeliver.getDeliverId()); List<ProjectVo.DeliverInfo> deliverInfoList = taskDeliverDao.selectByDeliverId(uploadDeliver.getDeliverId());
if (CollectionUtil.isNotEmpty(deliverInfoList)) { if (CollectionUtil.isNotEmpty(deliverInfoList)) {
deliverInfo = deliverInfoList.get(0); deliverInfo = deliverInfoList.get(0);
deliverInfo.setUrl(WebConstant.TEST_URL_BASE + deliverInfo.getUrl()); // deliverInfo.setUrl(WebConstant.TEST_URL_BASE + deliverInfo.getUrl());
deliverInfo.setUrl(PropUtil.imgDomain + "/" + deliverInfo.getUrl());
} }
return deliverInfo; return deliverInfo;
} }
@ -451,7 +453,8 @@ public class TaskDeliverService implements ITaskDeliverService {
} }
//修改文件路径为可下载路径 //修改文件路径为可下载路径
if(StrUtil.isNotEmpty(filePath.getUrl())) { if(StrUtil.isNotEmpty(filePath.getUrl())) {
filePath.setUrl(WebConstant.TEST_URL_BASE + filePath.getUrl()); // filePath.setUrl(WebConstant.TEST_URL_BASE + filePath.getUrl());
filePath.setUrl(PropUtil.imgDomain + "/" + filePath.getUrl());
} }
if (ObjectUtil.isNotNull(filePath.getUploaderId())) { if (ObjectUtil.isNotNull(filePath.getUploaderId())) {
//添加上传人的姓名信息 //添加上传人的姓名信息

166
tall/src/main/java/com/ccsens/tall/service/TaskPluginService.java

@ -8,7 +8,9 @@ import cn.hutool.core.util.StrUtil;
import com.ccsens.tall.bean.dto.PluginDto; import com.ccsens.tall.bean.dto.PluginDto;
import com.ccsens.tall.bean.dto.WpsDto; import com.ccsens.tall.bean.dto.WpsDto;
import com.ccsens.tall.bean.po.*; import com.ccsens.tall.bean.po.*;
import com.ccsens.tall.bean.vo.MemberVo;
import com.ccsens.tall.bean.vo.PluginVo; import com.ccsens.tall.bean.vo.PluginVo;
import com.ccsens.tall.bean.vo.RoleVo;
import com.ccsens.tall.bean.vo.TaskVo; import com.ccsens.tall.bean.vo.TaskVo;
import com.ccsens.tall.persist.dao.*; import com.ccsens.tall.persist.dao.*;
import com.ccsens.util.CodeEnum; import com.ccsens.util.CodeEnum;
@ -817,4 +819,168 @@ public class TaskPluginService implements ITaskPluginService{
return personalTaskReport; return personalTaskReport;
} }
@Override
public List<PluginVo.MinutesInfo> saveMinutesDay(Long currentUserId, PluginDto.GetMinutesDay getMinutesDay, String token) throws Exception {
//查找该任务的会议记录文件,有则直接返回
List<PluginVo.MinutesInfo> minutesInfoList = new ArrayList<>();
List<String> wpsPath = wpsService.queryVisitUrls(getMinutesDay.getTaskId(),(byte) 2,token,null);
if(CollectionUtil.isNotEmpty(wpsPath)){
minutesInfo(getMinutesDay.getTaskId(), minutesInfoList, wpsPath);
return minutesInfoList;
}
//之前没有会议记录则重新生成
Workbook wb = new XSSFWorkbook(new FileInputStream(new File("/home/staticrec/minutesDay.xlsx")));
//TODO 获取主持人、记录人、决策人、项目内的成员名、应到人数、项目下每个人的任务
List<List<PoiUtil.PoiUtilCell>> list = queryMinutesDay(getMinutesDay.getTaskId(),currentUserId);
PoiUtil.exportWB("会议纪要", list, wb);
//生成文件
String name = "会议纪要"+DateUtil.today() + ".xlsx";
String fileName = "minutesDay/" + DateUtil.today() + "/" + System.currentTimeMillis() + ".xlsx";
File tmpFile = saveFile(wb, fileName);
//关联wps
saveWpsBusiness(currentUserId, getMinutesDay, name, fileName, tmpFile);
//获取wps文件的路径并返回
wpsPath = wpsService.queryVisitUrls(getMinutesDay.getTaskId(),(byte) 2,token,null);
if(CollectionUtil.isNotEmpty(wpsPath)){
minutesInfo(getMinutesDay.getTaskId(), minutesInfoList, wpsPath);
}
return minutesInfoList;
}
private List<List<PoiUtil.PoiUtilCell>> queryMinutesDay(Long taskId,Long userId) throws Exception {
ProTaskDetail taskDetail = taskDetailDao.selectByPrimaryKey(taskId);
if(ObjectUtil.isNull(taskDetail)) {
ProTaskSubTime taskSubTime = taskSubTimeDao.selectByPrimaryKey(taskId);
if (ObjectUtil.isNotNull(taskSubTime)) {
taskDetail = taskDetailDao.selectByPrimaryKey(taskSubTime.getTaskDetailId());
if(ObjectUtil.isNull(taskDetail)){
throw new BaseException(CodeEnum.NOT_TASK);
}
}else {
throw new BaseException(CodeEnum.NOT_TASK);
}
}
//获取当前账号的名称,默认当前账号为主持人和记录人
MemberVo.MemberInfo member = proMemberService.getProMemberByProjectIdAndUserId(taskDetail.getProjectId(), userId);
//获取当前项目内的成员人数和姓名
List<MemberVo.MemberInfo> memberList = proMemberService.getAuthedMemberByProjectId(taskDetail.getProjectId());
StringBuilder names = new StringBuilder();
if(CollectionUtil.isNotEmpty(memberList)){
for (int i = 0; i < memberList.size(); i++) {
MemberVo.MemberInfo proMember = memberList.get(i);
if(i != 0){
names.append("、").append(proMember.getNickname());
}else {
names.append(proMember.getNickname());
}
}
}
//生成写入数据
List<List<PoiUtil.PoiUtilCell>> list = new ArrayList<>();
List<PoiUtil.PoiUtilCell> title1 = new ArrayList<>();
list.add(title1);
list.add(title1);
List<PoiUtil.PoiUtilCell> value1 = new ArrayList<>();
value1.add(new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL));
value1.add(new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL));
value1.add(new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL));
value1.add(new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL));
value1.add(new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL));
value1.add(new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL));
if(ObjectUtil.isNotNull(member)){
value1.add(new PoiUtil.PoiUtilCell(member.getNickname()));
}else {
value1.add(new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL));
}
value1.add(new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL));
value1.add(new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL));
value1.add(new PoiUtil.PoiUtilCell(names.toString()));
value1.add(new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL));
value1.add(new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL));
value1.add(new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL));
value1.add(new PoiUtil.PoiUtilCell(memberList.size()+""));
list.add(value1);
list.add(title1);
list.add(title1);
list.add(title1);
list.add(title1);
//TODO 获取所有角色和角色下当天的任务
long thisDayStartTime = DateUtil.beginOfDay(new Date()).getTime();
long thisDayEndTime = DateUtil.endOfDay(new Date()).getTime();
List<RoleVo.RoleTask> roleTaskList = roleDao.getRoleTaskByProjectId(taskDetail.getProjectId(),thisDayStartTime,thisDayEndTime);
if(CollectionUtil.isNotEmpty(roleTaskList)){
roleTaskList.forEach(roleTask -> {
if(CollectionUtil.isNotEmpty(roleTask.getTaskList())){
for (int i = 0; i < roleTask.getTaskList().size(); i++) {
RoleVo.RoleTaskInfo roleTaskInfo = roleTask.getTaskList().get(i);
List<PoiUtil.PoiUtilCell> task = new ArrayList<>();
task.add(new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL));
task.add(new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL));
if(i == 0){
task.add(new PoiUtil.PoiUtilCell(roleTask.getRoleName(),1,roleTask.getTaskList().size()));
}else {
task.add(new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL));
}
task.add(new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL));
task.add(new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL));
task.add(new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL));
task.add(new PoiUtil.PoiUtilCell(roleTaskInfo.getTaskName()));
task.add(new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL));
task.add(new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL));
task.add(new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL));
task.add(new PoiUtil.PoiUtilCell(roleTaskInfo.getCheckerName()));
list.add(task);
}
}
});
}
return list;
}
private File saveFile(Workbook wb, String fileName) throws IOException {
String path = PropUtil.path + File.separator + fileName;
File tmpFile = new File(path);
if (!tmpFile.getParentFile().exists()) {
tmpFile.getParentFile().mkdirs();
}
OutputStream stream = new FileOutputStream(tmpFile);
wb.write(stream);
stream.close();
return tmpFile;
}
private void saveWpsBusiness(Long currentUserId, PluginDto.GetMinutesDay getMinutesDay, String name, String fileName, File tmpFile) {
WpsDto.Business business = new WpsDto.Business();
business.setBusinessId(getMinutesDay.getTaskId());
business.setBusinessType((byte) 2);
business.setUserId(currentUserId);
business.setFileName(name);
business.setFilePath(fileName);
business.setRealFilePath(PropUtil.path + File.separator + fileName);
business.setFileSize(tmpFile.length());
business.setOperation(WebConstant.Wps.USER_OPERATION_NEW);
business.setPrivilege(WebConstant.Wps.PROJECT_PRIVILEGE_QUERY);
business.setPrivilegeQueryUrl(PropUtil.domain + "v1/3rd/wpsPower");
wpsService.saveFile(business);
}
private void minutesInfo(Long taskId, List<PluginVo.MinutesInfo> minutesInfoList, List<String> wpsPath) {
wpsPath.forEach(wps->{
PluginVo.MinutesInfo minutesInfo = new PluginVo.MinutesInfo();
minutesInfo.setWpsPath(wps);
//获取下载路径
ProProjectFileExample projectFileExample = new ProProjectFileExample();
projectFileExample.createCriteria().andBusinessIdEqualTo(taskId).andBusinessTypeEqualTo((byte) 2);
List<ProProjectFile> projectFileList = proProjectFileDao.selectByExample(projectFileExample);
if(CollectionUtil.isNotEmpty(projectFileList)){
WpsFile wpsFile = wpsFileDao.selectByPrimaryKey(projectFileList.get(0).getWpsFileId());
minutesInfo.setDownloadPath(wpsFile.getDownloadUrl());
minutesInfo.setWpsFileId(wpsFile.getId());
}
minutesInfoList.add(minutesInfo);
});
}
} }

14
tall/src/main/java/com/ccsens/tall/web/PluginController.java

@ -208,4 +208,18 @@ public class PluginController {
} }
@ApiOperation(value = "每日会议纪要", notes = "")
@ApiImplicitParams({
})
@RequestMapping(value = "/minutesDay", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<List<PluginVo.MinutesInfo>> saveMinutesDay(HttpServletRequest request,
@ApiParam @Validated @RequestBody PluginDto.GetMinutesDay getMinutesDay) throws Exception {
Long currentUserId = Long.valueOf(((Claims) request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS)).getSubject());
log.info("生成每日会议纪要:{}。useId:{}",getMinutesDay,currentUserId);
String authHeader = request.getHeader(WebConstant.HEADER_KEY_TOKEN);
String token = authHeader.substring(WebConstant.HEADER_KEY_TOKEN_PREFIX.length());
List<PluginVo.MinutesInfo> wpsPath = taskPluginService.saveMinutesDay(currentUserId,getMinutesDay,token);
log.info("生成每日会议纪要完成");
return JsonResponse.newInstance().ok(wpsPath);
}
} }

4
tall/src/main/resources/application-dev.yml

@ -12,9 +12,9 @@ spring:
type: com.alibaba.druid.pool.DruidDataSource type: com.alibaba.druid.pool.DruidDataSource
rabbitmq: rabbitmq:
host: 192.168.0.99 host: 192.168.0.99
password: 111111 password: guest
port: 5672 port: 5672
username: admin username: guest
redis: redis:
database: 0 database: 0
host: 127.0.0.1 host: 127.0.0.1

4
tall/src/main/resources/application.yml

@ -1,5 +1,5 @@
spring: spring:
profiles: profiles:
active: dev active: test
include: util-dev,common include: util-test,common

31
tall/src/main/resources/mapper_dao/ProRoleDao.xml

@ -30,6 +30,17 @@
<result column="rName" property="name" /> <result column="rName" property="name" />
</resultMap> </resultMap>
<resultMap id="roleTask" type="com.ccsens.tall.bean.vo.RoleVo$RoleTask">
<id column="roleId" property="roleId"/>
<result column="roleName" property="roleName"/>
<collection property="taskList" ofType="com.ccsens.tall.bean.vo.RoleVo$RoleTaskInfo">
<id column="taskId" property="taskId"/>
<result column="detailId" property="detailId"/>
<result column="taskName" property="taskName"/>
<result column="checkerName" property="checkerName"/>
</collection>
</resultMap>
<select id="selectFirstRoleByProjectIdAndUserId" parameterType="java.util.Map" <select id="selectFirstRoleByProjectIdAndUserId" parameterType="java.util.Map"
resultMap="resultMap_ProRole"> resultMap="resultMap_ProRole">
select select
@ -249,5 +260,25 @@
AND AND
r.rec_status = 0 r.rec_status = 0
</select> </select>
<select id="getRoleTaskByProjectId" resultMap="roleTask">
SELECT
pr.id AS roleId,
pr.NAME AS roleName,
d.id as detailId,
s.id as taskId,
d.`name` as taskName,
(SELECt `name` FROM t_pro_role WHERE id = d.checker_role) as checkerName
FROM
t_pro_role pr
LEFT JOIN t_pro_task_detail d on pr.id = d.executor_role and d.rec_status = 0
LEFT JOIN t_pro_task_sub_time s on d.id = s.task_detail_id and s.rec_status = 0
WHERE
pr.project_id = #{projectId}
AND ( SELECT NAME FROM t_pro_role r WHERE pr.parent_id = r.id ) IN ('Member')
AND pr.NAME NOT IN ('观众', 'MVP' )
AND pr.rec_status = 0
AND s.end_time &gt; #{thisDayStartTime}
AND s.begin_time &lt; #{thisDayEndTime}
</select>
</mapper> </mapper>

1
tall/src/main/resources/mapper_dao/SysProjectDao.xml

@ -125,6 +125,7 @@
s.name like concat('%',#{key},'%') s.name like concat('%',#{key},'%')
AND AND
s.rec_status = 0 s.rec_status = 0
and a.rec_status = 0
</select> </select>
<select id="findProjectIdByUserId01" parameterType="java.util.Map" resultMap="resultMap_ProjectInfo01"> <select id="findProjectIdByUserId01" parameterType="java.util.Map" resultMap="resultMap_ProjectInfo01">

8
tall/src/main/resources/mapper_dao/TaskDetailDao.xml

@ -349,10 +349,10 @@
t_pro_task_detail t join t_sys_project s on t.project_id = s.id JOIN t_sys_user_attention a on s.id = a.project_id t_pro_task_detail t join t_sys_project s on t.project_id = s.id JOIN t_sys_user_attention a on s.id = a.project_id
WHERE WHERE
a.user_id = #{userId} a.user_id = #{userId}
AND AND t.rec_status = 0
t.rec_status = 0 AND s.rec_status = 0
AND AND a.rec_status = 0
t.name like concat('%',#{key},'%') AND t.name like concat('%',#{key},'%')
<if test="projectId != null" > <if test="projectId != null" >
AND AND
s.id = #{projectId} s.id = #{projectId}

14
util/src/main/java/com/ccsens/util/PoiUtil.java

@ -57,11 +57,11 @@ public class PoiUtil {
/** /**
* 行高 * 行高
*/ */
private Integer height = 666; private Integer height;
/** /**
* 列宽 * 列宽
*/ */
private Integer wight = 18; private Integer wight;
/** /**
* 跳转的路径 * 跳转的路径
@ -171,11 +171,11 @@ public class PoiUtil {
newCell = row.createCell(j); newCell = row.createCell(j);
} }
//查找当前单元格的样式 //查找当前单元格的样式
// CellStyle style = newCell.getCellStyle(); CellStyle style = newCell.getCellStyle();
// if(ObjectUtil.isNull(style)){ if(ObjectUtil.isNull(style)){
// style = wb.createCellStyle(); style = wb.createCellStyle();
// } }
CellStyle style = wb.createCellStyle(); // CellStyle style = wb.createCellStyle();
//设置内容 //设置内容
if (!WebConstant.CELL_NULL.equals(cell.value)){ if (!WebConstant.CELL_NULL.equals(cell.value)){
// if(cell.num == 1){ // if(cell.num == 1){

3
util/src/main/java/com/ccsens/util/SmsUtil.java

@ -34,7 +34,8 @@ public class SmsUtil {
Integer minutes = (seconds - 1) / 60 + 1; Integer minutes = (seconds - 1) / 60 + 1;
try { try {
//数组具体的元素个数和模板中变量个数必须一致,例如事例中templateId:5678对应一个变量,参数数组中元素个数也必须是一个 //数组具体的元素个数和模板中变量个数必须一致,例如事例中templateId:5678对应一个变量,参数数组中元素个数也必须是一个
String[] params = {code,String.valueOf(minutes)}; SmsSingleSender ssender = new SmsSingleSender(appid, appkey); String[] params = {code,String.valueOf(minutes)};
SmsSingleSender ssender = new SmsSingleSender(appid, appkey);
// 签名参数未提供或者为空时,会使用默认签名发送短信 // 签名参数未提供或者为空时,会使用默认签名发送短信
SmsSingleSenderResult result = ssender.sendWithParam("86", phoneNumbers[0], SmsSingleSenderResult result = ssender.sendWithParam("86", phoneNumbers[0],
templateId2, params, smsSign, "", ""); templateId2, params, smsSign, "", "");

8
util/src/main/java/com/ccsens/util/config/RabbitMQConfig.java

@ -19,6 +19,8 @@ public class RabbitMQConfig {
public static final String WISDOM_CAR = "wisdom_car"; public static final String WISDOM_CAR = "wisdom_car";
public static final String BENEFICIATION = "beneficiation";
private static final String GAME_STATUS_DELAY_SEND_QUEUE = "gameStatusDelaySendQueue"; private static final String GAME_STATUS_DELAY_SEND_QUEUE = "gameStatusDelaySendQueue";
private static final String GAME_STATUS_DELAY_SEND_EXCHANGE = "gameStatusDelaySendExchange"; private static final String GAME_STATUS_DELAY_SEND_EXCHANGE = "gameStatusDelaySendExchange";
@ -63,6 +65,12 @@ public class RabbitMQConfig {
public Queue wisdomCar(){ public Queue wisdomCar(){
return new Queue(WISDOM_CAR); return new Queue(WISDOM_CAR);
} }
@Bean
public Queue beneficiation(){
return new Queue(BENEFICIATION);
}
// @Bean // @Bean
// public Queue wisdom_car(){ // public Queue wisdom_car(){
// return new Queue(GAME_MQ_A); // return new Queue(GAME_MQ_A);

2
wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/dto/Message/CarRecordMessageDto.java

@ -16,7 +16,7 @@ public class CarRecordMessageDto {
*/ */
private Byte type; private Byte type;
/** /**
* * 寄存器地址
*/ */
private int addr; private int addr;
/** /**

4
wisdomcar/src/main/resources/application.yml

@ -1,6 +1,6 @@
spring: spring:
profiles: profiles:
active: prod active: dev
include: common, util-prod include: common, util-dev

Loading…
Cancel
Save