Quellcode durchsuchen

mybatis generator code

傅行帆 vor 6 Jahren
Ursprung
Commit
4b1a500fb8
26 geänderte Dateien mit 1502 neuen und 0 gelöschten Zeilen
  1. 25
    0
      SmartCommunity/mybatisGeneratorCode/.gitignore
  2. BIN
      SmartCommunity/mybatisGeneratorCode/.mvn/wrapper/maven-wrapper.jar
  3. 1
    0
      SmartCommunity/mybatisGeneratorCode/.mvn/wrapper/maven-wrapper.properties
  4. 225
    0
      SmartCommunity/mybatisGeneratorCode/mvnw
  5. 143
    0
      SmartCommunity/mybatisGeneratorCode/mvnw.cmd
  6. 80
    0
      SmartCommunity/mybatisGeneratorCode/pom.xml
  7. 12
    0
      SmartCommunity/mybatisGeneratorCode/src/main/java/com/example/demo/MybatisGeneratorCodeApplication.java
  8. 32
    0
      SmartCommunity/mybatisGeneratorCode/src/main/java/com/example/demo/controller/TestController.java
  9. 11
    0
      SmartCommunity/mybatisGeneratorCode/src/main/java/com/example/demo/dao/ScUserMapper.java
  10. 17
    0
      SmartCommunity/mybatisGeneratorCode/src/main/java/com/example/demo/dao/SysMenuMapper.java
  11. 17
    0
      SmartCommunity/mybatisGeneratorCode/src/main/java/com/example/demo/dao/SysMsgMapper.java
  12. 17
    0
      SmartCommunity/mybatisGeneratorCode/src/main/java/com/example/demo/dao/SysOrgMapper.java
  13. 37
    0
      SmartCommunity/mybatisGeneratorCode/src/main/java/com/example/demo/model/ScUser.java
  14. 93
    0
      SmartCommunity/mybatisGeneratorCode/src/main/java/com/example/demo/model/SysMenu.java
  15. 105
    0
      SmartCommunity/mybatisGeneratorCode/src/main/java/com/example/demo/model/SysMsg.java
  16. 95
    0
      SmartCommunity/mybatisGeneratorCode/src/main/java/com/example/demo/model/SysOrg.java
  17. 9
    0
      SmartCommunity/mybatisGeneratorCode/src/main/java/com/example/demo/service/ScUserServiceI.java
  18. 25
    0
      SmartCommunity/mybatisGeneratorCode/src/main/java/com/example/demo/service/impl/ScUserServiceImpl.java
  19. 10
    0
      SmartCommunity/mybatisGeneratorCode/src/main/resources/application.yml
  20. 61
    0
      SmartCommunity/mybatisGeneratorCode/src/main/resources/generatorConfig.xml
  21. 19
    0
      SmartCommunity/mybatisGeneratorCode/src/main/resources/log4j.properties
  22. 16
    0
      SmartCommunity/mybatisGeneratorCode/src/main/resources/mapper/ScUserMapper.xml
  23. 141
    0
      SmartCommunity/mybatisGeneratorCode/src/main/resources/mapper/SysMenuMapper.xml
  24. 153
    0
      SmartCommunity/mybatisGeneratorCode/src/main/resources/mapper/SysMsgMapper.xml
  25. 142
    0
      SmartCommunity/mybatisGeneratorCode/src/main/resources/mapper/SysOrgMapper.xml
  26. 16
    0
      SmartCommunity/mybatisGeneratorCode/src/test/java/com/example/demo/DemoApplicationTests.java

+ 25
- 0
SmartCommunity/mybatisGeneratorCode/.gitignore Datei anzeigen

@@ -0,0 +1,25 @@
1
+/target/
2
+!.mvn/wrapper/maven-wrapper.jar
3
+
4
+### STS ###
5
+.apt_generated
6
+.classpath
7
+.factorypath
8
+.project
9
+.settings
10
+.springBeans
11
+.sts4-cache
12
+
13
+### IntelliJ IDEA ###
14
+.idea
15
+*.iws
16
+*.iml
17
+*.ipr
18
+
19
+### NetBeans ###
20
+/nbproject/private/
21
+/build/
22
+/nbbuild/
23
+/dist/
24
+/nbdist/
25
+/.nb-gradle/

BIN
SmartCommunity/mybatisGeneratorCode/.mvn/wrapper/maven-wrapper.jar Datei anzeigen


+ 1
- 0
SmartCommunity/mybatisGeneratorCode/.mvn/wrapper/maven-wrapper.properties Datei anzeigen

@@ -0,0 +1 @@
1
+distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip

+ 225
- 0
SmartCommunity/mybatisGeneratorCode/mvnw Datei anzeigen

@@ -0,0 +1,225 @@
1
+#!/bin/sh
2
+# ----------------------------------------------------------------------------
3
+# Licensed to the Apache Software Foundation (ASF) under one
4
+# or more contributor license agreements.  See the NOTICE file
5
+# distributed with this work for additional information
6
+# regarding copyright ownership.  The ASF licenses this file
7
+# to you under the Apache License, Version 2.0 (the
8
+# "License"); you may not use this file except in compliance
9
+# with the License.  You may obtain a copy of the License at
10
+#
11
+#    http://www.apache.org/licenses/LICENSE-2.0
12
+#
13
+# Unless required by applicable law or agreed to in writing,
14
+# software distributed under the License is distributed on an
15
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
+# KIND, either express or implied.  See the License for the
17
+# specific language governing permissions and limitations
18
+# under the License.
19
+# ----------------------------------------------------------------------------
20
+
21
+# ----------------------------------------------------------------------------
22
+# Maven2 Start Up Batch script
23
+#
24
+# Required ENV vars:
25
+# ------------------
26
+#   JAVA_HOME - location of a JDK home dir
27
+#
28
+# Optional ENV vars
29
+# -----------------
30
+#   M2_HOME - location of maven2's installed home dir
31
+#   MAVEN_OPTS - parameters passed to the Java VM when running Maven
32
+#     e.g. to debug Maven itself, use
33
+#       set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
34
+#   MAVEN_SKIP_RC - flag to disable loading of mavenrc files
35
+# ----------------------------------------------------------------------------
36
+
37
+if [ -z "$MAVEN_SKIP_RC" ] ; then
38
+
39
+  if [ -f /etc/mavenrc ] ; then
40
+    . /etc/mavenrc
41
+  fi
42
+
43
+  if [ -f "$HOME/.mavenrc" ] ; then
44
+    . "$HOME/.mavenrc"
45
+  fi
46
+
47
+fi
48
+
49
+# OS specific support.  $var _must_ be set to either true or false.
50
+cygwin=false;
51
+darwin=false;
52
+mingw=false
53
+case "`uname`" in
54
+  CYGWIN*) cygwin=true ;;
55
+  MINGW*) mingw=true;;
56
+  Darwin*) darwin=true
57
+    # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
58
+    # See https://developer.apple.com/library/mac/qa/qa1170/_index.html
59
+    if [ -z "$JAVA_HOME" ]; then
60
+      if [ -x "/usr/libexec/java_home" ]; then
61
+        export JAVA_HOME="`/usr/libexec/java_home`"
62
+      else
63
+        export JAVA_HOME="/Library/Java/Home"
64
+      fi
65
+    fi
66
+    ;;
67
+esac
68
+
69
+if [ -z "$JAVA_HOME" ] ; then
70
+  if [ -r /etc/gentoo-release ] ; then
71
+    JAVA_HOME=`java-config --jre-home`
72
+  fi
73
+fi
74
+
75
+if [ -z "$M2_HOME" ] ; then
76
+  ## resolve links - $0 may be a link to maven's home
77
+  PRG="$0"
78
+
79
+  # need this for relative symlinks
80
+  while [ -h "$PRG" ] ; do
81
+    ls=`ls -ld "$PRG"`
82
+    link=`expr "$ls" : '.*-> \(.*\)$'`
83
+    if expr "$link" : '/.*' > /dev/null; then
84
+      PRG="$link"
85
+    else
86
+      PRG="`dirname "$PRG"`/$link"
87
+    fi
88
+  done
89
+
90
+  saveddir=`pwd`
91
+
92
+  M2_HOME=`dirname "$PRG"`/..
93
+
94
+  # make it fully qualified
95
+  M2_HOME=`cd "$M2_HOME" && pwd`
96
+
97
+  cd "$saveddir"
98
+  # echo Using m2 at $M2_HOME
99
+fi
100
+
101
+# For Cygwin, ensure paths are in UNIX format before anything is touched
102
+if $cygwin ; then
103
+  [ -n "$M2_HOME" ] &&
104
+    M2_HOME=`cygpath --unix "$M2_HOME"`
105
+  [ -n "$JAVA_HOME" ] &&
106
+    JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
107
+  [ -n "$CLASSPATH" ] &&
108
+    CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
109
+fi
110
+
111
+# For Migwn, ensure paths are in UNIX format before anything is touched
112
+if $mingw ; then
113
+  [ -n "$M2_HOME" ] &&
114
+    M2_HOME="`(cd "$M2_HOME"; pwd)`"
115
+  [ -n "$JAVA_HOME" ] &&
116
+    JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
117
+  # TODO classpath?
118
+fi
119
+
120
+if [ -z "$JAVA_HOME" ]; then
121
+  javaExecutable="`which javac`"
122
+  if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
123
+    # readlink(1) is not available as standard on Solaris 10.
124
+    readLink=`which readlink`
125
+    if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
126
+      if $darwin ; then
127
+        javaHome="`dirname \"$javaExecutable\"`"
128
+        javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
129
+      else
130
+        javaExecutable="`readlink -f \"$javaExecutable\"`"
131
+      fi
132
+      javaHome="`dirname \"$javaExecutable\"`"
133
+      javaHome=`expr "$javaHome" : '\(.*\)/bin'`
134
+      JAVA_HOME="$javaHome"
135
+      export JAVA_HOME
136
+    fi
137
+  fi
138
+fi
139
+
140
+if [ -z "$JAVACMD" ] ; then
141
+  if [ -n "$JAVA_HOME"  ] ; then
142
+    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
143
+      # IBM's JDK on AIX uses strange locations for the executables
144
+      JAVACMD="$JAVA_HOME/jre/sh/java"
145
+    else
146
+      JAVACMD="$JAVA_HOME/bin/java"
147
+    fi
148
+  else
149
+    JAVACMD="`which java`"
150
+  fi
151
+fi
152
+
153
+if [ ! -x "$JAVACMD" ] ; then
154
+  echo "Error: JAVA_HOME is not defined correctly." >&2
155
+  echo "  We cannot execute $JAVACMD" >&2
156
+  exit 1
157
+fi
158
+
159
+if [ -z "$JAVA_HOME" ] ; then
160
+  echo "Warning: JAVA_HOME environment variable is not set."
161
+fi
162
+
163
+CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
164
+
165
+# traverses directory structure from process work directory to filesystem root
166
+# first directory with .mvn subdirectory is considered project base directory
167
+find_maven_basedir() {
168
+
169
+  if [ -z "$1" ]
170
+  then
171
+    echo "Path not specified to find_maven_basedir"
172
+    return 1
173
+  fi
174
+
175
+  basedir="$1"
176
+  wdir="$1"
177
+  while [ "$wdir" != '/' ] ; do
178
+    if [ -d "$wdir"/.mvn ] ; then
179
+      basedir=$wdir
180
+      break
181
+    fi
182
+    # workaround for JBEAP-8937 (on Solaris 10/Sparc)
183
+    if [ -d "${wdir}" ]; then
184
+      wdir=`cd "$wdir/.."; pwd`
185
+    fi
186
+    # end of workaround
187
+  done
188
+  echo "${basedir}"
189
+}
190
+
191
+# concatenates all lines of a file
192
+concat_lines() {
193
+  if [ -f "$1" ]; then
194
+    echo "$(tr -s '\n' ' ' < "$1")"
195
+  fi
196
+}
197
+
198
+BASE_DIR=`find_maven_basedir "$(pwd)"`
199
+if [ -z "$BASE_DIR" ]; then
200
+  exit 1;
201
+fi
202
+
203
+export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
204
+echo $MAVEN_PROJECTBASEDIR
205
+MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
206
+
207
+# For Cygwin, switch paths to Windows format before running java
208
+if $cygwin; then
209
+  [ -n "$M2_HOME" ] &&
210
+    M2_HOME=`cygpath --path --windows "$M2_HOME"`
211
+  [ -n "$JAVA_HOME" ] &&
212
+    JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
213
+  [ -n "$CLASSPATH" ] &&
214
+    CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
215
+  [ -n "$MAVEN_PROJECTBASEDIR" ] &&
216
+    MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
217
+fi
218
+
219
+WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
220
+
221
+exec "$JAVACMD" \
222
+  $MAVEN_OPTS \
223
+  -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
224
+  "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
225
+  ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"

+ 143
- 0
SmartCommunity/mybatisGeneratorCode/mvnw.cmd Datei anzeigen

@@ -0,0 +1,143 @@
1
+@REM ----------------------------------------------------------------------------
2
+@REM Licensed to the Apache Software Foundation (ASF) under one
3
+@REM or more contributor license agreements.  See the NOTICE file
4
+@REM distributed with this work for additional information
5
+@REM regarding copyright ownership.  The ASF licenses this file
6
+@REM to you under the Apache License, Version 2.0 (the
7
+@REM "License"); you may not use this file except in compliance
8
+@REM with the License.  You may obtain a copy of the License at
9
+@REM
10
+@REM    http://www.apache.org/licenses/LICENSE-2.0
11
+@REM
12
+@REM Unless required by applicable law or agreed to in writing,
13
+@REM software distributed under the License is distributed on an
14
+@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+@REM KIND, either express or implied.  See the License for the
16
+@REM specific language governing permissions and limitations
17
+@REM under the License.
18
+@REM ----------------------------------------------------------------------------
19
+
20
+@REM ----------------------------------------------------------------------------
21
+@REM Maven2 Start Up Batch script
22
+@REM
23
+@REM Required ENV vars:
24
+@REM JAVA_HOME - location of a JDK home dir
25
+@REM
26
+@REM Optional ENV vars
27
+@REM M2_HOME - location of maven2's installed home dir
28
+@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
29
+@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending
30
+@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
31
+@REM     e.g. to debug Maven itself, use
32
+@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
33
+@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
34
+@REM ----------------------------------------------------------------------------
35
+
36
+@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
37
+@echo off
38
+@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on'
39
+@if "%MAVEN_BATCH_ECHO%" == "on"  echo %MAVEN_BATCH_ECHO%
40
+
41
+@REM set %HOME% to equivalent of $HOME
42
+if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
43
+
44
+@REM Execute a user defined script before this one
45
+if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
46
+@REM check for pre script, once with legacy .bat ending and once with .cmd ending
47
+if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
48
+if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
49
+:skipRcPre
50
+
51
+@setlocal
52
+
53
+set ERROR_CODE=0
54
+
55
+@REM To isolate internal variables from possible post scripts, we use another setlocal
56
+@setlocal
57
+
58
+@REM ==== START VALIDATION ====
59
+if not "%JAVA_HOME%" == "" goto OkJHome
60
+
61
+echo.
62
+echo Error: JAVA_HOME not found in your environment. >&2
63
+echo Please set the JAVA_HOME variable in your environment to match the >&2
64
+echo location of your Java installation. >&2
65
+echo.
66
+goto error
67
+
68
+:OkJHome
69
+if exist "%JAVA_HOME%\bin\java.exe" goto init
70
+
71
+echo.
72
+echo Error: JAVA_HOME is set to an invalid directory. >&2
73
+echo JAVA_HOME = "%JAVA_HOME%" >&2
74
+echo Please set the JAVA_HOME variable in your environment to match the >&2
75
+echo location of your Java installation. >&2
76
+echo.
77
+goto error
78
+
79
+@REM ==== END VALIDATION ====
80
+
81
+:init
82
+
83
+@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
84
+@REM Fallback to current working directory if not found.
85
+
86
+set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
87
+IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
88
+
89
+set EXEC_DIR=%CD%
90
+set WDIR=%EXEC_DIR%
91
+:findBaseDir
92
+IF EXIST "%WDIR%"\.mvn goto baseDirFound
93
+cd ..
94
+IF "%WDIR%"=="%CD%" goto baseDirNotFound
95
+set WDIR=%CD%
96
+goto findBaseDir
97
+
98
+:baseDirFound
99
+set MAVEN_PROJECTBASEDIR=%WDIR%
100
+cd "%EXEC_DIR%"
101
+goto endDetectBaseDir
102
+
103
+:baseDirNotFound
104
+set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
105
+cd "%EXEC_DIR%"
106
+
107
+:endDetectBaseDir
108
+
109
+IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
110
+
111
+@setlocal EnableExtensions EnableDelayedExpansion
112
+for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
113
+@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
114
+
115
+:endReadAdditionalConfig
116
+
117
+SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
118
+
119
+set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
120
+set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
121
+
122
+%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
123
+if ERRORLEVEL 1 goto error
124
+goto end
125
+
126
+:error
127
+set ERROR_CODE=1
128
+
129
+:end
130
+@endlocal & set ERROR_CODE=%ERROR_CODE%
131
+
132
+if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
133
+@REM check for post script, once with legacy .bat ending and once with .cmd ending
134
+if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
135
+if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
136
+:skipRcPost
137
+
138
+@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
139
+if "%MAVEN_BATCH_PAUSE%" == "on" pause
140
+
141
+if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
142
+
143
+exit /B %ERROR_CODE%

+ 80
- 0
SmartCommunity/mybatisGeneratorCode/pom.xml Datei anzeigen

@@ -0,0 +1,80 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4
+	<modelVersion>4.0.0</modelVersion>
5
+
6
+	<groupId>com.example</groupId>
7
+	<artifactId>mybatisGeneratorCode</artifactId>
8
+	<version>0.0.1</version>
9
+	<packaging>jar</packaging>
10
+
11
+	<name>demo</name>
12
+	<description>Demo project for Spring Boot</description>
13
+
14
+	<parent>
15
+		<groupId>org.springframework.boot</groupId>
16
+		<artifactId>spring-boot-starter-parent</artifactId>
17
+		<version>2.0.4.RELEASE</version>
18
+		<relativePath/> <!-- lookup parent from repository -->
19
+	</parent>
20
+
21
+	<properties>
22
+		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
23
+		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
24
+		<java.version>1.8</java.version>
25
+		<spring-cloud.version>Finchley.SR1</spring-cloud.version>
26
+	</properties>
27
+
28
+	<dependencies>
29
+		<dependency>
30
+			<groupId>org.springframework.boot</groupId>
31
+			<artifactId>spring-boot-starter-web</artifactId>
32
+		</dependency>
33
+
34
+		<dependency>
35
+			<groupId>org.mybatis.spring.boot</groupId>
36
+			<artifactId>mybatis-spring-boot-starter</artifactId>
37
+			<version>1.3.2</version>
38
+		</dependency>
39
+
40
+		<dependency>
41
+			<groupId>mysql</groupId>
42
+			<artifactId>mysql-connector-java</artifactId>
43
+			<scope>runtime</scope>
44
+		</dependency>
45
+
46
+		<dependency>
47
+			<groupId>org.springframework.boot</groupId>
48
+			<artifactId>spring-boot-starter-test</artifactId>
49
+			<scope>test</scope>
50
+		</dependency>
51
+	</dependencies>
52
+
53
+	<dependencyManagement>
54
+		<dependencies>
55
+			<dependency>
56
+				<groupId>org.springframework.cloud</groupId>
57
+				<artifactId>spring-cloud-dependencies</artifactId>
58
+				<version>${spring-cloud.version}</version>
59
+				<type>pom</type>
60
+				<scope>import</scope>
61
+			</dependency>
62
+		</dependencies>
63
+	</dependencyManagement>
64
+
65
+	<build>
66
+		<plugins>
67
+			<plugin>
68
+				<groupId>org.springframework.boot</groupId>
69
+				<artifactId>spring-boot-maven-plugin</artifactId>
70
+			</plugin>
71
+			<plugin>
72
+				<groupId>org.mybatis.generator</groupId>
73
+				<artifactId>mybatis-generator-maven-plugin</artifactId>
74
+				<version>1.3.2</version>
75
+			</plugin>
76
+		</plugins>
77
+	</build>
78
+
79
+
80
+</project>

+ 12
- 0
SmartCommunity/mybatisGeneratorCode/src/main/java/com/example/demo/MybatisGeneratorCodeApplication.java Datei anzeigen

@@ -0,0 +1,12 @@
1
+package com.example.demo;
2
+
3
+import org.springframework.boot.SpringApplication;
4
+import org.springframework.boot.autoconfigure.SpringBootApplication;
5
+
6
+@SpringBootApplication
7
+public class MybatisGeneratorCodeApplication {
8
+
9
+	public static void main(String[] args) {
10
+		SpringApplication.run(MybatisGeneratorCodeApplication.class, args);
11
+	}
12
+}

+ 32
- 0
SmartCommunity/mybatisGeneratorCode/src/main/java/com/example/demo/controller/TestController.java Datei anzeigen

@@ -0,0 +1,32 @@
1
+package com.example.demo.controller;
2
+
3
+import com.example.demo.model.ScUser;
4
+import com.example.demo.service.ScUserServiceI;
5
+import org.springframework.beans.factory.annotation.Autowired;
6
+import org.springframework.beans.factory.annotation.Value;
7
+import org.springframework.web.bind.annotation.RequestMapping;
8
+import org.springframework.web.bind.annotation.ResponseBody;
9
+import org.springframework.web.bind.annotation.RestController;
10
+
11
+import java.util.List;
12
+
13
+/**
14
+ * @author FXF
15
+ * @date 2018-09-11
16
+ */
17
+@RestController
18
+public class TestController {
19
+    
20
+    @Autowired
21
+    private ScUserServiceI scUserService;
22
+    
23
+    /**
24
+     * 获取所有的用户信息
25
+     * @return
26
+     */
27
+    @RequestMapping("/user")
28
+    @ResponseBody
29
+    public List<ScUser> getUser(){
30
+        return scUserService.getUser();
31
+    }
32
+}

+ 11
- 0
SmartCommunity/mybatisGeneratorCode/src/main/java/com/example/demo/dao/ScUserMapper.java Datei anzeigen

@@ -0,0 +1,11 @@
1
+package com.example.demo.dao;
2
+
3
+import com.example.demo.model.ScUser;
4
+import org.apache.ibatis.annotations.Mapper;
5
+
6
+import java.util.List;
7
+
8
+@Mapper
9
+public interface ScUserMapper {
10
+	List<ScUser> find();
11
+}

+ 17
- 0
SmartCommunity/mybatisGeneratorCode/src/main/java/com/example/demo/dao/SysMenuMapper.java Datei anzeigen

@@ -0,0 +1,17 @@
1
+package dao;
2
+
3
+import model.SysMenu;
4
+
5
+public interface SysMenuMapper {
6
+    int deleteByPrimaryKey(Integer id);
7
+
8
+    int insert(SysMenu record);
9
+
10
+    int insertSelective(SysMenu record);
11
+
12
+    SysMenu selectByPrimaryKey(Integer id);
13
+
14
+    int updateByPrimaryKeySelective(SysMenu record);
15
+
16
+    int updateByPrimaryKey(SysMenu record);
17
+}

+ 17
- 0
SmartCommunity/mybatisGeneratorCode/src/main/java/com/example/demo/dao/SysMsgMapper.java Datei anzeigen

@@ -0,0 +1,17 @@
1
+package dao;
2
+
3
+import model.SysMsg;
4
+
5
+public interface SysMsgMapper {
6
+    int deleteByPrimaryKey(Integer id);
7
+
8
+    int insert(SysMsg record);
9
+
10
+    int insertSelective(SysMsg record);
11
+
12
+    SysMsg selectByPrimaryKey(Integer id);
13
+
14
+    int updateByPrimaryKeySelective(SysMsg record);
15
+
16
+    int updateByPrimaryKey(SysMsg record);
17
+}

+ 17
- 0
SmartCommunity/mybatisGeneratorCode/src/main/java/com/example/demo/dao/SysOrgMapper.java Datei anzeigen

@@ -0,0 +1,17 @@
1
+package dao;
2
+
3
+import model.SysOrg;
4
+
5
+public interface SysOrgMapper {
6
+    int deleteByPrimaryKey(Integer id);
7
+
8
+    int insert(SysOrg record);
9
+
10
+    int insertSelective(SysOrg record);
11
+
12
+    SysOrg selectByPrimaryKey(Integer id);
13
+
14
+    int updateByPrimaryKeySelective(SysOrg record);
15
+
16
+    int updateByPrimaryKey(SysOrg record);
17
+}

+ 37
- 0
SmartCommunity/mybatisGeneratorCode/src/main/java/com/example/demo/model/ScUser.java Datei anzeigen

@@ -0,0 +1,37 @@
1
+package com.example.demo.model;
2
+
3
+/**
4
+ * @author FXF
5
+ * @date 2018-09-19
6
+ */
7
+public class ScUser {
8
+	private Integer id;
9
+	
10
+	private String userName;
11
+	
12
+	private String userPassword;
13
+	
14
+	public Integer getId() {
15
+		return id;
16
+	}
17
+	
18
+	public void setId(Integer id) {
19
+		this.id = id;
20
+	}
21
+	
22
+	public String getUserName() {
23
+		return userName;
24
+	}
25
+	
26
+	public void setUserName(String userName) {
27
+		this.userName = userName;
28
+	}
29
+	
30
+	public String getUserPassword() {
31
+		return userPassword;
32
+	}
33
+	
34
+	public void setUserPassword(String userPassword) {
35
+		this.userPassword = userPassword;
36
+	}
37
+}

+ 93
- 0
SmartCommunity/mybatisGeneratorCode/src/main/java/com/example/demo/model/SysMenu.java Datei anzeigen

@@ -0,0 +1,93 @@
1
+package model;
2
+
3
+public class SysMenu {
4
+    private Integer id;
5
+
6
+    private String menuName;
7
+
8
+    private String menuUrl;
9
+
10
+    private String menuIcon;
11
+
12
+    private Integer parentId;
13
+
14
+    private Integer sort;
15
+
16
+    private String permission;
17
+
18
+    private String menuType;
19
+
20
+    private String status;
21
+
22
+    public Integer getId() {
23
+        return id;
24
+    }
25
+
26
+    public void setId(Integer id) {
27
+        this.id = id;
28
+    }
29
+
30
+    public String getMenuName() {
31
+        return menuName;
32
+    }
33
+
34
+    public void setMenuName(String menuName) {
35
+        this.menuName = menuName == null ? null : menuName.trim();
36
+    }
37
+
38
+    public String getMenuUrl() {
39
+        return menuUrl;
40
+    }
41
+
42
+    public void setMenuUrl(String menuUrl) {
43
+        this.menuUrl = menuUrl == null ? null : menuUrl.trim();
44
+    }
45
+
46
+    public String getMenuIcon() {
47
+        return menuIcon;
48
+    }
49
+
50
+    public void setMenuIcon(String menuIcon) {
51
+        this.menuIcon = menuIcon == null ? null : menuIcon.trim();
52
+    }
53
+
54
+    public Integer getParentId() {
55
+        return parentId;
56
+    }
57
+
58
+    public void setParentId(Integer parentId) {
59
+        this.parentId = parentId;
60
+    }
61
+
62
+    public Integer getSort() {
63
+        return sort;
64
+    }
65
+
66
+    public void setSort(Integer sort) {
67
+        this.sort = sort;
68
+    }
69
+
70
+    public String getPermission() {
71
+        return permission;
72
+    }
73
+
74
+    public void setPermission(String permission) {
75
+        this.permission = permission == null ? null : permission.trim();
76
+    }
77
+
78
+    public String getMenuType() {
79
+        return menuType;
80
+    }
81
+
82
+    public void setMenuType(String menuType) {
83
+        this.menuType = menuType == null ? null : menuType.trim();
84
+    }
85
+
86
+    public String getStatus() {
87
+        return status;
88
+    }
89
+
90
+    public void setStatus(String status) {
91
+        this.status = status == null ? null : status.trim();
92
+    }
93
+}

+ 105
- 0
SmartCommunity/mybatisGeneratorCode/src/main/java/com/example/demo/model/SysMsg.java Datei anzeigen

@@ -0,0 +1,105 @@
1
+package model;
2
+
3
+import java.util.Date;
4
+
5
+public class SysMsg {
6
+    private Integer id;
7
+
8
+    private Integer userId;
9
+
10
+    private Integer targetId;
11
+
12
+    private String msgMode;
13
+
14
+    private String msgType;
15
+
16
+    private String closeType;
17
+
18
+    private String msgContent;
19
+
20
+    private Date createTime;
21
+
22
+    private Integer statue;
23
+
24
+    private String declarationIdStr;
25
+
26
+    public Integer getId() {
27
+        return id;
28
+    }
29
+
30
+    public void setId(Integer id) {
31
+        this.id = id;
32
+    }
33
+
34
+    public Integer getUserId() {
35
+        return userId;
36
+    }
37
+
38
+    public void setUserId(Integer userId) {
39
+        this.userId = userId;
40
+    }
41
+
42
+    public Integer getTargetId() {
43
+        return targetId;
44
+    }
45
+
46
+    public void setTargetId(Integer targetId) {
47
+        this.targetId = targetId;
48
+    }
49
+
50
+    public String getMsgMode() {
51
+        return msgMode;
52
+    }
53
+
54
+    public void setMsgMode(String msgMode) {
55
+        this.msgMode = msgMode == null ? null : msgMode.trim();
56
+    }
57
+
58
+    public String getMsgType() {
59
+        return msgType;
60
+    }
61
+
62
+    public void setMsgType(String msgType) {
63
+        this.msgType = msgType == null ? null : msgType.trim();
64
+    }
65
+
66
+    public String getCloseType() {
67
+        return closeType;
68
+    }
69
+
70
+    public void setCloseType(String closeType) {
71
+        this.closeType = closeType == null ? null : closeType.trim();
72
+    }
73
+
74
+    public String getMsgContent() {
75
+        return msgContent;
76
+    }
77
+
78
+    public void setMsgContent(String msgContent) {
79
+        this.msgContent = msgContent == null ? null : msgContent.trim();
80
+    }
81
+
82
+    public Date getCreateTime() {
83
+        return createTime;
84
+    }
85
+
86
+    public void setCreateTime(Date createTime) {
87
+        this.createTime = createTime;
88
+    }
89
+
90
+    public Integer getStatue() {
91
+        return statue;
92
+    }
93
+
94
+    public void setStatue(Integer statue) {
95
+        this.statue = statue;
96
+    }
97
+
98
+    public String getDeclarationIdStr() {
99
+        return declarationIdStr;
100
+    }
101
+
102
+    public void setDeclarationIdStr(String declarationIdStr) {
103
+        this.declarationIdStr = declarationIdStr == null ? null : declarationIdStr.trim();
104
+    }
105
+}

+ 95
- 0
SmartCommunity/mybatisGeneratorCode/src/main/java/com/example/demo/model/SysOrg.java Datei anzeigen

@@ -0,0 +1,95 @@
1
+package model;
2
+
3
+import java.util.Date;
4
+
5
+public class SysOrg {
6
+    private Integer id;
7
+
8
+    private String orgCode;
9
+
10
+    private String orgName;
11
+
12
+    private String description;
13
+
14
+    private Integer parentId;
15
+
16
+    private String createUser;
17
+
18
+    private Date createDate;
19
+
20
+    private String updateUser;
21
+
22
+    private Date updateDate;
23
+
24
+    public Integer getId() {
25
+        return id;
26
+    }
27
+
28
+    public void setId(Integer id) {
29
+        this.id = id;
30
+    }
31
+
32
+    public String getOrgCode() {
33
+        return orgCode;
34
+    }
35
+
36
+    public void setOrgCode(String orgCode) {
37
+        this.orgCode = orgCode == null ? null : orgCode.trim();
38
+    }
39
+
40
+    public String getOrgName() {
41
+        return orgName;
42
+    }
43
+
44
+    public void setOrgName(String orgName) {
45
+        this.orgName = orgName == null ? null : orgName.trim();
46
+    }
47
+
48
+    public String getDescription() {
49
+        return description;
50
+    }
51
+
52
+    public void setDescription(String description) {
53
+        this.description = description == null ? null : description.trim();
54
+    }
55
+
56
+    public Integer getParentId() {
57
+        return parentId;
58
+    }
59
+
60
+    public void setParentId(Integer parentId) {
61
+        this.parentId = parentId;
62
+    }
63
+
64
+    public String getCreateUser() {
65
+        return createUser;
66
+    }
67
+
68
+    public void setCreateUser(String createUser) {
69
+        this.createUser = createUser == null ? null : createUser.trim();
70
+    }
71
+
72
+    public Date getCreateDate() {
73
+        return createDate;
74
+    }
75
+
76
+    public void setCreateDate(Date createDate) {
77
+        this.createDate = createDate;
78
+    }
79
+
80
+    public String getUpdateUser() {
81
+        return updateUser;
82
+    }
83
+
84
+    public void setUpdateUser(String updateUser) {
85
+        this.updateUser = updateUser == null ? null : updateUser.trim();
86
+    }
87
+
88
+    public Date getUpdateDate() {
89
+        return updateDate;
90
+    }
91
+
92
+    public void setUpdateDate(Date updateDate) {
93
+        this.updateDate = updateDate;
94
+    }
95
+}

+ 9
- 0
SmartCommunity/mybatisGeneratorCode/src/main/java/com/example/demo/service/ScUserServiceI.java Datei anzeigen

@@ -0,0 +1,9 @@
1
+package com.example.demo.service;
2
+
3
+import com.example.demo.model.ScUser;
4
+
5
+import java.util.List;
6
+
7
+public interface ScUserServiceI {
8
+	List<ScUser> getUser();
9
+}

+ 25
- 0
SmartCommunity/mybatisGeneratorCode/src/main/java/com/example/demo/service/impl/ScUserServiceImpl.java Datei anzeigen

@@ -0,0 +1,25 @@
1
+package com.example.demo.service.impl;
2
+
3
+import com.example.demo.dao.ScUserMapper;
4
+import com.example.demo.model.ScUser;
5
+import com.example.demo.service.ScUserServiceI;
6
+import org.springframework.beans.factory.annotation.Autowired;
7
+import org.springframework.stereotype.Service;
8
+
9
+import java.util.List;
10
+
11
+/**
12
+ * @author FXF
13
+ * @date 2018-09-19
14
+ */
15
+@Service("scUserService")
16
+public class ScUserServiceImpl implements ScUserServiceI {
17
+	
18
+	@Autowired
19
+	private ScUserMapper scUserMapper;
20
+	
21
+	@Override
22
+	public List<ScUser> getUser() {
23
+		return scUserMapper.find();
24
+	}
25
+}

+ 10
- 0
SmartCommunity/mybatisGeneratorCode/src/main/resources/application.yml Datei anzeigen

@@ -0,0 +1,10 @@
1
+spring:
2
+  datasource:
3
+    driver-class-name: com.mysql.jdbc.Driver
4
+    url: jdbc:mysql://rm-uf6z3z6jq11x653d77o.mysql.rds.aliyuncs.com:3306/smart_community?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true
5
+    username: root
6
+    password: DQ@0lW##kBb2+-jPZC1s$Ma0h5$9W((q
7
+## Mybatis
8
+mybatis:
9
+  typeAliasesPackage: com.example.demo.model
10
+  mapperLocations: classpath:mapper/*.xml

+ 61
- 0
SmartCommunity/mybatisGeneratorCode/src/main/resources/generatorConfig.xml Datei anzeigen

@@ -0,0 +1,61 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!DOCTYPE generatorConfiguration
3
+        PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN"
4
+        "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">
5
+
6
+<generatorConfiguration>
7
+    <!--数据库驱动jar -->
8
+    <classPathEntry
9
+            location="D:\m2_yincheng\mysql\mysql-connector-java\5.1.46\mysql-connector-java-5.1.46.jar" />
10
+
11
+    <context id="context" targetRuntime="MyBatis3">
12
+        <!--去除注释 -->
13
+        <commentGenerator>
14
+            <property name="suppressAllComments" value="true" />
15
+            <property name="suppressDate" value="true"/>
16
+        </commentGenerator>
17
+
18
+        <!--数据库连接 -->
19
+        <jdbcConnection driverClass="com.mysql.jdbc.Driver"
20
+                        connectionURL="jdbc:mysql://192.168.0.122:3306/resold_admin_import" userId="root"
21
+                        password="root">
22
+        </jdbcConnection>
23
+        <!--默认false Java type resolver will always use java.math.BigDecimal if
24
+            the database column is of type DECIMAL or NUMERIC. -->
25
+        <javaTypeResolver>
26
+            <property name="forceBigDecimals" value="false" />
27
+        </javaTypeResolver>
28
+
29
+        <!--生成实体类 指定包名 以及生成的地址 (可以自定义地址,但是路径不存在不会自动创建 使用Maven生成在target目录下,会自动创建) -->
30
+        <javaModelGenerator targetPackage="model"
31
+                            targetProject="E:\gitcode\SpringProject\SmartCommunity\mybatisGeneratorCode\src\main\java\com\example\demo">
32
+            <property name="enableSubPackages" value="true" />
33
+            <property name="trimStrings" value="true" />
34
+        </javaModelGenerator>
35
+        <!--生成SQLMAP文件 -->
36
+        <sqlMapGenerator targetPackage="mapper"
37
+                         targetProject="E:\gitcode\SpringProject\SmartCommunity\mybatisGeneratorCode\src\main\resources">
38
+            <property name="enableSubPackages" value="false" />
39
+        </sqlMapGenerator>
40
+        <!--生成Dao文件 可以配置 type="XMLMAPPER"生成xml的dao实现 context id="DB2Tables" 修改targetRuntime="MyBatis3" -->
41
+        <javaClientGenerator type="XMLMAPPER"
42
+                             targetPackage="dao"
43
+                             targetProject="E:\gitcode\SpringProject\SmartCommunity\mybatisGeneratorCode\src\main\java\com\example\demo">
44
+            <property name="enableSubPackages" value="false" />
45
+        </javaClientGenerator>
46
+
47
+        <!--对应数据库表 多个直接复制 -->
48
+        <table tableName="sys_msg" domainObjectName="SysMsg"
49
+               enableCountByExample="false" enableUpdateByExample="false"
50
+               enableDeleteByExample="false" enableSelectByExample="false"
51
+               selectByExampleQueryId="false" />
52
+        <table tableName="sys_menu" domainObjectName="SysMenu"
53
+               enableCountByExample="false" enableUpdateByExample="false"
54
+               enableDeleteByExample="false" enableSelectByExample="false"
55
+               selectByExampleQueryId="false" />
56
+        <table tableName="sys_org" domainObjectName="SysOrg"
57
+               enableCountByExample="false" enableUpdateByExample="false"
58
+               enableDeleteByExample="false" enableSelectByExample="false"
59
+               selectByExampleQueryId="false" />
60
+    </context>
61
+</generatorConfiguration>

+ 19
- 0
SmartCommunity/mybatisGeneratorCode/src/main/resources/log4j.properties Datei anzeigen

@@ -0,0 +1,19 @@
1
+log4j.rootLogger=info,A1,R
2
+log4j.appender.A1=org.apache.log4j.ConsoleAppender
3
+log4j.appender.A1.Target=System.out
4
+log4j.appender.A1.layout=org.apache.log4j.PatternLayout
5
+log4j.appender.A1.layout.ConversionPattern=%-5p%x [%t] %d - %c %m%n  
6
+
7
+log4j.appender.R=org.apache.log4j.DailyRollingFileAppender
8
+log4j.appender.R.File=../logs/resold_admin_.log
9
+log4j.appender.R.layout=org.apache.log4j.PatternLayout
10
+log4j.appender.R.Append = true
11
+log4j.appender.R.ImmediateFlush = true
12
+log4j.appender.R.DatePattern = '.' yyyy - MM - dd '.txt'
13
+log4j.appender.R.layout.ConversionPattern=%-5p%x [%t] %d -%c %m%n
14
+
15
+#log4j.logger.com.ibatis=DEBUG
16
+log4j.logger.org.springframework.transaction.support.TransactionSynchronizationManager = INFO
17
+log4j.logger.java.sql.Connection=DEBUG
18
+log4j.logger.java.sql.Statement=DEBUG
19
+log4j.logger.java.sql.PreparedStatement=DEBUG

+ 16
- 0
SmartCommunity/mybatisGeneratorCode/src/main/resources/mapper/ScUserMapper.xml Datei anzeigen

@@ -0,0 +1,16 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3
+<mapper namespace="com.example.demo.dao.ScUserMapper">
4
+
5
+    <parameterMap id="paramMap" type="com.example.demo.model.ScUser"></parameterMap>
6
+
7
+    <resultMap id="resultMap" type="com.example.demo.model.ScUser">
8
+        <id property="id" column="id"/>
9
+        <result property="userName" column="user_name"/>
10
+        <result property="userPassword" column="user_password"/>
11
+    </resultMap>
12
+
13
+    <select id="find" resultMap="resultMap">
14
+        select * from sc_user
15
+    </select>
16
+</mapper>

+ 141
- 0
SmartCommunity/mybatisGeneratorCode/src/main/resources/mapper/SysMenuMapper.xml Datei anzeigen

@@ -0,0 +1,141 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3
+<mapper namespace="dao.SysMenuMapper" >
4
+  <resultMap id="BaseResultMap" type="model.SysMenu" >
5
+    <id column="id" property="id" jdbcType="INTEGER" />
6
+    <result column="menu_name" property="menuName" jdbcType="VARCHAR" />
7
+    <result column="menu_url" property="menuUrl" jdbcType="VARCHAR" />
8
+    <result column="menu_icon" property="menuIcon" jdbcType="VARCHAR" />
9
+    <result column="parent_id" property="parentId" jdbcType="INTEGER" />
10
+    <result column="sort" property="sort" jdbcType="INTEGER" />
11
+    <result column="permission" property="permission" jdbcType="VARCHAR" />
12
+    <result column="menu_type" property="menuType" jdbcType="CHAR" />
13
+    <result column="status" property="status" jdbcType="CHAR" />
14
+  </resultMap>
15
+  <sql id="Base_Column_List" >
16
+    id, menu_name, menu_url, menu_icon, parent_id, sort, permission, menu_type, status
17
+  </sql>
18
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
19
+    select 
20
+    <include refid="Base_Column_List" />
21
+    from sys_menu
22
+    where id = #{id,jdbcType=INTEGER}
23
+  </select>
24
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
25
+    delete from sys_menu
26
+    where id = #{id,jdbcType=INTEGER}
27
+  </delete>
28
+  <insert id="insert" parameterType="model.SysMenu" >
29
+    insert into sys_menu (id, menu_name, menu_url, 
30
+      menu_icon, parent_id, sort, 
31
+      permission, menu_type, status
32
+      )
33
+    values (#{id,jdbcType=INTEGER}, #{menuName,jdbcType=VARCHAR}, #{menuUrl,jdbcType=VARCHAR}, 
34
+      #{menuIcon,jdbcType=VARCHAR}, #{parentId,jdbcType=INTEGER}, #{sort,jdbcType=INTEGER}, 
35
+      #{permission,jdbcType=VARCHAR}, #{menuType,jdbcType=CHAR}, #{status,jdbcType=CHAR}
36
+      )
37
+  </insert>
38
+  <insert id="insertSelective" parameterType="model.SysMenu" >
39
+    insert into sys_menu
40
+    <trim prefix="(" suffix=")" suffixOverrides="," >
41
+      <if test="id != null" >
42
+        id,
43
+      </if>
44
+      <if test="menuName != null" >
45
+        menu_name,
46
+      </if>
47
+      <if test="menuUrl != null" >
48
+        menu_url,
49
+      </if>
50
+      <if test="menuIcon != null" >
51
+        menu_icon,
52
+      </if>
53
+      <if test="parentId != null" >
54
+        parent_id,
55
+      </if>
56
+      <if test="sort != null" >
57
+        sort,
58
+      </if>
59
+      <if test="permission != null" >
60
+        permission,
61
+      </if>
62
+      <if test="menuType != null" >
63
+        menu_type,
64
+      </if>
65
+      <if test="status != null" >
66
+        status,
67
+      </if>
68
+    </trim>
69
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
70
+      <if test="id != null" >
71
+        #{id,jdbcType=INTEGER},
72
+      </if>
73
+      <if test="menuName != null" >
74
+        #{menuName,jdbcType=VARCHAR},
75
+      </if>
76
+      <if test="menuUrl != null" >
77
+        #{menuUrl,jdbcType=VARCHAR},
78
+      </if>
79
+      <if test="menuIcon != null" >
80
+        #{menuIcon,jdbcType=VARCHAR},
81
+      </if>
82
+      <if test="parentId != null" >
83
+        #{parentId,jdbcType=INTEGER},
84
+      </if>
85
+      <if test="sort != null" >
86
+        #{sort,jdbcType=INTEGER},
87
+      </if>
88
+      <if test="permission != null" >
89
+        #{permission,jdbcType=VARCHAR},
90
+      </if>
91
+      <if test="menuType != null" >
92
+        #{menuType,jdbcType=CHAR},
93
+      </if>
94
+      <if test="status != null" >
95
+        #{status,jdbcType=CHAR},
96
+      </if>
97
+    </trim>
98
+  </insert>
99
+  <update id="updateByPrimaryKeySelective" parameterType="model.SysMenu" >
100
+    update sys_menu
101
+    <set >
102
+      <if test="menuName != null" >
103
+        menu_name = #{menuName,jdbcType=VARCHAR},
104
+      </if>
105
+      <if test="menuUrl != null" >
106
+        menu_url = #{menuUrl,jdbcType=VARCHAR},
107
+      </if>
108
+      <if test="menuIcon != null" >
109
+        menu_icon = #{menuIcon,jdbcType=VARCHAR},
110
+      </if>
111
+      <if test="parentId != null" >
112
+        parent_id = #{parentId,jdbcType=INTEGER},
113
+      </if>
114
+      <if test="sort != null" >
115
+        sort = #{sort,jdbcType=INTEGER},
116
+      </if>
117
+      <if test="permission != null" >
118
+        permission = #{permission,jdbcType=VARCHAR},
119
+      </if>
120
+      <if test="menuType != null" >
121
+        menu_type = #{menuType,jdbcType=CHAR},
122
+      </if>
123
+      <if test="status != null" >
124
+        status = #{status,jdbcType=CHAR},
125
+      </if>
126
+    </set>
127
+    where id = #{id,jdbcType=INTEGER}
128
+  </update>
129
+  <update id="updateByPrimaryKey" parameterType="model.SysMenu" >
130
+    update sys_menu
131
+    set menu_name = #{menuName,jdbcType=VARCHAR},
132
+      menu_url = #{menuUrl,jdbcType=VARCHAR},
133
+      menu_icon = #{menuIcon,jdbcType=VARCHAR},
134
+      parent_id = #{parentId,jdbcType=INTEGER},
135
+      sort = #{sort,jdbcType=INTEGER},
136
+      permission = #{permission,jdbcType=VARCHAR},
137
+      menu_type = #{menuType,jdbcType=CHAR},
138
+      status = #{status,jdbcType=CHAR}
139
+    where id = #{id,jdbcType=INTEGER}
140
+  </update>
141
+</mapper>

+ 153
- 0
SmartCommunity/mybatisGeneratorCode/src/main/resources/mapper/SysMsgMapper.xml Datei anzeigen

@@ -0,0 +1,153 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3
+<mapper namespace="dao.SysMsgMapper" >
4
+  <resultMap id="BaseResultMap" type="model.SysMsg" >
5
+    <id column="id" property="id" jdbcType="INTEGER" />
6
+    <result column="user_id" property="userId" jdbcType="INTEGER" />
7
+    <result column="target_id" property="targetId" jdbcType="INTEGER" />
8
+    <result column="msg_mode" property="msgMode" jdbcType="VARCHAR" />
9
+    <result column="msg_type" property="msgType" jdbcType="VARCHAR" />
10
+    <result column="close_type" property="closeType" jdbcType="VARCHAR" />
11
+    <result column="msg_content" property="msgContent" jdbcType="VARCHAR" />
12
+    <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
13
+    <result column="statue" property="statue" jdbcType="INTEGER" />
14
+    <result column="declaration_id_str" property="declarationIdStr" jdbcType="VARCHAR" />
15
+  </resultMap>
16
+  <sql id="Base_Column_List" >
17
+    id, user_id, target_id, msg_mode, msg_type, close_type, msg_content, create_time, 
18
+    statue, declaration_id_str
19
+  </sql>
20
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
21
+    select 
22
+    <include refid="Base_Column_List" />
23
+    from sys_msg
24
+    where id = #{id,jdbcType=INTEGER}
25
+  </select>
26
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
27
+    delete from sys_msg
28
+    where id = #{id,jdbcType=INTEGER}
29
+  </delete>
30
+  <insert id="insert" parameterType="model.SysMsg" >
31
+    insert into sys_msg (id, user_id, target_id, 
32
+      msg_mode, msg_type, close_type, 
33
+      msg_content, create_time, statue, 
34
+      declaration_id_str)
35
+    values (#{id,jdbcType=INTEGER}, #{userId,jdbcType=INTEGER}, #{targetId,jdbcType=INTEGER}, 
36
+      #{msgMode,jdbcType=VARCHAR}, #{msgType,jdbcType=VARCHAR}, #{closeType,jdbcType=VARCHAR}, 
37
+      #{msgContent,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{statue,jdbcType=INTEGER}, 
38
+      #{declarationIdStr,jdbcType=VARCHAR})
39
+  </insert>
40
+  <insert id="insertSelective" parameterType="model.SysMsg" >
41
+    insert into sys_msg
42
+    <trim prefix="(" suffix=")" suffixOverrides="," >
43
+      <if test="id != null" >
44
+        id,
45
+      </if>
46
+      <if test="userId != null" >
47
+        user_id,
48
+      </if>
49
+      <if test="targetId != null" >
50
+        target_id,
51
+      </if>
52
+      <if test="msgMode != null" >
53
+        msg_mode,
54
+      </if>
55
+      <if test="msgType != null" >
56
+        msg_type,
57
+      </if>
58
+      <if test="closeType != null" >
59
+        close_type,
60
+      </if>
61
+      <if test="msgContent != null" >
62
+        msg_content,
63
+      </if>
64
+      <if test="createTime != null" >
65
+        create_time,
66
+      </if>
67
+      <if test="statue != null" >
68
+        statue,
69
+      </if>
70
+      <if test="declarationIdStr != null" >
71
+        declaration_id_str,
72
+      </if>
73
+    </trim>
74
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
75
+      <if test="id != null" >
76
+        #{id,jdbcType=INTEGER},
77
+      </if>
78
+      <if test="userId != null" >
79
+        #{userId,jdbcType=INTEGER},
80
+      </if>
81
+      <if test="targetId != null" >
82
+        #{targetId,jdbcType=INTEGER},
83
+      </if>
84
+      <if test="msgMode != null" >
85
+        #{msgMode,jdbcType=VARCHAR},
86
+      </if>
87
+      <if test="msgType != null" >
88
+        #{msgType,jdbcType=VARCHAR},
89
+      </if>
90
+      <if test="closeType != null" >
91
+        #{closeType,jdbcType=VARCHAR},
92
+      </if>
93
+      <if test="msgContent != null" >
94
+        #{msgContent,jdbcType=VARCHAR},
95
+      </if>
96
+      <if test="createTime != null" >
97
+        #{createTime,jdbcType=TIMESTAMP},
98
+      </if>
99
+      <if test="statue != null" >
100
+        #{statue,jdbcType=INTEGER},
101
+      </if>
102
+      <if test="declarationIdStr != null" >
103
+        #{declarationIdStr,jdbcType=VARCHAR},
104
+      </if>
105
+    </trim>
106
+  </insert>
107
+  <update id="updateByPrimaryKeySelective" parameterType="model.SysMsg" >
108
+    update sys_msg
109
+    <set >
110
+      <if test="userId != null" >
111
+        user_id = #{userId,jdbcType=INTEGER},
112
+      </if>
113
+      <if test="targetId != null" >
114
+        target_id = #{targetId,jdbcType=INTEGER},
115
+      </if>
116
+      <if test="msgMode != null" >
117
+        msg_mode = #{msgMode,jdbcType=VARCHAR},
118
+      </if>
119
+      <if test="msgType != null" >
120
+        msg_type = #{msgType,jdbcType=VARCHAR},
121
+      </if>
122
+      <if test="closeType != null" >
123
+        close_type = #{closeType,jdbcType=VARCHAR},
124
+      </if>
125
+      <if test="msgContent != null" >
126
+        msg_content = #{msgContent,jdbcType=VARCHAR},
127
+      </if>
128
+      <if test="createTime != null" >
129
+        create_time = #{createTime,jdbcType=TIMESTAMP},
130
+      </if>
131
+      <if test="statue != null" >
132
+        statue = #{statue,jdbcType=INTEGER},
133
+      </if>
134
+      <if test="declarationIdStr != null" >
135
+        declaration_id_str = #{declarationIdStr,jdbcType=VARCHAR},
136
+      </if>
137
+    </set>
138
+    where id = #{id,jdbcType=INTEGER}
139
+  </update>
140
+  <update id="updateByPrimaryKey" parameterType="model.SysMsg" >
141
+    update sys_msg
142
+    set user_id = #{userId,jdbcType=INTEGER},
143
+      target_id = #{targetId,jdbcType=INTEGER},
144
+      msg_mode = #{msgMode,jdbcType=VARCHAR},
145
+      msg_type = #{msgType,jdbcType=VARCHAR},
146
+      close_type = #{closeType,jdbcType=VARCHAR},
147
+      msg_content = #{msgContent,jdbcType=VARCHAR},
148
+      create_time = #{createTime,jdbcType=TIMESTAMP},
149
+      statue = #{statue,jdbcType=INTEGER},
150
+      declaration_id_str = #{declarationIdStr,jdbcType=VARCHAR}
151
+    where id = #{id,jdbcType=INTEGER}
152
+  </update>
153
+</mapper>

+ 142
- 0
SmartCommunity/mybatisGeneratorCode/src/main/resources/mapper/SysOrgMapper.xml Datei anzeigen

@@ -0,0 +1,142 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3
+<mapper namespace="dao.SysOrgMapper" >
4
+  <resultMap id="BaseResultMap" type="model.SysOrg" >
5
+    <id column="id" property="id" jdbcType="INTEGER" />
6
+    <result column="org_code" property="orgCode" jdbcType="VARCHAR" />
7
+    <result column="org_name" property="orgName" jdbcType="VARCHAR" />
8
+    <result column="description" property="description" jdbcType="VARCHAR" />
9
+    <result column="parent_id" property="parentId" jdbcType="INTEGER" />
10
+    <result column="create_user" property="createUser" jdbcType="VARCHAR" />
11
+    <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
12
+    <result column="update_user" property="updateUser" jdbcType="VARCHAR" />
13
+    <result column="update_date" property="updateDate" jdbcType="TIMESTAMP" />
14
+  </resultMap>
15
+  <sql id="Base_Column_List" >
16
+    id, org_code, org_name, description, parent_id, create_user, create_date, update_user, 
17
+    update_date
18
+  </sql>
19
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
20
+    select 
21
+    <include refid="Base_Column_List" />
22
+    from sys_org
23
+    where id = #{id,jdbcType=INTEGER}
24
+  </select>
25
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
26
+    delete from sys_org
27
+    where id = #{id,jdbcType=INTEGER}
28
+  </delete>
29
+  <insert id="insert" parameterType="model.SysOrg" >
30
+    insert into sys_org (id, org_code, org_name, 
31
+      description, parent_id, create_user, 
32
+      create_date, update_user, update_date
33
+      )
34
+    values (#{id,jdbcType=INTEGER}, #{orgCode,jdbcType=VARCHAR}, #{orgName,jdbcType=VARCHAR}, 
35
+      #{description,jdbcType=VARCHAR}, #{parentId,jdbcType=INTEGER}, #{createUser,jdbcType=VARCHAR}, 
36
+      #{createDate,jdbcType=TIMESTAMP}, #{updateUser,jdbcType=VARCHAR}, #{updateDate,jdbcType=TIMESTAMP}
37
+      )
38
+  </insert>
39
+  <insert id="insertSelective" parameterType="model.SysOrg" >
40
+    insert into sys_org
41
+    <trim prefix="(" suffix=")" suffixOverrides="," >
42
+      <if test="id != null" >
43
+        id,
44
+      </if>
45
+      <if test="orgCode != null" >
46
+        org_code,
47
+      </if>
48
+      <if test="orgName != null" >
49
+        org_name,
50
+      </if>
51
+      <if test="description != null" >
52
+        description,
53
+      </if>
54
+      <if test="parentId != null" >
55
+        parent_id,
56
+      </if>
57
+      <if test="createUser != null" >
58
+        create_user,
59
+      </if>
60
+      <if test="createDate != null" >
61
+        create_date,
62
+      </if>
63
+      <if test="updateUser != null" >
64
+        update_user,
65
+      </if>
66
+      <if test="updateDate != null" >
67
+        update_date,
68
+      </if>
69
+    </trim>
70
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
71
+      <if test="id != null" >
72
+        #{id,jdbcType=INTEGER},
73
+      </if>
74
+      <if test="orgCode != null" >
75
+        #{orgCode,jdbcType=VARCHAR},
76
+      </if>
77
+      <if test="orgName != null" >
78
+        #{orgName,jdbcType=VARCHAR},
79
+      </if>
80
+      <if test="description != null" >
81
+        #{description,jdbcType=VARCHAR},
82
+      </if>
83
+      <if test="parentId != null" >
84
+        #{parentId,jdbcType=INTEGER},
85
+      </if>
86
+      <if test="createUser != null" >
87
+        #{createUser,jdbcType=VARCHAR},
88
+      </if>
89
+      <if test="createDate != null" >
90
+        #{createDate,jdbcType=TIMESTAMP},
91
+      </if>
92
+      <if test="updateUser != null" >
93
+        #{updateUser,jdbcType=VARCHAR},
94
+      </if>
95
+      <if test="updateDate != null" >
96
+        #{updateDate,jdbcType=TIMESTAMP},
97
+      </if>
98
+    </trim>
99
+  </insert>
100
+  <update id="updateByPrimaryKeySelective" parameterType="model.SysOrg" >
101
+    update sys_org
102
+    <set >
103
+      <if test="orgCode != null" >
104
+        org_code = #{orgCode,jdbcType=VARCHAR},
105
+      </if>
106
+      <if test="orgName != null" >
107
+        org_name = #{orgName,jdbcType=VARCHAR},
108
+      </if>
109
+      <if test="description != null" >
110
+        description = #{description,jdbcType=VARCHAR},
111
+      </if>
112
+      <if test="parentId != null" >
113
+        parent_id = #{parentId,jdbcType=INTEGER},
114
+      </if>
115
+      <if test="createUser != null" >
116
+        create_user = #{createUser,jdbcType=VARCHAR},
117
+      </if>
118
+      <if test="createDate != null" >
119
+        create_date = #{createDate,jdbcType=TIMESTAMP},
120
+      </if>
121
+      <if test="updateUser != null" >
122
+        update_user = #{updateUser,jdbcType=VARCHAR},
123
+      </if>
124
+      <if test="updateDate != null" >
125
+        update_date = #{updateDate,jdbcType=TIMESTAMP},
126
+      </if>
127
+    </set>
128
+    where id = #{id,jdbcType=INTEGER}
129
+  </update>
130
+  <update id="updateByPrimaryKey" parameterType="model.SysOrg" >
131
+    update sys_org
132
+    set org_code = #{orgCode,jdbcType=VARCHAR},
133
+      org_name = #{orgName,jdbcType=VARCHAR},
134
+      description = #{description,jdbcType=VARCHAR},
135
+      parent_id = #{parentId,jdbcType=INTEGER},
136
+      create_user = #{createUser,jdbcType=VARCHAR},
137
+      create_date = #{createDate,jdbcType=TIMESTAMP},
138
+      update_user = #{updateUser,jdbcType=VARCHAR},
139
+      update_date = #{updateDate,jdbcType=TIMESTAMP}
140
+    where id = #{id,jdbcType=INTEGER}
141
+  </update>
142
+</mapper>

+ 16
- 0
SmartCommunity/mybatisGeneratorCode/src/test/java/com/example/demo/DemoApplicationTests.java Datei anzeigen

@@ -0,0 +1,16 @@
1
+package com.example.demo;
2
+
3
+import org.junit.Test;
4
+import org.junit.runner.RunWith;
5
+import org.springframework.boot.test.context.SpringBootTest;
6
+import org.springframework.test.context.junit4.SpringRunner;
7
+
8
+@RunWith(SpringRunner.class)
9
+@SpringBootTest
10
+public class DemoApplicationTests {
11
+
12
+	@Test
13
+	public void contextLoads() {
14
+	}
15
+
16
+}