Commit 1a95d4a7 by wangming

初始化

1 parent 20013c09
Showing with 20444 additions and 0 deletions
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-jdbc:1.5.7.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.apache.tomcat:tomcat-jdbc:8.5.20" level="project" />
<orderEntry type="library" name="Maven: org.apache.tomcat:tomcat-juli:8.5.20" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-jdbc:4.3.11.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-beans:4.3.11.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-tx:4.3.11.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-starter:1.3.1" level="project" />
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-autoconfigure:1.3.1" level="project" />
<orderEntry type="library" name="Maven: org.mybatis:mybatis:3.4.5" level="project" />
<orderEntry type="library" name="Maven: org.mybatis:mybatis-spring:1.3.1" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:1.5.7.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-tomcat:1.5.7.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-core:8.5.20" level="project" />
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-el:8.5.20" level="project" />
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-websocket:8.5.20" level="project" />
<orderEntry type="library" name="Maven: org.hibernate:hibernate-validator:5.3.5.Final" level="project" />
<orderEntry type="library" name="Maven: javax.validation:validation-api:1.1.0.Final" level="project" />
<orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging:3.3.1.Final" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml:classmate:1.3.4" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.8.10" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.8.0" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.8.10" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-web:4.3.11.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-aop:4.3.11.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-context:4.3.11.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-webmvc:4.3.11.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-expression:4.3.11.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:1.5.7.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:1.5.7.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:1.5.7.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-core:4.3.11.RELEASE" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: org.yaml:snakeyaml:1.17" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-log4j:1.3.7.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:jcl-over-slf4j:1.7.25" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.25" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.25" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:slf4j-log4j12:1.7.25" level="project" />
<orderEntry type="library" name="Maven: log4j:log4j:1.2.17" level="project" />
<orderEntry type="library" name="Maven: com.alibaba:fastjson:1.2.39" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-redis:1.3.8.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-redis:1.8.7.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-keyvalue:1.2.7.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-oxm:4.3.11.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-context-support:4.3.11.RELEASE" level="project" />
<orderEntry type="library" name="Maven: redis.clients:jedis:2.9.0" level="project" />
<orderEntry type="library" name="Maven: org.springframework.session:spring-session-data-redis:1.3.1.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-pool2:2.4.2" level="project" />
<orderEntry type="library" name="Maven: org.springframework.session:spring-session:1.3.1.RELEASE" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: mysql:mysql-connector-java:5.1.44" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-starter-test:1.5.7.RELEASE" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-test:1.5.7.RELEASE" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-test-autoconfigure:1.5.7.RELEASE" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: com.jayway.jsonpath:json-path:2.2.0" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: net.minidev:json-smart:2.2.1" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: net.minidev:accessors-smart:1.1" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.ow2.asm:asm:5.0.3" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.12" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.assertj:assertj-core:2.6.0" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.mockito:mockito-core:1.10.19" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.objenesis:objenesis:2.1" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-library:1.3" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.skyscreamer:jsonassert:1.4.0" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: com.vaadin.external.google:android-json:0.0.20131108.vaadin1" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.springframework:spring-test:4.3.11.RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper:4.1.0" level="project" />
<orderEntry type="library" name="Maven: com.github.jsqlparser:jsqlparser:0.9.4" level="project" />
<orderEntry type="library" name="Maven: net.sf.json-lib:json-lib:jdk15:2.4" level="project" />
<orderEntry type="library" name="Maven: commons-beanutils:commons-beanutils:1.9.3" level="project" />
<orderEntry type="library" name="Maven: commons-collections:commons-collections:3.2.2" level="project" />
<orderEntry type="library" name="Maven: commons-lang:commons-lang:2.5" level="project" />
<orderEntry type="library" name="Maven: commons-logging:commons-logging:1.1.1" level="project" />
<orderEntry type="library" name="Maven: net.sf.ezmorph:ezmorph:1.0.6" level="project" />
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.6" level="project" />
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.10" level="project" />
<orderEntry type="library" name="Maven: org.apache.shiro:shiro-spring:1.4.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.shiro:shiro-core:1.4.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.shiro:shiro-lang:1.4.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.shiro:shiro-cache:1.4.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.shiro:shiro-crypto-hash:1.4.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.shiro:shiro-crypto-core:1.4.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.shiro:shiro-crypto-cipher:1.4.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.shiro:shiro-config-core:1.4.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.shiro:shiro-config-ogdl:1.4.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.shiro:shiro-event:1.4.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.shiro:shiro-web:1.4.0" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-data-jpa:1.5.7.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-aop:1.5.7.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.aspectj:aspectjweaver:1.8.10" level="project" />
<orderEntry type="library" name="Maven: org.hibernate:hibernate-core:5.0.12.Final" level="project" />
<orderEntry type="library" name="Maven: org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.0.Final" level="project" />
<orderEntry type="library" name="Maven: org.javassist:javassist:3.21.0-GA" level="project" />
<orderEntry type="library" name="Maven: antlr:antlr:2.7.7" level="project" />
<orderEntry type="library" name="Maven: org.jboss:jandex:2.0.0.Final" level="project" />
<orderEntry type="library" name="Maven: dom4j:dom4j:1.6.1" level="project" />
<orderEntry type="library" name="Maven: org.hibernate.common:hibernate-commons-annotations:5.0.1.Final" level="project" />
<orderEntry type="library" name="Maven: org.hibernate:hibernate-entitymanager:5.0.12.Final" level="project" />
<orderEntry type="library" name="Maven: javax.transaction:javax.transaction-api:1.2" level="project" />
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-jpa:1.11.7.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-commons:1.13.7.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-orm:4.3.11.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-aspects:4.3.11.RELEASE" level="project" />
<orderEntry type="library" name="Maven: commons-io:commons-io:2.4" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.4" level="project" />
<orderEntry type="library" name="Maven: com.qiniu:qiniu-java-sdk:7.2.28" level="project" />
<orderEntry type="library" name="Maven: com.squareup.okhttp3:okhttp:3.8.1" level="project" />
<orderEntry type="library" name="Maven: com.squareup.okio:okio:1.13.0" level="project" />
<orderEntry type="library" name="Maven: com.google.code.gson:gson:2.8.1" level="project" />
</component>
</module>
\ No newline at end of file
#!/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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------
# Maven2 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 Migwn, 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)`"
# TODO classpath?
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
export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
echo $MAVEN_PROJECTBASEDIR
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
WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
exec "$JAVACMD" \
$MAVEN_OPTS \
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
"-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
@REM ----------------------------------------------------------------------------
@REM Licensed to the Apache Software Foundation (ASF) under one
@REM or more contributor license agreements. See the NOTICE file
@REM distributed with this work for additional information
@REM regarding copyright ownership. The ASF licenses this file
@REM to you under the Apache License, Version 2.0 (the
@REM "License"); you may not use this file except in compliance
@REM with the License. You may obtain a copy of the License at
@REM
@REM http://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 Maven2 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 key stroke 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 enable echoing my 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
%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
if ERRORLEVEL 1 goto error
goto end
:error
set ERROR_CODE=1
:end
@endlocal & set ERROR_CODE=%ERROR_CODE%
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
@REM check for post script, once with legacy .bat ending and once with .cmd ending
if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
:skipRcPost
@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
if "%MAVEN_BATCH_PAUSE%" == "on" pause
if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
exit /B %ERROR_CODE%
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>kzy-oss</groupId>
<artifactId>kzy-oss</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<name>kzy-oss</name>
<description>kln OSS</description>
<inceptionYear>2018</inceptionYear>
<organization>
<name>YXVZB Technical Team-</name>
<url>http://www.yxvzb.com</url>
</organization>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.7.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-netflix</artifactId>
<version>1.3.5.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>1.3.1</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-log4j</artifactId>
<version>1.3.7.RELEASE</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.8</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-redis</artifactId>
<version>1.3.8.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.session</groupId>
<artifactId>spring-session-data-redis</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper</artifactId>
<version>4.1.0</version>
</dependency>
<dependency>
<groupId>net.sf.json-lib</groupId>
<artifactId>json-lib</artifactId>
<version>2.4</version>
<classifier>jdk15</classifier>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.1</version>
</dependency>
<dependency>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-spring</artifactId>
<version>1.4.0</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.39</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.4</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.4</version>
</dependency>
<dependency>
<groupId>com.qiniu</groupId>
<artifactId>qiniu-java-sdk</artifactId>
<version>[7.2.0, 7.2.99]</version>
</dependency>
<!--<dependency>-->
<!--<groupId>com.basics-feign</groupId>-->
<!--<artifactId>basicsfeign</artifactId>-->
<!--<version>1.0</version>-->
<!--</dependency>-->
</dependencies>
<profiles>
<profile>
<id>105</id>
<properties>
<package.environment>105</package.environment>
</properties>
</profile>
<profile>
<id>online</id>
<properties>
<package.environment>online</package.environment>
</properties>
<!-- 设置默认使用的环境 -->
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</profile>
</profiles>
<build>
<!-- jar包名字,{名字+环境} -->
<finalName>sj_oss_${package.environment}</finalName>
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>*.xml</include>
<include>**/*.xml</include>
<include>**/application.properties</include>
<include>banner.txt</include>
</includes>
<excludes>
<exclude>generatorConfig.xml</exclude>
<exclude>mbg/*</exclude>
</excludes>
<filtering>false</filtering>
</resource>
<resource>
<directory>src/main/resources/servers/${package.environment}</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<configuration>
<encoding>utf-8</encoding>
<useDefaultDelimiters>true</useDefaultDelimiters>
</configuration>
</plugin>
<plugin>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-maven-plugin</artifactId>
<version>1.3.5</version>
<configuration>
<verbose>true</verbose>
<overwrite>true</overwrite>
</configuration>
</plugin>
</plugins>
</build>
</project>
package com.server;
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.context.annotation.ComponentScan;
import org.springframework.transaction.annotation.EnableTransactionManagement;
@SpringBootApplication
@EnableTransactionManagement
@ServletComponentScan
@MapperScan("com.server.web.common.mapper")
public class Application {
public static void main(String[] args) {
SpringApplication application = new SpringApplication(Application.class);
application.run(args);
}
}
package com.server.common.configure;
import com.github.pagehelper.PageHelper;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.Properties;
/**
* Created by dell on 2017/8/22.
*/
@Configuration
public class ConfigMybatis {
@Bean
public PageHelper pageHelper() {
System.out.println("MyBatisConfiguration.pageHelper()");
PageHelper pageHelper = new PageHelper();
Properties p = new Properties();
p.setProperty("offsetAsPageNum", "true");
p.setProperty("rowBoundsWithCount", "true");
p.setProperty("reasonable", "true");
pageHelper.setProperties(p);
return pageHelper;
}
}
package com.server.common.configure;
import org.springframework.context.annotation.Configuration;
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;
/**
* Created by yinbin on 2018/1/11.
* session 共享配置类,通过使用redis共享session,默认过期时间1800秒
*/
@Configuration
@EnableRedisHttpSession(maxInactiveIntervalInSeconds=1800,redisNamespace = "sj_oss")
public class ConfigRedisSession {
}
\ No newline at end of file
package com.server.common.configure;
import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.AsyncConfigurer;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import java.util.concurrent.Executor;
/**
* Created by yinbin on 2018/1/11.
* 线程池配置类
*/
@Configuration
@EnableAsync
public class ConfigThreadPoolExecutor implements AsyncConfigurer {
@Override
public Executor getAsyncExecutor() {
ThreadPoolTaskExecutor taskExecutor=new ThreadPoolTaskExecutor();
taskExecutor.setCorePoolSize(5);
taskExecutor.setMaxPoolSize(20);
taskExecutor.setQueueCapacity(25);
taskExecutor.initialize();
return taskExecutor;
}
@Override
public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler() {
return null;
}
}
package com.server.common.configure;
import com.server.web.interceptor.InterceptorLocal;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
/**
* Created by yinbin on 2018/1/9.
* web相关配置类
* 只配置了拦截器配置
*/
@Configuration
public class ConfigWebApp extends WebMvcConfigurerAdapter {
@Override
public void addInterceptors(InterceptorRegistry registry) {
// 多个拦截器组成一个拦截器链
// addPathPatterns 用于添加拦截规则
// excludePathPatterns 用户排除拦截
registry.addInterceptor(new InterceptorLocal()).addPathPatterns("/**");
super.addInterceptors(registry);
}
}
package com.server.common.configure;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.SchedulingConfigurer;
import org.springframework.scheduling.config.ScheduledTaskRegistrar;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
/**
* Created by yinbin on 2018/1/16.
* 启用此配置,任务采用多线程执行
* 不启用所有任务串行执行,即单线程执行任务
*/
@Configuration
@EnableScheduling
public class ScheduleConfig implements SchedulingConfigurer {
@Override
public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
taskRegistrar.setScheduler(taskExecutor());
}
@Bean(destroyMethod="shutdown")
public Executor taskExecutor() {
return Executors.newScheduledThreadPool(100);
}
}
package com.server.common.filter;
import com.server.common.filter.util.SecretUtil;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.annotation.Order;
import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import java.io.IOException;
/**
* Created by yinbin on 2018/1/9.
* 过滤器,过滤请求,此过滤器在为对外提供api时,签名过滤器
* Order其实不起作用,请注意
*/
@Order(10)
@WebFilter(urlPatterns = "/*", filterName = "apiFilter")
public class ApiFilter implements Filter {
final static Logger logger = LogManager.getLogger(ApiFilter.class);
@Value("${rest.api.debug}")
private String isdebug="false";
@Value("${rest.api.secretkey}")
private String secretKey;
@Value("${rest.api.charset}")
private String charset;
@Override
public void init(FilterConfig filterConfig) throws ServletException {
}
@Override
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
logger.info("API Filter");
if(isdebug.equals("false")) {
boolean flag=SecretUtil.signByMd5(servletRequest,secretKey,charset);
if(flag){
filterChain.doFilter(servletRequest, servletResponse);
}
}else {
filterChain.doFilter(servletRequest, servletResponse);
}
}
@Override
public void destroy() {
}
}
\ No newline at end of file
package com.server.common.filter;
import com.server.shiro.constants.Constants;
import com.server.shiro.constants.ErrorEnum;
import com.server.shiro.persistent.bean.SysUser;
import com.server.shiro.persistent.repository.UserRepository;
import com.server.shiro.util.CommonUtil;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.apache.shiro.session.Session;
import org.apache.shiro.session.UnknownSessionException;
import org.apache.shiro.session.mgt.SessionKey;
import org.apache.shiro.web.mgt.DefaultWebSecurityManager;
import org.apache.shiro.web.session.mgt.WebSessionKey;
import org.apache.shiro.web.util.WebUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.annotation.Order;
import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
/**
* Created by yinbin on 2018/1/9.
* 过滤器,session过滤器
* Order其实不起作用,请注意
*/
@Order(2)
@WebFilter(urlPatterns = "/*", filterName = "sessionFilter")
public class SessionFilter implements Filter {
final static Logger logger = LogManager.getLogger(ApiFilter.class);
private static final String AUTHORIZATION = "Authorization";
@Autowired
private UserRepository userRepository;
@Autowired
private DefaultWebSecurityManager securityManager;
@Override
public void init(FilterConfig filterConfig) throws ServletException {
// SysUser user= (SysUser) userRepository.getByUsernameIsAndPasswordIs("admin","123456");
// logger.info("user_name is :"+user.getUsername());
}
@Override
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
// logger.info("SessionFilter Filter");
// HttpServletResponse response= (HttpServletResponse) servletResponse;
// HttpServletRequest request = (HttpServletRequest) servletRequest;
// String url = request.getRequestURI();
// if(url.equals("/rest/login/auth") || url.equals("/rest/detection/detection") || url.equals("/rest/medicine/updatePinyin")){
// filterChain.doFilter(servletRequest,servletResponse);
// }else {
// SysUser user = getActiveUser(servletRequest, servletResponse);
// if (user != null) {
// filterChain.doFilter(servletRequest, servletResponse);
// } else {
// response.setCharacterEncoding("UTF-8");
// response.setContentType("application/json; charset=utf-8");
// response.setHeader("Content-type", "application/json;charset=UTF-8");
// PrintWriter write = response.getWriter();
// write.print(CommonUtil.errorJson(ErrorEnum.E_501));
// write.close();
// }
// }
filterChain.doFilter(servletRequest,servletResponse);
}
/**
* 根据sessionid 获取用户信息
* 根据sessionid获取shirosession,再获取用户信息
*/
public SysUser getActiveUser(ServletRequest req,ServletResponse res){
HttpServletRequest request= (HttpServletRequest) req;
HttpServletResponse response= (HttpServletResponse) res;
String sessionID = WebUtils.toHttp(request).getHeader(AUTHORIZATION);
SessionKey key = new WebSessionKey(sessionID,request,response);
SysUser user =null;
try {
Session se = securityManager.getSession(key);
user = (SysUser) se.getAttribute(Constants.SESSION_USER_INFO);
}catch (UnknownSessionException exception){
user=null;
logger.info("Session is Unavailability,Expired or Illegal ");
}
return user;
}
@Override
public void destroy() {
}
}
\ No newline at end of file
package com.server.common.filter.util;
import org.apache.commons.codec.digest.DigestUtils;
import javax.servlet.ServletRequest;
import java.io.UnsupportedEncodingException;
import java.util.*;
/**
* Created by yinbin on 2018/1/12.
* 签名工具
*/
public class SecretUtil {
public static boolean signByMd5(ServletRequest servletRequest,String secretKey,String charset) throws UnsupportedEncodingException {
Map<String,String> params = new HashMap<String,String>();
Map<String,String[]> requestParams = servletRequest.getParameterMap();
for (Iterator<String> iter = requestParams.keySet().iterator(); iter.hasNext();) {
String name = (String) iter.next();
String[] values = (String[]) requestParams.get(name);
String valueStr = "";
for (int i = 0; i < values.length; i++) {
valueStr = (i == values.length - 1) ? valueStr + values[i]
: valueStr + values[i] + ",";
}
//乱码解决,这段代码在出现乱码时使用
valueStr = new String(valueStr.getBytes("ISO-8859-1"), charset);
params.put(name, valueStr);
}
return rsaCheckV1(params,secretKey,charset);
}
public static boolean rsaCheckV1(Map<String, String> params, String publicKey,
String charset) {
String sign = params.get("sign");
String content = getSignCheckContentV1(params);
return rsaCheckContent(content, sign, publicKey, charset);
}
public static boolean rsaCheckContent(String content, String sign, String publicKey,
String charset) {
String sign_check= DigestUtils.md5Hex(content + publicKey);
return sign.equals(sign_check)?true:false;
}
public static String getSignCheckContentV1(Map<String, String> params) {
if (params == null) {
return null;
}
params.remove("sign");
StringBuffer content = new StringBuffer();
List<String> keys = new ArrayList<String>(params.keySet());
Collections.sort(keys);
for (int i = 0; i < keys.size(); i++) {
String key = keys.get(i);
String value = params.get(key);
content.append((i == 0 ? "" : "&") + key + "=" + value);
}
return content.toString();
}
}
package com.server.jobs;
import com.server.jobs.executor.PersonJob;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import java.util.Date;
/**
* Created by yinbin on 2018/1/10.
* 定时任务配置类
*/
//@Component
public class Jobs {
final static Logger logger = LogManager.getLogger(PersonJob.class);
@Autowired
PersonJob personJob;
public final static long ONE_Minute = 10 * 1000;
@Scheduled(fixedDelay=ONE_Minute)
public void fixedDelayJob(){
logger.info("fixedDelay执行....");
}
@Scheduled(fixedRate=ONE_Minute)
public void fixedRateJob(){
logger.info(" >>fixedRate执行....");
personJob.countPerson();
}
@Scheduled(cron="0 15 3 * * ?")
public void cronJob(){
logger.info(new Date()+" >>cron执行....");
}
}
\ No newline at end of file
package com.server.jobs.executor;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;
/**
* Created by yinbin on 2018/1/10.
*/
@Component
public class PersonJob {
final static Logger logger = LogManager.getLogger(PersonJob.class);
public void countPerson(){
logger.info("定时任务执行。。。 ");
}
}
package com.server.shiro;
import com.server.shiro.filter.AjaxPermissionsAuthorizationFilter;
import com.server.shiro.persistent.bean.SysUser;
import com.server.shiro.persistent.repository.UserRepository;
import com.server.shiro.realm.UserRealm;
import com.server.shiro.session.OssSessionManager;
import org.apache.shiro.authc.credential.HashedCredentialsMatcher;
import org.apache.shiro.mgt.SecurityManager;
import org.apache.shiro.spring.LifecycleBeanPostProcessor;
import org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor;
import org.apache.shiro.spring.web.ShiroFilterFactoryBean;
import org.apache.shiro.web.mgt.DefaultWebSecurityManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.DependsOn;
import javax.servlet.Filter;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* Created by yinbinhome@163.com on 2018/2/23.
* description:
*/
@Configuration
public class ConfigShiro {
private static final Logger logger = LoggerFactory.getLogger(ConfigShiro.class);
/**
* Shiro的Web过滤器Factory 命名:shiroFilter
*/
@Bean(name = "shiroFilter")
public ShiroFilterFactoryBean shiroFilterFactoryBean(SecurityManager securityManager) {
ShiroFilterFactoryBean shiroFilterFactoryBean = new ShiroFilterFactoryBean();
//Shiro的核心安全接口,这个属性是必须的
shiroFilterFactoryBean.setSecurityManager(securityManager);
Map<String, Filter> filterMap = new LinkedHashMap<>();
filterMap.put("authc", new AjaxPermissionsAuthorizationFilter());
shiroFilterFactoryBean.setFilters(filterMap);
/*定义shiro过滤链 Map结构
* Map中key(xml中是指value值)的第一个'/'代表的路径是相对于HttpServletRequest.getContextPath()的值来的
* anon:它对应的过滤器里面是空的,什么都没做,这里.do和.jsp后面的*表示参数,比方说login.jsp?main这种
* authc:该过滤器下的页面必须验证后才能访问,它是Shiro内置的一个拦截器org.apache.shiro.web.filter.authc.FormAuthenticationFilter
*/
Map<String, String> filterChainDefinitionMap = new LinkedHashMap<>();
/* 过滤链定义,从上向下顺序执行,一般将 / ** 放在最为下边:这是一个坑呢,一不小心代码就不好使了;
authc:所有url都必须认证通过才可以访问; anon:所有url都都可以匿名访问 */
filterChainDefinitionMap.put("/", "anon");
filterChainDefinitionMap.put("/updateper", "anon");//测试使用,上线删除这行
filterChainDefinitionMap.put("/rest/kzy/oss/login/auth", "anon");
filterChainDefinitionMap.put("/rest/kzy/oss/login/logout", "anon");
filterChainDefinitionMap.put("/error", "anon");
filterChainDefinitionMap.put("/**", "authc");
filterChainDefinitionMap.put("/**/**", "authc");
filterChainDefinitionMap.put("/**/**/**", "authc");
shiroFilterFactoryBean.setFilterChainDefinitionMap(filterChainDefinitionMap);
return shiroFilterFactoryBean;
}
@Bean
public AuthorizationAttributeSourceAdvisor authorizationAttributeSourceAdvisor() {
AuthorizationAttributeSourceAdvisor authorizationAttributeSourceAdvisor = new AuthorizationAttributeSourceAdvisor();
authorizationAttributeSourceAdvisor.setSecurityManager(securityManager());
return authorizationAttributeSourceAdvisor;
}
/**
* 不指定名字的话,自动创建一个方法名第一个字母小写的bean
*/
@Bean
public SecurityManager securityManager() {
DefaultWebSecurityManager securityManager = new DefaultWebSecurityManager();
securityManager.setRealm(userRealm());
securityManager.setSessionManager(new OssSessionManager());
return securityManager;
}
/**
* Shiro Realm 继承自AuthorizingRealm的自定义Realm,即指定Shiro验证用户登录的类为自定义的
*/
@Bean
public UserRealm userRealm() {
UserRealm userRealm = new UserRealm();
// userRealm.setCredentialsMatcher(hashedCredentialsMatcher());
return userRealm;
}
/**
* 凭证匹配器
* (由于我们的密码校验交给Shiro的SimpleAuthenticationInfo进行处理了
* 所以我们需要修改下doGetAuthenticationInfo中的代码;
* )
* 可以扩展凭证匹配器,实现 输入密码错误次数后锁定等功能,下一次
*/
public HashedCredentialsMatcher hashedCredentialsMatcher() {
HashedCredentialsMatcher hashedCredentialsMatcher = new HashedCredentialsMatcher();
//散列算法:这里使用MD5算法;
hashedCredentialsMatcher.setHashAlgorithmName("md5");
//散列的次数,比如散列两次,相当于 md5(md5(""));
hashedCredentialsMatcher.setHashIterations(1);
//storedCredentialsHexEncoded默认是true,此时用的是密码加密用的是Hex编码;false时用Base64编码
hashedCredentialsMatcher.setStoredCredentialsHexEncoded(true);
return hashedCredentialsMatcher;
}
/**
* Shiro生命周期处理器
*/
@Bean
public LifecycleBeanPostProcessor lifecycleBeanPostProcessor() {
return new LifecycleBeanPostProcessor();
}
/**
* 开启Shiro的注解(如@RequiresRoles,@RequiresPermissions),需借助SpringAOP扫描使用Shiro注解的类,并在必要时进行安全逻辑验证
* 配置以下两个bean(DefaultAdvisorAutoProxyCreator(可选)和AuthorizationAttributeSourceAdvisor)即可实现此功能
*/
@Bean
@DependsOn({"lifecycleBeanPostProcessor"})
public DefaultAdvisorAutoProxyCreator advisorAutoProxyCreator() {
DefaultAdvisorAutoProxyCreator advisorAutoProxyCreator = new DefaultAdvisorAutoProxyCreator();
advisorAutoProxyCreator.setProxyTargetClass(true);
return advisorAutoProxyCreator;
}
}
package com.server.shiro;
import com.server.shiro.context.PermissionManage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;
/**
* Created by yinbinhome@163.com on 2018/2/23.
* description:
* 初始化全局权限,存储在缓存里或者上下文,
* 加快鉴权速度,而不是每次读取数据库
*/
@Component
public class PermissionInitialize implements ApplicationRunner {
@Autowired
private PermissionManage permissionManager;//定义一个名字"permissionManager"的bean并且继承PermissionManage接口
@Override
public void run(ApplicationArguments applicationArguments) throws Exception {
permissionManager.initPermission();
}
}
package com.server.shiro.constants;
import org.springframework.beans.factory.annotation.Value;
/**
* Created by yinbinhome@163.com on 2018/2/23.
* description:
*/
public class Constants {
public static final String USER_PERMISSION = "application_user_permission_key";
public static final String SUCCESS_CODE = "1";
public static final String SUCCESS_MSG = "请求成功";
/**
* session中存放用户信息的key值
*/
public static final String SESSION_USER_INFO = "userInfo";
}
package com.server.shiro.constants;
/**
* Created by yinbinhome@163.com on 2018/2/23.
* description:
*/
public enum ErrorEnum {
/*
* 错误信息
* */
E_501("501", "无登录信息,请重新登陆"),
E_502("502", "权限不足"),
E_503("503", "用户名或密码不正确"),
E_504("504", "服务器内部错误");
private String errorCode;
private String errorMsg;
ErrorEnum() {
}
ErrorEnum(String errorCode, String errorMsg) {
this.errorCode = errorCode;
this.errorMsg = errorMsg;
}
public String getErrorCode() {
return errorCode;
}
public void setErrorCode(String errorCode) {
this.errorCode = errorCode;
}
public String getErrorMsg() {
return errorMsg;
}
public void setErrorMsg(String errorMsg) {
this.errorMsg = errorMsg;
}
}
package com.server.shiro.context;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;
/**
* Created by yinbinhome@163.com on 2018/2/23.
* description:
*/
@Component
public class ApplicationContextProvider implements ApplicationContextAware {
/**
* 上下文对象实例
*/
private ApplicationContext applicationContext;
@Override
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
this.applicationContext = applicationContext;
}
/**
* 获取applicationContext
* @return
*/
public ApplicationContext getApplicationContext() {
return applicationContext;
}
/**
* 通过name获取 Bean.
* @param name
* @return
*/
public Object getBean(String name){
return getApplicationContext().getBean(name);
}
/**
* 通过class获取Bean.
* @param clazz
* @param <T>
* @return
*/
public <T> T getBean(Class<T> clazz){
return getApplicationContext().getBean(clazz);
}
/**
* 通过name,以及Clazz返回指定的Bean
* @param name
* @param clazz
* @param <T>
* @return
*/
public <T> T getBean(String name,Class<T> clazz){
return getApplicationContext().getBean(name, clazz);
}
}
\ No newline at end of file
package com.server.shiro.context;
import com.server.shiro.constants.Constants;
import com.server.shiro.persistent.bean.SysUser;
import com.server.shiro.persistent.repository.UserRepository;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;
import org.springframework.web.context.WebApplicationContext;
import java.util.List;
/**
* Created by yinbinhome@163.com on 2018/2/23.
* description:
*/
@Component("permissionManager")
//@Singleton
public class CachePermissionManager implements PermissionManage {
private static final Logger logger = LoggerFactory.getLogger(CachePermissionManager.class);
@Value("${spring.application.name}")
private String APPLICATION_NAME;
@Autowired
private UserRepository userRepository;
@Autowired
private RedisTemplate redisTemplate;
@Override
public void initPermission() {
List<SysUser> users = (List<SysUser>) userRepository.findAll();
String key=APPLICATION_NAME+"_"+Constants.USER_PERMISSION;
// redisTemplate.delete(key);
// redisTemplate.opsForList().leftPushAll(key,users);
logger.info("从数据库拉取<用户-权限>对象,存储到上下文里");
}
@Override
public void reloadPermission() {
initPermission();
logger.info("更新上下文里的<用户-权限>");
}
@Override
public Object pullPermission() {
String key=APPLICATION_NAME+"_"+Constants.USER_PERMISSION;
Long size=redisTemplate.opsForList().size(key);
List<SysUser> user= (List<SysUser>) redisTemplate.opsForList().range(key,0,size);
logger.info("从上下文里取<用户-权限>对象");
return user;
}
}
package com.server.shiro.context;
import com.server.shiro.constants.Constants;
import com.server.shiro.persistent.bean.SysUser;
import com.server.shiro.persistent.repository.UserRepository;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.context.WebApplicationContext;
import java.util.List;
/**
* Created by yinbinhome@163.com on 2018/2/23.
* description:
*/
//@Component("permissionManager")
//@Singleton
public class ContextPermissionManager implements PermissionManage {
private static final Logger logger = LoggerFactory.getLogger(ContextPermissionManager.class);
@Value("${spring.application.name}")
private String APPLICATION_NAME;
@Autowired
private UserRepository userRepository;
@Autowired
private WebApplicationContext webApplicationContext;
@Override
public void initPermission() {
List<SysUser> user = (List<SysUser>) userRepository.findAll();
logger.info("从数据库拉取<用户-权限>对象,存储到上下文里");
webApplicationContext.getServletContext().setAttribute(APPLICATION_NAME+"_"+Constants.USER_PERMISSION,user);
}
@Override
public void reloadPermission() {
initPermission();
logger.info("更新上下文里的<用户-权限>");
}
@Override
public Object pullPermission() {
Object users_permission=webApplicationContext.getServletContext().getAttribute(APPLICATION_NAME+"_"+Constants.USER_PERMISSION);
logger.info("从上下文里取<用户-权限>对象");
return users_permission;
}
}
package com.server.shiro.context;
/**
* Created by yinbinhome@163.com on 2018/2/23.
* description:动态获取权限和更新权限接口
*/
public interface PermissionManage {
//初始化全局权限
void initPermission();
//更新全局权限,例如在管理平台修改了用户角色,权限,资源希望及时生效时
void reloadPermission();
//获取当前系统全局权限,而不是初始化从数据库获取
Object pullPermission();
}
package com.server.shiro.exception;
import org.apache.shiro.authc.AuthenticationException;
/**
* Created by yinbinhome@163.com on 2018/2/24.
* description:
* 自定义异常类,用户名或者密码错误时抛出此异常,
* 不做用户存在或者不存在的错误判断
*/
public class AccountErrorException extends AuthenticationException {
public AccountErrorException(){
super();
}
public AccountErrorException(String message){
super(message);
}
}
package com.server.shiro.exception;
import com.alibaba.fastjson.JSONObject;
import com.server.shiro.constants.ErrorEnum;
import com.server.shiro.util.CommonUtil;
import org.apache.shiro.authz.UnauthenticatedException;
import org.apache.shiro.authz.UnauthorizedException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.HttpRequestMethodNotSupportedException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
/**
* Created by yinbinhome@163.com on 2018/2/23.
* description:
*/
@ControllerAdvice
@ResponseBody
public class GlobalExceptionHandler {
private Logger logger = LoggerFactory.getLogger(GlobalExceptionHandler.class);
@ExceptionHandler(value = Exception.class)
public JSONObject defaultErrorHandler(HttpServletRequest req, Exception e) throws Exception {
String errorPosition = "";
//如果错误堆栈信息存在
if (e.getStackTrace().length > 0) {
StackTraceElement element = e.getStackTrace()[0];
String fileName = element.getFileName() == null ? "未找到错误文件" : element.getFileName();
int lineNumber = element.getLineNumber();
errorPosition = fileName + ":" + lineNumber;
}
JSONObject jsonObject = new JSONObject();
jsonObject.put("returnCode", ErrorEnum.E_504.getErrorCode());
jsonObject.put("returnMsg", ErrorEnum.E_504.getErrorMsg());
JSONObject errorObject = new JSONObject();
errorObject.put("errorLocation", e.toString() + " 错误位置:" + errorPosition);
jsonObject.put("returnData", errorObject);
logger.error("异常", e);
return jsonObject;
}
/**
* 权限不足报错拦截
*
* @return
* @throws Exception
*/
@ExceptionHandler(UnauthorizedException.class)
public JSONObject unauthorizedExceptionHandler() throws Exception {
return CommonUtil.errorJson(ErrorEnum.E_502);
}
/**
* 未登录报错拦截
* 在请求需要权限的接口,而连登录都还没登录的时候,会报此错
*
* @return
* @throws Exception
*/
@ExceptionHandler(UnauthenticatedException.class)
public JSONObject unauthenticatedHandler() throws Exception {
return CommonUtil.errorJson(ErrorEnum.E_501);
}
/**
* GET/POST请求方法错误的拦截器
* 因为开发时可能比较常见,而且发生在进入controller之前,上面的拦截器拦截不到这个错误
* 所以定义了这个拦截器
*
* @return
* @throws Exception
*/
@ExceptionHandler(HttpRequestMethodNotSupportedException.class)
public JSONObject httpRequestMethodHandler() throws Exception {
return CommonUtil.errorJson(ErrorEnum.E_501);
}
/**
*用户名密码不匹配时抛出的异常
* @return
* @throws Exception
*/
@ExceptionHandler(AccountErrorException.class)
public JSONObject accountErrorHandler() throws Exception {
return CommonUtil.errorJson(ErrorEnum.E_503);
}
}
package com.server.shiro.filter;
import com.alibaba.fastjson.JSONObject;
import com.server.shiro.constants.ErrorEnum;
import org.apache.shiro.web.filter.authc.FormAuthenticationFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletResponse;
import java.io.PrintWriter;
/**
* Created by yinbinhome@163.com on 2018/2/23.
* description:
*/
public class AjaxPermissionsAuthorizationFilter extends FormAuthenticationFilter {
@Override
protected boolean onAccessDenied(ServletRequest request, ServletResponse response) throws Exception {
JSONObject jsonObject = new JSONObject();
jsonObject.put("returnCode", ErrorEnum.E_501.getErrorCode());
jsonObject.put("returnMsg", ErrorEnum.E_501.getErrorMsg());
PrintWriter out = null;
HttpServletResponse res = (HttpServletResponse) response;
try {
res.setCharacterEncoding("UTF-8");
res.setContentType("application/json");
out = response.getWriter();
out.println(jsonObject);
} catch (Exception e) {
} finally {
if (null != out) {
out.flush();
out.close();
}
}
return false;
}
@Bean
public FilterRegistrationBean registration(AjaxPermissionsAuthorizationFilter filter) {
FilterRegistrationBean registration = new FilterRegistrationBean(filter);
registration.setEnabled(false);
return registration;
}
}
package com.server.shiro.persistent.bean;
import java.util.List;
import java.util.Map;
/**
* Created by yinbinhome@163.com on 2018/3/1.
* description:
*/
public class MenuModel {
private String name;
private Long weight;
private List<Map<String,String>> menus;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public List<Map<String, String>> getMenus() {
return menus;
}
public void setMenus(List<Map<String, String>> menus) {
this.menus = menus;
}
public Long getWeight() {
return weight;
}
public void setWeight(Long weight) {
this.weight = weight;
}
}
package com.server.shiro.persistent.bean;
import javax.persistence.*;
import java.io.Serializable;
import java.util.List;
/**
* 模块-文金龙
*/
@Entity
@Table(name = "sys_menu")
public class SysMenu implements Serializable {
@Id
@GeneratedValue
@Column(name = "id")
private Long id;
/**
* 菜单,vue的路由地址
*/
@Column(name = "menu_code")
private String menuCode;
/**
* 菜单名字,前台显示用
*/
@Column(name = "menu_name")
private String menuName;
/**
* 菜单地址
*/
@Column(name = "menu_url")
private String menuUrl;
/**
* null
*/
@Column(name = "remarks")
private String remarks;
/**
* null
*/
@Column(name = "status")
private Long status;
@Column(name="weight")
private Long weight;
@Column(name="level")
private Long level;
@Column(name="parentid")
private Long parentid;
@Transient
private List<SysMenu> subMenu;
public Long getLevel() {
return level;
}
public void setLevel(Long level) {
this.level = level;
}
public Long getParentid() {
return parentid;
}
public void setParentid(Long parentid) {
this.parentid = parentid;
}
public Long getWeight() {
return weight;
}
public void setWeight(Long weight) {
this.weight = weight;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getMenuCode() {
return menuCode;
}
public void setMenuCode(String menuCode) {
this.menuCode = menuCode;
}
public String getMenuName() {
return menuName;
}
public void setMenuName(String menuName) {
this.menuName = menuName;
}
public String getRemarks() {
return remarks;
}
public void setRemarks(String remarks) {
this.remarks = remarks;
}
public Long getStatus() {
return status;
}
public void setStatus(Long status) {
this.status = status;
}
public List<SysMenu> getSubMenu() {
return subMenu;
}
public void setSubMenu(List<SysMenu> subMenu) {
this.subMenu = subMenu;
}
public String getMenuUrl() {
return menuUrl;
}
public void setMenuUrl(String menuUrl) {
this.menuUrl = menuUrl;
}
}
package com.server.shiro.persistent.bean;
import java.io.Serializable;
/**
* Created by dell on 2018/3/13.
*/
public class SysMenuQuery implements Serializable {
/**
* 菜单编码
*/
private String menuCode;
/**
* 菜单名字
*/
private String menuName;
/**
* 是否有效 1有效 2无效
*/
private String status;
public SysMenuQuery(){
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getMenuCode() {
return menuCode;
}
public void setMenuCode(String menuCode) {
this.menuCode = menuCode;
}
public String getMenuName() {
return menuName;
}
public void setMenuName(String menuName) {
this.menuName = menuName;
}
}
package com.server.shiro.persistent.bean;
import javax.persistence.*;
import java.io.Serializable;
/**
* 资源表 - 刘志强
*/
@Entity
@Table(name = "sys_permission")
public class SysPermission implements Serializable {
@Id
@GeneratedValue
@Column(name = "id")
private long id;
/**
* 权限的代码/通配符,对应代码中@RequiresPermissions 的value
*/
@Column(name = "permission_code")
private String permissionCode;
/**
* 本权限的中文释义
*/
@Column(name = "permission_name")
private String permissionName;
/**
* null
*/
@Column(name = "remarks")
private String remarks;
/**
* 是否本菜单必选权限, 1.必选 2非必选 通常是"列表"权限是必选
*/
@Column(name = "status")
private Long status;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getPermissionCode() {
return permissionCode;
}
public void setPermissionCode(String permissionCode) {
this.permissionCode = permissionCode;
}
public String getPermissionName() {
return permissionName;
}
public void setPermissionName(String permissionName) {
this.permissionName = permissionName;
}
public String getRemarks() {
return remarks;
}
public void setRemarks(String remarks) {
this.remarks = remarks;
}
public Long getStatus() {
return status;
}
public void setStatus(Long status) {
this.status = status;
}
@Override
public boolean equals(Object obj) {
SysPermission p=(SysPermission)obj;
if (this == obj)
return true;
if (obj == null)
return false;
return p.getPermissionCode().equals(this.getPermissionCode());
}
}
package com.server.shiro.persistent.bean;
import java.io.Serializable;
/**
* Created by dell on 2018/3/13.
*/
public class SysPermissionQuery implements Serializable {
/**
* 权限的代码/通配符,对应代码中@RequiresPermissions 的value
*/
private String permissionCode;
/**
* 本权限的中文释义
*/
private String permissionName;
/**
* 是否本菜单必选权限, 1.必选 2非必选 通常是"列表"权限是必选
*/
private String status;
public SysPermissionQuery(){
}
public String getPermissionCode() {
return permissionCode;
}
public void setPermissionCode(String permissionCode) {
this.permissionCode = permissionCode;
}
public String getPermissionName() {
return permissionName;
}
public void setPermissionName(String permissionName) {
this.permissionName = permissionName;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
}
package com.server.shiro.persistent.bean;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Set;
/**
* 角色-文金龙
*/
@Entity
@Table(name = "sys_role")
public class SysRole implements Serializable {
@Id
@GeneratedValue
@Column(name = "id")
private long id;
/**
* 角色编码
*/
@Column(name = "role_code")
private String roleCode;
/**
* 角色名字
*/
@Column(name = "role_name")
private String roleName;
/**
* 角色备注
*/
@Column(name = "remarks")
private String remarks;
/**
* null
*/
@Column(name = "create_time")
private java.sql.Timestamp createTime;
/**
* null
*/
@Column(name = "update_time")
private java.sql.Timestamp updateTime;
/**
* 是否有效 1有效 2无效
*/
@Column(name = "status")
private String status;
@ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
@JoinTable(name = "sys_role_rule",
joinColumns = { @JoinColumn(name = "sys_role_id",referencedColumnName="id") },
inverseJoinColumns = {@JoinColumn(name = "rule_id",referencedColumnName="id") })
private Set<SysRule> rules;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getRoleCode() {
return roleCode;
}
public void setRoleCode(String roleCode) {
this.roleCode = roleCode;
}
public String getRoleName() {
return roleName;
}
public void setRoleName(String roleName) {
this.roleName = roleName;
}
public String getRemarks() {
return remarks;
}
public void setRemarks(String remarks) {
this.remarks = remarks;
}
public java.sql.Timestamp getCreateTime() {
return createTime;
}
public void setCreateTime(java.sql.Timestamp createTime) {
this.createTime = createTime;
}
public java.sql.Timestamp getUpdateTime() {
return updateTime;
}
public void setUpdateTime(java.sql.Timestamp updateTime) {
this.updateTime = updateTime;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public Set<SysRule> getRules() {
return rules;
}
public void setRules(Set<SysRule> rules) {
this.rules = rules;
}
}
package com.server.shiro.persistent.bean;
import java.io.Serializable;
/**
* Created by dell on 2018/3/13.
*/
public class SysRoleQuery implements Serializable {
/**
* 角色编码
*/
private String roleCode;
/**
* 角色名字
*/
private String roleName;
/**
* 是否有效 1有效 2无效
*/
private String status;
public SysRoleQuery(){
}
public String getRoleCode() {
return roleCode;
}
public void setRoleCode(String roleCode) {
this.roleCode = roleCode;
}
public String getRoleName() {
return roleName;
}
public void setRoleName(String roleName) {
this.roleName = roleName;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
}
package com.server.shiro.persistent.bean;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Set;
/**
* 权限表 - 刘志强
*/
@Entity
@Table(name = "sys_rule")
public class SysRule implements Serializable {
@Id
@GeneratedValue
@Column(name = "id")
private long id;
/**
* 权限编码
*/
@Column(name = "rule_code")
private String ruleCode;
/**
* 权限名字
*/
@Column(name = "rule_name")
private String ruleName;
/**
* 权限备注
*/
@Column(name = "remarks")
private String remarks;
/**
* null
*/
@Column(name = "create_time")
private java.sql.Timestamp createTime;
/**
* null
*/
@Column(name = "update_time")
private java.sql.Timestamp updateTime;
/**
* 是否有效 1有效 2无效
*/
@Column(name = "status")
private String status;
@ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
@JoinTable(name = "sys_rule_permissions",
joinColumns = { @JoinColumn(name = "sys_rule_id",referencedColumnName="id") },
inverseJoinColumns = {@JoinColumn(name = "permissions_id",referencedColumnName="id") })
private Set<SysPermission> permissions;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getRuleCode() {
return ruleCode;
}
public void setRuleCode(String ruleCode) {
this.ruleCode = ruleCode;
}
public String getRuleName() {
return ruleName;
}
public void setRuleName(String ruleName) {
this.ruleName = ruleName;
}
public String getRemarks() {
return remarks;
}
public void setRemarks(String remarks) {
this.remarks = remarks;
}
public java.sql.Timestamp getCreateTime() {
return createTime;
}
public void setCreateTime(java.sql.Timestamp createTime) {
this.createTime = createTime;
}
public java.sql.Timestamp getUpdateTime() {
return updateTime;
}
public void setUpdateTime(java.sql.Timestamp updateTime) {
this.updateTime = updateTime;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public Set<SysPermission> getPermissions() {
return permissions;
}
public void setPermissions(Set<SysPermission> permissions) {
this.permissions = permissions;
}
}
package com.server.shiro.persistent.bean;
import java.io.Serializable;
/**
* Created by dell on 2018/3/13.
*/
public class SysRuleQuery implements Serializable {
/**
* 权限编码
*/
private String ruleCode;
/**
* 权限名字
*/
private String ruleName;
/**
* 是否有效 1有效 2无效
*/
private String status;
public SysRuleQuery(){
}
public String getRuleCode() {
return ruleCode;
}
public void setRuleCode(String ruleCode) {
this.ruleCode = ruleCode;
}
public String getRuleName() {
return ruleName;
}
public void setRuleName(String ruleName) {
this.ruleName = ruleName;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
}
package com.server.shiro.persistent.bean;
import org.hibernate.annotations.GenericGenerator;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
import java.util.Set;
@Entity
@Table(name = "sys_user")
public class SysUser implements Serializable {
@Id
@GeneratedValue
@Column(name = "id")
private long id;
/**
* 用户名
*/
@Column(name = "username")
private String username;
/**
* 真实姓名
*/
@Column(name = "real_name")
private String realname;
/**
* 手机号
*/
@Column(name = "phone")
private String phone;
/**
* 密码
*/
@Column(name = "password")
private String password;
/**
* 备注
*/
@Column(name = "remarks")
private String remarks;
/**
* 创建时间
*/
@Column(name = "create_time")
private Date createTime;
/**
* 修改时间
*/
@Column(name = "update_time")
private Date updateTime;
/**
* 是否有效 1有效 2无效
*/
@Column(name = "status")
private Long status;
@ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
@JoinTable(name="sys_user_menus",//中间表的名称
joinColumns={@JoinColumn(name="sys_user_id",referencedColumnName="id")},//中间表PRODUCT_ID字段关联PRODUCT的ID
inverseJoinColumns={@JoinColumn(name="menus_id",referencedColumnName="id")})//中间表CATEGORY_ID字段关联CATEGORY的ID
private Set<SysMenu> menus;
@ManyToMany(cascade=CascadeType.ALL,fetch=FetchType.EAGER)//级联保存、更新、删除、刷新;延迟加载
@JoinTable(name = "sys_user_roles",
joinColumns = { @JoinColumn(name = "sys_user_id",referencedColumnName="id") },
inverseJoinColumns = {@JoinColumn(name = "roles_id",referencedColumnName="id") })
private Set<SysRole> roles;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getRemarks() {
return remarks;
}
public void setRemarks(String remarks) {
this.remarks = remarks;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Long getStatus() {
return status;
}
public void setStatus(Long status) {
this.status = status;
}
public Set<SysMenu> getMenus() {
return menus;
}
public void setMenus(Set<SysMenu> menus) {
this.menus = menus;
}
public Set<SysRole> getRoles() {
return roles;
}
public void setRoles(Set<SysRole> roles) {
this.roles = roles;
}
public void setRealname(String realname) {
this.realname = realname;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getRealname() {
return realname;
}
public String getPhone() {
return phone;
}
}
package com.server.shiro.persistent.bean;
import java.io.Serializable;
/**
* Created by dell on 2018/3/13.
*/
public class SysUserQuery implements Serializable {
/**
* 权限编码
*/
private String username;
/**
* 权限名字
*/
private String realname;
/**
* 是否有效 1有效 2无效
*/
private String phone;
private Long status;
public SysUserQuery(){
}
public String getUsername() {
return username;
}
public String getRealname() {
return realname;
}
public String getPhone() {
return phone;
}
public Long getStatus() {
return status;
}
public void setUsername(String username) {
this.username = username;
}
public void setRealname(String realname) {
this.realname = realname;
}
public void setPhone(String phone) {
this.phone = phone;
}
public void setStatus(Long status) {
this.status = status;
}
}
package com.server.shiro.persistent.bean;
import java.util.List;
import java.util.Map;
/**
* Created by yinbinhome@163.com on 2018/3/1.
* description:
*/
public class UserMenuModel {
private String name;
private Long weight;
private List<Map<String,String>> menus;
private int isSelect;
private Long id;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public List<Map<String, String>> getMenus() {
return menus;
}
public void setMenus(List<Map<String, String>> menus) {
this.menus = menus;
}
public Long getWeight() {
return weight;
}
public void setWeight(Long weight) {
this.weight = weight;
}
public int getIsSelect() {
return isSelect;
}
public void setIsSelect(int isSelect) {
this.isSelect = isSelect;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
}
package com.server.shiro.persistent.bean;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Created by yinbinhome@163.com on 2018/2/26.
* description:
*/
public class UserModel {
private String username;
private String sessionid;
private List<MenuModel> menus;
private List<String> rules;
public String getSessionid() {
return sessionid;
}
public void setSessionid(String sessionid) {
this.sessionid = sessionid;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public List<MenuModel> getMenus() {
return menus;
}
public void setMenus(List<MenuModel> menus) {
this.menus = menus;
}
public List<String> getRules() {
return rules;
}
public void setRules(List<String> rules) {
this.rules = rules;
}
}
package com.server.shiro.persistent.repository;
import com.server.shiro.persistent.bean.SysMenu;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 模块-文金龙
*/
@Service
public interface MenuRepository extends JpaRepository<SysMenu,Long>,JpaSpecificationExecutor<SysMenu> {
List<SysMenu> findByMenuCode(String ruleCode);
List<SysMenu> findByLevel(Long level);
List<SysMenu> findByParentid(Long parentId);
}
package com.server.shiro.persistent.repository;
import com.server.shiro.persistent.bean.SysRole;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 角色-文金龙
*/
@Service
public interface RoleRepository extends JpaRepository<SysRole,Long>,JpaSpecificationExecutor<SysRole> {
List<SysRole> findByRoleCode(String ruleCode);
}
package com.server.shiro.persistent.repository;
import com.server.shiro.persistent.bean.SysPermission;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import java.util.List;
/**
* 资源
*/
public interface SysPermissionRepository extends JpaRepository<SysPermission,Long>,JpaSpecificationExecutor<SysPermission> {
List<SysPermission> findByPermissionCode(String permissionCode);
}
package com.server.shiro.persistent.repository;
import com.server.shiro.persistent.bean.SysRule;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import java.util.List;
/**
* 权限
*/
public interface SysRuleRepository extends JpaRepository<SysRule,Long>,JpaSpecificationExecutor<SysRule> {
List<SysRule> findByRuleCode(String ruleCode);
}
package com.server.shiro.persistent.repository;
import com.server.shiro.persistent.bean.SysMenu;
import com.server.shiro.persistent.bean.SysUser;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Created by yinbinhome@163.com on 2018/2/22.
* description:
*/
@Service
public interface UserRepository extends JpaRepository<SysUser,Long>, JpaSpecificationExecutor<SysUser> {
//查询用户名称包含username字符串的用户对象
List<SysUser> findByUsernameContaining(String username);
//获得单个用户对象,根据username和pwd的字段匹配
SysUser getByUsernameIsAndPasswordIs(String username, String pwd);
//精确匹配username的用户对象
SysUser getByUsernameIs(String username);
}
package com.server.shiro.persistent.service;
import com.alibaba.fastjson.JSONObject;
import com.server.shiro.persistent.bean.SysUser;
/**
* Created by yinbinhome@163.com on 2018/2/23.
* description:
*/
public interface LoginService {
/**
* 登录表单提交
*
* @param jsonObject
* @return
*/
JSONObject authLogin(JSONObject jsonObject);
/**
* 根据用户名和密码查询对应的用户
*
* @param username 用户名
* @param password 密码
* @return
*/
SysUser getUser(String username, String password);
/**
* 查询当前登录用户的权限等信息
*
* @return
*/
SysUser getInfo();
/**
* 退出登录
*
* @return
*/
void logout();
}
package com.server.shiro.persistent.service;
import com.server.shiro.persistent.bean.SysMenu;
import com.server.shiro.persistent.bean.SysMenuQuery;
import com.server.shiro.persistent.bean.SysRole;
import com.server.shiro.persistent.bean.SysRoleQuery;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
public interface SysRoleService {
//角色分页
Page<SysRole> findSysRolePage(Pageable pageable, SysRoleQuery roleQuery);
//菜单分页
Page<SysMenu> findSysMenuPage(Pageable pageable, SysMenuQuery menuQuery);
}
package com.server.shiro.persistent.service;
import com.server.shiro.persistent.bean.SysPermission;
import com.server.shiro.persistent.bean.SysPermissionQuery;
import com.server.shiro.persistent.bean.SysRule;
import com.server.shiro.persistent.bean.SysRuleQuery;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
/**
* Created by dell on 2018/3/13.
*/
public interface SysRuleService {
Page<SysRule> findSysRulePage(Pageable pageable, SysRuleQuery ruleQuery);
Page<SysPermission> findSysPermissionPage(Pageable pageable, SysPermissionQuery permissionQuery);
}
package com.server.shiro.persistent.service;
import com.alibaba.fastjson.JSONObject;
import com.server.shiro.persistent.bean.*;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import java.util.List;
import java.util.Map;
/**
* Created by yinbinhome@163.com on 2018/2/23.
* description:
*/
public interface UserService {
List<UserMenuModel> getMenu(SysUser user,List<SysMenu> list);
List<Map> getRole(SysUser user, List<SysRole> list);
Page<SysUser> findSysUserPage(Pageable pageable, SysUserQuery userQuery);
}
package com.server.shiro.persistent.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.server.shiro.constants.Constants;
import com.server.shiro.persistent.bean.*;
import com.server.shiro.persistent.repository.UserRepository;
import com.server.shiro.persistent.service.LoginService;
import com.server.shiro.util.CommonUtil;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.UsernamePasswordToken;
import org.apache.shiro.session.Session;
import org.apache.shiro.subject.Subject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;
import java.util.*;
/**
* Created by yinbinhome@163.com on 2018/2/23.
* description:
*/
@Service
public class LoginServiceImpl implements LoginService {
private Logger logger = LoggerFactory.getLogger(LoginServiceImpl.class);
@Autowired
private UserRepository userRepository;
@PersistenceContext
private EntityManager entityManager;
/**
* 登录表单提交
*
* @param jsonObject
* @return
*/
@Override
public JSONObject authLogin(JSONObject jsonObject) {
String username = jsonObject.getString("username");
String password = jsonObject.getString("password");
Subject currentUser = SecurityUtils.getSubject();
Session session = currentUser.getSession();
String sessionId = session.getId().toString();
UsernamePasswordToken token = new UsernamePasswordToken(username, password);
currentUser.login(token);
SysUser user= (SysUser) session.getAttribute(Constants.SESSION_USER_INFO);
UserModel usermodel=getModel(user);
usermodel.setSessionid(sessionId);
return CommonUtil.loginJson(usermodel);
}
/**
* 根据用户名和密码查询对应的用户
*
* @param username 用户名
* @param password 密码
* @return
*/
@Override
public SysUser getUser(String username, String password) {
userRepository.findAll();
return userRepository.getByUsernameIsAndPasswordIs(username, password);
}
/**
* 查询当前登录用户的权限等信息
*
* @return
*/
@Override
public SysUser getInfo() {
//从session获取用户信息
Session session = SecurityUtils.getSubject().getSession();
SysUser userInfo = (SysUser) session.getAttribute(Constants.SESSION_USER_INFO);
return userInfo;
}
/**
* 退出登录
*
* @return
*/
@Override
public void logout() {
try {
Subject currentUser = SecurityUtils.getSubject();
currentUser.logout();
} catch (Exception e) {
}
}
//根据SysUser转换前端Model
public UserModel getModel(SysUser user){
UserModel model=new UserModel();
model.setUsername(user.getUsername());
List<String> rules=new ArrayList<String>();
List<MenuModel> menus=getMenus(user.getMenus());
Set<SysRole> roles = (Set<SysRole>) user.getRoles();
for(SysRole r:roles){
for(SysRule rule:r.getRules()){
rules.add(rule.getRuleCode());
}
}
model.setMenus(menus);
model.setRules(rules);
return model;
}
public List<MenuModel> getMenus(Set<SysMenu> menus){
List<MenuModel> menu_1=new ArrayList<MenuModel>();
for(SysMenu menu:menus){
if(menu.getLevel()==1){
MenuModel model=new MenuModel();
model.setWeight(menu.getWeight());
model.setName(menu.getMenuName());
List<Map<String,String>> ms=new ArrayList<Map<String,String>>();
for(SysMenu m:menus){
if(m.getParentid()==menu.getId()){
Map<String,String> map=new HashMap<String,String>();
map.put("menu_name",m.getMenuName());
map.put("menu_code",m.getMenuCode());
map.put("menu_weight",m.getWeight()+"");
map.put("menu_url",m.getMenuUrl());
ms.add(map);
}
}
model.setMenus(ms);
menu_1.add(model);
}
}
return menu_1;
}
}
package com.server.shiro.persistent.service.impl;
import com.server.shiro.persistent.bean.SysMenu;
import com.server.shiro.persistent.bean.SysMenuQuery;
import com.server.shiro.persistent.bean.SysRole;
import com.server.shiro.persistent.bean.SysRoleQuery;
import com.server.shiro.persistent.repository.MenuRepository;
import com.server.shiro.persistent.repository.RoleRepository;
import com.server.shiro.persistent.service.SysRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Predicate;
import javax.persistence.criteria.Root;
import java.util.ArrayList;
import java.util.List;
/**
* Created by dell on 2018/3/13.
*/
@Service
public class SysRoleServiceImpl implements SysRoleService {
@Autowired
RoleRepository roleRepository;
@Autowired
MenuRepository menuRepository;
@Override
public Page<SysRole> findSysRolePage(Pageable pageable, SysRoleQuery RoleQuery) {
Page<SysRole> bookPage = roleRepository.findAll(new Specification<SysRole>() {
public Predicate toPredicate(Root<SysRole> root, CriteriaQuery<?> query, CriteriaBuilder criteriaBuilder) {
List<Predicate> list = new ArrayList<Predicate>();
if (StringUtils.hasText(RoleQuery.getRoleName())) {
list.add(criteriaBuilder.like(root.get("roleName").as(String.class), "%"+RoleQuery.getRoleName()+"%"));
}
if (StringUtils.hasText(RoleQuery.getRoleCode())) {
list.add(criteriaBuilder.like(root.get("roleCode").as(String.class), "%"+RoleQuery.getRoleCode()+"%"));
}
if (StringUtils.hasText(RoleQuery.getStatus())) {
list.add(criteriaBuilder.equal(root.get("status").as(String.class), RoleQuery.getStatus()));
}
Predicate[] p = new Predicate[list.size()];
return criteriaBuilder.and(list.toArray(p));
}
}, pageable);
return bookPage;
}
@Override
public Page<SysMenu> findSysMenuPage(Pageable pageable, SysMenuQuery menuQuery) {
Page<SysMenu> bookPage = menuRepository.findAll(new Specification<SysMenu>() {
public Predicate toPredicate(Root<SysMenu> root, CriteriaQuery<?> query, CriteriaBuilder criteriaBuilder) {
List<Predicate> list = new ArrayList<Predicate>();
if (StringUtils.hasText(menuQuery.getMenuName())) {
list.add(criteriaBuilder.like(root.get("menuName").as(String.class), "%"+menuQuery.getMenuName()+"%"));
}
if (StringUtils.hasText(menuQuery.getMenuCode())) {
list.add(criteriaBuilder.like(root.get("menuCode").as(String.class), "%"+menuQuery.getMenuCode()+"%"));
}
if (StringUtils.hasText(menuQuery.getStatus())) {
list.add(criteriaBuilder.equal(root.get("status").as(String.class), menuQuery.getStatus()));
}
Predicate[] p = new Predicate[list.size()];
return criteriaBuilder.and(list.toArray(p));
}
}, pageable);
return bookPage;
}
}
package com.server.shiro.persistent.service.impl;
import com.server.shiro.persistent.bean.SysPermission;
import com.server.shiro.persistent.bean.SysPermissionQuery;
import com.server.shiro.persistent.bean.SysRule;
import com.server.shiro.persistent.bean.SysRuleQuery;
import com.server.shiro.persistent.repository.SysPermissionRepository;
import com.server.shiro.persistent.repository.SysRuleRepository;
import com.server.shiro.persistent.service.SysRuleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Predicate;
import javax.persistence.criteria.Root;
import java.util.ArrayList;
import java.util.List;
/**
* Created by dell on 2018/3/13.
*/
@Service
public class SysRuleServiceImpl implements SysRuleService {
@Autowired
SysRuleRepository ruleRepository;
@Autowired
SysPermissionRepository sysPermissionRepository;
@Override
public Page<SysRule> findSysRulePage(Pageable pageable, SysRuleQuery ruleQuery) {
Page<SysRule> bookPage = ruleRepository.findAll(new Specification<SysRule>(){
public Predicate toPredicate(Root<SysRule> root, CriteriaQuery<?> query, CriteriaBuilder criteriaBuilder) {
List<Predicate> list = new ArrayList<Predicate>();
if(StringUtils.hasText(ruleQuery.getRuleName())){
list.add(criteriaBuilder.like(root.get("ruleName").as(String.class), "%"+ruleQuery.getRuleName()+"%"));
}
if(StringUtils.hasText(ruleQuery.getRuleCode())){
list.add(criteriaBuilder.like(root.get("ruleCode").as(String.class), "%"+ruleQuery.getRuleCode()+"%"));
}
if(StringUtils.hasText(ruleQuery.getStatus())){
list.add(criteriaBuilder.equal(root.get("status").as(String.class), ruleQuery.getStatus()));
}
Predicate[] p = new Predicate[list.size()];
return criteriaBuilder.and(list.toArray(p));
}
},pageable);
return bookPage;
}
@Override
public Page<SysPermission> findSysPermissionPage(Pageable pageable, SysPermissionQuery permissionQuery) {
Page<SysPermission> bookPage = sysPermissionRepository.findAll(new Specification<SysPermission>(){
public Predicate toPredicate(Root<SysPermission> root, CriteriaQuery<?> query, CriteriaBuilder criteriaBuilder) {
List<Predicate> list = new ArrayList<Predicate>();
if(StringUtils.hasText(permissionQuery.getPermissionName())){
list.add(criteriaBuilder.like(root.get("permissionName").as(String.class), "%"+permissionQuery.getPermissionName()+"%"));
}
if(StringUtils.hasText(permissionQuery.getPermissionCode())){
list.add(criteriaBuilder.like(root.get("permissionCode").as(String.class), "%"+permissionQuery.getPermissionCode()+"%"));
}
if(StringUtils.hasText(permissionQuery.getStatus())){
list.add(criteriaBuilder.equal(root.get("status").as(String.class), permissionQuery.getStatus()));
}
Predicate[] p = new Predicate[list.size()];
return criteriaBuilder.and(list.toArray(p));
}
},pageable);
return bookPage;
}
}
package com.server.shiro.persistent.service.impl;
import com.server.shiro.persistent.bean.*;
import com.server.shiro.persistent.repository.UserRepository;
import com.server.shiro.persistent.service.UserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Predicate;
import javax.persistence.criteria.Root;
import java.util.*;
/**
*
*/
@Service
public class UserServiceImpl implements UserService {
private Logger logger = LoggerFactory.getLogger(UserServiceImpl.class);
@Autowired
private UserRepository userRepository;
@PersistenceContext
private EntityManager entityManager;
/**
* 用户模板绑定列表
* @param user
* @param list
* @return
*/
@Override
public List<UserMenuModel> getMenu(SysUser user,List<SysMenu> list){
List<UserMenuModel> menu_1=new ArrayList<UserMenuModel>();
Set<SysMenu> menus = user.getMenus();
for(SysMenu menu:list){
if(menu.getLevel()==1){
UserMenuModel menuModel = new UserMenuModel();
menuModel.setWeight(menu.getWeight());
menuModel.setName(menu.getMenuName());
menuModel.setId(menu.getId());
menuModel.setIsSelect(0);
for(SysMenu symMenu:menus){
if(menu.getId()==symMenu.getId()){ //判断当前用户是否有次菜单
menuModel.setIsSelect(1);
break;
}
}
List<Map<String,String>> ms=new ArrayList<Map<String,String>>();
for(SysMenu m:list){ //获取二级菜单
if(m.getParentid()==menu.getId()){
Map<String,String> map=new HashMap<String,String>();
map.put("name",m.getMenuName());
map.put("id",m.getId()+"");
map.put("weight",m.getWeight()+"");
map.put("isSelect","0");
for(SysMenu symMenu:menus){
if(m.getId()==symMenu.getId()){ //判断当前用户是否有次菜单
map.put("isSelect","1");
break;
}
}
ms.add(map);
}
}
menuModel.setMenus(ms);
menu_1.add(menuModel);
}
}
return menu_1;
}
/**
* 获取用户角色列表
* @param user
* @param list
* @return
*/
@Override
public List<Map> getRole(SysUser user, List<SysRole> list){
List<Map> role_1=new ArrayList<Map>();
Set<SysRole> roles = user.getRoles();
for (SysRole r:list){
Map<String,String> map=new HashMap<String,String>();
map.put("id",r.getId()+"");
map.put("roleCode",r.getRoleCode());
map.put("roleName",r.getRoleName());
map.put("remarks",r.getRemarks());
map.put("status",r.getStatus());
map.put("isSelect","0");
for (SysRole ur:roles){
if(r.getId()==ur.getId()){
map.put("isSelect","1");
break;
}
}
role_1.add(map);
}
return role_1;
}
/**
* 用户列表
* @param pageable
* @param userQuery
* @return
*/
@Override
public Page<SysUser> findSysUserPage(Pageable pageable, SysUserQuery userQuery){
Page<SysUser> bookPage = userRepository.findAll(new Specification<SysUser>(){
public Predicate toPredicate(Root<SysUser> root, CriteriaQuery<?> query, CriteriaBuilder criteriaBuilder) {
List<Predicate> list = new ArrayList<Predicate>();
if(StringUtils.hasText(userQuery.getUsername())){
list.add(criteriaBuilder.like(root.get("username").as(String.class), "%"+userQuery.getUsername()+"%"));
}
if(StringUtils.hasText(userQuery.getRealname())){
list.add(criteriaBuilder.like(root.get("realname").as(String.class), "%"+userQuery.getRealname()+"%"));
}
if(StringUtils.hasText(userQuery.getPhone())){
list.add(criteriaBuilder.like(root.get("phone").as(String.class), "%"+userQuery.getPhone()+"%"));
}
if(null !=userQuery.getStatus()){
list.add(criteriaBuilder.equal(root.get("status").as(Long.class), userQuery.getStatus()));
}
Predicate[] p = new Predicate[list.size()];
return criteriaBuilder.and(list.toArray(p));
}
},pageable);
return bookPage;
}
}
package com.server.shiro.realm;
import com.server.shiro.context.ContextPermissionManager;
import com.server.shiro.constants.Constants;
import com.server.shiro.context.PermissionManage;
import com.server.shiro.exception.AccountErrorException;
import com.server.shiro.persistent.bean.SysPermission;
import com.server.shiro.persistent.bean.SysRole;
import com.server.shiro.persistent.bean.SysRule;
import com.server.shiro.persistent.bean.SysUser;
import com.server.shiro.persistent.repository.UserRepository;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.*;
import org.apache.shiro.authz.AuthorizationInfo;
import org.apache.shiro.authz.SimpleAuthorizationInfo;
import org.apache.shiro.realm.AuthorizingRealm;
import org.apache.shiro.session.Session;
import org.apache.shiro.subject.PrincipalCollection;
import org.apache.shiro.util.ByteSource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
/**
* Created by yinbinhome@163.com on 2018/2/23.
* description:
*/
public class UserRealm extends AuthorizingRealm {
private Logger logger = LoggerFactory.getLogger(UserRealm.class);
@Autowired
private UserRepository userRepository;
@Autowired
private PermissionManage permissionManager;
/**
* 权限认证,角色和权限
* 对url的认证,当前用户有哪些URL访问的权限
* @param principals
* @return
*/
@Override
protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principals) {
String username= (String) principals.getPrimaryPrincipal();
Set<String> ps=new HashSet<String>();
//查询用户的权限
List<SysUser> up = (List<SysUser>) permissionManager.pullPermission();
for(SysUser user:up){
if(user.getUsername().equals(username)){
Set<SysRole> roles = (Set<SysRole>) user.getRoles();
for(SysRole r:roles){
for(SysRule rule:r.getRules()){
for(SysPermission p:rule.getPermissions()){
ps.add(p.getPermissionCode());
}
}
}
}
}
//为当前用户设置角色和权限
SimpleAuthorizationInfo authorizationInfo = new SimpleAuthorizationInfo();
authorizationInfo.addStringPermissions(ps);
return authorizationInfo;
}
/**
* 用户认证,验证用户名和密码
* 验证当前登录的Subject
* LoginController.login()方法中执行Subject.login()时 执行此方法
*/
@Override
protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken authcToken) throws AuthenticationException {
String loginName = (String) authcToken.getPrincipal();
// 获取用户密码
String password = new String((char[]) authcToken.getCredentials());
SysUser user = userRepository.getByUsernameIsAndPasswordIs(loginName, password);
// SysUser user = userRepository.getByUsernameIs(loginName);
if (user == null) {
//没找到帐号
throw new AccountErrorException();
}
//交给AuthenticatingRealm使用CredentialsMatcher进行密码匹配,如果觉得人家的不好可以自定义实现
SimpleAuthenticationInfo authenticationInfo = new SimpleAuthenticationInfo(
user.getUsername(),
user.getPassword(),
// ByteSource.Util.bytes("salt"),
getName()
);
//session中不需要保存密码
user.setPassword("");
SecurityUtils.getSubject().getSession().setAttribute(Constants.SESSION_USER_INFO, user);
return authenticationInfo;
}
}
package com.server.shiro.session;
import org.apache.shiro.web.servlet.ShiroHttpServletRequest;
import org.apache.shiro.web.session.mgt.DefaultWebSessionManager;
import org.apache.shiro.web.util.WebUtils;
import org.springframework.util.StringUtils;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import java.io.Serializable;
/**
* Created by yinbinhome@163.com on 2018/2/13.
* description:
*/
public class OssSessionManager extends DefaultWebSessionManager {
private static final String AUTHORIZATION = "Authorization";
private static final String REFERENCED_SESSION_ID_SOURCE = "Stateless request";
public OssSessionManager() {
super();
}
@Override
protected Serializable getSessionId(ServletRequest request, ServletResponse response) {
String id = WebUtils.toHttp(request).getHeader(AUTHORIZATION);
//如果请求头中有 Authorization 则其值为sessionId
if (!StringUtils.isEmpty(id)) {
request.setAttribute(ShiroHttpServletRequest.REFERENCED_SESSION_ID_SOURCE, REFERENCED_SESSION_ID_SOURCE);
request.setAttribute(ShiroHttpServletRequest.REFERENCED_SESSION_ID, id);
request.setAttribute(ShiroHttpServletRequest.REFERENCED_SESSION_ID_IS_VALID, Boolean.TRUE);
return id;
} else {
//否则按默认规则从cookie取sessionId,按默认规则生成sessionId
return super.getSessionId(request, response);
}
}
}
\ No newline at end of file
package com.server.shiro.session;
import org.apache.shiro.session.Session;
import org.apache.shiro.session.mgt.SimpleSession;
import org.apache.shiro.session.mgt.eis.EnterpriseCacheSessionDAO;
import java.io.*;
/**
* Created by yinbinhome@163.com on 2018/2/25.
* description:
*/
public class SessionRedisManage extends EnterpriseCacheSessionDAO {
// // 创建session,保存到数据库
// @Override
// protected Serializable doCreate(Session session) {
// Serializable sessionId = super.doCreate(session);
// RedisDb.setObject(sessionId.toString().getBytes(), sessionToByte(session));
//
// return sessionId;
// }
//
// // 获取session
// @Override
// protected Session doReadSession(Serializable sessionId) {
// // 先从缓存中获取session,如果没有再去数据库中获取
// Session session = super.doReadSession(sessionId);
// if(session == null){
// byte[] bytes = RedisDb.getObject(sessionId.toString().getBytes());
// if(bytes != null && bytes.length > 0){
// session = byteToSession(bytes);
// }
// }
// return session;
// }
//
// // 更新session的最后一次访问时间
// @Override
// protected void doUpdate(Session session) {
// super.doUpdate(session);
// RedisDb.setObject(session.getId().toString().getBytes(), sessionToByte(session));
// }
//
// // 删除session
// @Override
// protected void doDelete(Session session) {
// super.doDelete(session);
// RedisDb.delString(session.getId() + "");
// }
//
// // 把session对象转化为byte保存到redis中
// public byte[] sessionToByte(Session session){
// ByteArrayOutputStream bo = new ByteArrayOutputStream();
// byte[] bytes = null;
// try {
// ObjectOutputStream oo = new ObjectOutputStream(bo);
// oo.writeObject(session);
// bytes = bo.toByteArray();
// } catch (IOException e) {
// e.printStackTrace();
// }
// return bytes;
// }
//
// // 把byte还原为session
// public Session byteToSession(byte[] bytes){
// ByteArrayInputStream bi = new ByteArrayInputStream(bytes);
// ObjectInputStream in;
// SimpleSession session = null;
// try {
// in = new ObjectInputStream(bi);
// session = (SimpleSession) in.readObject();
// } catch (ClassNotFoundException e) {
// e.printStackTrace();
// } catch (IOException e) {
// e.printStackTrace();
// }
//
// return session;
// }
}
package com.server.shiro.util;
import com.alibaba.fastjson.JSONObject;
import com.server.shiro.constants.Constants;
import com.server.shiro.constants.ErrorEnum;
import com.server.shiro.persistent.bean.SysUser;
import com.server.shiro.persistent.bean.UserModel;
import javax.servlet.http.HttpServletRequest;
import java.util.Enumeration;
import java.util.List;
/**
* Created by yinbinhome@163.com on 2018/2/23.
* description:
*/
public class CommonUtil {
/**
* 返回一个returnData为空对象的成功消息的json
*
* @return
*/
public static JSONObject successJson() {
return successJson(new JSONObject());
}
/**
* 返回一个返回码为100的json
*
* @param returnData json里的主要内容
* @return
*/
public static JSONObject successJson(Object returnData) {
JSONObject resultJson = new JSONObject();
resultJson.put("returnCode", Constants.SUCCESS_CODE);
resultJson.put("returnMsg", Constants.SUCCESS_MSG);
resultJson.put("returnData", returnData);
return resultJson;
}
/**
* 返回错误信息JSON
*
* @param errorEnum 错误码的errorEnum
* @return
*/
public static JSONObject errorJson(ErrorEnum errorEnum) {
JSONObject resultJson = new JSONObject();
resultJson.put("returnCode", errorEnum.getErrorCode());
resultJson.put("returnMsg", errorEnum.getErrorMsg());
resultJson.put("returnData", new JSONObject());
return resultJson;
}
/**
* 查询分页结果后的封装工具方法
*
* @param requestJson 请求参数json,此json在之前调用fillPageParam 方法时,已经将pageRow放入
* @param list 查询分页对象list
* @param totalCount 查询出记录的总条数
*/
public static JSONObject successPage(final JSONObject requestJson, List<JSONObject> list, int totalCount) {
int pageRow = requestJson.getIntValue("pageRow");
int totalPage = getPageCounts(pageRow, totalCount);
JSONObject result = successJson();
JSONObject returnData = new JSONObject();
returnData.put("list", list);
returnData.put("totalCount", totalCount);
returnData.put("totalPage", totalPage);
result.put("returnData", returnData);
return result;
}
/**
* 查询分页结果后的封装工具方法
*
* @param list 查询分页对象list
*/
public static JSONObject successPage(List<JSONObject> list) {
JSONObject result = successJson();
JSONObject returnData = new JSONObject();
returnData.put("list", list);
result.put("returnData", returnData);
return result;
}
/**
* 获取总页数
*
* @param pageRow 每页行数
* @param itemCount 结果的总条数
* @return
*/
public static int getPageCounts(int pageRow, int itemCount) {
if (itemCount == 0) {
return 1;
}
return itemCount % pageRow > 0 ?
itemCount / pageRow + 1 :
itemCount / pageRow;
}
/**
* 将request参数值转为json
*
* @param request
* @return
*/
public static JSONObject request2Json(HttpServletRequest request) {
JSONObject requestJson = new JSONObject();
Enumeration paramNames = request.getParameterNames();
while (paramNames.hasMoreElements()) {
String paramName = (String) paramNames.nextElement();
String[] pv = request.getParameterValues(paramName);
StringBuilder sb = new StringBuilder();
for (int i = 0; i < pv.length; i++) {
if (pv[i].length() > 0) {
if (i > 0) {
sb.append(",");
}
sb.append(pv[i]);
}
}
requestJson.put(paramName, sb.toString());
}
return requestJson;
}
/**
* 在分页查询之前,为查询条件里加上分页参数
*
* @param paramObject 查询条件json
* @param defaultPageRow 默认的每页条数,即前端不传pageRow参数时的每页条数
*/
public static void fillPageParam(final JSONObject paramObject, int defaultPageRow) {
int pageNum = paramObject.getIntValue("pageNum");
pageNum = pageNum == 0 ? 1 : pageNum;
int pageRow = paramObject.getIntValue("pageRow");
pageRow = pageRow == 0 ? defaultPageRow : pageRow;
paramObject.put("offSet", (pageNum - 1) * pageRow);
paramObject.put("pageRow", pageRow);
paramObject.put("pageNum", pageNum);
//删除此参数,防止前端传了这个参数,pageHelper分页插件检测到之后,拦截导致SQL错误
paramObject.remove("pageSize");
}
/**
* 分页查询之前的处理参数
* 没有传pageRow参数时,默认每页10条.
*
* @param paramObject
*/
public static void fillPageParam(final JSONObject paramObject) {
fillPageParam(paramObject, 10);
}
public static JSONObject loginJson(UserModel user){
JSONObject resultJson = new JSONObject();
resultJson.put("code", Constants.SUCCESS_CODE);
resultJson.put("message", Constants.SUCCESS_MSG);
resultJson.put("status", "1");
JSONObject data=new JSONObject();
data.put("usermodel",user);
resultJson.put("returnData", data);
return resultJson;
}
}
package com.server.utils;
public final class ContentType {
//注意:EXTENSION 和 CONTENTTYPE 的值是通过下标是对应的,比如:EXTENSION[i]=CONTENTTYPE[i]
private static final String[] EXTENSION = new String[]{".*", ".tif",
".001", ".301", ".323", ".906", ".907", ".a11", ".acp", ".ai",
".aif", ".aifc", ".aiff", ".anv", ".asa", ".asf", ".asp", ".asx",
".au", ".avi", ".awf", ".biz", ".bmp", ".bot", ".c4t", ".c90",
".cal", ".cat", ".cdf", ".cdr", ".cel", ".cer", ".cg4", ".cgm",
".cit", ".class", ".cml", ".cmp", ".cmx", ".cot", ".crl", ".crt",
".csi", ".css", ".cut", ".dbf", ".dbm", ".dbx", ".dcd", ".dcx",
".der", ".dgn", ".dib", ".dll", ".doc", ".dot", ".drw", ".dtd",
".dwf", ".dwf", ".dwg", ".dxb", ".dxf", ".edn", ".emf", ".eml",
".ent", ".epi", ".eps", ".eps", ".etd", ".exe", ".fax", ".fdf",
".fif", ".fo", ".frm", ".g4", ".gbr", ".", ".gif", ".gl2", ".gp4",
".hgl", ".hmr", ".hpg", ".hpl", ".hqx", ".hrf", ".hta", ".htc",
".htm", ".html", ".htt", ".htx", ".icb", ".ico", ".ico", ".iff",
".ig4", ".igs", ".iii", ".img", ".ins", ".isp", ".IVF", ".java",
".jfif", ".jpe", ".jpe", ".jpeg", ".jpg", ".jpg", ".js", ".jsp",
".la1", ".lar", ".latex", ".lavs", ".lbm", ".lmsff", ".ls", ".ltr",
".m1v", ".m2v", ".m3u", ".m4e", ".mac", ".man", ".math", ".mdb",
".mdb", ".mfp", ".mht", ".mhtml", ".mi", ".mid", ".midi", ".mil",
".mml", ".mnd", ".mns", ".mocha", ".movie", ".mp1", ".mp2",
".mp2v", ".mp3", ".mp4", ".mpa", ".mpd", ".mpe", ".mpeg", ".mpg",
".mpga", ".mpp", ".mps", ".mpt", ".mpv", ".mpv2", ".mpw", ".mpx",
".mtx", ".mxp", ".net", ".nrf", ".nws", ".odc", ".out", ".p10",
".p12", ".p7b", ".p7c", ".p7m", ".p7r", ".p7s", ".pc5", ".pci",
".pcl", ".pcx", ".pdf", ".pdf", ".pdx", ".pfx", ".pgl", ".pic",
".pko", ".pl", ".plg", ".pls", ".plt", ".png", ".png", ".pot",
".ppa", ".ppm", ".pps", ".ppt", ".ppt", ".pr", ".prf", ".prn",
".prt", ".ps", ".ps", ".ptn", ".pwz", ".r3t", ".ra", ".ram",
".ras", ".rat", ".rdf", ".rec", ".red", ".rgb", ".rjs", ".rjt",
".rlc", ".rle", ".rm", ".rmf", ".rmi", ".rmj", ".rmm", ".rmp",
".rms", ".rmvb", ".rmx", ".rnx", ".rp", ".rpm", ".rsml", ".rt",
".rtf", ".rtf", ".rv", ".sam", ".sat", ".sdp", ".sdw", ".sit",
".slb", ".sld", ".slk", ".smi", ".smil", ".smk", ".snd", ".sol",
".sor", ".spc", ".spl", ".spp", ".ssm", ".sst", ".stl", ".stm",
".sty", ".svg", ".swf", ".tdf", ".tg4", ".tga", ".tif", ".tif",
".tiff", ".tld", ".top", ".torrent", ".tsd", ".txt", ".uin",
".uls", ".vcf", ".vda", ".vdx", ".vml", ".vpg", ".vsd", ".vsd",
".vss", ".vst", ".vst", ".vsw", ".vsx", ".vtx", ".vxml", ".wav",
".wax", ".wb1", ".wb2", ".wb3", ".wbmp", ".wiz", ".wk3", ".wk4",
".wkq", ".wks", ".wm", ".wma", ".wmd", ".wmf", ".wml", ".wmv",
".wmx", ".wmz", ".wp6", ".wpd", ".wpg", ".wpl", ".wq1", ".wr1",
".wri", ".wrk", ".ws", ".ws2", ".wsc", ".wsdl", ".wvx", ".xdp",
".xdr", ".xfd", ".xfdf", ".xhtml", ".xls", ".xls", ".xlw", ".xml",
".xpl", ".xq", ".xql", ".xquery", ".xsd", ".xsl", ".xslt", ".xwd",
".x_b", ".sis", ".sisx", ".x_t", ".ipa", ".apk", ".xap"};
private static final String[] CONTENTTYPE = new String[]{
"application/octet-stream", "image/tiff", "application/x-001",
"application/x-301", "text/h323", "application/x-906",
"drawing/907", "application/x-a11", "audio/x-mei-aac",
"application/postscript", "audio/aiff", "audio/aiff", "audio/aiff",
"application/x-anv", "text/asa", "video/x-ms-asf", "text/asp",
"video/x-ms-asf", "audio/basic", "video/avi",
"application/vnd.adobe.workflow", "text/xml", "application/x-bmp",
"application/x-bot", "application/x-c4t", "application/x-c90",
"application/x-cals", "application/vnd.ms-pki.seccat",
"application/x-netcdf", "application/x-cdr", "application/x-cel",
"application/x-x509-ca-cert", "application/x-g4",
"application/x-cgm", "application/x-cit", "java/*", "text/xml",
"application/x-cmp", "application/x-cmx", "application/x-cot",
"application/pkix-crl", "application/x-x509-ca-cert",
"application/x-csi", "text/css", "application/x-cut",
"application/x-dbf", "application/x-dbm", "application/x-dbx",
"text/xml", "application/x-dcx", "application/x-x509-ca-cert",
"application/x-dgn", "application/x-dib",
"application/x-msdownload", "application/msword",
"application/msword", "application/x-drw", "text/xml",
"Model/vnd.dwf", "application/x-dwf", "application/x-dwg",
"application/x-dxb", "application/x-dxf",
"application/vnd.adobe.edn", "application/x-emf", "message/rfc822",
"text/xml", "application/x-epi", "application/x-ps",
"application/postscript", "application/x-ebx",
"application/x-msdownload", "image/fax", "application/vnd.fdf",
"application/fractals", "text/xml", "application/x-frm",
"application/x-g4", "application/x-gbr", "application/x-",
"image/gif", "application/x-gl2", "application/x-gp4",
"application/x-hgl", "application/x-hmr", "application/x-hpgl",
"application/x-hpl", "application/mac-binhex40",
"application/x-hrf", "application/hta", "text/x-component",
"text/html", "text/html", "text/webviewhtml", "text/html",
"application/x-icb", "image/x-icon", "application/x-ico",
"application/x-iff", "application/x-g4", "application/x-igs",
"application/x-iphone", "application/x-img",
"application/x-internet-signup", "application/x-internet-signup",
"video/x-ivf", "java/*", "image/jpeg", "image/jpeg",
"application/x-jpe", "image/jpeg", "image/jpeg",
"application/x-jpg", "application/x-javascript", "text/html",
"audio/x-liquid-file", "application/x-laplayer-reg",
"application/x-latex", "audio/x-liquid-secure",
"application/x-lbm", "audio/x-la-lms", "application/x-javascript",
"application/x-ltr", "video/x-mpeg", "video/x-mpeg",
"audio/mpegurl", "video/mpeg4", "application/x-mac",
"application/x-troff-man", "text/xml", "application/msaccess",
"application/x-mdb", "application/x-shockwave-flash",
"message/rfc822", "message/rfc822", "application/x-mi",
"audio/mid", "audio/mid", "application/x-mil", "text/xml",
"audio/x-musicnet-download", "audio/x-musicnet-stream",
"application/x-javascript", "video/x-sgi-movie", "audio/mp1",
"audio/mp2", "video/mpeg", "audio/mp3", "video/mpeg4",
"video/x-mpg", "application/vnd.ms-project", "video/x-mpeg",
"video/mpg", "video/mpg", "audio/rn-mpeg",
"application/vnd.ms-project", "video/x-mpeg",
"application/vnd.ms-project", "video/mpg", "video/mpeg",
"application/vnd.ms-project", "application/vnd.ms-project",
"text/xml", "application/x-mmxp", "image/pnetvue",
"application/x-nrf", "message/rfc822", "text/x-ms-odc",
"application/x-out", "application/pkcs10", "application/x-pkcs12",
"application/x-pkcs7-certificates", "application/pkcs7-mime",
"application/pkcs7-mime", "application/x-pkcs7-certreqresp",
"application/pkcs7-signature", "application/x-pc5",
"application/x-pci", "application/x-pcl", "application/x-pcx",
"application/pdf", "application/pdf", "application/vnd.adobe.pdx",
"application/x-pkcs12", "application/x-pgl", "application/x-pic",
"application/vnd.ms-pki.pko", "application/x-perl", "text/html",
"audio/scpls", "application/x-plt", "image/png",
"application/x-png", "application/vnd.ms-powerpoint",
"application/vnd.ms-powerpoint", "application/x-ppm",
"application/vnd.ms-powerpoint", "application/vnd.ms-powerpoint",
"application/x-ppt", "application/x-pr", "application/pics-rules",
"application/x-prn", "application/x-prt", "application/x-ps",
"application/postscript", "application/x-ptn",
"application/vnd.ms-powerpoint", "text/vnd.rn-realtext3d",
"audio/vnd.rn-realaudio", "audio/x-pn-realaudio",
"application/x-ras", "application/rat-file", "text/xml",
"application/vnd.rn-recording", "application/x-red",
"application/x-rgb", "application/vnd.rn-realsystem-rjs",
"application/vnd.rn-realsystem-rjt", "application/x-rlc",
"application/x-rle", "application/vnd.rn-realmedia",
"application/vnd.adobe.rmf", "audio/mid",
"application/vnd.rn-realsystem-rmj", "audio/x-pn-realaudio",
"application/vnd.rn-rn_music_package",
"application/vnd.rn-realmedia-secure",
"application/vnd.rn-realmedia-vbr",
"application/vnd.rn-realsystem-rmx",
"application/vnd.rn-realplayer", "image/vnd.rn-realpix",
"audio/x-pn-realaudio-plugin", "application/vnd.rn-rsml",
"text/vnd.rn-realtext", "application/msword", "application/x-rtf",
"video/vnd.rn-realvideo", "application/x-sam", "application/x-sat",
"application/sdp", "application/x-sdw", "application/x-stuffit",
"application/x-slb", "application/x-sld", "drawing/x-slk",
"application/smil", "application/smil", "application/x-smk",
"audio/basic", "text/plain", "text/plain",
"application/x-pkcs7-certificates", "application/futuresplash",
"text/xml", "application/streamingmedia",
"application/vnd.ms-pki.certstore", "application/vnd.ms-pki.stl",
"text/html", "application/x-sty", "text/xml",
"application/x-shockwave-flash", "application/x-tdf",
"application/x-tg4", "application/x-tga", "image/tiff",
"application/x-tif", "image/tiff", "text/xml", "drawing/x-top",
"application/x-bittorrent", "text/xml", "text/plain",
"application/x-icq", "text/iuls", "text/x-vcard",
"application/x-vda", "application/vnd.visio", "text/xml",
"application/x-vpeg005", "application/vnd.visio",
"application/x-vsd", "application/vnd.visio",
"application/vnd.visio", "application/x-vst",
"application/vnd.visio", "application/vnd.visio",
"application/vnd.visio", "text/xml", "audio/wav", "audio/x-ms-wax",
"application/x-wb1", "application/x-wb2", "application/x-wb3",
"image/vnd.wap.wbmp", "application/msword", "application/x-wk3",
"application/x-wk4", "application/x-wkq", "application/x-wks",
"video/x-ms-wm", "audio/x-ms-wma", "application/x-ms-wmd",
"application/x-wmf", "text/vnd.wap.wml", "video/x-ms-wmv",
"video/x-ms-wmx", "application/x-ms-wmz", "application/x-wp6",
"application/x-wpd", "application/x-wpg", "application/vnd.ms-wpl",
"application/x-wq1", "application/x-wr1", "application/x-wri",
"application/x-wrk", "application/x-ws", "application/x-ws",
"text/scriptlet", "text/xml", "video/x-ms-wvx",
"application/vnd.adobe.xdp", "text/xml",
"application/vnd.adobe.xfd", "application/vnd.adobe.xfdf",
"text/html", "application/vnd.ms-excel", "application/x-xls",
"application/x-xlw", "text/xml", "audio/scpls", "text/xml",
"text/xml", "text/xml", "text/xml", "text/xml", "text/xml",
"application/x-xwd", "application/x-x_b",
"application/vnd.symbian.install",
"application/vnd.symbian.install", "application/x-x_t",
"application/vnd.iphone",
"application/vnd.android.package-archive",
"application/x-silverlight-app"};
public static final String getExtension(String contentType) {
String extension = EXTENSION[0];
for (int i = 1, length = CONTENTTYPE.length; i < length; i++) {
if (CONTENTTYPE[i].equals(contentType.toLowerCase())) {
extension = EXTENSION[i];
break;
}
}
return extension;
}
public static final String getContentType(String extension) {
String contentType = CONTENTTYPE[0];
for (int i = 1, length = EXTENSION.length; i < length; i++) {
if (EXTENSION[i].equals(extension.toLowerCase())) {
contentType = CONTENTTYPE[i];
break;
}
}
return contentType;
}
}
package com.server.utils;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.TimeZone;
/**
*
* @author ZMS
*
*/
public class DateUtils {
public static long MINUTE_PER_HOUR = 60; // 一个小时有多少分钟
public static long MINUTE_PER_DAY = 1440; // 一天有多少分钟
public static long HOUT_PER_DAY = 24; // 一天有多少小时
public static long SECOND_PER_MINUTE = 60; // 一分钟有多少秒
public static long SECOND_PER_HOUR = 3600; // 一个小时有多少秒
public static long SECOND_PER_DAY = 86400; // 一天有多少秒
public static long MILLIS_PER_SECOND = 1000; // 一秒钟有多少毫秒
public static long MILLIS_PER_MINUTE = 60000; // 一分钟有多少毫秒
public static long MILLIS_PER_HOUR = 3600000; // 一个小时有多少毫秒
public static long MILLIS_PER_DAY = 86400000; // 一天有多少毫秒
public static long NANO_PER_MILLIS = 1000000; // 一毫秒有多少纳秒
/**
* formate date
*
* @param formatter
* @param time
* @return
*/
public static String format(String formatter, long time) {
return new SimpleDateFormat(formatter).format(new Date(time));
}
public static String format(String formatter, Date time) {
return new SimpleDateFormat(formatter).format(time);
}
public static String format(Date time) {
return new SimpleDateFormat("yyyy-MM-dd").format(time);
}
/**
* rawoffset
*
* @param time
* @return
*/
public static long getRawOffsetMils(long time) {
return time + TimeZone.getDefault().getRawOffset();
}
/**
* 拆分时间
*
* @param time
* @return
*/
public static long[] splitTime(long timeMils) {
if (timeMils <= 0) {
return new long[] { 0, 0, 0, 0 };
}
long day = timeMils / 86400000;
long hour = (timeMils % 86400000) / 3600000;
long min = (timeMils % 3600000) / 60000;
long sec = (timeMils % 60000) / 1000;
return new long[] { day, hour, min, sec };
}
public static Date parse(String format, String str) throws ParseException {
return new SimpleDateFormat(format).parse(str);
}
public static Date firstDayOfMonth() {
Calendar c = Calendar.getInstance();
c.set(Calendar.DAY_OF_MONTH, 1);
c.set(Calendar.HOUR_OF_DAY, 0);
c.set(Calendar.MINUTE, 0);
c.set(Calendar.SECOND, 0);
c.set(Calendar.MILLISECOND, 0);
return c.getTime();
}
public static Date lastDayOfMonth() {
Calendar c = Calendar.getInstance();
c.set(Calendar.DAY_OF_MONTH, c.getActualMaximum(Calendar.DAY_OF_MONTH));
c.set(Calendar.HOUR_OF_DAY, c.getMaximum(Calendar.HOUR_OF_DAY));
c.set(Calendar.MINUTE, c.getMaximum(Calendar.MINUTE));
c.set(Calendar.SECOND, c.getMaximum(Calendar.SECOND));
c.set(Calendar.MILLISECOND, c.getMaximum(Calendar.MILLISECOND));
return c.getTime();
}
public static Date firstDayOfMonth(int year, int month) {
Calendar c = Calendar.getInstance();
c.set(Calendar.YEAR, year);
c.set(Calendar.MONTH, month);
c.set(Calendar.DAY_OF_MONTH, 1);
c.set(Calendar.HOUR_OF_DAY, 0);
c.set(Calendar.MINUTE, 0);
c.set(Calendar.SECOND, 0);
c.set(Calendar.MILLISECOND, 0);
return c.getTime();
}
public static Date lastDayOfMonth(int year, int month) {
Calendar c = Calendar.getInstance();
c.set(Calendar.YEAR, year);
c.set(Calendar.MONTH, month);
c.set(Calendar.DAY_OF_MONTH, c.getActualMaximum(Calendar.DAY_OF_MONTH));
c.set(Calendar.HOUR_OF_DAY, c.getMaximum(Calendar.HOUR_OF_DAY));
c.set(Calendar.MINUTE, c.getMaximum(Calendar.MINUTE));
c.set(Calendar.SECOND, c.getMaximum(Calendar.SECOND));
c.set(Calendar.MILLISECOND, c.getMaximum(Calendar.MILLISECOND));
return c.getTime();
}
public static int getMonthDayCount(int year, int month) {
Calendar c = Calendar.getInstance();
c.set(Calendar.YEAR, year);
c.set(Calendar.MONTH, month);
return c.getActualMaximum(Calendar.DAY_OF_MONTH);
}
public static long getStartTimeOfDate(long time) {
Calendar c = Calendar.getInstance();
c.setTimeInMillis(time);
c.set(Calendar.HOUR_OF_DAY, 0);
c.set(Calendar.MINUTE, 0);
c.set(Calendar.SECOND, 0);
c.set(Calendar.MILLISECOND, 0);
return c.getTimeInMillis();
}
public static long curDay() {
return getRawOffsetMils(System.currentTimeMillis()) / MILLIS_PER_DAY;
}
public static long curHour() {
return getRawOffsetMils(System.currentTimeMillis()) / MILLIS_PER_HOUR;
}
public static long curMinute() {
return getRawOffsetMils(System.currentTimeMillis()) / MILLIS_PER_MINUTE;
}
}
package com.server.utils;
/**
* Created by dell on 2018/2/27.
*/
public enum ErrorCode {
SUCCESS("1", "操作成功"),
ERROR("0", "操作失败"),
ERROR_PARAM_DEFICIENCY("0", "操作失败,参数缺失");
private String code ;
private String message ;
private ErrorCode(String code , String message ){
this.code = code ;
this.message = message ;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
}
package com.server.utils;
import com.server.utils.key.QiniuKey;
import com.server.utils.key.UploadUrlKey;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.multipart.MultipartFile;
import javax.imageio.ImageIO;
import java.io.File;
import java.io.IOException;
/**
* 本地文件存储
*/
@Component
public class FileStore {
private Logger log = LoggerFactory.getLogger(FileStore.class);
@Autowired
UploadUrlKey uploadUrlKey;
@Autowired
QiniuKey qiniuKey;
public String storeImage(String path, MultipartFile file) {
return store(path, file);
}
public String getRealPath(String path) {
String ret = uploadUrlKey.getRealPath() + "/" + path;
return ret.replaceAll("\\\\/+", "/");
}
public String store(String path, MultipartFile file) {
String originalName = file.getOriginalFilename();
int index = originalName.lastIndexOf(".");
String ext = index > -1 ? originalName.substring(index + 1) : ContentType.getExtension(file.getContentType());
String filename = UploadUtils.generateFilename(getRealPath(path), ext);
File dest = new File(filename);
dest = UploadUtils.getUniqueFile(dest);
dest = store(file, dest);
filename = dest.getAbsolutePath();
return filename.substring(filename.indexOf(uploadUrlKey.getBasePath()));
}
private File store(MultipartFile file, File dest) {
UploadUtils.checkDirAndCreate(dest.getParentFile());
try {
file.transferTo(dest);
} catch (IOException e) {
log.error("Transfer file error when upload file", e);
}
//如果是图片尝试纠图片方向
if (isImage(dest)) {
dest = compressImage(dest);
}
return dest;
}
private File compressImage(File dest) {
try {
Image image = new Image(dest);
if (image.getWidth() > 860 || image.getHeight() > 860) {
image.resize(860, 860, true);
}
image.saveAs(dest,uploadUrlKey,qiniuKey);
} catch (Exception e) {
e.printStackTrace();
}
return dest;
}
private boolean isImage(File file) {
try {
java.awt.Image image = ImageIO.read(file);
return image != null;
} catch (IOException ex) {
return false;
}
}
}
package com.server.utils;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.HttpClient;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.util.EntityUtils;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
/**
* Created by stone on 2017/6/14.
*/
public class HTTPClientUtil {
public static String getPublicService(Map<String, String> map, String url,String charset)
throws Exception {
HttpClient httpClient = null;
HttpPost httpPost = null;
String result = null;
try{
httpClient = new DefaultHttpClient();
httpPost = new HttpPost(url);
//设置参数
List<NameValuePair> list = new ArrayList<NameValuePair>();
Iterator iterator = map.entrySet().iterator();
while(iterator.hasNext()){
Entry<String,String> elem = (Entry<String, String>) iterator.next();
list.add(new BasicNameValuePair(elem.getKey(),elem.getValue()));
}
if(list.size() > 0){
UrlEncodedFormEntity entity = new UrlEncodedFormEntity(list,charset);
httpPost.setEntity(entity);
}
HttpResponse response = httpClient.execute(httpPost);
if(response != null){
HttpEntity resEntity = response.getEntity();
if(resEntity != null){
result = EntityUtils.toString(resEntity,charset);
}
}
}catch(Exception ex){
ex.printStackTrace();
}
return result;
}
public static String getUrl(HttpServletRequest request){
StringBuffer url = request.getRequestURL();
String visitUrl = url.delete(url.length() - request.getRequestURI().length(), url.length()).toString();
return visitUrl;
}
}
package com.server.utils;
import com.qiniu.common.QiniuException;
import com.qiniu.common.Zone;
import com.qiniu.http.Response;
import com.qiniu.storage.Configuration;
import com.qiniu.storage.UploadManager;
import com.qiniu.util.Auth;
import com.server.utils.key.QiniuKey;
import com.server.utils.key.UploadUrlKey;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import javax.imageio.*;
import javax.imageio.metadata.IIOMetadata;
import javax.imageio.metadata.IIOMetadataNode;
import javax.imageio.plugins.jpeg.JPEGImageWriteParam;
import javax.imageio.stream.ImageInputStream;
import java.awt.*;
import java.awt.color.ColorSpace;
import java.awt.geom.AffineTransform;
import java.awt.image.*;
import java.io.*;
import java.util.*;
/**
* @author ZMS
*/
public class Image {
private BufferedImage bufferedImage;
private ArrayList corners;
private float outputQuality;
private static final boolean useSunCodec = getSunCodec();
private static Class JPEGCodec;
private static Class JPEGEncodeParam;
private Graphics2D g2d;
public static String[] InputFormats = getFormats(ImageIO.getReaderFormatNames());
public static String[] OutputFormats = getFormats(ImageIO.getWriterFormatNames());
private IIOMetadata metadata;
private HashMap<Integer, Object> exif;
private HashMap<Integer, Object> iptc;
private HashMap<Integer, Object> gps;
public Image(String PathToImageFile) throws IOException {
this(new File(PathToImageFile));
}
public Image(File File) throws IOException {
this.bufferedImage = null;
this.corners = null;
this.outputQuality = 1.0F;
this.g2d = null;
this.createBufferedImage(File);
}
public Image(InputStream InputStream) throws IOException {
this.bufferedImage = null;
this.corners = null;
this.outputQuality = 1.0F;
this.g2d = null;
this.createBufferedImage(InputStream);
}
public Image(byte[] byteArray) throws IOException {
this((InputStream) (new ByteArrayInputStream(byteArray)));
}
private Image(int width, int height) {
this.bufferedImage = null;
this.corners = null;
this.outputQuality = 1.0F;
this.g2d = null;
this.bufferedImage = new BufferedImage(width, height, 2);
this.g2d = this.getGraphics();
}
private Image(BufferedImage bufferedImage) {
this.bufferedImage = null;
this.corners = null;
this.outputQuality = 1.0F;
this.g2d = null;
this.bufferedImage = bufferedImage;
}
private Image(RenderedImage img) {
this.bufferedImage = null;
this.corners = null;
this.outputQuality = 1.0F;
this.g2d = null;
if (img instanceof BufferedImage) {
this.bufferedImage = (BufferedImage) img;
} else {
ColorModel cm = img.getColorModel();
WritableRaster raster = cm.createCompatibleWritableRaster(img.getWidth(), img.getHeight());
boolean isAlphaPremultiplied = cm.isAlphaPremultiplied();
Hashtable properties = new Hashtable();
String[] keys = img.getPropertyNames();
if (keys != null) {
for (int result = 0; result < keys.length; ++result) {
properties.put(keys[result], img.getProperty(keys[result]));
}
}
BufferedImage var8 = new BufferedImage(cm, raster, isAlphaPremultiplied, properties);
img.copyData(raster);
this.bufferedImage = var8;
}
}
private Image(String text, String fontName, int fontSize, int r, int g, int b) {
this(text, new Font(fontName, 0, fontSize), r, g, b);
}
private Image(String text, Font font, int r, int g, int b) {
this.bufferedImage = null;
this.corners = null;
this.outputQuality = 1.0F;
this.g2d = null;
Graphics2D t = (new BufferedImage(1, 1, 2)).createGraphics();
t.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
FontMetrics fm = t.getFontMetrics(font);
int width = fm.stringWidth(text);
int height = fm.getHeight();
int descent = fm.getDescent();
t.dispose();
this.bufferedImage = new BufferedImage(width, height, 2);
this.g2d = this.bufferedImage.createGraphics();
this.g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
float alpha = 1.0F;
this.g2d.setComposite(AlphaComposite.getInstance(3, alpha));
this.g2d.setColor(new Color(r, g, b));
this.g2d.setFont(font);
this.g2d.drawString(text, 0, height - descent);
}
public void setBackgroundColor(int r, int g, int b) {
int imageType = this.bufferedImage.getType();
if (imageType == 0) {
imageType = 2;
}
int width = this.getWidth();
int height = this.getHeight();
BufferedImage bi = new BufferedImage(width, height, imageType);
Graphics2D g2d = bi.createGraphics();
g2d.setComposite(AlphaComposite.getInstance(3, 1.0F));
g2d.setColor(new Color(r, g, b));
g2d.fillRect(0, 0, width, height);
BufferedImage img = this.bufferedImage;
g2d.drawImage(img, 0, 0, (ImageObserver) null);
this.bufferedImage = bi;
g2d.dispose();
}
public String[] getInputFormats() {
return getFormats(ImageIO.getReaderFormatNames());
}
public String[] getOutputFormats() {
return getFormats(ImageIO.getWriterFormatNames());
}
private static String[] getFormats(String[] inputFormats) {
HashSet formats = new HashSet();
for (int i = 0; i < inputFormats.length; ++i) {
String format = inputFormats[i].toUpperCase();
if (format.contains("JPEG") && format.contains("2000")) {
formats.add("JP2");
formats.add("J2C");
formats.add("J2K");
formats.add("JPX");
} else if (!format.equals("JPEG") && !format.equals("JPG")) {
formats.add(format);
} else {
formats.add("JPE");
formats.add("JFF");
formats.add(format);
}
}
inputFormats = (String[]) formats.toArray(new String[formats.size()]);
Collections.sort(Arrays.asList(inputFormats));
return inputFormats;
}
private static boolean getSunCodec() {
try {
JPEGCodec = Class.forName("com.sun.image.codec.jpeg.JPEGCodec");
JPEGEncodeParam = Class.forName("com.sun.image.codec.jpeg.JPEGEncodeParam");
return true;
} catch (Exception var1) {
return false;
}
}
public int getWidth() {
return this.bufferedImage.getWidth();
}
public int getHeight() {
return this.bufferedImage.getHeight();
}
private Graphics2D getGraphics() {
if (this.g2d == null) {
this.g2d = this.bufferedImage.createGraphics();
this.g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
}
return this.g2d;
}
public void addText(String text, int x, int y) {
this.addText(text, x, y, new Font("SansSerif", 0, 12), 0, 0, 0);
}
public void addText(String text, int x, int y, String fontName, int fontSize, int r, int g, int b) {
this.addText(text, x, y, new Font(fontName, 0, fontSize), r, g, b);
}
public void addText(String text, int x, int y, Font font, int r, int g, int b) {
this.g2d = this.getGraphics();
this.g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
this.g2d.setColor(new Color(r, g, b));
this.g2d.setFont(font);
this.g2d.drawString(text, x, y);
}
public void addPoint(int x, int y, int r, int g, int b) {
this.setColor(x, y, new Color(r, g, b));
}
public void setColor(int x, int y, Color color) {
this.g2d = this.getGraphics();
Color org = this.g2d.getColor();
this.g2d.setColor(color);
this.g2d.fillRect(x, y, 1, 1);
this.g2d.setColor(org);
}
public Color getColor(int x, int y) {
int pixel = this.bufferedImage.getRGB(x, y);
int alpha = pixel >> 24 & 255;
int red = pixel >> 16 & 255;
int green = pixel >> 8 & 255;
int blue = pixel & 255;
return new Color(red, green, blue, alpha);
}
public ArrayList<int[]> getHistogram() {
int[] red = new int[256];
int[] green = new int[256];
int[] blue = new int[256];
int[] average = new int[256];
int hist;
for (hist = 0; hist < red.length; ++hist) {
red[hist] = 0;
}
for (hist = 0; hist < green.length; ++hist) {
green[hist] = 0;
}
for (hist = 0; hist < blue.length; ++hist) {
blue[hist] = 0;
}
for (hist = 0; hist < average.length; ++hist) {
average[hist] = 0;
}
for (hist = 0; hist < this.getWidth(); ++hist) {
for (int j = 0; j < this.getHeight(); ++j) {
Color color = this.getColor(hist, j);
int r = color.getRed();
int g = color.getGreen();
int b = color.getBlue();
++red[r];
++green[g];
blue[b] = blue[r] + 1;
int avg = Math.round((float) ((r + g + b) / 3));
++average[avg];
}
}
ArrayList var12 = new ArrayList();
var12.add(red);
var12.add(green);
var12.add(blue);
var12.add(average);
return var12;
}
public void addImage(BufferedImage in, int x, int y, boolean expand) {
int x2 = 0;
int y2 = 0;
int w = this.bufferedImage.getWidth();
int h = this.bufferedImage.getHeight();
if (expand) {
if (x < 0) {
w += -x;
if (in.getWidth() > w) {
w += in.getWidth() - w;
}
x2 = -x;
x = 0;
} else if (x > w) {
w = w + (x - w) + in.getWidth();
} else if (x + in.getWidth() > w) {
w += x + in.getWidth() - w;
}
if (y < 0) {
h += -y;
if (in.getHeight() > h) {
h += in.getHeight() - h;
}
y2 = -y;
y = 0;
} else if (y > h) {
h = h + (y - h) + in.getHeight();
} else if (y + in.getHeight() > h) {
h += y + in.getHeight() - h;
}
}
if (w <= this.bufferedImage.getWidth() && h <= this.bufferedImage.getHeight()) {
Graphics2D g2d2 = this.bufferedImage.createGraphics();
g2d2.drawImage(in, x, y, (ImageObserver) null);
g2d2.dispose();
} else {
int g2d = this.bufferedImage.getType();
if (g2d == 0 || g2d == 12) {
g2d = 2;
}
BufferedImage img = new BufferedImage(w, h, g2d);
Graphics2D g2d1 = img.createGraphics();
BufferedImage img1 = this.bufferedImage;
g2d1.drawImage(img1, x2, y2, (ImageObserver) null);
g2d1.drawImage(in, x, y, (ImageObserver) null);
g2d1.dispose();
this.bufferedImage = img;
}
}
public void addImage(Image in, int x, int y, boolean expand) {
this.addImage(in.getBufferedImage(), x, y, expand);
}
private void createBufferedImage(File file) throws IOException {
this.createBufferedImage((InputStream) (new FileInputStream(file)));
}
private void createBufferedImage(InputStream input) throws IOException {
ImageInputStream e = ImageIO.createImageInputStream(input);
Iterator iter = ImageIO.getImageReaders(e);
if (!iter.hasNext()) {
return;
}
ImageReader reader = (ImageReader) iter.next();
ImageReadParam param = reader.getDefaultReadParam();
reader.setInput(e, true, true);
try {
this.bufferedImage = reader.read(0, param);
this.metadata = reader.getImageMetadata(0);
} finally {
reader.dispose();
e.close();
}
input.close();
}
public void rotate(double Degrees) {
int width = this.getWidth();
int height = this.getHeight();
int cx = width / 2;
int cy = height / 2;
int[] corners = new int[]{0, 0, width, 0, width, height, 0, height};
int maxX = cx;
int minX = cx;
int maxY = cy;
int minY = cy;
double theta = Math.toRadians(Degrees);
for (int result = 0; result < corners.length; result += 2) {
int g2d = (int) Math.round(Math.cos(theta) * (double) (corners[result] - cx) - Math.sin(theta) * (double) (corners[result + 1] - cy) + (double) cx);
int xform = (int) Math.round(Math.sin(theta) * (double) (corners[result] - cx) + Math.cos(theta) * (double) (corners[result + 1] - cy) + (double) cy);
if (g2d > maxX) {
maxX = g2d;
}
if (g2d < minX) {
minX = g2d;
}
if (xform > maxY) {
maxY = xform;
}
if (xform < minY) {
minY = xform;
}
}
cx -= minX;
cy -= minY;
BufferedImage result1 = new BufferedImage(maxX - minX, maxY - minY, 2);
Graphics2D g2d1 = result1.createGraphics();
g2d1.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g2d1.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BICUBIC);
AffineTransform xform1 = new AffineTransform();
xform1.rotate(theta, (double) cx, (double) cy);
g2d1.setTransform(xform1);
g2d1.drawImage(this.bufferedImage, -minX, -minY, (ImageObserver) null);
g2d1.dispose();
this.bufferedImage = result1;
result1 = null;
xform1 = null;
}
public void rotateClockwise() {
this.rotate(90.0D);
}
public void rotateCounterClockwise() {
this.rotate(-90.0D);
}
public void rotate() {
try {
Integer e = (Integer) this.getExifTags().get(Integer.valueOf(274));
switch (e.intValue()) {
case 1:
return;
case 2:
this.flip();
break;
case 3:
this.rotate(180.0D);
break;
case 4:
this.flip();
this.rotate(180.0D);
break;
case 5:
this.flip();
this.rotate(270.0D);
break;
case 6:
this.rotate(90.0D);
break;
case 7:
this.flip();
this.rotate(90.0D);
break;
case 8:
this.rotate(270.0D);
}
} catch (Exception var2) {
;
}
}
public void setWidth(int Width) {
double ratio = (double) Width / (double) this.getWidth();
double dw = (double) this.getWidth() * ratio;
double dh = (double) this.getHeight() * ratio;
int outputWidth = (int) Math.round(dw);
int outputHeight = (int) Math.round(dh);
this.resize(outputWidth, outputHeight);
}
public void setHeight(int Height) {
double ratio = (double) Height / (double) this.getHeight();
double dw = (double) this.getWidth() * ratio;
double dh = (double) this.getHeight() * ratio;
int outputWidth = (int) Math.round(dw);
int outputHeight = (int) Math.round(dh);
this.resize(outputWidth, outputHeight);
}
public void resize(int Width, int Height) {
this.resize(Width, Height, false);
}
public void resize(int Width, int Height, boolean maintainRatio) {
int outputWidth = Width;
int outputHeight = Height;
int width = this.getWidth();
int height = this.getHeight();
if (maintainRatio) {
double outputImage = 0.0D;
if (width > height) {
outputImage = (double) Width / (double) width;
} else {
outputImage = (double) Height / (double) height;
}
double g2d = (double) width * outputImage;
double dh = (double) height * outputImage;
outputWidth = (int) Math.round(g2d);
outputHeight = (int) Math.round(dh);
if (outputWidth > width || outputHeight > height) {
outputWidth = width;
outputHeight = height;
}
}
java.awt.Image outputImage1 = this.bufferedImage.getScaledInstance(outputWidth, outputHeight, 16);
BufferedImage bi = new BufferedImage(outputWidth, outputHeight, this.getImageType());
Graphics2D g2d1 = bi.createGraphics();
g2d1.drawImage(outputImage1, 0, 0, (ImageObserver) null);
g2d1.dispose();
this.bufferedImage = bi;
outputImage1 = null;
bi = null;
g2d1 = null;
}
public void setCorners(float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3) {
Skew skew = new Skew(this.bufferedImage);
this.bufferedImage = skew.setCorners(x0, y0, x1, y1, x2, y2, x3, y3);
if (this.corners == null) {
this.corners = new ArrayList();
} else {
this.corners.clear();
}
this.corners.add(Float.valueOf(x0));
this.corners.add(Float.valueOf(y0));
this.corners.add(Float.valueOf(x1));
this.corners.add(Float.valueOf(y1));
this.corners.add(Float.valueOf(x2));
this.corners.add(Float.valueOf(y2));
this.corners.add(Float.valueOf(x3));
this.corners.add(Float.valueOf(y3));
}
public float[] getCorners() {
if (this.corners == null) {
float arr = (float) this.getWidth();
float ret = (float) this.getHeight();
this.corners = new ArrayList();
this.corners.add(Float.valueOf(0.0F));
this.corners.add(Float.valueOf(0.0F));
this.corners.add(Float.valueOf(arr));
this.corners.add(Float.valueOf(0.0F));
this.corners.add(Float.valueOf(arr));
this.corners.add(Float.valueOf(ret));
this.corners.add(Float.valueOf(0.0F));
this.corners.add(Float.valueOf(ret));
}
Object[] var5 = this.corners.toArray();
float[] var6 = new float[var5.length];
for (int i = 0; i < var5.length; ++i) {
Float f = (Float) var5[i];
var6[i] = f.floatValue();
}
return var6;
}
public void sharpen() {
int width = this.getWidth();
int height = this.getHeight();
Kernel kernel = new Kernel(3, 3, new float[]{0.0F, -0.2F, 0.0F, -0.2F, 1.8F, -0.2F, 0.0F, -0.2F, 0.0F});
BufferedImage out = new BufferedImage(width, height, this.getImageType());
ConvolveOp op = new ConvolveOp(kernel);
out = op.filter(this.bufferedImage, out);
BufferedImage overlay = out.getSubimage(2, 2, width - 4, height - 4);
Graphics2D g2d = this.bufferedImage.createGraphics();
g2d.drawImage(overlay, 2, 2, (ImageObserver) null);
g2d.dispose();
}
public void desaturate() {
this.bufferedImage = this.desaturate(this.bufferedImage);
}
public void desaturate(double percent) {
float alpha = (float) percent;
BufferedImage overlay = this.desaturate(this.bufferedImage);
Graphics2D g2d = this.bufferedImage.createGraphics();
g2d.setComposite(AlphaComposite.getInstance(3, alpha));
g2d.drawImage(overlay, 0, 0, (ImageObserver) null);
g2d.dispose();
}
private BufferedImage desaturate(BufferedImage in) {
BufferedImage out = new BufferedImage(in.getWidth(), in.getHeight(), this.getImageType(in));
ColorConvertOp op = new ColorConvertOp(ColorSpace.getInstance(1003), (RenderingHints) null);
return op.filter(in, out);
}
public void setOpacity(double percent) {
if (percent > 1.0D) {
percent /= 100.0D;
}
float alpha = (float) percent;
int imageType = this.bufferedImage.getType();
if (imageType == 0) {
imageType = 2;
}
BufferedImage out = new BufferedImage(this.getWidth(), this.getHeight(), imageType);
Graphics2D g2d = out.createGraphics();
g2d.setComposite(AlphaComposite.getInstance(3, alpha));
g2d.drawImage(this.bufferedImage, 0, 0, (ImageObserver) null);
g2d.dispose();
this.bufferedImage = out;
}
public void flip() {
BufferedImage out = new BufferedImage(this.getWidth(), this.getHeight(), this.getImageType());
AffineTransform tx = AffineTransform.getScaleInstance(-1.0D, 1.0D);
tx.translate((double) (-this.bufferedImage.getWidth()), 0.0D);
AffineTransformOp op = new AffineTransformOp(tx, 3);
this.bufferedImage = op.filter(this.bufferedImage, out);
}
public void crop(int x, int y, int width, int height) {
this.bufferedImage = this.getSubimage(x, y, width, height);
}
public Image copy() {
return new Image(this.bufferedImage);
}
public Image copyRect(int x, int y, int width, int height) {
return new Image(this.getSubimage(x, y, width, height));
}
private BufferedImage getSubimage(int x, int y, int width, int height) {
Rectangle rect1 = new Rectangle(0, 0, this.bufferedImage.getWidth(), this.bufferedImage.getHeight());
Rectangle rect2 = new Rectangle(x, y, width, height);
if (rect1.contains(rect2)) {
return this.bufferedImage.getSubimage(x, y, width, height);
} else {
int imageType = this.bufferedImage.getType();
if (imageType == 0 || imageType == 12) {
imageType = 2;
}
BufferedImage bi = new BufferedImage(width, height, imageType);
if (rect1.intersects(rect2)) {
Graphics2D g2d = bi.createGraphics();
BufferedImage subImage = null;
int X;
int Y;
int y1;
int h;
int w;
if (x < 0) {
byte x1 = 0;
if (y < 0) {
y1 = 0;
h = y + height;
Y = height - h;
} else {
y1 = y;
h = height;
Y = 0;
}
if (h + y1 > this.bufferedImage.getHeight()) {
h = this.bufferedImage.getHeight() - y1;
}
w = x + width;
if (w > this.bufferedImage.getWidth()) {
w = this.bufferedImage.getWidth();
}
subImage = this.bufferedImage.getSubimage(x1, y1, w, h);
X = width - w;
} else {
if (y < 0) {
y1 = 0;
h = y + height;
Y = height - h;
} else {
y1 = y;
h = height;
Y = 0;
}
if (h + y1 > this.bufferedImage.getHeight()) {
h = this.bufferedImage.getHeight() - y1;
}
w = width;
if (width + x > this.bufferedImage.getWidth()) {
w = this.bufferedImage.getWidth() - x;
}
X = 0;
subImage = this.bufferedImage.getSubimage(x, y1, w, h);
}
g2d.drawImage(subImage, X, Y, (ImageObserver) null);
g2d.dispose();
}
return bi;
}
}
public void trim() {
this.trim(0, 0, 0);
}
public void trim(int r, int g, int b) {
int top = 0;
int bottom = 0;
int left = 0;
int right = 0;
int x;
int y;
for (x = 0; x < this.bufferedImage.getHeight(); ++x) {
for (y = 0; y < this.bufferedImage.getWidth(); ++y) {
if (this.hasColor(this.bufferedImage.getRGB(y, x), r, g, b)) {
bottom = x;
break;
}
}
}
for (x = this.bufferedImage.getHeight() - 1; x > -1; --x) {
for (y = 0; y < this.bufferedImage.getWidth(); ++y) {
if (this.hasColor(this.bufferedImage.getRGB(y, x), r, g, b)) {
top = x;
break;
}
}
}
for (x = 0; x < this.bufferedImage.getWidth(); ++x) {
for (y = 0; y < this.bufferedImage.getHeight(); ++y) {
if (this.hasColor(this.bufferedImage.getRGB(x, y), r, g, b)) {
right = x;
break;
}
}
}
for (x = this.bufferedImage.getWidth() - 1; x > -1; --x) {
for (y = 0; y < this.bufferedImage.getHeight(); ++y) {
if (this.hasColor(this.bufferedImage.getRGB(x, y), r, g, b)) {
left = x;
break;
}
}
}
if (left != right && top != bottom) {
this.bufferedImage = this.bufferedImage.getSubimage(left, top, right - left, bottom - top);
} else {
this.bufferedImage = new BufferedImage(1, 1, 2);
}
}
public BufferedImage getBufferedImage() {
return this.bufferedImage;
}
public java.awt.Image getImage() {
return this.getBufferedImage();
}
public RenderedImage getRenderedImage() {
return this.getBufferedImage();
}
public BufferedImage getBufferedImage(int width, int height, boolean maintainRatio) {
Image image = new Image(this.getBufferedImage());
image.resize(width, height, maintainRatio);
return image.getBufferedImage();
}
public byte[] getByteArray() {
return this.getByteArray("jpeg");
}
public byte[] getByteArray(String format) {
byte[] rgb = null;
format = format.toLowerCase();
if (format.startsWith("image/")) {
format = format.substring(format.indexOf("/") + 1);
}
try {
if (this.isJPEG(format)) {
rgb = this.getJPEGByteArray(this.outputQuality);
} else {
ByteArrayOutputStream e = new ByteArrayOutputStream();
ImageIO.write(this.bufferedImage, format.toLowerCase(), e);
rgb = e.toByteArray();
}
} catch (Exception var4) {
;
}
return rgb;
}
public void saveAs(File OutputFile, UploadUrlKey uploadUrlKey, QiniuKey qiniuKey) {
try {
OutputFile.getParentFile().mkdirs();
String e = this.getExtension(OutputFile.getName()).toLowerCase();
FileOutputStream rendImage;
if (this.isJPEG(e)) {
rendImage = new FileOutputStream(OutputFile);
rendImage.write(this.getJPEGByteArray(this.outputQuality));
rendImage.close();
}
Configuration cfg = new Configuration(Zone.zone1());
UploadManager uploadManager = new UploadManager(cfg);
String accessKey = qiniuKey.getAccessKey();
String secretKey =qiniuKey.getSecretKey();
String bucket = qiniuKey.getBucket();
ByteArrayInputStream byteInputStream=new ByteArrayInputStream(File2byte(OutputFile));
Auth auth = Auth.create(accessKey, secretKey);
String upToken = auth.uploadToken(bucket);
try {
String key = OutputFile.getPath();
String base=uploadUrlKey.getBasePath();
int length = key.indexOf(base);
if(length>0){
key =key.substring(length);
}
uploadManager.put(byteInputStream,key,upToken,null,null);
} catch (QiniuException ex) {
Response r = ex.response;
System.err.println(r.toString());
try {
System.err.println(r.bodyString());
} catch (QiniuException ex2) {
}
}
} catch (Exception ex) {
}
}
public static byte[] File2byte(File OutputFile) {
byte[] buffer = null;
try {
FileInputStream fis = new FileInputStream(OutputFile);
org.apache.commons.io.output.ByteArrayOutputStream bos = new org.apache.commons.io.output.ByteArrayOutputStream();
byte[] b = new byte[1024];
int n;
while ((n = fis.read(b)) != -1) {
bos.write(b, 0, n);
}
fis.close();
bos.close();
buffer = bos.toByteArray();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return buffer;
}
public void setOutputQuality(double percentage) {
if (percentage > 1.0D && percentage <= 100.0D) {
percentage /= 100.0D;
}
float q = (float) percentage;
if (q == 1.0F && useSunCodec) {
q = 1.2F;
}
if (q >= 0.0F && q <= 1.2F) {
this.outputQuality = q;
}
}
private boolean isJPEG(String FileExtension) {
FileExtension = FileExtension.trim().toLowerCase();
return FileExtension.equals("jpg") || FileExtension.equals("jpeg") || FileExtension.equals("jpe") || FileExtension.equals("jff");
}
private boolean isJPEG2000(String FileExtension) {
FileExtension = FileExtension.trim().toLowerCase();
return FileExtension.equals("jp2") || FileExtension.equals("jpc") || FileExtension.equals("j2k") || FileExtension.equals("jpx");
}
private byte[] getJPEGByteArray(float outputQuality) throws IOException {
if (outputQuality >= 0.0F && outputQuality <= 1.2F) {
ByteArrayOutputStream bas = new ByteArrayOutputStream();
BufferedImage bi = this.bufferedImage;
int t = this.bufferedImage.getTransparency();
if (t == 3) {
bi = new BufferedImage(this.getWidth(), this.getHeight(), 1);
Graphics2D writer = bi.createGraphics();
writer.drawImage(this.bufferedImage, 0, 0, (ImageObserver) null);
}
if (useSunCodec) {
try {
Object writer1 = JPEGCodec.getMethod("createJPEGEncoder", new Class[]{OutputStream.class}).invoke(JPEGCodec, new Object[]{bas});
Object params = JPEGCodec.getMethod("getDefaultJPEGEncodeParam", new Class[]{BufferedImage.class}).invoke(JPEGCodec, new Object[]{bi});
params.getClass().getMethod("setQuality", new Class[]{Float.TYPE, Boolean.TYPE}).invoke(params, new Object[]{Float.valueOf(outputQuality), Boolean.valueOf(true)});
params.getClass().getMethod("setHorizontalSubsampling", new Class[]{Integer.TYPE, Integer.TYPE}).invoke(params, new Object[]{Integer.valueOf(0), Integer.valueOf(2)});
params.getClass().getMethod("setVerticalSubsampling", new Class[]{Integer.TYPE, Integer.TYPE}).invoke(params, new Object[]{Integer.valueOf(0), Integer.valueOf(2)});
writer1.getClass().getMethod("encode", new Class[]{BufferedImage.class, JPEGEncodeParam}).invoke(writer1, new Object[]{bi, params});
} catch (Exception var7) {
bas.reset();
}
}
if (bas.size() == 0) {
if (outputQuality > 1.0F) {
outputQuality = 1.0F;
}
ImageWriter writer2 = (ImageWriter) ImageIO.getImageWritersByFormatName("jpg").next();
JPEGImageWriteParam params1 = (JPEGImageWriteParam) writer2.getDefaultWriteParam();
params1.setCompressionMode(2);
params1.setCompressionQuality(outputQuality);
writer2.setOutput(ImageIO.createImageOutputStream(bas));
writer2.write((IIOMetadata) null, new IIOImage(bi, (java.util.List) null, (IIOMetadata) null), params1);
}
bas.flush();
return bas.toByteArray();
} else {
return this.getByteArray();
}
}
private int getImageType() {
return this.getImageType(this.bufferedImage);
}
private int getImageType(BufferedImage bufferedImage) {
int i = bufferedImage.getType();
if (i <= 0) {
i = 2;
}
return i;
}
private String getExtension(String FileName) {
return FileName.contains(".") ? FileName.substring(FileName.lastIndexOf(".") + 1, FileName.length()) : "";
}
private boolean hasColor(int pixel, int red, int green, int blue) {
int a = pixel >> 24 & 255;
int r = pixel >> 16 & 255;
int g = pixel >> 8 & 255;
int b = pixel & 255;
return (r != red || g != green || b != blue) && a != 0;
}
public boolean equals(Object obj) {
if (obj != null && obj instanceof Image) {
Image image = (Image) obj;
if (image.getWidth() == this.getWidth() && image.getHeight() == this.getHeight()) {
for (int i = 0; i < image.getWidth(); ++i) {
for (int j = 0; j < image.getHeight(); ++j) {
if (!image.getColor(i, j).equals(this.getColor(i, j))) {
return false;
}
}
}
return true;
}
}
return false;
}
public IIOMetadata getIIOMetadata() {
return this.metadata;
}
public void setIIOMetadata(IIOMetadata metadata) {
this.metadata = metadata;
this.iptc = null;
this.exif = null;
this.gps = null;
}
public byte[] getIptcData() {
return (byte[]) ((byte[]) this.getUnknownTags(237)[0].getUserObject());
}
public HashMap<Integer, Object> getIptcTags() {
if (this.iptc == null) {
this.iptc = new HashMap();
IIOMetadataNode[] arr$ = this.getUnknownTags(237);
int len$ = arr$.length;
for (int i$ = 0; i$ < len$; ++i$) {
IIOMetadataNode marker = arr$[i$];
byte[] iptcData = (byte[]) ((byte[]) marker.getUserObject());
HashMap tags = (new MetadataParser(iptcData, 237)).getTags("IPTC");
this.iptc.putAll(tags);
}
}
return this.iptc;
}
public byte[] getExifData() {
return (byte[]) ((byte[]) this.getUnknownTags(225)[0].getUserObject());
}
public HashMap<Integer, Object> getExifTags() {
if (this.exif == null) {
this.parseExif();
}
return this.exif;
}
public HashMap<Integer, Object> getGpsTags() {
if (this.gps == null) {
this.parseExif();
}
return this.gps;
}
private void parseExif() {
this.exif = new HashMap();
this.gps = new HashMap();
IIOMetadataNode[] arr$ = this.getUnknownTags(225);
int len$ = arr$.length;
for (int i$ = 0; i$ < len$; ++i$) {
IIOMetadataNode marker = arr$[i$];
byte[] exifData = (byte[]) ((byte[]) marker.getUserObject());
MetadataParser metadataParser = new MetadataParser(exifData, 225);
HashMap exif = metadataParser.getTags("EXIF");
HashMap gps = metadataParser.getTags("GPS");
if (exif != null) {
this.exif.putAll(exif);
}
if (gps != null) {
this.gps.putAll(gps);
}
metadataParser = null;
}
}
public double[] getGPSCoordinate() {
this.getExifTags();
try {
Double e = Double.valueOf(this.getCoordinate((String) this.gps.get(Integer.valueOf(2))));
Double lon = Double.valueOf(this.getCoordinate((String) this.gps.get(Integer.valueOf(4))));
String latRef = (String) this.gps.get(Integer.valueOf(1));
String lonRef = (String) this.gps.get(Integer.valueOf(3));
if (!latRef.equalsIgnoreCase("N")) {
e = Double.valueOf(-e.doubleValue());
}
if (!lonRef.equalsIgnoreCase("E")) {
lon = Double.valueOf(-lon.doubleValue());
}
return new double[]{lon.doubleValue(), e.doubleValue()};
} catch (Exception var5) {
return null;
}
}
private double getCoordinate(String RationalArray) {
String[] arr = RationalArray.substring(1, RationalArray.length() - 1).split(",");
String[] deg = arr[0].trim().split("/");
String[] min = arr[1].trim().split("/");
String[] sec = arr[2].trim().split("/");
double degNumerator = Double.parseDouble(deg[0]);
double degDenominator = 1.0D;
try {
degDenominator = Double.parseDouble(deg[1]);
} catch (Exception var22) {
;
}
double minNumerator = Double.parseDouble(min[0]);
double minDenominator = 1.0D;
try {
minDenominator = Double.parseDouble(min[1]);
} catch (Exception var21) {
;
}
double secNumerator = Double.parseDouble(sec[0]);
double secDenominator = 1.0D;
try {
secDenominator = Double.parseDouble(sec[1]);
} catch (Exception var20) {
;
}
double m = 0.0D;
if (degDenominator != 0.0D || degNumerator != 0.0D) {
m = degNumerator / degDenominator;
}
if (minDenominator != 0.0D || minNumerator != 0.0D) {
m += minNumerator / minDenominator / 60.0D;
}
if (secDenominator != 0.0D || secNumerator != 0.0D) {
m += secNumerator / secDenominator / 3600.0D;
}
return m;
}
public String getGPSDatum() {
this.getExifTags();
return (String) this.gps.get(Integer.valueOf(18));
}
public IIOMetadataNode[] getUnknownTags(int MarkerTag) {
ArrayList markers = new ArrayList();
if (this.metadata != null) {
String[] arr$ = this.metadata.getMetadataFormatNames();
int len$ = arr$.length;
for (int i$ = 0; i$ < len$; ++i$) {
String name = arr$[i$];
IIOMetadataNode node = (IIOMetadataNode) this.metadata.getAsTree(name);
Node[] unknownNodes = getElementsByTagName("unknown", node);
Node[] arr$1 = unknownNodes;
int len$1 = unknownNodes.length;
for (int i$1 = 0; i$1 < len$1; ++i$1) {
Node unknownNode = arr$1[i$1];
try {
int e = Integer.parseInt(getAttributeValue(unknownNode.getAttributes(), "MarkerTag"));
if (e == MarkerTag) {
markers.add((IIOMetadataNode) unknownNode);
}
} catch (Exception var14) {
var14.printStackTrace();
}
}
}
}
return (IIOMetadataNode[]) markers.toArray(new IIOMetadataNode[markers.size()]);
}
public IIOMetadataNode[] getMetadataByTagName(String tagName) {
ArrayList tags = new ArrayList();
if (this.metadata != null) {
String[] arr$ = this.metadata.getMetadataFormatNames();
int len$ = arr$.length;
for (int i$ = 0; i$ < len$; ++i$) {
String name = arr$[i$];
IIOMetadataNode node = (IIOMetadataNode) this.metadata.getAsTree(name);
Node[] unknownNodes = getElementsByTagName(tagName, node);
Node[] arr$1 = unknownNodes;
int len$1 = unknownNodes.length;
for (int i$1 = 0; i$1 < len$1; ++i$1) {
Node unknownNode = arr$1[i$1];
tags.add((IIOMetadataNode) unknownNode);
}
}
}
return (IIOMetadataNode[]) tags.toArray(new IIOMetadataNode[tags.size()]);
}
private static Node[] getElementsByTagName(String tagName, Node node) {
ArrayList nodes = new ArrayList();
getElementsByTagName(tagName, node, nodes);
return (Node[]) nodes.toArray(new Node[nodes.size()]);
}
private static void getElementsByTagName(String tagName, Node node, ArrayList<Node> nodes) {
if (node != null && node.getNodeType() == 1) {
String nodeName = node.getNodeName().trim();
if (nodeName.contains(":") && !tagName.contains(":")) {
nodeName = nodeName.substring(nodeName.indexOf(":") + 1);
}
if (nodeName.equalsIgnoreCase(tagName)) {
nodes.add(node);
}
NodeList childNodes = node.getChildNodes();
for (int i = 0; i < childNodes.getLength(); ++i) {
getElementsByTagName(tagName, childNodes.item(i), nodes);
}
}
}
public static String getAttributeValue(NamedNodeMap attrCollection, String attrName) {
if (attrCollection != null) {
for (int i = 0; i < attrCollection.getLength(); ++i) {
Node node = attrCollection.item(i);
if (node.getNodeName().equalsIgnoreCase(attrName)) {
return node.getNodeValue();
}
}
}
return "";
}
private class Skew {
public static final int ZERO = 0;
public static final int CLAMP = 1;
public static final int WRAP = 2;
public static final int NEAREST_NEIGHBOUR = 0;
public static final int BILINEAR = 1;
protected int edgeAction;
protected int interpolation;
protected Rectangle transformedSpace;
protected Rectangle originalSpace;
private float x0;
private float y0;
private float x1;
private float y1;
private float x2;
private float y2;
private float x3;
private float y3;
private float dx1;
private float dy1;
private float dx2;
private float dy2;
private float dx3;
private float dy3;
private float A;
private float B;
private float C;
private float D;
private float E;
private float F;
private float G;
private float H;
private float I;
private BufferedImage src;
private BufferedImage dst;
public Skew(BufferedImage src) {
this.edgeAction = 0;
this.interpolation = 1;
this.src = src;
this.dst = new BufferedImage(src.getWidth(), src.getHeight(), src.getType());
}
public Skew(Image src) {
this((BufferedImage) src.getBufferedImage());
}
public BufferedImage setCorners(float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3) {
this.x0 = x0;
this.y0 = y0;
this.x1 = x1;
this.y1 = y1;
this.x2 = x2;
this.y2 = y2;
this.x3 = x3;
this.y3 = y3;
this.dx1 = x1 - x2;
this.dy1 = y1 - y2;
this.dx2 = x3 - x2;
this.dy2 = y3 - y2;
this.dx3 = x0 - x1 + x2 - x3;
this.dy3 = y0 - y1 + y2 - y3;
float a11;
float a12;
float a13;
float a21;
float a22;
float a23;
float a31;
float a32;
if (this.dx3 == 0.0F && this.dy3 == 0.0F) {
a11 = x1 - x0;
a21 = x2 - x1;
a31 = x0;
a12 = y1 - y0;
a22 = y2 - y1;
a32 = y0;
a23 = 0.0F;
a13 = 0.0F;
} else {
a13 = (this.dx3 * this.dy2 - this.dx2 * this.dy3) / (this.dx1 * this.dy2 - this.dy1 * this.dx2);
a23 = (this.dx1 * this.dy3 - this.dy1 * this.dx3) / (this.dx1 * this.dy2 - this.dy1 * this.dx2);
a11 = x1 - x0 + a13 * x1;
a21 = x3 - x0 + a23 * x3;
a31 = x0;
a12 = y1 - y0 + a13 * y1;
a22 = y3 - y0 + a23 * y3;
a32 = y0;
}
this.A = a22 - a32 * a23;
this.B = a31 * a23 - a21;
this.C = a21 * a32 - a31 * a22;
this.D = a32 * a13 - a12;
this.E = a11 - a31 * a13;
this.F = a31 * a12 - a11 * a32;
this.G = a12 * a23 - a22 * a13;
this.H = a21 * a13 - a11 * a23;
this.I = a11 * a22 - a21 * a12;
return this.filter(this.src, this.dst);
}
protected void transformSpace(Rectangle rect) {
rect.x = (int) Math.min(Math.min(this.x0, this.x1), Math.min(this.x2, this.x3));
rect.y = (int) Math.min(Math.min(this.y0, this.y1), Math.min(this.y2, this.y3));
rect.width = (int) Math.max(Math.max(this.x0, this.x1), Math.max(this.x2, this.x3)) - rect.x;
rect.height = (int) Math.max(Math.max(this.y0, this.y1), Math.max(this.y2, this.y3)) - rect.y;
}
public float getOriginX() {
return this.x0 - (float) ((int) Math.min(Math.min(this.x0, this.x1), Math.min(this.x2, this.x3)));
}
public float getOriginY() {
return this.y0 - (float) ((int) Math.min(Math.min(this.y0, this.y1), Math.min(this.y2, this.y3)));
}
private BufferedImage filter(BufferedImage src, BufferedImage dst) {
int width = src.getWidth();
int height = src.getHeight();
this.originalSpace = new Rectangle(0, 0, width, height);
this.transformedSpace = new Rectangle(0, 0, width, height);
this.transformSpace(this.transformedSpace);
if (dst == null) {
ColorModel inPixels = src.getColorModel();
dst = new BufferedImage(inPixels, inPixels.createCompatibleWritableRaster(this.transformedSpace.width, this.transformedSpace.height), inPixels.isAlphaPremultiplied(), (Hashtable) null);
}
int[] var27 = this.getRGB(src, 0, 0, width, height, (int[]) null);
if (this.interpolation == 0) {
return this.filterPixelsNN(dst, width, height, var27, this.transformedSpace);
} else {
int srcWidth = width;
int srcHeight = height;
int srcWidth1 = width - 1;
int srcHeight1 = height - 1;
int outWidth = this.transformedSpace.width;
int outHeight = this.transformedSpace.height;
int[] outPixels = new int[outWidth];
int outX = this.transformedSpace.x;
int outY = this.transformedSpace.y;
float[] out = new float[2];
for (int y = 0; y < outHeight; ++y) {
for (int x = 0; x < outWidth; ++x) {
this.transformInverse(outX + x, outY + y, out);
int srcX = (int) Math.floor((double) out[0]);
int srcY = (int) Math.floor((double) out[1]);
float xWeight = out[0] - (float) srcX;
float yWeight = out[1] - (float) srcY;
int nw;
int ne;
int sw;
int se;
if (srcX >= 0 && srcX < srcWidth1 && srcY >= 0 && srcY < srcHeight1) {
int i = srcWidth * srcY + srcX;
nw = var27[i];
ne = var27[i + 1];
sw = var27[i + srcWidth];
se = var27[i + srcWidth + 1];
} else {
nw = this.getPixel(var27, srcX, srcY, srcWidth, srcHeight);
ne = this.getPixel(var27, srcX + 1, srcY, srcWidth, srcHeight);
sw = this.getPixel(var27, srcX, srcY + 1, srcWidth, srcHeight);
se = this.getPixel(var27, srcX + 1, srcY + 1, srcWidth, srcHeight);
}
outPixels[x] = this.bilinearInterpolate(xWeight, yWeight, nw, ne, sw, se);
}
this.setRGB(dst, 0, y, this.transformedSpace.width, 1, outPixels);
}
return dst;
}
}
private final int getPixel(int[] pixels, int x, int y, int width, int height) {
if (x >= 0 && x < width && y >= 0 && y < height) {
return pixels[y * width + x];
} else {
switch (this.edgeAction) {
case 0:
default:
return 0;
case 1:
return pixels[this.clamp(y, 0, height - 1) * width + this.clamp(x, 0, width - 1)];
case 2:
return pixels[this.mod(y, height) * width + this.mod(x, width)];
}
}
}
protected BufferedImage filterPixelsNN(BufferedImage dst, int width, int height, int[] inPixels, Rectangle transformedSpace) {
int srcWidth = width;
int srcHeight = height;
int outWidth = transformedSpace.width;
int outHeight = transformedSpace.height;
int[] outPixels = new int[outWidth];
int outX = transformedSpace.x;
int outY = transformedSpace.y;
int[] rgb = new int[4];
float[] out = new float[2];
for (int y = 0; y < outHeight; ++y) {
for (int x = 0; x < outWidth; ++x) {
this.transformInverse(outX + x, outY + y, out);
int srcX = (int) out[0];
int srcY = (int) out[1];
int i;
if (out[0] >= 0.0F && srcX < srcWidth && out[1] >= 0.0F && srcY < srcHeight) {
i = srcWidth * srcY + srcX;
rgb[0] = inPixels[i];
outPixels[x] = inPixels[i];
} else {
switch (this.edgeAction) {
case 0:
default:
i = 0;
break;
case 1:
i = inPixels[this.clamp(srcY, 0, srcHeight - 1) * srcWidth + this.clamp(srcX, 0, srcWidth - 1)];
break;
case 2:
i = inPixels[this.mod(srcY, srcHeight) * srcWidth + this.mod(srcX, srcWidth)];
}
outPixels[x] = i;
}
}
this.setRGB(dst, 0, y, transformedSpace.width, 1, outPixels);
}
return dst;
}
protected void transformInverse(int x, int y, float[] out) {
out[0] = (float) this.originalSpace.width * (this.A * (float) x + this.B * (float) y + this.C) / (this.G * (float) x + this.H * (float) y + this.I);
out[1] = (float) this.originalSpace.height * (this.D * (float) x + this.E * (float) y + this.F) / (this.G * (float) x + this.H * (float) y + this.I);
}
public int[] getRGB(BufferedImage image, int x, int y, int width, int height, int[] pixels) {
int type = image.getType();
return type != 2 && type != 1 ? image.getRGB(x, y, width, height, pixels, 0, width) : (int[]) ((int[]) image.getRaster().getDataElements(x, y, width, height, pixels));
}
public void setRGB(BufferedImage image, int x, int y, int width, int height, int[] pixels) {
int type = image.getType();
if (type != 2 && type != 1) {
image.setRGB(x, y, width, height, pixels, 0, width);
} else {
image.getRaster().setDataElements(x, y, width, height, pixels);
}
}
private float clamp(float x, float a, float b) {
return x < a ? a : (x > b ? b : x);
}
private int clamp(int x, int a, int b) {
return x < a ? a : (x > b ? b : x);
}
private double mod(double a, double b) {
int n = (int) (a / b);
a -= (double) n * b;
return a < 0.0D ? a + b : a;
}
private float mod(float a, float b) {
int n = (int) (a / b);
a -= (float) n * b;
return a < 0.0F ? a + b : a;
}
private int mod(int a, int b) {
int n = a / b;
a -= n * b;
return a < 0 ? a + b : a;
}
private int bilinearInterpolate(float x, float y, int nw, int ne, int sw, int se) {
int a0 = nw >> 24 & 255;
int r0 = nw >> 16 & 255;
int g0 = nw >> 8 & 255;
int b0 = nw & 255;
int a1 = ne >> 24 & 255;
int r1 = ne >> 16 & 255;
int g1 = ne >> 8 & 255;
int b1 = ne & 255;
int a2 = sw >> 24 & 255;
int r2 = sw >> 16 & 255;
int g2 = sw >> 8 & 255;
int b2 = sw & 255;
int a3 = se >> 24 & 255;
int r3 = se >> 16 & 255;
int g3 = se >> 8 & 255;
int b3 = se & 255;
float cx = 1.0F - x;
float cy = 1.0F - y;
float m0 = cx * (float) a0 + x * (float) a1;
float m1 = cx * (float) a2 + x * (float) a3;
int a = (int) (cy * m0 + y * m1);
m0 = cx * (float) r0 + x * (float) r1;
m1 = cx * (float) r2 + x * (float) r3;
int r = (int) (cy * m0 + y * m1);
m0 = cx * (float) g0 + x * (float) g1;
m1 = cx * (float) g2 + x * (float) g3;
int g = (int) (cy * m0 + y * m1);
m0 = cx * (float) b0 + x * (float) b1;
m1 = cx * (float) b2 + x * (float) b3;
int b = (int) (cy * m0 + y * m1);
return a << 24 | r << 16 | g << 8 | b;
}
}
private class MetadataParser {
private final int[] bytesPerFormat = new int[]{0, 1, 1, 2, 4, 8, 1, 1, 2, 4, 8, 4, 8};
private final int NUM_FORMATS = 12;
private final int FMT_BYTE = 1;
private final int FMT_STRING = 2;
private final int FMT_USHORT = 3;
private final int FMT_ULONG = 4;
private final int FMT_URATIONAL = 5;
private final int FMT_SBYTE = 6;
private final int FMT_SSHORT = 8;
private final int FMT_SLONG = 9;
private final int FMT_SRATIONAL = 10;
private byte[] data = null;
private boolean intelOrder = false;
private final int TAG_EXIF_OFFSET = '蝩';
private final int TAG_INTEROP_OFFSET = 'ꀅ';
private final int TAG_GPS_OFFSET = '蠥';
private final int TAG_USERCOMMENT = '銆';
private HashMap<String, HashMap<Integer, Object>> tags = new HashMap();
public MetadataParser(byte[] data, int marker) {
switch (marker) {
case 225:
this.parseExif(data);
break;
case 237:
this.parseIptc(data);
}
Object data1 = null;
}
private void parseIptc(byte[] iptcData) {
HashMap tags = new HashMap();
this.tags.put("IPTC", tags);
this.data = iptcData;
int offset = 0;
while (offset < this.data.length) {
if (this.data[offset] == 28) {
++offset;
byte directoryType;
byte tagType;
int tagByteCount;
try {
directoryType = this.data[offset++];
tagType = this.data[offset++];
tagByteCount = this.get16u(offset);
offset += 2;
} catch (Exception var11) {
return;
}
int tagIdentifier = tagType | directoryType << 8;
String str = "";
if (tagByteCount >= 1 && tagByteCount <= this.data.length - offset) {
try {
str = new String(this.data, offset, tagByteCount, "UTF-8");
offset += tagByteCount;
} catch (Exception var10) {
;
}
}
tags.put(Integer.valueOf(tagIdentifier), str);
} else {
++offset;
}
}
}
public void parseExif(byte[] exifData) {
HashMap tags = new HashMap();
this.tags.put("EXIF", tags);
try {
String checkValue = new String(exifData, 0, 8, "UTF-8");
if (exifData.length <= 4 || !"Exif".equals(checkValue.substring(0, 4))) {
return;
}
String firstOffset = checkValue.substring(6, 8);
if ("II".equals(firstOffset)) {
this.intelOrder = true;
} else {
if (!"MM".equals(firstOffset)) {
return;
}
this.intelOrder = false;
}
} catch (Exception var5) {
return;
}
this.data = exifData;
int checkValue1 = this.get16u(8);
if (checkValue1 != 42) {
this.data = null;
} else if (this.data != null) {
int firstOffset1 = this.get32u(10);
this.processExifDir(6 + firstOffset1, 6, tags);
}
}
public HashMap<Integer, Object> getTags(String dir) {
return (HashMap) this.tags.get(dir);
}
private void processExifDir(int dirStart, int offsetBase, HashMap<Integer, Object> tags) {
if (dirStart < this.data.length) {
int numEntries = this.get16u(dirStart);
for (int de = 0; de < numEntries; ++de) {
int dirOffset = dirStart + 2 + 12 * de;
int tag = this.get16u(dirOffset);
int format = this.get16u(dirOffset + 2);
int components = this.get32u(dirOffset + 4);
if (format < 0 || format > 12) {
return;
}
int byteCount = components * this.bytesPerFormat[format];
int valueOffset = dirOffset + 8;
if (byteCount > 4) {
int value = this.get32u(dirOffset + 8);
valueOffset = offsetBase + value;
}
String var15;
if (tag != '蝩' && tag != 'ꀅ' && tag != '蠥') {
switch (format) {
case 1:
case 3:
case 4:
case 6:
case 8:
case 9:
tags.put(Integer.valueOf(tag), Integer.valueOf((int) this.getDouble(format, valueOffset)));
break;
case 2:
var15 = this.getString(valueOffset, byteCount);
if (var15 != null) {
tags.put(Integer.valueOf(tag), var15);
}
break;
case 5:
case 10:
if (components > 1) {
StringBuffer var16 = new StringBuffer();
var16.append("[");
for (int i = 0; i < components; ++i) {
var16.append(this.getRational(valueOffset + 8 * i));
if (i < components - 1) {
var16.append(",");
}
}
var16.append("]");
tags.put(Integer.valueOf(tag), var16.toString());
} else {
tags.put(Integer.valueOf(tag), this.getRational(valueOffset));
}
break;
case 7:
default:
byte[] var17 = this.getUndefined(valueOffset, byteCount);
if (var17 != null) {
tags.put(Integer.valueOf(tag), var17);
}
}
} else {
var15 = "";
switch (tag) {
case 34665:
var15 = "EXIF";
break;
case 34853:
var15 = "GPS";
break;
case 40965:
var15 = "EXIF";
}
tags = (HashMap) this.tags.get(var15);
if (tags == null) {
tags = new HashMap();
this.tags.put(var15, tags);
}
int result = this.get32u(valueOffset);
this.processExifDir(offsetBase + result, offsetBase, tags);
}
}
}
}
private String getRational(int offset) {
int num = this.get32s(offset);
int den = this.get32s(offset + 4);
String result = "";
if (num % 10 == 0 && den % 10 == 0) {
num /= 10;
den /= 10;
}
if (num % 5 == 0 && den % 5 == 0) {
num /= 5;
den /= 5;
}
if (num % 3 == 0 && den % 3 == 0) {
num /= 3;
den /= 3;
}
if (num % 2 == 0 && den % 2 == 0) {
num /= 2;
den /= 2;
}
if (den == 0) {
result = "0";
} else if (den == 1) {
result = "" + num;
} else {
result = "" + num + "/" + den;
}
return result;
}
private int get16s(int offset) {
byte hi;
byte lo;
if (this.intelOrder) {
hi = this.data[offset + 1];
lo = this.data[offset];
} else {
hi = this.data[offset];
lo = this.data[offset + 1];
}
int lo1 = lo & 255;
int hi1 = hi & 255;
return (hi1 << 8) + lo1;
}
private int get16u(int offset) {
int value = this.get16s(offset);
return value & '\uffff';
}
private int get32s(int offset) {
int n1;
int n2;
int n3;
int n4;
if (this.intelOrder) {
n1 = this.data[offset + 3] & 255;
n2 = this.data[offset + 2] & 255;
n3 = this.data[offset + 1] & 255;
n4 = this.data[offset] & 255;
} else {
n1 = this.data[offset] & 255;
n2 = this.data[offset + 1] & 255;
n3 = this.data[offset + 2] & 255;
n4 = this.data[offset + 3] & 255;
}
return (n1 << 24) + (n2 << 16) + (n3 << 8) + n4;
}
private int get32u(int offset) {
return this.get32s(offset);
}
private byte[] getUndefined(int offset, int length) {
return Arrays.copyOfRange(this.data, offset, offset + length);
}
private String getString(int offset, int length) {
try {
return (new String(this.data, offset, length, "UTF-8")).trim();
} catch (Exception var4) {
return null;
}
}
private double getDouble(int format, int offset) {
switch (format) {
case 1:
byte iValue = this.data[offset];
return (double) (iValue & 255);
case 2:
case 7:
default:
return 0.0D;
case 3:
return (double) this.get16u(offset);
case 4:
return (double) this.get32u(offset);
case 5:
case 10:
int num = this.get32s(offset);
int den = this.get32s(offset + 4);
if (den == 0) {
return 0.0D;
}
return (double) num / (double) den;
case 6:
return (double) this.data[offset];
case 8:
return (double) this.get16s(offset);
case 9:
return (double) this.get32s(offset);
}
}
}
}
package com.server.utils;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;
import java.security.MessageDigest;
/**
* MD5
*/
public final class MD5 {
private MD5() {
}
private static final char[] hexDigits = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
public static String md5(String txt) {
try {
return md5(txt.getBytes("UTF-8"));
} catch (Exception e) {
throw new RuntimeException(e);
}
}
public static String md5(String... txt) {
return md5(StrUtils.joinString(",", txt));
}
public static String md5(byte[] data) {
try {
MessageDigest mdTemp = MessageDigest.getInstance("MD5");
byte[] bytes = data;
mdTemp.update(bytes);
byte[] md = mdTemp.digest();
int j = md.length;
char str[] = new char[j * 2];
int k = 0;
for (int i = 0; i < j; i++) {
byte byte0 = md[i];
str[k++] = hexDigits[byte0 >>> 4 & 0xf];
str[k++] = hexDigits[byte0 & 0xf];
}
return new String(str);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
/**
* @param file
* @return
* @throws IOException
*/
public static String fileMd5(File file) throws Exception {
try (FileInputStream in = new FileInputStream(file)) {
MessageDigest md5 = MessageDigest.getInstance("MD5");
FileChannel fChannel = in.getChannel();
ByteBuffer buffer = ByteBuffer.allocate(16 * 1024);
for (int count = fChannel.read(buffer); count != -1; count = fChannel.read(buffer)) {
buffer.flip();
md5.update(buffer);
if (!buffer.hasRemaining()) {
buffer.clear();
}
}
//
byte[] md = md5.digest();
int j = md.length;
char str[] = new char[j * 2];
int k = 0;
for (int i = 0; i < j; i++) {
byte byte0 = md[i];
str[k++] = hexDigits[byte0 >>> 4 & 0xf];
str[k++] = hexDigits[byte0 & 0xf];
}
return new String(str);
} catch (Exception ex) {
throw ex;
}
}
}
package com.server.utils;
/**
* 62进制数字
*/
public class Num62 {
/**
* 62个字母和数字,含大小写
*/
public static final char[] N62_CHARS = {'0', '1', '2', '3', '4', '5', '6',
'7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J',
'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j',
'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w',
'x', 'y', 'z'};
/**
* 36个小写字母和数字
*/
public static final char[] N36_CHARS = {'0', '1', '2', '3', '4', '5', '6',
'7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j',
'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w',
'x', 'y', 'z'};
/**
* 长整型用N36表示的最大长度
*/
public static final int LONG_N36_LEN = 13;
/**
* 长整型用N62表示的最大长度
*/
public static final int LONG_N62_LEN = 11;
/**
* 长整型转换成字符串
*/
private static StringBuilder longToNBuf(long l, char[] chars) {
int upgrade = chars.length;
StringBuilder result = new StringBuilder();
int last;
while (l > 0) {
last = (int) (l % upgrade);
result.append(chars[last]);
l /= upgrade;
}
return result;
}
/**
* 长整数转换成N62
*/
public static String longToN62(long l) {
return longToNBuf(l, N62_CHARS).reverse().toString();
}
/**
* 长整型转换成N36
*/
public static String longToN36(long l) {
return longToNBuf(l, N36_CHARS).reverse().toString();
}
/**
* 长整数转换成N62
*
* @param length 如不足length长度,则补足0。
*/
public static String longToN62(long l, int length) {
StringBuilder sb = longToNBuf(l, N62_CHARS);
for (int i = sb.length(); i < length; i++) {
sb.append('0');
}
return sb.reverse().toString();
}
/**
* 长整型转换成N36
*
* @param length 如不足length长度,则补足0。
*/
public static String longToN36(long l, int length) {
StringBuilder sb = longToNBuf(l, N36_CHARS);
for (int i = sb.length(); i < length; i++) {
sb.append('0');
}
return sb.reverse().toString();
}
/**
* N62转换成整数
*/
public static long n62ToLong(String n62) {
return nToLong(n62, N62_CHARS);
}
/**
* N36转换成整数
*/
public static long n36ToLong(String n36) {
return nToLong(n36, N36_CHARS);
}
private static long nToLong(String s, char[] chars) {
char[] nc = s.toCharArray();
long result = 0;
long pow = 1;
for (int i = nc.length - 1; i >= 0; i--, pow *= chars.length) {
int n = findNIndex(nc[i], chars);
result += n * pow;
}
return result;
}
private static int findNIndex(char c, char[] chars) {
for (int i = 0; i < chars.length; i++) {
if (c == chars[i]) {
return i;
}
}
throw new RuntimeException("N62(N36)非法字符:" + c);
}
public static void main(String[] args) {
System.out.println(longToN62(Long.MAX_VALUE));
}
}
package com.server.utils;
import java.util.concurrent.ThreadLocalRandom;
/**
* @author ZMS
*/
public final class RandomUtils {
public static int random(int i) {
return ThreadLocalRandom.current().nextInt(i);
}
public static int random() {
return ThreadLocalRandom.current().nextInt();
}
}
package com.server.utils;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
public class SpringContextUtil implements ApplicationContextAware {
private static ApplicationContext ctx;
public void setApplicationContext(ApplicationContext ctx) throws BeansException {
SpringContextUtil.ctx = ctx;
}
public static ApplicationContext getCtx() {
return ctx;
}
}
package com.server.utils;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* @author ZMS
*/
public final class StrUtils {
/**
* 是否是空白字符串
*
* @param str
* @return
*/
public static boolean isBlank(String str) {
if (str == null || str.trim().length() == 0) {
return true;
}
return false;
}
public static boolean isNotBlank(String str) {
return !isBlank(str);
}
/**
* null转换为空白字符
*
* @param str
* @return
*/
public static String null2Blank(String str) {
if (isBlank(str)) {
return "";
}
return str;
}
/**
* 首字母大写
*
* @param str
* @return
*/
public static String firstUpper(String str) {
StringBuilder ret = new StringBuilder();
if (str != null && str.length() > 0) {
ret.append(str.substring(0, 1).toUpperCase()).append(str.substring(1));
}
return ret.toString();
}
/**
* 首字母小写
*
* @param str
* @return
*/
public static String firstLower(String str) {
StringBuilder ret = new StringBuilder();
if (str != null && str.length() > 0) {
ret.append(str.substring(0, 1).toLowerCase()).append(str.substring(1));
}
return ret.toString();
}
/**
* 转换为boolean
*
* @param str
* @return
*/
public static boolean parseBoolean(String str) {
return "1".equals(str) || "true".equals(str);
}
/**
* 链接字符串
*
* @param delimiter
* @param strings
* @return
*/
public static String joinString(String delimiter, Object... strings) {
if (strings == null || strings.length == 0) {
return "";
}
StringBuilder sb = new StringBuilder();
boolean d = false;
for (Object s : strings) {
if (d) {
sb.append(delimiter);
} else {
d = true;
}
sb.append(s);
}
return sb.toString();
}
public static String joinString(String delimiter, String... strings) {
Object[] o = new Object[strings.length];
for (int i = 0; i < o.length; i++) {
o[i] = strings[i];
}
return joinString(delimiter, o);
}
/**
* 链接非空字符串
*
* @param delimiter
* @param strings
* @return
*/
public static String joinNotEmpty(String delimiter, String... strings) {
if (strings == null || strings.length == 0) {
return "";
}
StringBuilder sb = new StringBuilder();
boolean d = false;
for (String s : strings) {
if (s != null && !s.isEmpty()) {
if (d) {
sb.append(delimiter);
} else {
d = true;
}
sb.append(s);
}
}
return sb.toString();
}
/**
* 正则查找
*
* @param string
* @param reg
* @return
*/
public static String[] find(String string, String reg) {
List<String> list = new ArrayList<String>();
Pattern p = Pattern.compile(reg);
Matcher m = p.matcher(string);
while (m.find()) {
list.add(m.group());
}
return list.toArray(new String[list.size()]);
}
/**
* 统计正则个数
*
* @param string
* @param regex
* @return
*/
public static int countRegex(String string, String regex) {
if (StrUtils.isBlank(string)) {
return 0;
}
String[] para = StrUtils.find(string, regex);
return para.length;
}
public static String jsonSafe(String str) {
if (str == null) {
return "";
}
str = str.replaceAll("\n|\r|\r\n|\n\r", "");
str = str.replaceAll("\"|'", " ");
str = str.trim();
return str;
}
public static String formatLeftTime(long l) {
long[] time = DateUtils.splitTime(l);
String str = "";
if (time[0] > 0) {
str = str + time[0] + "day ";
}
if (time[1] > 0) {
str = str + time[1] + "hour ";
}
if (time[2] > 0) {
str = str + time[2] + "minute ";
}
if (time[3] > 0) {
str = str + time[3] + "second ";
}
return str;
}
public static String xssSafe(String str) {
str = str.replaceAll("<", "&lt;");
str = str.replaceAll(">", "&gt;");
str = str.replaceAll("\"", "&quot;");
str = str.replaceAll("'", "&apos;");
return str;
}
public static boolean isWord(String str) {
if (str == null) {
return false;
}
return str.matches("[a-zA-Z_0-9]+");
}
public static boolean isNumber(String str) {
return str != null && str.matches("[\\-\\+]?[0-9]*\\.?[0-9]+");
}
public static boolean isInteger(String str) {
return str != null && str.matches("[\\-\\+]?[0-9]+");
}
public static String join(String[] array, String token) {
if (array == null || array.length == 0) {
return "";
}
StringBuilder sb = new StringBuilder(array[0]);
for (int i = 1; i < array.length; i++) {
sb.append(token);
sb.append(array[i]);
}
return sb.toString();
}
public static boolean requireLength(String str, int min, int max) {
return str != null && str.length() >= min && str.length() <= max;
}
public static String firstLowerCase(String str) {
return str.substring(0, 1).toLowerCase() + str.substring(1);
}
public static boolean isEmail(String str) {
return str != null && str.matches("\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*");
}
public static boolean isMobilePhone(String str) {
return str != null && str.matches("\\d{11}");
}
public static String reverse(String str) {
return new StringBuilder(str).reverse().toString();
}
/**
* 随机固定长度的数字
*
* @param length
* @return
*/
public static String randomNumber(int length) {
StringBuilder sb = new StringBuilder();
for (int i = 0; i < length; i++) {
sb.append(RandomUtils.random(10));
}
return sb.toString();
}
/**
* 随机固定长度
*
* @param length
* @return
*/
public static String randomString(int length) {
StringBuilder sb = new StringBuilder();
for (int i = 0; i < length; i++) {
int val = RandomUtils.random(36);
if (val < 10) {
sb.append(val);
} else {
char c = (char) ('a' + (val - 10));
sb.append(c);
}
}
return sb.toString();
}
public static String formatPrice(double price) {
return formatDouble(price, 2);
}
public static String formatDouble(double num, int scale) {
BigDecimal bigDecimal = new BigDecimal(num);
bigDecimal = bigDecimal.setScale(scale, RoundingMode.HALF_UP);
num = Double.parseDouble(bigDecimal.toPlainString());
int value = new Double(num).intValue();
if (num - value < Math.pow(10, -scale)) {
return String.valueOf(value);
}
return String.valueOf(num);
}
public static boolean isIpV4Address(String str) {
String reg = "([1-9]|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3}";
return str != null && str.matches(reg);
}
public static String uuid() {
return UUID.randomUUID().toString().replace("-", "");
}
}
package com.server.utils;
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.lang3.RandomStringUtils;
import org.apache.commons.lang3.StringUtils;
import java.io.File;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.regex.Pattern;
public class UploadUtils {
/**
* 日期格式化对象
*/
public static final DateFormat MONTH_FORMAT = new SimpleDateFormat("/yyyyMM/ddHHmmss");
public static final DateFormat YEAR_MONTH_FORMAT = new SimpleDateFormat("yyyyMM");
public static String generateFilename(String path, String ext) {
String ret = path + MONTH_FORMAT.format(new Date()) + RandomStringUtils.random(4, Num62.N36_CHARS) + "." + ext;
return ret.replaceAll("/+", "/");
}
public static String generateMonthname() {
return YEAR_MONTH_FORMAT.format(new Date());
}
public static String generateByFilename(String path, String fileName, String ext) {
return path + fileName + "." + ext;
}
protected static final Pattern ILLEGAL_CURRENT_FOLDER_PATTERN = Pattern
.compile("^[^/]|[^/]$|/\\.{1,2}|\\\\|\\||:|\\?|\\*|\"|<|>|\\p{Cntrl}");
/**
* Sanitizes a filename from certain chars.<br />
* This method enforces the <code>forceSingleExtension</code> property and
* then replaces all occurrences of \, /, |, :, ?, *, &quot;, &lt;, &gt;,
* control chars by _ (underscore).
*
* @param filename a potentially 'malicious' filename
* @return sanitized filename
*/
public static String sanitizeFileName(final String filename) {
if (StringUtils.isBlank(filename))
return filename;
String name = forceSingleExtension(filename);
// Remove \ / | : ? * " < > 'Control Chars' with _
return name.replaceAll("\\\\|/|\\||:|\\?|\\*|\"|<|>|\\p{Cntrl}", "_");
}
/**
* Sanitizes a folder name from certain chars.<br />
* This method replaces all occurrences of \, /, |, :, ?, *, &quot;, &lt;,
* &gt;, control chars by _ (underscore).
*
* @param folderName a potentially 'malicious' folder name
* @return sanitized folder name
*/
public static String sanitizeFolderName(final String folderName) {
if (StringUtils.isBlank(folderName))
return folderName;
// Remove . \ / | : ? * " < > 'Control Chars' with _
return folderName.replaceAll(
"\\.|\\\\|/|\\||:|\\?|\\*|\"|<|>|\\p{Cntrl}", "_");
}
/**
* Checks whether a path complies with the FCKeditor File Browser <a href="http://docs.fckeditor.net/FCKeditor_2.x/Developers_Guide/Server_Side_Integration#File_Browser_Requests"
* target="_blank">rules</a>.
*
* @param path a potentially 'malicious' path
* @return <code>true</code> if path complies with the rules, else
* <code>false</code>
*/
public static boolean isValidPath(final String path) {
if(StringUtils.isBlank(path))
return false;
if (ILLEGAL_CURRENT_FOLDER_PATTERN.matcher(path).find())
return false;
return true;
}
/**
* Replaces all dots in a filename with underscores except the last one.
*
* @param filename filename to sanitize
* @return string with a single dot only
*/
public static String forceSingleExtension(final String filename) {
return filename.replaceAll("\\.(?![^.]+$)", "_");
}
/**
* Checks if a filename contains more than one dot.
*
* @param filename filename to check
* @return <code>true</code> if filename contains severals dots, else
* <code>false</code>
*/
public static boolean isSingleExtension(final String filename) {
return filename.matches("[^\\.]+\\.[^\\.]+");
}
/**
* Checks a directory for existence and creates it if non-existent.
*
* @param dir directory to check/create
*/
public static void checkDirAndCreate(File dir) {
if (!dir.exists())
dir.mkdirs();
}
/**
* Iterates over a base name and returns the first non-existent file.<br />
* This method extracts a file's base name, iterates over it until the first
* non-existent appearance with <code>basename(n).ext</code>. Where n is a
* positive integer starting from one.
*
* @param file base file
* @return first non-existent file
*/
public static File getUniqueFile(final File file) {
if (!file.exists())
return file;
File tmpFile = new File(file.getAbsolutePath());
File parentDir = tmpFile.getParentFile();
int count = 1;
String extension = FilenameUtils.getExtension(tmpFile.getName());
String baseName = FilenameUtils.getBaseName(tmpFile.getName());
do {
tmpFile = new File(parentDir, baseName + "(" + count++ + ")."
+ extension);
} while (tmpFile.exists());
return tmpFile;
}
}
package com.server.utils.blob;
import org.apache.ibatis.type.BaseTypeHandler;
import org.apache.ibatis.type.JdbcType;
import java.io.ByteArrayInputStream;
import java.io.UnsupportedEncodingException;
import java.sql.*;
/**
* Created by dell on 2017/7/19.
*/
public class BlobTypeHandler extends BaseTypeHandler<String> {
// 指定字符集
private static final String DEFAULT_CHARSET = "utf-8";
@Override
public void setNonNullParameter(PreparedStatement ps, int i,
String parameter, JdbcType jdbcType) throws SQLException
{
ByteArrayInputStream bis;
try
{
// 把String转化成byte流
bis = new ByteArrayInputStream(parameter.getBytes(DEFAULT_CHARSET));
} catch (UnsupportedEncodingException e)
{
throw new RuntimeException("Blob Encoding Error!");
}
ps.setBinaryStream(i, bis, parameter.length());
}
@Override
public String getNullableResult(ResultSet rs, String columnName)
throws SQLException
{
Blob blob = rs.getBlob(columnName);
byte[] returnValue = null;
String result = null;
if (null != blob)
{
returnValue = blob.getBytes(1, (int) blob.length());
}
try
{
if (null != returnValue)
{
// 把byte转化成string
result = new String(returnValue, DEFAULT_CHARSET);
}
} catch (UnsupportedEncodingException e)
{
throw new RuntimeException("Blob Encoding Error!");
}
return result;
}
@Override
public String getNullableResult(CallableStatement cs, int columnIndex)
throws SQLException
{
Blob blob = cs.getBlob(columnIndex);
byte[] returnValue = null;
String result = null;
if (null != blob)
{
returnValue = blob.getBytes(1, (int) blob.length());
}
try
{
if (null != returnValue)
{
result = new String(returnValue, DEFAULT_CHARSET);
}
} catch (UnsupportedEncodingException e)
{
throw new RuntimeException("Blob Encoding Error!");
}
return result;
}
/**
* @Description:
*
* @return
* @throws SQLException
*
* @see BaseTypeHandler#getNullableResult(ResultSet,
* int)
*
*/
@Override
public String getNullableResult(ResultSet rs, int columnName)
throws SQLException
{
String result = null;
Blob blob = rs.getBlob(columnName);
byte[] returnValue = null;
if (null != blob)
{
returnValue = blob.getBytes(1, (int) blob.length());
}
try
{
// 把byte转化成string
if (null != returnValue)
{
result = new String(returnValue, DEFAULT_CHARSET);
}
} catch (UnsupportedEncodingException e)
{
throw new RuntimeException("Blob Encoding Error!");
}
return result;
}
}
package com.server.utils.key;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
/**
* Created by dell on 2018/3/5.
*/
@Component
public class QiniuKey {
@Value("${qiniu.accessKey}")
private String accessKey;
@Value("${qiniu.secretKey}")
private String secretKey;
@Value("${qiniu.bucket}")
private String bucket;
@Value("${qiniu.url}")
private String url;
public String getAccessKey() {
return accessKey;
}
public void setAccessKey(String accessKey) {
this.accessKey = accessKey;
}
public String getSecretKey() {
return secretKey;
}
public void setSecretKey(String secretKey) {
this.secretKey = secretKey;
}
public String getBucket() {
return bucket;
}
public void setBucket(String bucket) {
this.bucket = bucket;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
}
package com.server.utils.key;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
/**
* Created by dell on 2018/3/5.
*/
@Component
public class UploadUrlKey {
@Value("${upload.image.dir}")
private String realPath;
@Value("${upload.image.base.path}")
private String basePath;
public String getRealPath() {
return realPath;
}
public void setRealPath(String realPath) {
this.realPath = realPath;
}
public String getBasePath() {
return basePath;
}
public void setBasePath(String basePath) {
this.basePath = basePath;
}
}
package com.server.utils.redis;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.PropertyAccessor;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.cache.CacheManager;
import org.springframework.cache.annotation.CachingConfigurerSupport;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.cache.RedisCacheManager;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
import org.springframework.data.redis.serializer.RedisSerializer;
import org.springframework.data.redis.serializer.StringRedisSerializer;
import javax.crypto.KeyGenerator;
/**
* Created by dell on 2017/11/6.
*/
@Configuration
@EnableCaching
public class RedisCacheConfig extends CachingConfigurerSupport {
@Bean
public CacheManager cacheManager(RedisTemplate redisTemplate) {
RedisCacheManager rcm = new RedisCacheManager(redisTemplate);
//设置缓存过期时间
//rcm.setDefaultExpiration(60);//秒
return rcm;
}
@Bean
public RedisTemplate<String, String> stringRedisTemplate(RedisConnectionFactory factory) {
StringRedisTemplate template = new StringRedisTemplate(factory);
Jackson2JsonRedisSerializer jackson2JsonRedisSerializer = new Jackson2JsonRedisSerializer(Object.class);
ObjectMapper om = new ObjectMapper();
om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
om.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);
jackson2JsonRedisSerializer.setObjectMapper(om);
template.setValueSerializer(jackson2JsonRedisSerializer);
template.afterPropertiesSet();
return template;
}
}
package com.server.web.common.mapper;
import com.server.web.common.model.TBaseBanner;
import com.server.web.common.model.TBaseBannerExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface TBaseBannerMapper {
long countByExample(TBaseBannerExample example);
int deleteByExample(TBaseBannerExample example);
int deleteByPrimaryKey(Long id);
int insert(TBaseBanner record);
int insertSelective(TBaseBanner record);
List<TBaseBanner> selectByExample(TBaseBannerExample example);
TBaseBanner selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") TBaseBanner record, @Param("example") TBaseBannerExample example);
int updateByExample(@Param("record") TBaseBanner record, @Param("example") TBaseBannerExample example);
int updateByPrimaryKeySelective(TBaseBanner record);
int updateByPrimaryKey(TBaseBanner record);
}
\ No newline at end of file
package com.server.web.common.mapper;
import com.server.web.common.model.TBaseFirstClass;
import com.server.web.common.model.TBaseFirstClassExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface TBaseFirstClassMapper {
long countByExample(TBaseFirstClassExample example);
int deleteByExample(TBaseFirstClassExample example);
int deleteByPrimaryKey(Long id);
int insert(TBaseFirstClass record);
int insertSelective(TBaseFirstClass record);
List<TBaseFirstClass> selectByExample(TBaseFirstClassExample example);
TBaseFirstClass selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") TBaseFirstClass record, @Param("example") TBaseFirstClassExample example);
int updateByExample(@Param("record") TBaseFirstClass record, @Param("example") TBaseFirstClassExample example);
int updateByPrimaryKeySelective(TBaseFirstClass record);
int updateByPrimaryKey(TBaseFirstClass record);
}
\ No newline at end of file
package com.server.web.common.mapper;
import com.server.web.common.model.TBaseSecondClass;
import com.server.web.common.model.TBaseSecondClassExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface TBaseSecondClassMapper {
long countByExample(TBaseSecondClassExample example);
int deleteByExample(TBaseSecondClassExample example);
int deleteByPrimaryKey(Long id);
int insert(TBaseSecondClass record);
int insertSelective(TBaseSecondClass record);
List<TBaseSecondClass> selectByExample(TBaseSecondClassExample example);
TBaseSecondClass selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") TBaseSecondClass record, @Param("example") TBaseSecondClassExample example);
int updateByExample(@Param("record") TBaseSecondClass record, @Param("example") TBaseSecondClassExample example);
int updateByPrimaryKeySelective(TBaseSecondClass record);
int updateByPrimaryKey(TBaseSecondClass record);
}
\ No newline at end of file
package com.server.web.common.mapper;
import com.server.web.common.model.TKzyComment;
import com.server.web.common.model.TKzyCommentExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface TKzyCommentMapper {
long countByExample(TKzyCommentExample example);
int deleteByExample(TKzyCommentExample example);
int deleteByPrimaryKey(Long id);
int insert(TKzyComment record);
int insertSelective(TKzyComment record);
List<TKzyComment> selectByExample(TKzyCommentExample example);
TKzyComment selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") TKzyComment record, @Param("example") TKzyCommentExample example);
int updateByExample(@Param("record") TKzyComment record, @Param("example") TKzyCommentExample example);
int updateByPrimaryKeySelective(TKzyComment record);
int updateByPrimaryKey(TKzyComment record);
}
\ No newline at end of file
package com.server.web.common.mapper;
import com.server.web.common.model.TKzyCourse;
import com.server.web.common.model.TKzyCourseExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface TKzyCourseMapper {
long countByExample(TKzyCourseExample example);
int deleteByExample(TKzyCourseExample example);
int deleteByPrimaryKey(Long id);
int insert(TKzyCourse record);
int insertSelective(TKzyCourse record);
List<TKzyCourse> selectByExampleWithBLOBs(TKzyCourseExample example);
List<TKzyCourse> selectByExample(TKzyCourseExample example);
TKzyCourse selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") TKzyCourse record, @Param("example") TKzyCourseExample example);
int updateByExampleWithBLOBs(@Param("record") TKzyCourse record, @Param("example") TKzyCourseExample example);
int updateByExample(@Param("record") TKzyCourse record, @Param("example") TKzyCourseExample example);
int updateByPrimaryKeySelective(TKzyCourse record);
int updateByPrimaryKeyWithBLOBs(TKzyCourse record);
int updateByPrimaryKey(TKzyCourse record);
}
\ No newline at end of file
package com.server.web.common.mapper;
import com.server.web.common.model.TKzyInformation;
import com.server.web.common.model.TKzyInformationExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface TKzyInformationMapper {
long countByExample(TKzyInformationExample example);
int deleteByExample(TKzyInformationExample example);
int deleteByPrimaryKey(Long id);
int insert(TKzyInformation record);
int insertSelective(TKzyInformation record);
List<TKzyInformation> selectByExampleWithBLOBs(TKzyInformationExample example);
List<TKzyInformation> selectByExample(TKzyInformationExample example);
TKzyInformation selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") TKzyInformation record, @Param("example") TKzyInformationExample example);
int updateByExampleWithBLOBs(@Param("record") TKzyInformation record, @Param("example") TKzyInformationExample example);
int updateByExample(@Param("record") TKzyInformation record, @Param("example") TKzyInformationExample example);
int updateByPrimaryKeySelective(TKzyInformation record);
int updateByPrimaryKeyWithBLOBs(TKzyInformation record);
int updateByPrimaryKey(TKzyInformation record);
}
\ No newline at end of file
package com.server.web.common.mapper;
import com.server.web.common.model.TKzyRelationClass;
import com.server.web.common.model.TKzyRelationClassExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface TKzyRelationClassMapper {
long countByExample(TKzyRelationClassExample example);
int deleteByExample(TKzyRelationClassExample example);
int deleteByPrimaryKey(Long id);
int insert(TKzyRelationClass record);
int insertSelective(TKzyRelationClass record);
List<TKzyRelationClass> selectByExample(TKzyRelationClassExample example);
TKzyRelationClass selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") TKzyRelationClass record, @Param("example") TKzyRelationClassExample example);
int updateByExample(@Param("record") TKzyRelationClass record, @Param("example") TKzyRelationClassExample example);
int updateByPrimaryKeySelective(TKzyRelationClass record);
int updateByPrimaryKey(TKzyRelationClass record);
}
\ No newline at end of file
package com.server.web.common.mapper;
import com.server.web.common.model.TKzyUserIntegralFlowing;
import com.server.web.common.model.TKzyUserIntegralFlowingExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface TKzyUserIntegralFlowingMapper {
long countByExample(TKzyUserIntegralFlowingExample example);
int deleteByExample(TKzyUserIntegralFlowingExample example);
int deleteByPrimaryKey(Long id);
int insert(TKzyUserIntegralFlowing record);
int insertSelective(TKzyUserIntegralFlowing record);
List<TKzyUserIntegralFlowing> selectByExample(TKzyUserIntegralFlowingExample example);
TKzyUserIntegralFlowing selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") TKzyUserIntegralFlowing record, @Param("example") TKzyUserIntegralFlowingExample example);
int updateByExample(@Param("record") TKzyUserIntegralFlowing record, @Param("example") TKzyUserIntegralFlowingExample example);
int updateByPrimaryKeySelective(TKzyUserIntegralFlowing record);
int updateByPrimaryKey(TKzyUserIntegralFlowing record);
}
\ No newline at end of file
package com.server.web.common.mapper;
import com.server.web.common.model.TKzyUser;
import com.server.web.common.model.TKzyUserExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface TKzyUserMapper {
long countByExample(TKzyUserExample example);
int deleteByExample(TKzyUserExample example);
int deleteByPrimaryKey(Long id);
int insert(TKzyUser record);
int insertSelective(TKzyUser record);
List<TKzyUser> selectByExample(TKzyUserExample example);
TKzyUser selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") TKzyUser record, @Param("example") TKzyUserExample example);
int updateByExample(@Param("record") TKzyUser record, @Param("example") TKzyUserExample example);
int updateByPrimaryKeySelective(TKzyUser record);
int updateByPrimaryKey(TKzyUser record);
}
\ No newline at end of file
package com.server.web.common.model;
import java.io.Serializable;
public class BaseModel implements Serializable {
}
package com.server.web.common.model;
import java.util.List;
public class PageModel extends BaseModel {
private long total;
private List list;
private String name;
public void setTotal(long total) {
this.total = total;
}
public void setList(List list) {
this.list = list;
}
public void setName(String name) {
this.name = name;
}
public String getName() {
return name;
}
public long getTotal() {
return total;
}
public List getList() {
return list;
}
}
\ No newline at end of file
package com.server.web.common.model;
import java.util.Date;
public class TBaseBanner extends BaseModel {
private Long id;
private String title;
private String picUrl;
private Integer weight;
private Integer jumpType;
private String jumpAddress;
private String remark;
private Integer isDelete;
private Integer isUp;
private Date createDt;
public TBaseBanner(Long id, String title, String picUrl, Integer weight, Integer jumpType, String jumpAddress, String remark, Integer isDelete, Integer isUp, Date createDt) {
this.id = id;
this.title = title;
this.picUrl = picUrl;
this.weight = weight;
this.jumpType = jumpType;
this.jumpAddress = jumpAddress;
this.remark = remark;
this.isDelete = isDelete;
this.isUp = isUp;
this.createDt = createDt;
}
public TBaseBanner() {
super();
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title == null ? null : title.trim();
}
public String getPicUrl() {
return picUrl;
}
public void setPicUrl(String picUrl) {
this.picUrl = picUrl == null ? null : picUrl.trim();
}
public Integer getWeight() {
return weight;
}
public void setWeight(Integer weight) {
this.weight = weight;
}
public Integer getJumpType() {
return jumpType;
}
public void setJumpType(Integer jumpType) {
this.jumpType = jumpType;
}
public String getJumpAddress() {
return jumpAddress;
}
public void setJumpAddress(String jumpAddress) {
this.jumpAddress = jumpAddress == null ? null : jumpAddress.trim();
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark == null ? null : remark.trim();
}
public Integer getIsDelete() {
return isDelete;
}
public void setIsDelete(Integer isDelete) {
this.isDelete = isDelete;
}
public Integer getIsUp() {
return isUp;
}
public void setIsUp(Integer isUp) {
this.isUp = isUp;
}
public Date getCreateDt() {
return createDt;
}
public void setCreateDt(Date createDt) {
this.createDt = createDt;
}
}
\ No newline at end of file
package com.server.web.common.model;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class TBaseBannerExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public TBaseBannerExample() {
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 andTitleIsNull() {
addCriterion("title is null");
return (Criteria) this;
}
public Criteria andTitleIsNotNull() {
addCriterion("title is not null");
return (Criteria) this;
}
public Criteria andTitleEqualTo(String value) {
addCriterion("title =", value, "title");
return (Criteria) this;
}
public Criteria andTitleNotEqualTo(String value) {
addCriterion("title <>", value, "title");
return (Criteria) this;
}
public Criteria andTitleGreaterThan(String value) {
addCriterion("title >", value, "title");
return (Criteria) this;
}
public Criteria andTitleGreaterThanOrEqualTo(String value) {
addCriterion("title >=", value, "title");
return (Criteria) this;
}
public Criteria andTitleLessThan(String value) {
addCriterion("title <", value, "title");
return (Criteria) this;
}
public Criteria andTitleLessThanOrEqualTo(String value) {
addCriterion("title <=", value, "title");
return (Criteria) this;
}
public Criteria andTitleLike(String value) {
addCriterion("title like", value, "title");
return (Criteria) this;
}
public Criteria andTitleNotLike(String value) {
addCriterion("title not like", value, "title");
return (Criteria) this;
}
public Criteria andTitleIn(List<String> values) {
addCriterion("title in", values, "title");
return (Criteria) this;
}
public Criteria andTitleNotIn(List<String> values) {
addCriterion("title not in", values, "title");
return (Criteria) this;
}
public Criteria andTitleBetween(String value1, String value2) {
addCriterion("title between", value1, value2, "title");
return (Criteria) this;
}
public Criteria andTitleNotBetween(String value1, String value2) {
addCriterion("title not between", value1, value2, "title");
return (Criteria) this;
}
public Criteria andPicUrlIsNull() {
addCriterion("pic_url is null");
return (Criteria) this;
}
public Criteria andPicUrlIsNotNull() {
addCriterion("pic_url is not null");
return (Criteria) this;
}
public Criteria andPicUrlEqualTo(String value) {
addCriterion("pic_url =", value, "picUrl");
return (Criteria) this;
}
public Criteria andPicUrlNotEqualTo(String value) {
addCriterion("pic_url <>", value, "picUrl");
return (Criteria) this;
}
public Criteria andPicUrlGreaterThan(String value) {
addCriterion("pic_url >", value, "picUrl");
return (Criteria) this;
}
public Criteria andPicUrlGreaterThanOrEqualTo(String value) {
addCriterion("pic_url >=", value, "picUrl");
return (Criteria) this;
}
public Criteria andPicUrlLessThan(String value) {
addCriterion("pic_url <", value, "picUrl");
return (Criteria) this;
}
public Criteria andPicUrlLessThanOrEqualTo(String value) {
addCriterion("pic_url <=", value, "picUrl");
return (Criteria) this;
}
public Criteria andPicUrlLike(String value) {
addCriterion("pic_url like", value, "picUrl");
return (Criteria) this;
}
public Criteria andPicUrlNotLike(String value) {
addCriterion("pic_url not like", value, "picUrl");
return (Criteria) this;
}
public Criteria andPicUrlIn(List<String> values) {
addCriterion("pic_url in", values, "picUrl");
return (Criteria) this;
}
public Criteria andPicUrlNotIn(List<String> values) {
addCriterion("pic_url not in", values, "picUrl");
return (Criteria) this;
}
public Criteria andPicUrlBetween(String value1, String value2) {
addCriterion("pic_url between", value1, value2, "picUrl");
return (Criteria) this;
}
public Criteria andPicUrlNotBetween(String value1, String value2) {
addCriterion("pic_url not between", value1, value2, "picUrl");
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(Integer value) {
addCriterion("weight =", value, "weight");
return (Criteria) this;
}
public Criteria andWeightNotEqualTo(Integer value) {
addCriterion("weight <>", value, "weight");
return (Criteria) this;
}
public Criteria andWeightGreaterThan(Integer value) {
addCriterion("weight >", value, "weight");
return (Criteria) this;
}
public Criteria andWeightGreaterThanOrEqualTo(Integer value) {
addCriterion("weight >=", value, "weight");
return (Criteria) this;
}
public Criteria andWeightLessThan(Integer value) {
addCriterion("weight <", value, "weight");
return (Criteria) this;
}
public Criteria andWeightLessThanOrEqualTo(Integer value) {
addCriterion("weight <=", value, "weight");
return (Criteria) this;
}
public Criteria andWeightIn(List<Integer> values) {
addCriterion("weight in", values, "weight");
return (Criteria) this;
}
public Criteria andWeightNotIn(List<Integer> values) {
addCriterion("weight not in", values, "weight");
return (Criteria) this;
}
public Criteria andWeightBetween(Integer value1, Integer value2) {
addCriterion("weight between", value1, value2, "weight");
return (Criteria) this;
}
public Criteria andWeightNotBetween(Integer value1, Integer value2) {
addCriterion("weight not between", value1, value2, "weight");
return (Criteria) this;
}
public Criteria andJumpTypeIsNull() {
addCriterion("jump_type is null");
return (Criteria) this;
}
public Criteria andJumpTypeIsNotNull() {
addCriterion("jump_type is not null");
return (Criteria) this;
}
public Criteria andJumpTypeEqualTo(Integer value) {
addCriterion("jump_type =", value, "jumpType");
return (Criteria) this;
}
public Criteria andJumpTypeNotEqualTo(Integer value) {
addCriterion("jump_type <>", value, "jumpType");
return (Criteria) this;
}
public Criteria andJumpTypeGreaterThan(Integer value) {
addCriterion("jump_type >", value, "jumpType");
return (Criteria) this;
}
public Criteria andJumpTypeGreaterThanOrEqualTo(Integer value) {
addCriterion("jump_type >=", value, "jumpType");
return (Criteria) this;
}
public Criteria andJumpTypeLessThan(Integer value) {
addCriterion("jump_type <", value, "jumpType");
return (Criteria) this;
}
public Criteria andJumpTypeLessThanOrEqualTo(Integer value) {
addCriterion("jump_type <=", value, "jumpType");
return (Criteria) this;
}
public Criteria andJumpTypeIn(List<Integer> values) {
addCriterion("jump_type in", values, "jumpType");
return (Criteria) this;
}
public Criteria andJumpTypeNotIn(List<Integer> values) {
addCriterion("jump_type not in", values, "jumpType");
return (Criteria) this;
}
public Criteria andJumpTypeBetween(Integer value1, Integer value2) {
addCriterion("jump_type between", value1, value2, "jumpType");
return (Criteria) this;
}
public Criteria andJumpTypeNotBetween(Integer value1, Integer value2) {
addCriterion("jump_type not between", value1, value2, "jumpType");
return (Criteria) this;
}
public Criteria andJumpAddressIsNull() {
addCriterion("jump_address is null");
return (Criteria) this;
}
public Criteria andJumpAddressIsNotNull() {
addCriterion("jump_address is not null");
return (Criteria) this;
}
public Criteria andJumpAddressEqualTo(String value) {
addCriterion("jump_address =", value, "jumpAddress");
return (Criteria) this;
}
public Criteria andJumpAddressNotEqualTo(String value) {
addCriterion("jump_address <>", value, "jumpAddress");
return (Criteria) this;
}
public Criteria andJumpAddressGreaterThan(String value) {
addCriterion("jump_address >", value, "jumpAddress");
return (Criteria) this;
}
public Criteria andJumpAddressGreaterThanOrEqualTo(String value) {
addCriterion("jump_address >=", value, "jumpAddress");
return (Criteria) this;
}
public Criteria andJumpAddressLessThan(String value) {
addCriterion("jump_address <", value, "jumpAddress");
return (Criteria) this;
}
public Criteria andJumpAddressLessThanOrEqualTo(String value) {
addCriterion("jump_address <=", value, "jumpAddress");
return (Criteria) this;
}
public Criteria andJumpAddressLike(String value) {
addCriterion("jump_address like", value, "jumpAddress");
return (Criteria) this;
}
public Criteria andJumpAddressNotLike(String value) {
addCriterion("jump_address not like", value, "jumpAddress");
return (Criteria) this;
}
public Criteria andJumpAddressIn(List<String> values) {
addCriterion("jump_address in", values, "jumpAddress");
return (Criteria) this;
}
public Criteria andJumpAddressNotIn(List<String> values) {
addCriterion("jump_address not in", values, "jumpAddress");
return (Criteria) this;
}
public Criteria andJumpAddressBetween(String value1, String value2) {
addCriterion("jump_address between", value1, value2, "jumpAddress");
return (Criteria) this;
}
public Criteria andJumpAddressNotBetween(String value1, String value2) {
addCriterion("jump_address not between", value1, value2, "jumpAddress");
return (Criteria) this;
}
public Criteria andRemarkIsNull() {
addCriterion("remark is null");
return (Criteria) this;
}
public Criteria andRemarkIsNotNull() {
addCriterion("remark is not null");
return (Criteria) this;
}
public Criteria andRemarkEqualTo(String value) {
addCriterion("remark =", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkNotEqualTo(String value) {
addCriterion("remark <>", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkGreaterThan(String value) {
addCriterion("remark >", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkGreaterThanOrEqualTo(String value) {
addCriterion("remark >=", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkLessThan(String value) {
addCriterion("remark <", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkLessThanOrEqualTo(String value) {
addCriterion("remark <=", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkLike(String value) {
addCriterion("remark like", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkNotLike(String value) {
addCriterion("remark not like", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkIn(List<String> values) {
addCriterion("remark in", values, "remark");
return (Criteria) this;
}
public Criteria andRemarkNotIn(List<String> values) {
addCriterion("remark not in", values, "remark");
return (Criteria) this;
}
public Criteria andRemarkBetween(String value1, String value2) {
addCriterion("remark between", value1, value2, "remark");
return (Criteria) this;
}
public Criteria andRemarkNotBetween(String value1, String value2) {
addCriterion("remark not between", value1, value2, "remark");
return (Criteria) this;
}
public Criteria andIsDeleteIsNull() {
addCriterion("is_delete is null");
return (Criteria) this;
}
public Criteria andIsDeleteIsNotNull() {
addCriterion("is_delete is not null");
return (Criteria) this;
}
public Criteria andIsDeleteEqualTo(Integer value) {
addCriterion("is_delete =", value, "isDelete");
return (Criteria) this;
}
public Criteria andIsDeleteNotEqualTo(Integer value) {
addCriterion("is_delete <>", value, "isDelete");
return (Criteria) this;
}
public Criteria andIsDeleteGreaterThan(Integer value) {
addCriterion("is_delete >", value, "isDelete");
return (Criteria) this;
}
public Criteria andIsDeleteGreaterThanOrEqualTo(Integer value) {
addCriterion("is_delete >=", value, "isDelete");
return (Criteria) this;
}
public Criteria andIsDeleteLessThan(Integer value) {
addCriterion("is_delete <", value, "isDelete");
return (Criteria) this;
}
public Criteria andIsDeleteLessThanOrEqualTo(Integer value) {
addCriterion("is_delete <=", value, "isDelete");
return (Criteria) this;
}
public Criteria andIsDeleteIn(List<Integer> values) {
addCriterion("is_delete in", values, "isDelete");
return (Criteria) this;
}
public Criteria andIsDeleteNotIn(List<Integer> values) {
addCriterion("is_delete not in", values, "isDelete");
return (Criteria) this;
}
public Criteria andIsDeleteBetween(Integer value1, Integer value2) {
addCriterion("is_delete between", value1, value2, "isDelete");
return (Criteria) this;
}
public Criteria andIsDeleteNotBetween(Integer value1, Integer value2) {
addCriterion("is_delete not between", value1, value2, "isDelete");
return (Criteria) this;
}
public Criteria andIsUpIsNull() {
addCriterion("is_up is null");
return (Criteria) this;
}
public Criteria andIsUpIsNotNull() {
addCriterion("is_up is not null");
return (Criteria) this;
}
public Criteria andIsUpEqualTo(Integer value) {
addCriterion("is_up =", value, "isUp");
return (Criteria) this;
}
public Criteria andIsUpNotEqualTo(Integer value) {
addCriterion("is_up <>", value, "isUp");
return (Criteria) this;
}
public Criteria andIsUpGreaterThan(Integer value) {
addCriterion("is_up >", value, "isUp");
return (Criteria) this;
}
public Criteria andIsUpGreaterThanOrEqualTo(Integer value) {
addCriterion("is_up >=", value, "isUp");
return (Criteria) this;
}
public Criteria andIsUpLessThan(Integer value) {
addCriterion("is_up <", value, "isUp");
return (Criteria) this;
}
public Criteria andIsUpLessThanOrEqualTo(Integer value) {
addCriterion("is_up <=", value, "isUp");
return (Criteria) this;
}
public Criteria andIsUpIn(List<Integer> values) {
addCriterion("is_up in", values, "isUp");
return (Criteria) this;
}
public Criteria andIsUpNotIn(List<Integer> values) {
addCriterion("is_up not in", values, "isUp");
return (Criteria) this;
}
public Criteria andIsUpBetween(Integer value1, Integer value2) {
addCriterion("is_up between", value1, value2, "isUp");
return (Criteria) this;
}
public Criteria andIsUpNotBetween(Integer value1, Integer value2) {
addCriterion("is_up not between", value1, value2, "isUp");
return (Criteria) this;
}
public Criteria andCreateDtIsNull() {
addCriterion("create_dt is null");
return (Criteria) this;
}
public Criteria andCreateDtIsNotNull() {
addCriterion("create_dt is not null");
return (Criteria) this;
}
public Criteria andCreateDtEqualTo(Date value) {
addCriterion("create_dt =", value, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtNotEqualTo(Date value) {
addCriterion("create_dt <>", value, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtGreaterThan(Date value) {
addCriterion("create_dt >", value, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtGreaterThanOrEqualTo(Date value) {
addCriterion("create_dt >=", value, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtLessThan(Date value) {
addCriterion("create_dt <", value, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtLessThanOrEqualTo(Date value) {
addCriterion("create_dt <=", value, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtIn(List<Date> values) {
addCriterion("create_dt in", values, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtNotIn(List<Date> values) {
addCriterion("create_dt not in", values, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtBetween(Date value1, Date value2) {
addCriterion("create_dt between", value1, value2, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtNotBetween(Date value1, Date value2) {
addCriterion("create_dt not between", value1, value2, "createDt");
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);
}
}
}
\ No newline at end of file
package com.server.web.common.model;
import java.util.Date;
public class TBaseFirstClass extends BaseModel {
private Long id;
private String className;
private Integer status;
private String picUrl;
private Integer weight;
private Date createDt;
public TBaseFirstClass(Long id, String className, Integer status, String picUrl, Integer weight, Date createDt) {
this.id = id;
this.className = className;
this.status = status;
this.picUrl = picUrl;
this.weight = weight;
this.createDt = createDt;
}
public TBaseFirstClass() {
super();
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getClassName() {
return className;
}
public void setClassName(String className) {
this.className = className == null ? null : className.trim();
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public String getPicUrl() {
return picUrl;
}
public void setPicUrl(String picUrl) {
this.picUrl = picUrl == null ? null : picUrl.trim();
}
public Integer getWeight() {
return weight;
}
public void setWeight(Integer weight) {
this.weight = weight;
}
public Date getCreateDt() {
return createDt;
}
public void setCreateDt(Date createDt) {
this.createDt = createDt;
}
}
\ No newline at end of file
package com.server.web.common.model;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class TBaseFirstClassExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public TBaseFirstClassExample() {
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 andClassNameIsNull() {
addCriterion("class_name is null");
return (Criteria) this;
}
public Criteria andClassNameIsNotNull() {
addCriterion("class_name is not null");
return (Criteria) this;
}
public Criteria andClassNameEqualTo(String value) {
addCriterion("class_name =", value, "className");
return (Criteria) this;
}
public Criteria andClassNameNotEqualTo(String value) {
addCriterion("class_name <>", value, "className");
return (Criteria) this;
}
public Criteria andClassNameGreaterThan(String value) {
addCriterion("class_name >", value, "className");
return (Criteria) this;
}
public Criteria andClassNameGreaterThanOrEqualTo(String value) {
addCriterion("class_name >=", value, "className");
return (Criteria) this;
}
public Criteria andClassNameLessThan(String value) {
addCriterion("class_name <", value, "className");
return (Criteria) this;
}
public Criteria andClassNameLessThanOrEqualTo(String value) {
addCriterion("class_name <=", value, "className");
return (Criteria) this;
}
public Criteria andClassNameLike(String value) {
addCriterion("class_name like", value, "className");
return (Criteria) this;
}
public Criteria andClassNameNotLike(String value) {
addCriterion("class_name not like", value, "className");
return (Criteria) this;
}
public Criteria andClassNameIn(List<String> values) {
addCriterion("class_name in", values, "className");
return (Criteria) this;
}
public Criteria andClassNameNotIn(List<String> values) {
addCriterion("class_name not in", values, "className");
return (Criteria) this;
}
public Criteria andClassNameBetween(String value1, String value2) {
addCriterion("class_name between", value1, value2, "className");
return (Criteria) this;
}
public Criteria andClassNameNotBetween(String value1, String value2) {
addCriterion("class_name not between", value1, value2, "className");
return (Criteria) this;
}
public Criteria andStatusIsNull() {
addCriterion("status is null");
return (Criteria) this;
}
public Criteria andStatusIsNotNull() {
addCriterion("status is not null");
return (Criteria) this;
}
public Criteria andStatusEqualTo(Integer value) {
addCriterion("status =", value, "status");
return (Criteria) this;
}
public Criteria andStatusNotEqualTo(Integer value) {
addCriterion("status <>", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThan(Integer value) {
addCriterion("status >", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThanOrEqualTo(Integer value) {
addCriterion("status >=", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThan(Integer value) {
addCriterion("status <", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThanOrEqualTo(Integer value) {
addCriterion("status <=", value, "status");
return (Criteria) this;
}
public Criteria andStatusIn(List<Integer> values) {
addCriterion("status in", values, "status");
return (Criteria) this;
}
public Criteria andStatusNotIn(List<Integer> values) {
addCriterion("status not in", values, "status");
return (Criteria) this;
}
public Criteria andStatusBetween(Integer value1, Integer value2) {
addCriterion("status between", value1, value2, "status");
return (Criteria) this;
}
public Criteria andStatusNotBetween(Integer value1, Integer value2) {
addCriterion("status not between", value1, value2, "status");
return (Criteria) this;
}
public Criteria andPicUrlIsNull() {
addCriterion("pic_url is null");
return (Criteria) this;
}
public Criteria andPicUrlIsNotNull() {
addCriterion("pic_url is not null");
return (Criteria) this;
}
public Criteria andPicUrlEqualTo(String value) {
addCriterion("pic_url =", value, "picUrl");
return (Criteria) this;
}
public Criteria andPicUrlNotEqualTo(String value) {
addCriterion("pic_url <>", value, "picUrl");
return (Criteria) this;
}
public Criteria andPicUrlGreaterThan(String value) {
addCriterion("pic_url >", value, "picUrl");
return (Criteria) this;
}
public Criteria andPicUrlGreaterThanOrEqualTo(String value) {
addCriterion("pic_url >=", value, "picUrl");
return (Criteria) this;
}
public Criteria andPicUrlLessThan(String value) {
addCriterion("pic_url <", value, "picUrl");
return (Criteria) this;
}
public Criteria andPicUrlLessThanOrEqualTo(String value) {
addCriterion("pic_url <=", value, "picUrl");
return (Criteria) this;
}
public Criteria andPicUrlLike(String value) {
addCriterion("pic_url like", value, "picUrl");
return (Criteria) this;
}
public Criteria andPicUrlNotLike(String value) {
addCriterion("pic_url not like", value, "picUrl");
return (Criteria) this;
}
public Criteria andPicUrlIn(List<String> values) {
addCriterion("pic_url in", values, "picUrl");
return (Criteria) this;
}
public Criteria andPicUrlNotIn(List<String> values) {
addCriterion("pic_url not in", values, "picUrl");
return (Criteria) this;
}
public Criteria andPicUrlBetween(String value1, String value2) {
addCriterion("pic_url between", value1, value2, "picUrl");
return (Criteria) this;
}
public Criteria andPicUrlNotBetween(String value1, String value2) {
addCriterion("pic_url not between", value1, value2, "picUrl");
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(Integer value) {
addCriterion("weight =", value, "weight");
return (Criteria) this;
}
public Criteria andWeightNotEqualTo(Integer value) {
addCriterion("weight <>", value, "weight");
return (Criteria) this;
}
public Criteria andWeightGreaterThan(Integer value) {
addCriterion("weight >", value, "weight");
return (Criteria) this;
}
public Criteria andWeightGreaterThanOrEqualTo(Integer value) {
addCriterion("weight >=", value, "weight");
return (Criteria) this;
}
public Criteria andWeightLessThan(Integer value) {
addCriterion("weight <", value, "weight");
return (Criteria) this;
}
public Criteria andWeightLessThanOrEqualTo(Integer value) {
addCriterion("weight <=", value, "weight");
return (Criteria) this;
}
public Criteria andWeightIn(List<Integer> values) {
addCriterion("weight in", values, "weight");
return (Criteria) this;
}
public Criteria andWeightNotIn(List<Integer> values) {
addCriterion("weight not in", values, "weight");
return (Criteria) this;
}
public Criteria andWeightBetween(Integer value1, Integer value2) {
addCriterion("weight between", value1, value2, "weight");
return (Criteria) this;
}
public Criteria andWeightNotBetween(Integer value1, Integer value2) {
addCriterion("weight not between", value1, value2, "weight");
return (Criteria) this;
}
public Criteria andCreateDtIsNull() {
addCriterion("create_dt is null");
return (Criteria) this;
}
public Criteria andCreateDtIsNotNull() {
addCriterion("create_dt is not null");
return (Criteria) this;
}
public Criteria andCreateDtEqualTo(Date value) {
addCriterion("create_dt =", value, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtNotEqualTo(Date value) {
addCriterion("create_dt <>", value, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtGreaterThan(Date value) {
addCriterion("create_dt >", value, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtGreaterThanOrEqualTo(Date value) {
addCriterion("create_dt >=", value, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtLessThan(Date value) {
addCriterion("create_dt <", value, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtLessThanOrEqualTo(Date value) {
addCriterion("create_dt <=", value, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtIn(List<Date> values) {
addCriterion("create_dt in", values, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtNotIn(List<Date> values) {
addCriterion("create_dt not in", values, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtBetween(Date value1, Date value2) {
addCriterion("create_dt between", value1, value2, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtNotBetween(Date value1, Date value2) {
addCriterion("create_dt not between", value1, value2, "createDt");
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);
}
}
}
\ No newline at end of file
package com.server.web.common.model;
import java.util.Date;
public class TBaseSecondClass extends BaseModel {
private Long id;
private String className;
private Integer status;
private Integer type;
private String picUrl;
private Long firstId;
private Integer weight;
private Date createDt;
public TBaseSecondClass(Long id, String className, Integer status, Integer type, String picUrl, Long firstId, Integer weight, Date createDt) {
this.id = id;
this.className = className;
this.status = status;
this.type = type;
this.picUrl = picUrl;
this.firstId = firstId;
this.weight = weight;
this.createDt = createDt;
}
public TBaseSecondClass() {
super();
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getClassName() {
return className;
}
public void setClassName(String className) {
this.className = className == null ? null : className.trim();
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public String getPicUrl() {
return picUrl;
}
public void setPicUrl(String picUrl) {
this.picUrl = picUrl == null ? null : picUrl.trim();
}
public Long getFirstId() {
return firstId;
}
public void setFirstId(Long firstId) {
this.firstId = firstId;
}
public Integer getWeight() {
return weight;
}
public void setWeight(Integer weight) {
this.weight = weight;
}
public Date getCreateDt() {
return createDt;
}
public void setCreateDt(Date createDt) {
this.createDt = createDt;
}
}
\ No newline at end of file
package com.server.web.common.model;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class TBaseSecondClassExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public TBaseSecondClassExample() {
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 andClassNameIsNull() {
addCriterion("class_name is null");
return (Criteria) this;
}
public Criteria andClassNameIsNotNull() {
addCriterion("class_name is not null");
return (Criteria) this;
}
public Criteria andClassNameEqualTo(String value) {
addCriterion("class_name =", value, "className");
return (Criteria) this;
}
public Criteria andClassNameNotEqualTo(String value) {
addCriterion("class_name <>", value, "className");
return (Criteria) this;
}
public Criteria andClassNameGreaterThan(String value) {
addCriterion("class_name >", value, "className");
return (Criteria) this;
}
public Criteria andClassNameGreaterThanOrEqualTo(String value) {
addCriterion("class_name >=", value, "className");
return (Criteria) this;
}
public Criteria andClassNameLessThan(String value) {
addCriterion("class_name <", value, "className");
return (Criteria) this;
}
public Criteria andClassNameLessThanOrEqualTo(String value) {
addCriterion("class_name <=", value, "className");
return (Criteria) this;
}
public Criteria andClassNameLike(String value) {
addCriterion("class_name like", value, "className");
return (Criteria) this;
}
public Criteria andClassNameNotLike(String value) {
addCriterion("class_name not like", value, "className");
return (Criteria) this;
}
public Criteria andClassNameIn(List<String> values) {
addCriterion("class_name in", values, "className");
return (Criteria) this;
}
public Criteria andClassNameNotIn(List<String> values) {
addCriterion("class_name not in", values, "className");
return (Criteria) this;
}
public Criteria andClassNameBetween(String value1, String value2) {
addCriterion("class_name between", value1, value2, "className");
return (Criteria) this;
}
public Criteria andClassNameNotBetween(String value1, String value2) {
addCriterion("class_name not between", value1, value2, "className");
return (Criteria) this;
}
public Criteria andStatusIsNull() {
addCriterion("status is null");
return (Criteria) this;
}
public Criteria andStatusIsNotNull() {
addCriterion("status is not null");
return (Criteria) this;
}
public Criteria andStatusEqualTo(Integer value) {
addCriterion("status =", value, "status");
return (Criteria) this;
}
public Criteria andStatusNotEqualTo(Integer value) {
addCriterion("status <>", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThan(Integer value) {
addCriterion("status >", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThanOrEqualTo(Integer value) {
addCriterion("status >=", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThan(Integer value) {
addCriterion("status <", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThanOrEqualTo(Integer value) {
addCriterion("status <=", value, "status");
return (Criteria) this;
}
public Criteria andStatusIn(List<Integer> values) {
addCriterion("status in", values, "status");
return (Criteria) this;
}
public Criteria andStatusNotIn(List<Integer> values) {
addCriterion("status not in", values, "status");
return (Criteria) this;
}
public Criteria andStatusBetween(Integer value1, Integer value2) {
addCriterion("status between", value1, value2, "status");
return (Criteria) this;
}
public Criteria andStatusNotBetween(Integer value1, Integer value2) {
addCriterion("status not between", value1, value2, "status");
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(Integer value) {
addCriterion("type =", value, "type");
return (Criteria) this;
}
public Criteria andTypeNotEqualTo(Integer value) {
addCriterion("type <>", value, "type");
return (Criteria) this;
}
public Criteria andTypeGreaterThan(Integer value) {
addCriterion("type >", value, "type");
return (Criteria) this;
}
public Criteria andTypeGreaterThanOrEqualTo(Integer value) {
addCriterion("type >=", value, "type");
return (Criteria) this;
}
public Criteria andTypeLessThan(Integer value) {
addCriterion("type <", value, "type");
return (Criteria) this;
}
public Criteria andTypeLessThanOrEqualTo(Integer value) {
addCriterion("type <=", value, "type");
return (Criteria) this;
}
public Criteria andTypeIn(List<Integer> values) {
addCriterion("type in", values, "type");
return (Criteria) this;
}
public Criteria andTypeNotIn(List<Integer> values) {
addCriterion("type not in", values, "type");
return (Criteria) this;
}
public Criteria andTypeBetween(Integer value1, Integer value2) {
addCriterion("type between", value1, value2, "type");
return (Criteria) this;
}
public Criteria andTypeNotBetween(Integer value1, Integer value2) {
addCriterion("type not between", value1, value2, "type");
return (Criteria) this;
}
public Criteria andPicUrlIsNull() {
addCriterion("pic_url is null");
return (Criteria) this;
}
public Criteria andPicUrlIsNotNull() {
addCriterion("pic_url is not null");
return (Criteria) this;
}
public Criteria andPicUrlEqualTo(String value) {
addCriterion("pic_url =", value, "picUrl");
return (Criteria) this;
}
public Criteria andPicUrlNotEqualTo(String value) {
addCriterion("pic_url <>", value, "picUrl");
return (Criteria) this;
}
public Criteria andPicUrlGreaterThan(String value) {
addCriterion("pic_url >", value, "picUrl");
return (Criteria) this;
}
public Criteria andPicUrlGreaterThanOrEqualTo(String value) {
addCriterion("pic_url >=", value, "picUrl");
return (Criteria) this;
}
public Criteria andPicUrlLessThan(String value) {
addCriterion("pic_url <", value, "picUrl");
return (Criteria) this;
}
public Criteria andPicUrlLessThanOrEqualTo(String value) {
addCriterion("pic_url <=", value, "picUrl");
return (Criteria) this;
}
public Criteria andPicUrlLike(String value) {
addCriterion("pic_url like", value, "picUrl");
return (Criteria) this;
}
public Criteria andPicUrlNotLike(String value) {
addCriterion("pic_url not like", value, "picUrl");
return (Criteria) this;
}
public Criteria andPicUrlIn(List<String> values) {
addCriterion("pic_url in", values, "picUrl");
return (Criteria) this;
}
public Criteria andPicUrlNotIn(List<String> values) {
addCriterion("pic_url not in", values, "picUrl");
return (Criteria) this;
}
public Criteria andPicUrlBetween(String value1, String value2) {
addCriterion("pic_url between", value1, value2, "picUrl");
return (Criteria) this;
}
public Criteria andPicUrlNotBetween(String value1, String value2) {
addCriterion("pic_url not between", value1, value2, "picUrl");
return (Criteria) this;
}
public Criteria andFirstIdIsNull() {
addCriterion("first_id is null");
return (Criteria) this;
}
public Criteria andFirstIdIsNotNull() {
addCriterion("first_id is not null");
return (Criteria) this;
}
public Criteria andFirstIdEqualTo(Long value) {
addCriterion("first_id =", value, "firstId");
return (Criteria) this;
}
public Criteria andFirstIdNotEqualTo(Long value) {
addCriterion("first_id <>", value, "firstId");
return (Criteria) this;
}
public Criteria andFirstIdGreaterThan(Long value) {
addCriterion("first_id >", value, "firstId");
return (Criteria) this;
}
public Criteria andFirstIdGreaterThanOrEqualTo(Long value) {
addCriterion("first_id >=", value, "firstId");
return (Criteria) this;
}
public Criteria andFirstIdLessThan(Long value) {
addCriterion("first_id <", value, "firstId");
return (Criteria) this;
}
public Criteria andFirstIdLessThanOrEqualTo(Long value) {
addCriterion("first_id <=", value, "firstId");
return (Criteria) this;
}
public Criteria andFirstIdIn(List<Long> values) {
addCriterion("first_id in", values, "firstId");
return (Criteria) this;
}
public Criteria andFirstIdNotIn(List<Long> values) {
addCriterion("first_id not in", values, "firstId");
return (Criteria) this;
}
public Criteria andFirstIdBetween(Long value1, Long value2) {
addCriterion("first_id between", value1, value2, "firstId");
return (Criteria) this;
}
public Criteria andFirstIdNotBetween(Long value1, Long value2) {
addCriterion("first_id not between", value1, value2, "firstId");
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(Integer value) {
addCriterion("weight =", value, "weight");
return (Criteria) this;
}
public Criteria andWeightNotEqualTo(Integer value) {
addCriterion("weight <>", value, "weight");
return (Criteria) this;
}
public Criteria andWeightGreaterThan(Integer value) {
addCriterion("weight >", value, "weight");
return (Criteria) this;
}
public Criteria andWeightGreaterThanOrEqualTo(Integer value) {
addCriterion("weight >=", value, "weight");
return (Criteria) this;
}
public Criteria andWeightLessThan(Integer value) {
addCriterion("weight <", value, "weight");
return (Criteria) this;
}
public Criteria andWeightLessThanOrEqualTo(Integer value) {
addCriterion("weight <=", value, "weight");
return (Criteria) this;
}
public Criteria andWeightIn(List<Integer> values) {
addCriterion("weight in", values, "weight");
return (Criteria) this;
}
public Criteria andWeightNotIn(List<Integer> values) {
addCriterion("weight not in", values, "weight");
return (Criteria) this;
}
public Criteria andWeightBetween(Integer value1, Integer value2) {
addCriterion("weight between", value1, value2, "weight");
return (Criteria) this;
}
public Criteria andWeightNotBetween(Integer value1, Integer value2) {
addCriterion("weight not between", value1, value2, "weight");
return (Criteria) this;
}
public Criteria andCreateDtIsNull() {
addCriterion("create_dt is null");
return (Criteria) this;
}
public Criteria andCreateDtIsNotNull() {
addCriterion("create_dt is not null");
return (Criteria) this;
}
public Criteria andCreateDtEqualTo(Date value) {
addCriterion("create_dt =", value, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtNotEqualTo(Date value) {
addCriterion("create_dt <>", value, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtGreaterThan(Date value) {
addCriterion("create_dt >", value, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtGreaterThanOrEqualTo(Date value) {
addCriterion("create_dt >=", value, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtLessThan(Date value) {
addCriterion("create_dt <", value, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtLessThanOrEqualTo(Date value) {
addCriterion("create_dt <=", value, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtIn(List<Date> values) {
addCriterion("create_dt in", values, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtNotIn(List<Date> values) {
addCriterion("create_dt not in", values, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtBetween(Date value1, Date value2) {
addCriterion("create_dt between", value1, value2, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtNotBetween(Date value1, Date value2) {
addCriterion("create_dt not between", value1, value2, "createDt");
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);
}
}
}
\ No newline at end of file
package com.server.web.common.model;
import java.util.Date;
public class TKzyComment extends BaseModel {
private Long id;
private Long userId;
private Long relationId;
private Integer type;
private String replyContent;
private Integer isDelete;
private Integer authStatus;
private Date authDt;
private Date createDt;
public TKzyComment(Long id, Long userId, Long relationId, Integer type, String replyContent, Integer isDelete, Integer authStatus, Date authDt, Date createDt) {
this.id = id;
this.userId = userId;
this.relationId = relationId;
this.type = type;
this.replyContent = replyContent;
this.isDelete = isDelete;
this.authStatus = authStatus;
this.authDt = authDt;
this.createDt = createDt;
}
public TKzyComment() {
super();
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public Long getRelationId() {
return relationId;
}
public void setRelationId(Long relationId) {
this.relationId = relationId;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public String getReplyContent() {
return replyContent;
}
public void setReplyContent(String replyContent) {
this.replyContent = replyContent == null ? null : replyContent.trim();
}
public Integer getIsDelete() {
return isDelete;
}
public void setIsDelete(Integer isDelete) {
this.isDelete = isDelete;
}
public Integer getAuthStatus() {
return authStatus;
}
public void setAuthStatus(Integer authStatus) {
this.authStatus = authStatus;
}
public Date getAuthDt() {
return authDt;
}
public void setAuthDt(Date authDt) {
this.authDt = authDt;
}
public Date getCreateDt() {
return createDt;
}
public void setCreateDt(Date createDt) {
this.createDt = createDt;
}
}
\ No newline at end of file
package com.server.web.common.model;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class TKzyCommentExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public TKzyCommentExample() {
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 andUserIdIsNull() {
addCriterion("user_id is null");
return (Criteria) this;
}
public Criteria andUserIdIsNotNull() {
addCriterion("user_id is not null");
return (Criteria) this;
}
public Criteria andUserIdEqualTo(Long value) {
addCriterion("user_id =", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotEqualTo(Long value) {
addCriterion("user_id <>", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdGreaterThan(Long value) {
addCriterion("user_id >", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdGreaterThanOrEqualTo(Long value) {
addCriterion("user_id >=", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLessThan(Long value) {
addCriterion("user_id <", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLessThanOrEqualTo(Long value) {
addCriterion("user_id <=", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdIn(List<Long> values) {
addCriterion("user_id in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotIn(List<Long> values) {
addCriterion("user_id not in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdBetween(Long value1, Long value2) {
addCriterion("user_id between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotBetween(Long value1, Long value2) {
addCriterion("user_id not between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andRelationIdIsNull() {
addCriterion("relation_id is null");
return (Criteria) this;
}
public Criteria andRelationIdIsNotNull() {
addCriterion("relation_id is not null");
return (Criteria) this;
}
public Criteria andRelationIdEqualTo(Long value) {
addCriterion("relation_id =", value, "relationId");
return (Criteria) this;
}
public Criteria andRelationIdNotEqualTo(Long value) {
addCriterion("relation_id <>", value, "relationId");
return (Criteria) this;
}
public Criteria andRelationIdGreaterThan(Long value) {
addCriterion("relation_id >", value, "relationId");
return (Criteria) this;
}
public Criteria andRelationIdGreaterThanOrEqualTo(Long value) {
addCriterion("relation_id >=", value, "relationId");
return (Criteria) this;
}
public Criteria andRelationIdLessThan(Long value) {
addCriterion("relation_id <", value, "relationId");
return (Criteria) this;
}
public Criteria andRelationIdLessThanOrEqualTo(Long value) {
addCriterion("relation_id <=", value, "relationId");
return (Criteria) this;
}
public Criteria andRelationIdIn(List<Long> values) {
addCriterion("relation_id in", values, "relationId");
return (Criteria) this;
}
public Criteria andRelationIdNotIn(List<Long> values) {
addCriterion("relation_id not in", values, "relationId");
return (Criteria) this;
}
public Criteria andRelationIdBetween(Long value1, Long value2) {
addCriterion("relation_id between", value1, value2, "relationId");
return (Criteria) this;
}
public Criteria andRelationIdNotBetween(Long value1, Long value2) {
addCriterion("relation_id not between", value1, value2, "relationId");
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(Integer value) {
addCriterion("type =", value, "type");
return (Criteria) this;
}
public Criteria andTypeNotEqualTo(Integer value) {
addCriterion("type <>", value, "type");
return (Criteria) this;
}
public Criteria andTypeGreaterThan(Integer value) {
addCriterion("type >", value, "type");
return (Criteria) this;
}
public Criteria andTypeGreaterThanOrEqualTo(Integer value) {
addCriterion("type >=", value, "type");
return (Criteria) this;
}
public Criteria andTypeLessThan(Integer value) {
addCriterion("type <", value, "type");
return (Criteria) this;
}
public Criteria andTypeLessThanOrEqualTo(Integer value) {
addCriterion("type <=", value, "type");
return (Criteria) this;
}
public Criteria andTypeIn(List<Integer> values) {
addCriterion("type in", values, "type");
return (Criteria) this;
}
public Criteria andTypeNotIn(List<Integer> values) {
addCriterion("type not in", values, "type");
return (Criteria) this;
}
public Criteria andTypeBetween(Integer value1, Integer value2) {
addCriterion("type between", value1, value2, "type");
return (Criteria) this;
}
public Criteria andTypeNotBetween(Integer value1, Integer value2) {
addCriterion("type not between", value1, value2, "type");
return (Criteria) this;
}
public Criteria andReplyContentIsNull() {
addCriterion("reply_content is null");
return (Criteria) this;
}
public Criteria andReplyContentIsNotNull() {
addCriterion("reply_content is not null");
return (Criteria) this;
}
public Criteria andReplyContentEqualTo(String value) {
addCriterion("reply_content =", value, "replyContent");
return (Criteria) this;
}
public Criteria andReplyContentNotEqualTo(String value) {
addCriterion("reply_content <>", value, "replyContent");
return (Criteria) this;
}
public Criteria andReplyContentGreaterThan(String value) {
addCriterion("reply_content >", value, "replyContent");
return (Criteria) this;
}
public Criteria andReplyContentGreaterThanOrEqualTo(String value) {
addCriterion("reply_content >=", value, "replyContent");
return (Criteria) this;
}
public Criteria andReplyContentLessThan(String value) {
addCriterion("reply_content <", value, "replyContent");
return (Criteria) this;
}
public Criteria andReplyContentLessThanOrEqualTo(String value) {
addCriterion("reply_content <=", value, "replyContent");
return (Criteria) this;
}
public Criteria andReplyContentLike(String value) {
addCriterion("reply_content like", value, "replyContent");
return (Criteria) this;
}
public Criteria andReplyContentNotLike(String value) {
addCriterion("reply_content not like", value, "replyContent");
return (Criteria) this;
}
public Criteria andReplyContentIn(List<String> values) {
addCriterion("reply_content in", values, "replyContent");
return (Criteria) this;
}
public Criteria andReplyContentNotIn(List<String> values) {
addCriterion("reply_content not in", values, "replyContent");
return (Criteria) this;
}
public Criteria andReplyContentBetween(String value1, String value2) {
addCriterion("reply_content between", value1, value2, "replyContent");
return (Criteria) this;
}
public Criteria andReplyContentNotBetween(String value1, String value2) {
addCriterion("reply_content not between", value1, value2, "replyContent");
return (Criteria) this;
}
public Criteria andIsDeleteIsNull() {
addCriterion("is_delete is null");
return (Criteria) this;
}
public Criteria andIsDeleteIsNotNull() {
addCriterion("is_delete is not null");
return (Criteria) this;
}
public Criteria andIsDeleteEqualTo(Integer value) {
addCriterion("is_delete =", value, "isDelete");
return (Criteria) this;
}
public Criteria andIsDeleteNotEqualTo(Integer value) {
addCriterion("is_delete <>", value, "isDelete");
return (Criteria) this;
}
public Criteria andIsDeleteGreaterThan(Integer value) {
addCriterion("is_delete >", value, "isDelete");
return (Criteria) this;
}
public Criteria andIsDeleteGreaterThanOrEqualTo(Integer value) {
addCriterion("is_delete >=", value, "isDelete");
return (Criteria) this;
}
public Criteria andIsDeleteLessThan(Integer value) {
addCriterion("is_delete <", value, "isDelete");
return (Criteria) this;
}
public Criteria andIsDeleteLessThanOrEqualTo(Integer value) {
addCriterion("is_delete <=", value, "isDelete");
return (Criteria) this;
}
public Criteria andIsDeleteIn(List<Integer> values) {
addCriterion("is_delete in", values, "isDelete");
return (Criteria) this;
}
public Criteria andIsDeleteNotIn(List<Integer> values) {
addCriterion("is_delete not in", values, "isDelete");
return (Criteria) this;
}
public Criteria andIsDeleteBetween(Integer value1, Integer value2) {
addCriterion("is_delete between", value1, value2, "isDelete");
return (Criteria) this;
}
public Criteria andIsDeleteNotBetween(Integer value1, Integer value2) {
addCriterion("is_delete not between", value1, value2, "isDelete");
return (Criteria) this;
}
public Criteria andAuthStatusIsNull() {
addCriterion("auth_status is null");
return (Criteria) this;
}
public Criteria andAuthStatusIsNotNull() {
addCriterion("auth_status is not null");
return (Criteria) this;
}
public Criteria andAuthStatusEqualTo(Integer value) {
addCriterion("auth_status =", value, "authStatus");
return (Criteria) this;
}
public Criteria andAuthStatusNotEqualTo(Integer value) {
addCriterion("auth_status <>", value, "authStatus");
return (Criteria) this;
}
public Criteria andAuthStatusGreaterThan(Integer value) {
addCriterion("auth_status >", value, "authStatus");
return (Criteria) this;
}
public Criteria andAuthStatusGreaterThanOrEqualTo(Integer value) {
addCriterion("auth_status >=", value, "authStatus");
return (Criteria) this;
}
public Criteria andAuthStatusLessThan(Integer value) {
addCriterion("auth_status <", value, "authStatus");
return (Criteria) this;
}
public Criteria andAuthStatusLessThanOrEqualTo(Integer value) {
addCriterion("auth_status <=", value, "authStatus");
return (Criteria) this;
}
public Criteria andAuthStatusIn(List<Integer> values) {
addCriterion("auth_status in", values, "authStatus");
return (Criteria) this;
}
public Criteria andAuthStatusNotIn(List<Integer> values) {
addCriterion("auth_status not in", values, "authStatus");
return (Criteria) this;
}
public Criteria andAuthStatusBetween(Integer value1, Integer value2) {
addCriterion("auth_status between", value1, value2, "authStatus");
return (Criteria) this;
}
public Criteria andAuthStatusNotBetween(Integer value1, Integer value2) {
addCriterion("auth_status not between", value1, value2, "authStatus");
return (Criteria) this;
}
public Criteria andAuthDtIsNull() {
addCriterion("auth_dt is null");
return (Criteria) this;
}
public Criteria andAuthDtIsNotNull() {
addCriterion("auth_dt is not null");
return (Criteria) this;
}
public Criteria andAuthDtEqualTo(Date value) {
addCriterion("auth_dt =", value, "authDt");
return (Criteria) this;
}
public Criteria andAuthDtNotEqualTo(Date value) {
addCriterion("auth_dt <>", value, "authDt");
return (Criteria) this;
}
public Criteria andAuthDtGreaterThan(Date value) {
addCriterion("auth_dt >", value, "authDt");
return (Criteria) this;
}
public Criteria andAuthDtGreaterThanOrEqualTo(Date value) {
addCriterion("auth_dt >=", value, "authDt");
return (Criteria) this;
}
public Criteria andAuthDtLessThan(Date value) {
addCriterion("auth_dt <", value, "authDt");
return (Criteria) this;
}
public Criteria andAuthDtLessThanOrEqualTo(Date value) {
addCriterion("auth_dt <=", value, "authDt");
return (Criteria) this;
}
public Criteria andAuthDtIn(List<Date> values) {
addCriterion("auth_dt in", values, "authDt");
return (Criteria) this;
}
public Criteria andAuthDtNotIn(List<Date> values) {
addCriterion("auth_dt not in", values, "authDt");
return (Criteria) this;
}
public Criteria andAuthDtBetween(Date value1, Date value2) {
addCriterion("auth_dt between", value1, value2, "authDt");
return (Criteria) this;
}
public Criteria andAuthDtNotBetween(Date value1, Date value2) {
addCriterion("auth_dt not between", value1, value2, "authDt");
return (Criteria) this;
}
public Criteria andCreateDtIsNull() {
addCriterion("create_dt is null");
return (Criteria) this;
}
public Criteria andCreateDtIsNotNull() {
addCriterion("create_dt is not null");
return (Criteria) this;
}
public Criteria andCreateDtEqualTo(Date value) {
addCriterion("create_dt =", value, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtNotEqualTo(Date value) {
addCriterion("create_dt <>", value, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtGreaterThan(Date value) {
addCriterion("create_dt >", value, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtGreaterThanOrEqualTo(Date value) {
addCriterion("create_dt >=", value, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtLessThan(Date value) {
addCriterion("create_dt <", value, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtLessThanOrEqualTo(Date value) {
addCriterion("create_dt <=", value, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtIn(List<Date> values) {
addCriterion("create_dt in", values, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtNotIn(List<Date> values) {
addCriterion("create_dt not in", values, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtBetween(Date value1, Date value2) {
addCriterion("create_dt between", value1, value2, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtNotBetween(Date value1, Date value2) {
addCriterion("create_dt not between", value1, value2, "createDt");
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);
}
}
}
\ No newline at end of file
package com.server.web.common.model;
import java.util.Date;
public class TKzyCourse extends BaseModel {
private Long id;
private String courseName;
private String picUrl;
private Date startDt;
private Date endDt;
private Integer weight;
private String liveUrl;
private Integer courseType;
private Integer isUp;
private Long editorId;
private String editorName;
private Integer isDelete;
private Date createDt;
private Date updateDt;
private String courseIntroduce;
public TKzyCourse(Long id, String courseName, String picUrl, Date startDt, Date endDt, Integer weight, String liveUrl, Integer courseType, Integer isUp, Long editorId, String editorName, Integer isDelete, Date createDt, Date updateDt, String courseIntroduce) {
this.id = id;
this.courseName = courseName;
this.picUrl = picUrl;
this.startDt = startDt;
this.endDt = endDt;
this.weight = weight;
this.liveUrl = liveUrl;
this.courseType = courseType;
this.isUp = isUp;
this.editorId = editorId;
this.editorName = editorName;
this.isDelete = isDelete;
this.createDt = createDt;
this.updateDt = updateDt;
this.courseIntroduce = courseIntroduce;
}
public TKzyCourse() {
super();
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getCourseName() {
return courseName;
}
public void setCourseName(String courseName) {
this.courseName = courseName == null ? null : courseName.trim();
}
public String getPicUrl() {
return picUrl;
}
public void setPicUrl(String picUrl) {
this.picUrl = picUrl == null ? null : picUrl.trim();
}
public Date getStartDt() {
return startDt;
}
public void setStartDt(Date startDt) {
this.startDt = startDt;
}
public Date getEndDt() {
return endDt;
}
public void setEndDt(Date endDt) {
this.endDt = endDt;
}
public Integer getWeight() {
return weight;
}
public void setWeight(Integer weight) {
this.weight = weight;
}
public String getLiveUrl() {
return liveUrl;
}
public void setLiveUrl(String liveUrl) {
this.liveUrl = liveUrl == null ? null : liveUrl.trim();
}
public Integer getCourseType() {
return courseType;
}
public void setCourseType(Integer courseType) {
this.courseType = courseType;
}
public Integer getIsUp() {
return isUp;
}
public void setIsUp(Integer isUp) {
this.isUp = isUp;
}
public Long getEditorId() {
return editorId;
}
public void setEditorId(Long editorId) {
this.editorId = editorId;
}
public String getEditorName() {
return editorName;
}
public void setEditorName(String editorName) {
this.editorName = editorName == null ? null : editorName.trim();
}
public Integer getIsDelete() {
return isDelete;
}
public void setIsDelete(Integer isDelete) {
this.isDelete = isDelete;
}
public Date getCreateDt() {
return createDt;
}
public void setCreateDt(Date createDt) {
this.createDt = createDt;
}
public Date getUpdateDt() {
return updateDt;
}
public void setUpdateDt(Date updateDt) {
this.updateDt = updateDt;
}
public String getCourseIntroduce() {
return courseIntroduce;
}
public void setCourseIntroduce(String courseIntroduce) {
this.courseIntroduce = courseIntroduce == null ? null : courseIntroduce.trim();
}
}
\ No newline at end of file
package com.server.web.common.model;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class TKzyCourseExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public TKzyCourseExample() {
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 andCourseNameIsNull() {
addCriterion("course_name is null");
return (Criteria) this;
}
public Criteria andCourseNameIsNotNull() {
addCriterion("course_name is not null");
return (Criteria) this;
}
public Criteria andCourseNameEqualTo(String value) {
addCriterion("course_name =", value, "courseName");
return (Criteria) this;
}
public Criteria andCourseNameNotEqualTo(String value) {
addCriterion("course_name <>", value, "courseName");
return (Criteria) this;
}
public Criteria andCourseNameGreaterThan(String value) {
addCriterion("course_name >", value, "courseName");
return (Criteria) this;
}
public Criteria andCourseNameGreaterThanOrEqualTo(String value) {
addCriterion("course_name >=", value, "courseName");
return (Criteria) this;
}
public Criteria andCourseNameLessThan(String value) {
addCriterion("course_name <", value, "courseName");
return (Criteria) this;
}
public Criteria andCourseNameLessThanOrEqualTo(String value) {
addCriterion("course_name <=", value, "courseName");
return (Criteria) this;
}
public Criteria andCourseNameLike(String value) {
addCriterion("course_name like", value, "courseName");
return (Criteria) this;
}
public Criteria andCourseNameNotLike(String value) {
addCriterion("course_name not like", value, "courseName");
return (Criteria) this;
}
public Criteria andCourseNameIn(List<String> values) {
addCriterion("course_name in", values, "courseName");
return (Criteria) this;
}
public Criteria andCourseNameNotIn(List<String> values) {
addCriterion("course_name not in", values, "courseName");
return (Criteria) this;
}
public Criteria andCourseNameBetween(String value1, String value2) {
addCriterion("course_name between", value1, value2, "courseName");
return (Criteria) this;
}
public Criteria andCourseNameNotBetween(String value1, String value2) {
addCriterion("course_name not between", value1, value2, "courseName");
return (Criteria) this;
}
public Criteria andPicUrlIsNull() {
addCriterion("pic_url is null");
return (Criteria) this;
}
public Criteria andPicUrlIsNotNull() {
addCriterion("pic_url is not null");
return (Criteria) this;
}
public Criteria andPicUrlEqualTo(String value) {
addCriterion("pic_url =", value, "picUrl");
return (Criteria) this;
}
public Criteria andPicUrlNotEqualTo(String value) {
addCriterion("pic_url <>", value, "picUrl");
return (Criteria) this;
}
public Criteria andPicUrlGreaterThan(String value) {
addCriterion("pic_url >", value, "picUrl");
return (Criteria) this;
}
public Criteria andPicUrlGreaterThanOrEqualTo(String value) {
addCriterion("pic_url >=", value, "picUrl");
return (Criteria) this;
}
public Criteria andPicUrlLessThan(String value) {
addCriterion("pic_url <", value, "picUrl");
return (Criteria) this;
}
public Criteria andPicUrlLessThanOrEqualTo(String value) {
addCriterion("pic_url <=", value, "picUrl");
return (Criteria) this;
}
public Criteria andPicUrlLike(String value) {
addCriterion("pic_url like", value, "picUrl");
return (Criteria) this;
}
public Criteria andPicUrlNotLike(String value) {
addCriterion("pic_url not like", value, "picUrl");
return (Criteria) this;
}
public Criteria andPicUrlIn(List<String> values) {
addCriterion("pic_url in", values, "picUrl");
return (Criteria) this;
}
public Criteria andPicUrlNotIn(List<String> values) {
addCriterion("pic_url not in", values, "picUrl");
return (Criteria) this;
}
public Criteria andPicUrlBetween(String value1, String value2) {
addCriterion("pic_url between", value1, value2, "picUrl");
return (Criteria) this;
}
public Criteria andPicUrlNotBetween(String value1, String value2) {
addCriterion("pic_url not between", value1, value2, "picUrl");
return (Criteria) this;
}
public Criteria andStartDtIsNull() {
addCriterion("start_dt is null");
return (Criteria) this;
}
public Criteria andStartDtIsNotNull() {
addCriterion("start_dt is not null");
return (Criteria) this;
}
public Criteria andStartDtEqualTo(Date value) {
addCriterion("start_dt =", value, "startDt");
return (Criteria) this;
}
public Criteria andStartDtNotEqualTo(Date value) {
addCriterion("start_dt <>", value, "startDt");
return (Criteria) this;
}
public Criteria andStartDtGreaterThan(Date value) {
addCriterion("start_dt >", value, "startDt");
return (Criteria) this;
}
public Criteria andStartDtGreaterThanOrEqualTo(Date value) {
addCriterion("start_dt >=", value, "startDt");
return (Criteria) this;
}
public Criteria andStartDtLessThan(Date value) {
addCriterion("start_dt <", value, "startDt");
return (Criteria) this;
}
public Criteria andStartDtLessThanOrEqualTo(Date value) {
addCriterion("start_dt <=", value, "startDt");
return (Criteria) this;
}
public Criteria andStartDtIn(List<Date> values) {
addCriterion("start_dt in", values, "startDt");
return (Criteria) this;
}
public Criteria andStartDtNotIn(List<Date> values) {
addCriterion("start_dt not in", values, "startDt");
return (Criteria) this;
}
public Criteria andStartDtBetween(Date value1, Date value2) {
addCriterion("start_dt between", value1, value2, "startDt");
return (Criteria) this;
}
public Criteria andStartDtNotBetween(Date value1, Date value2) {
addCriterion("start_dt not between", value1, value2, "startDt");
return (Criteria) this;
}
public Criteria andEndDtIsNull() {
addCriterion("end_dt is null");
return (Criteria) this;
}
public Criteria andEndDtIsNotNull() {
addCriterion("end_dt is not null");
return (Criteria) this;
}
public Criteria andEndDtEqualTo(Date value) {
addCriterion("end_dt =", value, "endDt");
return (Criteria) this;
}
public Criteria andEndDtNotEqualTo(Date value) {
addCriterion("end_dt <>", value, "endDt");
return (Criteria) this;
}
public Criteria andEndDtGreaterThan(Date value) {
addCriterion("end_dt >", value, "endDt");
return (Criteria) this;
}
public Criteria andEndDtGreaterThanOrEqualTo(Date value) {
addCriterion("end_dt >=", value, "endDt");
return (Criteria) this;
}
public Criteria andEndDtLessThan(Date value) {
addCriterion("end_dt <", value, "endDt");
return (Criteria) this;
}
public Criteria andEndDtLessThanOrEqualTo(Date value) {
addCriterion("end_dt <=", value, "endDt");
return (Criteria) this;
}
public Criteria andEndDtIn(List<Date> values) {
addCriterion("end_dt in", values, "endDt");
return (Criteria) this;
}
public Criteria andEndDtNotIn(List<Date> values) {
addCriterion("end_dt not in", values, "endDt");
return (Criteria) this;
}
public Criteria andEndDtBetween(Date value1, Date value2) {
addCriterion("end_dt between", value1, value2, "endDt");
return (Criteria) this;
}
public Criteria andEndDtNotBetween(Date value1, Date value2) {
addCriterion("end_dt not between", value1, value2, "endDt");
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(Integer value) {
addCriterion("weight =", value, "weight");
return (Criteria) this;
}
public Criteria andWeightNotEqualTo(Integer value) {
addCriterion("weight <>", value, "weight");
return (Criteria) this;
}
public Criteria andWeightGreaterThan(Integer value) {
addCriterion("weight >", value, "weight");
return (Criteria) this;
}
public Criteria andWeightGreaterThanOrEqualTo(Integer value) {
addCriterion("weight >=", value, "weight");
return (Criteria) this;
}
public Criteria andWeightLessThan(Integer value) {
addCriterion("weight <", value, "weight");
return (Criteria) this;
}
public Criteria andWeightLessThanOrEqualTo(Integer value) {
addCriterion("weight <=", value, "weight");
return (Criteria) this;
}
public Criteria andWeightIn(List<Integer> values) {
addCriterion("weight in", values, "weight");
return (Criteria) this;
}
public Criteria andWeightNotIn(List<Integer> values) {
addCriterion("weight not in", values, "weight");
return (Criteria) this;
}
public Criteria andWeightBetween(Integer value1, Integer value2) {
addCriterion("weight between", value1, value2, "weight");
return (Criteria) this;
}
public Criteria andWeightNotBetween(Integer value1, Integer value2) {
addCriterion("weight not between", value1, value2, "weight");
return (Criteria) this;
}
public Criteria andLiveUrlIsNull() {
addCriterion("live_url is null");
return (Criteria) this;
}
public Criteria andLiveUrlIsNotNull() {
addCriterion("live_url is not null");
return (Criteria) this;
}
public Criteria andLiveUrlEqualTo(String value) {
addCriterion("live_url =", value, "liveUrl");
return (Criteria) this;
}
public Criteria andLiveUrlNotEqualTo(String value) {
addCriterion("live_url <>", value, "liveUrl");
return (Criteria) this;
}
public Criteria andLiveUrlGreaterThan(String value) {
addCriterion("live_url >", value, "liveUrl");
return (Criteria) this;
}
public Criteria andLiveUrlGreaterThanOrEqualTo(String value) {
addCriterion("live_url >=", value, "liveUrl");
return (Criteria) this;
}
public Criteria andLiveUrlLessThan(String value) {
addCriterion("live_url <", value, "liveUrl");
return (Criteria) this;
}
public Criteria andLiveUrlLessThanOrEqualTo(String value) {
addCriterion("live_url <=", value, "liveUrl");
return (Criteria) this;
}
public Criteria andLiveUrlLike(String value) {
addCriterion("live_url like", value, "liveUrl");
return (Criteria) this;
}
public Criteria andLiveUrlNotLike(String value) {
addCriterion("live_url not like", value, "liveUrl");
return (Criteria) this;
}
public Criteria andLiveUrlIn(List<String> values) {
addCriterion("live_url in", values, "liveUrl");
return (Criteria) this;
}
public Criteria andLiveUrlNotIn(List<String> values) {
addCriterion("live_url not in", values, "liveUrl");
return (Criteria) this;
}
public Criteria andLiveUrlBetween(String value1, String value2) {
addCriterion("live_url between", value1, value2, "liveUrl");
return (Criteria) this;
}
public Criteria andLiveUrlNotBetween(String value1, String value2) {
addCriterion("live_url not between", value1, value2, "liveUrl");
return (Criteria) this;
}
public Criteria andCourseTypeIsNull() {
addCriterion("course_type is null");
return (Criteria) this;
}
public Criteria andCourseTypeIsNotNull() {
addCriterion("course_type is not null");
return (Criteria) this;
}
public Criteria andCourseTypeEqualTo(Integer value) {
addCriterion("course_type =", value, "courseType");
return (Criteria) this;
}
public Criteria andCourseTypeNotEqualTo(Integer value) {
addCriterion("course_type <>", value, "courseType");
return (Criteria) this;
}
public Criteria andCourseTypeGreaterThan(Integer value) {
addCriterion("course_type >", value, "courseType");
return (Criteria) this;
}
public Criteria andCourseTypeGreaterThanOrEqualTo(Integer value) {
addCriterion("course_type >=", value, "courseType");
return (Criteria) this;
}
public Criteria andCourseTypeLessThan(Integer value) {
addCriterion("course_type <", value, "courseType");
return (Criteria) this;
}
public Criteria andCourseTypeLessThanOrEqualTo(Integer value) {
addCriterion("course_type <=", value, "courseType");
return (Criteria) this;
}
public Criteria andCourseTypeIn(List<Integer> values) {
addCriterion("course_type in", values, "courseType");
return (Criteria) this;
}
public Criteria andCourseTypeNotIn(List<Integer> values) {
addCriterion("course_type not in", values, "courseType");
return (Criteria) this;
}
public Criteria andCourseTypeBetween(Integer value1, Integer value2) {
addCriterion("course_type between", value1, value2, "courseType");
return (Criteria) this;
}
public Criteria andCourseTypeNotBetween(Integer value1, Integer value2) {
addCriterion("course_type not between", value1, value2, "courseType");
return (Criteria) this;
}
public Criteria andIsUpIsNull() {
addCriterion("is_up is null");
return (Criteria) this;
}
public Criteria andIsUpIsNotNull() {
addCriterion("is_up is not null");
return (Criteria) this;
}
public Criteria andIsUpEqualTo(Integer value) {
addCriterion("is_up =", value, "isUp");
return (Criteria) this;
}
public Criteria andIsUpNotEqualTo(Integer value) {
addCriterion("is_up <>", value, "isUp");
return (Criteria) this;
}
public Criteria andIsUpGreaterThan(Integer value) {
addCriterion("is_up >", value, "isUp");
return (Criteria) this;
}
public Criteria andIsUpGreaterThanOrEqualTo(Integer value) {
addCriterion("is_up >=", value, "isUp");
return (Criteria) this;
}
public Criteria andIsUpLessThan(Integer value) {
addCriterion("is_up <", value, "isUp");
return (Criteria) this;
}
public Criteria andIsUpLessThanOrEqualTo(Integer value) {
addCriterion("is_up <=", value, "isUp");
return (Criteria) this;
}
public Criteria andIsUpIn(List<Integer> values) {
addCriterion("is_up in", values, "isUp");
return (Criteria) this;
}
public Criteria andIsUpNotIn(List<Integer> values) {
addCriterion("is_up not in", values, "isUp");
return (Criteria) this;
}
public Criteria andIsUpBetween(Integer value1, Integer value2) {
addCriterion("is_up between", value1, value2, "isUp");
return (Criteria) this;
}
public Criteria andIsUpNotBetween(Integer value1, Integer value2) {
addCriterion("is_up not between", value1, value2, "isUp");
return (Criteria) this;
}
public Criteria andEditorIdIsNull() {
addCriterion("editor_id is null");
return (Criteria) this;
}
public Criteria andEditorIdIsNotNull() {
addCriterion("editor_id is not null");
return (Criteria) this;
}
public Criteria andEditorIdEqualTo(Long value) {
addCriterion("editor_id =", value, "editorId");
return (Criteria) this;
}
public Criteria andEditorIdNotEqualTo(Long value) {
addCriterion("editor_id <>", value, "editorId");
return (Criteria) this;
}
public Criteria andEditorIdGreaterThan(Long value) {
addCriterion("editor_id >", value, "editorId");
return (Criteria) this;
}
public Criteria andEditorIdGreaterThanOrEqualTo(Long value) {
addCriterion("editor_id >=", value, "editorId");
return (Criteria) this;
}
public Criteria andEditorIdLessThan(Long value) {
addCriterion("editor_id <", value, "editorId");
return (Criteria) this;
}
public Criteria andEditorIdLessThanOrEqualTo(Long value) {
addCriterion("editor_id <=", value, "editorId");
return (Criteria) this;
}
public Criteria andEditorIdIn(List<Long> values) {
addCriterion("editor_id in", values, "editorId");
return (Criteria) this;
}
public Criteria andEditorIdNotIn(List<Long> values) {
addCriterion("editor_id not in", values, "editorId");
return (Criteria) this;
}
public Criteria andEditorIdBetween(Long value1, Long value2) {
addCriterion("editor_id between", value1, value2, "editorId");
return (Criteria) this;
}
public Criteria andEditorIdNotBetween(Long value1, Long value2) {
addCriterion("editor_id not between", value1, value2, "editorId");
return (Criteria) this;
}
public Criteria andEditorNameIsNull() {
addCriterion("editor_name is null");
return (Criteria) this;
}
public Criteria andEditorNameIsNotNull() {
addCriterion("editor_name is not null");
return (Criteria) this;
}
public Criteria andEditorNameEqualTo(String value) {
addCriterion("editor_name =", value, "editorName");
return (Criteria) this;
}
public Criteria andEditorNameNotEqualTo(String value) {
addCriterion("editor_name <>", value, "editorName");
return (Criteria) this;
}
public Criteria andEditorNameGreaterThan(String value) {
addCriterion("editor_name >", value, "editorName");
return (Criteria) this;
}
public Criteria andEditorNameGreaterThanOrEqualTo(String value) {
addCriterion("editor_name >=", value, "editorName");
return (Criteria) this;
}
public Criteria andEditorNameLessThan(String value) {
addCriterion("editor_name <", value, "editorName");
return (Criteria) this;
}
public Criteria andEditorNameLessThanOrEqualTo(String value) {
addCriterion("editor_name <=", value, "editorName");
return (Criteria) this;
}
public Criteria andEditorNameLike(String value) {
addCriterion("editor_name like", value, "editorName");
return (Criteria) this;
}
public Criteria andEditorNameNotLike(String value) {
addCriterion("editor_name not like", value, "editorName");
return (Criteria) this;
}
public Criteria andEditorNameIn(List<String> values) {
addCriterion("editor_name in", values, "editorName");
return (Criteria) this;
}
public Criteria andEditorNameNotIn(List<String> values) {
addCriterion("editor_name not in", values, "editorName");
return (Criteria) this;
}
public Criteria andEditorNameBetween(String value1, String value2) {
addCriterion("editor_name between", value1, value2, "editorName");
return (Criteria) this;
}
public Criteria andEditorNameNotBetween(String value1, String value2) {
addCriterion("editor_name not between", value1, value2, "editorName");
return (Criteria) this;
}
public Criteria andIsDeleteIsNull() {
addCriterion("is_delete is null");
return (Criteria) this;
}
public Criteria andIsDeleteIsNotNull() {
addCriterion("is_delete is not null");
return (Criteria) this;
}
public Criteria andIsDeleteEqualTo(Integer value) {
addCriterion("is_delete =", value, "isDelete");
return (Criteria) this;
}
public Criteria andIsDeleteNotEqualTo(Integer value) {
addCriterion("is_delete <>", value, "isDelete");
return (Criteria) this;
}
public Criteria andIsDeleteGreaterThan(Integer value) {
addCriterion("is_delete >", value, "isDelete");
return (Criteria) this;
}
public Criteria andIsDeleteGreaterThanOrEqualTo(Integer value) {
addCriterion("is_delete >=", value, "isDelete");
return (Criteria) this;
}
public Criteria andIsDeleteLessThan(Integer value) {
addCriterion("is_delete <", value, "isDelete");
return (Criteria) this;
}
public Criteria andIsDeleteLessThanOrEqualTo(Integer value) {
addCriterion("is_delete <=", value, "isDelete");
return (Criteria) this;
}
public Criteria andIsDeleteIn(List<Integer> values) {
addCriterion("is_delete in", values, "isDelete");
return (Criteria) this;
}
public Criteria andIsDeleteNotIn(List<Integer> values) {
addCriterion("is_delete not in", values, "isDelete");
return (Criteria) this;
}
public Criteria andIsDeleteBetween(Integer value1, Integer value2) {
addCriterion("is_delete between", value1, value2, "isDelete");
return (Criteria) this;
}
public Criteria andIsDeleteNotBetween(Integer value1, Integer value2) {
addCriterion("is_delete not between", value1, value2, "isDelete");
return (Criteria) this;
}
public Criteria andCreateDtIsNull() {
addCriterion("create_dt is null");
return (Criteria) this;
}
public Criteria andCreateDtIsNotNull() {
addCriterion("create_dt is not null");
return (Criteria) this;
}
public Criteria andCreateDtEqualTo(Date value) {
addCriterion("create_dt =", value, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtNotEqualTo(Date value) {
addCriterion("create_dt <>", value, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtGreaterThan(Date value) {
addCriterion("create_dt >", value, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtGreaterThanOrEqualTo(Date value) {
addCriterion("create_dt >=", value, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtLessThan(Date value) {
addCriterion("create_dt <", value, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtLessThanOrEqualTo(Date value) {
addCriterion("create_dt <=", value, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtIn(List<Date> values) {
addCriterion("create_dt in", values, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtNotIn(List<Date> values) {
addCriterion("create_dt not in", values, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtBetween(Date value1, Date value2) {
addCriterion("create_dt between", value1, value2, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtNotBetween(Date value1, Date value2) {
addCriterion("create_dt not between", value1, value2, "createDt");
return (Criteria) this;
}
public Criteria andUpdateDtIsNull() {
addCriterion("update_dt is null");
return (Criteria) this;
}
public Criteria andUpdateDtIsNotNull() {
addCriterion("update_dt is not null");
return (Criteria) this;
}
public Criteria andUpdateDtEqualTo(Date value) {
addCriterion("update_dt =", value, "updateDt");
return (Criteria) this;
}
public Criteria andUpdateDtNotEqualTo(Date value) {
addCriterion("update_dt <>", value, "updateDt");
return (Criteria) this;
}
public Criteria andUpdateDtGreaterThan(Date value) {
addCriterion("update_dt >", value, "updateDt");
return (Criteria) this;
}
public Criteria andUpdateDtGreaterThanOrEqualTo(Date value) {
addCriterion("update_dt >=", value, "updateDt");
return (Criteria) this;
}
public Criteria andUpdateDtLessThan(Date value) {
addCriterion("update_dt <", value, "updateDt");
return (Criteria) this;
}
public Criteria andUpdateDtLessThanOrEqualTo(Date value) {
addCriterion("update_dt <=", value, "updateDt");
return (Criteria) this;
}
public Criteria andUpdateDtIn(List<Date> values) {
addCriterion("update_dt in", values, "updateDt");
return (Criteria) this;
}
public Criteria andUpdateDtNotIn(List<Date> values) {
addCriterion("update_dt not in", values, "updateDt");
return (Criteria) this;
}
public Criteria andUpdateDtBetween(Date value1, Date value2) {
addCriterion("update_dt between", value1, value2, "updateDt");
return (Criteria) this;
}
public Criteria andUpdateDtNotBetween(Date value1, Date value2) {
addCriterion("update_dt not between", value1, value2, "updateDt");
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);
}
}
}
\ No newline at end of file
package com.server.web.common.model;
import java.util.Date;
public class TKzyInformation extends BaseModel {
private Long id;
private String title;
private String author;
private String picUrl;
private String iconUrl;
private Integer isDelete;
private Date createDt;
private Date updateDt;
private byte[] content;
public TKzyInformation(Long id, String title, String author, String picUrl, String iconUrl, Integer isDelete, Date createDt, Date updateDt, byte[] content) {
this.id = id;
this.title = title;
this.author = author;
this.picUrl = picUrl;
this.iconUrl = iconUrl;
this.isDelete = isDelete;
this.createDt = createDt;
this.updateDt = updateDt;
this.content = content;
}
public TKzyInformation() {
super();
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title == null ? null : title.trim();
}
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author == null ? null : author.trim();
}
public String getPicUrl() {
return picUrl;
}
public void setPicUrl(String picUrl) {
this.picUrl = picUrl == null ? null : picUrl.trim();
}
public String getIconUrl() {
return iconUrl;
}
public void setIconUrl(String iconUrl) {
this.iconUrl = iconUrl == null ? null : iconUrl.trim();
}
public Integer getIsDelete() {
return isDelete;
}
public void setIsDelete(Integer isDelete) {
this.isDelete = isDelete;
}
public Date getCreateDt() {
return createDt;
}
public void setCreateDt(Date createDt) {
this.createDt = createDt;
}
public Date getUpdateDt() {
return updateDt;
}
public void setUpdateDt(Date updateDt) {
this.updateDt = updateDt;
}
public byte[] getContent() {
return content;
}
public void setContent(byte[] content) {
this.content = content;
}
}
\ No newline at end of file
package com.server.web.common.model;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class TKzyInformationExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public TKzyInformationExample() {
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 andTitleIsNull() {
addCriterion("title is null");
return (Criteria) this;
}
public Criteria andTitleIsNotNull() {
addCriterion("title is not null");
return (Criteria) this;
}
public Criteria andTitleEqualTo(String value) {
addCriterion("title =", value, "title");
return (Criteria) this;
}
public Criteria andTitleNotEqualTo(String value) {
addCriterion("title <>", value, "title");
return (Criteria) this;
}
public Criteria andTitleGreaterThan(String value) {
addCriterion("title >", value, "title");
return (Criteria) this;
}
public Criteria andTitleGreaterThanOrEqualTo(String value) {
addCriterion("title >=", value, "title");
return (Criteria) this;
}
public Criteria andTitleLessThan(String value) {
addCriterion("title <", value, "title");
return (Criteria) this;
}
public Criteria andTitleLessThanOrEqualTo(String value) {
addCriterion("title <=", value, "title");
return (Criteria) this;
}
public Criteria andTitleLike(String value) {
addCriterion("title like", value, "title");
return (Criteria) this;
}
public Criteria andTitleNotLike(String value) {
addCriterion("title not like", value, "title");
return (Criteria) this;
}
public Criteria andTitleIn(List<String> values) {
addCriterion("title in", values, "title");
return (Criteria) this;
}
public Criteria andTitleNotIn(List<String> values) {
addCriterion("title not in", values, "title");
return (Criteria) this;
}
public Criteria andTitleBetween(String value1, String value2) {
addCriterion("title between", value1, value2, "title");
return (Criteria) this;
}
public Criteria andTitleNotBetween(String value1, String value2) {
addCriterion("title not between", value1, value2, "title");
return (Criteria) this;
}
public Criteria andAuthorIsNull() {
addCriterion("author is null");
return (Criteria) this;
}
public Criteria andAuthorIsNotNull() {
addCriterion("author is not null");
return (Criteria) this;
}
public Criteria andAuthorEqualTo(String value) {
addCriterion("author =", value, "author");
return (Criteria) this;
}
public Criteria andAuthorNotEqualTo(String value) {
addCriterion("author <>", value, "author");
return (Criteria) this;
}
public Criteria andAuthorGreaterThan(String value) {
addCriterion("author >", value, "author");
return (Criteria) this;
}
public Criteria andAuthorGreaterThanOrEqualTo(String value) {
addCriterion("author >=", value, "author");
return (Criteria) this;
}
public Criteria andAuthorLessThan(String value) {
addCriterion("author <", value, "author");
return (Criteria) this;
}
public Criteria andAuthorLessThanOrEqualTo(String value) {
addCriterion("author <=", value, "author");
return (Criteria) this;
}
public Criteria andAuthorLike(String value) {
addCriterion("author like", value, "author");
return (Criteria) this;
}
public Criteria andAuthorNotLike(String value) {
addCriterion("author not like", value, "author");
return (Criteria) this;
}
public Criteria andAuthorIn(List<String> values) {
addCriterion("author in", values, "author");
return (Criteria) this;
}
public Criteria andAuthorNotIn(List<String> values) {
addCriterion("author not in", values, "author");
return (Criteria) this;
}
public Criteria andAuthorBetween(String value1, String value2) {
addCriterion("author between", value1, value2, "author");
return (Criteria) this;
}
public Criteria andAuthorNotBetween(String value1, String value2) {
addCriterion("author not between", value1, value2, "author");
return (Criteria) this;
}
public Criteria andPicUrlIsNull() {
addCriterion("pic_url is null");
return (Criteria) this;
}
public Criteria andPicUrlIsNotNull() {
addCriterion("pic_url is not null");
return (Criteria) this;
}
public Criteria andPicUrlEqualTo(String value) {
addCriterion("pic_url =", value, "picUrl");
return (Criteria) this;
}
public Criteria andPicUrlNotEqualTo(String value) {
addCriterion("pic_url <>", value, "picUrl");
return (Criteria) this;
}
public Criteria andPicUrlGreaterThan(String value) {
addCriterion("pic_url >", value, "picUrl");
return (Criteria) this;
}
public Criteria andPicUrlGreaterThanOrEqualTo(String value) {
addCriterion("pic_url >=", value, "picUrl");
return (Criteria) this;
}
public Criteria andPicUrlLessThan(String value) {
addCriterion("pic_url <", value, "picUrl");
return (Criteria) this;
}
public Criteria andPicUrlLessThanOrEqualTo(String value) {
addCriterion("pic_url <=", value, "picUrl");
return (Criteria) this;
}
public Criteria andPicUrlLike(String value) {
addCriterion("pic_url like", value, "picUrl");
return (Criteria) this;
}
public Criteria andPicUrlNotLike(String value) {
addCriterion("pic_url not like", value, "picUrl");
return (Criteria) this;
}
public Criteria andPicUrlIn(List<String> values) {
addCriterion("pic_url in", values, "picUrl");
return (Criteria) this;
}
public Criteria andPicUrlNotIn(List<String> values) {
addCriterion("pic_url not in", values, "picUrl");
return (Criteria) this;
}
public Criteria andPicUrlBetween(String value1, String value2) {
addCriterion("pic_url between", value1, value2, "picUrl");
return (Criteria) this;
}
public Criteria andPicUrlNotBetween(String value1, String value2) {
addCriterion("pic_url not between", value1, value2, "picUrl");
return (Criteria) this;
}
public Criteria andIconUrlIsNull() {
addCriterion("icon_url is null");
return (Criteria) this;
}
public Criteria andIconUrlIsNotNull() {
addCriterion("icon_url is not null");
return (Criteria) this;
}
public Criteria andIconUrlEqualTo(String value) {
addCriterion("icon_url =", value, "iconUrl");
return (Criteria) this;
}
public Criteria andIconUrlNotEqualTo(String value) {
addCriterion("icon_url <>", value, "iconUrl");
return (Criteria) this;
}
public Criteria andIconUrlGreaterThan(String value) {
addCriterion("icon_url >", value, "iconUrl");
return (Criteria) this;
}
public Criteria andIconUrlGreaterThanOrEqualTo(String value) {
addCriterion("icon_url >=", value, "iconUrl");
return (Criteria) this;
}
public Criteria andIconUrlLessThan(String value) {
addCriterion("icon_url <", value, "iconUrl");
return (Criteria) this;
}
public Criteria andIconUrlLessThanOrEqualTo(String value) {
addCriterion("icon_url <=", value, "iconUrl");
return (Criteria) this;
}
public Criteria andIconUrlLike(String value) {
addCriterion("icon_url like", value, "iconUrl");
return (Criteria) this;
}
public Criteria andIconUrlNotLike(String value) {
addCriterion("icon_url not like", value, "iconUrl");
return (Criteria) this;
}
public Criteria andIconUrlIn(List<String> values) {
addCriterion("icon_url in", values, "iconUrl");
return (Criteria) this;
}
public Criteria andIconUrlNotIn(List<String> values) {
addCriterion("icon_url not in", values, "iconUrl");
return (Criteria) this;
}
public Criteria andIconUrlBetween(String value1, String value2) {
addCriterion("icon_url between", value1, value2, "iconUrl");
return (Criteria) this;
}
public Criteria andIconUrlNotBetween(String value1, String value2) {
addCriterion("icon_url not between", value1, value2, "iconUrl");
return (Criteria) this;
}
public Criteria andIsDeleteIsNull() {
addCriterion("is_delete is null");
return (Criteria) this;
}
public Criteria andIsDeleteIsNotNull() {
addCriterion("is_delete is not null");
return (Criteria) this;
}
public Criteria andIsDeleteEqualTo(Integer value) {
addCriterion("is_delete =", value, "isDelete");
return (Criteria) this;
}
public Criteria andIsDeleteNotEqualTo(Integer value) {
addCriterion("is_delete <>", value, "isDelete");
return (Criteria) this;
}
public Criteria andIsDeleteGreaterThan(Integer value) {
addCriterion("is_delete >", value, "isDelete");
return (Criteria) this;
}
public Criteria andIsDeleteGreaterThanOrEqualTo(Integer value) {
addCriterion("is_delete >=", value, "isDelete");
return (Criteria) this;
}
public Criteria andIsDeleteLessThan(Integer value) {
addCriterion("is_delete <", value, "isDelete");
return (Criteria) this;
}
public Criteria andIsDeleteLessThanOrEqualTo(Integer value) {
addCriterion("is_delete <=", value, "isDelete");
return (Criteria) this;
}
public Criteria andIsDeleteIn(List<Integer> values) {
addCriterion("is_delete in", values, "isDelete");
return (Criteria) this;
}
public Criteria andIsDeleteNotIn(List<Integer> values) {
addCriterion("is_delete not in", values, "isDelete");
return (Criteria) this;
}
public Criteria andIsDeleteBetween(Integer value1, Integer value2) {
addCriterion("is_delete between", value1, value2, "isDelete");
return (Criteria) this;
}
public Criteria andIsDeleteNotBetween(Integer value1, Integer value2) {
addCriterion("is_delete not between", value1, value2, "isDelete");
return (Criteria) this;
}
public Criteria andCreateDtIsNull() {
addCriterion("create_dt is null");
return (Criteria) this;
}
public Criteria andCreateDtIsNotNull() {
addCriterion("create_dt is not null");
return (Criteria) this;
}
public Criteria andCreateDtEqualTo(Date value) {
addCriterion("create_dt =", value, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtNotEqualTo(Date value) {
addCriterion("create_dt <>", value, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtGreaterThan(Date value) {
addCriterion("create_dt >", value, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtGreaterThanOrEqualTo(Date value) {
addCriterion("create_dt >=", value, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtLessThan(Date value) {
addCriterion("create_dt <", value, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtLessThanOrEqualTo(Date value) {
addCriterion("create_dt <=", value, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtIn(List<Date> values) {
addCriterion("create_dt in", values, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtNotIn(List<Date> values) {
addCriterion("create_dt not in", values, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtBetween(Date value1, Date value2) {
addCriterion("create_dt between", value1, value2, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtNotBetween(Date value1, Date value2) {
addCriterion("create_dt not between", value1, value2, "createDt");
return (Criteria) this;
}
public Criteria andUpdateDtIsNull() {
addCriterion("update_dt is null");
return (Criteria) this;
}
public Criteria andUpdateDtIsNotNull() {
addCriterion("update_dt is not null");
return (Criteria) this;
}
public Criteria andUpdateDtEqualTo(Date value) {
addCriterion("update_dt =", value, "updateDt");
return (Criteria) this;
}
public Criteria andUpdateDtNotEqualTo(Date value) {
addCriterion("update_dt <>", value, "updateDt");
return (Criteria) this;
}
public Criteria andUpdateDtGreaterThan(Date value) {
addCriterion("update_dt >", value, "updateDt");
return (Criteria) this;
}
public Criteria andUpdateDtGreaterThanOrEqualTo(Date value) {
addCriterion("update_dt >=", value, "updateDt");
return (Criteria) this;
}
public Criteria andUpdateDtLessThan(Date value) {
addCriterion("update_dt <", value, "updateDt");
return (Criteria) this;
}
public Criteria andUpdateDtLessThanOrEqualTo(Date value) {
addCriterion("update_dt <=", value, "updateDt");
return (Criteria) this;
}
public Criteria andUpdateDtIn(List<Date> values) {
addCriterion("update_dt in", values, "updateDt");
return (Criteria) this;
}
public Criteria andUpdateDtNotIn(List<Date> values) {
addCriterion("update_dt not in", values, "updateDt");
return (Criteria) this;
}
public Criteria andUpdateDtBetween(Date value1, Date value2) {
addCriterion("update_dt between", value1, value2, "updateDt");
return (Criteria) this;
}
public Criteria andUpdateDtNotBetween(Date value1, Date value2) {
addCriterion("update_dt not between", value1, value2, "updateDt");
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);
}
}
}
\ No newline at end of file
package com.server.web.common.model;
import java.util.Date;
public class TKzyRelationClass extends BaseModel {
private Long id;
private Long relationId;
private Long firstClassId;
private Long secondClassId;
private Date createDt;
public TKzyRelationClass(Long id, Long relationId, Long firstClassId, Long secondClassId, Date createDt) {
this.id = id;
this.relationId = relationId;
this.firstClassId = firstClassId;
this.secondClassId = secondClassId;
this.createDt = createDt;
}
public TKzyRelationClass() {
super();
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getRelationId() {
return relationId;
}
public void setRelationId(Long relationId) {
this.relationId = relationId;
}
public Long getFirstClassId() {
return firstClassId;
}
public void setFirstClassId(Long firstClassId) {
this.firstClassId = firstClassId;
}
public Long getSecondClassId() {
return secondClassId;
}
public void setSecondClassId(Long secondClassId) {
this.secondClassId = secondClassId;
}
public Date getCreateDt() {
return createDt;
}
public void setCreateDt(Date createDt) {
this.createDt = createDt;
}
}
\ No newline at end of file
package com.server.web.common.model;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class TKzyRelationClassExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public TKzyRelationClassExample() {
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 andRelationIdIsNull() {
addCriterion("relation_id is null");
return (Criteria) this;
}
public Criteria andRelationIdIsNotNull() {
addCriterion("relation_id is not null");
return (Criteria) this;
}
public Criteria andRelationIdEqualTo(Long value) {
addCriterion("relation_id =", value, "relationId");
return (Criteria) this;
}
public Criteria andRelationIdNotEqualTo(Long value) {
addCriterion("relation_id <>", value, "relationId");
return (Criteria) this;
}
public Criteria andRelationIdGreaterThan(Long value) {
addCriterion("relation_id >", value, "relationId");
return (Criteria) this;
}
public Criteria andRelationIdGreaterThanOrEqualTo(Long value) {
addCriterion("relation_id >=", value, "relationId");
return (Criteria) this;
}
public Criteria andRelationIdLessThan(Long value) {
addCriterion("relation_id <", value, "relationId");
return (Criteria) this;
}
public Criteria andRelationIdLessThanOrEqualTo(Long value) {
addCriterion("relation_id <=", value, "relationId");
return (Criteria) this;
}
public Criteria andRelationIdIn(List<Long> values) {
addCriterion("relation_id in", values, "relationId");
return (Criteria) this;
}
public Criteria andRelationIdNotIn(List<Long> values) {
addCriterion("relation_id not in", values, "relationId");
return (Criteria) this;
}
public Criteria andRelationIdBetween(Long value1, Long value2) {
addCriterion("relation_id between", value1, value2, "relationId");
return (Criteria) this;
}
public Criteria andRelationIdNotBetween(Long value1, Long value2) {
addCriterion("relation_id not between", value1, value2, "relationId");
return (Criteria) this;
}
public Criteria andFirstClassIdIsNull() {
addCriterion("first_class_id is null");
return (Criteria) this;
}
public Criteria andFirstClassIdIsNotNull() {
addCriterion("first_class_id is not null");
return (Criteria) this;
}
public Criteria andFirstClassIdEqualTo(Long value) {
addCriterion("first_class_id =", value, "firstClassId");
return (Criteria) this;
}
public Criteria andFirstClassIdNotEqualTo(Long value) {
addCriterion("first_class_id <>", value, "firstClassId");
return (Criteria) this;
}
public Criteria andFirstClassIdGreaterThan(Long value) {
addCriterion("first_class_id >", value, "firstClassId");
return (Criteria) this;
}
public Criteria andFirstClassIdGreaterThanOrEqualTo(Long value) {
addCriterion("first_class_id >=", value, "firstClassId");
return (Criteria) this;
}
public Criteria andFirstClassIdLessThan(Long value) {
addCriterion("first_class_id <", value, "firstClassId");
return (Criteria) this;
}
public Criteria andFirstClassIdLessThanOrEqualTo(Long value) {
addCriterion("first_class_id <=", value, "firstClassId");
return (Criteria) this;
}
public Criteria andFirstClassIdIn(List<Long> values) {
addCriterion("first_class_id in", values, "firstClassId");
return (Criteria) this;
}
public Criteria andFirstClassIdNotIn(List<Long> values) {
addCriterion("first_class_id not in", values, "firstClassId");
return (Criteria) this;
}
public Criteria andFirstClassIdBetween(Long value1, Long value2) {
addCriterion("first_class_id between", value1, value2, "firstClassId");
return (Criteria) this;
}
public Criteria andFirstClassIdNotBetween(Long value1, Long value2) {
addCriterion("first_class_id not between", value1, value2, "firstClassId");
return (Criteria) this;
}
public Criteria andSecondClassIdIsNull() {
addCriterion("second_class_id is null");
return (Criteria) this;
}
public Criteria andSecondClassIdIsNotNull() {
addCriterion("second_class_id is not null");
return (Criteria) this;
}
public Criteria andSecondClassIdEqualTo(Long value) {
addCriterion("second_class_id =", value, "secondClassId");
return (Criteria) this;
}
public Criteria andSecondClassIdNotEqualTo(Long value) {
addCriterion("second_class_id <>", value, "secondClassId");
return (Criteria) this;
}
public Criteria andSecondClassIdGreaterThan(Long value) {
addCriterion("second_class_id >", value, "secondClassId");
return (Criteria) this;
}
public Criteria andSecondClassIdGreaterThanOrEqualTo(Long value) {
addCriterion("second_class_id >=", value, "secondClassId");
return (Criteria) this;
}
public Criteria andSecondClassIdLessThan(Long value) {
addCriterion("second_class_id <", value, "secondClassId");
return (Criteria) this;
}
public Criteria andSecondClassIdLessThanOrEqualTo(Long value) {
addCriterion("second_class_id <=", value, "secondClassId");
return (Criteria) this;
}
public Criteria andSecondClassIdIn(List<Long> values) {
addCriterion("second_class_id in", values, "secondClassId");
return (Criteria) this;
}
public Criteria andSecondClassIdNotIn(List<Long> values) {
addCriterion("second_class_id not in", values, "secondClassId");
return (Criteria) this;
}
public Criteria andSecondClassIdBetween(Long value1, Long value2) {
addCriterion("second_class_id between", value1, value2, "secondClassId");
return (Criteria) this;
}
public Criteria andSecondClassIdNotBetween(Long value1, Long value2) {
addCriterion("second_class_id not between", value1, value2, "secondClassId");
return (Criteria) this;
}
public Criteria andCreateDtIsNull() {
addCriterion("create_dt is null");
return (Criteria) this;
}
public Criteria andCreateDtIsNotNull() {
addCriterion("create_dt is not null");
return (Criteria) this;
}
public Criteria andCreateDtEqualTo(Date value) {
addCriterion("create_dt =", value, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtNotEqualTo(Date value) {
addCriterion("create_dt <>", value, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtGreaterThan(Date value) {
addCriterion("create_dt >", value, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtGreaterThanOrEqualTo(Date value) {
addCriterion("create_dt >=", value, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtLessThan(Date value) {
addCriterion("create_dt <", value, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtLessThanOrEqualTo(Date value) {
addCriterion("create_dt <=", value, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtIn(List<Date> values) {
addCriterion("create_dt in", values, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtNotIn(List<Date> values) {
addCriterion("create_dt not in", values, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtBetween(Date value1, Date value2) {
addCriterion("create_dt between", value1, value2, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtNotBetween(Date value1, Date value2) {
addCriterion("create_dt not between", value1, value2, "createDt");
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);
}
}
}
\ No newline at end of file
package com.server.web.common.model;
import java.util.Date;
public class TKzyUser extends BaseModel {
private Long id;
private String fullName;
private String headPhoto;
private String phone;
private Integer userCategory;
private String duty;
private Integer status;
private String wxOpenid;
private Integer integral;
private Integer signInCount;
private Date lastSignDt;
private Date createDt;
private Date lastLoginDt;
public TKzyUser(Long id, String fullName, String headPhoto, String phone, Integer userCategory, String duty, Integer status, String wxOpenid, Integer integral, Integer signInCount, Date lastSignDt, Date createDt, Date lastLoginDt) {
this.id = id;
this.fullName = fullName;
this.headPhoto = headPhoto;
this.phone = phone;
this.userCategory = userCategory;
this.duty = duty;
this.status = status;
this.wxOpenid = wxOpenid;
this.integral = integral;
this.signInCount = signInCount;
this.lastSignDt = lastSignDt;
this.createDt = createDt;
this.lastLoginDt = lastLoginDt;
}
public TKzyUser() {
super();
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getFullName() {
return fullName;
}
public void setFullName(String fullName) {
this.fullName = fullName == null ? null : fullName.trim();
}
public String getHeadPhoto() {
return headPhoto;
}
public void setHeadPhoto(String headPhoto) {
this.headPhoto = headPhoto == null ? null : headPhoto.trim();
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone == null ? null : phone.trim();
}
public Integer getUserCategory() {
return userCategory;
}
public void setUserCategory(Integer userCategory) {
this.userCategory = userCategory;
}
public String getDuty() {
return duty;
}
public void setDuty(String duty) {
this.duty = duty == null ? null : duty.trim();
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public String getWxOpenid() {
return wxOpenid;
}
public void setWxOpenid(String wxOpenid) {
this.wxOpenid = wxOpenid == null ? null : wxOpenid.trim();
}
public Integer getIntegral() {
return integral;
}
public void setIntegral(Integer integral) {
this.integral = integral;
}
public Integer getSignInCount() {
return signInCount;
}
public void setSignInCount(Integer signInCount) {
this.signInCount = signInCount;
}
public Date getLastSignDt() {
return lastSignDt;
}
public void setLastSignDt(Date lastSignDt) {
this.lastSignDt = lastSignDt;
}
public Date getCreateDt() {
return createDt;
}
public void setCreateDt(Date createDt) {
this.createDt = createDt;
}
public Date getLastLoginDt() {
return lastLoginDt;
}
public void setLastLoginDt(Date lastLoginDt) {
this.lastLoginDt = lastLoginDt;
}
}
\ No newline at end of file
package com.server.web.common.model;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class TKzyUserExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public TKzyUserExample() {
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 andFullNameIsNull() {
addCriterion("full_name is null");
return (Criteria) this;
}
public Criteria andFullNameIsNotNull() {
addCriterion("full_name is not null");
return (Criteria) this;
}
public Criteria andFullNameEqualTo(String value) {
addCriterion("full_name =", value, "fullName");
return (Criteria) this;
}
public Criteria andFullNameNotEqualTo(String value) {
addCriterion("full_name <>", value, "fullName");
return (Criteria) this;
}
public Criteria andFullNameGreaterThan(String value) {
addCriterion("full_name >", value, "fullName");
return (Criteria) this;
}
public Criteria andFullNameGreaterThanOrEqualTo(String value) {
addCriterion("full_name >=", value, "fullName");
return (Criteria) this;
}
public Criteria andFullNameLessThan(String value) {
addCriterion("full_name <", value, "fullName");
return (Criteria) this;
}
public Criteria andFullNameLessThanOrEqualTo(String value) {
addCriterion("full_name <=", value, "fullName");
return (Criteria) this;
}
public Criteria andFullNameLike(String value) {
addCriterion("full_name like", value, "fullName");
return (Criteria) this;
}
public Criteria andFullNameNotLike(String value) {
addCriterion("full_name not like", value, "fullName");
return (Criteria) this;
}
public Criteria andFullNameIn(List<String> values) {
addCriterion("full_name in", values, "fullName");
return (Criteria) this;
}
public Criteria andFullNameNotIn(List<String> values) {
addCriterion("full_name not in", values, "fullName");
return (Criteria) this;
}
public Criteria andFullNameBetween(String value1, String value2) {
addCriterion("full_name between", value1, value2, "fullName");
return (Criteria) this;
}
public Criteria andFullNameNotBetween(String value1, String value2) {
addCriterion("full_name not between", value1, value2, "fullName");
return (Criteria) this;
}
public Criteria andHeadPhotoIsNull() {
addCriterion("head_photo is null");
return (Criteria) this;
}
public Criteria andHeadPhotoIsNotNull() {
addCriterion("head_photo is not null");
return (Criteria) this;
}
public Criteria andHeadPhotoEqualTo(String value) {
addCriterion("head_photo =", value, "headPhoto");
return (Criteria) this;
}
public Criteria andHeadPhotoNotEqualTo(String value) {
addCriterion("head_photo <>", value, "headPhoto");
return (Criteria) this;
}
public Criteria andHeadPhotoGreaterThan(String value) {
addCriterion("head_photo >", value, "headPhoto");
return (Criteria) this;
}
public Criteria andHeadPhotoGreaterThanOrEqualTo(String value) {
addCriterion("head_photo >=", value, "headPhoto");
return (Criteria) this;
}
public Criteria andHeadPhotoLessThan(String value) {
addCriterion("head_photo <", value, "headPhoto");
return (Criteria) this;
}
public Criteria andHeadPhotoLessThanOrEqualTo(String value) {
addCriterion("head_photo <=", value, "headPhoto");
return (Criteria) this;
}
public Criteria andHeadPhotoLike(String value) {
addCriterion("head_photo like", value, "headPhoto");
return (Criteria) this;
}
public Criteria andHeadPhotoNotLike(String value) {
addCriterion("head_photo not like", value, "headPhoto");
return (Criteria) this;
}
public Criteria andHeadPhotoIn(List<String> values) {
addCriterion("head_photo in", values, "headPhoto");
return (Criteria) this;
}
public Criteria andHeadPhotoNotIn(List<String> values) {
addCriterion("head_photo not in", values, "headPhoto");
return (Criteria) this;
}
public Criteria andHeadPhotoBetween(String value1, String value2) {
addCriterion("head_photo between", value1, value2, "headPhoto");
return (Criteria) this;
}
public Criteria andHeadPhotoNotBetween(String value1, String value2) {
addCriterion("head_photo not between", value1, value2, "headPhoto");
return (Criteria) this;
}
public Criteria andPhoneIsNull() {
addCriterion("phone is null");
return (Criteria) this;
}
public Criteria andPhoneIsNotNull() {
addCriterion("phone is not null");
return (Criteria) this;
}
public Criteria andPhoneEqualTo(String value) {
addCriterion("phone =", value, "phone");
return (Criteria) this;
}
public Criteria andPhoneNotEqualTo(String value) {
addCriterion("phone <>", value, "phone");
return (Criteria) this;
}
public Criteria andPhoneGreaterThan(String value) {
addCriterion("phone >", value, "phone");
return (Criteria) this;
}
public Criteria andPhoneGreaterThanOrEqualTo(String value) {
addCriterion("phone >=", value, "phone");
return (Criteria) this;
}
public Criteria andPhoneLessThan(String value) {
addCriterion("phone <", value, "phone");
return (Criteria) this;
}
public Criteria andPhoneLessThanOrEqualTo(String value) {
addCriterion("phone <=", value, "phone");
return (Criteria) this;
}
public Criteria andPhoneLike(String value) {
addCriterion("phone like", value, "phone");
return (Criteria) this;
}
public Criteria andPhoneNotLike(String value) {
addCriterion("phone not like", value, "phone");
return (Criteria) this;
}
public Criteria andPhoneIn(List<String> values) {
addCriterion("phone in", values, "phone");
return (Criteria) this;
}
public Criteria andPhoneNotIn(List<String> values) {
addCriterion("phone not in", values, "phone");
return (Criteria) this;
}
public Criteria andPhoneBetween(String value1, String value2) {
addCriterion("phone between", value1, value2, "phone");
return (Criteria) this;
}
public Criteria andPhoneNotBetween(String value1, String value2) {
addCriterion("phone not between", value1, value2, "phone");
return (Criteria) this;
}
public Criteria andUserCategoryIsNull() {
addCriterion("user_category is null");
return (Criteria) this;
}
public Criteria andUserCategoryIsNotNull() {
addCriterion("user_category is not null");
return (Criteria) this;
}
public Criteria andUserCategoryEqualTo(Integer value) {
addCriterion("user_category =", value, "userCategory");
return (Criteria) this;
}
public Criteria andUserCategoryNotEqualTo(Integer value) {
addCriterion("user_category <>", value, "userCategory");
return (Criteria) this;
}
public Criteria andUserCategoryGreaterThan(Integer value) {
addCriterion("user_category >", value, "userCategory");
return (Criteria) this;
}
public Criteria andUserCategoryGreaterThanOrEqualTo(Integer value) {
addCriterion("user_category >=", value, "userCategory");
return (Criteria) this;
}
public Criteria andUserCategoryLessThan(Integer value) {
addCriterion("user_category <", value, "userCategory");
return (Criteria) this;
}
public Criteria andUserCategoryLessThanOrEqualTo(Integer value) {
addCriterion("user_category <=", value, "userCategory");
return (Criteria) this;
}
public Criteria andUserCategoryIn(List<Integer> values) {
addCriterion("user_category in", values, "userCategory");
return (Criteria) this;
}
public Criteria andUserCategoryNotIn(List<Integer> values) {
addCriterion("user_category not in", values, "userCategory");
return (Criteria) this;
}
public Criteria andUserCategoryBetween(Integer value1, Integer value2) {
addCriterion("user_category between", value1, value2, "userCategory");
return (Criteria) this;
}
public Criteria andUserCategoryNotBetween(Integer value1, Integer value2) {
addCriterion("user_category not between", value1, value2, "userCategory");
return (Criteria) this;
}
public Criteria andDutyIsNull() {
addCriterion("duty is null");
return (Criteria) this;
}
public Criteria andDutyIsNotNull() {
addCriterion("duty is not null");
return (Criteria) this;
}
public Criteria andDutyEqualTo(String value) {
addCriterion("duty =", value, "duty");
return (Criteria) this;
}
public Criteria andDutyNotEqualTo(String value) {
addCriterion("duty <>", value, "duty");
return (Criteria) this;
}
public Criteria andDutyGreaterThan(String value) {
addCriterion("duty >", value, "duty");
return (Criteria) this;
}
public Criteria andDutyGreaterThanOrEqualTo(String value) {
addCriterion("duty >=", value, "duty");
return (Criteria) this;
}
public Criteria andDutyLessThan(String value) {
addCriterion("duty <", value, "duty");
return (Criteria) this;
}
public Criteria andDutyLessThanOrEqualTo(String value) {
addCriterion("duty <=", value, "duty");
return (Criteria) this;
}
public Criteria andDutyLike(String value) {
addCriterion("duty like", value, "duty");
return (Criteria) this;
}
public Criteria andDutyNotLike(String value) {
addCriterion("duty not like", value, "duty");
return (Criteria) this;
}
public Criteria andDutyIn(List<String> values) {
addCriterion("duty in", values, "duty");
return (Criteria) this;
}
public Criteria andDutyNotIn(List<String> values) {
addCriterion("duty not in", values, "duty");
return (Criteria) this;
}
public Criteria andDutyBetween(String value1, String value2) {
addCriterion("duty between", value1, value2, "duty");
return (Criteria) this;
}
public Criteria andDutyNotBetween(String value1, String value2) {
addCriterion("duty not between", value1, value2, "duty");
return (Criteria) this;
}
public Criteria andStatusIsNull() {
addCriterion("status is null");
return (Criteria) this;
}
public Criteria andStatusIsNotNull() {
addCriterion("status is not null");
return (Criteria) this;
}
public Criteria andStatusEqualTo(Integer value) {
addCriterion("status =", value, "status");
return (Criteria) this;
}
public Criteria andStatusNotEqualTo(Integer value) {
addCriterion("status <>", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThan(Integer value) {
addCriterion("status >", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThanOrEqualTo(Integer value) {
addCriterion("status >=", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThan(Integer value) {
addCriterion("status <", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThanOrEqualTo(Integer value) {
addCriterion("status <=", value, "status");
return (Criteria) this;
}
public Criteria andStatusIn(List<Integer> values) {
addCriterion("status in", values, "status");
return (Criteria) this;
}
public Criteria andStatusNotIn(List<Integer> values) {
addCriterion("status not in", values, "status");
return (Criteria) this;
}
public Criteria andStatusBetween(Integer value1, Integer value2) {
addCriterion("status between", value1, value2, "status");
return (Criteria) this;
}
public Criteria andStatusNotBetween(Integer value1, Integer value2) {
addCriterion("status not between", value1, value2, "status");
return (Criteria) this;
}
public Criteria andWxOpenidIsNull() {
addCriterion("wx_openid is null");
return (Criteria) this;
}
public Criteria andWxOpenidIsNotNull() {
addCriterion("wx_openid is not null");
return (Criteria) this;
}
public Criteria andWxOpenidEqualTo(String value) {
addCriterion("wx_openid =", value, "wxOpenid");
return (Criteria) this;
}
public Criteria andWxOpenidNotEqualTo(String value) {
addCriterion("wx_openid <>", value, "wxOpenid");
return (Criteria) this;
}
public Criteria andWxOpenidGreaterThan(String value) {
addCriterion("wx_openid >", value, "wxOpenid");
return (Criteria) this;
}
public Criteria andWxOpenidGreaterThanOrEqualTo(String value) {
addCriterion("wx_openid >=", value, "wxOpenid");
return (Criteria) this;
}
public Criteria andWxOpenidLessThan(String value) {
addCriterion("wx_openid <", value, "wxOpenid");
return (Criteria) this;
}
public Criteria andWxOpenidLessThanOrEqualTo(String value) {
addCriterion("wx_openid <=", value, "wxOpenid");
return (Criteria) this;
}
public Criteria andWxOpenidLike(String value) {
addCriterion("wx_openid like", value, "wxOpenid");
return (Criteria) this;
}
public Criteria andWxOpenidNotLike(String value) {
addCriterion("wx_openid not like", value, "wxOpenid");
return (Criteria) this;
}
public Criteria andWxOpenidIn(List<String> values) {
addCriterion("wx_openid in", values, "wxOpenid");
return (Criteria) this;
}
public Criteria andWxOpenidNotIn(List<String> values) {
addCriterion("wx_openid not in", values, "wxOpenid");
return (Criteria) this;
}
public Criteria andWxOpenidBetween(String value1, String value2) {
addCriterion("wx_openid between", value1, value2, "wxOpenid");
return (Criteria) this;
}
public Criteria andWxOpenidNotBetween(String value1, String value2) {
addCriterion("wx_openid not between", value1, value2, "wxOpenid");
return (Criteria) this;
}
public Criteria andIntegralIsNull() {
addCriterion("integral is null");
return (Criteria) this;
}
public Criteria andIntegralIsNotNull() {
addCriterion("integral is not null");
return (Criteria) this;
}
public Criteria andIntegralEqualTo(Integer value) {
addCriterion("integral =", value, "integral");
return (Criteria) this;
}
public Criteria andIntegralNotEqualTo(Integer value) {
addCriterion("integral <>", value, "integral");
return (Criteria) this;
}
public Criteria andIntegralGreaterThan(Integer value) {
addCriterion("integral >", value, "integral");
return (Criteria) this;
}
public Criteria andIntegralGreaterThanOrEqualTo(Integer value) {
addCriterion("integral >=", value, "integral");
return (Criteria) this;
}
public Criteria andIntegralLessThan(Integer value) {
addCriterion("integral <", value, "integral");
return (Criteria) this;
}
public Criteria andIntegralLessThanOrEqualTo(Integer value) {
addCriterion("integral <=", value, "integral");
return (Criteria) this;
}
public Criteria andIntegralIn(List<Integer> values) {
addCriterion("integral in", values, "integral");
return (Criteria) this;
}
public Criteria andIntegralNotIn(List<Integer> values) {
addCriterion("integral not in", values, "integral");
return (Criteria) this;
}
public Criteria andIntegralBetween(Integer value1, Integer value2) {
addCriterion("integral between", value1, value2, "integral");
return (Criteria) this;
}
public Criteria andIntegralNotBetween(Integer value1, Integer value2) {
addCriterion("integral not between", value1, value2, "integral");
return (Criteria) this;
}
public Criteria andSignInCountIsNull() {
addCriterion("sign_in_count is null");
return (Criteria) this;
}
public Criteria andSignInCountIsNotNull() {
addCriterion("sign_in_count is not null");
return (Criteria) this;
}
public Criteria andSignInCountEqualTo(Integer value) {
addCriterion("sign_in_count =", value, "signInCount");
return (Criteria) this;
}
public Criteria andSignInCountNotEqualTo(Integer value) {
addCriterion("sign_in_count <>", value, "signInCount");
return (Criteria) this;
}
public Criteria andSignInCountGreaterThan(Integer value) {
addCriterion("sign_in_count >", value, "signInCount");
return (Criteria) this;
}
public Criteria andSignInCountGreaterThanOrEqualTo(Integer value) {
addCriterion("sign_in_count >=", value, "signInCount");
return (Criteria) this;
}
public Criteria andSignInCountLessThan(Integer value) {
addCriterion("sign_in_count <", value, "signInCount");
return (Criteria) this;
}
public Criteria andSignInCountLessThanOrEqualTo(Integer value) {
addCriterion("sign_in_count <=", value, "signInCount");
return (Criteria) this;
}
public Criteria andSignInCountIn(List<Integer> values) {
addCriterion("sign_in_count in", values, "signInCount");
return (Criteria) this;
}
public Criteria andSignInCountNotIn(List<Integer> values) {
addCriterion("sign_in_count not in", values, "signInCount");
return (Criteria) this;
}
public Criteria andSignInCountBetween(Integer value1, Integer value2) {
addCriterion("sign_in_count between", value1, value2, "signInCount");
return (Criteria) this;
}
public Criteria andSignInCountNotBetween(Integer value1, Integer value2) {
addCriterion("sign_in_count not between", value1, value2, "signInCount");
return (Criteria) this;
}
public Criteria andLastSignDtIsNull() {
addCriterion("last_sign_dt is null");
return (Criteria) this;
}
public Criteria andLastSignDtIsNotNull() {
addCriterion("last_sign_dt is not null");
return (Criteria) this;
}
public Criteria andLastSignDtEqualTo(Date value) {
addCriterion("last_sign_dt =", value, "lastSignDt");
return (Criteria) this;
}
public Criteria andLastSignDtNotEqualTo(Date value) {
addCriterion("last_sign_dt <>", value, "lastSignDt");
return (Criteria) this;
}
public Criteria andLastSignDtGreaterThan(Date value) {
addCriterion("last_sign_dt >", value, "lastSignDt");
return (Criteria) this;
}
public Criteria andLastSignDtGreaterThanOrEqualTo(Date value) {
addCriterion("last_sign_dt >=", value, "lastSignDt");
return (Criteria) this;
}
public Criteria andLastSignDtLessThan(Date value) {
addCriterion("last_sign_dt <", value, "lastSignDt");
return (Criteria) this;
}
public Criteria andLastSignDtLessThanOrEqualTo(Date value) {
addCriterion("last_sign_dt <=", value, "lastSignDt");
return (Criteria) this;
}
public Criteria andLastSignDtIn(List<Date> values) {
addCriterion("last_sign_dt in", values, "lastSignDt");
return (Criteria) this;
}
public Criteria andLastSignDtNotIn(List<Date> values) {
addCriterion("last_sign_dt not in", values, "lastSignDt");
return (Criteria) this;
}
public Criteria andLastSignDtBetween(Date value1, Date value2) {
addCriterion("last_sign_dt between", value1, value2, "lastSignDt");
return (Criteria) this;
}
public Criteria andLastSignDtNotBetween(Date value1, Date value2) {
addCriterion("last_sign_dt not between", value1, value2, "lastSignDt");
return (Criteria) this;
}
public Criteria andCreateDtIsNull() {
addCriterion("create_dt is null");
return (Criteria) this;
}
public Criteria andCreateDtIsNotNull() {
addCriterion("create_dt is not null");
return (Criteria) this;
}
public Criteria andCreateDtEqualTo(Date value) {
addCriterion("create_dt =", value, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtNotEqualTo(Date value) {
addCriterion("create_dt <>", value, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtGreaterThan(Date value) {
addCriterion("create_dt >", value, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtGreaterThanOrEqualTo(Date value) {
addCriterion("create_dt >=", value, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtLessThan(Date value) {
addCriterion("create_dt <", value, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtLessThanOrEqualTo(Date value) {
addCriterion("create_dt <=", value, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtIn(List<Date> values) {
addCriterion("create_dt in", values, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtNotIn(List<Date> values) {
addCriterion("create_dt not in", values, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtBetween(Date value1, Date value2) {
addCriterion("create_dt between", value1, value2, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtNotBetween(Date value1, Date value2) {
addCriterion("create_dt not between", value1, value2, "createDt");
return (Criteria) this;
}
public Criteria andLastLoginDtIsNull() {
addCriterion("last_login_dt is null");
return (Criteria) this;
}
public Criteria andLastLoginDtIsNotNull() {
addCriterion("last_login_dt is not null");
return (Criteria) this;
}
public Criteria andLastLoginDtEqualTo(Date value) {
addCriterion("last_login_dt =", value, "lastLoginDt");
return (Criteria) this;
}
public Criteria andLastLoginDtNotEqualTo(Date value) {
addCriterion("last_login_dt <>", value, "lastLoginDt");
return (Criteria) this;
}
public Criteria andLastLoginDtGreaterThan(Date value) {
addCriterion("last_login_dt >", value, "lastLoginDt");
return (Criteria) this;
}
public Criteria andLastLoginDtGreaterThanOrEqualTo(Date value) {
addCriterion("last_login_dt >=", value, "lastLoginDt");
return (Criteria) this;
}
public Criteria andLastLoginDtLessThan(Date value) {
addCriterion("last_login_dt <", value, "lastLoginDt");
return (Criteria) this;
}
public Criteria andLastLoginDtLessThanOrEqualTo(Date value) {
addCriterion("last_login_dt <=", value, "lastLoginDt");
return (Criteria) this;
}
public Criteria andLastLoginDtIn(List<Date> values) {
addCriterion("last_login_dt in", values, "lastLoginDt");
return (Criteria) this;
}
public Criteria andLastLoginDtNotIn(List<Date> values) {
addCriterion("last_login_dt not in", values, "lastLoginDt");
return (Criteria) this;
}
public Criteria andLastLoginDtBetween(Date value1, Date value2) {
addCriterion("last_login_dt between", value1, value2, "lastLoginDt");
return (Criteria) this;
}
public Criteria andLastLoginDtNotBetween(Date value1, Date value2) {
addCriterion("last_login_dt not between", value1, value2, "lastLoginDt");
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);
}
}
}
\ No newline at end of file
package com.server.web.common.model;
import java.util.Date;
public class TKzyUserIntegralFlowing extends BaseModel {
private Long id;
private Long userId;
private Integer integral;
private Integer sourceType;
private Integer type;
private Date createDt;
private String remark;
public TKzyUserIntegralFlowing(Long id, Long userId, Integer integral, Integer sourceType, Integer type, Date createDt, String remark) {
this.id = id;
this.userId = userId;
this.integral = integral;
this.sourceType = sourceType;
this.type = type;
this.createDt = createDt;
this.remark = remark;
}
public TKzyUserIntegralFlowing() {
super();
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public Integer getIntegral() {
return integral;
}
public void setIntegral(Integer integral) {
this.integral = integral;
}
public Integer getSourceType() {
return sourceType;
}
public void setSourceType(Integer sourceType) {
this.sourceType = sourceType;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public Date getCreateDt() {
return createDt;
}
public void setCreateDt(Date createDt) {
this.createDt = createDt;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark == null ? null : remark.trim();
}
}
\ No newline at end of file
package com.server.web.common.model;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class TKzyUserIntegralFlowingExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public TKzyUserIntegralFlowingExample() {
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 andUserIdIsNull() {
addCriterion("user_id is null");
return (Criteria) this;
}
public Criteria andUserIdIsNotNull() {
addCriterion("user_id is not null");
return (Criteria) this;
}
public Criteria andUserIdEqualTo(Long value) {
addCriterion("user_id =", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotEqualTo(Long value) {
addCriterion("user_id <>", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdGreaterThan(Long value) {
addCriterion("user_id >", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdGreaterThanOrEqualTo(Long value) {
addCriterion("user_id >=", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLessThan(Long value) {
addCriterion("user_id <", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLessThanOrEqualTo(Long value) {
addCriterion("user_id <=", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdIn(List<Long> values) {
addCriterion("user_id in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotIn(List<Long> values) {
addCriterion("user_id not in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdBetween(Long value1, Long value2) {
addCriterion("user_id between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotBetween(Long value1, Long value2) {
addCriterion("user_id not between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andIntegralIsNull() {
addCriterion("integral is null");
return (Criteria) this;
}
public Criteria andIntegralIsNotNull() {
addCriterion("integral is not null");
return (Criteria) this;
}
public Criteria andIntegralEqualTo(Integer value) {
addCriterion("integral =", value, "integral");
return (Criteria) this;
}
public Criteria andIntegralNotEqualTo(Integer value) {
addCriterion("integral <>", value, "integral");
return (Criteria) this;
}
public Criteria andIntegralGreaterThan(Integer value) {
addCriterion("integral >", value, "integral");
return (Criteria) this;
}
public Criteria andIntegralGreaterThanOrEqualTo(Integer value) {
addCriterion("integral >=", value, "integral");
return (Criteria) this;
}
public Criteria andIntegralLessThan(Integer value) {
addCriterion("integral <", value, "integral");
return (Criteria) this;
}
public Criteria andIntegralLessThanOrEqualTo(Integer value) {
addCriterion("integral <=", value, "integral");
return (Criteria) this;
}
public Criteria andIntegralIn(List<Integer> values) {
addCriterion("integral in", values, "integral");
return (Criteria) this;
}
public Criteria andIntegralNotIn(List<Integer> values) {
addCriterion("integral not in", values, "integral");
return (Criteria) this;
}
public Criteria andIntegralBetween(Integer value1, Integer value2) {
addCriterion("integral between", value1, value2, "integral");
return (Criteria) this;
}
public Criteria andIntegralNotBetween(Integer value1, Integer value2) {
addCriterion("integral not between", value1, value2, "integral");
return (Criteria) this;
}
public Criteria andSourceTypeIsNull() {
addCriterion("source_type is null");
return (Criteria) this;
}
public Criteria andSourceTypeIsNotNull() {
addCriterion("source_type is not null");
return (Criteria) this;
}
public Criteria andSourceTypeEqualTo(Integer value) {
addCriterion("source_type =", value, "sourceType");
return (Criteria) this;
}
public Criteria andSourceTypeNotEqualTo(Integer value) {
addCriterion("source_type <>", value, "sourceType");
return (Criteria) this;
}
public Criteria andSourceTypeGreaterThan(Integer value) {
addCriterion("source_type >", value, "sourceType");
return (Criteria) this;
}
public Criteria andSourceTypeGreaterThanOrEqualTo(Integer value) {
addCriterion("source_type >=", value, "sourceType");
return (Criteria) this;
}
public Criteria andSourceTypeLessThan(Integer value) {
addCriterion("source_type <", value, "sourceType");
return (Criteria) this;
}
public Criteria andSourceTypeLessThanOrEqualTo(Integer value) {
addCriterion("source_type <=", value, "sourceType");
return (Criteria) this;
}
public Criteria andSourceTypeIn(List<Integer> values) {
addCriterion("source_type in", values, "sourceType");
return (Criteria) this;
}
public Criteria andSourceTypeNotIn(List<Integer> values) {
addCriterion("source_type not in", values, "sourceType");
return (Criteria) this;
}
public Criteria andSourceTypeBetween(Integer value1, Integer value2) {
addCriterion("source_type between", value1, value2, "sourceType");
return (Criteria) this;
}
public Criteria andSourceTypeNotBetween(Integer value1, Integer value2) {
addCriterion("source_type not between", value1, value2, "sourceType");
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(Integer value) {
addCriterion("type =", value, "type");
return (Criteria) this;
}
public Criteria andTypeNotEqualTo(Integer value) {
addCriterion("type <>", value, "type");
return (Criteria) this;
}
public Criteria andTypeGreaterThan(Integer value) {
addCriterion("type >", value, "type");
return (Criteria) this;
}
public Criteria andTypeGreaterThanOrEqualTo(Integer value) {
addCriterion("type >=", value, "type");
return (Criteria) this;
}
public Criteria andTypeLessThan(Integer value) {
addCriterion("type <", value, "type");
return (Criteria) this;
}
public Criteria andTypeLessThanOrEqualTo(Integer value) {
addCriterion("type <=", value, "type");
return (Criteria) this;
}
public Criteria andTypeIn(List<Integer> values) {
addCriterion("type in", values, "type");
return (Criteria) this;
}
public Criteria andTypeNotIn(List<Integer> values) {
addCriterion("type not in", values, "type");
return (Criteria) this;
}
public Criteria andTypeBetween(Integer value1, Integer value2) {
addCriterion("type between", value1, value2, "type");
return (Criteria) this;
}
public Criteria andTypeNotBetween(Integer value1, Integer value2) {
addCriterion("type not between", value1, value2, "type");
return (Criteria) this;
}
public Criteria andCreateDtIsNull() {
addCriterion("create_dt is null");
return (Criteria) this;
}
public Criteria andCreateDtIsNotNull() {
addCriterion("create_dt is not null");
return (Criteria) this;
}
public Criteria andCreateDtEqualTo(Date value) {
addCriterion("create_dt =", value, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtNotEqualTo(Date value) {
addCriterion("create_dt <>", value, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtGreaterThan(Date value) {
addCriterion("create_dt >", value, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtGreaterThanOrEqualTo(Date value) {
addCriterion("create_dt >=", value, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtLessThan(Date value) {
addCriterion("create_dt <", value, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtLessThanOrEqualTo(Date value) {
addCriterion("create_dt <=", value, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtIn(List<Date> values) {
addCriterion("create_dt in", values, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtNotIn(List<Date> values) {
addCriterion("create_dt not in", values, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtBetween(Date value1, Date value2) {
addCriterion("create_dt between", value1, value2, "createDt");
return (Criteria) this;
}
public Criteria andCreateDtNotBetween(Date value1, Date value2) {
addCriterion("create_dt not between", value1, value2, "createDt");
return (Criteria) this;
}
public Criteria andRemarkIsNull() {
addCriterion("remark is null");
return (Criteria) this;
}
public Criteria andRemarkIsNotNull() {
addCriterion("remark is not null");
return (Criteria) this;
}
public Criteria andRemarkEqualTo(String value) {
addCriterion("remark =", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkNotEqualTo(String value) {
addCriterion("remark <>", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkGreaterThan(String value) {
addCriterion("remark >", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkGreaterThanOrEqualTo(String value) {
addCriterion("remark >=", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkLessThan(String value) {
addCriterion("remark <", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkLessThanOrEqualTo(String value) {
addCriterion("remark <=", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkLike(String value) {
addCriterion("remark like", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkNotLike(String value) {
addCriterion("remark not like", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkIn(List<String> values) {
addCriterion("remark in", values, "remark");
return (Criteria) this;
}
public Criteria andRemarkNotIn(List<String> values) {
addCriterion("remark not in", values, "remark");
return (Criteria) this;
}
public Criteria andRemarkBetween(String value1, String value2) {
addCriterion("remark between", value1, value2, "remark");
return (Criteria) this;
}
public Criteria andRemarkNotBetween(String value1, String value2) {
addCriterion("remark not between", value1, value2, "remark");
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);
}
}
}
\ No newline at end of file
package com.server.web.common.service.Impl;
import com.server.web.common.service.OpenSqlRingsService;
import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import org.springframework.stereotype.Service;
import org.springframework.transaction.TransactionDefinition;
import org.springframework.transaction.TransactionStatus;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.support.DefaultTransactionDefinition;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* 指环王工具
* Created by yinbin on 2018/1/12.
* 自定义sql执行工具类
* 功能:通过sql的命名空间,指定执行xml里的sql
* 1、增删改查
* 2、批量增加
*/
@Service
public class OpenSqlRingsServiceImpl implements OpenSqlRingsService {
@Autowired
private SqlSessionTemplate sqlSession;
// @Autowired
// private DataSourceTransactionManager transactionManager;
@Override
public Object selectOne_Rings(String statement, Map<String, Object> params) {
Object obj = sqlSession.selectOne(statement, params);
return obj;
}
@Override
public ArrayList<Object> selectList_Rings(String statement, Map<String, Object> params) {
ArrayList<Object> resultList = (ArrayList<Object>) sqlSession.selectList(statement, params);
return resultList;
}
@Override
@Transactional
public void insert_Rings(String statement, Map<String, Object> params) {
sqlSession.insert(statement, params);
}
@Override
@Transactional
public void delete_Rings(String statement, Map<String, Object> params) {
sqlSession.delete(statement, params);
}
@Override
@Transactional
public void update_Rings(String statement, Map<String, Object> params) {
sqlSession.update(statement, params);
}
@Override
@Transactional
public void insert_batch_Rings(String statement, List<Map<String, Object>> params) {
for (Map<String, Object> map : params) {
sqlSession.insert(statement, map);
}
}
@Override
public void insert_batch11_Rings(String statement, List<Map<String, Object>> params, int per) {
//
// //事物定义类
// DefaultTransactionDefinition transactionDefinition = new DefaultTransactionDefinition(TransactionDefinition.PROPAGATION_REQUIRED);
// //获取事物对象
// TransactionStatus status = transactionManager.getTransaction(transactionDefinition);
//
// try {
// for (Map<String, Object> map : params) {
// sqlSession.insert(statement, map);
// }
// //插入成功提交事物
// transactionManager.commit(status);
// } catch (Exception e) {
// //异常回滚事物
// transactionManager.rollback(status);
// }
}
}
package com.server.web.common.service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* Created by yinbin on 2018/1/15.
*/
public interface OpenSqlRingsService {
Object selectOne_Rings(String statement, Map<String, Object> params);
ArrayList<Object> selectList_Rings(String statement, Map<String, Object> params);
@Transactional
void insert_Rings(String statement, Map<String, Object> params);
@Transactional
void delete_Rings(String statement, Map<String, Object> params);
@Transactional
void update_Rings(String statement, Map<String, Object> params);
@Transactional
void insert_batch_Rings(String statement, List<Map<String, Object>> params);
void insert_batch11_Rings(String statement, List<Map<String, Object>> params, int per);
}
package com.server.web.controller;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.server.utils.ErrorCode;
import com.server.web.common.mapper.TBaseBannerMapper;
import com.server.web.common.model.PageModel;
import com.server.web.common.model.TBaseBanner;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* banner管理
*/
@RestController
@RequestMapping(BaseController.OSS_NAMESPACE + "/banner")
public class BannerController extends BaseController {
@Autowired
private TBaseBannerMapper bannerMapper;
/**
* Banner 查询
* @param request
* @param response
* @return
*/
@ResponseBody
@RequestMapping(value = "/queryBanner", method = {RequestMethod.POST, RequestMethod.GET}, produces = "application/json")
public Map<String,Object> queryBanner(int pageNo, int pageSize, HttpServletRequest request, HttpServletResponse response) {
if(pageNo<=0){
pageNo = 1;
}
if(pageSize==0){
pageSize = 10;
}
Map<String,Object> paramMap = new HashMap<String,Object>();
String title = request.getParameter("title");
if(StringUtils.hasText(title)){
paramMap.put("title","%"+title+"%");
}
PageHelper.startPage(pageNo, pageSize);
List list =this.openSqlRingsService.selectList_Rings("com.mapping.queryModel.queryBanner", paramMap);
PageInfo pageInfo = new PageInfo(list);
PageModel model = new PageModel();
model.setTotal(pageInfo.getTotal());
model.setList(list);
return success(model);
}
/**
* 删除banner
* @param id
* @param request
* @param response
* @return
*/
@ResponseBody
@RequestMapping(value = "/deleteBanner", method = {RequestMethod.POST, RequestMethod.GET}, produces = "application/json")
public Map<String,Object> deleteBanner(@RequestParam("id") Long id , HttpServletRequest request, HttpServletResponse response) {
try{
TBaseBanner banner = new TBaseBanner();
banner.setId(id);
banner.setIsDelete(1);
bannerMapper.updateByPrimaryKeySelective(banner);
return success("");
}catch (Exception e){
e.printStackTrace();
return error(ErrorCode.ERROR.getCode(),"服务器忙,请稍后重试~","服务器忙,请稍后重试~");
}
}
/**
* banner上下架
* @param id
* @param isUp 上下架状态 1 上架 2 下架
* @param request
* @param response
* @return
*/
@ResponseBody
@RequestMapping(value = "/updateIsUp", method = {RequestMethod.POST, RequestMethod.GET}, produces = "application/json")
public Map<String,Object> updateIsUp(@RequestParam("id") long id ,@RequestParam("isUp") int isUp, HttpServletRequest request, HttpServletResponse response) {
try{
if(isUp==1||isUp==2){
TBaseBanner banner = new TBaseBanner();
banner.setId(id);
banner.setIsUp(isUp);
bannerMapper.updateByPrimaryKeySelective(banner);
return success("");
}else{
return error(ErrorCode.ERROR.getCode(),"服务器忙,请稍后重试~","服务器忙,请稍后重试~");
}
}catch (Exception e){
e.printStackTrace();
return error(ErrorCode.ERROR.getCode(),"服务器忙,请稍后重试~","服务器忙,请稍后重试~");
}
}
/**
* 根据id查询banner
* @param id
* @param request
* @param response
* @return
*/
@ResponseBody
@RequestMapping(value = "/getBannerById", method = {RequestMethod.POST, RequestMethod.GET}, produces = "application/json")
public Map<String,Object> getBannerById(@RequestParam("id") Long id , HttpServletRequest request, HttpServletResponse response) {
try{
TBaseBanner baseBanner=bannerMapper.selectByPrimaryKey(id);
return success(baseBanner);
}catch (Exception e){
e.printStackTrace();
return error(ErrorCode.ERROR.getCode(),"服务器忙,请稍后重试~","服务器忙,请稍后重试~");
}
}
/**
* 保存修改banner
* @param request
* @param response
* @return
*/
@ResponseBody
@RequestMapping(value = "/saveOrUpdateBanner", method = {RequestMethod.POST, RequestMethod.GET}, produces = "application/json")
public Map<String,Object> saveOrUpdateBanner(HttpServletRequest request, HttpServletResponse response) {
try{
String id = request.getParameter("id");
TBaseBanner baseBanner = new TBaseBanner();
if(StringUtils.hasText(id)){
baseBanner.setId(Long.valueOf(id.trim()));
}else{
baseBanner.setCreateDt(new Date());
}
baseBanner.setTitle(request.getParameter("title"));
baseBanner.setPicUrl(request.getParameter("picUrl"));
baseBanner.setJumpType(Integer.valueOf(request.getParameter("jumpType")));
baseBanner.setJumpAddress(request.getParameter("jumpAddress"));
if(StringUtils.hasText(request.getParameter("weight"))){
baseBanner.setWeight(Integer.valueOf(request.getParameter("weight")));
}else{
baseBanner.setWeight(1);
}
baseBanner.setRemark(request.getParameter("remark"));
baseBanner.setIsDelete(0);
baseBanner.setIsUp(1);
if(baseBanner.getId()!=null){
bannerMapper.updateByPrimaryKeySelective(baseBanner);
}else{
baseBanner.setCreateDt(new Date());
bannerMapper.insertSelective(baseBanner);
}
return success("");
}catch (Exception e){
e.printStackTrace();
return error(ErrorCode.ERROR.getCode(),"服务器忙,请稍后重试~","服务器忙,请稍后重试~");
}
}
}
package com.server.web.controller;
import com.server.shiro.constants.Constants;
import com.server.shiro.persistent.bean.SysUser;
import com.server.utils.ErrorCode;
import com.server.utils.StrUtils;
import com.server.web.common.service.OpenSqlRingsService;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;
/**
* Created by Administrator on 2018/3/10.
*/
public class BaseController {
public final static String OSS_NAMESPACE = "/rest/kzy/oss";
public int pageNo = 0;
public int pageSize = 10;
@Autowired
public OpenSqlRingsService openSqlRingsService;
/**
* 返回成功
* @param obj
* @return
*/
public Map<String,Object> success(Object obj){
Map<String,Object> returnResult = new HashMap<String,Object>();
returnResult.put("status", ErrorCode.SUCCESS.getCode());
returnResult.put("message",ErrorCode.SUCCESS.getMessage());
returnResult.put("data",obj);
return returnResult;
}
/**
* 返回失败
* @param code
* @param message
* @param obj
* @return
*/
public Map<String,Object> error(String code, String message ,Object obj){
Map<String,Object> returnResult = new HashMap<String,Object>();
returnResult.put("status", code);
returnResult.put("message",message);
returnResult.put("data",obj);
return returnResult;
}
public Pageable getPageable(HttpServletRequest request) {
String pPage = request.getParameter("page");
String pRows = request.getParameter("rows");
int page = 0;
int size = 10;
if (StrUtils.isNumber(pPage)) {
page = Integer.parseInt(pPage);
}
if (StrUtils.isNumber(pRows)) {
size = Integer.parseInt(pRows);
}
Sort sort = getSort(request);
if (sort != null) {
return new PageRequest(page, size, sort);
}
return new PageRequest(page, size);
}
public Sort getSort(HttpServletRequest request) {
String orderBy = request.getParameter("sort");
String order = request.getParameter("order");
if (StrUtils.isBlank(orderBy)) {
return null;
}
if (Sort.Direction.DESC.name().equalsIgnoreCase(order)) {
order = Sort.Direction.DESC.name();
} else {
order = Sort.Direction.ASC.name();
}
return new Sort(Sort.Direction.fromString(order), orderBy);
}
public SysUser getSysUser(){
return (SysUser) SecurityUtils.getSubject().getSession().getAttribute(Constants.SESSION_USER_INFO);
}
}
package com.server.web.controller;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.server.utils.ErrorCode;
import com.server.web.common.model.PageModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 分类管理
*/
@RestController
@RequestMapping(BaseController.OSS_NAMESPACE + "/class")
public class ClassController extends BaseController {
// @Autowired
// private TBaseClassMapper classMapper;
//
//
//
// /**
// * 查询所有分类
// * @param request
// * @param response
// * @return
// */
// @ResponseBody
// @RequestMapping(value = "/queryClassAllList", method = {RequestMethod.POST, RequestMethod.GET}, produces = "application/json")
// public Map<String,Object> queryClassAllList(HttpServletRequest request, HttpServletResponse response) {
// Map<String,Object> paramMap = new HashMap<String,Object>();
// paramMap.put("status",1);
// List list =this.openSqlRingsService.selectList_Rings("com.mapping.queryModel.queryClass", paramMap);
// return success(list);
// }
//
//
//
// /**
// * 分类 查询
// * @param request
// * @param response
// * @return
// */
// @ResponseBody
// @RequestMapping(value = "/queryClass", method = {RequestMethod.POST, RequestMethod.GET}, produces = "application/json")
// public Map<String,Object> queryClass(int pageNo, int pageSize, HttpServletRequest request, HttpServletResponse response) {
// if(pageNo<=0){
// pageNo = 1;
// }
// if(pageSize==0){
// pageSize = 10;
// }
// Map<String,Object> paramMap = new HashMap<String,Object>();
// String className = request.getParameter("className");//类型 1 APP 2 微信 3 PC 4 小程序
// if(StringUtils.hasText(className)){
// paramMap.put("className","%"+className+"%");
// }
// PageHelper.startPage(pageNo, pageSize);
// List list =this.openSqlRingsService.selectList_Rings("com.mapping.queryModel.queryClass", paramMap);
// PageInfo pageInfo = new PageInfo(list);
// PageModel model = new PageModel();
// model.setTotal(pageInfo.getTotal());
// model.setList(list);
// return success(model);
// }
//
//
// /**
// * 分类启用关闭
// * @param id
// * @param status 状态 1 启用 0 关闭
// * @param request
// * @param response
// * @return
// */
// @ResponseBody
// @RequestMapping(value = "/updateStatus", method = {RequestMethod.POST, RequestMethod.GET}, produces = "application/json")
// public Map<String,Object> updateStatus(@RequestParam("id") long id , @RequestParam("status") int status, HttpServletRequest request, HttpServletResponse response) {
// try{
// if(status==0||status==1){
// TBaseClass baseClass = new TBaseClass();
// baseClass.setId(id);
// baseClass.setStatus(status);
// classMapper.updateByPrimaryKeySelective(baseClass);
// return success("");
// }else{
// return error(ErrorCode.ERROR.getCode(),"服务器忙,请稍后重试~","服务器忙,请稍后重试~");
// }
// }catch (Exception e){
// e.printStackTrace();
// return error(ErrorCode.ERROR.getCode(),"服务器忙,请稍后重试~","服务器忙,请稍后重试~");
// }
// }
//
// /**
// * 根据id查询分类
// * @param id
// * @param request
// * @param response
// * @return
// */
// @ResponseBody
// @RequestMapping(value = "/getClassById", method = {RequestMethod.POST, RequestMethod.GET}, produces = "application/json")
// public Map<String,Object> getClassById(@RequestParam("id") Long id , HttpServletRequest request, HttpServletResponse response) {
// try{
// TBaseClass baseClass=classMapper.selectByPrimaryKey(id);
// return success(baseClass);
// }catch (Exception e){
// e.printStackTrace();
// return error(ErrorCode.ERROR.getCode(),"服务器忙,请稍后重试~","服务器忙,请稍后重试~");
// }
// }
// /**
// * 保存修改分类
// * @param request
// * @param response
// * @return
// */
// @ResponseBody
// @RequestMapping(value = "/saveOrUpdateClass", method = {RequestMethod.POST, RequestMethod.GET}, produces = "application/json")
// public Map<String,Object> saveOrUpdateClass(HttpServletRequest request, HttpServletResponse response) {
// try{
// String id = request.getParameter("id");
// TBaseClass baseClass = new TBaseClass();
// if(StringUtils.hasText(id)){
// baseClass.setId(Long.valueOf(id.trim()));
// }else{
// baseClass.setCreateDt(new Date());
// }
// baseClass.setClassName(request.getParameter("className"));
// if(StringUtils.hasText(request.getParameter("fid"))){
// baseClass.setLevel(2);
// baseClass.setFid(Long.valueOf(request.getParameter("fid")));
// }else{
// baseClass.setLevel(1);
// }
// if(StringUtils.hasText(request.getParameter("status"))){
// baseClass.setStatus(Integer.valueOf(request.getParameter("status")));
// }else{
// baseClass.setStatus(1);
// }
// baseClass.setPicUrl(request.getParameter("picUrl"));
// if(StringUtils.hasText(request.getParameter("weight"))){
// baseClass.setWeight(Integer.valueOf(request.getParameter("weight")));
// }else{
// baseClass.setWeight(1);
// }
// if(baseClass.getId()!=null){
// classMapper.updateByPrimaryKeySelective(baseClass);
// }else{
// classMapper.insertSelective(baseClass);
// }
// return success("");
// }catch (Exception e){
// e.printStackTrace();
// return error(ErrorCode.ERROR.getCode(),"服务器忙,请稍后重试~","服务器忙,请稍后重试~");
// }
// }
}
package com.server.web.controller;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.server.shiro.persistent.bean.SysUser;
import com.server.utils.DateUtils;
import com.server.web.common.model.PageModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 课程管理
*/
@RestController
@RequestMapping(BaseController.OSS_NAMESPACE + "/course")
public class CourseController extends BaseController {
// @Autowired
// TSjCourseMapper courseMapper;
//
// @Autowired
// CourseService courseService;
//
// /**
// * 直播列表
// * @param courseName
// * @param pageNo
// * @param pageSize
// * @return
// */
// @ResponseBody
// @RequestMapping(path = "/zbList", method = {RequestMethod.POST, RequestMethod.GET}, produces = "application/json")
// public Map zbList(@RequestParam(defaultValue = "") String courseName
// ,@RequestParam(defaultValue = "1") Integer pageNo, @RequestParam(defaultValue = "1") Integer pageSize) {
// try {
// Map paramMap = new HashMap<>();
// if(!("").equals(courseName)){
// paramMap.put("courseName","%"+courseName+"%");
// }
// PageHelper.startPage(pageNo,pageSize,true,false);
// List list = openSqlRingsService.selectList_Rings("com.mapping.queryModel.queryCourseZb",paramMap);
// PageInfo pageInfo = new PageInfo(list);
// PageModel model = new PageModel();
// model.setTotal(pageInfo.getTotal());
// model.setList(list);
// return success(model);
// } catch (Exception e) {
// e.printStackTrace();
// return error("0","系统异常",null);
// }
// }
//
// /**
// * 录播列表
// * @param courseName
// * @param pageNo
// * @param pageSize
// * @return
// */
// @ResponseBody
// @RequestMapping(path = "/lbList", method = {RequestMethod.POST, RequestMethod.GET}, produces = "application/json")
// public Map lbList(@RequestParam(defaultValue = "") String courseName
// ,@RequestParam(defaultValue = "1") Integer pageNo, @RequestParam(defaultValue = "1") Integer pageSize) {
// try {
// Map paramMap = new HashMap<>();
// if(!("").equals(courseName)){
// paramMap.put("courseName","%"+courseName+"%");
// }
// PageHelper.startPage(pageNo,pageSize,true,false);
// List list = openSqlRingsService.selectList_Rings("com.mapping.queryModel.queryCourseLb",paramMap);
// PageInfo pageInfo = new PageInfo(list);
// PageModel model = new PageModel();
// model.setTotal(pageInfo.getTotal());
// model.setList(list);
// return success(model);
// } catch (Exception e) {
// e.printStackTrace();
// return error("0","系统异常",null);
// }
// }
//
// /**
// * 上下架录播课
// * @param id
// * @param status
// * @return
// */
// @ResponseBody
// @RequestMapping(path = "/courseStatus", method = {RequestMethod.POST, RequestMethod.GET}, produces = "application/json")
// public Map courseStatus(@RequestParam long id,@RequestParam int status) {
// try {
// SysUser user =getSysUser();
// TSjCourse course = new TSjCourse();
// course.setId(id);
// course.setIsUp(status);
// course.setUpdateDt(new Date());
// course.setEditorId(user.getId());
// course.setEditorName(user.getRealname());
// courseMapper.updateByPrimaryKeySelective(course);
// return success("操作成功");
// } catch (Exception e) {
// e.printStackTrace();
// return error("0","系统异常",null);
// }
// }
//
// /**
// * 删除直播课
// * @param id
// * @return
// */
// @ResponseBody
// @RequestMapping(path = "/deleteCourse", method = {RequestMethod.POST, RequestMethod.GET}, produces = "application/json")
// public Map deleteCourse(@RequestParam long id) {
// try {
// SysUser user =getSysUser();
// TSjCourse course = new TSjCourse();
// course.setId(id);
// course.setIsDelete(1);
// course.setUpdateDt(new Date());
// course.setEditorId(user.getId());
// course.setEditorName(user.getRealname());
// courseMapper.updateByPrimaryKeySelective(course);
// return success("操作成功");
// } catch (Exception e) {
// e.printStackTrace();
// return error("0","系统异常",null);
// }
// }
//
//
// /**
// * 添加修改直播课
// * @param id
// * @param courseName
// * @param dateRange
// * @param picUrl
// * @param courseIntroduce
// * @param liveUrl
// * @return
// */
// @ResponseBody
// @RequestMapping(path = "/saveZbCourse", method = {RequestMethod.POST, RequestMethod.GET}, produces = "application/json")
// public Map saveZbCourse(@RequestParam(defaultValue = "-1") long id,@RequestParam String courseName,@RequestParam String dateRange,
// @RequestParam String picUrl,@RequestParam String courseIntroduce,@RequestParam String liveUrl,@RequestParam(defaultValue = "") String classIds,
// @RequestParam String startDt,@RequestParam String endDt) {
// try {
// SysUser user =getSysUser();
// TSjCourse course = new TSjCourse();
// course.setCourseName(courseName);
// course.setPicUrl(picUrl);
// course.setCourseIntroduce(courseIntroduce);
// course.setLiveUrl(liveUrl);
// course.setEditorId(user.getId());
// course.setEditorName(user.getRealname());
// Date start = DateUtils.parse("yyyy-MM-dd HH:mm:ss",startDt);
// Date end = DateUtils.parse("yyyy-MM-dd HH:mm:ss", endDt);
// course.setStartDt(start);
// course.setEndDt(end);
// if(id != -1){ //修改
// course.setId(id);
// course.setUpdateDt(new Date());
// courseService.updateCourse(course,classIds);
// }else{ //添加
// course.setCreateDt(new Date());
// course.setIsDelete(0);
// course.setIsUp(1);
// course.setCourseType(1);
// courseService.insertCourse(course,classIds);
// }
// return success("操作成功");
// } catch (Exception e) {
// e.printStackTrace();
// return error("0","系统异常",null);
// }
// }
//
//
// /**
// * 添加修改录播课
// * @param id
// * @param courseName
// * @param picUrl
// * @param courseIntroduce
// * @param liveUrl
// * @return
// */
// @ResponseBody
// @RequestMapping(path = "/saveLbCourse", method = {RequestMethod.POST, RequestMethod.GET}, produces = "application/json")
// public Map saveLbCourse(@RequestParam(defaultValue = "-1") long id,@RequestParam String courseName,
// @RequestParam String picUrl,@RequestParam String courseIntroduce,@RequestParam(defaultValue = "") String liveUrl,@RequestParam(defaultValue = "") String classIds) {
// try {
// SysUser user =getSysUser();
// TSjCourse course = new TSjCourse();
// course.setCourseName(courseName);
// course.setPicUrl(picUrl);
// course.setCourseIntroduce(courseIntroduce);
// if(!("").equals(liveUrl)) {
// course.setLiveUrl(liveUrl);
// }
// course.setEditorId(user.getId());
// course.setEditorName(user.getRealname());
// if(id != -1){ //修改
// course.setId(id);
// course.setUpdateDt(new Date());
// courseService.updateCourse(course,classIds);
// }else{ //添加
// course.setCreateDt(new Date());
// course.setIsDelete(0);
// course.setIsUp(2);
// course.setCourseType(2);
// courseService.insertCourse(course,classIds);
// }
// return success("操作成功");
// } catch (Exception e) {
// e.printStackTrace();
// return error("0","系统异常",null);
// }
// }
//
// /**
// * 直播详情
// * @param id
// * @return
// */
// @ResponseBody
// @RequestMapping(path = "/zbCourseInfo", method = {RequestMethod.POST, RequestMethod.GET}, produces = "application/json")
// public Map zbCourseInfo(@RequestParam long id) {
// try {
// Map paramMap = new HashMap<>();
// paramMap.put("id",id);
// Map map = (Map)openSqlRingsService.selectOne_Rings("com.mapping.queryModel.queryCourseZbInfo",paramMap);
// List classList = openSqlRingsService.selectList_Rings("com.mapping.queryModel.queryCourseClass",paramMap);
// map.put("classList",classList);
// return success(map);
// } catch (Exception e) {
// e.printStackTrace();
// return error("0","系统异常",null);
// }
// }
//
// /**
// * 录播详情
// * @param id
// * @return
// */
// @ResponseBody
// @RequestMapping(path = "/lbCourseInfo", method = {RequestMethod.POST, RequestMethod.GET}, produces = "application/json")
// public Map lbCourseInfo(@RequestParam long id) {
// try {
// Map paramMap = new HashMap<>();
// paramMap.put("id",id);
// Map map = (Map)openSqlRingsService.selectOne_Rings("com.mapping.queryModel.queryCourseLbInfo",paramMap);
// List classList = openSqlRingsService.selectList_Rings("com.mapping.queryModel.queryCourseClass",paramMap);
// map.put("classList",classList);
// return success(map);
// } catch (Exception e) {
// e.printStackTrace();
// return error("0","系统异常",null);
// }
// }
//
// /**
// * 获取类目集合
// * @param className
// * @return
// */
// @ResponseBody
// @RequestMapping(path = "/queryClassList", method = {RequestMethod.POST, RequestMethod.GET}, produces = "application/json")
// public Map queryClassList(@RequestParam(defaultValue = "") String className) {
// try {
// Map paramMap = new HashMap<>();
// if(!("").equals(className)){
// paramMap.put("className","%"+className+"%");
// }
// List classList = openSqlRingsService.selectList_Rings("com.mapping.queryModel.queryClassList",paramMap);
// return success(classList);
// } catch (Exception e) {
// e.printStackTrace();
// return error("0","系统异常",null);
// }
// }
}
package com.server.web.controller;
import com.alibaba.fastjson.JSONObject;
import com.server.shiro.persistent.bean.SysUser;
import com.server.shiro.persistent.service.LoginService;
import com.server.utils.MD5;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping(BaseController.OSS_NAMESPACE + "/login")
public class LoginController {
@Autowired
private LoginService loginService;
/**
* 登录
*
* @return
*/
@PostMapping("/auth")
public JSONObject authLogin(@RequestParam String username,@RequestParam String password) {
// CommonUtil.hasAllRequired(requestJson, "username,password");
JSONObject obj=new JSONObject();
obj.put("username",username);
obj.put("password", MD5.md5(MD5.md5(password)));
return loginService.authLogin(obj);
}
/**
* 查询当前登录用户的信息
*
* @return
*/
@PostMapping("/getInfo")
public SysUser getInfo() {
return loginService.getInfo();
}
/**
* 登出
*
* @return
*/
@GetMapping("/logout")
public void logout() {
loginService.logout();
}
}
package com.server.web.controller;
import com.server.shiro.persistent.bean.*;
import com.server.shiro.persistent.repository.MenuRepository;
import com.server.shiro.persistent.repository.RoleRepository;
import com.server.shiro.persistent.repository.SysRuleRepository;
import com.server.shiro.persistent.service.SysRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataIntegrityViolationException;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import java.sql.Timestamp;
import java.util.*;
/**
* 后台角色管理
*/
@RestController
@RequestMapping(BaseController.OSS_NAMESPACE + "/role")
public class RoleController extends BaseController {
@Autowired
SysRoleService roleService;
@Autowired
RoleRepository roleRepository;
@Autowired
MenuRepository menuRepository;
@Autowired
SysRuleRepository ruleRepository;
/**
* 角色查询分页
*
* @param request
* @param roleQuery
* @return
*/
@RequestMapping(value = "/queryRole", method = {RequestMethod.POST, RequestMethod.GET}, produces = "application/json")
public Map<String,Object> queryRole(HttpServletRequest request, SysRoleQuery roleQuery) {
try {
return success(roleService.findSysRolePage(getPageable(request), roleQuery));
} catch (Exception e) {
e.printStackTrace();
return error("-1", "操作失败", "");
}
}
/**
* 角色保存
*
* @param request
* @param role
* @return
*/
@RequestMapping(value = "/saveRole", method = {RequestMethod.POST, RequestMethod.GET}, produces = "application/json")
public Map<String,Object> saveRole(HttpServletRequest request, SysRole role) {
try {
if (StringUtils.hasText(role.getRoleCode()) && StringUtils.hasText(role.getRoleName())) {
List roleList = roleRepository.findByRoleCode(role.getRoleCode());
if (roleList != null && roleList.size() > 0) {
return error("-1", "角色编码已被使用", "");
} else {
role.setStatus("1");
role.setCreateTime(new Timestamp(new Date().getTime()));
role.setUpdateTime(new Timestamp(new Date().getTime()));
roleRepository.save(role);
return success(role.getId());
}
} else {
return error("-1", "角色编码和名称不能为空", "");
}
} catch (Exception e) {
e.printStackTrace();
return error("-1", "操作失败", "");
}
}
/**
* 角色修改
*
* @param request
* @param role
* @return
*/
@RequestMapping(value = "/updateRole", method = {RequestMethod.POST, RequestMethod.GET}, produces = "application/json")
// @RequiresPermissions("role:update")
public Map<String,Object> updateRole(HttpServletRequest request, SysRole role) {
try {
if (StringUtils.hasText(role.getRoleCode()) && StringUtils.hasText(role.getRoleName())) {
SysRole oldRule = roleRepository.findOne(role.getId());
if (oldRule.getRoleCode().equals(role.getRoleCode())) {
oldRule.setRoleCode(role.getRoleCode());
oldRule.setRoleName(role.getRoleName());
oldRule.setRemarks(role.getRemarks());
oldRule.setUpdateTime(new Timestamp(new Date().getTime()));
oldRule.setStatus(role.getStatus());
roleRepository.save(oldRule);
return success(role.getId());
} else {
List ruleList = roleRepository.findByRoleCode(role.getRoleCode());
if (ruleList != null && ruleList.size() > 0) {
return error("-1", "角色编码已被使用", "");
} else {
oldRule.setRoleCode(role.getRoleCode());
oldRule.setRoleName(role.getRoleName());
oldRule.setRemarks(role.getRemarks());
oldRule.setUpdateTime(new Timestamp(new Date().getTime()));
oldRule.setStatus(role.getStatus());
roleRepository.save(oldRule);
return success(oldRule.getId());
}
}
} else {
return error("-1", "角色编码和名称不能为空", "");
}
} catch (Exception e) {
e.printStackTrace();
return error("-1", "操作失败", "");
}
}
/**
* 根据角色ID获取角色权限信息
*/
@RequestMapping(value = "/getRoleRule", method = {RequestMethod.POST, RequestMethod.GET}, produces = "application/json")
// @RequiresPermissions("role:info")
public Map<String,Object> getRoleRule(HttpServletRequest request, SysRole role) {
try {
role = roleRepository.findOne(role.getId());
return success(role);
} catch (Exception e) {
e.printStackTrace();
return error("-1", "操作失败", "");
}
}
/**
* 获取角色权限ID
* @param request
* @param role
* @return
*/
@RequestMapping(value = "/getRuleId", method = {RequestMethod.POST, RequestMethod.GET}, produces = "application/json")
public Map<String,Object> getRuleId(HttpServletRequest request, SysRole role) {
try {
role = roleRepository.findOne(role.getId());
Set<SysRule> rule = role.getRules();
String ruleId ="";
for (SysRule r :rule){
ruleId +=r.getId()+",";
}
return success(ruleId);
} catch (Exception e) {
e.printStackTrace();
System.out.println();
return error("-1", "操作失败", "");
}
}
/**
* 保存角色和权限关系
*/
@RequestMapping(value = "/saveRoleRule", method = {RequestMethod.POST, RequestMethod.GET}, produces = "application/json")
// @RequiresPermissions("role:saveRoleRule")
public Map<String,Object> saveRoleRule(HttpServletRequest request, @RequestParam("id") Long roleId,@RequestParam("roles") String ruleId) {
try {
SysRole role = roleRepository.findOne(roleId);
List<String> result = Arrays.asList(ruleId.split(","));
Set<SysRule> ruleHashSet = new HashSet<SysRule>();
for (String r : result) {
SysRule rule = ruleRepository.findOne(Long.valueOf(r));
ruleHashSet.add(rule);
}
role.setRules(ruleHashSet);
roleRepository.save(role);
return success(role.getId());
} catch (Exception e) {
e.printStackTrace();
return error("-1", "操作失败", "");
}
}
/**
* 菜单查询分页
*
* @param request
* @param menuQuery
* @return
*/
@RequestMapping(value = "/queryMenuByQuery", method = {RequestMethod.POST, RequestMethod.GET}, produces = "application/json")
public Map<String,Object> queryMenuByQuery(HttpServletRequest request, SysMenuQuery menuQuery) {
try {
return success(roleService.findSysMenuPage(getPageable(request), menuQuery));
} catch (Exception e) {
e.printStackTrace();
return error("-1", "操作失败", "");
}
}
/**
* 菜单查询
*/
@RequestMapping(value = "/queryMenu", method = {RequestMethod.POST, RequestMethod.GET}, produces = "application/json")
public Map<String,Object> queryMenu() {
List<SysMenu> list = menuRepository.findByLevel(1l);
try {
for (SysMenu m : list) {
//设置二级菜单
List<SysMenu> sub = menuRepository.findByParentid(m.getId());
m.setSubMenu(sub);
}
return success(list);
} catch (Exception e) {
e.printStackTrace();
return error("-1", "操作失败", "");
}
}
/**
* 菜单保存
*
* @param request
* @param menu
* @return
*/
@RequestMapping(value = "/saveMenu", method = {RequestMethod.POST, RequestMethod.GET}, produces = "application/json")
// @RequiresPermissions("menu:save")
public Map<String,Object> saveMenu(HttpServletRequest request, SysMenu menu) {
try {
if (StringUtils.hasText(menu.getMenuCode()) && StringUtils.hasText(menu.getMenuName())) {
List list = menuRepository.findByMenuCode(menu.getMenuCode());
if (list != null && list.size() > 0) {
return error("-1", "模块编码已被使用", "");
} else {
menuRepository.save(menu);
return success(menu.getId());
}
} else {
return error("-1", "模块编码和名称不能为空", "");
}
} catch (Exception e) {
e.printStackTrace();
return error("-1", "操作失败", "");
}
}
/**
* 菜单修改
*
* @param request
* @param menu
* @return
*/
@RequestMapping(value = "/updateMenu", method = {RequestMethod.POST, RequestMethod.GET}, produces = "application/json")
// @RequiresPermissions("menu:update")
public Map<String,Object> updateMenu(HttpServletRequest request, SysMenu menu) {
try {
if (StringUtils.hasText(menu.getMenuCode()) && StringUtils.hasText(menu.getMenuName())) {
SysMenu oldMenu = menuRepository.findOne(menu.getId());
if (oldMenu.getMenuCode().equals(menu.getMenuCode())) {
menuRepository.save(menu);
return success(menu.getId());
} else {
List list = menuRepository.findByMenuCode(menu.getMenuCode());
if (list != null && list.size() > 0) {
return error("-1", "模块编码已被使用", "");
} else {
menuRepository.save(menu);
return success(menu.getId());
}
}
} else {
return error("-1", "模块编码和名称不能为空", "");
}
} catch (Exception e) {
e.printStackTrace();
return error("-1", "操作失败", "");
}
}
/**
* 删除菜单
*
* @param request
* @param menu
* @return
*/
@RequestMapping(value = "/deleteMenu", method = {RequestMethod.POST, RequestMethod.GET}, produces = "application/json")
// @RequiresPermissions("menu:update")
public Map<String,Object> deleteMenu(HttpServletRequest request, SysMenu menu) {
try {
menuRepository.delete(menu.getId());
return success("操作成功");
}catch (DataIntegrityViolationException e){
e.printStackTrace();
return error("-1", "该模块已绑定,请先解绑后删除!", "");
} catch (Exception e) {
e.printStackTrace();
return error("-1", "操作失败", "");
}
}
}
package com.server.web.controller;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.server.web.common.model.PageModel;
import org.springframework.web.bind.annotation.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 用户管理
*/
@RestController
@RequestMapping(BaseController.OSS_NAMESPACE + "/sjuser")
public class SjUserController extends BaseController {
/**
* 用户列表
* @param fullName
* @param nickName
* @param department
* @param phone
* @param pageNo
* @param pageSize
* @return
*/
@ResponseBody
@RequestMapping(path = "/list", method = {RequestMethod.POST, RequestMethod.GET}, produces = "application/json")
public Map list(@RequestParam(defaultValue = "") String fullName,@RequestParam(defaultValue = "") String nickName,
@RequestParam(defaultValue = "") String department,@RequestParam(defaultValue = "") String phone
,@RequestParam(defaultValue = "1") Integer pageNo, @RequestParam(defaultValue = "1") Integer pageSize) {
try {
Map paramMap = new HashMap<>();
if(!("").equals(fullName)){
paramMap.put("fullName","%"+fullName+"%");
}
if(!("").equals(nickName)){
paramMap.put("nickName","%"+nickName+"%");
}
if(!("").equals(department)){
paramMap.put("department","%"+department+"%");
}
if(!("").equals(phone)){
paramMap.put("phone",phone);
}
PageHelper.startPage(pageNo,pageSize,true,false);
List list = openSqlRingsService.selectList_Rings("com.mapping.queryModel.queryUser",paramMap);
PageInfo pageInfo = new PageInfo(list);
PageModel model = new PageModel();
model.setTotal(pageInfo.getTotal());
model.setList(list);
return success(model);
} catch (Exception e) {
e.printStackTrace();
return error("0","系统异常",null);
}
}
}
package com.server.web.controller;
import com.server.shiro.context.PermissionManage;
import com.server.shiro.persistent.bean.SysPermission;
import com.server.shiro.persistent.bean.SysPermissionQuery;
import com.server.shiro.persistent.bean.SysRule;
import com.server.shiro.persistent.bean.SysRuleQuery;
import com.server.shiro.persistent.repository.SysPermissionRepository;
import com.server.shiro.persistent.repository.SysRuleRepository;
import com.server.shiro.persistent.service.SysRuleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.sql.Timestamp;
import java.util.*;
/**
* 权限contorller
*/
@RestController
@RequestMapping(BaseController.OSS_NAMESPACE + "/rule")
public class SysRuleContorller extends BaseController {
@Autowired
SysRuleService ruleService;
@Autowired
SysPermissionRepository sysPermissionRepository;
@Autowired
SysRuleRepository ruleRepository;
@Autowired
PermissionManage permissionManage;
/**
* 权限查询分页
* @param request
* @param ruleQuery
* @return
*/
@ResponseBody
@RequestMapping(value = "/queryRule", method = {RequestMethod.POST,RequestMethod.GET},produces = "application/json")
public Map<String,Object> queryRule(HttpServletRequest request, SysRuleQuery ruleQuery){
try{
return success(ruleService.findSysRulePage(getPageable(request),ruleQuery));
}catch (Exception e){
e.printStackTrace();
return error("-1", "操作失败", "");
}
}
/**
* 权限保存
* @param request
* @param rule
* @return
*/
@ResponseBody
@RequestMapping(value = "/saveRule", method = {RequestMethod.POST,RequestMethod.GET},produces = "application/json")
// @RequiresPermissions("rule:save")
public Map<String,Object> saveRule(HttpServletRequest request,SysRule rule){
try{
if(StringUtils.hasText(rule.getRuleCode())&&StringUtils.hasText(rule.getRuleName())){
List ruleList =this.ruleRepository.findByRuleCode(rule.getRuleCode());
if(ruleList!=null&&ruleList.size()>0){
return error("-1", "权限编码已被使用", "");
}else{
rule.setStatus("1");
rule.setCreateTime(new Timestamp(new Date().getTime()));
rule.setUpdateTime(new Timestamp(new Date().getTime()));
this.ruleRepository.save(rule);
return success(rule.getId());
}
}else{
return error("-1", "权限编码和名称不能为空", "");
}
}catch (Exception e){
e.printStackTrace();
return error("-1", "操作失败", "");
}
}
/**
* 权限修改
* @param request
* @param rule
* @return
*/
@ResponseBody
@RequestMapping(value = "/updateRule", method = {RequestMethod.POST,RequestMethod.GET},produces = "application/json")
// @RequiresPermissions("rule:update")
public Map<String,Object> updateRule(HttpServletRequest request,SysRule rule){
try{
if(StringUtils.hasText(rule.getRuleCode())&&StringUtils.hasText(rule.getRuleName())){
SysRule oldRule = this.ruleRepository.findOne(rule.getId());
if(oldRule.getRuleCode().equals(rule.getRuleCode())){
rule.setCreateTime(oldRule.getCreateTime());
rule.setUpdateTime(new Timestamp(new Date().getTime()));
this.ruleRepository.save(rule);
return success(rule.getId());
}else{
List ruleList =this.ruleRepository.findByRuleCode(rule.getRuleCode());
if(ruleList!=null&&ruleList.size()>0){
return error("-1", "权限编码已被使用", "");
}else{
rule.setCreateTime(oldRule.getCreateTime());
rule.setUpdateTime(new Timestamp(new Date().getTime()));
this.ruleRepository.save(rule);
return success(rule.getId());
}
}
}else{
return error("-1", "权限编码和名称不能为空", "");
}
}catch (Exception e){
e.printStackTrace();
return error("-1", "操作失败", "");
}
}
/**
* 根据权限id查询权限信息
* @param request
* @param ruleId
* @return
*/
@ResponseBody
@RequestMapping(value = "/getRuleById", method = {RequestMethod.POST,RequestMethod.GET},produces = "application/json")
// @RequiresPermissions("rule:info")
public Map<String,Object> getRuleById(HttpServletRequest request,@RequestParam String ruleId){
try{
if(StringUtils.hasText(ruleId)){
SysRule sysRule =this.ruleRepository.findOne(Long.valueOf(ruleId.trim()));
if(sysRule!=null){
return success(sysRule);
}else{
return error("-1","权限不存在","");
}
}else{
return error("-1","权限不存在","");
}
}catch (Exception e){
e.printStackTrace();
return error("-1","操作失败","");
}
}
/**
* 根据权限id查询资源id
* @param request
* @param ruleId
* @return
*/
@ResponseBody
@RequestMapping(value = "/getPermissionByRuleId", method = {RequestMethod.POST,RequestMethod.GET},produces = "application/json")
public Map<String,Object> getPermissionByRuleId(HttpServletRequest request,@RequestParam("id") String ruleId){
try{
if(StringUtils.hasText(ruleId)){
SysRule sysRule =this.ruleRepository.findOne(Long.valueOf(ruleId.trim()));
if(sysRule!=null){
String permissionId ="";
if(sysRule.getPermissions()!=null){
for (SysPermission permission:sysRule.getPermissions()){
if(StringUtils.hasText(permissionId)){
permissionId =permissionId+","+String.valueOf(permission.getId());
}else{
permissionId = String.valueOf(permission.getId());
}
}
}
return success(permissionId);
}else{
return error("-1","权限不存在","");
}
}else{
return error("-1","权限不存在","");
}
}catch (Exception e){
e.printStackTrace();
return error("-1","操作失败","");
}
}
/**
* 给权限设置资源
* @param request
* @param ruleId
* @param permissionIds
* @return
*/
@ResponseBody
@RequestMapping(value = "/updateRulePermission", method = {RequestMethod.POST,RequestMethod.GET},produces = "application/json")
// @RequiresPermissions("rule:updateRulePermission")
public Map<String,Object> updateRulePermission(HttpServletRequest request,@RequestParam("id") String ruleId,@RequestParam("roles") String permissionIds){
try{
if(StringUtils.hasText(ruleId)&&StringUtils.hasText(permissionIds)){
SysRule sysRule =this.ruleRepository.findOne(Long.valueOf(ruleId.trim()));
if(sysRule!=null){
String[] permissionIdList = permissionIds.split(",");
Set<SysPermission> permissionSet = new HashSet<SysPermission>();
for(String permissionId:permissionIdList){
SysPermission sysPermission= this.sysPermissionRepository.findOne(Long.valueOf(permissionId.trim()));
if(sysPermission!=null){
permissionSet.add(sysPermission);
}
}
sysRule.setPermissions(permissionSet);
this.ruleRepository.save(sysRule);
permissionManage.reloadPermission();
return success(sysRule.getId());
}else{
return error("-1","权限不存在","");
}
}else{
return error("-1","操作失败,缺少参数","");
}
}catch (Exception e){
e.printStackTrace();
return error("-1","操作失败","");
}
}
/**
* 资源查询分页
* @param request
* @param permissionQuery
* @return
*/
@ResponseBody
@RequestMapping(value = "/queryPermissionPage", method = {RequestMethod.POST,RequestMethod.GET},produces = "application/json")
public Map<String,Object> queryPermissionPage(HttpServletRequest request,SysPermissionQuery permissionQuery){
try{
return success(ruleService.findSysPermissionPage(getPageable(request),permissionQuery));
}catch (Exception e){
e.printStackTrace();
return error("-1", "操作失败", "");
}
}
/**
* 资源保存
* @param request
* @param permission
* @return
*/
@ResponseBody
@RequestMapping(value = "/savePermission", method = {RequestMethod.POST,RequestMethod.GET},produces = "application/json")
// @RequiresPermissions("permission:save")
public Map<String,Object> savePermission(HttpServletRequest request,SysPermission permission){
try{
if(StringUtils.hasText(permission.getPermissionCode())&&StringUtils.hasText(permission.getPermissionName())){
List permissionList =this.sysPermissionRepository.findByPermissionCode(permission.getPermissionCode());
if(permissionList!=null&&permissionList.size()>0){
return error("-1", "资源编码已被使用", "");
}else{
if(permission.getStatus()==null){
permission.setStatus(1L);
}
this.sysPermissionRepository.save(permission);
return success(permission.getId());
}
}else{
return error("-1", "资源编码和名称不能为空", "");
}
}catch (Exception e){
e.printStackTrace();
return error("-1", "操作失败", "");
}
}
/**
* 根据资源id,查询资源信息
* @param request
* @param permissionId
* @return
*/
@ResponseBody
@RequestMapping(value = "/getSysPermissioneById", method = {RequestMethod.POST,RequestMethod.GET},produces = "application/json")
// @RequiresPermissions("permission:info")
public Map<String,Object> getSysPermissioneById(HttpServletRequest request,@RequestParam String permissionId){
try{
if(StringUtils.hasText(permissionId)){
SysPermission permission =this.sysPermissionRepository.findOne(Long.valueOf(permissionId.trim()));
if(permission!=null){
return success(permission);
}else{
return error("-1","资源不存在","");
}
}else{
return error("-1","资源不存在","");
}
}catch (Exception e){
e.printStackTrace();
return error("-1","操作失败","");
}
}
/**
* 资源修改
* @param request
* @param permission
* @return
*/
@ResponseBody
@RequestMapping(value = "/updatePermission", method = {RequestMethod.POST,RequestMethod.GET},produces = "application/json")
// @RequiresPermissions("permission:update")
public Map<String,Object> updatePermission(HttpServletRequest request,SysPermission permission){
try{
if(StringUtils.hasText(permission.getPermissionCode())&&StringUtils.hasText(permission.getPermissionName())){
SysPermission oldPermission = this.sysPermissionRepository.findOne(permission.getId());
if(oldPermission.getPermissionCode().equals(permission.getPermissionCode())){
this.sysPermissionRepository.save(permission);
return success(permission.getId());
}else{
List permissionList =this.sysPermissionRepository.findByPermissionCode(permission.getPermissionCode());
if(permissionList!=null&&permissionList.size()>0){
return error("-1", "资源编码已被使用", "");
}else{
this.sysPermissionRepository.save(permission);
return success(permission.getId());
}
}
}else{
return error("-1", "资源编码和名称不能为空", "");
}
}catch (Exception e){
e.printStackTrace();
return error("-1", "操作失败", "");
}
}
}
package com.server.web.controller;
import com.server.utils.FileStore;
import com.server.utils.key.QiniuKey;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.util.Map;
/**
* 上传图片
*/
@RestController
@RequestMapping(BaseController.OSS_NAMESPACE +"/upload")
public class UploadController extends BaseController {
private Logger log = LoggerFactory.getLogger(UploadController.class);
@Autowired
FileStore fileStore;
@Autowired
QiniuKey qiniuKey;
@ResponseBody
@RequestMapping(path = "/image", method = {RequestMethod.POST, RequestMethod.GET}, produces = "application/json")
// @RequiresPermissions("upload:image")
public Map uploadImage(@RequestParam("file") MultipartFile file) {
try {
String url = fileStore.storeImage("", file);
return success(qiniuKey.getUrl()+url);
} catch (Exception e) {
e.printStackTrace();
return error("0","上传错误",null);
}
}
@ResponseBody
@RequestMapping(path = "/chatImage", method = {RequestMethod.POST, RequestMethod.GET}, produces = "application/json")
// @RequiresPermissions("upload:chatImage")
public Map uploadChatImage(@RequestParam("file") MultipartFile file) {
try {
String url = fileStore.storeImage("chatImage", file);
return success(qiniuKey.getUrl()+url);
} catch (Exception e) {
e.printStackTrace();
return error("0","上传错误",null);
}
}
}
package com.server.web.controller;
import com.server.shiro.context.PermissionManage;
import com.server.shiro.persistent.bean.*;
import com.server.shiro.persistent.repository.MenuRepository;
import com.server.shiro.persistent.repository.RoleRepository;
import com.server.shiro.persistent.repository.UserRepository;
import com.server.shiro.persistent.service.SysRoleService;
import com.server.shiro.persistent.service.UserService;
import com.server.utils.MD5;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* 后台用户管理
*/
@RestController
@RequestMapping(BaseController.OSS_NAMESPACE + "/user")
public class UserController extends BaseController {
@Autowired
UserRepository userRepository;
@Autowired
MenuRepository menuRepository;
@Autowired
RoleRepository roleRepository;
@Autowired
UserService userService;
@Autowired
SysRoleService sysRoleService;
@Autowired
PermissionManage permissionManage;
/**
* 添加修改用户信息
* @param id
* @param username
* @param password
* @param realname
* @param phone
* @param remarks
* @param status
* @return
*/
@ResponseBody
@RequestMapping(value = "/save", method = {RequestMethod.POST,RequestMethod.GET},produces = "application/json")
// @RequiresPermissions("user:save")
public Map<String,Object> save(@RequestParam(defaultValue = "-1") long id,
@RequestParam String username,
@RequestParam(defaultValue = "") String password,
@RequestParam String realname,
@RequestParam String phone,
@RequestParam(defaultValue = "") String remarks,
@RequestParam long status,
@RequestParam int departmentId) {
try {
SysUser user = null;
if(id == -1){ //添加
user = userRepository.getByUsernameIs(username);
if(user != null){
return error("-1", "用户名已存在", "");
}
user = new SysUser();
user.setCreateTime(new Date());
}else{ //修改
user = userRepository.findOne(id);
if (user == null) {
return error("-1", "用户不存在", "");
}
}
user.setUsername(username);
user.setPhone(phone);
if((StringUtils.hasText(password))){
user.setPassword(MD5.md5(MD5.md5(password)));
}
user.setRealname(realname);
user.setStatus(status);
user.setRemarks(remarks);
userRepository.save(user);
permissionManage.reloadPermission();
return success("成功");
} catch (Exception e) {
e.printStackTrace();
return error("-1", "添加用户异常", "");
}
}
/**
* 查询用户信息
* @param id
* @return
*/
@ResponseBody
@RequestMapping(value = "/findOne", method = {RequestMethod.POST,RequestMethod.GET},produces = "application/json")
// @RequiresPermissions("user:info")
public Map<String,Object> findOne(@RequestParam long id) {
try {
SysUser user = userRepository.findOne(id);
return success(user);
} catch (Exception e) {
e.printStackTrace();
return error("-1", "添加用户异常", "");
}
}
/**
* 用户列表
* @param request
* @param userQuery
* @return
*/
@ResponseBody
@RequestMapping(value = "/queryUserList", method = {RequestMethod.POST,RequestMethod.GET},produces = "application/json")
public Map<String,Object> queryUserList(HttpServletRequest request,SysUserQuery userQuery){
try{
return success(userService.findSysUserPage(getPageable(request),userQuery));
}catch (Exception e){
e.printStackTrace();
return error("-1", "操作失败", "");
}
}
/**
* 用户模块列表
* @param id
* @return
*/
@ResponseBody
@RequestMapping(value = "/menuList", method = {RequestMethod.POST,RequestMethod.GET},produces = "application/json")
// @RequiresPermissions("user:menuList")
public Map<String,Object> menuList(@RequestParam long id) {
try {
SysUser user = userRepository.findOne(id); //查询选中用户
List<SysMenu> list = menuRepository.findAll();
List<UserMenuModel> menuList = userService.getMenu(user,list);
return success(menuList);
} catch (Exception e) {
e.printStackTrace();
return error("-1", "添加用户异常", "");
}
}
/**
* 获取用户角色列表
* @param id
* @return
*/
@ResponseBody
@RequestMapping(value = "/roleList", method = {RequestMethod.POST,RequestMethod.GET},produces = "application/json")
// @RequiresPermissions("user:roleList")
public Map<String,Object> roleList(HttpServletRequest request, long id,SysRoleQuery roleQuery) {
try {
SysUser user = userRepository.findOne(id); //查询选中用户
Page<SysRole> rolePage = sysRoleService.findSysRolePage(getPageable(request),roleQuery);
return success(rolePage);
} catch (Exception e) {
e.printStackTrace();
return error("-1", "添加用户异常", "");
}
}
/**
* 获取当前用户所有角色ID
* @param id
* @return
*/
@ResponseBody
@RequestMapping(value = "/getUserRole", method = {RequestMethod.POST,RequestMethod.GET},produces = "application/json")
public Map<String,Object> getUserRole(@RequestParam long id) {
try {
SysUser user = userRepository.findOne(id); //查询选中用户
String roles = "";
for (SysRole role:user.getRoles()){
roles+=role.getId()+",";
}
return success(roles);
} catch (Exception e) {
e.printStackTrace();
return error("-1", "添加用户异常", "");
}
}
/**
* 用户分配模块
* @param id
* @param menus
* @return
*/
@ResponseBody
@RequestMapping(value = "/saveUserMenu", method = {RequestMethod.POST,RequestMethod.GET},produces = "application/json")
// @RequiresPermissions("user:saveMenu")
public Map<String,Object> saveUserMenu(@RequestParam long id,@RequestParam String menus) {
try {
SysUser user = userRepository.findOne(id); //查询选中用户
String menu [] = menus.split(",");
Set<SysMenu> menuSet = user.getMenus();
menuSet.clear();
for (String m :menu){
SysMenu sysMenu = menuRepository.findOne(new Long(m));
menuSet.add(sysMenu);
}
user.setMenus(menuSet);
userRepository.save(user);
return success("成功");
} catch (Exception e) {
e.printStackTrace();
return error("-1", "用户分配模块异常", "");
}
}
/**
* 用户分配角色
* @param id
* @param roles
* @return
*/
@ResponseBody
@RequestMapping(value = "/saveUserRole", method = {RequestMethod.POST,RequestMethod.GET},produces = "application/json")
// @RequiresPermissions("user:saveRole")
public Map<String,Object> saveUserRole(@RequestParam long id,@RequestParam String roles) {
try {
SysUser user = userRepository.findOne(id); //查询选中用户
String role [] = roles.split(",");
Set<SysRole> roleSet = user.getRoles();
roleSet.clear();
for (String r :role){
SysRole sysRole = roleRepository.findOne(new Long(r));
roleSet.add(sysRole);
}
user.setRoles(roleSet);
userRepository.save(user);
return success("成功");
} catch (Exception e) {
e.printStackTrace();
return error("-1", "用户分配角色异常", "");
}
}
/**
* 修改用户密码
* @param password
* @return
*/
@ResponseBody
@RequestMapping(value = "/updatePassword", method = {RequestMethod.POST,RequestMethod.GET},produces = "application/json")
// @RequiresPermissions("user:save")
public Map<String,Object> updatePassword(@RequestParam String password) {
try {
SysUser sysUser = getSysUser();
SysUser user = userRepository.findOne(sysUser.getId());
user.setPassword(MD5.md5(MD5.md5(password)));
userRepository.save(user);
return success("成功");
} catch (Exception e) {
e.printStackTrace();
return error("-1", "添加用户异常", "");
}
}
public static void main(String[] args) {
System.out.println(MD5.md5(MD5.md5("V2tPg0.wgJ4")));
}
}
package com.server.web.controller;
import com.server.utils.FileStore;
import com.server.utils.key.QiniuKey;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.util.HashMap;
import java.util.Map;
/**
* 135上传图片
*/
@RestController
@RequestMapping(BaseController.OSS_NAMESPACE +"/webUpload")
public class WebUploadController extends BaseController {
private Logger log = LoggerFactory.getLogger(WebUploadController.class);
@Autowired
FileStore fileStore;
@Autowired
QiniuKey qiniuKey;
@ResponseBody
@RequestMapping(path = "/image", method = {RequestMethod.POST, RequestMethod.GET}, produces = "application/json")
// @RequiresPermissions("upload:image")
public Map uploadImage(@RequestParam("file") MultipartFile file) {
try {
Map map = new HashMap<>();
String url = fileStore.storeImage("", file);
map.put("state","SUCCESS");
map.put("url",qiniuKey.getUrl()+url);
map.put("title","img");
map.put("original","img");
return map;
} catch (Exception e) {
Map map = new HashMap<>();
map.put("state","ERROR");
map.put("url","");
map.put("title","");
map.put("original","");
e.printStackTrace();
return map;
}
}
@ResponseBody
@RequestMapping(path = "/chatImage", method = {RequestMethod.POST, RequestMethod.GET}, produces = "application/json")
// @RequiresPermissions("upload:chatImage")
public Map uploadChatImage(@RequestParam("file") MultipartFile file) {
try {
String url = fileStore.storeImage("chatImage", file);
return success(qiniuKey.getUrl()+url);
} catch (Exception e) {
e.printStackTrace();
return error("0","上传错误",null);
}
}
}
package com.server.web.interceptor;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* Created by yinbin on 2018/1/9.
*/
@Component
public class InterceptorLocal implements HandlerInterceptor {
final static Logger logger = LogManager.getLogger(InterceptorLocal.class);
@Override
public boolean preHandle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o) throws Exception {
logger.debug("preHandle");
return true;
}
@Override
public void postHandle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o, ModelAndView modelAndView) throws Exception {
logger.debug("postHandle");
}
@Override
public void afterCompletion(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o, Exception e) throws Exception {
logger.debug("afterCompletion");
}
}
server.port=${port:8081}
server.tomcat.max-threads=1000
spring.datasource.driverClassName = com.mysql.jdbc.Driver
spring.datasource.url = jdbc:mysql://192.168.0.105:3306/sj_sc?useUnicode=true&characterEncoding=utf-8
spring.datasource.username = mysql
spring.datasource.password = 123456
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.format_sql=true
spring.jackson.serialization.indent-output=true
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect
mybatis.type-aliases-package=com.server.web.model
#mybatis.mapper-locations=classpath:com/server/mapper/mybatis/*.xml
mybatis.mapper-locations=classpath:mybatis/mapper/*.xml,classpath:mybatis/mapping/*.xml
mybatis.config-location=classpath:mybatis/mybatis-config.xml
## Redis 配置
# Redis数据库索引(默认为0)
spring.redis.database=0
# Redis服务器地址
spring.redis.host=192.168.0.105
# Redis服务器连接端口
spring.redis.port=6379
# Redis服务器连接密码(默认为空)
spring.redis.password=WebRedis123
# 连接池最大连接数(使用负值表示没有限制)
spring.redis.pool.max-active=30
# 连接池最大阻塞等待时间(使用负值表示没有限制)
spring.redis.pool.max-wait=-1
# 连接池中的最大空闲连接
spring.redis.pool.max-idle=8
# 连接池中的最小空闲连接
spring.redis.pool.min-idle=0
# 连接超时时间(毫秒)
spring.redis.timeout=0
#如果本服务为api服务,可以进行如下配置
#是否开始debug模式,false加密并且验签。true调试模式,不加密,不验签
rest.api.debug=true
#编码
rest.api.charset=utf-8
#加密secret_key
rest.api.secretkey=FoK28EsYrxuiM3ohnAurFGm2uGAHyijL
////////////////////////////////////////////////////////////////////
// _ooOoo_ //
// o8888888o //
// 88" . "88 //
// (| ^_^ |) //
// O\ = /O //
// ____/`---'\____ //
// .' \\| |// `. //
// / \\||| : |||// \ //
// / _||||| -:- |||||- \ //
// | | \\\ - /// | | //
// | \_| ''\---/'' | | //
// \ .-\__ `-` ___/-. / //
// ___`. .' /--.--\ `. . ___ //
// ."" '< `.___\_<|>_/___.' >'"". //
// | | : `- \`.;`\ _ /`;.`/ - ` : | | //
// \ \ `-. \_ __\ /__ _/ .-` / / //
// ========`-.____`-.___\_____/___.-`____.-'======== //
// `=---=' //
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ //
// 佛祖保佑 永不宕机 永无BUG //
////////////////////////////////////////////////////////////////////
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE generatorConfiguration
PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN"
"http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">
<generatorConfiguration>
<!--导入属性配置 -->
<properties resource="mbg/generator.properties"></properties>
<!--指定特定数据库的jdbc驱动jar包的位置 -->
<classPathEntry location="F:\mysql\mysql-connector-java-5.1.44.jar"/>
<context id="default" targetRuntime="MyBatis3">
<!-- optional,旨在创建class时,对注释进行控制 -->
<commentGenerator>
<property name="suppressDate" value="true"/>
<property name="suppressAllComments" value="true" />
</commentGenerator>
<!--jdbc的数据库连接 -->
<jdbcConnection driverClass="${jdbc.driverClass}" connectionURL="${jdbc.connectionURL}" userId="${jdbc.userId}"
password="${jdbc.password}">
</jdbcConnection>
<!-- 非必需,类型处理器,在数据库类型和java类型之间的转换控制-->
<javaTypeResolver>
<property name="forceBigDecimals" value="false"/>
</javaTypeResolver>
<!-- Model模型生成器,用来生成含有主键key的类,记录类 以及查询Example类
targetPackage 指定生成的model生成所在的包名
targetProject 指定在该项目下所在的路径
-->
<javaModelGenerator targetPackage="com.server.web.common.model" targetProject="src/main/java">
<!-- 是否对model添加 构造函数 -->
<property name="constructorBased" value="true"/>
<!-- 是否允许子包,即targetPackage.schemaName.tableName -->
<property name="enableSubPackages" value="false"/>
<!-- 建立的Model对象是否 不可改变 即生成的Model对象不会有 setter方法,只有构造方法 -->
<property name="immutable" value="false"/>
<!-- 给Model添加一个父类 -->
<property name="rootClass" value="com.server.web.common.model.BaseModel"/>
<!-- 是否对类CHAR类型的列的数据进行trim操作 -->
<property name="trimStrings" value="true"/>
</javaModelGenerator>
<!--Mapper映射文件生成所在的目录 为每一个数据库的表生成对应的SqlMap文件 -->
<sqlMapGenerator targetPackage="mybatis.mapper" targetProject="src/main/resources">
<property name="enableSubPackages" value="false"/>
</sqlMapGenerator>
<!--<javaClientGenerator type="XMLMAPPER"-->
<!--targetPackage="com.server.web.common.mapper" targetProject="src/main/java">-->
<!--<property name="enableSubPackages" value="true" />-->
<!--</javaClientGenerator>-->
<!--<sqlMapGenerator targetPackage="mybatis.mapper" targetProject="src/main/resources" >-->
<!--<property name="enableSubPackages" value="true" />-->
<!--<property name="trimStrings" value="true" />-->
<!--</sqlMapGenerator>-->
<!--
客户端代码,生成易于使用的针对Model对象和XML配置文件 的代码
type="ANNOTATEDMAPPER",生成Java Model 和基于注解的Mapper对象
type="MIXEDMAPPER",生成基于注解的Java Model 和相应的Mapper对象
type="XMLMAPPER",生成SQLMap XML文件和独立的Mapper接口
-->
<javaClientGenerator targetPackage="com.server.web.common.mapper" targetProject="src/main/java" type="XMLMAPPER">
<property name="exampleMethodVisibility" value="public"/>
</javaClientGenerator>
<table tableName="t_base_banner" schema="kzy_db_test">
<generatedKey column="ID" sqlStatement="JDBC" identity="true"/>
</table>
<table tableName="t_base_first_class" schema="kzy_db_test">
<generatedKey column="ID" sqlStatement="JDBC" identity="true"/>
</table>
<table tableName="t_base_second_class" schema="kzy_db_test">
<generatedKey column="ID" sqlStatement="JDBC" identity="true"/>
</table>
<table tableName="t_kzy_comment" schema="kzy_db_test">
<generatedKey column="ID" sqlStatement="JDBC" identity="true"/>
</table>
<table tableName="t_kzy_course" schema="kzy_db_test">
<generatedKey column="ID" sqlStatement="JDBC" identity="true"/>
</table>
<table tableName="t_kzy_information" schema="kzy_db_test">
<generatedKey column="ID" sqlStatement="JDBC" identity="true"/>
</table>
<table tableName="t_kzy_relation_class" schema="kzy_db_test">
<generatedKey column="ID" sqlStatement="JDBC" identity="true"/>
</table>
<table tableName="t_kzy_user" schema="kzy_db_test">
<generatedKey column="ID" sqlStatement="JDBC" identity="true"/>
</table>
<table tableName="t_kzy_user_integral_flowing" schema="kzy_db_test">
<generatedKey column="ID" sqlStatement="JDBC" identity="true"/>
</table>
</context>
</generatorConfiguration>
\ No newline at end of file
log4j.rootLogger=info,stdout,E
log4j.logger.com.server.web.common.mapper=DEBUG
##########控制台#############
log4j.appender.stdout = org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target = System.out
log4j.appender.stdout.layout = org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern = %d{ABSOLUTE} %5p %c{1}:%L - %m%n
##########ERROR#############
log4j.appender.E = org.apache.log4j.RollingFileAppender
log4j.appender.E.File = ../error.log
log4j.appender.E.MaxFileSize = 10240KB
log4j.appender.E.Encoding = UTF-8
log4j.appender.E.Threshold = ERROR
log4j.appender.E.layout = org.apache.log4j.PatternLayout
log4j.appender.E.MaxBackupIndex = 10
\ No newline at end of file
jdbc.driverLocation=
jdbc.driverClass=com.mysql.jdbc.Driver
jdbc.connectionURL=jdbc:mysql://39.97.246.118:3306/kzy_db_test?useUnicode=true&characterEncoding=utf-8
jdbc.userId=kzy_user
jdbc.password=Kzy2020#yY
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.server.web.common.mapper.TBaseBannerMapper">
<resultMap id="BaseResultMap" type="com.server.web.common.model.TBaseBanner">
<constructor>
<idArg column="id" javaType="java.lang.Long" jdbcType="BIGINT" />
<arg column="title" javaType="java.lang.String" jdbcType="VARCHAR" />
<arg column="pic_url" javaType="java.lang.String" jdbcType="VARCHAR" />
<arg column="weight" javaType="java.lang.Integer" jdbcType="INTEGER" />
<arg column="jump_type" javaType="java.lang.Integer" jdbcType="INTEGER" />
<arg column="jump_address" javaType="java.lang.String" jdbcType="VARCHAR" />
<arg column="remark" javaType="java.lang.String" jdbcType="VARCHAR" />
<arg column="is_delete" javaType="java.lang.Integer" jdbcType="INTEGER" />
<arg column="is_up" javaType="java.lang.Integer" jdbcType="INTEGER" />
<arg column="create_dt" javaType="java.util.Date" jdbcType="TIMESTAMP" />
</constructor>
</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, title, pic_url, weight, jump_type, jump_address, remark, is_delete, is_up, create_dt
</sql>
<select id="selectByExample" parameterType="com.server.web.common.model.TBaseBannerExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from t_base_banner
<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_base_banner
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from t_base_banner
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.server.web.common.model.TBaseBannerExample">
delete from t_base_banner
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.server.web.common.model.TBaseBanner" useGeneratedKeys="true">
insert into t_base_banner (title, pic_url, weight,
jump_type, jump_address, remark,
is_delete, is_up, create_dt
)
values (#{title,jdbcType=VARCHAR}, #{picUrl,jdbcType=VARCHAR}, #{weight,jdbcType=INTEGER},
#{jumpType,jdbcType=INTEGER}, #{jumpAddress,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR},
#{isDelete,jdbcType=INTEGER}, #{isUp,jdbcType=INTEGER}, #{createDt,jdbcType=TIMESTAMP}
)
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.server.web.common.model.TBaseBanner" useGeneratedKeys="true">
insert into t_base_banner
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="title != null">
title,
</if>
<if test="picUrl != null">
pic_url,
</if>
<if test="weight != null">
weight,
</if>
<if test="jumpType != null">
jump_type,
</if>
<if test="jumpAddress != null">
jump_address,
</if>
<if test="remark != null">
remark,
</if>
<if test="isDelete != null">
is_delete,
</if>
<if test="isUp != null">
is_up,
</if>
<if test="createDt != null">
create_dt,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="title != null">
#{title,jdbcType=VARCHAR},
</if>
<if test="picUrl != null">
#{picUrl,jdbcType=VARCHAR},
</if>
<if test="weight != null">
#{weight,jdbcType=INTEGER},
</if>
<if test="jumpType != null">
#{jumpType,jdbcType=INTEGER},
</if>
<if test="jumpAddress != null">
#{jumpAddress,jdbcType=VARCHAR},
</if>
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
<if test="isDelete != null">
#{isDelete,jdbcType=INTEGER},
</if>
<if test="isUp != null">
#{isUp,jdbcType=INTEGER},
</if>
<if test="createDt != null">
#{createDt,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.server.web.common.model.TBaseBannerExample" resultType="java.lang.Long">
select count(*) from t_base_banner
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update t_base_banner
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.title != null">
title = #{record.title,jdbcType=VARCHAR},
</if>
<if test="record.picUrl != null">
pic_url = #{record.picUrl,jdbcType=VARCHAR},
</if>
<if test="record.weight != null">
weight = #{record.weight,jdbcType=INTEGER},
</if>
<if test="record.jumpType != null">
jump_type = #{record.jumpType,jdbcType=INTEGER},
</if>
<if test="record.jumpAddress != null">
jump_address = #{record.jumpAddress,jdbcType=VARCHAR},
</if>
<if test="record.remark != null">
remark = #{record.remark,jdbcType=VARCHAR},
</if>
<if test="record.isDelete != null">
is_delete = #{record.isDelete,jdbcType=INTEGER},
</if>
<if test="record.isUp != null">
is_up = #{record.isUp,jdbcType=INTEGER},
</if>
<if test="record.createDt != null">
create_dt = #{record.createDt,jdbcType=TIMESTAMP},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update t_base_banner
set id = #{record.id,jdbcType=BIGINT},
title = #{record.title,jdbcType=VARCHAR},
pic_url = #{record.picUrl,jdbcType=VARCHAR},
weight = #{record.weight,jdbcType=INTEGER},
jump_type = #{record.jumpType,jdbcType=INTEGER},
jump_address = #{record.jumpAddress,jdbcType=VARCHAR},
remark = #{record.remark,jdbcType=VARCHAR},
is_delete = #{record.isDelete,jdbcType=INTEGER},
is_up = #{record.isUp,jdbcType=INTEGER},
create_dt = #{record.createDt,jdbcType=TIMESTAMP}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.server.web.common.model.TBaseBanner">
update t_base_banner
<set>
<if test="title != null">
title = #{title,jdbcType=VARCHAR},
</if>
<if test="picUrl != null">
pic_url = #{picUrl,jdbcType=VARCHAR},
</if>
<if test="weight != null">
weight = #{weight,jdbcType=INTEGER},
</if>
<if test="jumpType != null">
jump_type = #{jumpType,jdbcType=INTEGER},
</if>
<if test="jumpAddress != null">
jump_address = #{jumpAddress,jdbcType=VARCHAR},
</if>
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>
<if test="isDelete != null">
is_delete = #{isDelete,jdbcType=INTEGER},
</if>
<if test="isUp != null">
is_up = #{isUp,jdbcType=INTEGER},
</if>
<if test="createDt != null">
create_dt = #{createDt,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.server.web.common.model.TBaseBanner">
update t_base_banner
set title = #{title,jdbcType=VARCHAR},
pic_url = #{picUrl,jdbcType=VARCHAR},
weight = #{weight,jdbcType=INTEGER},
jump_type = #{jumpType,jdbcType=INTEGER},
jump_address = #{jumpAddress,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR},
is_delete = #{isDelete,jdbcType=INTEGER},
is_up = #{isUp,jdbcType=INTEGER},
create_dt = #{createDt,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.server.web.common.mapper.TBaseFirstClassMapper">
<resultMap id="BaseResultMap" type="com.server.web.common.model.TBaseFirstClass">
<constructor>
<idArg column="id" javaType="java.lang.Long" jdbcType="BIGINT" />
<arg column="class_name" javaType="java.lang.String" jdbcType="VARCHAR" />
<arg column="status" javaType="java.lang.Integer" jdbcType="INTEGER" />
<arg column="pic_url" javaType="java.lang.String" jdbcType="VARCHAR" />
<arg column="weight" javaType="java.lang.Integer" jdbcType="INTEGER" />
<arg column="create_dt" javaType="java.util.Date" jdbcType="TIMESTAMP" />
</constructor>
</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, class_name, status, pic_url, weight, create_dt
</sql>
<select id="selectByExample" parameterType="com.server.web.common.model.TBaseFirstClassExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from t_base_first_class
<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_base_first_class
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from t_base_first_class
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.server.web.common.model.TBaseFirstClassExample">
delete from t_base_first_class
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.server.web.common.model.TBaseFirstClass" useGeneratedKeys="true">
insert into t_base_first_class (class_name, status, pic_url,
weight, create_dt)
values (#{className,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{picUrl,jdbcType=VARCHAR},
#{weight,jdbcType=INTEGER}, #{createDt,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.server.web.common.model.TBaseFirstClass" useGeneratedKeys="true">
insert into t_base_first_class
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="className != null">
class_name,
</if>
<if test="status != null">
status,
</if>
<if test="picUrl != null">
pic_url,
</if>
<if test="weight != null">
weight,
</if>
<if test="createDt != null">
create_dt,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="className != null">
#{className,jdbcType=VARCHAR},
</if>
<if test="status != null">
#{status,jdbcType=INTEGER},
</if>
<if test="picUrl != null">
#{picUrl,jdbcType=VARCHAR},
</if>
<if test="weight != null">
#{weight,jdbcType=INTEGER},
</if>
<if test="createDt != null">
#{createDt,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.server.web.common.model.TBaseFirstClassExample" resultType="java.lang.Long">
select count(*) from t_base_first_class
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update t_base_first_class
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.className != null">
class_name = #{record.className,jdbcType=VARCHAR},
</if>
<if test="record.status != null">
status = #{record.status,jdbcType=INTEGER},
</if>
<if test="record.picUrl != null">
pic_url = #{record.picUrl,jdbcType=VARCHAR},
</if>
<if test="record.weight != null">
weight = #{record.weight,jdbcType=INTEGER},
</if>
<if test="record.createDt != null">
create_dt = #{record.createDt,jdbcType=TIMESTAMP},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update t_base_first_class
set id = #{record.id,jdbcType=BIGINT},
class_name = #{record.className,jdbcType=VARCHAR},
status = #{record.status,jdbcType=INTEGER},
pic_url = #{record.picUrl,jdbcType=VARCHAR},
weight = #{record.weight,jdbcType=INTEGER},
create_dt = #{record.createDt,jdbcType=TIMESTAMP}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.server.web.common.model.TBaseFirstClass">
update t_base_first_class
<set>
<if test="className != null">
class_name = #{className,jdbcType=VARCHAR},
</if>
<if test="status != null">
status = #{status,jdbcType=INTEGER},
</if>
<if test="picUrl != null">
pic_url = #{picUrl,jdbcType=VARCHAR},
</if>
<if test="weight != null">
weight = #{weight,jdbcType=INTEGER},
</if>
<if test="createDt != null">
create_dt = #{createDt,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.server.web.common.model.TBaseFirstClass">
update t_base_first_class
set class_name = #{className,jdbcType=VARCHAR},
status = #{status,jdbcType=INTEGER},
pic_url = #{picUrl,jdbcType=VARCHAR},
weight = #{weight,jdbcType=INTEGER},
create_dt = #{createDt,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.server.web.common.mapper.TBaseSecondClassMapper">
<resultMap id="BaseResultMap" type="com.server.web.common.model.TBaseSecondClass">
<constructor>
<idArg column="id" javaType="java.lang.Long" jdbcType="BIGINT" />
<arg column="class_name" javaType="java.lang.String" jdbcType="VARCHAR" />
<arg column="status" javaType="java.lang.Integer" jdbcType="INTEGER" />
<arg column="type" javaType="java.lang.Integer" jdbcType="INTEGER" />
<arg column="pic_url" javaType="java.lang.String" jdbcType="VARCHAR" />
<arg column="first_id" javaType="java.lang.Long" jdbcType="BIGINT" />
<arg column="weight" javaType="java.lang.Integer" jdbcType="INTEGER" />
<arg column="create_dt" javaType="java.util.Date" jdbcType="TIMESTAMP" />
</constructor>
</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, class_name, status, type, pic_url, first_id, weight, create_dt
</sql>
<select id="selectByExample" parameterType="com.server.web.common.model.TBaseSecondClassExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from t_base_second_class
<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_base_second_class
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from t_base_second_class
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.server.web.common.model.TBaseSecondClassExample">
delete from t_base_second_class
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.server.web.common.model.TBaseSecondClass" useGeneratedKeys="true">
insert into t_base_second_class (class_name, status, type,
pic_url, first_id, weight,
create_dt)
values (#{className,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{type,jdbcType=INTEGER},
#{picUrl,jdbcType=VARCHAR}, #{firstId,jdbcType=BIGINT}, #{weight,jdbcType=INTEGER},
#{createDt,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.server.web.common.model.TBaseSecondClass" useGeneratedKeys="true">
insert into t_base_second_class
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="className != null">
class_name,
</if>
<if test="status != null">
status,
</if>
<if test="type != null">
type,
</if>
<if test="picUrl != null">
pic_url,
</if>
<if test="firstId != null">
first_id,
</if>
<if test="weight != null">
weight,
</if>
<if test="createDt != null">
create_dt,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="className != null">
#{className,jdbcType=VARCHAR},
</if>
<if test="status != null">
#{status,jdbcType=INTEGER},
</if>
<if test="type != null">
#{type,jdbcType=INTEGER},
</if>
<if test="picUrl != null">
#{picUrl,jdbcType=VARCHAR},
</if>
<if test="firstId != null">
#{firstId,jdbcType=BIGINT},
</if>
<if test="weight != null">
#{weight,jdbcType=INTEGER},
</if>
<if test="createDt != null">
#{createDt,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.server.web.common.model.TBaseSecondClassExample" resultType="java.lang.Long">
select count(*) from t_base_second_class
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update t_base_second_class
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.className != null">
class_name = #{record.className,jdbcType=VARCHAR},
</if>
<if test="record.status != null">
status = #{record.status,jdbcType=INTEGER},
</if>
<if test="record.type != null">
type = #{record.type,jdbcType=INTEGER},
</if>
<if test="record.picUrl != null">
pic_url = #{record.picUrl,jdbcType=VARCHAR},
</if>
<if test="record.firstId != null">
first_id = #{record.firstId,jdbcType=BIGINT},
</if>
<if test="record.weight != null">
weight = #{record.weight,jdbcType=INTEGER},
</if>
<if test="record.createDt != null">
create_dt = #{record.createDt,jdbcType=TIMESTAMP},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update t_base_second_class
set id = #{record.id,jdbcType=BIGINT},
class_name = #{record.className,jdbcType=VARCHAR},
status = #{record.status,jdbcType=INTEGER},
type = #{record.type,jdbcType=INTEGER},
pic_url = #{record.picUrl,jdbcType=VARCHAR},
first_id = #{record.firstId,jdbcType=BIGINT},
weight = #{record.weight,jdbcType=INTEGER},
create_dt = #{record.createDt,jdbcType=TIMESTAMP}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.server.web.common.model.TBaseSecondClass">
update t_base_second_class
<set>
<if test="className != null">
class_name = #{className,jdbcType=VARCHAR},
</if>
<if test="status != null">
status = #{status,jdbcType=INTEGER},
</if>
<if test="type != null">
type = #{type,jdbcType=INTEGER},
</if>
<if test="picUrl != null">
pic_url = #{picUrl,jdbcType=VARCHAR},
</if>
<if test="firstId != null">
first_id = #{firstId,jdbcType=BIGINT},
</if>
<if test="weight != null">
weight = #{weight,jdbcType=INTEGER},
</if>
<if test="createDt != null">
create_dt = #{createDt,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.server.web.common.model.TBaseSecondClass">
update t_base_second_class
set class_name = #{className,jdbcType=VARCHAR},
status = #{status,jdbcType=INTEGER},
type = #{type,jdbcType=INTEGER},
pic_url = #{picUrl,jdbcType=VARCHAR},
first_id = #{firstId,jdbcType=BIGINT},
weight = #{weight,jdbcType=INTEGER},
create_dt = #{createDt,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.server.web.common.mapper.TKzyCommentMapper">
<resultMap id="BaseResultMap" type="com.server.web.common.model.TKzyComment">
<constructor>
<idArg column="id" javaType="java.lang.Long" jdbcType="BIGINT" />
<arg column="user_id" javaType="java.lang.Long" jdbcType="BIGINT" />
<arg column="relation_id" javaType="java.lang.Long" jdbcType="BIGINT" />
<arg column="type" javaType="java.lang.Integer" jdbcType="INTEGER" />
<arg column="reply_content" javaType="java.lang.String" jdbcType="VARCHAR" />
<arg column="is_delete" javaType="java.lang.Integer" jdbcType="INTEGER" />
<arg column="auth_status" javaType="java.lang.Integer" jdbcType="INTEGER" />
<arg column="auth_dt" javaType="java.util.Date" jdbcType="TIMESTAMP" />
<arg column="create_dt" javaType="java.util.Date" jdbcType="TIMESTAMP" />
</constructor>
</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, user_id, relation_id, type, reply_content, is_delete, auth_status, auth_dt, create_dt
</sql>
<select id="selectByExample" parameterType="com.server.web.common.model.TKzyCommentExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from t_kzy_comment
<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_kzy_comment
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from t_kzy_comment
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.server.web.common.model.TKzyCommentExample">
delete from t_kzy_comment
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.server.web.common.model.TKzyComment" useGeneratedKeys="true">
insert into t_kzy_comment (user_id, relation_id, type,
reply_content, is_delete, auth_status,
auth_dt, create_dt)
values (#{userId,jdbcType=BIGINT}, #{relationId,jdbcType=BIGINT}, #{type,jdbcType=INTEGER},
#{replyContent,jdbcType=VARCHAR}, #{isDelete,jdbcType=INTEGER}, #{authStatus,jdbcType=INTEGER},
#{authDt,jdbcType=TIMESTAMP}, #{createDt,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.server.web.common.model.TKzyComment" useGeneratedKeys="true">
insert into t_kzy_comment
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="userId != null">
user_id,
</if>
<if test="relationId != null">
relation_id,
</if>
<if test="type != null">
type,
</if>
<if test="replyContent != null">
reply_content,
</if>
<if test="isDelete != null">
is_delete,
</if>
<if test="authStatus != null">
auth_status,
</if>
<if test="authDt != null">
auth_dt,
</if>
<if test="createDt != null">
create_dt,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="userId != null">
#{userId,jdbcType=BIGINT},
</if>
<if test="relationId != null">
#{relationId,jdbcType=BIGINT},
</if>
<if test="type != null">
#{type,jdbcType=INTEGER},
</if>
<if test="replyContent != null">
#{replyContent,jdbcType=VARCHAR},
</if>
<if test="isDelete != null">
#{isDelete,jdbcType=INTEGER},
</if>
<if test="authStatus != null">
#{authStatus,jdbcType=INTEGER},
</if>
<if test="authDt != null">
#{authDt,jdbcType=TIMESTAMP},
</if>
<if test="createDt != null">
#{createDt,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.server.web.common.model.TKzyCommentExample" resultType="java.lang.Long">
select count(*) from t_kzy_comment
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update t_kzy_comment
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.userId != null">
user_id = #{record.userId,jdbcType=BIGINT},
</if>
<if test="record.relationId != null">
relation_id = #{record.relationId,jdbcType=BIGINT},
</if>
<if test="record.type != null">
type = #{record.type,jdbcType=INTEGER},
</if>
<if test="record.replyContent != null">
reply_content = #{record.replyContent,jdbcType=VARCHAR},
</if>
<if test="record.isDelete != null">
is_delete = #{record.isDelete,jdbcType=INTEGER},
</if>
<if test="record.authStatus != null">
auth_status = #{record.authStatus,jdbcType=INTEGER},
</if>
<if test="record.authDt != null">
auth_dt = #{record.authDt,jdbcType=TIMESTAMP},
</if>
<if test="record.createDt != null">
create_dt = #{record.createDt,jdbcType=TIMESTAMP},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update t_kzy_comment
set id = #{record.id,jdbcType=BIGINT},
user_id = #{record.userId,jdbcType=BIGINT},
relation_id = #{record.relationId,jdbcType=BIGINT},
type = #{record.type,jdbcType=INTEGER},
reply_content = #{record.replyContent,jdbcType=VARCHAR},
is_delete = #{record.isDelete,jdbcType=INTEGER},
auth_status = #{record.authStatus,jdbcType=INTEGER},
auth_dt = #{record.authDt,jdbcType=TIMESTAMP},
create_dt = #{record.createDt,jdbcType=TIMESTAMP}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.server.web.common.model.TKzyComment">
update t_kzy_comment
<set>
<if test="userId != null">
user_id = #{userId,jdbcType=BIGINT},
</if>
<if test="relationId != null">
relation_id = #{relationId,jdbcType=BIGINT},
</if>
<if test="type != null">
type = #{type,jdbcType=INTEGER},
</if>
<if test="replyContent != null">
reply_content = #{replyContent,jdbcType=VARCHAR},
</if>
<if test="isDelete != null">
is_delete = #{isDelete,jdbcType=INTEGER},
</if>
<if test="authStatus != null">
auth_status = #{authStatus,jdbcType=INTEGER},
</if>
<if test="authDt != null">
auth_dt = #{authDt,jdbcType=TIMESTAMP},
</if>
<if test="createDt != null">
create_dt = #{createDt,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.server.web.common.model.TKzyComment">
update t_kzy_comment
set user_id = #{userId,jdbcType=BIGINT},
relation_id = #{relationId,jdbcType=BIGINT},
type = #{type,jdbcType=INTEGER},
reply_content = #{replyContent,jdbcType=VARCHAR},
is_delete = #{isDelete,jdbcType=INTEGER},
auth_status = #{authStatus,jdbcType=INTEGER},
auth_dt = #{authDt,jdbcType=TIMESTAMP},
create_dt = #{createDt,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.server.web.common.mapper.TKzyCourseMapper">
<resultMap id="BaseResultMap" type="com.server.web.common.model.TKzyCourse">
<constructor>
<idArg column="id" javaType="java.lang.Long" jdbcType="BIGINT" />
<arg column="course_name" javaType="java.lang.String" jdbcType="VARCHAR" />
<arg column="pic_url" javaType="java.lang.String" jdbcType="VARCHAR" />
<arg column="start_dt" javaType="java.util.Date" jdbcType="TIMESTAMP" />
<arg column="end_dt" javaType="java.util.Date" jdbcType="TIMESTAMP" />
<arg column="weight" javaType="java.lang.Integer" jdbcType="INTEGER" />
<arg column="live_url" javaType="java.lang.String" jdbcType="VARCHAR" />
<arg column="course_type" javaType="java.lang.Integer" jdbcType="INTEGER" />
<arg column="is_up" javaType="java.lang.Integer" jdbcType="INTEGER" />
<arg column="editor_id" javaType="java.lang.Long" jdbcType="BIGINT" />
<arg column="editor_name" javaType="java.lang.String" jdbcType="VARCHAR" />
<arg column="is_delete" javaType="java.lang.Integer" jdbcType="INTEGER" />
<arg column="create_dt" javaType="java.util.Date" jdbcType="TIMESTAMP" />
<arg column="update_dt" javaType="java.util.Date" jdbcType="TIMESTAMP" />
</constructor>
</resultMap>
<resultMap id="ResultMapWithBLOBs" type="com.server.web.common.model.TKzyCourse">
<constructor>
<idArg column="id" javaType="java.lang.Long" jdbcType="BIGINT" />
<arg column="course_name" javaType="java.lang.String" jdbcType="VARCHAR" />
<arg column="pic_url" javaType="java.lang.String" jdbcType="VARCHAR" />
<arg column="start_dt" javaType="java.util.Date" jdbcType="TIMESTAMP" />
<arg column="end_dt" javaType="java.util.Date" jdbcType="TIMESTAMP" />
<arg column="weight" javaType="java.lang.Integer" jdbcType="INTEGER" />
<arg column="live_url" javaType="java.lang.String" jdbcType="VARCHAR" />
<arg column="course_type" javaType="java.lang.Integer" jdbcType="INTEGER" />
<arg column="is_up" javaType="java.lang.Integer" jdbcType="INTEGER" />
<arg column="editor_id" javaType="java.lang.Long" jdbcType="BIGINT" />
<arg column="editor_name" javaType="java.lang.String" jdbcType="VARCHAR" />
<arg column="is_delete" javaType="java.lang.Integer" jdbcType="INTEGER" />
<arg column="create_dt" javaType="java.util.Date" jdbcType="TIMESTAMP" />
<arg column="update_dt" javaType="java.util.Date" jdbcType="TIMESTAMP" />
<arg column="course_introduce" javaType="java.lang.String" jdbcType="LONGVARCHAR" />
</constructor>
</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, course_name, pic_url, start_dt, end_dt, weight, live_url, course_type, is_up,
editor_id, editor_name, is_delete, create_dt, update_dt
</sql>
<sql id="Blob_Column_List">
course_introduce
</sql>
<select id="selectByExampleWithBLOBs" parameterType="com.server.web.common.model.TKzyCourseExample" resultMap="ResultMapWithBLOBs">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from t_kzy_course
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByExample" parameterType="com.server.web.common.model.TKzyCourseExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from t_kzy_course
<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="ResultMapWithBLOBs">
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from t_kzy_course
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from t_kzy_course
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.server.web.common.model.TKzyCourseExample">
delete from t_kzy_course
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.server.web.common.model.TKzyCourse" useGeneratedKeys="true">
insert into t_kzy_course (course_name, pic_url, start_dt,
end_dt, weight, live_url,
course_type, is_up, editor_id,
editor_name, is_delete, create_dt,
update_dt, course_introduce)
values (#{courseName,jdbcType=VARCHAR}, #{picUrl,jdbcType=VARCHAR}, #{startDt,jdbcType=TIMESTAMP},
#{endDt,jdbcType=TIMESTAMP}, #{weight,jdbcType=INTEGER}, #{liveUrl,jdbcType=VARCHAR},
#{courseType,jdbcType=INTEGER}, #{isUp,jdbcType=INTEGER}, #{editorId,jdbcType=BIGINT},
#{editorName,jdbcType=VARCHAR}, #{isDelete,jdbcType=INTEGER}, #{createDt,jdbcType=TIMESTAMP},
#{updateDt,jdbcType=TIMESTAMP}, #{courseIntroduce,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.server.web.common.model.TKzyCourse" useGeneratedKeys="true">
insert into t_kzy_course
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="courseName != null">
course_name,
</if>
<if test="picUrl != null">
pic_url,
</if>
<if test="startDt != null">
start_dt,
</if>
<if test="endDt != null">
end_dt,
</if>
<if test="weight != null">
weight,
</if>
<if test="liveUrl != null">
live_url,
</if>
<if test="courseType != null">
course_type,
</if>
<if test="isUp != null">
is_up,
</if>
<if test="editorId != null">
editor_id,
</if>
<if test="editorName != null">
editor_name,
</if>
<if test="isDelete != null">
is_delete,
</if>
<if test="createDt != null">
create_dt,
</if>
<if test="updateDt != null">
update_dt,
</if>
<if test="courseIntroduce != null">
course_introduce,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="courseName != null">
#{courseName,jdbcType=VARCHAR},
</if>
<if test="picUrl != null">
#{picUrl,jdbcType=VARCHAR},
</if>
<if test="startDt != null">
#{startDt,jdbcType=TIMESTAMP},
</if>
<if test="endDt != null">
#{endDt,jdbcType=TIMESTAMP},
</if>
<if test="weight != null">
#{weight,jdbcType=INTEGER},
</if>
<if test="liveUrl != null">
#{liveUrl,jdbcType=VARCHAR},
</if>
<if test="courseType != null">
#{courseType,jdbcType=INTEGER},
</if>
<if test="isUp != null">
#{isUp,jdbcType=INTEGER},
</if>
<if test="editorId != null">
#{editorId,jdbcType=BIGINT},
</if>
<if test="editorName != null">
#{editorName,jdbcType=VARCHAR},
</if>
<if test="isDelete != null">
#{isDelete,jdbcType=INTEGER},
</if>
<if test="createDt != null">
#{createDt,jdbcType=TIMESTAMP},
</if>
<if test="updateDt != null">
#{updateDt,jdbcType=TIMESTAMP},
</if>
<if test="courseIntroduce != null">
#{courseIntroduce,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.server.web.common.model.TKzyCourseExample" resultType="java.lang.Long">
select count(*) from t_kzy_course
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update t_kzy_course
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.courseName != null">
course_name = #{record.courseName,jdbcType=VARCHAR},
</if>
<if test="record.picUrl != null">
pic_url = #{record.picUrl,jdbcType=VARCHAR},
</if>
<if test="record.startDt != null">
start_dt = #{record.startDt,jdbcType=TIMESTAMP},
</if>
<if test="record.endDt != null">
end_dt = #{record.endDt,jdbcType=TIMESTAMP},
</if>
<if test="record.weight != null">
weight = #{record.weight,jdbcType=INTEGER},
</if>
<if test="record.liveUrl != null">
live_url = #{record.liveUrl,jdbcType=VARCHAR},
</if>
<if test="record.courseType != null">
course_type = #{record.courseType,jdbcType=INTEGER},
</if>
<if test="record.isUp != null">
is_up = #{record.isUp,jdbcType=INTEGER},
</if>
<if test="record.editorId != null">
editor_id = #{record.editorId,jdbcType=BIGINT},
</if>
<if test="record.editorName != null">
editor_name = #{record.editorName,jdbcType=VARCHAR},
</if>
<if test="record.isDelete != null">
is_delete = #{record.isDelete,jdbcType=INTEGER},
</if>
<if test="record.createDt != null">
create_dt = #{record.createDt,jdbcType=TIMESTAMP},
</if>
<if test="record.updateDt != null">
update_dt = #{record.updateDt,jdbcType=TIMESTAMP},
</if>
<if test="record.courseIntroduce != null">
course_introduce = #{record.courseIntroduce,jdbcType=LONGVARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExampleWithBLOBs" parameterType="map">
update t_kzy_course
set id = #{record.id,jdbcType=BIGINT},
course_name = #{record.courseName,jdbcType=VARCHAR},
pic_url = #{record.picUrl,jdbcType=VARCHAR},
start_dt = #{record.startDt,jdbcType=TIMESTAMP},
end_dt = #{record.endDt,jdbcType=TIMESTAMP},
weight = #{record.weight,jdbcType=INTEGER},
live_url = #{record.liveUrl,jdbcType=VARCHAR},
course_type = #{record.courseType,jdbcType=INTEGER},
is_up = #{record.isUp,jdbcType=INTEGER},
editor_id = #{record.editorId,jdbcType=BIGINT},
editor_name = #{record.editorName,jdbcType=VARCHAR},
is_delete = #{record.isDelete,jdbcType=INTEGER},
create_dt = #{record.createDt,jdbcType=TIMESTAMP},
update_dt = #{record.updateDt,jdbcType=TIMESTAMP},
course_introduce = #{record.courseIntroduce,jdbcType=LONGVARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update t_kzy_course
set id = #{record.id,jdbcType=BIGINT},
course_name = #{record.courseName,jdbcType=VARCHAR},
pic_url = #{record.picUrl,jdbcType=VARCHAR},
start_dt = #{record.startDt,jdbcType=TIMESTAMP},
end_dt = #{record.endDt,jdbcType=TIMESTAMP},
weight = #{record.weight,jdbcType=INTEGER},
live_url = #{record.liveUrl,jdbcType=VARCHAR},
course_type = #{record.courseType,jdbcType=INTEGER},
is_up = #{record.isUp,jdbcType=INTEGER},
editor_id = #{record.editorId,jdbcType=BIGINT},
editor_name = #{record.editorName,jdbcType=VARCHAR},
is_delete = #{record.isDelete,jdbcType=INTEGER},
create_dt = #{record.createDt,jdbcType=TIMESTAMP},
update_dt = #{record.updateDt,jdbcType=TIMESTAMP}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.server.web.common.model.TKzyCourse">
update t_kzy_course
<set>
<if test="courseName != null">
course_name = #{courseName,jdbcType=VARCHAR},
</if>
<if test="picUrl != null">
pic_url = #{picUrl,jdbcType=VARCHAR},
</if>
<if test="startDt != null">
start_dt = #{startDt,jdbcType=TIMESTAMP},
</if>
<if test="endDt != null">
end_dt = #{endDt,jdbcType=TIMESTAMP},
</if>
<if test="weight != null">
weight = #{weight,jdbcType=INTEGER},
</if>
<if test="liveUrl != null">
live_url = #{liveUrl,jdbcType=VARCHAR},
</if>
<if test="courseType != null">
course_type = #{courseType,jdbcType=INTEGER},
</if>
<if test="isUp != null">
is_up = #{isUp,jdbcType=INTEGER},
</if>
<if test="editorId != null">
editor_id = #{editorId,jdbcType=BIGINT},
</if>
<if test="editorName != null">
editor_name = #{editorName,jdbcType=VARCHAR},
</if>
<if test="isDelete != null">
is_delete = #{isDelete,jdbcType=INTEGER},
</if>
<if test="createDt != null">
create_dt = #{createDt,jdbcType=TIMESTAMP},
</if>
<if test="updateDt != null">
update_dt = #{updateDt,jdbcType=TIMESTAMP},
</if>
<if test="courseIntroduce != null">
course_introduce = #{courseIntroduce,jdbcType=LONGVARCHAR},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.server.web.common.model.TKzyCourse">
update t_kzy_course
set course_name = #{courseName,jdbcType=VARCHAR},
pic_url = #{picUrl,jdbcType=VARCHAR},
start_dt = #{startDt,jdbcType=TIMESTAMP},
end_dt = #{endDt,jdbcType=TIMESTAMP},
weight = #{weight,jdbcType=INTEGER},
live_url = #{liveUrl,jdbcType=VARCHAR},
course_type = #{courseType,jdbcType=INTEGER},
is_up = #{isUp,jdbcType=INTEGER},
editor_id = #{editorId,jdbcType=BIGINT},
editor_name = #{editorName,jdbcType=VARCHAR},
is_delete = #{isDelete,jdbcType=INTEGER},
create_dt = #{createDt,jdbcType=TIMESTAMP},
update_dt = #{updateDt,jdbcType=TIMESTAMP},
course_introduce = #{courseIntroduce,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.server.web.common.model.TKzyCourse">
update t_kzy_course
set course_name = #{courseName,jdbcType=VARCHAR},
pic_url = #{picUrl,jdbcType=VARCHAR},
start_dt = #{startDt,jdbcType=TIMESTAMP},
end_dt = #{endDt,jdbcType=TIMESTAMP},
weight = #{weight,jdbcType=INTEGER},
live_url = #{liveUrl,jdbcType=VARCHAR},
course_type = #{courseType,jdbcType=INTEGER},
is_up = #{isUp,jdbcType=INTEGER},
editor_id = #{editorId,jdbcType=BIGINT},
editor_name = #{editorName,jdbcType=VARCHAR},
is_delete = #{isDelete,jdbcType=INTEGER},
create_dt = #{createDt,jdbcType=TIMESTAMP},
update_dt = #{updateDt,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.server.web.common.mapper.TKzyInformationMapper">
<resultMap id="BaseResultMap" type="com.server.web.common.model.TKzyInformation">
<constructor>
<idArg column="id" javaType="java.lang.Long" jdbcType="BIGINT" />
<arg column="title" javaType="java.lang.String" jdbcType="VARCHAR" />
<arg column="author" javaType="java.lang.String" jdbcType="VARCHAR" />
<arg column="pic_url" javaType="java.lang.String" jdbcType="VARCHAR" />
<arg column="icon_url" javaType="java.lang.String" jdbcType="VARCHAR" />
<arg column="is_delete" javaType="java.lang.Integer" jdbcType="INTEGER" />
<arg column="create_dt" javaType="java.util.Date" jdbcType="TIMESTAMP" />
<arg column="update_dt" javaType="java.util.Date" jdbcType="TIMESTAMP" />
</constructor>
</resultMap>
<resultMap id="ResultMapWithBLOBs" type="com.server.web.common.model.TKzyInformation">
<constructor>
<idArg column="id" javaType="java.lang.Long" jdbcType="BIGINT" />
<arg column="title" javaType="java.lang.String" jdbcType="VARCHAR" />
<arg column="author" javaType="java.lang.String" jdbcType="VARCHAR" />
<arg column="pic_url" javaType="java.lang.String" jdbcType="VARCHAR" />
<arg column="icon_url" javaType="java.lang.String" jdbcType="VARCHAR" />
<arg column="is_delete" javaType="java.lang.Integer" jdbcType="INTEGER" />
<arg column="create_dt" javaType="java.util.Date" jdbcType="TIMESTAMP" />
<arg column="update_dt" javaType="java.util.Date" jdbcType="TIMESTAMP" />
<arg column="content" javaType="_byte[]" jdbcType="LONGVARBINARY" />
</constructor>
</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, title, author, pic_url, icon_url, is_delete, create_dt, update_dt
</sql>
<sql id="Blob_Column_List">
content
</sql>
<select id="selectByExampleWithBLOBs" parameterType="com.server.web.common.model.TKzyInformationExample" resultMap="ResultMapWithBLOBs">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from t_kzy_information
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByExample" parameterType="com.server.web.common.model.TKzyInformationExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from t_kzy_information
<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="ResultMapWithBLOBs">
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from t_kzy_information
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from t_kzy_information
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.server.web.common.model.TKzyInformationExample">
delete from t_kzy_information
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.server.web.common.model.TKzyInformation" useGeneratedKeys="true">
insert into t_kzy_information (title, author, pic_url,
icon_url, is_delete, create_dt,
update_dt, content)
values (#{title,jdbcType=VARCHAR}, #{author,jdbcType=VARCHAR}, #{picUrl,jdbcType=VARCHAR},
#{iconUrl,jdbcType=VARCHAR}, #{isDelete,jdbcType=INTEGER}, #{createDt,jdbcType=TIMESTAMP},
#{updateDt,jdbcType=TIMESTAMP}, #{content,jdbcType=LONGVARBINARY})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.server.web.common.model.TKzyInformation" useGeneratedKeys="true">
insert into t_kzy_information
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="title != null">
title,
</if>
<if test="author != null">
author,
</if>
<if test="picUrl != null">
pic_url,
</if>
<if test="iconUrl != null">
icon_url,
</if>
<if test="isDelete != null">
is_delete,
</if>
<if test="createDt != null">
create_dt,
</if>
<if test="updateDt != null">
update_dt,
</if>
<if test="content != null">
content,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="title != null">
#{title,jdbcType=VARCHAR},
</if>
<if test="author != null">
#{author,jdbcType=VARCHAR},
</if>
<if test="picUrl != null">
#{picUrl,jdbcType=VARCHAR},
</if>
<if test="iconUrl != null">
#{iconUrl,jdbcType=VARCHAR},
</if>
<if test="isDelete != null">
#{isDelete,jdbcType=INTEGER},
</if>
<if test="createDt != null">
#{createDt,jdbcType=TIMESTAMP},
</if>
<if test="updateDt != null">
#{updateDt,jdbcType=TIMESTAMP},
</if>
<if test="content != null">
#{content,jdbcType=LONGVARBINARY},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.server.web.common.model.TKzyInformationExample" resultType="java.lang.Long">
select count(*) from t_kzy_information
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update t_kzy_information
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.title != null">
title = #{record.title,jdbcType=VARCHAR},
</if>
<if test="record.author != null">
author = #{record.author,jdbcType=VARCHAR},
</if>
<if test="record.picUrl != null">
pic_url = #{record.picUrl,jdbcType=VARCHAR},
</if>
<if test="record.iconUrl != null">
icon_url = #{record.iconUrl,jdbcType=VARCHAR},
</if>
<if test="record.isDelete != null">
is_delete = #{record.isDelete,jdbcType=INTEGER},
</if>
<if test="record.createDt != null">
create_dt = #{record.createDt,jdbcType=TIMESTAMP},
</if>
<if test="record.updateDt != null">
update_dt = #{record.updateDt,jdbcType=TIMESTAMP},
</if>
<if test="record.content != null">
content = #{record.content,jdbcType=LONGVARBINARY},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExampleWithBLOBs" parameterType="map">
update t_kzy_information
set id = #{record.id,jdbcType=BIGINT},
title = #{record.title,jdbcType=VARCHAR},
author = #{record.author,jdbcType=VARCHAR},
pic_url = #{record.picUrl,jdbcType=VARCHAR},
icon_url = #{record.iconUrl,jdbcType=VARCHAR},
is_delete = #{record.isDelete,jdbcType=INTEGER},
create_dt = #{record.createDt,jdbcType=TIMESTAMP},
update_dt = #{record.updateDt,jdbcType=TIMESTAMP},
content = #{record.content,jdbcType=LONGVARBINARY}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update t_kzy_information
set id = #{record.id,jdbcType=BIGINT},
title = #{record.title,jdbcType=VARCHAR},
author = #{record.author,jdbcType=VARCHAR},
pic_url = #{record.picUrl,jdbcType=VARCHAR},
icon_url = #{record.iconUrl,jdbcType=VARCHAR},
is_delete = #{record.isDelete,jdbcType=INTEGER},
create_dt = #{record.createDt,jdbcType=TIMESTAMP},
update_dt = #{record.updateDt,jdbcType=TIMESTAMP}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.server.web.common.model.TKzyInformation">
update t_kzy_information
<set>
<if test="title != null">
title = #{title,jdbcType=VARCHAR},
</if>
<if test="author != null">
author = #{author,jdbcType=VARCHAR},
</if>
<if test="picUrl != null">
pic_url = #{picUrl,jdbcType=VARCHAR},
</if>
<if test="iconUrl != null">
icon_url = #{iconUrl,jdbcType=VARCHAR},
</if>
<if test="isDelete != null">
is_delete = #{isDelete,jdbcType=INTEGER},
</if>
<if test="createDt != null">
create_dt = #{createDt,jdbcType=TIMESTAMP},
</if>
<if test="updateDt != null">
update_dt = #{updateDt,jdbcType=TIMESTAMP},
</if>
<if test="content != null">
content = #{content,jdbcType=LONGVARBINARY},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.server.web.common.model.TKzyInformation">
update t_kzy_information
set title = #{title,jdbcType=VARCHAR},
author = #{author,jdbcType=VARCHAR},
pic_url = #{picUrl,jdbcType=VARCHAR},
icon_url = #{iconUrl,jdbcType=VARCHAR},
is_delete = #{isDelete,jdbcType=INTEGER},
create_dt = #{createDt,jdbcType=TIMESTAMP},
update_dt = #{updateDt,jdbcType=TIMESTAMP},
content = #{content,jdbcType=LONGVARBINARY}
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.server.web.common.model.TKzyInformation">
update t_kzy_information
set title = #{title,jdbcType=VARCHAR},
author = #{author,jdbcType=VARCHAR},
pic_url = #{picUrl,jdbcType=VARCHAR},
icon_url = #{iconUrl,jdbcType=VARCHAR},
is_delete = #{isDelete,jdbcType=INTEGER},
create_dt = #{createDt,jdbcType=TIMESTAMP},
update_dt = #{updateDt,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.server.web.common.mapper.TKzyRelationClassMapper">
<resultMap id="BaseResultMap" type="com.server.web.common.model.TKzyRelationClass">
<constructor>
<idArg column="id" javaType="java.lang.Long" jdbcType="BIGINT" />
<arg column="relation_id" javaType="java.lang.Long" jdbcType="BIGINT" />
<arg column="first_class_id" javaType="java.lang.Long" jdbcType="BIGINT" />
<arg column="second_class_id" javaType="java.lang.Long" jdbcType="BIGINT" />
<arg column="create_dt" javaType="java.util.Date" jdbcType="TIMESTAMP" />
</constructor>
</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, relation_id, first_class_id, second_class_id, create_dt
</sql>
<select id="selectByExample" parameterType="com.server.web.common.model.TKzyRelationClassExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from t_kzy_relation_class
<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_kzy_relation_class
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from t_kzy_relation_class
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.server.web.common.model.TKzyRelationClassExample">
delete from t_kzy_relation_class
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.server.web.common.model.TKzyRelationClass" useGeneratedKeys="true">
insert into t_kzy_relation_class (relation_id, first_class_id, second_class_id,
create_dt)
values (#{relationId,jdbcType=BIGINT}, #{firstClassId,jdbcType=BIGINT}, #{secondClassId,jdbcType=BIGINT},
#{createDt,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.server.web.common.model.TKzyRelationClass" useGeneratedKeys="true">
insert into t_kzy_relation_class
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="relationId != null">
relation_id,
</if>
<if test="firstClassId != null">
first_class_id,
</if>
<if test="secondClassId != null">
second_class_id,
</if>
<if test="createDt != null">
create_dt,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="relationId != null">
#{relationId,jdbcType=BIGINT},
</if>
<if test="firstClassId != null">
#{firstClassId,jdbcType=BIGINT},
</if>
<if test="secondClassId != null">
#{secondClassId,jdbcType=BIGINT},
</if>
<if test="createDt != null">
#{createDt,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.server.web.common.model.TKzyRelationClassExample" resultType="java.lang.Long">
select count(*) from t_kzy_relation_class
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update t_kzy_relation_class
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.relationId != null">
relation_id = #{record.relationId,jdbcType=BIGINT},
</if>
<if test="record.firstClassId != null">
first_class_id = #{record.firstClassId,jdbcType=BIGINT},
</if>
<if test="record.secondClassId != null">
second_class_id = #{record.secondClassId,jdbcType=BIGINT},
</if>
<if test="record.createDt != null">
create_dt = #{record.createDt,jdbcType=TIMESTAMP},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update t_kzy_relation_class
set id = #{record.id,jdbcType=BIGINT},
relation_id = #{record.relationId,jdbcType=BIGINT},
first_class_id = #{record.firstClassId,jdbcType=BIGINT},
second_class_id = #{record.secondClassId,jdbcType=BIGINT},
create_dt = #{record.createDt,jdbcType=TIMESTAMP}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.server.web.common.model.TKzyRelationClass">
update t_kzy_relation_class
<set>
<if test="relationId != null">
relation_id = #{relationId,jdbcType=BIGINT},
</if>
<if test="firstClassId != null">
first_class_id = #{firstClassId,jdbcType=BIGINT},
</if>
<if test="secondClassId != null">
second_class_id = #{secondClassId,jdbcType=BIGINT},
</if>
<if test="createDt != null">
create_dt = #{createDt,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.server.web.common.model.TKzyRelationClass">
update t_kzy_relation_class
set relation_id = #{relationId,jdbcType=BIGINT},
first_class_id = #{firstClassId,jdbcType=BIGINT},
second_class_id = #{secondClassId,jdbcType=BIGINT},
create_dt = #{createDt,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.server.web.common.mapper.TKzyUserIntegralFlowingMapper">
<resultMap id="BaseResultMap" type="com.server.web.common.model.TKzyUserIntegralFlowing">
<constructor>
<idArg column="id" javaType="java.lang.Long" jdbcType="BIGINT" />
<arg column="user_id" javaType="java.lang.Long" jdbcType="BIGINT" />
<arg column="integral" javaType="java.lang.Integer" jdbcType="INTEGER" />
<arg column="source_type" javaType="java.lang.Integer" jdbcType="INTEGER" />
<arg column="type" javaType="java.lang.Integer" jdbcType="INTEGER" />
<arg column="create_dt" javaType="java.util.Date" jdbcType="TIMESTAMP" />
<arg column="remark" javaType="java.lang.String" jdbcType="VARCHAR" />
</constructor>
</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, user_id, integral, source_type, type, create_dt, remark
</sql>
<select id="selectByExample" parameterType="com.server.web.common.model.TKzyUserIntegralFlowingExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from t_kzy_user_integral_flowing
<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_kzy_user_integral_flowing
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from t_kzy_user_integral_flowing
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.server.web.common.model.TKzyUserIntegralFlowingExample">
delete from t_kzy_user_integral_flowing
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.server.web.common.model.TKzyUserIntegralFlowing" useGeneratedKeys="true">
insert into t_kzy_user_integral_flowing (user_id, integral, source_type,
type, create_dt, remark
)
values (#{userId,jdbcType=BIGINT}, #{integral,jdbcType=INTEGER}, #{sourceType,jdbcType=INTEGER},
#{type,jdbcType=INTEGER}, #{createDt,jdbcType=TIMESTAMP}, #{remark,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.server.web.common.model.TKzyUserIntegralFlowing" useGeneratedKeys="true">
insert into t_kzy_user_integral_flowing
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="userId != null">
user_id,
</if>
<if test="integral != null">
integral,
</if>
<if test="sourceType != null">
source_type,
</if>
<if test="type != null">
type,
</if>
<if test="createDt != null">
create_dt,
</if>
<if test="remark != null">
remark,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="userId != null">
#{userId,jdbcType=BIGINT},
</if>
<if test="integral != null">
#{integral,jdbcType=INTEGER},
</if>
<if test="sourceType != null">
#{sourceType,jdbcType=INTEGER},
</if>
<if test="type != null">
#{type,jdbcType=INTEGER},
</if>
<if test="createDt != null">
#{createDt,jdbcType=TIMESTAMP},
</if>
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.server.web.common.model.TKzyUserIntegralFlowingExample" resultType="java.lang.Long">
select count(*) from t_kzy_user_integral_flowing
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update t_kzy_user_integral_flowing
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.userId != null">
user_id = #{record.userId,jdbcType=BIGINT},
</if>
<if test="record.integral != null">
integral = #{record.integral,jdbcType=INTEGER},
</if>
<if test="record.sourceType != null">
source_type = #{record.sourceType,jdbcType=INTEGER},
</if>
<if test="record.type != null">
type = #{record.type,jdbcType=INTEGER},
</if>
<if test="record.createDt != null">
create_dt = #{record.createDt,jdbcType=TIMESTAMP},
</if>
<if test="record.remark != null">
remark = #{record.remark,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update t_kzy_user_integral_flowing
set id = #{record.id,jdbcType=BIGINT},
user_id = #{record.userId,jdbcType=BIGINT},
integral = #{record.integral,jdbcType=INTEGER},
source_type = #{record.sourceType,jdbcType=INTEGER},
type = #{record.type,jdbcType=INTEGER},
create_dt = #{record.createDt,jdbcType=TIMESTAMP},
remark = #{record.remark,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.server.web.common.model.TKzyUserIntegralFlowing">
update t_kzy_user_integral_flowing
<set>
<if test="userId != null">
user_id = #{userId,jdbcType=BIGINT},
</if>
<if test="integral != null">
integral = #{integral,jdbcType=INTEGER},
</if>
<if test="sourceType != null">
source_type = #{sourceType,jdbcType=INTEGER},
</if>
<if test="type != null">
type = #{type,jdbcType=INTEGER},
</if>
<if test="createDt != null">
create_dt = #{createDt,jdbcType=TIMESTAMP},
</if>
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.server.web.common.model.TKzyUserIntegralFlowing">
update t_kzy_user_integral_flowing
set user_id = #{userId,jdbcType=BIGINT},
integral = #{integral,jdbcType=INTEGER},
source_type = #{sourceType,jdbcType=INTEGER},
type = #{type,jdbcType=INTEGER},
create_dt = #{createDt,jdbcType=TIMESTAMP},
remark = #{remark,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.server.web.common.mapper.TKzyUserMapper">
<resultMap id="BaseResultMap" type="com.server.web.common.model.TKzyUser">
<constructor>
<idArg column="id" javaType="java.lang.Long" jdbcType="BIGINT" />
<arg column="full_name" javaType="java.lang.String" jdbcType="VARCHAR" />
<arg column="head_photo" javaType="java.lang.String" jdbcType="VARCHAR" />
<arg column="phone" javaType="java.lang.String" jdbcType="VARCHAR" />
<arg column="user_category" javaType="java.lang.Integer" jdbcType="INTEGER" />
<arg column="duty" javaType="java.lang.String" jdbcType="VARCHAR" />
<arg column="status" javaType="java.lang.Integer" jdbcType="INTEGER" />
<arg column="wx_openid" javaType="java.lang.String" jdbcType="VARCHAR" />
<arg column="integral" javaType="java.lang.Integer" jdbcType="INTEGER" />
<arg column="sign_in_count" javaType="java.lang.Integer" jdbcType="INTEGER" />
<arg column="last_sign_dt" javaType="java.util.Date" jdbcType="TIMESTAMP" />
<arg column="create_dt" javaType="java.util.Date" jdbcType="TIMESTAMP" />
<arg column="last_login_dt" javaType="java.util.Date" jdbcType="TIMESTAMP" />
</constructor>
</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, full_name, head_photo, phone, user_category, duty, status, wx_openid, integral,
sign_in_count, last_sign_dt, create_dt, last_login_dt
</sql>
<select id="selectByExample" parameterType="com.server.web.common.model.TKzyUserExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from t_kzy_user
<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_kzy_user
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from t_kzy_user
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.server.web.common.model.TKzyUserExample">
delete from t_kzy_user
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.server.web.common.model.TKzyUser" useGeneratedKeys="true">
insert into t_kzy_user (full_name, head_photo, phone,
user_category, duty, status,
wx_openid, integral, sign_in_count,
last_sign_dt, create_dt, last_login_dt
)
values (#{fullName,jdbcType=VARCHAR}, #{headPhoto,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR},
#{userCategory,jdbcType=INTEGER}, #{duty,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER},
#{wxOpenid,jdbcType=VARCHAR}, #{integral,jdbcType=INTEGER}, #{signInCount,jdbcType=INTEGER},
#{lastSignDt,jdbcType=TIMESTAMP}, #{createDt,jdbcType=TIMESTAMP}, #{lastLoginDt,jdbcType=TIMESTAMP}
)
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.server.web.common.model.TKzyUser" useGeneratedKeys="true">
insert into t_kzy_user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="fullName != null">
full_name,
</if>
<if test="headPhoto != null">
head_photo,
</if>
<if test="phone != null">
phone,
</if>
<if test="userCategory != null">
user_category,
</if>
<if test="duty != null">
duty,
</if>
<if test="status != null">
status,
</if>
<if test="wxOpenid != null">
wx_openid,
</if>
<if test="integral != null">
integral,
</if>
<if test="signInCount != null">
sign_in_count,
</if>
<if test="lastSignDt != null">
last_sign_dt,
</if>
<if test="createDt != null">
create_dt,
</if>
<if test="lastLoginDt != null">
last_login_dt,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="fullName != null">
#{fullName,jdbcType=VARCHAR},
</if>
<if test="headPhoto != null">
#{headPhoto,jdbcType=VARCHAR},
</if>
<if test="phone != null">
#{phone,jdbcType=VARCHAR},
</if>
<if test="userCategory != null">
#{userCategory,jdbcType=INTEGER},
</if>
<if test="duty != null">
#{duty,jdbcType=VARCHAR},
</if>
<if test="status != null">
#{status,jdbcType=INTEGER},
</if>
<if test="wxOpenid != null">
#{wxOpenid,jdbcType=VARCHAR},
</if>
<if test="integral != null">
#{integral,jdbcType=INTEGER},
</if>
<if test="signInCount != null">
#{signInCount,jdbcType=INTEGER},
</if>
<if test="lastSignDt != null">
#{lastSignDt,jdbcType=TIMESTAMP},
</if>
<if test="createDt != null">
#{createDt,jdbcType=TIMESTAMP},
</if>
<if test="lastLoginDt != null">
#{lastLoginDt,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.server.web.common.model.TKzyUserExample" resultType="java.lang.Long">
select count(*) from t_kzy_user
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update t_kzy_user
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.fullName != null">
full_name = #{record.fullName,jdbcType=VARCHAR},
</if>
<if test="record.headPhoto != null">
head_photo = #{record.headPhoto,jdbcType=VARCHAR},
</if>
<if test="record.phone != null">
phone = #{record.phone,jdbcType=VARCHAR},
</if>
<if test="record.userCategory != null">
user_category = #{record.userCategory,jdbcType=INTEGER},
</if>
<if test="record.duty != null">
duty = #{record.duty,jdbcType=VARCHAR},
</if>
<if test="record.status != null">
status = #{record.status,jdbcType=INTEGER},
</if>
<if test="record.wxOpenid != null">
wx_openid = #{record.wxOpenid,jdbcType=VARCHAR},
</if>
<if test="record.integral != null">
integral = #{record.integral,jdbcType=INTEGER},
</if>
<if test="record.signInCount != null">
sign_in_count = #{record.signInCount,jdbcType=INTEGER},
</if>
<if test="record.lastSignDt != null">
last_sign_dt = #{record.lastSignDt,jdbcType=TIMESTAMP},
</if>
<if test="record.createDt != null">
create_dt = #{record.createDt,jdbcType=TIMESTAMP},
</if>
<if test="record.lastLoginDt != null">
last_login_dt = #{record.lastLoginDt,jdbcType=TIMESTAMP},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update t_kzy_user
set id = #{record.id,jdbcType=BIGINT},
full_name = #{record.fullName,jdbcType=VARCHAR},
head_photo = #{record.headPhoto,jdbcType=VARCHAR},
phone = #{record.phone,jdbcType=VARCHAR},
user_category = #{record.userCategory,jdbcType=INTEGER},
duty = #{record.duty,jdbcType=VARCHAR},
status = #{record.status,jdbcType=INTEGER},
wx_openid = #{record.wxOpenid,jdbcType=VARCHAR},
integral = #{record.integral,jdbcType=INTEGER},
sign_in_count = #{record.signInCount,jdbcType=INTEGER},
last_sign_dt = #{record.lastSignDt,jdbcType=TIMESTAMP},
create_dt = #{record.createDt,jdbcType=TIMESTAMP},
last_login_dt = #{record.lastLoginDt,jdbcType=TIMESTAMP}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.server.web.common.model.TKzyUser">
update t_kzy_user
<set>
<if test="fullName != null">
full_name = #{fullName,jdbcType=VARCHAR},
</if>
<if test="headPhoto != null">
head_photo = #{headPhoto,jdbcType=VARCHAR},
</if>
<if test="phone != null">
phone = #{phone,jdbcType=VARCHAR},
</if>
<if test="userCategory != null">
user_category = #{userCategory,jdbcType=INTEGER},
</if>
<if test="duty != null">
duty = #{duty,jdbcType=VARCHAR},
</if>
<if test="status != null">
status = #{status,jdbcType=INTEGER},
</if>
<if test="wxOpenid != null">
wx_openid = #{wxOpenid,jdbcType=VARCHAR},
</if>
<if test="integral != null">
integral = #{integral,jdbcType=INTEGER},
</if>
<if test="signInCount != null">
sign_in_count = #{signInCount,jdbcType=INTEGER},
</if>
<if test="lastSignDt != null">
last_sign_dt = #{lastSignDt,jdbcType=TIMESTAMP},
</if>
<if test="createDt != null">
create_dt = #{createDt,jdbcType=TIMESTAMP},
</if>
<if test="lastLoginDt != null">
last_login_dt = #{lastLoginDt,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.server.web.common.model.TKzyUser">
update t_kzy_user
set full_name = #{fullName,jdbcType=VARCHAR},
head_photo = #{headPhoto,jdbcType=VARCHAR},
phone = #{phone,jdbcType=VARCHAR},
user_category = #{userCategory,jdbcType=INTEGER},
duty = #{duty,jdbcType=VARCHAR},
status = #{status,jdbcType=INTEGER},
wx_openid = #{wxOpenid,jdbcType=VARCHAR},
integral = #{integral,jdbcType=INTEGER},
sign_in_count = #{signInCount,jdbcType=INTEGER},
last_sign_dt = #{lastSignDt,jdbcType=TIMESTAMP},
create_dt = #{createDt,jdbcType=TIMESTAMP},
last_login_dt = #{lastLoginDt,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.mapping.queryModel" >
<!--banner查询 -->
<select id="queryBanner" resultType="java.util.HashMap" parameterType="java.util.HashMap">
SELECT
t.id,
t.title,
t.pic_url AS picUrl,
t.is_up AS isUp,
t.weight,
t.jump_type as jumpType
FROM
t_base_banner t
WHERE
t.is_delete =0
<if test="title != null">
AND t.title LIKE #{title}
</if>
ORDER BY t.create_dt DESC, t.weight DESC
</select>
</mapper>
\ No newline at end of file
<?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>
<setting name="callSettersOnNulls" value="true"/>
<setting name="cacheEnabled" value="true"/>
<setting name="lazyLoadingEnabled" value="true"/>
<setting name="aggressiveLazyLoading" value="true"/>
<setting name="multipleResultSetsEnabled" value="true"/>
<setting name="useColumnLabel" value="true"/>
<setting name="useGeneratedKeys" value="false"/>
<setting name="autoMappingBehavior" value="PARTIAL"/>
<setting name="defaultExecutorType" value="SIMPLE"/>
<setting name="mapUnderscoreToCamelCase" value="true"/>
<setting name="localCacheScope" value="SESSION"/>
<setting name="jdbcTypeForNull" value="NULL"/>
<setting name="logImpl" value="LOG4J"/>
</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" />
</typeAliases>
</configuration>
\ No newline at end of file
server.port=${port:8081}
server.tomcat.max-threads=1000
spring.application.name=kzy-oss
spring.datasource.driverClassName = com.mysql.jdbc.Driver
spring.datasource.url = jdbc:mysql://39.97.246.118:3306/kzy_db_test?useUnicode=true&characterEncoding=utf-8
spring.datasource.username = kzy_user
spring.datasource.password = Kzy2020#yY
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.format_sql=true
spring.jackson.serialization.indent-output=true
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect
mybatis.type-aliases-package=com.server.web.model
#mybatis.mapper-locations=classpath:com/server/mapper/mybatis/*.xml
mybatis.mapper-locations=classpath:mybatis/mapper/*.xml,classpath:mybatis/mapping/*.xml
mybatis.config-location=classpath:mybatis/mybatis-config.xml
## Redis 配置
# Redis数据库索引(默认为0)
spring.redis.database=0
# Redis服务器地址
spring.redis.host=192.168.0.105
# Redis服务器连接端口
spring.redis.port=6379
# Redis服务器连接密码(默认为空)
spring.redis.password=WebRedis123
# 连接池最大连接数(使用负值表示没有限制)
spring.redis.pool.max-active=30
# 连接池最大阻塞等待时间(使用负值表示没有限制)
spring.redis.pool.max-wait=-1
# 连接池中的最大空闲连接
spring.redis.pool.max-idle=8
# 连接池中的最小空闲连接
spring.redis.pool.min-idle=0
# 连接超时时间(毫秒)
spring.redis.timeout=0
#如果本服务为api服务,可以进行如下配置
#是否开始debug模式,false加密并且验签。true调试模式,不加密,不验签
rest.api.debug=true
#编码
rest.api.charset=utf-8
#加密secret_key
rest.api.secretkey=FoK28EsYrxuiM3ohnAurFGm2uGAHyijL
#上传图片
upload.image.dir=/data/tempImages
upload.image.base.path=tempImages/
#七牛云
qiniu.accessKey=tOdsZIdcGZB4A6B4X6XnhRj9PALEPIY4QRT7RduW
qiniu.secretKey=UN8ZnFyzlYUdVNVoRkfpWaFVQBGDc3vUDg_Cz_6h
qiniu.bucket=yxvzb
qiniu.url=https://cdn1.yxvzb.com/
log4j.rootLogger=info,stdout,E
log4j.logger.com.server.web.common.mapper=DEBUG
##########控制台#############
log4j.appender.stdout = org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target = System.out
log4j.appender.stdout.layout = org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern = %d{ABSOLUTE} %5p %c{1}:%L - %m%n
##########ERROR#############
log4j.appender.E = org.apache.log4j.RollingFileAppender
log4j.appender.E.File = ../error.log
log4j.appender.E.MaxFileSize = 10240KB
log4j.appender.E.Encoding = UTF-8
log4j.appender.E.Threshold = ERROR
log4j.appender.E.layout = org.apache.log4j.PatternLayout
log4j.appender.E.MaxBackupIndex = 10
\ No newline at end of file
server.port=${port:8081}
server.tomcat.max-threads=1000
spring.application.name=sj-oss
spring.datasource.driverClassName = com.mysql.jdbc.Driver
spring.datasource.url = jdbc:mysql://127.0.0.1:3306/sj_sc?useUnicode=true&characterEncoding=utf-8
spring.datasource.username = root
spring.datasource.password = 2019#YpfkL999
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.format_sql=true
spring.jackson.serialization.indent-output=true
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect
mybatis.type-aliases-package=com.server.web.model
#mybatis.mapper-locations=classpath:com/server/mapper/mybatis/*.xml
mybatis.mapper-locations=classpath:mybatis/mapper/*.xml,classpath:mybatis/mapping/*.xml
mybatis.config-location=classpath:mybatis/mybatis-config.xml
## Redis 配置
# Redis数据库索引(默认为0)
spring.redis.database=0
# Redis服务器地址
spring.redis.host=127.0.0.1
# Redis服务器连接端口
spring.redis.port=6379
# Redis服务器连接密码(默认为空)
spring.redis.password=WebRedis999
# 连接池最大连接数(使用负值表示没有限制)
spring.redis.pool.max-active=30
# 连接池最大阻塞等待时间(使用负值表示没有限制)
spring.redis.pool.max-wait=-1
# 连接池中的最大空闲连接
spring.redis.pool.max-idle=8
# 连接池中的最小空闲连接
spring.redis.pool.min-idle=0
# 连接超时时间(毫秒)
spring.redis.timeout=0
#如果本服务为api服务,可以进行如下配置
#是否开始debug模式,false加密并且验签。true调试模式,不加密,不验签
rest.api.debug=true
#编码
rest.api.charset=utf-8
#加密secret_key
rest.api.secretkey=FoK28EsYrxuiM3ohnAurFGm2uGAHyijL
upload.image.dir=/alidata/server/tempImages
upload.image.base.path=tempImages/
#七牛云
qiniu.accessKey=tOdsZIdcGZB4A6B4X6XnhRj9PALEPIY4QRT7RduW
qiniu.secretKey=UN8ZnFyzlYUdVNVoRkfpWaFVQBGDc3vUDg_Cz_6h
qiniu.bucket=yxvzb
qiniu.url=https://cdn1.yxvzb.com/
log4j.rootLogger=info,stdout,E
log4j.logger.com.server.web.common.mapper=DEBUG
##########控制台#############
log4j.appender.stdout = org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target = System.out
log4j.appender.stdout.layout = org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern = %d{ABSOLUTE} %5p %c{1}:%L - %m%n
##########ERROR#############
log4j.appender.E = org.apache.log4j.RollingFileAppender
log4j.appender.E.File = ../error.log
log4j.appender.E.MaxFileSize = 10240KB
log4j.appender.E.Encoding = UTF-8
log4j.appender.E.Threshold = ERROR
log4j.appender.E.layout = org.apache.log4j.PatternLayout
log4j.appender.E.MaxBackupIndex = 10
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!