suochencheng пре 7 година
комит
05a4ede970
100 измењених фајлова са 13850 додато и 0 уклоњено
  1. 7 0
      .gitignore
  2. 6 0
      README.md
  3. 377 0
      log.txt
  4. 984 0
      pom.xml
  5. 10 0
      runConfigurations/Install_Dependencies.xml
  6. 75 0
      runConfigurations/Tomcat.xml
  7. 12 0
      runConfigurations/Vue_Build.xml
  8. 12 0
      runConfigurations/Vue_Server.xml
  9. 70 0
      src/main/java/com/izouma/awesomeadmin/activiti/CustomAuthenticationProvider.java
  10. 31 0
      src/main/java/com/izouma/awesomeadmin/activiti/CustomGroupEntityManager.java
  11. 24 0
      src/main/java/com/izouma/awesomeadmin/activiti/CustomGroupEntityManagerFactory.java
  12. 48 0
      src/main/java/com/izouma/awesomeadmin/activiti/CustomUserEntityManager.java
  13. 23 0
      src/main/java/com/izouma/awesomeadmin/activiti/CustomUserEntityManagerFactory.java
  14. 45 0
      src/main/java/com/izouma/awesomeadmin/activiti/RestFilter.java
  15. 153 0
      src/main/java/com/izouma/awesomeadmin/constant/AppConstant.java
  16. 36 0
      src/main/java/com/izouma/awesomeadmin/constant/RongConstant.java
  17. 17 0
      src/main/java/com/izouma/awesomeadmin/container/DateConverter.java
  18. 26 0
      src/main/java/com/izouma/awesomeadmin/container/Lifecycle.java
  19. 70 0
      src/main/java/com/izouma/awesomeadmin/container/StartupListener.java
  20. 29 0
      src/main/java/com/izouma/awesomeadmin/dao/AccessTokenMapper.java
  21. 21 0
      src/main/java/com/izouma/awesomeadmin/dao/AccessTokenMapper.xml
  22. 26 0
      src/main/java/com/izouma/awesomeadmin/dao/CommonQueryMapper.java
  23. 264 0
      src/main/java/com/izouma/awesomeadmin/dao/CommonQueryMapper.xml
  24. 27 0
      src/main/java/com/izouma/awesomeadmin/dao/CommonQuerySqlServerMapper.java
  25. 258 0
      src/main/java/com/izouma/awesomeadmin/dao/CommonQuerySqlServerMapper.xml
  26. 31 0
      src/main/java/com/izouma/awesomeadmin/dao/DataMapper.java
  27. 35 0
      src/main/java/com/izouma/awesomeadmin/dao/DataMapper.xml
  28. 36 0
      src/main/java/com/izouma/awesomeadmin/dao/DataSourceInfoMapper.java
  29. 327 0
      src/main/java/com/izouma/awesomeadmin/dao/DataSourceInfoMapper.xml
  30. 53 0
      src/main/java/com/izouma/awesomeadmin/dao/DepartInfoMapper.java
  31. 440 0
      src/main/java/com/izouma/awesomeadmin/dao/DepartInfoMapper.xml
  32. 33 0
      src/main/java/com/izouma/awesomeadmin/dao/GenCodeMapper.java
  33. 265 0
      src/main/java/com/izouma/awesomeadmin/dao/GenCodeMapper.xml
  34. 33 0
      src/main/java/com/izouma/awesomeadmin/dao/GenTestTableMapper.java
  35. 209 0
      src/main/java/com/izouma/awesomeadmin/dao/GenTestTableMapper.xml
  36. 34 0
      src/main/java/com/izouma/awesomeadmin/dao/PowerInfoMapper.java
  37. 224 0
      src/main/java/com/izouma/awesomeadmin/dao/PowerInfoMapper.xml
  38. 33 0
      src/main/java/com/izouma/awesomeadmin/dao/QueryConfigMapper.java
  39. 398 0
      src/main/java/com/izouma/awesomeadmin/dao/QueryConfigMapper.xml
  40. 26 0
      src/main/java/com/izouma/awesomeadmin/dao/RongYunTokenMapper.java
  41. 88 0
      src/main/java/com/izouma/awesomeadmin/dao/RongYunTokenMapper.xml
  42. 51 0
      src/main/java/com/izouma/awesomeadmin/dao/SuperUserMapper.java
  43. 88 0
      src/main/java/com/izouma/awesomeadmin/dao/SuperUserMapper.xml
  44. 14 0
      src/main/java/com/izouma/awesomeadmin/dao/SysAppTokenMapper.java
  45. 18 0
      src/main/java/com/izouma/awesomeadmin/dao/SysAppTokenMapper.xml
  46. 33 0
      src/main/java/com/izouma/awesomeadmin/dao/SysDataruleMapper.java
  47. 153 0
      src/main/java/com/izouma/awesomeadmin/dao/SysDataruleMapper.xml
  48. 34 0
      src/main/java/com/izouma/awesomeadmin/dao/SysMenuMapper.java
  49. 406 0
      src/main/java/com/izouma/awesomeadmin/dao/SysMenuMapper.xml
  50. 47 0
      src/main/java/com/izouma/awesomeadmin/dao/SysRoleMapper.java
  51. 376 0
      src/main/java/com/izouma/awesomeadmin/dao/SysRoleMapper.xml
  52. 34 0
      src/main/java/com/izouma/awesomeadmin/dao/TableFieldMapper.java
  53. 494 0
      src/main/java/com/izouma/awesomeadmin/dao/TableFieldMapper.xml
  54. 34 0
      src/main/java/com/izouma/awesomeadmin/dao/TableNiuseRongliangMapper.java
  55. 588 0
      src/main/java/com/izouma/awesomeadmin/dao/TableNiuseRongliangMapper.xml
  56. 34 0
      src/main/java/com/izouma/awesomeadmin/dao/TableShouyiYaopinxinxiMapper.java
  57. 376 0
      src/main/java/com/izouma/awesomeadmin/dao/TableShouyiYaopinxinxiMapper.xml
  58. 33 0
      src/main/java/com/izouma/awesomeadmin/dao/TestAaaMapper.java
  59. 467 0
      src/main/java/com/izouma/awesomeadmin/dao/TestAaaMapper.xml
  60. 33 0
      src/main/java/com/izouma/awesomeadmin/dao/TestBbbCopyMapper.java
  61. 237 0
      src/main/java/com/izouma/awesomeadmin/dao/TestBbbCopyMapper.xml
  62. 33 0
      src/main/java/com/izouma/awesomeadmin/dao/TestBbbMapper.java
  63. 306 0
      src/main/java/com/izouma/awesomeadmin/dao/TestBbbMapper.xml
  64. 34 0
      src/main/java/com/izouma/awesomeadmin/dao/TestCaidanMapper.java
  65. 288 0
      src/main/java/com/izouma/awesomeadmin/dao/TestCaidanMapper.xml
  66. 33 0
      src/main/java/com/izouma/awesomeadmin/dao/TestDeployMapper.java
  67. 212 0
      src/main/java/com/izouma/awesomeadmin/dao/TestDeployMapper.xml
  68. 34 0
      src/main/java/com/izouma/awesomeadmin/dao/TestSqlserverAaaMapper.java
  69. 228 0
      src/main/java/com/izouma/awesomeadmin/dao/TestSqlserverAaaMapper.xml
  70. 33 0
      src/main/java/com/izouma/awesomeadmin/dao/TestaaaoneMapper.java
  71. 264 0
      src/main/java/com/izouma/awesomeadmin/dao/TestaaaoneMapper.xml
  72. 33 0
      src/main/java/com/izouma/awesomeadmin/dao/TestgitMapper.java
  73. 218 0
      src/main/java/com/izouma/awesomeadmin/dao/TestgitMapper.xml
  74. 39 0
      src/main/java/com/izouma/awesomeadmin/dao/UserInfoMapper.java
  75. 475 0
      src/main/java/com/izouma/awesomeadmin/dao/UserInfoMapper.xml
  76. 23 0
      src/main/java/com/izouma/awesomeadmin/datasource/DataService.java
  77. 44 0
      src/main/java/com/izouma/awesomeadmin/datasource/DataServiceImpl.java
  78. 14 0
      src/main/java/com/izouma/awesomeadmin/datasource/DataSource.java
  79. 67 0
      src/main/java/com/izouma/awesomeadmin/datasource/DataSourceAspect.java
  80. 79 0
      src/main/java/com/izouma/awesomeadmin/datasource/DynamicDataSource.java
  81. 20 0
      src/main/java/com/izouma/awesomeadmin/datasource/DynamicDataSourceHolder.java
  82. 144 0
      src/main/java/com/izouma/awesomeadmin/dto/Page.java
  83. 70 0
      src/main/java/com/izouma/awesomeadmin/dto/Result.java
  84. 87 0
      src/main/java/com/izouma/awesomeadmin/dto/TreeNode.java
  85. 32 0
      src/main/java/com/izouma/awesomeadmin/dto/wx/AccessToken.java
  86. 69 0
      src/main/java/com/izouma/awesomeadmin/dto/wx/BaseMessage.java
  87. 54 0
      src/main/java/com/izouma/awesomeadmin/dto/wx/CustomServiceMessage.java
  88. 18 0
      src/main/java/com/izouma/awesomeadmin/dto/wx/Image.java
  89. 18 0
      src/main/java/com/izouma/awesomeadmin/dto/wx/ImageMessage.java
  90. 74 0
      src/main/java/com/izouma/awesomeadmin/dto/wx/Music.java
  91. 18 0
      src/main/java/com/izouma/awesomeadmin/dto/wx/MusicMessage.java
  92. 58 0
      src/main/java/com/izouma/awesomeadmin/dto/wx/News.java
  93. 25 0
      src/main/java/com/izouma/awesomeadmin/dto/wx/NewsMessage.java
  94. 24 0
      src/main/java/com/izouma/awesomeadmin/dto/wx/TemplateData.java
  95. 47 0
      src/main/java/com/izouma/awesomeadmin/dto/wx/TemplateMessage.java
  96. 37 0
      src/main/java/com/izouma/awesomeadmin/dto/wx/TextMessage.java
  97. 30 0
      src/main/java/com/izouma/awesomeadmin/frame/GenController.java
  98. 2026 0
      src/main/java/com/izouma/awesomeadmin/frame/gen/GenEntity.java
  99. 16 0
      src/main/java/com/izouma/awesomeadmin/frame/gen/JdbcConfig.java
  100. 60 0
      src/main/java/com/izouma/awesomeadmin/frame/gen/RunTool.java

+ 7 - 0
.gitignore

@@ -0,0 +1,7 @@
+.vscode
+.DS_Store
+.idea
+node_modules/
+/target
+*.iml
+/src/main/webapp/static

+ 6 - 0
README.md

@@ -0,0 +1,6 @@
+# 后台项目模版
+* IDEA 直接打开项目
+* 复制 runConfigurations 文件夹至 .idea 文件夹下
+* 运行 Install Dependencies
+* 同时运行 Tomcat 和 Vue Server
+* 访问 [http://localhost:8081](http://localhost:8081)

+ 377 - 0
log.txt

@@ -0,0 +1,377 @@
+[2018-07-31 16:15:40] [WARN ] - Bad pool size config, start 3 < min 5. Using 5 as start.
+[2018-07-31 16:17:19] [WARN ] - Bad pool size config, start 3 < min 5. Using 5 as start.
+[2018-07-31 16:17:38] [WARN ] - Bad pool size config, start 3 < min 5. Using 5 as start.
+[2018-07-31 16:18:06] [WARN ] - Bad pool size config, start 3 < min 5. Using 5 as start.
+[2018-07-31 16:18:27] [WARN ] - Bad pool size config, start 3 < min 5. Using 5 as start.
+[2018-08-07 16:36:56] [WARN ] - Bad pool size config, start 3 < min 5. Using 5 as start.
+[2018-08-07 16:38:01] [WARN ] - Bad pool size config, start 3 < min 5. Using 5 as start.
+[2018-08-07 16:39:11] [WARN ] - Bad pool size config, start 3 < min 5. Using 5 as start.
+[2018-08-07 16:41:25] [WARN ] - Bad pool size config, start 3 < min 5. Using 5 as start.
+[2018-08-07 16:53:52] [WARN ] - Bad pool size config, start 3 < min 5. Using 5 as start.
+[2018-08-07 17:16:04] [WARN ] - Bad pool size config, start 3 < min 5. Using 5 as start.
+[2018-08-07 17:18:19] [WARN ] - Bad pool size config, start 3 < min 5. Using 5 as start.
+[2018-08-07 17:50:23] [WARN ] - Bad pool size config, start 3 < min 5. Using 5 as start.
+[2018-08-07 17:56:01] [WARN ] - Bad pool size config, start 3 < min 5. Using 5 as start.
+[2018-08-07 18:03:44] [WARN ] - SQL State '08007' of Exception tested by statusOnException() implies that the database is invalid, and the pool should refill itself with fresh Connections.
+com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Communications link failure during rollback(). Transaction resolution unknown.
+	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
+	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
+	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
+	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
+	at com.mysql.jdbc.Util.handleNewInstance(Util.java:409)
+	at com.mysql.jdbc.Util.getInstance(Util.java:384)
+	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1013)
+	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:987)
+	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:973)
+	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:918)
+	at com.mysql.jdbc.ConnectionImpl.rollback(ConnectionImpl.java:5086)
+	at com.mchange.v2.c3p0.impl.NewProxyConnection.rollback(NewProxyConnection.java:1033)
+	at org.springframework.jdbc.datasource.DataSourceTransactionManager.doRollback(DataSourceTransactionManager.java:294)
+	at org.springframework.transaction.support.AbstractPlatformTransactionManager.processRollback(AbstractPlatformTransactionManager.java:853)
+	at org.springframework.transaction.support.AbstractPlatformTransactionManager.rollback(AbstractPlatformTransactionManager.java:830)
+	at org.springframework.test.context.transaction.TransactionContext.endTransaction(TransactionContext.java:125)
+	at org.springframework.test.context.transaction.TransactionalTestExecutionListener.afterTestMethod(TransactionalTestExecutionListener.java:227)
+	at org.springframework.test.context.TestContextManager.afterTestMethod(TestContextManager.java:319)
+	at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:94)
+	at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84)
+	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
+	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:252)
+	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:94)
+	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
+	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
+	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
+	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
+	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
+	at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
+	at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
+	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
+	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:191)
+	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
+	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
+	at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
+	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
+	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
+[2018-08-07 18:03:44] [ERROR] - Error while closing command context
+org.apache.ibatis.exceptions.PersistenceException: 
+### Error querying database.  Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
+
+The last packet successfully received from the server was 432,744 milliseconds ago.  The last packet sent successfully to the server was 18,341 milliseconds ago.
+### The error may exist in org/activiti/db/mapping/entity/Job.xml
+### The error may involve org.activiti.engine.impl.persistence.entity.JobEntity.selectNextJobsToExecute-Inline
+### The error occurred while setting parameters
+### SQL: select       RES.*            from ACT_RU_JOB RES          LEFT OUTER JOIN ACT_RU_EXECUTION PI ON PI.ID_ = RES.PROCESS_INSTANCE_ID_     where (RES.RETRIES_ > 0)       and (RES.DUEDATE_ is null or RES.DUEDATE_ <= ?)       and (RES.LOCK_OWNER_ is null or RES.LOCK_EXP_TIME_ <= ?)      and (         (RES.EXECUTION_ID_ is null)        or         (PI.SUSPENSION_STATE_ = 1)       )       LIMIT ? OFFSET ?
+### Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
+
+The last packet successfully received from the server was 432,744 milliseconds ago.  The last packet sent successfully to the server was 18,341 milliseconds ago.
+	at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
+	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:122)
+	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:113)
+	at org.activiti.engine.impl.db.DbSqlSession.selectListWithRawParameter(DbSqlSession.java:440)
+	at org.activiti.engine.impl.db.DbSqlSession.selectList(DbSqlSession.java:431)
+	at org.activiti.engine.impl.db.DbSqlSession.selectList(DbSqlSession.java:426)
+	at org.activiti.engine.impl.db.DbSqlSession.selectList(DbSqlSession.java:409)
+	at org.activiti.engine.impl.persistence.entity.JobEntityManager.findNextJobsToExecute(JobEntityManager.java:150)
+	at org.activiti.engine.impl.cmd.AcquireJobsCmd.execute(AcquireJobsCmd.java:50)
+	at org.activiti.engine.impl.cmd.AcquireJobsCmd.execute(AcquireJobsCmd.java:33)
+	at org.activiti.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:24)
+	at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:57)
+	at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:47)
+	at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)
+	at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:45)
+	at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:31)
+	at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:40)
+	at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:35)
+	at org.activiti.engine.impl.jobexecutor.AcquireJobsRunnableImpl.run(AcquireJobsRunnableImpl.java:54)
+	at java.lang.Thread.run(Thread.java:748)
+Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
+
+The last packet successfully received from the server was 432,744 milliseconds ago.  The last packet sent successfully to the server was 18,341 milliseconds ago.
+	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
+	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
+	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
+	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
+	at com.mysql.jdbc.Util.handleNewInstance(Util.java:409)
+	at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1127)
+	at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:3715)
+	at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:3604)
+	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4155)
+	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2615)
+	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2776)
+	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2838)
+	at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2082)
+	at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:1307)
+	at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.execute(NewProxyPreparedStatement.java:67)
+	at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:62)
+	at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:78)
+	at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:62)
+	at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:303)
+	at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:154)
+	at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:102)
+	at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:82)
+	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:120)
+	... 18 more
+Caused by: java.net.SocketException: Operation timed out (Read failed)
+	at java.net.SocketInputStream.socketRead0(Native Method)
+	at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
+	at java.net.SocketInputStream.read(SocketInputStream.java:171)
+	at java.net.SocketInputStream.read(SocketInputStream.java:141)
+	at com.mysql.jdbc.util.ReadAheadInputStream.fill(ReadAheadInputStream.java:112)
+	at com.mysql.jdbc.util.ReadAheadInputStream.readFromUnderlyingStreamIfNecessary(ReadAheadInputStream.java:159)
+	at com.mysql.jdbc.util.ReadAheadInputStream.read(ReadAheadInputStream.java:187)
+	at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:3158)
+	at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:3615)
+	... 34 more
+[2018-08-07 18:03:44] [WARN ] - A ConnectionTest has failed, reporting that all previously acquired Connections are likely invalid. The pool will be reset.
+[2018-08-07 18:03:44] [WARN ] - [c3p0] A PooledConnection that has already signalled a Connection error is still in use!
+[2018-08-07 18:03:44] [WARN ] - [c3p0] Another error has occurred [ com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed after connection closed. ] which will not be reported to listeners!
+com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed after connection closed.
+	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
+	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
+	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
+	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
+	at com.mysql.jdbc.Util.handleNewInstance(Util.java:409)
+	at com.mysql.jdbc.Util.getInstance(Util.java:384)
+	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1013)
+	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:987)
+	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:973)
+	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:918)
+	at com.mysql.jdbc.ConnectionImpl.throwConnectionClosedException(ConnectionImpl.java:1321)
+	at com.mysql.jdbc.ConnectionImpl.checkClosed(ConnectionImpl.java:1313)
+	at com.mysql.jdbc.ConnectionImpl.rollback(ConnectionImpl.java:5046)
+	at com.mchange.v2.c3p0.impl.NewProxyConnection.rollback(NewProxyConnection.java:1033)
+	at org.springframework.jdbc.datasource.DataSourceTransactionManager.doRollback(DataSourceTransactionManager.java:294)
+	at org.springframework.transaction.support.AbstractPlatformTransactionManager.processRollback(AbstractPlatformTransactionManager.java:853)
+	at org.springframework.transaction.support.AbstractPlatformTransactionManager.rollback(AbstractPlatformTransactionManager.java:830)
+	at org.springframework.transaction.support.TransactionTemplate.rollbackOnException(TransactionTemplate.java:164)
+	at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:137)
+	at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:45)
+	at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:31)
+	at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:40)
+	at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:35)
+	at org.activiti.engine.impl.jobexecutor.AcquireJobsRunnableImpl.run(AcquireJobsRunnableImpl.java:54)
+	at java.lang.Thread.run(Thread.java:748)
+[2018-08-07 18:03:44] [WARN ] - [c3p0] A PooledConnection that has already signalled a Connection error is still in use!
+[2018-08-07 18:03:44] [WARN ] - [c3p0] Another error has occurred [ com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed after connection closed. ] which will not be reported to listeners!
+com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed after connection closed.
+	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
+	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
+	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
+	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
+	at com.mysql.jdbc.Util.handleNewInstance(Util.java:409)
+	at com.mysql.jdbc.Util.getInstance(Util.java:384)
+	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1013)
+	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:987)
+	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:973)
+	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:918)
+	at com.mysql.jdbc.ConnectionImpl.throwConnectionClosedException(ConnectionImpl.java:1321)
+	at com.mysql.jdbc.ConnectionImpl.checkClosed(ConnectionImpl.java:1313)
+	at com.mysql.jdbc.ConnectionImpl.setAutoCommit(ConnectionImpl.java:5311)
+	at com.mchange.v2.c3p0.impl.NewProxyConnection.setAutoCommit(NewProxyConnection.java:1059)
+	at org.springframework.jdbc.datasource.DataSourceTransactionManager.doCleanupAfterCompletion(DataSourceTransactionManager.java:324)
+	at org.springframework.transaction.support.AbstractPlatformTransactionManager.cleanupAfterCompletion(AbstractPlatformTransactionManager.java:1016)
+	at org.springframework.transaction.support.AbstractPlatformTransactionManager.processRollback(AbstractPlatformTransactionManager.java:883)
+	at org.springframework.transaction.support.AbstractPlatformTransactionManager.rollback(AbstractPlatformTransactionManager.java:830)
+	at org.springframework.transaction.support.TransactionTemplate.rollbackOnException(TransactionTemplate.java:164)
+	at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:137)
+	at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:45)
+	at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:31)
+	at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:40)
+	at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:35)
+	at org.activiti.engine.impl.jobexecutor.AcquireJobsRunnableImpl.run(AcquireJobsRunnableImpl.java:54)
+	at java.lang.Thread.run(Thread.java:748)
+[2018-08-07 18:03:44] [ERROR] - Application exception overridden by rollback exception
+org.apache.ibatis.exceptions.PersistenceException: 
+### Error querying database.  Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
+
+The last packet successfully received from the server was 432,744 milliseconds ago.  The last packet sent successfully to the server was 18,341 milliseconds ago.
+### The error may exist in org/activiti/db/mapping/entity/Job.xml
+### The error may involve org.activiti.engine.impl.persistence.entity.JobEntity.selectNextJobsToExecute-Inline
+### The error occurred while setting parameters
+### SQL: select       RES.*            from ACT_RU_JOB RES          LEFT OUTER JOIN ACT_RU_EXECUTION PI ON PI.ID_ = RES.PROCESS_INSTANCE_ID_     where (RES.RETRIES_ > 0)       and (RES.DUEDATE_ is null or RES.DUEDATE_ <= ?)       and (RES.LOCK_OWNER_ is null or RES.LOCK_EXP_TIME_ <= ?)      and (         (RES.EXECUTION_ID_ is null)        or         (PI.SUSPENSION_STATE_ = 1)       )       LIMIT ? OFFSET ?
+### Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
+
+The last packet successfully received from the server was 432,744 milliseconds ago.  The last packet sent successfully to the server was 18,341 milliseconds ago.
+	at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
+	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:122)
+	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:113)
+	at org.activiti.engine.impl.db.DbSqlSession.selectListWithRawParameter(DbSqlSession.java:440)
+	at org.activiti.engine.impl.db.DbSqlSession.selectList(DbSqlSession.java:431)
+	at org.activiti.engine.impl.db.DbSqlSession.selectList(DbSqlSession.java:426)
+	at org.activiti.engine.impl.db.DbSqlSession.selectList(DbSqlSession.java:409)
+	at org.activiti.engine.impl.persistence.entity.JobEntityManager.findNextJobsToExecute(JobEntityManager.java:150)
+	at org.activiti.engine.impl.cmd.AcquireJobsCmd.execute(AcquireJobsCmd.java:50)
+	at org.activiti.engine.impl.cmd.AcquireJobsCmd.execute(AcquireJobsCmd.java:33)
+	at org.activiti.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:24)
+	at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:57)
+	at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:47)
+	at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)
+	at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:45)
+	at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:31)
+	at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:40)
+	at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:35)
+	at org.activiti.engine.impl.jobexecutor.AcquireJobsRunnableImpl.run(AcquireJobsRunnableImpl.java:54)
+	at java.lang.Thread.run(Thread.java:748)
+Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
+
+The last packet successfully received from the server was 432,744 milliseconds ago.  The last packet sent successfully to the server was 18,341 milliseconds ago.
+	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
+	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
+	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
+	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
+	at com.mysql.jdbc.Util.handleNewInstance(Util.java:409)
+	at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1127)
+	at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:3715)
+	at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:3604)
+	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4155)
+	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2615)
+	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2776)
+	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2838)
+	at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2082)
+	at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:1307)
+	at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.execute(NewProxyPreparedStatement.java:67)
+	at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:62)
+	at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:78)
+	at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:62)
+	at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:303)
+	at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:154)
+	at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:102)
+	at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:82)
+	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:120)
+	... 18 more
+Caused by: java.net.SocketException: Operation timed out (Read failed)
+	at java.net.SocketInputStream.socketRead0(Native Method)
+	at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
+	at java.net.SocketInputStream.read(SocketInputStream.java:171)
+	at java.net.SocketInputStream.read(SocketInputStream.java:141)
+	at com.mysql.jdbc.util.ReadAheadInputStream.fill(ReadAheadInputStream.java:112)
+	at com.mysql.jdbc.util.ReadAheadInputStream.readFromUnderlyingStreamIfNecessary(ReadAheadInputStream.java:159)
+	at com.mysql.jdbc.util.ReadAheadInputStream.read(ReadAheadInputStream.java:187)
+	at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:3158)
+	at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:3615)
+	... 34 more
+[2018-08-07 18:03:44] [ERROR] - exception during job acquisition: Could not roll back JDBC transaction; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed after connection closed.
+org.springframework.transaction.TransactionSystemException: Could not roll back JDBC transaction; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed after connection closed.
+	at org.springframework.jdbc.datasource.DataSourceTransactionManager.doRollback(DataSourceTransactionManager.java:297)
+	at org.springframework.transaction.support.AbstractPlatformTransactionManager.processRollback(AbstractPlatformTransactionManager.java:853)
+	at org.springframework.transaction.support.AbstractPlatformTransactionManager.rollback(AbstractPlatformTransactionManager.java:830)
+	at org.springframework.transaction.support.TransactionTemplate.rollbackOnException(TransactionTemplate.java:164)
+	at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:137)
+	at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:45)
+	at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:31)
+	at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:40)
+	at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:35)
+	at org.activiti.engine.impl.jobexecutor.AcquireJobsRunnableImpl.run(AcquireJobsRunnableImpl.java:54)
+	at java.lang.Thread.run(Thread.java:748)
+Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed after connection closed.
+	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
+	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
+	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
+	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
+	at com.mysql.jdbc.Util.handleNewInstance(Util.java:409)
+	at com.mysql.jdbc.Util.getInstance(Util.java:384)
+	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1013)
+	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:987)
+	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:973)
+	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:918)
+	at com.mysql.jdbc.ConnectionImpl.throwConnectionClosedException(ConnectionImpl.java:1321)
+	at com.mysql.jdbc.ConnectionImpl.checkClosed(ConnectionImpl.java:1313)
+	at com.mysql.jdbc.ConnectionImpl.rollback(ConnectionImpl.java:5046)
+	at com.mchange.v2.c3p0.impl.NewProxyConnection.rollback(NewProxyConnection.java:1033)
+	at org.springframework.jdbc.datasource.DataSourceTransactionManager.doRollback(DataSourceTransactionManager.java:294)
+	... 10 more
+[2018-08-07 18:03:44] [WARN ] - [c3p0] A PooledConnection that has already signalled a Connection error is still in use!
+[2018-08-07 18:03:44] [WARN ] - [c3p0] Another error has occurred [ com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
+
+The last packet successfully received from the server was 460,935 milliseconds ago.  The last packet sent successfully to the server was 18,355 milliseconds ago. ] which will not be reported to listeners!
+com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
+
+The last packet successfully received from the server was 460,935 milliseconds ago.  The last packet sent successfully to the server was 18,355 milliseconds ago.
+	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
+	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
+	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
+	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
+	at com.mysql.jdbc.Util.handleNewInstance(Util.java:409)
+	at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1127)
+	at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3983)
+	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2596)
+	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2776)
+	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2832)
+	at com.mysql.jdbc.ConnectionImpl.setAutoCommit(ConnectionImpl.java:5357)
+	at com.mchange.v2.c3p0.impl.NewProxyConnection.setAutoCommit(NewProxyConnection.java:1059)
+	at org.springframework.jdbc.datasource.DataSourceTransactionManager.doCleanupAfterCompletion(DataSourceTransactionManager.java:324)
+	at org.springframework.transaction.support.AbstractPlatformTransactionManager.cleanupAfterCompletion(AbstractPlatformTransactionManager.java:1016)
+	at org.springframework.transaction.support.AbstractPlatformTransactionManager.processRollback(AbstractPlatformTransactionManager.java:883)
+	at org.springframework.transaction.support.AbstractPlatformTransactionManager.rollback(AbstractPlatformTransactionManager.java:830)
+	at org.springframework.test.context.transaction.TransactionContext.endTransaction(TransactionContext.java:125)
+	at org.springframework.test.context.transaction.TransactionalTestExecutionListener.afterTestMethod(TransactionalTestExecutionListener.java:227)
+	at org.springframework.test.context.TestContextManager.afterTestMethod(TestContextManager.java:319)
+	at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:94)
+	at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84)
+	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
+	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:252)
+	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:94)
+	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
+	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
+	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
+	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
+	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
+	at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
+	at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
+	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
+	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:191)
+	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
+	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
+	at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
+	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
+	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
+Caused by: java.net.SocketException: Broken pipe (Write failed)
+	at java.net.SocketOutputStream.socketWrite0(Native Method)
+	at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:111)
+	at java.net.SocketOutputStream.write(SocketOutputStream.java:155)
+	at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
+	at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
+	at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3964)
+	... 31 more
+[2018-08-07 18:03:44] [WARN ] - Caught exception while allowing TestExecutionListener [org.springframework.test.context.transaction.TransactionalTestExecutionListener@60652518] to process 'after' execution for test: method [public void AppTokenTest.parseToken()], instance [AppTokenTest@438aaa9f], exception [null]
+org.springframework.transaction.TransactionSystemException: Could not roll back JDBC transaction; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Communications link failure during rollback(). Transaction resolution unknown.
+	at org.springframework.jdbc.datasource.DataSourceTransactionManager.doRollback(DataSourceTransactionManager.java:297)
+	at org.springframework.transaction.support.AbstractPlatformTransactionManager.processRollback(AbstractPlatformTransactionManager.java:853)
+	at org.springframework.transaction.support.AbstractPlatformTransactionManager.rollback(AbstractPlatformTransactionManager.java:830)
+	at org.springframework.test.context.transaction.TransactionContext.endTransaction(TransactionContext.java:125)
+	at org.springframework.test.context.transaction.TransactionalTestExecutionListener.afterTestMethod(TransactionalTestExecutionListener.java:227)
+	at org.springframework.test.context.TestContextManager.afterTestMethod(TestContextManager.java:319)
+	at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:94)
+	at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84)
+	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
+	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:252)
+	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:94)
+	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
+	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
+	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
+	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
+	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
+	at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
+	at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
+	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
+	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:191)
+	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
+	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
+	at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
+	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
+	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
+Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Communications link failure during rollback(). Transaction resolution unknown.
+	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
+	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
+	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
+	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
+	at com.mysql.jdbc.Util.handleNewInstance(Util.java:409)
+	at com.mysql.jdbc.Util.getInstance(Util.java:384)
+	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1013)
+	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:987)
+	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:973)
+	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:918)
+	at com.mysql.jdbc.ConnectionImpl.rollback(ConnectionImpl.java:5086)
+	at com.mchange.v2.c3p0.impl.NewProxyConnection.rollback(NewProxyConnection.java:1033)
+	at org.springframework.jdbc.datasource.DataSourceTransactionManager.doRollback(DataSourceTransactionManager.java:294)
+	... 24 more
+[2018-08-07 18:03:49] [WARN ] - Bad pool size config, start 3 < min 5. Using 5 as start.

+ 984 - 0
pom.xml

@@ -0,0 +1,984 @@
+<?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>com.izouma</groupId>
+    <artifactId>awesome-admin</artifactId>
+    <version>1.0.0</version>
+    <packaging>war</packaging>
+
+    <name>awesome-admin</name>
+    <url>http://www.izouma.com</url>
+
+    <!-- 项目属性 -->
+    <properties>
+        <!-- other libs -->
+        <lib.path>${basedir}/src/main/webapp/WEB-INF/lib</lib.path>
+        <!-- main version setting -->
+        <spring.version>4.3.5.RELEASE</spring.version>
+        <validator.version>5.4.0.Final</validator.version>
+        <mybatis.version>3.3.1</mybatis.version>
+        <mybatis-spring.version>1.2.2</mybatis-spring.version>
+        <druid.version>1.0.31</druid.version>
+        <ehcache.version>2.6.11</ehcache.version>
+        <ehcache-web.version>2.0.4</ehcache-web.version>
+        <shiro.version>1.4.0</shiro.version>
+        <sitemesh.version>2.4.2</sitemesh.version>
+        <activiti.version>5.22.0</activiti.version>
+
+        <!-- tools version setting -->
+        <slf4j.version>1.7.25</slf4j.version>
+        <log4j.version>1.2.17</log4j.version>
+        <commons-io.version>2.4</commons-io.version>
+        <commons-codec.version>1.9</commons-codec.version>
+        <commons-fileupload.version>1.3.1</commons-fileupload.version>
+        <commons-beanutils.version>1.9.1</commons-beanutils.version>
+        <jackson.version>2.8.6</jackson.version>
+        <fastjson.version>1.1.40</fastjson.version>
+        <xstream.version>1.4.9</xstream.version>
+        <dozer.version>5.5.1</dozer.version>
+        <poi.version>3.9</poi.version>
+        <freemarker.version>2.3.25-incubating</freemarker.version>
+        <quartz.version>2.2.3</quartz.version>
+        <ckfinder.version>2.3</ckfinder.version>
+
+        <guava.version>20.0</guava.version>
+        <commons-lang3.version>3.5</commons-lang3.version>
+        <commons-text.version>1.3</commons-text.version>
+        <commons-collections.version>4.1</commons-collections.version>
+
+        <!-- jdbc driver setting -->
+        <mysql.driver.version>5.1.30</mysql.driver.version>
+        <sqlserver.driver.version>4.0.0</sqlserver.driver.version>
+        <oracle.driver.version>10.2.0.4.0</oracle.driver.version>
+        <mssql.driver.version>1.3.1</mssql.driver.version>
+
+        <!-- environment setting -->
+        <jdk.version>1.8</jdk.version>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <downloadSources>true</downloadSources>
+
+    </properties>
+    <!-- 设定仓库 -->
+    <!--<repositories>-->
+    <!--<repository>-->
+    <!--<id>central-repos</id>-->
+    <!--<name>Central Repository</name>-->
+    <!--<url>http://maven.aliyun.com/nexus/content/groups/public/</url>-->
+    <!--<releases>-->
+    <!--<enabled>true</enabled>-->
+    <!--</releases>-->
+    <!--<snapshots>-->
+    <!--<enabled>false</enabled>-->
+    <!--</snapshots>-->
+    <!--</repository>-->
+
+    <!--<repository>-->
+    <!--<id>central-repos2</id>-->
+    <!--<name>Central Repository 2</name>-->
+    <!--<url>http://mvnrepo.code.taobao.org/nexus/content/repositories/snapshots/</url>-->
+    <!--<releases>-->
+    <!--<enabled>true</enabled>-->
+    <!--</releases>-->
+    <!--<snapshots>-->
+    <!--<enabled>false</enabled>-->
+    <!--</snapshots>-->
+    <!--</repository>-->
+
+    <!--<repository>-->
+    <!--<id>springsource-repos</id>-->
+    <!--<name>SpringSource Repository</name>-->
+    <!--<url>http://mvnrepo.code.taobao.org/nexus/content/repositories/releases/</url>-->
+    <!--<releases>-->
+    <!--<enabled>true</enabled>-->
+    <!--</releases>-->
+    <!--<snapshots>-->
+    <!--<enabled>false</enabled>-->
+    <!--</snapshots>-->
+    <!--</repository>-->
+    <!---->
+    <!--<repository>-->
+    <!--<id>bitwalker.user-agent-utils.mvn.repo</id>-->
+    <!--<url>https://nexus.jackpinetech.com/nexus/content/groups/public</url>-->
+    <!--&lt;!&ndash; use snapshot version &ndash;&gt;-->
+    <!--<snapshots>-->
+    <!--<updatePolicy>always</updatePolicy>-->
+    <!--</snapshots>-->
+    <!--</repository>-->
+    <!--</repositories>-->
+    <build>
+        <finalName>awesome-admin</finalName>
+        <resources>
+            <resource>
+                <directory>src/main/java</directory>
+                <filtering>true</filtering>
+                <includes>
+                    <include>**/*.xml</include>
+                    <include>**/*.properties</include>
+                </includes>
+            </resource>
+            <resource>
+                <directory>src/main/resources</directory>
+            </resource>
+        </resources>
+
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <source>${jdk.version}</source>
+                    <target>${jdk.version}</target>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <version>2.10</version>
+                <configuration>
+                    <skip>true</skip>
+                    <testFailureIgnore>true</testFailureIgnore>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+    <!-- 依赖项定义 -->
+    <dependencies>
+        <!-- SPRING begin -->
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-core</artifactId>
+            <version>${spring.version}</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>commons-logging</groupId>
+                    <artifactId>commons-logging</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-beans</artifactId>
+            <version>${spring.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-context</artifactId>
+            <version>${spring.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-context-support</artifactId>
+            <version>${spring.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-aop</artifactId>
+            <version>${spring.version}</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>commons-logging</groupId>
+                    <artifactId>commons-logging</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-tx</artifactId>
+            <version>${spring.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-expression</artifactId>
+            <version>${spring.version}</version>
+        </dependency>
+
+        <!-- spring orm -->
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-orm</artifactId>
+            <version>${spring.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-jdbc</artifactId>
+            <version>${spring.version}</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>c3p0</groupId>
+                    <artifactId>c3p0</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
+        <!-- spring websocket-->
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-websocket</artifactId>
+            <version>${spring.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-messaging</artifactId>
+            <version>${spring.version}</version>
+        </dependency>
+
+        <!-- bean validate -->
+        <dependency>
+            <groupId>org.hibernate</groupId>
+            <artifactId>hibernate-validator</artifactId>
+            <version>${validator.version}</version>
+        </dependency>
+        <!-- SPRING end -->
+
+        <!-- AOP begin -->
+        <dependency>
+            <groupId>org.aspectj</groupId>
+            <artifactId>aspectjrt</artifactId>
+            <version>1.7.4</version>
+        </dependency>
+        <dependency>
+            <groupId>org.aspectj</groupId>
+            <artifactId>aspectjweaver</artifactId>
+            <version>1.7.4</version>
+        </dependency>
+        <dependency>
+            <groupId>cglib</groupId>
+            <artifactId>cglib</artifactId>
+            <version>3.1</version>
+        </dependency>
+        <!-- AOP end -->
+
+        <!-- PERSISTENCE begin -->
+
+        <!-- MyBatis -->
+        <dependency>
+            <groupId>org.mybatis</groupId>
+            <artifactId>mybatis</artifactId>
+            <version>${mybatis.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.mybatis</groupId>
+            <artifactId>mybatis-spring</artifactId>
+            <version>${mybatis-spring.version}</version>
+        </dependency>
+
+        <!-- connection pool -->
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>druid</artifactId>
+            <version>${druid.version}</version>
+        </dependency>
+
+        <!-- jdbc driver -->
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+            <version>${mysql.driver.version}</version>
+        </dependency>
+        <!--<dependency>-->
+            <!--<groupId>com.microsoft.sqlserver</groupId>-->
+            <!--<artifactId>sqljdbc4</artifactId>-->
+            <!--<version>${sqlserver.driver.version}</version>-->
+        <!--</dependency>-->
+        <!-- https://mvnrepository.com/artifact/com.microsoft.sqlserver/sqljdbc4 -->
+        <!-- https://mvnrepository.com/artifact/com.microsoft.sqlserver/mssql-jdbc -->
+        <dependency>
+            <groupId>com.microsoft.sqlserver</groupId>
+            <artifactId>mssql-jdbc</artifactId>
+            <version>6.4.0.jre8</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.mchange</groupId>
+            <artifactId>c3p0</artifactId>
+            <version>0.9.5.2</version>
+        </dependency>
+
+        <!-- WEB begin -->
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-web</artifactId>
+            <version>${spring.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-webmvc</artifactId>
+            <version>${spring.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-oxm</artifactId>
+            <version>${spring.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>opensymphony</groupId>
+            <artifactId>sitemesh</artifactId>
+            <version>${sitemesh.version}</version>
+        </dependency>
+        <!--<dependency>-->
+        <!--<groupId>taglibs</groupId>-->
+        <!--<artifactId>standard</artifactId>-->
+        <!--<version>1.1.2</version>-->
+        <!--<type>jar</type>-->
+        <!--</dependency>-->
+
+
+        <dependency>
+            <groupId>javax</groupId>
+            <artifactId>javaee-api</artifactId>
+            <version>7.0</version>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>javax.servlet</groupId>
+            <artifactId>jstl</artifactId>
+            <version>1.2</version>
+            <type>jar</type>
+        </dependency>
+        <dependency>
+            <groupId>javax.servlet</groupId>
+            <artifactId>servlet-api</artifactId>
+            <version>2.5</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>javax.servlet.jsp</groupId>
+            <artifactId>jsp-api</artifactId>
+            <version>2.1</version>
+            <scope>provided</scope>
+        </dependency>
+        <!--  <dependency>
+             <groupId>javax.servlet</groupId>
+             <artifactId>javax.servlet-api</artifactId>
+             <version>3.0.1</version>
+             <scope>provided</scope>
+         </dependency>
+         <dependency>
+             <groupId>javax.servlet.jsp</groupId>
+             <artifactId>jsp-api</artifactId>
+             <version>2.2</version>
+             <scope>provided</scope>
+         </dependency>-->
+
+        <dependency>
+            <groupId>net.sf.ehcache</groupId>
+            <artifactId>ehcache-core</artifactId>
+            <version>${ehcache.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.jgroups</groupId>
+            <artifactId>jgroups</artifactId>
+            <version>3.6.6.Final</version>
+        </dependency>
+        <dependency>
+            <groupId>redis.clients</groupId>
+            <artifactId>jedis</artifactId>
+            <version>2.8.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-pool2</artifactId>
+            <version>2.4.2</version>
+        </dependency>
+        <dependency>
+            <groupId>de.ruedigermoeller</groupId>
+            <artifactId>fst</artifactId>
+            <version>2.42</version>
+        </dependency>
+        <dependency>
+            <groupId>com.esotericsoftware</groupId>
+            <artifactId>kryo-shaded</artifactId>
+            <version>3.0.0</version>
+        </dependency>
+        <!-- CACHE end -->
+
+        <!-- SECURITY begin -->
+        <dependency>
+            <groupId>org.apache.shiro</groupId>
+            <artifactId>shiro-core</artifactId>
+            <version>${shiro.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.shiro</groupId>
+            <artifactId>shiro-spring</artifactId>
+            <version>${shiro.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.shiro</groupId>
+            <artifactId>shiro-cas</artifactId>
+            <version>${shiro.version}</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>commons-logging</groupId>
+                    <artifactId>commons-logging</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.shiro</groupId>
+            <artifactId>shiro-web</artifactId>
+            <version>${shiro.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.shiro</groupId>
+            <artifactId>shiro-ehcache</artifactId>
+            <version>${shiro.version}</version>
+        </dependency>
+        <!-- SECURITY end -->
+
+        <!-- Activiti -->
+        <dependency>
+            <groupId>org.activiti</groupId>
+            <artifactId>activiti-engine</artifactId>
+            <version>${activiti.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.activiti</groupId>
+            <artifactId>activiti-spring</artifactId>
+            <version>${activiti.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.activiti</groupId>
+            <artifactId>activiti-explorer</artifactId>
+            <version>${activiti.version}</version>
+            <exclusions>
+                <exclusion>
+                    <artifactId>vaadin</artifactId>
+                    <groupId>com.vaadin</groupId>
+                </exclusion>
+                <exclusion>
+                    <artifactId>dcharts-widget</artifactId>
+                    <groupId>org.vaadin.addons</groupId>
+                </exclusion>
+                <exclusion>
+                    <artifactId>activiti-simple-workflow</artifactId>
+                    <groupId>org.activiti</groupId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.activiti</groupId>
+            <artifactId>activiti-modeler</artifactId>
+            <version>${activiti.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.activiti</groupId>
+            <artifactId>activiti-rest</artifactId>
+            <version>${activiti.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.activiti</groupId>
+            <artifactId>activiti-diagram-rest</artifactId>
+            <version>${activiti.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.activiti</groupId>
+            <artifactId>activiti-json-converter</artifactId>
+            <version>${activiti.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.activiti</groupId>
+            <artifactId>activiti-cxf</artifactId>
+            <version>${activiti.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>xerces</groupId>
+            <artifactId>xercesImpl</artifactId>
+            <version>2.11.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-api</artifactId>
+            <version>2.7.6</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-rt-frontend-jaxws</artifactId>
+            <version>2.7.6</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-rt-transports-http-jetty</artifactId>
+            <version>2.7.6</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-rt-transports-http</artifactId>
+            <version>2.7.6</version>
+        </dependency>
+        <dependency>
+            <groupId>com.sun.xml.bind</groupId>
+            <artifactId>jaxb-impl</artifactId>
+            <version>2.2.11</version>
+        </dependency>
+
+
+        <!-- LOGGING begin -->
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <version>${slf4j.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+            <version>${slf4j.version}</version>
+        </dependency>
+        <!-- common-logging 实际调用slf4j -->
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>jcl-over-slf4j</artifactId>
+            <version>${slf4j.version}</version>
+        </dependency>
+        <!-- java.util.logging 实际调用slf4j -->
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>jul-to-slf4j</artifactId>
+            <version>${slf4j.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>log4j</groupId>
+            <artifactId>log4j</artifactId>
+            <version>${log4j.version}</version>
+        </dependency>
+        <!-- LOGGING end -->
+
+        <!-- GENERAL UTILS begin -->
+        <dependency>
+            <groupId>commons-io</groupId>
+            <artifactId>commons-io</artifactId>
+            <version>${commons-io.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>commons-codec</groupId>
+            <artifactId>commons-codec</artifactId>
+            <version>${commons-codec.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>commons-fileupload</groupId>
+            <artifactId>commons-fileupload</artifactId>
+            <version>${commons-fileupload.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>commons-beanutils</groupId>
+            <artifactId>commons-beanutils</artifactId>
+            <version>${commons-beanutils.version}</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>commons-logging</groupId>
+                    <artifactId>commons-logging</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-text</artifactId>
+            <version>${commons-text.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-collections4</artifactId>
+            <version>${commons-collections.version}</version>
+        </dependency>
+
+
+        <!-- jackson json -->
+        <dependency>
+            <groupId>com.fasterxml.jackson.core</groupId>
+            <artifactId>jackson-core</artifactId>
+            <version>${jackson.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>com.fasterxml.jackson.core</groupId>
+            <artifactId>jackson-databind</artifactId>
+            <version>${jackson.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>com.fasterxml.jackson.core</groupId>
+            <artifactId>jackson-annotations</artifactId>
+            <version>${jackson.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>com.fasterxml.jackson.module</groupId>
+            <artifactId>jackson-module-jaxb-annotations</artifactId>
+            <version>${jackson.version}</version>
+        </dependency>
+
+        <!-- fastjson json-->
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>fastjson</artifactId>
+            <version>${fastjson.version}</version>
+        </dependency>
+
+        <!-- xstream xml -->
+        <dependency>
+            <groupId>com.thoughtworks.xstream</groupId>
+            <artifactId>xstream</artifactId>
+            <version>${xstream.version}</version>
+        </dependency>
+
+        <!-- pojo copy -->
+        <dependency>
+            <groupId>net.sf.dozer</groupId>
+            <artifactId>dozer</artifactId>
+            <version>${dozer.version}</version>
+        </dependency>
+
+        <!-- https://mvnrepository.com/artifact/com.belerweb/pinyin4j -->
+        <dependency>
+            <groupId>com.belerweb</groupId>
+            <artifactId>pinyin4j</artifactId>
+            <version>2.5.1</version>
+        </dependency>
+
+
+        <!-- template engine -->
+        <dependency>
+            <groupId>org.freemarker</groupId>
+            <artifactId>freemarker</artifactId>
+            <version>${freemarker.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>com.ibeetl</groupId>
+            <artifactId>beetl</artifactId>
+            <version>2.7.5</version>
+        </dependency>
+
+        <!-- email -->
+        <dependency>
+            <groupId>javax.mail</groupId>
+            <artifactId>mail</artifactId>
+            <version>1.4.7</version>
+        </dependency>
+        <dependency>
+            <groupId>javax.activation</groupId>
+            <artifactId>activation</artifactId>
+            <version>1.1.1</version>
+        </dependency>
+
+        <!-- poi office -->
+        <dependency>
+            <groupId>org.apache.poi</groupId>
+            <artifactId>poi</artifactId>
+            <version>${poi.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.poi</groupId>
+            <artifactId>poi-ooxml</artifactId>
+            <version>${poi.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.poi</groupId>
+            <artifactId>poi-ooxml-schemas</artifactId>
+            <version>${poi.version}</version>
+        </dependency>
+
+        <!-- image util -->
+        <dependency>
+            <groupId>com.drewnoakes</groupId>
+            <artifactId>metadata-extractor</artifactId>
+            <version>2.10.1</version>
+        </dependency>
+
+        <!-- 条形码、二维码生成  -->
+        <dependency>
+            <groupId>com.google.zxing</groupId>
+            <artifactId>core</artifactId>
+            <version>3.3.0</version>
+        </dependency>
+
+        <dependency>
+            <groupId>batik</groupId>
+            <artifactId>batik-util</artifactId>
+            <version>1.6-1</version>
+        </dependency>
+
+        <!-- quartz -->
+        <dependency>
+            <groupId>org.quartz-scheduler</groupId>
+            <artifactId>quartz</artifactId>
+            <version>${quartz.version}</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>c3p0</groupId>
+                    <artifactId>c3p0</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.quartz-scheduler</groupId>
+            <artifactId>quartz-jobs</artifactId>
+            <version>${quartz.version}</version>
+        </dependency>
+
+        <!--&lt;!&ndash; 中文分词 &ndash;&gt;-->
+        <!--<dependency>-->
+        <!--<groupId>org.wltea</groupId>-->
+        <!--<artifactId>analyzer</artifactId>-->
+        <!--<version>2012_u6</version>-->
+        <!--</dependency>-->
+        <!-- GENERAL UTILS end -->
+
+        <!-- sigar -->
+        <!-- https://mvnrepository.com/artifact/org.fusesource/sigar -->
+        <dependency>
+            <groupId>org.fusesource</groupId>
+            <artifactId>sigar</artifactId>
+            <version>1.6.4</version>
+        </dependency>
+        <!-- CKFinder begin -->
+        <dependency>
+            <groupId>net.coobird</groupId>
+            <artifactId>thumbnailator</artifactId>
+            <version>0.4.8</version>
+        </dependency>
+        <!--<dependency>-->
+        <!--<groupId>com.ckfinder</groupId>-->
+        <!--<artifactId>apache-ant-zip</artifactId>-->
+        <!--<version>${ckfinder.version}</version>-->
+        <!--</dependency>-->
+        <!--<dependency>-->
+        <!--<groupId>com.ckfinder</groupId>-->
+        <!--<artifactId>ckfinder</artifactId>-->
+        <!--<version>${ckfinder.version}</version>-->
+        <!--</dependency>-->
+        <!--<dependency>-->
+        <!--<groupId>com.ckfinder</groupId>-->
+        <!--<artifactId>ckfinderplugin-fileeditor</artifactId>-->
+        <!--<version>${ckfinder.version}</version>-->
+        <!--</dependency>-->
+        <!--<dependency>-->
+        <!--<groupId>com.ckfinder</groupId>-->
+        <!--<artifactId>ckfinderplugin-imageresize</artifactId>-->
+        <!--<version>${ckfinder.version}</version>-->
+        <!--</dependency>-->
+        <!-- CKFinder end -->
+
+        <!-- Echarts图表依赖包开始 -->
+        <!-- https://mvnrepository.com/artifact/com.github.abel533/ECharts -->
+        <dependency>
+            <groupId>com.github.abel533</groupId>
+            <artifactId>ECharts</artifactId>
+            <version>3.0.0.2</version>
+        </dependency>
+        <dependency>
+            <groupId>com.google.code.gson</groupId>
+            <artifactId>gson</artifactId>
+            <version>2.6.2</version>
+        </dependency>
+        <!-- Echarts图表依赖包结束 -->
+
+        <!-- TEST begin -->
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.12</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-test</artifactId>
+            <version>${spring.version}</version>
+        </dependency>
+        <!-- TEST end -->
+        <dependency>
+            <groupId>eu.bitwalker</groupId>
+            <artifactId>UserAgentUtils</artifactId>
+            <version>1.20</version>
+        </dependency>
+
+        <!--httpcore -->
+        <dependency>
+            <groupId>org.apache.httpcomponents</groupId>
+            <artifactId>httpcore</artifactId>
+            <version>4.4.4</version>
+        </dependency>
+
+
+        <!-- swagger-springmvc -->
+        <dependency>
+            <groupId>io.springfox</groupId>
+            <artifactId>springfox-swagger2</artifactId>
+            <version>2.7.0</version>
+        </dependency>
+        <dependency>
+            <groupId>io.springfox</groupId>
+            <artifactId>springfox-swagger-ui</artifactId>
+            <version>2.7.0</version>
+        </dependency>
+        <!-- swagger-springmvc -->
+
+        <!--httpclient -->
+        <dependency>
+            <groupId>org.apache.httpcomponents</groupId>
+            <artifactId>httpclient</artifactId>
+            <version>4.5.2</version>
+        </dependency>
+
+        <!-- UTILS begin -->
+        <dependency>
+            <groupId>com.google.guava</groupId>
+            <artifactId>guava</artifactId>
+            <version>${guava.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-lang3</artifactId>
+            <version>${commons-lang3.version}</version>
+        </dependency>
+        <!-- UTILS end -->
+
+        <dependency>
+            <groupId>com.aliyun</groupId>
+            <artifactId>aliyun-java-sdk-core</artifactId>
+            <version>3.2.2</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.aliyun</groupId>
+            <artifactId>aliyun-java-sdk-vod</artifactId>
+            <version>2.2.0</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.aliyun.oss</groupId>
+            <artifactId>aliyun-sdk-oss</artifactId>
+            <version>2.0.6</version>
+        </dependency>
+
+        <dependency>
+            <groupId>aopalliance</groupId>
+            <artifactId>aopalliance</artifactId>
+            <version>1.0</version>
+        </dependency>
+
+        <dependency>
+            <groupId>dom4j</groupId>
+            <artifactId>dom4j</artifactId>
+            <version>1.6.1</version>
+        </dependency>
+
+        <dependency>
+            <groupId>net.sf.ezmorph</groupId>
+            <artifactId>ezmorph</artifactId>
+            <version>1.0.6</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.jboss.logging</groupId>
+            <artifactId>jboss-logging</artifactId>
+            <version>3.3.0.Final</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.jboss</groupId>
+            <artifactId>jboss-vfs</artifactId>
+            <version>3.2.12.Final</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.jdom</groupId>
+            <artifactId>jdom</artifactId>
+            <version>1.1</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.codehaus.jettison</groupId>
+            <artifactId>jettison</artifactId>
+            <version>1.1</version>
+        </dependency>
+
+        <dependency>
+            <groupId>net.sf.json-lib</groupId>
+            <artifactId>json-lib</artifactId>
+            <classifier>jdk15</classifier>
+            <version>2.4</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.json</groupId>
+            <artifactId>json</artifactId>
+            <version>20160810</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.drewnoakes</groupId>
+            <artifactId>metadata-extractor</artifactId>
+            <version>2.10.1</version>
+        </dependency>
+
+        <dependency>
+            <groupId>net.coobird</groupId>
+            <artifactId>thumbnailator</artifactId>
+            <version>0.4.8</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.adobe.xmp</groupId>
+            <artifactId>xmpcore</artifactId>
+            <version>5.1.3</version>
+        </dependency>
+
+        <dependency>
+            <groupId>xpp3</groupId>
+            <artifactId>xpp3_min</artifactId>
+            <version>1.1.4c</version>
+        </dependency>
+
+        <!--<dependency>-->
+            <!--<groupId>org.apache.velocity</groupId>-->
+            <!--<artifactId>velocity-engine-core</artifactId>-->
+            <!--<version>2.0</version>-->
+        <!--</dependency>-->
+        <!-- https://mvnrepository.com/artifact/org.apache.velocity/velocity -->
+        <dependency>
+            <groupId>org.apache.velocity</groupId>
+            <artifactId>velocity</artifactId>
+            <version>1.7</version>
+        </dependency>
+
+
+        <dependency>
+            <groupId>org.apache.velocity</groupId>
+            <artifactId>velocity-tools</artifactId>
+            <version>2.0</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.fasterxml.uuid</groupId>
+            <artifactId>java-uuid-generator</artifactId>
+            <version>3.1.3</version>
+        </dependency>
+        <!--<dependency>-->
+            <!--<groupId>com.baidu</groupId>-->
+            <!--<artifactId>ueditor</artifactId>-->
+            <!--<version>1.1.2</version>-->
+            <!--<systemPath>${basedir}/src/main/webapp/WEB-INF/lib/ueditor-1.1.2.jar</systemPath>-->
+        <!--</dependency>-->
+
+        <dependency>
+            <groupId>io.jsonwebtoken</groupId>
+            <artifactId>jjwt-api</artifactId>
+            <version>0.10.1</version>
+        </dependency>
+        <dependency>
+            <groupId>io.jsonwebtoken</groupId>
+            <artifactId>jjwt-impl</artifactId>
+            <version>0.10.1</version>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>io.jsonwebtoken</groupId>
+            <artifactId>jjwt-jackson</artifactId>
+            <version>0.10.1</version>
+            <scope>runtime</scope>
+        </dependency>
+    </dependencies>
+
+</project>

+ 10 - 0
runConfigurations/Install_Dependencies.xml

@@ -0,0 +1,10 @@
+<component name="ProjectRunConfigurationManager">
+  <configuration default="false" name="Install Dependencies" type="js.build_tools.npm" factoryName="npm">
+    <package-json value="$PROJECT_DIR$/src/main/vue/package.json" />
+    <command value="install" />
+    <arguments value="-verbose" />
+    <node-interpreter value="project" />
+    <envs />
+    <method />
+  </configuration>
+</component>

+ 75 - 0
runConfigurations/Tomcat.xml

@@ -0,0 +1,75 @@
+<component name="ProjectRunConfigurationManager">
+  <configuration default="false" name="Tomcat" type="#com.intellij.j2ee.web.tomcat.TomcatRunConfigurationFactory" factoryName="Local" APPLICATION_SERVER_NAME="Tomcat 8.5.30" ALTERNATIVE_JRE_ENABLED="false">
+    <option name="OPEN_IN_BROWSER" value="false" />
+    <option name="UPDATE_ON_FRAME_DEACTIVATION" value="true" />
+    <option name="UPDATING_POLICY" value="redeploy-artifacts" />
+    <deployment>
+      <artifact name="awesome-admin:war exploded">
+        <settings>
+          <option name="CONTEXT_PATH" value="/" />
+        </settings>
+      </artifact>
+    </deployment>
+    <server-settings>
+      <option name="BASE_DIRECTORY_NAME" value="Unnamed_awesome-admin" />
+    </server-settings>
+    <predefined_log_file id="Tomcat" enabled="true" />
+    <predefined_log_file id="Tomcat Catalina" enabled="true" />
+    <predefined_log_file id="Tomcat Manager" enabled="false" />
+    <predefined_log_file id="Tomcat Host Manager" enabled="false" />
+    <predefined_log_file id="Tomcat Localhost Access" enabled="false" />
+    <RunnerSettings RunnerId="Debug">
+      <option name="DEBUG_PORT" value="51593" />
+    </RunnerSettings>
+    <ConfigurationWrapper VM_VAR="JAVA_OPTS" RunnerId="Cover">
+      <option name="USE_ENV_VARIABLES" value="true" />
+      <STARTUP>
+        <option name="USE_DEFAULT" value="true" />
+        <option name="SCRIPT" value="" />
+        <option name="VM_PARAMETERS" value="" />
+        <option name="PROGRAM_PARAMETERS" value="" />
+      </STARTUP>
+      <SHUTDOWN>
+        <option name="USE_DEFAULT" value="true" />
+        <option name="SCRIPT" value="" />
+        <option name="VM_PARAMETERS" value="" />
+        <option name="PROGRAM_PARAMETERS" value="" />
+      </SHUTDOWN>
+    </ConfigurationWrapper>
+    <ConfigurationWrapper VM_VAR="JAVA_OPTS" RunnerId="Debug">
+      <option name="USE_ENV_VARIABLES" value="true" />
+      <STARTUP>
+        <option name="USE_DEFAULT" value="true" />
+        <option name="SCRIPT" value="" />
+        <option name="VM_PARAMETERS" value="" />
+        <option name="PROGRAM_PARAMETERS" value="" />
+      </STARTUP>
+      <SHUTDOWN>
+        <option name="USE_DEFAULT" value="true" />
+        <option name="SCRIPT" value="" />
+        <option name="VM_PARAMETERS" value="" />
+        <option name="PROGRAM_PARAMETERS" value="" />
+      </SHUTDOWN>
+    </ConfigurationWrapper>
+    <ConfigurationWrapper VM_VAR="JAVA_OPTS" RunnerId="Run">
+      <option name="USE_ENV_VARIABLES" value="true" />
+      <STARTUP>
+        <option name="USE_DEFAULT" value="true" />
+        <option name="SCRIPT" value="" />
+        <option name="VM_PARAMETERS" value="" />
+        <option name="PROGRAM_PARAMETERS" value="" />
+      </STARTUP>
+      <SHUTDOWN>
+        <option name="USE_DEFAULT" value="true" />
+        <option name="SCRIPT" value="" />
+        <option name="VM_PARAMETERS" value="" />
+        <option name="PROGRAM_PARAMETERS" value="" />
+      </SHUTDOWN>
+    </ConfigurationWrapper>
+    <method>
+      <option name="BuildArtifacts" enabled="true">
+        <artifact name="awesome-admin:war exploded" />
+      </option>
+    </method>
+  </configuration>
+</component>

+ 12 - 0
runConfigurations/Vue_Build.xml

@@ -0,0 +1,12 @@
+<component name="ProjectRunConfigurationManager">
+  <configuration default="false" name="Vue Build" type="js.build_tools.npm" factoryName="npm">
+    <package-json value="$PROJECT_DIR$/src/main/vue/package.json" />
+    <command value="run" />
+    <scripts>
+      <script value="build" />
+    </scripts>
+    <node-interpreter value="project" />
+    <envs />
+    <method />
+  </configuration>
+</component>

+ 12 - 0
runConfigurations/Vue_Server.xml

@@ -0,0 +1,12 @@
+<component name="ProjectRunConfigurationManager">
+  <configuration default="false" name="Vue Server" type="js.build_tools.npm" factoryName="npm">
+    <package-json value="$PROJECT_DIR$/src/main/vue/package.json" />
+    <command value="run" />
+    <scripts>
+      <script value="dev" />
+    </scripts>
+    <node-interpreter value="project" />
+    <envs />
+    <method />
+  </configuration>
+</component>

+ 70 - 0
src/main/java/com/izouma/awesomeadmin/activiti/CustomAuthenticationProvider.java

@@ -0,0 +1,70 @@
+package com.izouma.awesomeadmin.activiti;
+
+import com.izouma.awesomeadmin.model.UserInfo;
+import org.activiti.engine.IdentityService;
+import org.activiti.engine.identity.Group;
+import org.apache.shiro.SecurityUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.authentication.AuthenticationProvider;
+import org.springframework.security.authentication.BadCredentialsException;
+import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
+import org.springframework.security.core.Authentication;
+import org.springframework.security.core.AuthenticationException;
+import org.springframework.security.core.GrantedAuthority;
+import org.springframework.security.core.authority.SimpleGrantedAuthority;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+
+public class CustomAuthenticationProvider implements AuthenticationProvider {
+    @Autowired
+    private IdentityService identityService;
+
+    public CustomAuthenticationProvider() {
+    }
+
+    public Authentication authenticate(Authentication authentication) throws AuthenticationException {
+        String name = authentication.getName();
+        String password = authentication.getCredentials().toString();
+        boolean authenticated = this.identityService.checkPassword(name, password);
+
+        UserInfo userInfo = null;
+        try {
+            userInfo = (UserInfo) SecurityUtils.getSubject().getPrincipal();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        if (userInfo == null) {
+
+        }
+
+        if (userInfo == null) {
+            throw new BadCredentialsException("Authentication failed for this username and password");
+        } else {
+            this.identityService.setAuthenticatedUserId(userInfo.getId().toString());
+        }
+
+
+        if (!authenticated) {
+            throw new BadCredentialsException("Authentication failed for this username and password");
+        } else {
+            List<Group> groups = this.identityService.createGroupQuery().groupMember(name).list();
+            Collection<GrantedAuthority> grantedAuthorities = new ArrayList();
+            Iterator var7 = groups.iterator();
+
+            while (var7.hasNext()) {
+                Group group = (Group) var7.next();
+                grantedAuthorities.add(new SimpleGrantedAuthority(group.getId()));
+            }
+
+            this.identityService.setAuthenticatedUserId(name);
+            return new UsernamePasswordAuthenticationToken(name, password, grantedAuthorities);
+        }
+    }
+
+    public boolean supports(Class<?> authentication) {
+        return authentication.equals(UsernamePasswordAuthenticationToken.class);
+    }
+}

+ 31 - 0
src/main/java/com/izouma/awesomeadmin/activiti/CustomGroupEntityManager.java

@@ -0,0 +1,31 @@
+package com.izouma.awesomeadmin.activiti;
+
+import com.izouma.awesomeadmin.model.SysRole;
+import com.izouma.awesomeadmin.model.UserInfo;
+import com.izouma.awesomeadmin.service.SysRoleService;
+import com.izouma.awesomeadmin.service.UserInfoService;
+import org.activiti.engine.identity.Group;
+import org.activiti.engine.impl.persistence.entity.GroupEntity;
+import org.activiti.engine.impl.persistence.entity.GroupEntityManager;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class CustomGroupEntityManager extends GroupEntityManager {
+    @Autowired
+    private SysRoleService  sysRoleService;
+
+    @Override
+    public List<Group> findGroupsByUser(String userId) {
+        List<Group> groupList = new ArrayList<>();
+        for (SysRole sysRole : sysRoleService.getUserRoles(Integer.valueOf(userId))) {
+            Group group = new GroupEntity();
+            group.setId(sysRole.getId().toString());
+            group.setName(sysRole.getName());
+            group.setType("assignment");
+            groupList.add(group);
+        }
+        return groupList;
+    }
+}

+ 24 - 0
src/main/java/com/izouma/awesomeadmin/activiti/CustomGroupEntityManagerFactory.java

@@ -0,0 +1,24 @@
+package com.izouma.awesomeadmin.activiti;
+
+import org.activiti.engine.impl.interceptor.Session;
+import org.activiti.engine.impl.interceptor.SessionFactory;
+import org.activiti.engine.impl.persistence.entity.GroupIdentityManager;
+
+public class CustomGroupEntityManagerFactory implements SessionFactory {
+
+    private CustomGroupEntityManager customGroupEntityManager;
+
+    @Override
+    public Class<?> getSessionType() {
+        return GroupIdentityManager.class;
+    }
+
+    @Override
+    public Session openSession() {
+        return customGroupEntityManager;
+    }
+
+    public void setCustomGroupEntityManager(CustomGroupEntityManager customGroupEntityManager) {
+        this.customGroupEntityManager = customGroupEntityManager;
+    }
+}

+ 48 - 0
src/main/java/com/izouma/awesomeadmin/activiti/CustomUserEntityManager.java

@@ -0,0 +1,48 @@
+package com.izouma.awesomeadmin.activiti;
+
+import com.izouma.awesomeadmin.model.SysRole;
+import com.izouma.awesomeadmin.model.UserInfo;
+import com.izouma.awesomeadmin.service.SysRoleService;
+import com.izouma.awesomeadmin.service.UserInfoService;
+import org.activiti.engine.identity.Group;
+import org.activiti.engine.identity.User;
+import org.activiti.engine.impl.persistence.entity.GroupEntity;
+import org.activiti.engine.impl.persistence.entity.UserEntity;
+import org.activiti.engine.impl.persistence.entity.UserEntityManager;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class CustomUserEntityManager extends UserEntityManager {
+
+    @Autowired
+    private UserInfoService userInfoService;
+    @Autowired
+    private SysRoleService sysRoleService;
+
+    @Override
+    public User findUserById(String userId) {
+        UserInfo userInfo = userInfoService.getUserInfoById(userId);
+        if (userInfo != null) {
+            User user = new UserEntity();
+            user.setId(userInfo.getId().toString());
+            user.setFirstName(userInfo.getUsername());
+            user.setLastName(userInfo.getNickname());
+        }
+        return null;
+    }
+
+    @Override
+    public List<Group> findGroupsByUser(String userId) {
+        List<Group> groupList = new ArrayList<>();
+        for (SysRole sysRole : sysRoleService.getUserRoles(Integer.valueOf(userId))) {
+            Group group = new GroupEntity();
+            group.setId(sysRole.getId().toString());
+            group.setName(sysRole.getName());
+            group.setType("assignment");
+            groupList.add(group);
+        }
+        return groupList;
+    }
+}

+ 23 - 0
src/main/java/com/izouma/awesomeadmin/activiti/CustomUserEntityManagerFactory.java

@@ -0,0 +1,23 @@
+package com.izouma.awesomeadmin.activiti;
+
+import org.activiti.engine.impl.interceptor.Session;
+import org.activiti.engine.impl.interceptor.SessionFactory;
+import org.activiti.engine.impl.persistence.entity.UserIdentityManager;
+
+public class CustomUserEntityManagerFactory implements SessionFactory {
+    private CustomUserEntityManager customUserEntityManager;
+
+    @Override
+    public Class<?> getSessionType() {
+        return UserIdentityManager.class;
+    }
+
+    @Override
+    public Session openSession() {
+        return customUserEntityManager;
+    }
+
+    public void setCustomUserEntityManager(CustomUserEntityManager customUserEntityManager) {
+        this.customUserEntityManager = customUserEntityManager;
+    }
+}

+ 45 - 0
src/main/java/com/izouma/awesomeadmin/activiti/RestFilter.java

@@ -0,0 +1,45 @@
+package com.izouma.awesomeadmin.activiti;
+
+import com.izouma.awesomeadmin.model.UserInfo;
+import org.activiti.engine.IdentityService;
+import org.apache.shiro.SecurityUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.ApplicationContext;
+import org.springframework.stereotype.Component;
+import org.springframework.web.context.support.WebApplicationContextUtils;
+import org.springframework.web.filter.GenericFilterBean;
+
+import javax.servlet.*;
+import javax.servlet.annotation.WebFilter;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+
+@WebFilter
+public class RestFilter extends GenericFilterBean {
+
+    @Override
+    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
+        try {
+            UserInfo userInfo = (UserInfo) SecurityUtils.getSubject().getPrincipal();
+            ServletContext context = servletRequest.getServletContext();
+            ApplicationContext ctx = WebApplicationContextUtils.getWebApplicationContext(context);
+            IdentityService identityService = ctx.getBean(IdentityService.class);
+            identityService.setAuthenticatedUserId(userInfo.getId().toString());
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        try {
+            HttpServletRequest request = (HttpServletRequest) servletRequest;
+            HttpServletResponse response = (HttpServletResponse) servletResponse;
+            response.addHeader("Access-Control-Allow-Origin", request.getHeader("Origin"));
+            response.addHeader("Access-Control-Allow-Methods", "*");
+            response.addHeader("Access-Control-Max-Age", "100");
+            response.addHeader("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
+            response.addHeader("Access-Control-Allow-Credentials", "true");
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        filterChain.doFilter(servletRequest, servletResponse);
+    }
+}

+ 153 - 0
src/main/java/com/izouma/awesomeadmin/constant/AppConstant.java

@@ -0,0 +1,153 @@
+package com.izouma.awesomeadmin.constant;
+
+/**
+ * 
+ * <p>
+ * app常量
+ * </p>
+ */
+public interface AppConstant {
+
+
+
+    /**
+     * 商户号
+     */
+    String MCH_ID              = "1379284802";
+
+    /**
+     * 子商户号
+     */
+    String SUB_MCH_ID          = "";
+
+    /**
+     * 商户密钥
+     */
+    String MCH_SECRET          = "R4q0yoo5GXh9A3CDiKJ6v7hgiE0aT0rM";
+
+    /**
+     * 货币类型
+     */
+    String FEE_TYPE            = "CNY";
+
+    /**
+     *交易类型 
+     */
+    String TRADE_TYPE          = "JSAPI";
+
+    /**
+     * 设备号 PC网页或公众号内支付请传"WEB"
+     */
+    String DEVICE_INFO         = "WEB";
+
+    /**
+     * 标题
+     */
+    String BODY                = "工蜂家服产品";
+
+    /**
+     * 标题
+     */
+    String BODY_RECHARGE       = "工蜂家服充值";
+
+    /**
+     * 通知地址
+     */
+    String NOTIFY_URL          = "http://www.gfjiafu.com/wxpay/notify";
+
+    /**
+     * 通知地址
+     */
+    String GXNOTIFY_URL        = "http://www.gfjiafu.com/GXwxpay/notify";
+
+    /**
+     * 通知地址
+     */
+    String NOTIFY_URL_RECHARGE = "http://www.gfjiafu.com/wxpay/notifyRecharge";
+
+    /**
+     * 商户名称
+     */
+    String SEND_NAME           = "工蜂家服";
+
+    String PAGE                = "page";
+
+    public interface InergralUpdateType {
+
+        /**
+         * 产品抵扣
+         */
+        Integer DISCOUNT = 0;
+
+        /**
+         * 任务
+         */
+        Integer TASK     = 1;
+
+        /**
+         * 充值
+         */
+        Integer RECHARGE = 2;
+    }
+
+    public interface OrderStatus {
+
+        /**
+         * 待付款
+         */
+        Integer NO_PAY  = 0;
+
+        /**
+         * 待平台确认
+         */
+        Integer PYY     = 1;
+
+        /**
+         * 预约成功
+         */
+        Integer CONFIRM = 2;
+
+        /**
+         * 人员派送中
+         */
+        Integer ASSIGN  = 3;
+
+        /**
+         * 已完成
+         */
+        Integer FINISH  = 4;
+
+        /**
+         * 退款中
+         */
+        Integer REFUND  = 5;
+
+        /**
+         * 已经取消
+         */
+        Integer CANCEL  = 6;
+
+    }
+
+    public interface template {
+
+        /**
+         * 咨询回复消息提醒 
+         */
+        String reply        = "B7pRn_aPMKJT41Q498Okw5ZPsFtjE5NW_vNO6l6K2hw";
+
+        /**
+         * 用户咨询提醒 
+         */
+        String consultation = "SOLot-tJ5XMziyrM8xrXwS4q1meGI8z7SL8_OklnigE";
+
+        /**
+         * 入驻
+         */
+        String settled      = "HJtFE3VjxVaP0vw0-k4rtn7LdN7xcPbwygLgvZbH6R8";
+    }
+
+    String weixinurl                = "http://i.izouma.cn/wx/auth";
+
+    String weixinurlRedirectUriFlag = "_redirectUri_";
+}

+ 36 - 0
src/main/java/com/izouma/awesomeadmin/constant/RongConstant.java

@@ -0,0 +1,36 @@
+package com.izouma.awesomeadmin.constant;
+
+/**
+ * 
+ * <p>
+ * 融云常量
+ * </p>
+ */
+public interface RongConstant {
+
+    /**
+     * 验证码模板
+     */
+    String VERIFY_TEMPLATEID = "fMsDXJ0Y4pCbrtN4a66JGx";
+
+    /**
+     * 通知模板
+     */
+    String NOTIFY_TEMPLATEID = "a6ZrRkr3AKqaDMizqPhFEi";
+
+    /**
+     * 提交订单
+     */
+    String TI_JIAO_DIN_DAN   = "0Q3R5Enjk_58Ycq-XEqAQt";
+
+    /**
+     * 派送订单
+     */
+    String PAI_SONG_DIN_DAN  = "e5daKayLkqi8WJnckJguke";
+
+    /**
+     * 通用
+     */
+    String COMMON_TEMPLATEID = "e8kzeKB5Ahx9Vnm7tPESn3";
+
+}

+ 17 - 0
src/main/java/com/izouma/awesomeadmin/container/DateConverter.java

@@ -0,0 +1,17 @@
+package com.izouma.awesomeadmin.container;
+
+import org.springframework.core.convert.converter.Converter;
+
+import java.util.Date;
+
+public class DateConverter implements Converter<String, Date> {
+    @Override
+    public Date convert(String source) {
+        try {
+            return new Date(Long.valueOf(source));
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+}

+ 26 - 0
src/main/java/com/izouma/awesomeadmin/container/Lifecycle.java

@@ -0,0 +1,26 @@
+package com.izouma.awesomeadmin.container;
+
+/**
+ * 启动项,可在容器启动时加载
+ * @author Administrator
+ *
+ */
+public interface Lifecycle {
+	/**
+	 * 启动初始化
+	 * @return
+	 */
+	boolean init();
+	
+	/**
+	 * 启动项信息
+	 * @return
+	 */
+	String getItemInfo();
+	
+	/**
+	 * 关闭
+	 * @return
+	 */
+	boolean close();	
+}

+ 70 - 0
src/main/java/com/izouma/awesomeadmin/container/StartupListener.java

@@ -0,0 +1,70 @@
+package com.izouma.awesomeadmin.container;
+
+import com.izouma.awesomeadmin.util.Const;
+
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+import java.util.LinkedList;
+import java.util.List;
+
+/**
+ * 启动监听方法
+ *
+ * @author OnceMad
+ */
+public class StartupListener implements ServletContextListener {
+
+    private static List<Lifecycle> startups = new LinkedList<Lifecycle>();
+
+    static {
+        //startups.add(new PhotoCheckWorker());
+    }
+
+
+    @Override
+    public void contextInitialized(ServletContextEvent sce) {
+
+        System.out.println("==================context Initialized=====================");
+
+        for (Lifecycle lifecycle : startups) {
+            System.out.print(lifecycle.getItemInfo() + " is start ");
+            if (lifecycle.init()) {
+                System.out.println(" successfully.");
+            } else {
+                System.out.println(" fail.");
+            }
+        }
+
+        initConst();
+
+
+        System.out.println("============context Initialized successfully===============");
+    }
+
+
+    @Override
+    public void contextDestroyed(ServletContextEvent sce) {
+
+        System.out.println("==================context Destroyed=====================");
+
+        for (Lifecycle lifecycle : startups) {
+            System.out.print(lifecycle.getItemInfo() + " is close ");
+            if (lifecycle.close()) {
+                System.out.println(" successfully.");
+            } else {
+                System.out.println(" fail.");
+            }
+        }
+
+    }
+
+
+    private void initConst() {
+
+        Const con = new Const();
+        con.initData();
+        System.out.println("============init const successfully===============");
+    }
+
+
+}

+ 29 - 0
src/main/java/com/izouma/awesomeadmin/dao/AccessTokenMapper.java

@@ -0,0 +1,29 @@
+package com.izouma.awesomeadmin.dao;
+
+import java.util.Map;
+
+import org.springframework.stereotype.Repository;
+
+import com.izouma.awesomeadmin.model.AccessToken;
+
+@Repository("com.izouma.awesomeadmin.dao.AccessTokenMapper")
+public interface AccessTokenMapper {
+
+    /**
+     * 
+     * <p>获取最新的accessToken。</p>
+     *
+     * @return
+     */
+    AccessToken getAccessToken();
+
+
+    /**
+     * 
+     * <p>插入新的accessToken。</p>
+     *
+     * @param parameter
+     * @return
+     */
+    int updateAccessToken(Map <String, Object> parameter);
+}

+ 21 - 0
src/main/java/com/izouma/awesomeadmin/dao/AccessTokenMapper.xml

@@ -0,0 +1,21 @@
+<?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.izouma.awesomeadmin.dao.AccessTokenMapper">
+	<!-- 目的:为 Dao接口方法提供sql语句配置 -->
+	<select id="getAccessToken" resultType="com.izouma.awesomeadmin.model.AccessToken" >
+		SELECT
+			*
+		FROM
+			sys_access_token
+		ORDER BY
+			time_stamp DESC
+		LIMIT 1
+	</select>
+	
+	<insert id="updateAccessToken" parameterType="map">
+	    INSERT INTO sys_access_token (access_token, time_stamp)
+		VALUES (#{accessToken}, #{timeStamp})
+  	</insert>
+
+</mapper>

+ 26 - 0
src/main/java/com/izouma/awesomeadmin/dao/CommonQueryMapper.java

@@ -0,0 +1,26 @@
+package com.izouma.awesomeadmin.dao;
+
+import com.izouma.awesomeadmin.datasource.DataSource;
+import com.izouma.awesomeadmin.model.CommonQuery;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+import java.util.Map;
+
+@DataSource("dataSource")
+@Repository("com.izouma.awesomeadmin.dao.CommonQueryMapper")
+public interface CommonQueryMapper {
+
+
+    List<Map> getTableListByPage(Map<String, Object> parameter);
+
+    List<Map> getTableListAll(CommonQuery record);
+
+    Map selectByPrimaryKey(CommonQuery record);
+
+    int insertSelective(Map<String, Object> parameter);
+
+    int updateByPrimaryKeySelective(Map<String, Object> parameter);
+
+    int delete(CommonQuery record);
+}

+ 264 - 0
src/main/java/com/izouma/awesomeadmin/dao/CommonQueryMapper.xml

@@ -0,0 +1,264 @@
+<?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.izouma.awesomeadmin.dao.CommonQueryMapper">
+
+
+    <select id="getTableListByPage" resultType="java.util.Map">
+
+        SELECT * FROM ${record.tableName}
+        <where>
+            and (del_flag = 'N' or del_flag = '0')
+
+            <if test="record.advancedQuery != null and !&quot;&quot;.equals(record.advancedQuery)">
+                <foreach item="item" index="index" collection="record.advancedQuery.split('_;')">
+                    <choose>
+                        <when test="item.indexOf('like') != -1">
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    concat('%',#{itemDetail},'%')
+                                </if>
+
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
+
+                            </foreach>
+                        </when>
+                        <when test="item.indexOf('in') != -1">
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    (${itemDetail})
+                                </if>
+
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
+
+                            </foreach>
+                        </when>
+                        <otherwise>
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    #{itemDetail}
+                                </if>
+
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
+
+                            </foreach>
+                        </otherwise>
+                    </choose>
+
+
+                </foreach>
+
+
+            </if>
+
+
+            <if test="record.searchKey != null and !&quot;&quot;.equals(record.searchKey)">
+                <trim prefix="and (" suffix=")" prefixOverrides="OR">
+                    <foreach item="item" index="index" collection="record.searchColumn.split('_,')">
+                        OR ${item} LIKE concat('%',#{record.searchKey},'%')
+                    </foreach>
+                </trim>
+            </if>
+
+
+        </where>
+
+        <if test="record.orderByStr != null and !&quot;&quot;.equals(record.orderByStr)">
+
+            order by
+            <trim suffixOverrides=",">
+                <foreach item="item" index="index" separator="," collection="record.orderByStr.split('_;')">
+                    <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                        ${itemDetail}
+                    </foreach>
+                </foreach>
+            </trim>
+
+        </if>
+
+    </select>
+
+    <select id="getTableListAll" resultType="java.util.Map">
+
+        SELECT * FROM ${tableName}
+        <where>
+            and (del_flag = 'N' or del_flag = '0')
+            <if test="advancedQuery != null and !&quot;&quot;.equals(advancedQuery)">
+                <foreach item="item" index="index" collection="advancedQuery.split('_;')">
+                    <choose>
+                        <when test="item.indexOf('like') != -1">
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    concat('%',#{itemDetail},'%')
+                                </if>
+
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
+
+                            </foreach>
+                        </when>
+                        <when test="item.indexOf('in') != -1">
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    (${itemDetail})
+                                </if>
+
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
+
+                            </foreach>
+                        </when>
+                        <otherwise>
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    #{itemDetail}
+                                </if>
+
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
+
+                            </foreach>
+                        </otherwise>
+                    </choose>
+
+
+                </foreach>
+
+
+            </if>
+
+            <if test="searchKey != null and !&quot;&quot;.equals(searchKey)">
+                <trim prefix="and (" suffix=")" prefixOverrides="OR">
+                    <foreach item="item" index="index" collection="searchColumn.split('_,')">
+                        OR ${item} LIKE concat('%',#{searchKey},'%')
+                    </foreach>
+                </trim>
+            </if>
+
+        </where>
+
+        <if test="orderByStr != null and !&quot;&quot;.equals(orderByStr)">
+
+            order by
+            <trim suffixOverrides=",">
+                <foreach item="item" index="index" separator="," collection="orderByStr.split('_;')">
+                    <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                        ${itemDetail}
+                    </foreach>
+                </foreach>
+            </trim>
+
+        </if>
+
+    </select>
+
+    <select id="selectByPrimaryKey" resultType="java.util.Map" parameterType="java.util.Map">
+        select
+        *
+        from ${tableName}
+        where
+        (del_flag = 'N' or del_flag = '0')
+        <if test="primaryKey != null and !&quot;&quot;.equals(primaryKey)">
+            and id = #{primaryKey,jdbcType=INTEGER}
+        </if>
+
+        <if test="advancedQuery != null and !&quot;&quot;.equals(advancedQuery)">
+            <foreach item="item" index="index" collection="advancedQuery.split('_;')">
+                <choose>
+                    <when test="item.indexOf('like') != -1">
+                        <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                            <if test="detailIndex == 3">
+                                concat('%',#{itemDetail},'%')
+                            </if>
+
+                            <if test="detailIndex &lt; 3">
+                                ${itemDetail}
+                            </if>
+
+                        </foreach>
+                    </when>
+                    <when test="item.indexOf('in') != -1">
+                        <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                            <if test="detailIndex == 3">
+                                (${itemDetail})
+                            </if>
+
+                            <if test="detailIndex &lt; 3">
+                                ${itemDetail}
+                            </if>
+
+                        </foreach>
+                    </when>
+                    <otherwise>
+                        <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                            <if test="detailIndex == 3">
+                                #{itemDetail}
+                            </if>
+
+                            <if test="detailIndex &lt; 3">
+                                ${itemDetail}
+                            </if>
+
+                        </foreach>
+                    </otherwise>
+                </choose>
+
+
+            </foreach>
+
+
+        </if>
+        LIMIT 1
+    </select>
+
+    <insert id="insertSelective" parameterType="java.util.Map" useGeneratedKeys="true"
+            keyProperty="id">
+        insert into ${tableName}
+
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+
+            <foreach item="item" index="index" collection="formData.keys">
+                <if test="formData[item]!= null">
+                    ${item},
+                </if>
+            </foreach>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+
+            <foreach item="item" index="index" collection="formData.keys">
+                <if test="formData[item]!= null">
+                    #{formData[${item}]},
+                </if>
+            </foreach>
+        </trim>
+    </insert>
+    <update id="updateByPrimaryKeySelective" parameterType="java.util.Map">
+        update ${tableName}
+        <set>
+
+            <foreach item="item" index="index" collection="formData.keys">
+                <if test="formData[item]!= null">
+                    ${item} = #{formData[${item}]},
+                </if>
+            </foreach>
+
+        </set>
+        where id = #{primaryKey,jdbcType=INTEGER}
+    </update>
+
+    <update id="delete">
+        UPDATE ${tableName} SET del_flag = 'Y'
+        <where>
+            AND id = #{primaryKey}
+        </where>
+    </update>
+</mapper>

+ 27 - 0
src/main/java/com/izouma/awesomeadmin/dao/CommonQuerySqlServerMapper.java

@@ -0,0 +1,27 @@
+package com.izouma.awesomeadmin.dao;
+
+import com.izouma.awesomeadmin.datasource.DataSource;
+import com.izouma.awesomeadmin.model.CommonQuery;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+import java.util.Map;
+
+@DataSource("dataSource")
+@Repository("com.izouma.awesomeadmin.dao.CommonQuerySqlServerMapper")
+public interface CommonQuerySqlServerMapper {
+
+    List<Map> getTableListByPage(Map<String, Object> parameter);
+
+    List<Map> getTableListAll(CommonQuery record);
+
+    Map selectByPrimaryKey(CommonQuery record);
+
+
+    int insertSelective(Map<String, Object> parameter);
+
+    int updateByPrimaryKeySelective(Map<String, Object> parameter);
+
+
+    int delete(CommonQuery record);
+}

+ 258 - 0
src/main/java/com/izouma/awesomeadmin/dao/CommonQuerySqlServerMapper.xml

@@ -0,0 +1,258 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.izouma.awesomeadmin.dao.CommonQuerySqlServerMapper">
+
+
+    <select id="getTableListByPage" resultType="java.util.Map">
+
+        SELECT * FROM ${record.tableName}
+        <where>
+            <if test="record.advancedQuery != null and !&quot;&quot;.equals(record.advancedQuery)">
+                <foreach item="item" index="index" collection="record.advancedQuery.split('_;')">
+                    <choose>
+                        <when test="item.indexOf('like') != -1">
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    concat('%',#{itemDetail},'%')
+                                </if>
+
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
+
+                            </foreach>
+                        </when>
+                        <when test="item.indexOf('in') != -1">
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    (${itemDetail})
+                                </if>
+
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
+
+                            </foreach>
+                        </when>
+                        <otherwise>
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    #{itemDetail}
+                                </if>
+
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
+
+                            </foreach>
+                        </otherwise>
+                    </choose>
+
+
+                </foreach>
+
+
+            </if>
+
+
+            <if test="record.searchKey != null and !&quot;&quot;.equals(record.searchKey)">
+                <trim prefix="and (" suffix=")" prefixOverrides="OR">
+                    <foreach item="item" index="index" collection="record.searchColumn.split('_,')">
+                        OR ${item} LIKE concat('%',#{record.searchKey},'%')
+                    </foreach>
+                </trim>
+            </if>
+
+        </where>
+
+        <if test="record.orderByStr != null and !&quot;&quot;.equals(record.orderByStr)">
+
+            order by
+            <trim suffixOverrides=",">
+                <foreach item="item" index="index" separator="," collection="record.orderByStr.split('_;')">
+                    <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                        ${itemDetail}
+                    </foreach>
+                </foreach>
+            </trim>
+
+        </if>
+
+    </select>
+
+    <select id="getTableListAll" resultType="java.util.Map">
+
+        SELECT * FROM ${tableName}
+        <where>
+            <if test="advancedQuery != null and !&quot;&quot;.equals(advancedQuery)">
+                <foreach item="item" index="index" collection="advancedQuery.split('_;')">
+                    <choose>
+                        <when test="item.indexOf('like') != -1">
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    concat('%',#{itemDetail},'%')
+                                </if>
+
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
+
+                            </foreach>
+                        </when>
+                        <when test="item.indexOf('in') != -1">
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    (${itemDetail})
+                                </if>
+
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
+
+                            </foreach>
+                        </when>
+                        <otherwise>
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    #{itemDetail}
+                                </if>
+
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
+
+                            </foreach>
+                        </otherwise>
+                    </choose>
+
+
+                </foreach>
+
+
+            </if>
+
+            <if test="searchKey != null and !&quot;&quot;.equals(searchKey)">
+                <trim prefix="and (" suffix=")" prefixOverrides="OR">
+                    <foreach item="item" index="index" collection="searchColumn.split('_,')">
+                        OR ${item} LIKE concat('%',#{searchKey},'%')
+                    </foreach>
+                </trim>
+            </if>
+
+        </where>
+
+        <if test="orderByStr != null and !&quot;&quot;.equals(orderByStr)">
+
+            order by
+            <trim suffixOverrides=",">
+                <foreach item="item" index="index" separator="," collection="orderByStr.split('_;')">
+                    <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                        ${itemDetail}
+                    </foreach>
+                </foreach>
+            </trim>
+
+        </if>
+
+    </select>
+
+    <select id="selectByPrimaryKey" resultType="java.util.Map" parameterType="java.util.Map">
+        select top 1
+        *
+        from ${tableName}
+        <where>
+            <if test="primaryKey != null and !&quot;&quot;.equals(primaryKey)">
+                id = #{primaryKey,jdbcType=INTEGER}
+            </if>
+
+            <if test="advancedQuery != null and !&quot;&quot;.equals(advancedQuery)">
+                <foreach item="item" index="index" collection="advancedQuery.split('_;')">
+                    <choose>
+                        <when test="item.indexOf('like') != -1">
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    concat('%',#{itemDetail},'%')
+                                </if>
+
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
+
+                            </foreach>
+                        </when>
+                        <when test="item.indexOf('in') != -1">
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    (${itemDetail})
+                                </if>
+
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
+
+                            </foreach>
+                        </when>
+                        <otherwise>
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    #{itemDetail}
+                                </if>
+
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
+
+                            </foreach>
+                        </otherwise>
+                    </choose>
+
+
+                </foreach>
+
+
+            </if>
+        </where>
+
+    </select>
+
+    <insert id="insertSelective" parameterType="java.util.Map" useGeneratedKeys="true"
+            keyProperty="id">
+        insert into ${tableName}
+
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+
+            <foreach item="item" index="index" collection="formData.keys">
+                <if test="formData[item]!= null">
+                    ${item},
+                </if>
+            </foreach>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+
+            <foreach item="item" index="index" collection="formData.keys">
+                <if test="formData[item]!= null">
+                    #{formData[${item}]},
+                </if>
+            </foreach>
+        </trim>
+    </insert>
+    <update id="updateByPrimaryKeySelective" parameterType="java.util.Map">
+        update ${tableName}
+        <set>
+
+            <foreach item="item" index="index" collection="formData.keys">
+                <if test="formData[item]!= null">
+                    ${item} = #{formData[${item}]},
+                </if>
+            </foreach>
+
+        </set>
+        where id = #{primaryKey,jdbcType=INTEGER}
+    </update>
+
+    <delete id="delete">
+        delete from ${tableName}
+        where id = #{primaryKey,jdbcType=INTEGER}
+    </delete>
+</mapper>

+ 31 - 0
src/main/java/com/izouma/awesomeadmin/dao/DataMapper.java

@@ -0,0 +1,31 @@
+package com.izouma.awesomeadmin.dao;
+
+import com.izouma.awesomeadmin.datasource.DataSource;
+import com.izouma.awesomeadmin.model.SqlServerTest;
+import com.izouma.awesomeadmin.model.SuperUser;
+import com.izouma.awesomeadmin.model.Zouma;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+import java.util.Map;
+
+@DataSource("dataSource")
+@Repository("com.izouma.awesomeadmin.dao.DataMapper")
+public interface DataMapper {
+
+    /**
+     * <p>获取用户列表。</p>
+     *
+     * @return TblUser list
+     */
+    // 不指定,则默认使用数据源1
+    List<SuperUser> queryAllUsers();
+
+    // 覆盖类上指定的,使用数据源2
+    @DataSource("dataSourceSlaver")
+    List<Zouma> queryZouma();
+
+    // 覆盖类上指定的,使用数据源2
+    @DataSource("dataSourceSqlserver")
+    List<SqlServerTest> getSqlServerTestByPage(Map<String, Object> parameter);
+}

+ 35 - 0
src/main/java/com/izouma/awesomeadmin/dao/DataMapper.xml

@@ -0,0 +1,35 @@
+<?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.izouma.awesomeadmin.dao.DataMapper">
+    <sql id="columns">
+        user_id, power, password, user_name, profile, del_flag
+  	</sql>
+
+    <select id="queryAllUsers" resultType="com.izouma.awesomeadmin.model.SuperUser">
+        SELECT
+        <include refid="columns"/>
+        FROM super_user
+        where del_flag = 'N'
+        order by user_id
+        <!-- 为了测试只取100个 -->
+        <!-- LIMIT 100  -->
+    </select>
+
+
+    <select id="queryZouma" resultType="com.izouma.awesomeadmin.model.Zouma">
+        SELECT
+        *
+        FROM zouma
+        where del_flag = 0
+        order by id
+        <!-- 为了测试只取100个 -->
+        <!-- LIMIT 100  -->
+    </select>
+
+    <select id="getSqlServerTestByPage" resultType="com.izouma.awesomeadmin.model.SqlServerTest">
+        SELECT * FROM T_SYS_Depts where  id > 2  ORDER BY id
+
+    </select>
+
+</mapper>

+ 36 - 0
src/main/java/com/izouma/awesomeadmin/dao/DataSourceInfoMapper.java

@@ -0,0 +1,36 @@
+package com.izouma.awesomeadmin.dao;
+
+import com.izouma.awesomeadmin.model.DataSourceInfo;
+import org.springframework.stereotype.Component;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * Dao接口
+ */
+@Component
+@Repository("com.zoumaframe.dao.DataSourceInfoMapper")
+public interface DataSourceInfoMapper {
+
+    int deleteByPrimaryKey(Integer id);
+
+    int insertSelective(DataSourceInfo record);
+
+    DataSourceInfo selectByPrimaryKey(Integer id);
+
+    int updateByPrimaryKeySelective(DataSourceInfo record);
+
+    List<DataSourceInfo> queryAllDataSourceInfo(DataSourceInfo record);
+
+    List<DataSourceInfo> queryDataSourceInfoByPage(Map<String, Object> parameter);
+
+    int delete(String id);
+
+    DataSourceInfo queryDataSourceInfo(DataSourceInfo record);
+
+    List<DataSourceInfo> query(DataSourceInfo record);
+}
+

+ 327 - 0
src/main/java/com/izouma/awesomeadmin/dao/DataSourceInfoMapper.xml

@@ -0,0 +1,327 @@
+<?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.izouma.awesomeadmin.dao.DataSourceInfoMapper" >
+    <resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.DataSourceInfo" >
+                <id column="id" property="id" jdbcType="INTEGER" />
+                                        <result column="del_flag" property="delFlag" jdbcType="CHAR" />
+                                <result column="code" property="code" jdbcType="VARCHAR" />
+                                <result column="database_type" property="databaseType" jdbcType="VARCHAR" />
+                                <result column="url" property="url" jdbcType="VARCHAR" />
+                                <result column="username" property="username" jdbcType="VARCHAR" />
+                                <result column="password" property="password" jdbcType="VARCHAR" />
+                                <result column="database_name" property="databaseName" jdbcType="VARCHAR" />
+            </resultMap>
+    <sql id="Base_Column_List" >
+        <trim  suffixOverrides="," >
+            id,
+
+            del_flag,
+
+            code,
+
+            database_type,
+
+            url,
+
+            username,
+
+            password,
+
+            database_name,
+
+            </trim>
+    </sql>
+    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
+        select
+        <include refid="Base_Column_List" />
+        from sys_data_source_info
+        where id = #{id,jdbcType=INTEGER}
+    </select>
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
+        delete from sys_data_source_info
+        where id = #{id,jdbcType=INTEGER}
+    </delete>
+    <insert id="insertSelective" parameterType="com.izouma.awesomeadmin.model.DataSourceInfo" useGeneratedKeys="true" keyProperty="id">
+        insert into sys_data_source_info
+        <trim prefix="(" suffix=")" suffixOverrides="," >
+                <if test="id!= null" >
+                id,
+            </if>
+                <if test="delFlag!= null" >
+                del_flag,
+            </if>
+                <if test="code!= null" >
+                code,
+            </if>
+                <if test="databaseType!= null" >
+                database_type,
+            </if>
+                <if test="url!= null" >
+                url,
+            </if>
+                <if test="username!= null" >
+                username,
+            </if>
+                <if test="password!= null" >
+                password,
+            </if>
+                <if test="databaseName!= null" >
+                database_name,
+            </if>
+            </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides="," >
+                    <if test="id != null" >
+                #{id,jdbcType=INTEGER},
+            </if>
+                    <if test="delFlag != null" >
+                #{delFlag,jdbcType=CHAR},
+            </if>
+                    <if test="code != null" >
+                #{code,jdbcType=VARCHAR},
+            </if>
+                    <if test="databaseType != null" >
+                #{databaseType,jdbcType=VARCHAR},
+            </if>
+                    <if test="url != null" >
+                #{url,jdbcType=VARCHAR},
+            </if>
+                    <if test="username != null" >
+                #{username,jdbcType=VARCHAR},
+            </if>
+                    <if test="password != null" >
+                #{password,jdbcType=VARCHAR},
+            </if>
+                    <if test="databaseName != null" >
+                #{databaseName,jdbcType=VARCHAR},
+            </if>
+                </trim>
+    </insert>
+    <update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.DataSourceInfo" >
+        update sys_data_source_info
+        <set >
+                    <if test="id != null" >
+               id= #{id,jdbcType=INTEGER},
+            </if>
+                     <if test="delFlag != null" >
+               del_flag= #{delFlag,jdbcType=CHAR},
+            </if>
+                     <if test="code != null" >
+               code= #{code,jdbcType=VARCHAR},
+            </if>
+                     <if test="databaseType != null" >
+               database_type= #{databaseType,jdbcType=VARCHAR},
+            </if>
+                     <if test="url != null" >
+               url= #{url,jdbcType=VARCHAR},
+            </if>
+                     <if test="username != null" >
+               username= #{username,jdbcType=VARCHAR},
+            </if>
+                     <if test="password != null" >
+               password= #{password,jdbcType=VARCHAR},
+            </if>
+                     <if test="databaseName != null" >
+               database_name= #{databaseName,jdbcType=VARCHAR},
+            </if>
+                 </set>
+        where id = #{id,jdbcType=INTEGER}
+    </update>
+    <select id="queryDataSourceInfoByPage" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.DataSourceInfo">
+        select <include refid="Base_Column_List"/> from sys_data_source_info
+        <where>
+            and del_flag = 'N'
+                    <if test="record.id != null and !&quot;&quot;.equals(record.id)">
+                and  id = #{record.id}
+            </if>
+                     <if test="record.delFlag != null and !&quot;&quot;.equals(record.delFlag)">
+                and  del_flag = #{record.delFlag}
+            </if>
+                     <if test="record.code != null and !&quot;&quot;.equals(record.code)">
+                and  code = #{record.code}
+            </if>
+                     <if test="record.databaseType != null and !&quot;&quot;.equals(record.databaseType)">
+                and  database_type = #{record.databaseType}
+            </if>
+                     <if test="record.url != null and !&quot;&quot;.equals(record.url)">
+                and  url = #{record.url}
+            </if>
+                     <if test="record.username != null and !&quot;&quot;.equals(record.username)">
+                and  username = #{record.username}
+            </if>
+                     <if test="record.password != null and !&quot;&quot;.equals(record.password)">
+                and  password = #{record.password}
+            </if>
+                     <if test="record.databaseName != null and !&quot;&quot;.equals(record.databaseName)">
+                and  database_name = #{record.databaseName}
+            </if>
+                  <if test="record.searchKey != null and !&quot;&quot;.equals(record.searchKey)">
+             <trim prefix="and (" suffix=")" prefixOverrides="OR" >
+                                                                                                                                                                OR  code LIKE concat('%',#{record.searchKey},'%')
+                                                                                                    OR  database_type LIKE concat('%',#{record.searchKey},'%')
+                                                                                                    OR  url LIKE concat('%',#{record.searchKey},'%')
+                                                                                                    OR  username LIKE concat('%',#{record.searchKey},'%')
+                                                                                                    OR  password LIKE concat('%',#{record.searchKey},'%')
+                                                                                                    OR  database_name LIKE concat('%',#{record.searchKey},'%')
+                                                             </trim>
+         </if>
+
+            <if test="record.advancedQuery != null and !&quot;&quot;.equals(record.advancedQuery)">
+                <foreach item="item" index="index" collection="record.advancedQuery.split('_;')">
+                    <choose>
+                        <when test="item.indexOf('like') != -1">
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    concat('%',#{itemDetail},'%')
+                                </if>
+
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
+
+                            </foreach>
+                        </when>
+                        <otherwise>
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    #{itemDetail}
+                                </if>
+
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
+
+                            </foreach>
+                        </otherwise>
+                    </choose>
+
+
+                </foreach>
+
+
+            </if>
+
+        </where>
+        order by id desc
+    </select>
+    <select id="queryAllDataSourceInfo" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.DataSourceInfo">
+        select <include refid="Base_Column_List"/> from sys_data_source_info
+        <where>
+            and del_flag = 'N'
+                    <if test="id != null and !&quot;&quot;.equals(id)">
+                and  id = #{id}
+            </if>
+                    <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
+                and  del_flag = #{delFlag}
+            </if>
+                    <if test="code != null and !&quot;&quot;.equals(code)">
+                and  code = #{code}
+            </if>
+                    <if test="databaseType != null and !&quot;&quot;.equals(databaseType)">
+                and  database_type = #{databaseType}
+            </if>
+                    <if test="url != null and !&quot;&quot;.equals(url)">
+                and  url = #{url}
+            </if>
+                    <if test="username != null and !&quot;&quot;.equals(username)">
+                and  username = #{username}
+            </if>
+                    <if test="password != null and !&quot;&quot;.equals(password)">
+                and  password = #{password}
+            </if>
+                    <if test="databaseName != null and !&quot;&quot;.equals(databaseName)">
+                and  database_name = #{databaseName}
+            </if>
+                    <if test="searchKey != null and !&quot;&quot;.equals(searchKey)">
+                <trim prefix="and (" suffix=")" prefixOverrides="OR" >
+                                                                                                                                                                                                                                                OR  code LIKE concat('%',#{searchKey},'%')
+                                                                                                                                                        OR  database_type LIKE concat('%',#{searchKey},'%')
+                                                                                                                                                        OR  url LIKE concat('%',#{searchKey},'%')
+                                                                                                                                                        OR  username LIKE concat('%',#{searchKey},'%')
+                                                                                                                                                        OR  password LIKE concat('%',#{searchKey},'%')
+                                                                                                                                                        OR  database_name LIKE concat('%',#{searchKey},'%')
+                                                                                        </trim>
+            </if>
+<if test="advancedQuery != null and !&quot;&quot;.equals(advancedQuery)">
+    <foreach item="item" index="index" collection="advancedQuery.split('_;')">
+        <choose>
+            <when test="item.indexOf('like') != -1">
+                <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                    <if test="detailIndex == 3">
+                        concat('%',#{itemDetail},'%')
+                    </if>
+
+                    <if test="detailIndex &lt; 3">
+                        ${itemDetail}
+                    </if>
+
+                </foreach>
+            </when>
+            <otherwise>
+                <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                    <if test="detailIndex == 3">
+                        #{itemDetail}
+                    </if>
+
+                    <if test="detailIndex &lt; 3">
+                        ${itemDetail}
+                    </if>
+
+                </foreach>
+            </otherwise>
+        </choose>
+
+
+    </foreach>
+
+
+</if>
+        </where>
+        order by id desc
+    </select>
+    <select id="queryDataSourceInfo" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.DataSourceInfo">
+        select <include refid="Base_Column_List"/> from sys_data_source_info
+        <where>
+            and del_flag = 'N'
+                    <if test="id != null and !&quot;&quot;.equals(id)">
+                and id = #{id}
+            </if>
+                     <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
+                and del_flag = #{delFlag}
+            </if>
+                     <if test="code != null and !&quot;&quot;.equals(code)">
+                and code = #{code}
+            </if>
+                     <if test="databaseType != null and !&quot;&quot;.equals(databaseType)">
+                and database_type = #{databaseType}
+            </if>
+                     <if test="url != null and !&quot;&quot;.equals(url)">
+                and url = #{url}
+            </if>
+                     <if test="username != null and !&quot;&quot;.equals(username)">
+                and username = #{username}
+            </if>
+                     <if test="password != null and !&quot;&quot;.equals(password)">
+                and password = #{password}
+            </if>
+                     <if test="databaseName != null and !&quot;&quot;.equals(databaseName)">
+                and database_name = #{databaseName}
+            </if>
+         
+        </where>
+        LIMIT 1
+    </select>
+    <update id="delete">
+        UPDATE sys_data_source_info SET del_flag = 'Y'
+        <where>
+            AND id = #{id}
+        </where>
+    </update>
+    <select id="query" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.DataSourceInfo">
+        select <include refid="Base_Column_List"/> from sys_data_source_info
+        <where>
+            and del_flag = 'N'
+                                                                                                                                                                                                                                                    </where>
+        order by id desc
+    </select>
+</mapper>
+

+ 53 - 0
src/main/java/com/izouma/awesomeadmin/dao/DepartInfoMapper.java

@@ -0,0 +1,53 @@
+package com.izouma.awesomeadmin.dao;
+
+import java.util.List;
+import java.util.Map;
+
+import com.izouma.awesomeadmin.model.UserInfo;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+
+import com.izouma.awesomeadmin.model.DepartInfo;
+
+/**
+ * depart_info Dao接口
+ * Thu Apr 26 10:56:37 CST 2018  Suo Chen Cheng
+ */
+@Repository("com.izouma.awesomeadmin.dao.DepartInfoMapper")
+public interface DepartInfoMapper {
+
+    int deleteByPrimaryKey(Integer id);
+
+    int insertSelective(DepartInfo record);
+
+    DepartInfo selectByPrimaryKey(Integer id);
+
+    int updateByPrimaryKeySelective(DepartInfo record);
+
+    List<DepartInfo> queryAllDepartInfo(DepartInfo record);
+
+    List<DepartInfo> queryDepartInfosByPage(Map<String, Object> parameter);
+
+    int delete(String id);
+
+    DepartInfo queryDepartInfo(DepartInfo record);
+
+    List<DepartInfo> findPower(DepartInfo record);
+
+    List<DepartInfo> getParentList(Integer id);
+
+    List<DepartInfo> selectByPrimaryKeys(String ids);
+
+    List<DepartInfo> getUserDeparts(@Param("userId") Integer userId);
+
+    int setUserDeparts(@Param("userId") Integer userId, @Param("departs") List<String> departs);
+
+    int clearUserDeparts(@Param("userId") Integer userId);
+
+    String getUserDepartId(Integer id);
+
+    List<UserInfo> getDepartUsers(Integer departId);
+
+    List<DepartInfo> getChildDepartsByUserId(Integer userId);
+}
+

+ 440 - 0
src/main/java/com/izouma/awesomeadmin/dao/DepartInfoMapper.xml

@@ -0,0 +1,440 @@
+<?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.izouma.awesomeadmin.dao.DepartInfoMapper">
+    <resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.DepartInfo">
+        <id column="id" property="id" jdbcType="INTEGER"/>
+        <result column="depart_name" property="departName" jdbcType="VARCHAR"/>
+        <result column="parent_id" property="parentId" jdbcType="INTEGER"/>
+        <result column="all_parent_id" property="allParentId" jdbcType="VARCHAR"/>
+        <result column="description" property="description" jdbcType="VARCHAR"/>
+        <result column="depart_code" property="departCode" jdbcType="VARCHAR"/>
+        <result column="org_code" property="orgCode" jdbcType="VARCHAR"/>
+        <result column="type" property="type" jdbcType="INTEGER"/>
+        <result column="remark" property="remark" jdbcType="VARCHAR"/>
+        <result column="sort" property="sort" jdbcType="INTEGER"/>
+        <result column="del_flag" property="delFlag" jdbcType="CHAR"/>
+        <result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
+        <result column="permission" property="permission" jdbcType="VARCHAR"/>
+        <result column="mis_org_code" property="misOrgCode" jdbcType="VARCHAR"/>
+        <result column="mis_org_name" property="misOrgName" jdbcType="VARCHAR"/>
+        <result column="mis_include" property="misInclude" jdbcType="CHAR"/>
+        <result column="mis_child" property="misChild" jdbcType="VARCHAR"/>
+    </resultMap>
+    <sql id="Base_Column_List">
+		 id, depart_name, parent_id, all_parent_id, description, depart_code,
+		 org_code, type, remark, sort, del_flag, create_time, permission,
+		 mis_org_code, mis_org_name, mis_include, mis_child
+	</sql>
+    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer">
+        select
+        <include refid="Base_Column_List"/>
+        from sys_depart
+        where id = #{id,jdbcType=INTEGER}
+    </select>
+    <select id="selectByPrimaryKeys" resultMap="BaseResultMap" parameterType="java.lang.String">
+        select
+        <include refid="Base_Column_List"/>
+        from sys_depart
+        where FIND_IN_SET(id, #{ids,jdbcType=INTEGER}) and del_flag = 'N'
+    </select>
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
+		delete from sys_depart
+		where id = #{id,jdbcType=INTEGER}
+	</delete>
+    <insert id="insertSelective" parameterType="com.izouma.awesomeadmin.model.DepartInfo" useGeneratedKeys="true"
+            keyProperty="id">
+        insert into sys_depart
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">
+                id,
+            </if>
+            <if test="departName != null">
+                depart_name,
+            </if>
+            <if test="parentId != null">
+                parent_id,
+            </if>
+            <if test="allParentId != null">
+                all_parent_id,
+            </if>
+            <if test="description != null">
+                description,
+            </if>
+            <if test="departCode != null">
+                depart_code,
+            </if>
+            <if test="orgCode != null">
+                org_code,
+            </if>
+            <if test="type != null">
+                type,
+            </if>
+            <if test="remark != null">
+                remark,
+            </if>
+            <if test="sort != null">
+                sort,
+            </if>
+            <if test="delFlag != null">
+                del_flag,
+            </if>
+            <if test="createTime != null">
+                create_time,
+            </if>
+            <if test="permission != null">
+                permission,
+            </if>
+            <if test="misOrgCode != null">
+                mis_org_code,
+            </if>
+            <if test="misOrgName != null">
+                mis_org_name,
+            </if>
+            <if test="misInclude != null">
+                mis_include,
+            </if>
+            <if test="misChild != null">
+                mis_child,
+            </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">
+                #{id,jdbcType=INTEGER},
+            </if>
+            <if test="departName != null">
+                #{departName,jdbcType=VARCHAR},
+            </if>
+            <if test="parentId != null">
+                #{parentId,jdbcType=INTEGER},
+            </if>
+            <if test="allParentId != null">
+                #{allParentId,jdbcType=VARCHAR},
+            </if>
+            <if test="description != null">
+                #{description,jdbcType=VARCHAR},
+            </if>
+            <if test="departCode != null">
+                #{departCode,jdbcType=VARCHAR},
+            </if>
+            <if test="orgCode != null">
+                #{orgCode,jdbcType=VARCHAR},
+            </if>
+            <if test="type != null">
+                #{type,jdbcType=INTEGER},
+            </if>
+            <if test="remark != null">
+                #{remark,jdbcType=VARCHAR},
+            </if>
+            <if test="sort != null">
+                #{sort,jdbcType=INTEGER},
+            </if>
+            <if test="delFlag != null">
+                #{delFlag,jdbcType=CHAR},
+            </if>
+            <if test="createTime != null">
+                #{createTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="permission != null">
+                #{permission,jdbcType=VARCHAR},
+            </if>
+            <if test="misOrgCode != null">
+                #{misOrgCode,jdbcType=VARCHAR},
+            </if>
+            <if test="misOrgName != null">
+                #{misOrgName,jdbcType=VARCHAR},
+            </if>
+            <if test="misInclude != null">
+                #{misInclude,jdbcType=CHAR},
+            </if>
+            <if test="misChild != null">
+                #{misChild,jdbcType=VARCHAR},
+            </if>
+        </trim>
+    </insert>
+    <update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.DepartInfo">
+        UPDATE sys_depart
+        <set>
+            <if test="departName != null">
+                depart_name = #{departName,jdbcType=VARCHAR},
+            </if>
+            <if test="parentId != null">
+                parent_id = #{parentId,jdbcType=INTEGER},
+            </if>
+            <if test="allParentId != null">
+                all_parent_id = #{allParentId,jdbcType=VARCHAR},
+            </if>
+            <if test="description != null">
+                description = #{description,jdbcType=VARCHAR},
+            </if>
+            <if test="departCode != null">
+                depart_code = #{departCode,jdbcType=VARCHAR},
+            </if>
+            <if test="orgCode != null">
+                org_code = #{orgCode,jdbcType=VARCHAR},
+            </if>
+            <if test="type != null">
+                type = #{type,jdbcType=INTEGER},
+            </if>
+            <if test="remark != null">
+                remark = #{remark,jdbcType=VARCHAR},
+            </if>
+            <if test="sort != null">
+                sort = #{sort,jdbcType=INTEGER},
+            </if>
+            <if test="delFlag != null">
+                del_flag = #{delFlag,jdbcType=CHAR},
+            </if>
+            <if test="createTime != null">
+                create_time = #{createTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="permission != null">
+                permission = #{permission,jdbcType=VARCHAR},
+            </if>
+            <if test="misOrgCode != null">
+                mis_org_code = #{misOrgCode,jdbcType=VARCHAR},
+            </if>
+            <if test="misOrgName != null">
+                mis_org_name = #{misOrgName,jdbcType=VARCHAR},
+            </if>
+            <if test="misInclude != null">
+                mis_include = #{misInclude,jdbcType=CHAR},
+            </if>
+            <if test="misChild != null">
+                mis_child = #{misChild,jdbcType=VARCHAR},
+            </if>
+        </set>
+        where id = #{id,jdbcType=INTEGER}
+    </update>
+    <select id="queryDepartInfosByPage" parameterType="java.util.Map"
+            resultType="com.izouma.awesomeadmin.model.DepartInfo">
+        select
+        <include refid="Base_Column_List"/>
+        from sys_depart
+        <where>
+            and del_flag = 'N'
+            <if test="record.id != null and !&quot;&quot;.equals(record.id)">
+                and id = #{record.id}
+            </if>
+            <if test="record.departName != null and !&quot;&quot;.equals(record.departName)">
+                and depart_name = #{record.departName}
+            </if>
+            <if test="record.parentId != null and !&quot;&quot;.equals(record.parentId)">
+                and parent_id = #{record.parentId}
+            </if>
+            <if test="record.allParentId != null and !&quot;&quot;.equals(record.allParentId)">
+                and all_parent_id = #{record.allParentId}
+            </if>
+            <if test="record.description != null and !&quot;&quot;.equals(record.description)">
+                and description = #{record.description}
+            </if>
+            <if test="record.departCode != null and !&quot;&quot;.equals(record.departCode)">
+                and depart_code = #{record.departCode}
+            </if>
+            <if test="record.orgCode != null and !&quot;&quot;.equals(record.orgCode)">
+                and org_code = #{record.orgCode}
+            </if>
+            <if test="record.type != null and !&quot;&quot;.equals(record.type)">
+                and type = #{record.type}
+            </if>
+            <if test="record.remark != null and !&quot;&quot;.equals(record.remark)">
+                and remark = #{record.remark}
+            </if>
+            <if test="record.sort != null and !&quot;&quot;.equals(record.sort)">
+                and sort = #{record.sort}
+            </if>
+            <if test="record.delFlag != null and !&quot;&quot;.equals(record.delFlag)">
+                and del_flag = #{record.delFlag}
+            </if>
+            <if test="record.createTime != null and !&quot;&quot;.equals(record.createTime)">
+                and create_time = #{record.createTime}
+            </if>
+            <if test="record.permission != null and !&quot;&quot;.equals(record.permission)">
+                and permission = #{record.permission}
+            </if>
+        </where>
+        order by id desc
+    </select>
+    <select id="queryAllDepartInfo" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.DepartInfo">
+        select
+        <include refid="Base_Column_List"/>
+        from sys_depart
+        <where>
+            and del_flag = 'N'
+            <if test="id != null and !&quot;&quot;.equals(id)">
+                and id = #{id}
+            </if>
+            <if test="idStr != null and !&quot;&quot;.equals(idStr)">
+                and id in (${idStr})
+            </if>
+            <if test="departName != null and !&quot;&quot;.equals(departName)">
+                and depart_name = #{departName}
+            </if>
+            <if test="parentId != null and !&quot;&quot;.equals(parentId)">
+                and parent_id = #{parentId}
+            </if>
+            <if test="allParentId != null and !&quot;&quot;.equals(allParentId)">
+                and all_parent_id = #{allParentId}
+            </if>
+            <if test="description != null and !&quot;&quot;.equals(description)">
+                and description = #{description}
+            </if>
+            <if test="departCode != null and !&quot;&quot;.equals(departCode)">
+                and depart_code = #{departCode}
+            </if>
+            <if test="orgCode != null and !&quot;&quot;.equals(orgCode)">
+                and org_code = #{orgCode}
+            </if>
+            <if test="type != null and !&quot;&quot;.equals(type)">
+                and type = #{type}
+            </if>
+            <if test="remark != null and !&quot;&quot;.equals(remark)">
+                and remark = #{remark}
+            </if>
+            <if test="sort != null and !&quot;&quot;.equals(sort)">
+                and sort = #{sort}
+            </if>
+            <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
+                and del_flag = #{delFlag}
+            </if>
+            <if test="createTime != null and !&quot;&quot;.equals(createTime)">
+                and create_time = #{createTime}
+            </if>
+            <if test="permission != null and !&quot;&quot;.equals(permission)">
+                and permission = #{permission}
+            </if>
+        </where>
+        order by id desc
+    </select>
+    <select id="queryDepartInfo" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.DepartInfo">
+        select
+        <include refid="Base_Column_List"/>
+        from sys_depart
+        <where>
+            and del_flag = 'N'
+            <if test="id != null and !&quot;&quot;.equals(id)">
+                and id = #{id}
+            </if>
+            <if test="departName != null and !&quot;&quot;.equals(departName)">
+                and depart_name = #{departName}
+            </if>
+            <if test="parentId != null and !&quot;&quot;.equals(parentId)">
+                and parent_id = #{parentId}
+            </if>
+            <if test="allParentId != null and !&quot;&quot;.equals(allParentId)">
+                and all_parent_id = #{allParentId}
+            </if>
+            <if test="description != null and !&quot;&quot;.equals(description)">
+                and description = #{description}
+            </if>
+            <if test="departCode != null and !&quot;&quot;.equals(departCode)">
+                and depart_code = #{departCode}
+            </if>
+            <if test="orgCode != null and !&quot;&quot;.equals(orgCode)">
+                and org_code = #{orgCode}
+            </if>
+            <if test="type != null and !&quot;&quot;.equals(type)">
+                and type = #{type}
+            </if>
+            <if test="remark != null and !&quot;&quot;.equals(remark)">
+                and remark = #{remark}
+            </if>
+            <if test="sort != null and !&quot;&quot;.equals(sort)">
+                and sort = #{sort}
+            </if>
+            <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
+                and del_flag = #{delFlag}
+            </if>
+            <if test="createTime != null and !&quot;&quot;.equals(createTime)">
+                and create_time = #{createTime}
+            </if>
+            <if test="permission != null and !&quot;&quot;.equals(permission)">
+                and permission = #{permission}
+            </if>
+        </where>
+        LIMIT 1
+    </select>
+    <select id="findPower" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.DepartInfo">
+		select * from sys_depart where all_parent_id  LIKE '${allParentId}%'  and id=  #{parentId}
+	</select>
+    <update id="delete">
+        UPDATE sys_depart SET del_flag = 'Y'
+        <where>
+            AND id = #{id}
+        </where>
+    </update>
+
+    <select id="getParentList" resultType="departInfo" parameterType="integer">
+	    SELECT * from sys_depart WHERE FIND_IN_SET(id,(SELECT all_parent_id from sys_depart WHERE id  = #{id})) AND del_flag = 'N'
+	</select>
+
+    <select id="getUserDeparts" resultType="com.izouma.awesomeadmin.model.DepartInfo">
+        select
+        <include refid="Base_Column_List"/>
+        from sys_depart
+        where id in (select depart_id from sys_user_depart where user_id = #{userId})
+        and del_flag = 'N'
+    </select>
+    <insert id="setUserDeparts">
+        insert into sys_user_depart (user_id, depart_id)
+        values
+        <foreach collection="departs" item="departId" separator=",">
+            (#{userId}, #{departId})
+        </foreach>
+    </insert>
+    <delete id="clearUserDeparts">
+		delete from sys_user_depart where user_id = #{userId}
+	</delete>
+    <select id="getUserDepartId" resultType="java.lang.String">
+		SELECT group_concat(depart_id) FROM sys_user_depart WHERE user_id = #{id}
+	</select>
+    <select id="getDepartUsers" resultType="com.izouma.awesomeadmin.model.UserInfo">
+		select * from sys_user where id in (select user_id from sys_user_depart where depart_id = #{departId}) and del_flag = 'N'
+	</select>
+    <select id="getChildDepartsByUserId" resultType="com.izouma.awesomeadmin.model.DepartInfo">
+		SELECT
+	      *
+        FROM
+            sys_depart
+        WHERE
+            sys_depart.del_flag = 'N'
+        AND (
+            FIND_IN_SET(
+                sys_depart.id,
+                (
+                    SELECT
+                        sys_user.mis_child
+                    FROM
+                        sys_user
+                    WHERE
+                        sys_user.del_flag = 'N'
+                    AND sys_user.id =  #{userId}
+                )
+            )
+            OR FIND_IN_SET(
+                sys_depart.id,
+                (
+                    SELECT
+                        child_depart.mis_child
+                    FROM
+                        sys_depart child_depart
+                    WHERE
+                        child_depart.id = (
+                            SELECT
+                                sys_user_depart.depart_id
+                            FROM
+                                sys_user_depart,
+                                sys_user
+                            WHERE
+                                sys_user_depart.user_id = #{userId}
+                            AND sys_user.inherit_flag = 'Y'
+                            AND sys_user.id = #{userId}
+                            ORDER BY
+                                sys_user_depart.id DESC
+                            LIMIT 1
+                        )
+                )
+            )
+        )
+	</select>
+</mapper>
+

+ 33 - 0
src/main/java/com/izouma/awesomeadmin/dao/GenCodeMapper.java

@@ -0,0 +1,33 @@
+package com.izouma.awesomeadmin.dao;
+
+import java.util.List;
+import java.util.Map;
+
+import org.springframework.stereotype.Repository;
+
+import com.izouma.awesomeadmin.model.GenCode;
+
+/**
+ * gen_code_model Dao接口
+ * Fri May 04 15:57:06 CST 2018  Suo Chen Cheng
+ */ 
+@Repository("com.izouma.awesomeadmin.dao.GenCodeModelMapper")
+public interface GenCodeMapper {
+
+	int deleteByPrimaryKey(Integer id);
+
+	int insertSelective(GenCode record);
+
+	GenCode selectByPrimaryKey(Integer id);
+
+	int updateByPrimaryKeySelective(GenCode record);
+
+	List <GenCode> queryAllGenCode(GenCode record);
+
+	List <GenCode> queryGenCodeByPage(Map <String, Object> parameter);
+
+	int delete(String id);
+
+	GenCode queryGenCode(GenCode record);
+}
+

+ 265 - 0
src/main/java/com/izouma/awesomeadmin/dao/GenCodeMapper.xml

@@ -0,0 +1,265 @@
+<?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.izouma.awesomeadmin.dao.GenCodeMapper">
+    <resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.GenCode">
+        <id column="id" property="id" jdbcType="INTEGER"/>
+        <result column="tableName" property="tableName" jdbcType="VARCHAR"/>
+        <result column="className" property="className" jdbcType="VARCHAR"/>
+        <result column="remark" property="remark" jdbcType="VARCHAR"/>
+        <result column="genTable" property="genTable" jdbcType="BIT"/>
+        <result column="genClass" property="genClass" jdbcType="BIT"/>
+        <result column="genList" property="genList" jdbcType="BIT"/>
+        <result column="genForm" property="genForm" jdbcType="BIT"/>
+        <result column="field_id" property="fieldId" jdbcType="VARCHAR"/>
+        <result column="gen_json" property="genJson" jdbcType="VARCHAR"/>
+        <result column="del_flag" property="delFlag" jdbcType="VARCHAR"/>
+        <result column="type_flag" property="typeFlag" jdbcType="VARCHAR"/>
+    </resultMap>
+    <sql id="Base_Column_List">
+		 id, tableName, className, remark, genTable, genClass,
+		 genList, genForm, field_id, gen_json, del_flag, type_flag
+	</sql>
+    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer">
+        select
+        <include refid="Base_Column_List"/>
+        from sys_gen_code
+        where id = #{id,jdbcType=INTEGER}
+    </select>
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
+		delete from sys_gen_code
+		where id = #{id,jdbcType=INTEGER}
+	</delete>
+    <insert id="insertSelective" parameterType="com.izouma.awesomeadmin.model.GenCode" useGeneratedKeys="true"
+            keyProperty="id">
+        insert into sys_gen_code
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">
+                id,
+            </if>
+            <if test="tableName != null">
+                tableName,
+            </if>
+            <if test="className != null">
+                className,
+            </if>
+            <if test="remark != null">
+                remark,
+            </if>
+            <if test="genTable != null">
+                genTable,
+            </if>
+            <if test="genClass != null">
+                genClass,
+            </if>
+            <if test="genList != null">
+                genList,
+            </if>
+            <if test="genForm != null">
+                genForm,
+            </if>
+            <if test="fieldId != null">
+                field_id,
+            </if>
+            <if test="genJson != null">
+                gen_json,
+            </if>
+            <if test="typeFlag != null">
+                type_flag,
+            </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">
+                #{id,jdbcType=INTEGER},
+            </if>
+            <if test="tableName != null">
+                #{tableName,jdbcType=VARCHAR},
+            </if>
+            <if test="className != null">
+                #{className,jdbcType=VARCHAR},
+            </if>
+            <if test="remark != null">
+                #{remark,jdbcType=VARCHAR},
+            </if>
+            <if test="genTable != null">
+                #{genTable,jdbcType=BIT},
+            </if>
+            <if test="genClass != null">
+                #{genClass,jdbcType=BIT},
+            </if>
+            <if test="genList != null">
+                #{genList,jdbcType=BIT},
+            </if>
+            <if test="genForm != null">
+                #{genForm,jdbcType=BIT},
+            </if>
+            <if test="fieldId != null">
+                #{fieldId,jdbcType=VARCHAR},
+            </if>
+            <if test="genJson != null">
+                #{genJson,jdbcType=VARCHAR},
+            </if>
+            <if test="typeFlag != null">
+                #{typeFlag,jdbcType=VARCHAR},
+            </if>
+        </trim>
+    </insert>
+    <update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.GenCode">
+        update sys_gen_code
+        <set>
+            <if test="tableName != null">
+                tableName = #{tableName,jdbcType=VARCHAR},
+            </if>
+            <if test="className != null">
+                className = #{className,jdbcType=VARCHAR},
+            </if>
+            <if test="remark != null">
+                remark = #{remark,jdbcType=VARCHAR},
+            </if>
+            <if test="genTable != null">
+                genTable = #{genTable,jdbcType=BIT},
+            </if>
+            <if test="genClass != null">
+                genClass = #{genClass,jdbcType=BIT},
+            </if>
+            <if test="genList != null">
+                genList = #{genList,jdbcType=BIT},
+            </if>
+            <if test="genForm != null">
+                genForm = #{genForm,jdbcType=BIT},
+            </if>
+            <if test="fieldId != null">
+                field_id = #{fieldId,jdbcType=VARCHAR},
+            </if>
+            <if test="genJson != null">
+                gen_json = #{genJson,jdbcType=VARCHAR},
+            </if>
+            <if test="typeFlag != null">
+                type_flag = #{typeFlag,jdbcType=VARCHAR},
+            </if>
+        </set>
+        where id = #{id,jdbcType=INTEGER}
+    </update>
+    <select id="queryGenCodeByPage" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.GenCode">
+        select
+        <include refid="Base_Column_List"/>
+        from sys_gen_code
+        <where>
+            and del_flag = 'N'
+            <if test="record.id != null and !&quot;&quot;.equals(record.id)">
+                and id = #{record.id}
+            </if>
+            <if test="record.tableName != null and !&quot;&quot;.equals(record.tableName)">
+                and tableName = #{record.tableName}
+            </if>
+            <if test="record.className != null and !&quot;&quot;.equals(record.className)">
+                and className = #{record.className}
+            </if>
+            <if test="record.remark != null and !&quot;&quot;.equals(record.remark)">
+                and remark = #{record.remark}
+            </if>
+            <if test="record.genTable != null and !&quot;&quot;.equals(record.genTable)">
+                and genTable = #{record.genTable}
+            </if>
+            <if test="record.genClass != null and !&quot;&quot;.equals(record.genClass)">
+                and genClass = #{record.genClass}
+            </if>
+            <if test="record.genList != null and !&quot;&quot;.equals(record.genList)">
+                and genList = #{record.genList}
+            </if>
+            <if test="record.genForm != null and !&quot;&quot;.equals(record.genForm)">
+                and genForm = #{record.genForm}
+            </if>
+            <if test="record.fieldId != null and !&quot;&quot;.equals(record.fieldId)">
+                and field_id = #{record.fieldId}
+            </if>
+            <if test="record.searchKey != null and !&quot;&quot;.equals(record.searchKey)">
+                <trim prefix="and (" suffix=")" prefixOverrides="OR">
+                    OR tableName LIKE concat('%',#{record.searchKey},'%')
+                    OR className LIKE concat('%',#{record.searchKey},'%')
+                    OR remark LIKE concat('%',#{record.searchKey},'%')
+                    OR type_flag LIKE concat('%',#{record.searchKey},'%')
+                </trim>
+            </if>
+        </where>
+        order by id desc
+    </select>
+    <select id="queryAllGenCode" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.GenCode">
+        select
+        <include refid="Base_Column_List"/>
+        from sys_gen_code
+        <where>
+            and del_flag = 'N'
+            <if test="id != null and !&quot;&quot;.equals(id)">
+                and id = #{id}
+            </if>
+            <if test="tableName != null and !&quot;&quot;.equals(tableName)">
+                and tableName = #{tableName}
+            </if>
+            <if test="className != null and !&quot;&quot;.equals(className)">
+                and className = #{className}
+            </if>
+            <if test="remark != null and !&quot;&quot;.equals(remark)">
+                and remark = #{remark}
+            </if>
+            <if test="genTable != null and !&quot;&quot;.equals(genTable)">
+                and genTable = #{genTable}
+            </if>
+            <if test="genClass != null and !&quot;&quot;.equals(genClass)">
+                and genClass = #{genClass}
+            </if>
+            <if test="genList != null and !&quot;&quot;.equals(genList)">
+                and genList = #{genList}
+            </if>
+            <if test="genForm != null and !&quot;&quot;.equals(genForm)">
+                and genForm = #{genForm}
+            </if>
+            <if test="fieldId != null and !&quot;&quot;.equals(fieldId)">
+                and field_id = #{fieldId}
+            </if>
+        </where>
+        order by id desc
+    </select>
+    <select id="queryGenCode" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.GenCode">
+        select
+        <include refid="Base_Column_List"/>
+        from sys_gen_code
+        <where>
+            and del_flag = 'N'
+            <if test="id != null and !&quot;&quot;.equals(id)">
+                and id = #{id}
+            </if>
+            <if test="tableName != null and !&quot;&quot;.equals(tableName)">
+                and tableName = #{tableName}
+            </if>
+            <if test="className != null and !&quot;&quot;.equals(className)">
+                and className = #{className}
+            </if>
+            <if test="remark != null and !&quot;&quot;.equals(remark)">
+                and remark = #{remark}
+            </if>
+            <if test="genTable != null and !&quot;&quot;.equals(genTable)">
+                and genTable = #{genTable}
+            </if>
+            <if test="genClass != null and !&quot;&quot;.equals(genClass)">
+                and genClass = #{genClass}
+            </if>
+            <if test="genList != null and !&quot;&quot;.equals(genList)">
+                and genList = #{genList}
+            </if>
+            <if test="genForm != null and !&quot;&quot;.equals(genForm)">
+                and genForm = #{genForm}
+            </if>
+            <if test="fieldId != null and !&quot;&quot;.equals(fieldId)">
+                and field_id = #{fieldId}
+            </if>
+        </where>
+        LIMIT 1
+    </select>
+    <update id="delete">
+        UPDATE sys_gen_code SET del_flag = 'Y'
+        <where>
+            AND id = #{id}
+        </where>
+    </update>
+</mapper>
+

+ 33 - 0
src/main/java/com/izouma/awesomeadmin/dao/GenTestTableMapper.java

@@ -0,0 +1,33 @@
+package com.izouma.awesomeadmin.dao;
+
+import java.util.List;
+import java.util.Map;
+
+import org.springframework.stereotype.Repository;
+
+import com.izouma.awesomeadmin.model.GenTestTable;
+
+/**
+ * gen_test_table Dao接口
+ * Fri Apr 20 09:24:30 CST 2018  Suo Chen Cheng
+ */ 
+@Repository("com.izouma.awesomeadmin.dao.GenTestTableMapper")
+public interface GenTestTableMapper {
+
+	int deleteByPrimaryKey(Integer id);
+
+	int insertSelective(GenTestTable record);
+
+	GenTestTable selectByPrimaryKey(Integer id);
+
+	int updateByPrimaryKeySelective(GenTestTable record);
+
+	List <GenTestTable> queryAllGenTestTable(GenTestTable record);
+
+	List <GenTestTable> queryGenTestTablesByPage(Map <String, Object> parameter);
+
+	int delete(String id);
+
+	GenTestTable queryGenTestTable(GenTestTable record);
+}
+

+ 209 - 0
src/main/java/com/izouma/awesomeadmin/dao/GenTestTableMapper.xml

@@ -0,0 +1,209 @@
+<?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.izouma.awesomeadmin.dao.GenTestTableMapper" >
+	<resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.GenTestTable" >
+		<id column="id" property="id" jdbcType="INTEGER" />
+		<result column="my_column" property="myColumn" jdbcType="VARCHAR" />
+		<result column="aaa_test" property="aaaTest" jdbcType="VARCHAR" />
+		<result column="bbb_flag" property="bbbFlag" jdbcType="CHAR" />
+		<result column="no_comment" property="noComment" jdbcType="VARCHAR" />
+		<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
+		<result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
+		<result column="del_flag" property="delFlag" jdbcType="CHAR" />
+	</resultMap>
+	<sql id="Base_Column_List" >
+		 id, my_column, aaa_test, bbb_flag, no_comment, create_time, update_time, del_flag
+	</sql>
+	<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
+		select
+		<include refid="Base_Column_List" />
+		from gen_test_table
+		where id = #{id,jdbcType=INTEGER}
+	</select>
+	<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
+		delete from gen_test_table
+		where id = #{id,jdbcType=INTEGER}
+	</delete>
+	<insert id="insertSelective" parameterType="com.izouma.awesomeadmin.model.GenTestTable" useGeneratedKeys="true" keyProperty="id">
+		insert into gen_test_table
+		<trim prefix="(" suffix=")" suffixOverrides="," >
+			<if test="id != null" >
+				id,	
+			</if>
+			<if test="myColumn != null" >
+				my_column,	
+			</if>
+			<if test="aaaTest != null" >
+				aaa_test,	
+			</if>
+			<if test="bbbFlag != null" >
+				bbb_flag,	
+			</if>
+			<if test="noComment != null" >
+				no_comment,	
+			</if>
+			<if test="createTime != null" >
+				create_time,	
+			</if>
+			<if test="updateTime != null" >
+				update_time,	
+			</if>
+			<if test="delFlag != null" >
+				del_flag,	
+			</if>
+		</trim>
+		<trim prefix="values (" suffix=")" suffixOverrides="," >
+			<if test="id != null" >
+				#{id,jdbcType=INTEGER},	
+			</if>
+			<if test="myColumn != null" >
+				#{myColumn,jdbcType=VARCHAR},	
+			</if>
+			<if test="aaaTest != null" >
+				#{aaaTest,jdbcType=VARCHAR},	
+			</if>
+			<if test="bbbFlag != null" >
+				#{bbbFlag,jdbcType=CHAR},	
+			</if>
+			<if test="noComment != null" >
+				#{noComment,jdbcType=VARCHAR},	
+			</if>
+			<if test="createTime != null" >
+				#{createTime,jdbcType=TIMESTAMP},	
+			</if>
+			<if test="updateTime != null" >
+				#{updateTime,jdbcType=TIMESTAMP},	
+			</if>
+			<if test="delFlag != null" >
+				#{delFlag,jdbcType=CHAR},	
+			</if>
+		</trim>
+	</insert>
+	<update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.GenTestTable" >
+		update gen_test_table
+		<set >
+			<if test="myColumn != null" >
+				my_column = #{myColumn,jdbcType=VARCHAR},	
+			</if>
+			<if test="aaaTest != null" >
+				aaa_test = #{aaaTest,jdbcType=VARCHAR},	
+			</if>
+			<if test="bbbFlag != null" >
+				bbb_flag = #{bbbFlag,jdbcType=CHAR},	
+			</if>
+			<if test="noComment != null" >
+				no_comment = #{noComment,jdbcType=VARCHAR},	
+			</if>
+			<if test="createTime != null" >
+				create_time = #{createTime,jdbcType=TIMESTAMP},	
+			</if>
+			<if test="updateTime != null" >
+				update_time = #{updateTime,jdbcType=TIMESTAMP},	
+			</if>
+			<if test="delFlag != null" >
+				del_flag = #{delFlag,jdbcType=CHAR},	
+			</if>
+		</set>
+		where id = #{id,jdbcType=INTEGER}
+	</update>
+	<select id="queryGenTestTablesByPage" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.GenTestTable">
+		select <include refid="Base_Column_List"/> from gen_test_table
+		<where>
+			and del_flag = 'N'
+			<if test="record.id != null and !&quot;&quot;.equals(record.id)">
+				and id = #{record.id}	
+			</if>
+			<if test="record.myColumn != null and !&quot;&quot;.equals(record.myColumn)">
+				and my_column = #{record.myColumn}	
+			</if>
+			<if test="record.aaaTest != null and !&quot;&quot;.equals(record.aaaTest)">
+				and aaa_test = #{record.aaaTest}	
+			</if>
+			<if test="record.bbbFlag != null and !&quot;&quot;.equals(record.bbbFlag)">
+				and bbb_flag = #{record.bbbFlag}	
+			</if>
+			<if test="record.noComment != null and !&quot;&quot;.equals(record.noComment)">
+				and no_comment = #{record.noComment}	
+			</if>
+			<if test="record.createTime != null and !&quot;&quot;.equals(record.createTime)">
+				and create_time = #{record.createTime}	
+			</if>
+			<if test="record.updateTime != null and !&quot;&quot;.equals(record.updateTime)">
+				and update_time = #{record.updateTime}	
+			</if>
+			<if test="record.delFlag != null and !&quot;&quot;.equals(record.delFlag)">
+				and del_flag = #{record.delFlag}	
+			</if>
+		</where>
+		order by id desc
+	</select>
+	<select id="queryAllGenTestTable" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.GenTestTable">
+		select <include refid="Base_Column_List"/> from gen_test_table
+		<where>
+			and del_flag = 'N'
+			<if test="id != null and !&quot;&quot;.equals(id)">
+				and id = #{id}	
+			</if>
+			<if test="myColumn != null and !&quot;&quot;.equals(myColumn)">
+				and my_column = #{myColumn}	
+			</if>
+			<if test="aaaTest != null and !&quot;&quot;.equals(aaaTest)">
+				and aaa_test = #{aaaTest}	
+			</if>
+			<if test="bbbFlag != null and !&quot;&quot;.equals(bbbFlag)">
+				and bbb_flag = #{bbbFlag}	
+			</if>
+			<if test="noComment != null and !&quot;&quot;.equals(noComment)">
+				and no_comment = #{noComment}	
+			</if>
+			<if test="createTime != null and !&quot;&quot;.equals(createTime)">
+				and create_time = #{createTime}	
+			</if>
+			<if test="updateTime != null and !&quot;&quot;.equals(updateTime)">
+				and update_time = #{updateTime}	
+			</if>
+			<if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
+				and del_flag = #{delFlag}	
+			</if>
+		</where>
+		order by id desc
+	</select>
+	<select id="queryGenTestTable" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.GenTestTable">
+		select <include refid="Base_Column_List"/> from gen_test_table
+		<where>
+			and del_flag = 'N'
+			<if test="id != null and !&quot;&quot;.equals(id)">
+				and id = #{id}	
+			</if>
+			<if test="myColumn != null and !&quot;&quot;.equals(myColumn)">
+				and my_column = #{myColumn}	
+			</if>
+			<if test="aaaTest != null and !&quot;&quot;.equals(aaaTest)">
+				and aaa_test = #{aaaTest}	
+			</if>
+			<if test="bbbFlag != null and !&quot;&quot;.equals(bbbFlag)">
+				and bbb_flag = #{bbbFlag}	
+			</if>
+			<if test="noComment != null and !&quot;&quot;.equals(noComment)">
+				and no_comment = #{noComment}	
+			</if>
+			<if test="createTime != null and !&quot;&quot;.equals(createTime)">
+				and create_time = #{createTime}	
+			</if>
+			<if test="updateTime != null and !&quot;&quot;.equals(updateTime)">
+				and update_time = #{updateTime}	
+			</if>
+			<if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
+				and del_flag = #{delFlag}	
+			</if>
+		</where>
+		LIMIT 1
+	</select>
+	<update id="delete">
+		UPDATE gen_test_table SET del_flag = 'Y'
+		<where>
+			AND id = #{id}
+		</where>
+	</update>
+</mapper>
+

+ 34 - 0
src/main/java/com/izouma/awesomeadmin/dao/PowerInfoMapper.java

@@ -0,0 +1,34 @@
+package com.izouma.awesomeadmin.dao;
+
+import com.izouma.awesomeadmin.model.PowerInfo;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * power_info Dao接口
+ * Wed Apr 11 11:04:02 CST 2018  Suo Chen Cheng
+ */ 
+@Repository("com.zoumaframe.dao.PowerInfoMapper")
+public interface PowerInfoMapper {
+
+	int deleteByPrimaryKey(Integer id);
+
+	int insertSelective(PowerInfo record);
+
+	PowerInfo selectByPrimaryKey(Integer id);
+
+	int updateByPrimaryKeySelective(PowerInfo record);
+
+	List<PowerInfo> queryAllPowerInfo(PowerInfo record);
+
+	List<PowerInfo> queryPowerInfosByPage(Map<String, Object> parameter);
+
+	int delete(String id);
+
+	PowerInfo queryPowerInfo(PowerInfo record);
+
+	int deleteByRoleId(String roleId);
+}
+

+ 224 - 0
src/main/java/com/izouma/awesomeadmin/dao/PowerInfoMapper.xml

@@ -0,0 +1,224 @@
+<?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.izouma.awesomeadmin.dao.PowerInfoMapper">
+    <resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.PowerInfo">
+        <id column="id" property="id" jdbcType="INTEGER"/>
+        <result column="role_id" property="roleId" jdbcType="INTEGER"/>
+        <result column="menu_id" property="menuId" jdbcType="INTEGER"/>
+        <result column="can_add" property="canAdd" jdbcType="INTEGER"/>
+        <result column="can_delete" property="canDelete" jdbcType="INTEGER"/>
+        <result column="can_update" property="canUpdate" jdbcType="INTEGER"/>
+        <result column="can_select" property="canSelect" jdbcType="INTEGER"/>
+        <result column="del_flag" property="delFlag" jdbcType="CHAR"/>
+    </resultMap>
+    <sql id="Base_Column_List">
+		 id, role_id, menu_id, can_add, can_delete, can_update, can_select, del_flag
+	</sql>
+    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer">
+        select
+        <include refid="Base_Column_List"/>
+        from sys_power_info
+        where id = #{id,jdbcType=INTEGER}
+    </select>
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
+		delete from sys_power_info
+		where id = #{id,jdbcType=INTEGER}
+	</delete>
+    <insert id="insertSelective" parameterType="com.izouma.awesomeadmin.model.PowerInfo" useGeneratedKeys="true"
+            keyProperty="id">
+        insert into sys_power_info
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">
+                id,
+            </if>
+            <if test="roleId != null">
+                role_id,
+            </if>
+            <if test="menuId != null">
+                menu_id,
+            </if>
+            <if test="canAdd != null">
+                can_add,
+            </if>
+            <if test="canDelete != null">
+                can_delete,
+            </if>
+            <if test="canUpdate != null">
+                can_update,
+            </if>
+            <if test="canSelect != null">
+                can_select,
+            </if>
+            <if test="delFlag != null">
+                del_flag,
+            </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">
+                #{id,jdbcType=INTEGER},
+            </if>
+            <if test="roleId != null">
+                #{roleId,jdbcType=INTEGER},
+            </if>
+            <if test="menuId != null">
+                #{menuId,jdbcType=INTEGER},
+            </if>
+            <if test="canAdd != null">
+                #{canAdd,jdbcType=INTEGER},
+            </if>
+            <if test="canDelete != null">
+                #{canDelete,jdbcType=INTEGER},
+            </if>
+            <if test="canUpdate != null">
+                #{canUpdate,jdbcType=INTEGER},
+            </if>
+            <if test="canSelect != null">
+                #{canSelect,jdbcType=INTEGER},
+            </if>
+            <if test="delFlag != null">
+                #{delFlag,jdbcType=CHAR},
+            </if>
+        </trim>
+    </insert>
+    <update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.PowerInfo">
+        update sys_power_info
+        <set>
+            <if test="roleId != null">
+                role_id = #{roleId,jdbcType=INTEGER},
+            </if>
+            <if test="menuId != null">
+                menu_id = #{menuId,jdbcType=INTEGER},
+            </if>
+            <if test="canAdd != null">
+                can_add = #{canAdd,jdbcType=INTEGER},
+            </if>
+            <if test="canDelete != null">
+                can_delete = #{canDelete,jdbcType=INTEGER},
+            </if>
+            <if test="canUpdate != null">
+                can_update = #{canUpdate,jdbcType=INTEGER},
+            </if>
+            <if test="canSelect != null">
+                can_select = #{canSelect,jdbcType=INTEGER},
+            </if>
+            <if test="delFlag != null">
+                del_flag = #{delFlag,jdbcType=CHAR},
+            </if>
+        </set>
+        where id = #{id,jdbcType=INTEGER}
+    </update>
+    <select id="queryPowerInfosByPage" parameterType="java.util.Map"
+            resultType="com.izouma.awesomeadmin.model.PowerInfo">
+        select
+        <include refid="Base_Column_List"/>
+        from sys_power_info
+        <where>
+            and del_flag = 'N'
+            <if test="record.id != null and !&quot;&quot;.equals(record.id)">
+                and id = #{record.id}
+            </if>
+            <if test="record.roleId != null and !&quot;&quot;.equals(record.roleId)">
+                and role_id = #{record.roleId}
+            </if>
+            <if test="record.menuId != null and !&quot;&quot;.equals(record.menuId)">
+                and menu_id = #{record.menuId}
+            </if>
+            <if test="record.canAdd != null and !&quot;&quot;.equals(record.canAdd)">
+                and can_add = #{record.canAdd}
+            </if>
+            <if test="record.canDelete != null and !&quot;&quot;.equals(record.canDelete)">
+                and can_delete = #{record.canDelete}
+            </if>
+            <if test="record.canUpdate != null and !&quot;&quot;.equals(record.canUpdate)">
+                and can_update = #{record.canUpdate}
+            </if>
+            <if test="record.canSelect != null and !&quot;&quot;.equals(record.canSelect)">
+                and can_select = #{record.canSelect}
+            </if>
+        </where>
+        order by id desc
+    </select>
+    <select id="queryAllPowerInfo" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.PowerInfo">
+        select
+        <include refid="Base_Column_List"/>
+        from sys_power_info
+        <where>
+            and del_flag = 'N'
+            <if test="id != null and !&quot;&quot;.equals(id)">
+                and id = #{id}
+            </if>
+            <if test="roleId != null and !&quot;&quot;.equals(roleId)">
+                and role_id = #{roleId}
+            </if>
+            <if test="menuId != null and !&quot;&quot;.equals(menuId)">
+                and menu_id = #{menuId}
+            </if>
+            <if test="canAdd != null and !&quot;&quot;.equals(canAdd)">
+                and can_add = #{canAdd}
+            </if>
+            <if test="canDelete != null and !&quot;&quot;.equals(canDelete)">
+                and can_delete = #{canDelete}
+            </if>
+            <if test="canUpdate != null and !&quot;&quot;.equals(canUpdate)">
+                and can_update = #{canUpdate}
+            </if>
+            <if test="canSelect != null and !&quot;&quot;.equals(canSelect)">
+                and can_select = #{canSelect}
+            </if>
+            <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
+                and del_flag = #{delFlag}
+            </if>
+            <if test="roleIdStr != null and !&quot;&quot;.equals(roleIdStr)">
+                and role_id in (${roleIdStr})
+            </if>
+        </where>
+        order by id desc
+    </select>
+    <select id="queryPowerInfo" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.PowerInfo">
+        select
+        <include refid="Base_Column_List"/>
+        from sys_power_info
+        <where>
+            and del_flag = 'N'
+            <if test="id != null and !&quot;&quot;.equals(id)">
+                and id = #{id}
+            </if>
+            <if test="roleId != null and !&quot;&quot;.equals(roleId)">
+                and role_id = #{roleId}
+            </if>
+            <if test="menuId != null and !&quot;&quot;.equals(menuId)">
+                and menu_id = #{menuId}
+            </if>
+            <if test="canAdd != null and !&quot;&quot;.equals(canAdd)">
+                and can_add = #{canAdd}
+            </if>
+            <if test="canDelete != null and !&quot;&quot;.equals(canDelete)">
+                and can_delete = #{canDelete}
+            </if>
+            <if test="canUpdate != null and !&quot;&quot;.equals(canUpdate)">
+                and can_update = #{canUpdate}
+            </if>
+            <if test="canSelect != null and !&quot;&quot;.equals(canSelect)">
+                and can_select = #{canSelect}
+            </if>
+            <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
+                and del_flag = #{delFlag}
+            </if>
+        </where>
+        LIMIT 1
+    </select>
+    <update id="delete">
+        UPDATE sys_power_info SET del_flag = 'Y'
+        <where>
+            AND id = #{id}
+        </where>
+    </update>
+
+    <update id="deleteByRoleId">
+        UPDATE sys_power_info SET del_flag = 'Y'
+        <where>
+            AND role_id = #{roleId}
+        </where>
+    </update>
+</mapper>
+

+ 33 - 0
src/main/java/com/izouma/awesomeadmin/dao/QueryConfigMapper.java

@@ -0,0 +1,33 @@
+package com.izouma.awesomeadmin.dao;
+
+import java.util.*;
+import com.izouma.awesomeadmin.datasource.DataSource;
+import org.springframework.stereotype.Repository;
+import com.izouma.awesomeadmin.model.QueryConfig;
+
+
+/**
+*  Dao接口
+*/
+@Repository("com.zoumaframe.dao.QueryConfigMapper")
+public interface QueryConfigMapper{
+
+    int deleteByPrimaryKey(Integer id);
+
+    int insertSelective(QueryConfig record);
+
+    QueryConfig selectByPrimaryKey(Integer id);
+
+    int updateByPrimaryKeySelective(QueryConfig record);
+
+    List<QueryConfig> queryAllQueryConfig(QueryConfig record);
+
+    List<QueryConfig> queryQueryConfigByPage(Map<String, Object> parameter);
+
+    int delete(String id);
+
+    QueryConfig queryQueryConfig(QueryConfig record);
+
+    List<QueryConfig> query(QueryConfig record);
+}
+

+ 398 - 0
src/main/java/com/izouma/awesomeadmin/dao/QueryConfigMapper.xml

@@ -0,0 +1,398 @@
+<?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.izouma.awesomeadmin.dao.QueryConfigMapper">
+    <resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.QueryConfig">
+        <id column="id" property="id" jdbcType="INTEGER"/>
+        <result column="del_flag" property="delFlag" jdbcType="CHAR"/>
+        <result column="code" property="code" jdbcType="VARCHAR"/>
+        <result column="table_name" property="tableName" jdbcType="VARCHAR"/>
+        <result column="tableColumns" property="tablecolumns" jdbcType="VARCHAR"/>
+        <result column="dataBaseType" property="databasetype" jdbcType="VARCHAR"/>
+        <result column="modules" property="modules" jdbcType="VARCHAR"/>
+        <result column="data_source_code" property="dataSourceCode" jdbcType="VARCHAR"/>
+        <result column="config_json" property="configJson" jdbcType="VARCHAR"/>
+        <result column="type_flag" property="typeFlag" jdbcType="VARCHAR"/>
+        <result column="sub_json" property="subJson" jdbcType="VARCHAR"/>
+        <result column="query_json" property="queryJson" jdbcType="VARCHAR"/>
+    </resultMap>
+    <sql id="Base_Column_List">
+        <trim suffixOverrides=",">
+            id,
+
+            del_flag,
+
+            code,
+
+            table_name,
+
+            tableColumns,
+
+            dataBaseType,
+
+            modules,
+
+            data_source_code,
+
+            config_json,
+
+            type_flag,
+
+            sub_json,
+            query_json,
+
+        </trim>
+    </sql>
+    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer">
+        select
+        <include refid="Base_Column_List"/>
+        from sys_query_config
+        where id = #{id,jdbcType=INTEGER}
+    </select>
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
+        delete from sys_query_config
+        where id = #{id,jdbcType=INTEGER}
+    </delete>
+    <insert id="insertSelective" parameterType="com.izouma.awesomeadmin.model.QueryConfig" useGeneratedKeys="true"
+            keyProperty="id">
+        insert into sys_query_config
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id!= null">
+                id,
+            </if>
+            <if test="delFlag!= null">
+                del_flag,
+            </if>
+            <if test="code!= null">
+                code,
+            </if>
+            <if test="tableName!= null">
+                table_name,
+            </if>
+            <if test="tablecolumns!= null">
+                tableColumns,
+            </if>
+            <if test="databasetype!= null">
+                dataBaseType,
+            </if>
+            <if test="modules!= null">
+                modules,
+            </if>
+            <if test="dataSourceCode!= null">
+                data_source_code,
+            </if>
+            <if test="configJson!= null">
+                config_json,
+            </if>
+            <if test="typeFlag!= null">
+                type_flag,
+            </if>
+            <if test="subJson!= null">
+                sub_json,
+            </if>
+            <if test="queryJson!= null">
+                query_json,
+            </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">
+                #{id,jdbcType=INTEGER},
+            </if>
+            <if test="delFlag != null">
+                #{delFlag,jdbcType=CHAR},
+            </if>
+            <if test="code != null">
+                #{code,jdbcType=VARCHAR},
+            </if>
+            <if test="tableName != null">
+                #{tableName,jdbcType=VARCHAR},
+            </if>
+            <if test="tablecolumns != null">
+                #{tablecolumns,jdbcType=VARCHAR},
+            </if>
+            <if test="databasetype != null">
+                #{databasetype,jdbcType=VARCHAR},
+            </if>
+            <if test="modules != null">
+                #{modules,jdbcType=VARCHAR},
+            </if>
+            <if test="dataSourceCode != null">
+                #{dataSourceCode,jdbcType=VARCHAR},
+            </if>
+            <if test="configJson != null">
+                #{configJson,jdbcType=VARCHAR},
+            </if>
+            <if test="typeFlag != null">
+                #{typeFlag,jdbcType=VARCHAR},
+            </if>
+            <if test="subJson != null">
+                #{subJson,jdbcType=VARCHAR},
+            </if>
+            <if test="queryJson != null">
+                #{queryJson,jdbcType=VARCHAR},
+            </if>
+        </trim>
+    </insert>
+    <update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.QueryConfig">
+        update sys_query_config
+        <set>
+            <if test="id != null">
+                id= #{id,jdbcType=INTEGER},
+            </if>
+            <if test="delFlag != null">
+                del_flag= #{delFlag,jdbcType=CHAR},
+            </if>
+            <if test="code != null">
+                code= #{code,jdbcType=VARCHAR},
+            </if>
+            <if test="tableName != null">
+                table_name= #{tableName,jdbcType=VARCHAR},
+            </if>
+            <if test="tablecolumns != null">
+                tableColumns= #{tablecolumns,jdbcType=VARCHAR},
+            </if>
+            <if test="databasetype != null">
+                dataBaseType= #{databasetype,jdbcType=VARCHAR},
+            </if>
+            <if test="modules != null">
+                modules= #{modules,jdbcType=VARCHAR},
+            </if>
+            <if test="dataSourceCode != null">
+                data_source_code= #{dataSourceCode,jdbcType=VARCHAR},
+            </if>
+            <if test="configJson != null">
+                config_json= #{configJson,jdbcType=VARCHAR},
+            </if>
+            <if test="typeFlag != null">
+                type_flag= #{typeFlag,jdbcType=VARCHAR},
+            </if>
+            <if test="subJson != null">
+                sub_json= #{subJson,jdbcType=VARCHAR},
+            </if>
+            <if test="queryJson != null">
+                query_json= #{queryJson,jdbcType=VARCHAR},
+            </if>
+        </set>
+        where id = #{id,jdbcType=INTEGER}
+    </update>
+    <select id="queryQueryConfigByPage" parameterType="java.util.Map"
+            resultType="com.izouma.awesomeadmin.model.QueryConfig">
+        select
+        <include refid="Base_Column_List"/>
+        from sys_query_config
+        <where>
+            and del_flag = 'N'
+            <if test="record.id != null and !&quot;&quot;.equals(record.id)">
+                and id = #{record.id}
+            </if>
+            <if test="record.delFlag != null and !&quot;&quot;.equals(record.delFlag)">
+                and del_flag = #{record.delFlag}
+            </if>
+            <if test="record.code != null and !&quot;&quot;.equals(record.code)">
+                and code = #{record.code}
+            </if>
+            <if test="record.tableName != null and !&quot;&quot;.equals(record.tableName)">
+                and table_name = #{record.tableName}
+            </if>
+            <if test="record.tablecolumns != null and !&quot;&quot;.equals(record.tablecolumns)">
+                and tableColumns = #{record.tablecolumns}
+            </if>
+            <if test="record.databasetype != null and !&quot;&quot;.equals(record.databasetype)">
+                and dataBaseType = #{record.databasetype}
+            </if>
+            <if test="record.modules != null and !&quot;&quot;.equals(record.modules)">
+                and modules = #{record.modules}
+            </if>
+            <if test="record.searchKey != null and !&quot;&quot;.equals(record.searchKey)">
+                <trim prefix="and (" suffix=")" prefixOverrides="OR">
+                    OR code LIKE concat('%',#{record.searchKey},'%')
+                    OR table_name LIKE concat('%',#{record.searchKey},'%')
+                    OR tableColumns LIKE concat('%',#{record.searchKey},'%')
+                    OR dataBaseType LIKE concat('%',#{record.searchKey},'%')
+                    OR type_flag LIKE concat('%',#{record.searchKey},'%')
+                </trim>
+            </if>
+
+            <if test="record.advancedQuery != null and !&quot;&quot;.equals(record.advancedQuery)">
+                <foreach item="item" index="index" collection="record.advancedQuery.split('_;')">
+                    <choose>
+                        <when test="item.indexOf('like') != -1">
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    concat('%',#{itemDetail},'%')
+                                </if>
+
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
+
+                            </foreach>
+                        </when>
+                        <when test="item.indexOf('in') != -1">
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    (${itemDetail})
+                                </if>
+
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
+
+                            </foreach>
+                        </when>
+                        <otherwise>
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    #{itemDetail}
+                                </if>
+
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
+
+                            </foreach>
+                        </otherwise>
+                    </choose>
+
+
+                </foreach>
+
+
+            </if>
+
+        </where>
+        order by id desc
+    </select>
+    <select id="queryAllQueryConfig" parameterType="java.util.Map"
+            resultType="com.izouma.awesomeadmin.model.QueryConfig">
+        select
+        <include refid="Base_Column_List"/>
+        from sys_query_config
+        <where>
+            and del_flag = 'N'
+            <if test="id != null and !&quot;&quot;.equals(id)">
+                and id = #{id}
+            </if>
+            <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
+                and del_flag = #{delFlag}
+            </if>
+            <if test="code != null and !&quot;&quot;.equals(code)">
+                and code = #{code}
+            </if>
+            <if test="tableName != null and !&quot;&quot;.equals(tableName)">
+                and table_name = #{tableName}
+            </if>
+            <if test="tablecolumns != null and !&quot;&quot;.equals(tablecolumns)">
+                and tableColumns = #{tablecolumns}
+            </if>
+            <if test="databasetype != null and !&quot;&quot;.equals(databasetype)">
+                and dataBaseType = #{databasetype}
+            </if>
+            <if test="modules != null and !&quot;&quot;.equals(modules)">
+                and modules = #{modules}
+            </if>
+            <if test="searchKey != null and !&quot;&quot;.equals(searchKey)">
+                <trim prefix="and (" suffix=")" prefixOverrides="OR">
+                    OR code LIKE concat('%',#{searchKey},'%')
+                    OR table_name LIKE concat('%',#{searchKey},'%')
+                    OR tableColumns LIKE concat('%',#{searchKey},'%')
+                    OR dataBaseType LIKE concat('%',#{searchKey},'%')
+                    OR type_flag LIKE concat('%',#{searchKey},'%')
+                </trim>
+            </if>
+            <if test="advancedQuery != null and !&quot;&quot;.equals(advancedQuery)">
+                <foreach item="item" index="index" collection="advancedQuery.split('_;')">
+                    <choose>
+                        <when test="item.indexOf('like') != -1">
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    concat('%',#{itemDetail},'%')
+                                </if>
+
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
+
+                            </foreach>
+                        </when>
+                        <when test="item.indexOf('in') != -1">
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    (${itemDetail})
+                                </if>
+
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
+
+                            </foreach>
+                        </when>
+                        <otherwise>
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    #{itemDetail}
+                                </if>
+
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
+
+                            </foreach>
+                        </otherwise>
+                    </choose>
+
+
+                </foreach>
+
+
+            </if>
+        </where>
+        order by id desc
+    </select>
+    <select id="queryQueryConfig" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.QueryConfig">
+        select
+        <include refid="Base_Column_List"/>
+        from sys_query_config
+        <where>
+            and del_flag = 'N'
+            <if test="id != null and !&quot;&quot;.equals(id)">
+                and id = #{id}
+            </if>
+            <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
+                and del_flag = #{delFlag}
+            </if>
+            <if test="code != null and !&quot;&quot;.equals(code)">
+                and code = #{code}
+            </if>
+            <if test="tableName != null and !&quot;&quot;.equals(tableName)">
+                and table_name = #{tableName}
+            </if>
+            <if test="tablecolumns != null and !&quot;&quot;.equals(tablecolumns)">
+                and tableColumns = #{tablecolumns}
+            </if>
+            <if test="databasetype != null and !&quot;&quot;.equals(databasetype)">
+                and dataBaseType = #{databasetype}
+            </if>
+            <if test="modules != null and !&quot;&quot;.equals(modules)">
+                and modules = #{modules}
+            </if>
+
+        </where>
+        LIMIT 1
+    </select>
+    <update id="delete">
+        UPDATE sys_query_config SET del_flag = 'Y'
+        <where>
+            AND id = #{id}
+        </where>
+    </update>
+    <select id="query" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.QueryConfig">
+        select
+        <include refid="Base_Column_List"/>
+        from sys_query_config
+        <where>
+            and del_flag = 'N'
+        </where>
+        order by id desc
+    </select>
+</mapper>
+

+ 26 - 0
src/main/java/com/izouma/awesomeadmin/dao/RongYunTokenMapper.java

@@ -0,0 +1,26 @@
+package com.izouma.awesomeadmin.dao;
+
+import com.izouma.awesomeadmin.model.RongYunToken;
+
+public interface RongYunTokenMapper {
+
+    int deleteByPrimaryKey(Long id);
+
+
+    int insert(RongYunToken record);
+
+
+    int insertSelective(RongYunToken record);
+
+
+    RongYunToken selectByPrimaryKey(Long id);
+
+
+    int updateByPrimaryKeySelective(RongYunToken record);
+
+
+    int updateByPrimaryKey(RongYunToken record);
+
+
+    RongYunToken getRongToken(String rongKey);
+}

+ 88 - 0
src/main/java/com/izouma/awesomeadmin/dao/RongYunTokenMapper.xml

@@ -0,0 +1,88 @@
+<?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.izouma.awesomeadmin.dao.RongYunTokenMapper">
+    <resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.RongYunToken">
+        <id column="id" property="id" jdbcType="BIGINT"/>
+        <result column="user_id" property="userId" jdbcType="BIGINT"/>
+        <result column="token" property="token" jdbcType="VARCHAR"/>
+    </resultMap>
+
+    <sql id="Base_Column_List">
+      id, user_id, token
+    </sql>
+
+    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">
+        select
+        <include refid="Base_Column_List"/>
+        from sys_rong_yun_token
+        where id = #{id,jdbcType=BIGINT}
+    </select>
+
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+        delete from sys_rong_yun_token
+        where id = #{id,jdbcType=BIGINT}
+    </delete>
+
+    <insert id="insert" parameterType="com.izouma.awesomeadmin.model.RongYunToken" useGeneratedKeys="true"
+            keyProperty="id">
+        insert into sys_rong_yun_token (id, user_id, token)
+        values (#{id,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT}, #{token,jdbcType=VARCHAR})
+    </insert>
+
+    <insert id="insertSelective" parameterType="com.izouma.awesomeadmin.model.RongYunToken" useGeneratedKeys="true"
+            keyProperty="id">
+        insert into sys_rong_yun_token
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">
+                id,
+            </if>
+            <if test="userId != null">
+                user_id,
+            </if>
+            <if test="token != null">
+                token,
+            </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">
+                #{id,jdbcType=BIGINT},
+            </if>
+            <if test="userId != null">
+                #{userId,jdbcType=BIGINT},
+            </if>
+            <if test="token != null">
+                #{token,jdbcType=VARCHAR},
+            </if>
+        </trim>
+    </insert>
+
+    <update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.RongYunToken">
+        update sys_rong_yun_token
+        <set>
+            <if test="userId != null">
+                user_id = #{userId,jdbcType=BIGINT},
+            </if>
+            <if test="token != null">
+                token = #{token,jdbcType=VARCHAR},
+            </if>
+        </set>
+        where id = #{id,jdbcType=BIGINT}
+    </update>
+
+    <update id="updateByPrimaryKey" parameterType="com.izouma.awesomeadmin.model.RongYunToken">
+        update sys_rong_yun_token
+        set user_id = #{userId,jdbcType=BIGINT},
+            token = #{token,jdbcType=VARCHAR}
+        where id = #{id,jdbcType=BIGINT}
+    </update>
+
+    <select id="getRongToken" resultType="com.izouma.awesomeadmin.model.RongYunToken" parameterType="string">
+		SELECT
+		*
+		FROM sys_rong_yun_token
+		WHERE user_id = #{rongKey}
+		order by id desc
+		LIMIT 1
+	</select>
+
+</mapper>

+ 51 - 0
src/main/java/com/izouma/awesomeadmin/dao/SuperUserMapper.java

@@ -0,0 +1,51 @@
+package com.izouma.awesomeadmin.dao;
+
+import java.util.List;
+import java.util.Map;
+
+import org.springframework.stereotype.Repository;
+
+import com.izouma.awesomeadmin.model.SuperUser;
+
+@Repository("com.izouma.awesomeadmin.dao.SuperUserMapper")
+public interface SuperUserMapper {
+
+    /**
+     * 
+     * <p>获取用户列表。</p>
+     *
+     * @return TblUser list
+     */
+    List <SuperUser> queryAllUsers();
+
+
+    /**
+     * 
+     * <p>分页查询,需要以ByPage结尾。</p>
+     *
+     * @return
+     */
+    List <SuperUser> queryAllUsersByPage(Map <String, Object> parameter);
+
+
+    /**
+     * 
+     * <p>根据用户id获取单个用户。</p>
+     *
+     * @param id
+     * @return
+     */
+    SuperUser queryUserById(String userId);
+
+
+    int save(SuperUser superUser);
+
+
+    int updateUserInfo(Map <String, Object> parameter);
+
+
+    int delete(String userId);
+
+
+    SuperUser userLogin(Map <String, Object> parameter);
+}

+ 88 - 0
src/main/java/com/izouma/awesomeadmin/dao/SuperUserMapper.xml

@@ -0,0 +1,88 @@
+<?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.izouma.awesomeadmin.dao.SuperUserMapper">
+    <sql id="columns">
+        user_id, power, password, user_name, profile, del_flag
+  	</sql>
+
+    <select id="queryUserById" resultType="com.izouma.awesomeadmin.model.SuperUser" parameterType="string">
+        SELECT
+        <include refid="columns"/>
+        FROM sys_super_user
+        WHERE user_id = #{userId}
+        LIMIT 1
+    </select>
+
+    <select id="userLogin" resultType="com.izouma.awesomeadmin.model.SuperUser" parameterType="map">
+        SELECT
+        <include refid="columns"/>
+        FROM sys_super_user
+        WHERE user_name = #{username}
+        and password = #{password}
+        LIMIT 1
+    </select>
+
+    <select id="queryAllUsers" resultType="com.izouma.awesomeadmin.model.SuperUser">
+        SELECT
+        <include refid="columns"/>
+        FROM sys_super_user
+        where del_flag = 'N'
+        order by user_id
+        <!-- 为了测试只取100个 -->
+        <!-- LIMIT 100  -->
+    </select>
+
+    <select id="queryAllUsersByPage" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.SuperUser">
+        select
+        <include refid="columns"/>
+        from sys_super_user
+        <where>
+            <!--  
+            <if test="userInfo.userId != null and !&quot;&quot;.equals(userInfo.userId)">
+                and user_id=#{userInfo.userId}
+            </if>
+            <if test="userInfo.username != null and !&quot;&quot;.equals(userInfo.username.trim())">
+                and user_name like '%' #{userInfo.username} '%'
+            </if>
+            -->
+        </where>
+        order by user_id
+    </select>
+
+    <insert id="save" parameterType="com.izouma.awesomeadmin.model.SuperUser" useGeneratedKeys="true" keyProperty="id">
+	    INSERT INTO sys_super_user (user_name, power, password, profile)
+        VALUES (#{username}, #{power}, #{password}, #{profile})
+    </insert>
+
+    <update id="updateUserInfo">
+        UPDATE sys_super_user
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="userInfo.userId != null">
+                user_Id = #{userInfo.userId},
+            </if>
+            <if test="userInfo.username != null">
+                user_name = #{userInfo.username},
+            </if>
+            <if test="userInfo.password != null">
+                password = #{userInfo.password},
+            </if>
+            <if test="userInfo.profile != null">
+                profile = #{userInfo.profile},
+            </if>
+            <if test="userInfo.power != null">
+                power = #{userInfo.power},
+            </if>
+        </trim>
+        <where>
+            AND user_id = #{userId}
+        </where>
+    </update>
+
+    <update id="delete">
+        UPDATE sys_super_user SET del_flag = 'Y'
+        <where>
+            AND user_id = #{userId}
+        </where>
+    </update>
+</mapper>

+ 14 - 0
src/main/java/com/izouma/awesomeadmin/dao/SysAppTokenMapper.java

@@ -0,0 +1,14 @@
+package com.izouma.awesomeadmin.dao;
+
+import com.izouma.awesomeadmin.shiro.AppToken;
+import org.apache.ibatis.annotations.Param;
+
+public interface SysAppTokenMapper {
+    int saveToken(@Param("userId") Integer userId, @Param("token") String token);
+
+    AppToken getToken(String token);
+
+    int delToken(String token);
+
+    int delUserToken(Integer userId);
+}

+ 18 - 0
src/main/java/com/izouma/awesomeadmin/dao/SysAppTokenMapper.xml

@@ -0,0 +1,18 @@
+<?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.izouma.awesomeadmin.dao.SysAppTokenMapper">
+    <insert id="saveToken">
+        insert into sys_app_token (user_id, token)
+        values (#{userId}, #{token})
+    </insert>
+    <delete id="delToken">
+        delete from sys_app_token where token = #{token}
+    </delete>
+    <delete id="delUserToken">
+        delete from sys_app_token where user_id = #{userId}
+    </delete>
+    <select id="getToken" resultType="com.izouma.awesomeadmin.shiro.AppToken">
+        select * from sys_app_token where token = #{token}
+    </select>
+
+</mapper>

+ 33 - 0
src/main/java/com/izouma/awesomeadmin/dao/SysDataruleMapper.java

@@ -0,0 +1,33 @@
+package com.izouma.awesomeadmin.dao;
+
+import java.util.List;
+import java.util.Map;
+
+import com.izouma.awesomeadmin.model.SysDatarule;
+import org.springframework.stereotype.Repository;
+
+
+/**
+ * sys_datarule Dao接口
+ * Tue Apr 17 10:44:06 CST 2018  Suo Chen Cheng
+ */ 
+@Repository("com.izouma.awesomeadmin.dao.SysDataruleMapper")
+public interface SysDataruleMapper {
+
+	int deleteByPrimaryKey(Integer id);
+
+	int insertSelective(SysDatarule record);
+
+	SysDatarule selectByPrimaryKey(Integer id);
+
+	int updateByPrimaryKeySelective(SysDatarule record);
+
+	List <SysDatarule> queryAllSysDatarule(SysDatarule record);
+
+	List <SysDatarule> querySysDatarulesByPage(Map <String, Object> parameter);
+
+	int delete(String id);
+
+	SysDatarule querySysDatarule(SysDatarule record);
+}
+

+ 153 - 0
src/main/java/com/izouma/awesomeadmin/dao/SysDataruleMapper.xml

@@ -0,0 +1,153 @@
+<?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.izouma.awesomeadmin.dao.SysDataruleMapper" >
+	<resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.SysDatarule" >
+		<id column="id" property="id" jdbcType="INTEGER" />
+		<result column="datarule_name" property="dataruleName" jdbcType="VARCHAR" />
+		<result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
+		<result column="del_flag" property="delFlag" jdbcType="CHAR" />
+		<result column="permission" property="permission" jdbcType="VARCHAR" />
+	</resultMap>
+	<sql id="Base_Column_List" >
+		 id, datarule_name, create_date, del_flag,permission
+	</sql>
+	<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
+		select
+		<include refid="Base_Column_List" />
+		from sys_datarule
+		where id = #{id,jdbcType=INTEGER}
+	</select>
+	<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
+		delete from sys_datarule
+		where id = #{id,jdbcType=INTEGER}
+	</delete>
+	<insert id="insertSelective" parameterType="com.izouma.awesomeadmin.model.SysDatarule" useGeneratedKeys="true" keyProperty="id">
+		insert into sys_datarule
+		<trim prefix="(" suffix=")" suffixOverrides="," >
+			<if test="id != null" >
+				id,	
+			</if>
+			<if test="dataruleName != null" >
+				datarule_name,	
+			</if>
+			<if test="createDate != null" >
+				create_date,	
+			</if>
+			<if test="delFlag != null" >
+				del_flag,	
+			</if>
+			<if test="permission != null" >
+				permission,
+			</if>
+
+		</trim>
+		<trim prefix="values (" suffix=")" suffixOverrides="," >
+			<if test="id != null" >
+				#{id,jdbcType=INTEGER},	
+			</if>
+			<if test="dataruleName != null" >
+				#{dataruleName,jdbcType=VARCHAR},	
+			</if>
+			<if test="createDate != null" >
+				#{createDate,jdbcType=TIMESTAMP},	
+			</if>
+			<if test="delFlag != null" >
+				#{delFlag,jdbcType=CHAR},	
+			</if>
+			<if test="permission != null" >
+				#{permission,jdbcType=VARCHAR},
+			</if>
+		</trim>
+	</insert>
+	<update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.SysDatarule" >
+		update sys_datarule
+		<set >
+			<if test="dataruleName != null" >
+				datarule_name = #{dataruleName,jdbcType=VARCHAR},	
+			</if>
+			<if test="createDate != null" >
+				create_date = #{createDate,jdbcType=TIMESTAMP},	
+			</if>
+			<if test="delFlag != null" >
+				del_flag = #{delFlag,jdbcType=CHAR},	
+			</if>
+			<if test="permission != null" >
+				permission = #{permission,jdbcType=VARCHAR},
+			</if>
+		</set>
+		where id = #{id,jdbcType=INTEGER}
+	</update>
+	<select id="querySysDatarulesByPage" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.SysDatarule">
+		select <include refid="Base_Column_List"/> from sys_datarule
+		<where>
+			and del_flag = 'N'
+			<if test="record.id != null and !&quot;&quot;.equals(record.id)">
+				and id = #{record.id}	
+			</if>
+			<if test="record.dataruleName != null and !&quot;&quot;.equals(record.dataruleName)">
+				and datarule_name = #{record.dataruleName}	
+			</if>
+			<if test="record.createDate != null and !&quot;&quot;.equals(record.createDate)">
+				and create_date = #{record.createDate}	
+			</if>
+			<if test="record.delFlag != null and !&quot;&quot;.equals(record.delFlag)">
+				and del_flag = #{record.delFlag}	
+			</if>
+			<if test="record.permission != null and !&quot;&quot;.equals(record.permission)">
+				and permission = #{record.permission}
+			</if>
+		</where>
+		order by id desc
+	</select>
+	<select id="queryAllSysDatarule" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.SysDatarule">
+		select <include refid="Base_Column_List"/> from sys_datarule
+		<where>
+			and del_flag = 'N'
+			<if test="id != null and !&quot;&quot;.equals(id)">
+				and id = #{id}	
+			</if>
+			<if test="dataruleName != null and !&quot;&quot;.equals(dataruleName)">
+				and datarule_name = #{dataruleName}	
+			</if>
+			<if test="createDate != null and !&quot;&quot;.equals(createDate)">
+				and create_date = #{createDate}	
+			</if>
+			<if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
+				and del_flag = #{delFlag}	
+			</if>
+			<if test="permission != null and !&quot;&quot;.equals(permission)">
+				and permission = #{permission}
+			</if>
+		</where>
+		order by id desc
+	</select>
+	<select id="querySysDatarule" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.SysDatarule">
+		select <include refid="Base_Column_List"/> from sys_datarule
+		<where>
+			and del_flag = 'N'
+			<if test="id != null and !&quot;&quot;.equals(id)">
+				and id = #{id}	
+			</if>
+			<if test="dataruleName != null and !&quot;&quot;.equals(dataruleName)">
+				and datarule_name = #{dataruleName}	
+			</if>
+			<if test="createDate != null and !&quot;&quot;.equals(createDate)">
+				and create_date = #{createDate}	
+			</if>
+			<if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
+				and del_flag = #{delFlag}	
+			</if>
+			<if test="permission != null and !&quot;&quot;.equals(permission)">
+				and permission = #{permission}
+			</if>
+		</where>
+		LIMIT 1
+	</select>
+	<update id="delete">
+		UPDATE sys_datarule SET del_flag = 'Y'
+		<where>
+			AND id = #{id}
+		</where>
+	</update>
+</mapper>
+

+ 34 - 0
src/main/java/com/izouma/awesomeadmin/dao/SysMenuMapper.java

@@ -0,0 +1,34 @@
+package com.izouma.awesomeadmin.dao;
+
+import com.izouma.awesomeadmin.model.SysMenu;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * sys_menu Dao接口
+ * Tue Apr 10 18:09:44 CST 2018  Suo Chen Cheng
+ */ 
+@Repository("com.zoumaframe.dao.SysMenuMapper")
+public interface SysMenuMapper {
+
+	int deleteByPrimaryKey(Integer id);
+
+	int insertSelective(SysMenu record);
+
+	SysMenu selectByPrimaryKey(Integer id);
+
+	List<SysMenu> selectByPrimaryKeys(String ids);
+
+	int updateByPrimaryKeySelective(SysMenu record);
+
+	List<SysMenu> queryAllSysMenu(SysMenu record);
+
+	List<SysMenu> querySysMenusByPage(Map<String, Object> parameter);
+
+	int delete(String id);
+
+	SysMenu querySysMenu(SysMenu record);
+}
+

+ 406 - 0
src/main/java/com/izouma/awesomeadmin/dao/SysMenuMapper.xml

@@ -0,0 +1,406 @@
+<?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.izouma.awesomeadmin.dao.SysMenuMapper" >
+	<resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.SysMenu" >
+		<id column="id" property="id" jdbcType="INTEGER" />
+		<result column="parent_id" property="parentId" jdbcType="INTEGER" />
+		<result column="parent_ids" property="parentIds" jdbcType="VARCHAR" />
+		<result column="name" property="name" jdbcType="VARCHAR" />
+		<result column="sort" property="sort" jdbcType="DECIMAL" />
+		<result column="href" property="href" jdbcType="VARCHAR" />
+		<result column="target" property="target" jdbcType="VARCHAR" />
+		<result column="icon" property="icon" jdbcType="VARCHAR" />
+		<result column="is_show" property="isShow" jdbcType="CHAR" />
+		<result column="permission" property="permission" jdbcType="VARCHAR" />
+		<result column="create_by" property="createBy" jdbcType="VARCHAR" />
+		<result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
+		<result column="update_by" property="updateBy" jdbcType="VARCHAR" />
+		<result column="update_date" property="updateDate" jdbcType="TIMESTAMP" />
+		<result column="remarks" property="remarks" jdbcType="VARCHAR" />
+		<result column="del_flag" property="delFlag" jdbcType="CHAR" />
+		<result column="menu_type" property="menuType" jdbcType="CHAR" />
+		<result column="can_move" property="canMove" jdbcType="CHAR" />
+	</resultMap>
+	<sql id="Base_Column_List" >
+		 id, parent_id, parent_ids, name, sort, href, target, icon, is_show, permission, create_by,
+		 create_date, update_by, update_date, remarks, del_flag, menu_type, can_move,handheld
+	</sql>
+	<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
+		select
+		<include refid="Base_Column_List" />
+		from sys_menu
+		where id = #{id,jdbcType=INTEGER}
+	</select>
+	<select id="selectByPrimaryKeys" resultMap="BaseResultMap" parameterType="java.lang.String" >
+		select
+		<include refid="Base_Column_List" />
+		from sys_menu
+		where FIND_IN_SET(id, #{ids,jdbcType=INTEGER}) and del_flag = 'N'
+	</select>
+	<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
+		delete from sys_menu
+		where id = #{id,jdbcType=INTEGER}
+	</delete>
+	<insert id="insertSelective" parameterType="com.izouma.awesomeadmin.model.SysMenu" useGeneratedKeys="true" keyProperty="id">
+		insert into sys_menu
+		<trim prefix="(" suffix=")" suffixOverrides="," >
+			<if test="id != null" >
+				id,	
+			</if>
+			<if test="parentId != null" >
+				parent_id,	
+			</if>
+			<if test="parentIds != null" >
+				parent_ids,	
+			</if>
+			<if test="name != null" >
+				name,	
+			</if>
+			<if test="sort != null" >
+				sort,	
+			</if>
+			<if test="href != null" >
+				href,	
+			</if>
+			<if test="target != null" >
+				target,	
+			</if>
+			<if test="icon != null" >
+				icon,	
+			</if>
+			<if test="isShow != null" >
+				is_show,	
+			</if>
+			<if test="permission != null" >
+				permission,	
+			</if>
+			<if test="createBy != null" >
+				create_by,	
+			</if>
+			<if test="createDate != null" >
+				create_date,	
+			</if>
+			<if test="updateBy != null" >
+				update_by,	
+			</if>
+			<if test="updateDate != null" >
+				update_date,	
+			</if>
+			<if test="remarks != null" >
+				remarks,	
+			</if>
+			<if test="delFlag != null" >
+				del_flag,	
+			</if>
+			<if test="menuType != null" >
+				menu_type,	
+			</if>
+			<if test="handheld != null" >
+				handheld,
+			</if>
+		</trim>
+		<trim prefix="values (" suffix=")" suffixOverrides="," >
+			<if test="id != null" >
+				#{id,jdbcType=INTEGER},	
+			</if>
+			<if test="parentId != null" >
+				#{parentId,jdbcType=INTEGER},	
+			</if>
+			<if test="parentIds != null" >
+				#{parentIds,jdbcType=VARCHAR},	
+			</if>
+			<if test="name != null" >
+				#{name,jdbcType=VARCHAR},	
+			</if>
+			<if test="sort != null" >
+				#{sort,jdbcType=DECIMAL},	
+			</if>
+			<if test="href != null" >
+				#{href,jdbcType=VARCHAR},	
+			</if>
+			<if test="target != null" >
+				#{target,jdbcType=VARCHAR},	
+			</if>
+			<if test="icon != null" >
+				#{icon,jdbcType=VARCHAR},	
+			</if>
+			<if test="isShow != null" >
+				#{isShow,jdbcType=CHAR},	
+			</if>
+			<if test="permission != null" >
+				#{permission,jdbcType=VARCHAR},	
+			</if>
+			<if test="createBy != null" >
+				#{createBy,jdbcType=VARCHAR},	
+			</if>
+			<if test="createDate != null" >
+				#{createDate,jdbcType=TIMESTAMP},	
+			</if>
+			<if test="updateBy != null" >
+				#{updateBy,jdbcType=VARCHAR},	
+			</if>
+			<if test="updateDate != null" >
+				#{updateDate,jdbcType=TIMESTAMP},	
+			</if>
+			<if test="remarks != null" >
+				#{remarks,jdbcType=VARCHAR},	
+			</if>
+			<if test="delFlag != null" >
+				#{delFlag,jdbcType=CHAR},	
+			</if>
+			<if test="menuType != null" >
+				#{menuType,jdbcType=CHAR},	
+			</if>
+			<if test="handheld != null" >
+				#{handheld,jdbcType=CHAR},
+			</if>
+		</trim>
+	</insert>
+	<update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.SysMenu" >
+		update sys_menu
+		<set >
+			<if test="parentId != null" >
+				parent_id = #{parentId,jdbcType=INTEGER},	
+			</if>
+			<if test="parentIds != null" >
+				parent_ids = #{parentIds,jdbcType=VARCHAR},	
+			</if>
+			<if test="name != null" >
+				name = #{name,jdbcType=VARCHAR},	
+			</if>
+			<if test="sort != null" >
+				sort = #{sort,jdbcType=DECIMAL},	
+			</if>
+			<if test="href != null" >
+				href = #{href,jdbcType=VARCHAR},	
+			</if>
+			<if test="target != null" >
+				target = #{target,jdbcType=VARCHAR},	
+			</if>
+			<if test="icon != null" >
+				icon = #{icon,jdbcType=VARCHAR},	
+			</if>
+			<if test="isShow != null" >
+				is_show = #{isShow,jdbcType=CHAR},	
+			</if>
+			<if test="permission != null" >
+				permission = #{permission,jdbcType=VARCHAR},	
+			</if>
+			<if test="createBy != null" >
+				create_by = #{createBy,jdbcType=VARCHAR},	
+			</if>
+			<if test="createDate != null" >
+				create_date = #{createDate,jdbcType=TIMESTAMP},	
+			</if>
+			<if test="updateBy != null" >
+				update_by = #{updateBy,jdbcType=VARCHAR},	
+			</if>
+			<if test="updateDate != null" >
+				update_date = #{updateDate,jdbcType=TIMESTAMP},	
+			</if>
+			<if test="remarks != null" >
+				remarks = #{remarks,jdbcType=VARCHAR},	
+			</if>
+			<if test="delFlag != null" >
+				del_flag = #{delFlag,jdbcType=CHAR},	
+			</if>
+			<if test="menuType != null" >
+				menu_type = #{menuType,jdbcType=CHAR},	
+			</if>
+			<if test="handheld != null" >
+				handheld = #{handheld,jdbcType=CHAR},
+			</if>
+		</set>
+		where id = #{id,jdbcType=INTEGER}
+	</update>
+	<select id="querySysMenusByPage" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.SysMenu">
+		select <include refid="Base_Column_List"/> from sys_menu
+		<where>
+			and del_flag = 'N'
+			<if test="record.id != null and !&quot;&quot;.equals(record.id)">
+				and id = #{record.id}	
+			</if>
+			<if test="record.parentId != null and !&quot;&quot;.equals(record.parentId)">
+				and parent_id = #{record.parentId}	
+			</if>
+			<if test="record.parentIds != null and !&quot;&quot;.equals(record.parentIds)">
+				and parent_ids = #{record.parentIds}	
+			</if>
+			<if test="record.name != null and !&quot;&quot;.equals(record.name)">
+				and name = #{record.name}	
+			</if>
+			<if test="record.sort != null and !&quot;&quot;.equals(record.sort)">
+				and sort = #{record.sort}	
+			</if>
+			<if test="record.href != null and !&quot;&quot;.equals(record.href)">
+				and href = #{record.href}	
+			</if>
+			<if test="record.target != null and !&quot;&quot;.equals(record.target)">
+				and target = #{record.target}	
+			</if>
+			<if test="record.icon != null and !&quot;&quot;.equals(record.icon)">
+				and icon = #{record.icon}	
+			</if>
+			<if test="record.isShow != null and !&quot;&quot;.equals(record.isShow)">
+				and is_show = #{record.isShow}	
+			</if>
+			<if test="record.permission != null and !&quot;&quot;.equals(record.permission)">
+				and permission = #{record.permission}	
+			</if>
+			<if test="record.createBy != null and !&quot;&quot;.equals(record.createBy)">
+				and create_by = #{record.createBy}	
+			</if>
+			<if test="record.createDate != null and !&quot;&quot;.equals(record.createDate)">
+				and create_date = #{record.createDate}	
+			</if>
+			<if test="record.updateBy != null and !&quot;&quot;.equals(record.updateBy)">
+				and update_by = #{record.updateBy}	
+			</if>
+			<if test="record.updateDate != null and !&quot;&quot;.equals(record.updateDate)">
+				and update_date = #{record.updateDate}	
+			</if>
+			<if test="record.remarks != null and !&quot;&quot;.equals(record.remarks)">
+				and remarks = #{record.remarks}	
+			</if>
+			<if test="record.delFlag != null and !&quot;&quot;.equals(record.delFlag)">
+				and del_flag = #{record.delFlag}	
+			</if>
+			<if test="record.menuType != null and !&quot;&quot;.equals(record.menuType)">
+				and menu_type = #{record.menuType}	
+			</if>
+			<if test="record.handheld != null and !&quot;&quot;.equals(record.handheld)">
+				and handheld = #{record.handheld}
+			</if>
+		</where>
+		order by id desc
+	</select>
+	<select id="queryAllSysMenu" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.SysMenu">
+		select <include refid="Base_Column_List"/> from sys_menu
+		<where>
+			and del_flag = 'N'
+			<if test="id != null and !&quot;&quot;.equals(id)">
+				and id = #{id}	
+			</if>
+			<if test="parentId != null and !&quot;&quot;.equals(parentId)">
+				and parent_id = #{parentId}	
+			</if>
+			<if test="parentIds != null and !&quot;&quot;.equals(parentIds)">
+				and parent_ids = #{parentIds}	
+			</if>
+			<if test="name != null and !&quot;&quot;.equals(name)">
+				and name = #{name}	
+			</if>
+			<if test="sort != null and !&quot;&quot;.equals(sort)">
+				and sort = #{sort}	
+			</if>
+			<if test="href != null and !&quot;&quot;.equals(href)">
+				and href = #{href}	
+			</if>
+			<if test="target != null and !&quot;&quot;.equals(target)">
+				and target = #{target}	
+			</if>
+			<if test="icon != null and !&quot;&quot;.equals(icon)">
+				and icon = #{icon}	
+			</if>
+			<if test="isShow != null and !&quot;&quot;.equals(isShow)">
+				and is_show = #{isShow}	
+			</if>
+			<if test="permission != null and !&quot;&quot;.equals(permission)">
+				and permission = #{permission}	
+			</if>
+			<if test="createBy != null and !&quot;&quot;.equals(createBy)">
+				and create_by = #{createBy}	
+			</if>
+			<if test="createDate != null and !&quot;&quot;.equals(createDate)">
+				and create_date = #{createDate}	
+			</if>
+			<if test="updateBy != null and !&quot;&quot;.equals(updateBy)">
+				and update_by = #{updateBy}	
+			</if>
+			<if test="updateDate != null and !&quot;&quot;.equals(updateDate)">
+				and update_date = #{updateDate}	
+			</if>
+			<if test="remarks != null and !&quot;&quot;.equals(remarks)">
+				and remarks = #{remarks}	
+			</if>
+			<if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
+				and del_flag = #{delFlag}	
+			</if>
+			<if test="menuType != null and !&quot;&quot;.equals(menuType)">
+				and menu_type = #{menuType}	
+			</if>
+			<if test="handheld != null and !&quot;&quot;.equals(handheld)">
+				and handheld = #{handheld}
+			</if>
+		</where>
+		order by id desc
+	</select>
+	<select id="querySysMenu" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.SysMenu">
+		select <include refid="Base_Column_List"/> from sys_menu
+		<where>
+			and del_flag = 'N'
+			<if test="id != null and !&quot;&quot;.equals(id)">
+				and id = #{id}	
+			</if>
+			<if test="parentId != null and !&quot;&quot;.equals(parentId)">
+				and parent_id = #{parentId}	
+			</if>
+			<if test="parentIds != null and !&quot;&quot;.equals(parentIds)">
+				and parent_ids = #{parentIds}	
+			</if>
+			<if test="name != null and !&quot;&quot;.equals(name)">
+				and name = #{name}	
+			</if>
+			<if test="sort != null and !&quot;&quot;.equals(sort)">
+				and sort = #{sort}	
+			</if>
+			<if test="href != null and !&quot;&quot;.equals(href)">
+				and href = #{href}	
+			</if>
+			<if test="target != null and !&quot;&quot;.equals(target)">
+				and target = #{target}	
+			</if>
+			<if test="icon != null and !&quot;&quot;.equals(icon)">
+				and icon = #{icon}	
+			</if>
+			<if test="isShow != null and !&quot;&quot;.equals(isShow)">
+				and is_show = #{isShow}	
+			</if>
+			<if test="permission != null and !&quot;&quot;.equals(permission)">
+				and permission = #{permission}	
+			</if>
+			<if test="createBy != null and !&quot;&quot;.equals(createBy)">
+				and create_by = #{createBy}	
+			</if>
+			<if test="createDate != null and !&quot;&quot;.equals(createDate)">
+				and create_date = #{createDate}	
+			</if>
+			<if test="updateBy != null and !&quot;&quot;.equals(updateBy)">
+				and update_by = #{updateBy}	
+			</if>
+			<if test="updateDate != null and !&quot;&quot;.equals(updateDate)">
+				and update_date = #{updateDate}	
+			</if>
+			<if test="remarks != null and !&quot;&quot;.equals(remarks)">
+				and remarks = #{remarks}	
+			</if>
+			<if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
+				and del_flag = #{delFlag}	
+			</if>
+			<if test="menuType != null and !&quot;&quot;.equals(menuType)">
+				and menu_type = #{menuType}	
+			</if>
+			<if test="handheld != null and !&quot;&quot;.equals(handheld)">
+				and handheld = #{handheld}
+			</if>
+		</where>
+		LIMIT 1
+	</select>
+	<update id="delete">
+		UPDATE sys_menu SET del_flag = 'Y'
+		<where>
+			AND id = #{id}
+		</where>
+	</update>
+</mapper>
+

+ 47 - 0
src/main/java/com/izouma/awesomeadmin/dao/SysRoleMapper.java

@@ -0,0 +1,47 @@
+package com.izouma.awesomeadmin.dao;
+
+import com.izouma.awesomeadmin.model.SysRole;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * sys_role Dao接口
+ * Tue Apr 10 18:09:56 CST 2018  Suo Chen Cheng
+ */
+@Repository("com.zoumaframe.dao.SysRoleMapper")
+public interface SysRoleMapper {
+
+    int deleteByPrimaryKey(Integer id);
+
+    int insertSelective(SysRole record);
+
+    SysRole selectByPrimaryKey(Integer id);
+
+    List<SysRole> selectByPrimaryKeys(@Param("ids") String ids);
+
+    int updateByPrimaryKeySelective(SysRole record);
+
+    List<SysRole> queryAllSysRole(SysRole record);
+
+    List<SysRole> querySysRolesByPage(Map<String, Object> parameter);
+
+    int delete(String id);
+
+    SysRole querySysRole(SysRole record);
+
+    List<SysRole> getUserRoles(@Param("userId") Integer userId);
+
+    int setUserRoles(@Param("userId") Integer userId, @Param("roles") List<String> roles);
+
+    int clearUserRoles(@Param("userId") Integer userId);
+
+    int addUserRole(@Param("userId") Integer userId, @Param("roleId") Integer roleId);
+
+    int removeUserRole(@Param("userId") Integer userId, @Param("roleId") Integer roleId);
+
+    String getUserRoleId(Integer id);
+}
+

+ 376 - 0
src/main/java/com/izouma/awesomeadmin/dao/SysRoleMapper.xml

@@ -0,0 +1,376 @@
+<?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.izouma.awesomeadmin.dao.SysRoleMapper" >
+	<resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.SysRole" >
+		<id column="id" property="id" jdbcType="INTEGER" />
+		<result column="office_id" property="officeId" jdbcType="VARCHAR" />
+		<result column="name" property="name" jdbcType="VARCHAR" />
+		<result column="enname" property="enname" jdbcType="VARCHAR" />
+		<result column="role_type" property="roleType" jdbcType="VARCHAR" />
+		<result column="is_sys" property="isSys" jdbcType="VARCHAR" />
+		<result column="useable" property="useable" jdbcType="VARCHAR" />
+		<result column="create_by" property="createBy" jdbcType="VARCHAR" />
+		<result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
+		<result column="update_by" property="updateBy" jdbcType="VARCHAR" />
+		<result column="update_date" property="updateDate" jdbcType="TIMESTAMP" />
+		<result column="remarks" property="remarks" jdbcType="VARCHAR" />
+		<result column="del_flag" property="delFlag" jdbcType="CHAR" />
+		<result column="menu_ids" property="menuIds" jdbcType="VARCHAR" />
+		<result column="permission" property="permission" jdbcType="VARCHAR" />
+	</resultMap>
+	<sql id="Base_Column_List" >
+		 id, office_id, name, enname, role_type, is_sys, useable, create_by, create_date, update_by, update_date, remarks, del_flag,menu_ids,permission
+	</sql>
+	<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
+		select
+		<include refid="Base_Column_List" />
+		from sys_role
+		where id = #{id,jdbcType=INTEGER}
+	</select>
+	<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
+		delete from sys_role
+		where id = #{id,jdbcType=INTEGER}
+	</delete>
+	<insert id="insertSelective" parameterType="com.izouma.awesomeadmin.model.SysRole" useGeneratedKeys="true" keyProperty="id">
+		insert into sys_role
+		<trim prefix="(" suffix=")" suffixOverrides="," >
+			<if test="id != null" >
+				id,	
+			</if>
+			<if test="officeId != null" >
+				office_id,	
+			</if>
+			<if test="name != null" >
+				name,	
+			</if>
+			<if test="enname != null" >
+				enname,	
+			</if>
+			<if test="roleType != null" >
+				role_type,	
+			</if>
+			<if test="isSys != null" >
+				is_sys,	
+			</if>
+			<if test="useable != null" >
+				useable,	
+			</if>
+			<if test="createBy != null" >
+				create_by,	
+			</if>
+			<if test="createDate != null" >
+				create_date,	
+			</if>
+			<if test="updateBy != null" >
+				update_by,	
+			</if>
+			<if test="updateDate != null" >
+				update_date,	
+			</if>
+			<if test="remarks != null" >
+				remarks,	
+			</if>
+			<if test="menuIds != null" >
+				menu_ids,
+			</if>
+			<if test="permission != null" >
+				permission,
+			</if>
+		</trim>
+		<trim prefix="values (" suffix=")" suffixOverrides="," >
+			<if test="id != null" >
+				#{id,jdbcType=INTEGER},	
+			</if>
+			<if test="officeId != null" >
+				#{officeId,jdbcType=VARCHAR},	
+			</if>
+			<if test="name != null" >
+				#{name,jdbcType=VARCHAR},	
+			</if>
+			<if test="enname != null" >
+				#{enname,jdbcType=VARCHAR},	
+			</if>
+			<if test="roleType != null" >
+				#{roleType,jdbcType=VARCHAR},	
+			</if>
+			<if test="isSys != null" >
+				#{isSys,jdbcType=VARCHAR},	
+			</if>
+			<if test="useable != null" >
+				#{useable,jdbcType=VARCHAR},	
+			</if>
+			<if test="createBy != null" >
+				#{createBy,jdbcType=VARCHAR},	
+			</if>
+			<if test="createDate != null" >
+				#{createDate,jdbcType=TIMESTAMP},	
+			</if>
+			<if test="updateBy != null" >
+				#{updateBy,jdbcType=VARCHAR},	
+			</if>
+			<if test="updateDate != null" >
+				#{updateDate,jdbcType=TIMESTAMP},	
+			</if>
+			<if test="remarks != null" >
+				#{remarks,jdbcType=VARCHAR},	
+			</if>
+			<if test="menuIds != null" >
+				#{menuIds,jdbcType=VARCHAR},
+			</if>
+			<if test="permission != null" >
+				#{permission,jdbcType=VARCHAR},
+			</if>
+		</trim>
+	</insert>
+	<update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.SysRole" >
+		update sys_role
+		<set >
+			<if test="officeId != null" >
+				office_id = #{officeId,jdbcType=VARCHAR},	
+			</if>
+			<if test="name != null" >
+				name = #{name,jdbcType=VARCHAR},	
+			</if>
+			<if test="enname != null" >
+				enname = #{enname,jdbcType=VARCHAR},	
+			</if>
+			<if test="roleType != null" >
+				role_type = #{roleType,jdbcType=VARCHAR},	
+			</if>
+			<if test="isSys != null" >
+				is_sys = #{isSys,jdbcType=VARCHAR},	
+			</if>
+			<if test="useable != null" >
+				useable = #{useable,jdbcType=VARCHAR},	
+			</if>
+			<if test="createBy != null" >
+				create_by = #{createBy,jdbcType=VARCHAR},	
+			</if>
+			<if test="createDate != null" >
+				create_date = #{createDate,jdbcType=TIMESTAMP},	
+			</if>
+			<if test="updateBy != null" >
+				update_by = #{updateBy,jdbcType=VARCHAR},	
+			</if>
+			<if test="updateDate != null" >
+				update_date = #{updateDate,jdbcType=TIMESTAMP},	
+			</if>
+			<if test="remarks != null" >
+				remarks = #{remarks,jdbcType=VARCHAR},	
+			</if>
+			<if test="delFlag != null" >
+				del_flag = #{delFlag,jdbcType=CHAR},	
+			</if>
+			<if test="menuIds != null" >
+				menu_ids = #{menuIds,jdbcType=VARCHAR},
+			</if>
+			<if test="permission != null" >
+				permission = #{permission,jdbcType=VARCHAR},
+			</if>
+		</set>
+		where id = #{id,jdbcType=INTEGER}
+	</update>
+	<select id="querySysRolesByPage" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.SysRole">
+		select <include refid="Base_Column_List"/> from sys_role
+		<where>
+			and del_flag = 'N'
+			<if test="record.id != null and !&quot;&quot;.equals(record.id)">
+				and id = #{record.id}	
+			</if>
+			<if test="record.officeId != null and !&quot;&quot;.equals(record.officeId)">
+				and office_id = #{record.officeId}	
+			</if>
+			<if test="record.name != null and !&quot;&quot;.equals(record.name)">
+				and name = #{record.name}	
+			</if>
+			<if test="record.enname != null and !&quot;&quot;.equals(record.enname)">
+				and enname = #{record.enname}	
+			</if>
+			<if test="record.roleType != null and !&quot;&quot;.equals(record.roleType)">
+				and role_type = #{record.roleType}	
+			</if>
+			<if test="record.isSys != null and !&quot;&quot;.equals(record.isSys)">
+				and is_sys = #{record.isSys}	
+			</if>
+			<if test="record.useable != null and !&quot;&quot;.equals(record.useable)">
+				and useable = #{record.useable}	
+			</if>
+			<if test="record.createBy != null and !&quot;&quot;.equals(record.createBy)">
+				and create_by = #{record.createBy}	
+			</if>
+			<if test="record.createDate != null and !&quot;&quot;.equals(record.createDate)">
+				and create_date = #{record.createDate}	
+			</if>
+			<if test="record.updateBy != null and !&quot;&quot;.equals(record.updateBy)">
+				and update_by = #{record.updateBy}	
+			</if>
+			<if test="record.updateDate != null and !&quot;&quot;.equals(record.updateDate)">
+				and update_date = #{record.updateDate}	
+			</if>
+			<if test="record.remarks != null and !&quot;&quot;.equals(record.remarks)">
+				and remarks = #{record.remarks}	
+			</if>
+			<if test="record.delFlag != null and !&quot;&quot;.equals(record.delFlag)">
+				and del_flag = #{record.delFlag}	
+			</if>
+			<if test="record.menuIds != null and !&quot;&quot;.equals(record.menuIds)">
+				and menu_ids = #{record.menuIds}
+			</if>
+			<if test="record.permission != null and !&quot;&quot;.equals(record.permission)">
+				and permission = #{record.permission}
+			</if>
+		</where>
+		order by id desc
+	</select>
+	<select id="queryAllSysRole" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.SysRole">
+		select <include refid="Base_Column_List"/>
+		<if test="menuId != null and !&quot;&quot;.equals(menuId)">
+			,  FIND_IN_SET(#{menuId}, menu_ids) as  menu_flag
+		</if>
+		from sys_role
+		<where>
+			and del_flag = 'N'
+			<if test="id != null and !&quot;&quot;.equals(id)">
+				and id = #{id}	
+			</if>
+			<if test="officeId != null and !&quot;&quot;.equals(officeId)">
+				and office_id = #{officeId}	
+			</if>
+			<if test="name != null and !&quot;&quot;.equals(name)">
+				and name = #{name}	
+			</if>
+			<if test="enname != null and !&quot;&quot;.equals(enname)">
+				and enname = #{enname}	
+			</if>
+			<if test="roleType != null and !&quot;&quot;.equals(roleType)">
+				and role_type = #{roleType}	
+			</if>
+			<if test="isSys != null and !&quot;&quot;.equals(isSys)">
+				and is_sys = #{isSys}	
+			</if>
+			<if test="useable != null and !&quot;&quot;.equals(useable)">
+				and useable = #{useable}	
+			</if>
+			<if test="createBy != null and !&quot;&quot;.equals(createBy)">
+				and create_by = #{createBy}	
+			</if>
+			<if test="createDate != null and !&quot;&quot;.equals(createDate)">
+				and create_date = #{createDate}	
+			</if>
+			<if test="updateBy != null and !&quot;&quot;.equals(updateBy)">
+				and update_by = #{updateBy}	
+			</if>
+			<if test="updateDate != null and !&quot;&quot;.equals(updateDate)">
+				and update_date = #{updateDate}	
+			</if>
+			<if test="remarks != null and !&quot;&quot;.equals(remarks)">
+				and remarks = #{remarks}	
+			</if>
+			<if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
+				and del_flag = #{delFlag}	
+			</if>
+			<if test="idStr != null and !&quot;&quot;.equals(idStr)">
+				and id in  (${idStr})
+			</if>
+			<if test="menuIds != null and !&quot;&quot;.equals(menuIds)">
+				and menu_ids = #{menuIds}
+			</if>
+			<if test="permission != null and !&quot;&quot;.equals(permission)">
+				and permission = #{permission}
+			</if>
+		</where>
+		order by id desc
+	</select>
+	<select id="querySysRole" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.SysRole">
+		select <include refid="Base_Column_List"/> from sys_role
+		<where>
+			and del_flag = 'N'
+			<if test="id != null and !&quot;&quot;.equals(id)">
+				and id = #{id}	
+			</if>
+			<if test="officeId != null and !&quot;&quot;.equals(officeId)">
+				and office_id = #{officeId}	
+			</if>
+			<if test="name != null and !&quot;&quot;.equals(name)">
+				and name = #{name}	
+			</if>
+			<if test="enname != null and !&quot;&quot;.equals(enname)">
+				and enname = #{enname}	
+			</if>
+			<if test="roleType != null and !&quot;&quot;.equals(roleType)">
+				and role_type = #{roleType}	
+			</if>
+			<if test="isSys != null and !&quot;&quot;.equals(isSys)">
+				and is_sys = #{isSys}	
+			</if>
+			<if test="useable != null and !&quot;&quot;.equals(useable)">
+				and useable = #{useable}	
+			</if>
+			<if test="createBy != null and !&quot;&quot;.equals(createBy)">
+				and create_by = #{createBy}	
+			</if>
+			<if test="createDate != null and !&quot;&quot;.equals(createDate)">
+				and create_date = #{createDate}	
+			</if>
+			<if test="updateBy != null and !&quot;&quot;.equals(updateBy)">
+				and update_by = #{updateBy}	
+			</if>
+			<if test="updateDate != null and !&quot;&quot;.equals(updateDate)">
+				and update_date = #{updateDate}	
+			</if>
+			<if test="remarks != null and !&quot;&quot;.equals(remarks)">
+				and remarks = #{remarks}	
+			</if>
+			<if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
+				and del_flag = #{delFlag}	
+			</if>
+			<if test="menuIds != null and !&quot;&quot;.equals(menuIds)">
+				and menu_ids = #{menuIds}
+			</if>
+			<if test="permission != null and !&quot;&quot;.equals(permission)">
+				and permission = #{permission}
+			</if>
+		</where>
+		LIMIT 1
+	</select>
+    <select id="selectByPrimaryKeys" resultType="com.izouma.awesomeadmin.model.SysRole">
+		select
+		<include refid="Base_Column_List" />
+		from sys_role
+		where id in (${ids})
+		and del_flag = 'N'
+	</select>
+    <select id="getUserRoles" resultType="com.izouma.awesomeadmin.model.SysRole">
+		select
+		<include refid="Base_Column_List" />
+		from sys_role
+		where id in (select role_id from sys_user_role where user_id = #{userId})
+		and del_flag = 'N'
+	</select>
+    <update id="delete">
+		UPDATE sys_role SET del_flag = 'Y'
+		<where>
+			AND id = #{id}
+		</where>
+	</update>
+	<insert id="setUserRoles">
+		insert into sys_user_role (user_id, role_id)
+		values
+		<foreach collection="roles" item="roleId" separator=",">
+			(#{userId}, #{roleId})
+		</foreach>
+	</insert>
+    <delete id="clearUserRoles">
+		delete from sys_user_role where user_id = #{userId}
+	</delete>
+	<insert id="addUserRole">
+		insert into sys_user_role (user_id, role_id) values (#{userId}, #{roleId})
+	</insert>
+	<delete id="removeUserRole">
+		delete from sys_user_role when user_id = #{userId} and role_id = #{roleId}
+	</delete>
+	<select id="getUserRoleId" resultType="java.lang.String">
+		SELECT group_concat(role_id) FROM sys_user_role WHERE user_id = #{id}
+	</select>
+</mapper>
+

+ 34 - 0
src/main/java/com/izouma/awesomeadmin/dao/TableFieldMapper.java

@@ -0,0 +1,34 @@
+package com.izouma.awesomeadmin.dao;
+
+import java.util.List;
+import java.util.Map;
+
+import org.springframework.stereotype.Repository;
+
+import com.izouma.awesomeadmin.model.TableField;
+
+/**
+ * table_field Dao接口
+ * Fri May 04 13:38:24 CST 2018  Suo Chen Cheng
+ */ 
+@Repository("com.izouma.awesomeadmin.dao.TableFieldMapper")
+public interface TableFieldMapper {
+
+	int deleteByPrimaryKey(Integer id);
+
+	int insertSelective(TableField record);
+
+	TableField selectByPrimaryKey(Integer id);
+
+	int updateByPrimaryKeySelective(TableField record);
+
+	List <TableField> queryAllTableField(TableField record);
+
+	List <TableField> queryTableFieldsByPage(Map <String, Object> parameter);
+
+	int delete(String id);
+
+	TableField queryTableField(TableField record);
+
+}
+

+ 494 - 0
src/main/java/com/izouma/awesomeadmin/dao/TableFieldMapper.xml

@@ -0,0 +1,494 @@
+<?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.izouma.awesomeadmin.dao.TableFieldMapper" >
+	<resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.TableField" >
+		<id column="id" property="id" jdbcType="INTEGER" />
+		<result column="name" property="name" jdbcType="VARCHAR" />
+		<result column="remark" property="remark" jdbcType="VARCHAR" />
+		<result column="jdbcType" property="jdbcType" jdbcType="VARCHAR" />
+		<result column="javaType" property="javaType" jdbcType="VARCHAR" />
+		<result column="length" property="length" jdbcType="INTEGER" />
+		<result column="decimalPlaces" property="decimalPlaces" jdbcType="INTEGER" />
+		<result column="defaultValue" property="defaultValue" jdbcType="VARCHAR" />
+		<result column="notNull" property="notNull" jdbcType="BIT" />
+		<result column="primaryKey" property="primaryKey" jdbcType="BIT" />
+		<result column="autoIncrease" property="autoIncrease" jdbcType="BIT" />
+		<result column="showInList" property="showInList" jdbcType="BIT" />
+		<result column="showInForm" property="showInForm" jdbcType="BIT" />
+		<result column="searchable" property="searchable" jdbcType="BIT" />
+		<result column="formType" property="formType" jdbcType="VARCHAR" />
+		<result column="searchMethod" property="searchMethod" jdbcType="VARCHAR" />
+		<result column="required" property="required" jdbcType="BIT" />
+		<result column="validate" property="validate" jdbcType="BIT" />
+		<result column="minLength" property="minLength" jdbcType="INTEGER" />
+		<result column="maxLength" property="maxLength" jdbcType="INTEGER" />
+		<result column="min" property="min" jdbcType="VARCHAR" />
+		<result column="max" property="max" jdbcType="VARCHAR" />
+		<result column="validatorType" property="validatorType" jdbcType="VARCHAR" />
+	</resultMap>
+	<sql id="Base_Column_List" >
+		 id, 'name', remark, jdbcType, javaType, 'length', decimalPlaces, defaultValue, notNull, primaryKey, autoIncrease, showInList, showInForm, searchable, formType, searchMethod, required, validate, minLength, maxLength, 'min','max', validatorType
+	</sql>
+	<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
+		select
+		<include refid="Base_Column_List" />
+		from sys_table_field
+		where id = #{id,jdbcType=INTEGER}
+	</select>
+	<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
+		delete from sys_table_field
+		where id = #{id,jdbcType=INTEGER}
+	</delete>
+	<insert id="insertSelective" parameterType="com.izouma.awesomeadmin.model.TableField" useGeneratedKeys="true" keyProperty="id">
+		insert into sys_table_field
+		<trim prefix="(" suffix=")" suffixOverrides="," >
+			<if test="id != null" >
+				id,	
+			</if>
+			<if test="name != null" >
+				name,	
+			</if>
+			<if test="remark != null" >
+				remark,	
+			</if>
+			<if test="jdbcType != null" >
+				jdbcType,	
+			</if>
+			<if test="javaType != null" >
+				javaType,	
+			</if>
+			<if test="length != null" >
+				length,	
+			</if>
+			<if test="decimalPlaces != null" >
+				decimalPlaces,	
+			</if>
+			<if test="defaultValue != null" >
+				defaultValue,	
+			</if>
+			<if test="notNull != null" >
+				notNull,	
+			</if>
+			<if test="primaryKey != null" >
+				primaryKey,	
+			</if>
+			<if test="autoIncrease != null" >
+				autoIncrease,	
+			</if>
+			<if test="showInList != null" >
+				showInList,	
+			</if>
+			<if test="showInForm != null" >
+				showInForm,	
+			</if>
+			<if test="searchable != null" >
+				searchable,	
+			</if>
+			<if test="formType != null" >
+				formType,	
+			</if>
+			<if test="searchMethod != null" >
+				searchMethod,	
+			</if>
+			<if test="required != null" >
+				required,	
+			</if>
+			<if test="validate != null" >
+				validate,	
+			</if>
+			<if test="minLength != null" >
+				minLength,	
+			</if>
+			<if test="maxLength != null" >
+				maxLength,	
+			</if>
+			<if test="min != null" >
+				min,	
+			</if>
+			<if test="max != null" >
+				max,	
+			</if>
+			<if test="validatorType != null" >
+				validatorType,	
+			</if>
+		</trim>
+		<trim prefix="values (" suffix=")" suffixOverrides="," >
+			<if test="id != null" >
+				#{id,jdbcType=INTEGER},	
+			</if>
+			<if test="name != null" >
+				#{name,jdbcType=VARCHAR},	
+			</if>
+			<if test="remark != null" >
+				#{remark,jdbcType=VARCHAR},	
+			</if>
+			<if test="jdbcType != null" >
+				#{jdbcType,jdbcType=VARCHAR},	
+			</if>
+			<if test="javaType != null" >
+				#{javaType,jdbcType=VARCHAR},	
+			</if>
+			<if test="length != null" >
+				#{length,jdbcType=INTEGER},	
+			</if>
+			<if test="decimalPlaces != null" >
+				#{decimalPlaces,jdbcType=INTEGER},	
+			</if>
+			<if test="defaultValue != null" >
+				#{defaultValue,jdbcType=VARCHAR},	
+			</if>
+			<if test="notNull != null" >
+				#{notNull,jdbcType=BIT},	
+			</if>
+			<if test="primaryKey != null" >
+				#{primaryKey,jdbcType=BIT},	
+			</if>
+			<if test="autoIncrease != null" >
+				#{autoIncrease,jdbcType=BIT},	
+			</if>
+			<if test="showInList != null" >
+				#{showInList,jdbcType=BIT},	
+			</if>
+			<if test="showInForm != null" >
+				#{showInForm,jdbcType=BIT},	
+			</if>
+			<if test="searchable != null" >
+				#{searchable,jdbcType=BIT},	
+			</if>
+			<if test="formType != null" >
+				#{formType,jdbcType=VARCHAR},	
+			</if>
+			<if test="searchMethod != null" >
+				#{searchMethod,jdbcType=VARCHAR},	
+			</if>
+			<if test="required != null" >
+				#{required,jdbcType=BIT},	
+			</if>
+			<if test="validate != null" >
+				#{validate,jdbcType=BIT},	
+			</if>
+			<if test="minLength != null" >
+				#{minLength,jdbcType=INTEGER},	
+			</if>
+			<if test="maxLength != null" >
+				#{maxLength,jdbcType=INTEGER},	
+			</if>
+			<if test="min != null" >
+				#{min,jdbcType=VARCHAR},	
+			</if>
+			<if test="max != null" >
+				#{max,jdbcType=VARCHAR},	
+			</if>
+			<if test="validatorType != null" >
+				#{validatorType,jdbcType=VARCHAR},	
+			</if>
+		</trim>
+	</insert>
+	<update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.TableField" >
+		update sys_table_field
+		<set >
+			<if test="name != null" >
+				name = #{name,jdbcType=VARCHAR},	
+			</if>
+			<if test="remark != null" >
+				remark = #{remark,jdbcType=VARCHAR},	
+			</if>
+			<if test="jdbcType != null" >
+				jdbcType = #{jdbcType,jdbcType=VARCHAR},	
+			</if>
+			<if test="javaType != null" >
+				javaType = #{javaType,jdbcType=VARCHAR},	
+			</if>
+			<if test="length != null" >
+				length = #{length,jdbcType=INTEGER},	
+			</if>
+			<if test="decimalPlaces != null" >
+				decimalPlaces = #{decimalPlaces,jdbcType=INTEGER},	
+			</if>
+			<if test="defaultValue != null" >
+				defaultValue = #{defaultValue,jdbcType=VARCHAR},	
+			</if>
+			<if test="notNull != null" >
+				notNull = #{notNull,jdbcType=BIT},	
+			</if>
+			<if test="primaryKey != null" >
+				primaryKey = #{primaryKey,jdbcType=BIT},	
+			</if>
+			<if test="autoIncrease != null" >
+				autoIncrease = #{autoIncrease,jdbcType=BIT},	
+			</if>
+			<if test="showInList != null" >
+				showInList = #{showInList,jdbcType=BIT},	
+			</if>
+			<if test="showInForm != null" >
+				showInForm = #{showInForm,jdbcType=BIT},	
+			</if>
+			<if test="searchable != null" >
+				searchable = #{searchable,jdbcType=BIT},	
+			</if>
+			<if test="formType != null" >
+				formType = #{formType,jdbcType=VARCHAR},	
+			</if>
+			<if test="searchMethod != null" >
+				searchMethod = #{searchMethod,jdbcType=VARCHAR},	
+			</if>
+			<if test="required != null" >
+				required = #{required,jdbcType=BIT},	
+			</if>
+			<if test="validate != null" >
+				validate = #{validate,jdbcType=BIT},	
+			</if>
+			<if test="minLength != null" >
+				minLength = #{minLength,jdbcType=INTEGER},	
+			</if>
+			<if test="maxLength != null" >
+				maxLength = #{maxLength,jdbcType=INTEGER},	
+			</if>
+			<if test="min != null" >
+				min = #{min,jdbcType=VARCHAR},	
+			</if>
+			<if test="max != null" >
+				max = #{max,jdbcType=VARCHAR},	
+			</if>
+			<if test="validatorType != null" >
+				validatorType = #{validatorType,jdbcType=VARCHAR},	
+			</if>
+		</set>
+		where id = #{id,jdbcType=INTEGER}
+	</update>
+	<select id="queryTableFieldsByPage" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.TableField">
+		select <include refid="Base_Column_List"/> from sys_table_field
+		<where>
+			and del_flag = 'N'
+			<if test="record.id != null and !&quot;&quot;.equals(record.id)">
+				and id = #{record.id}	
+			</if>
+			<if test="record.name != null and !&quot;&quot;.equals(record.name)">
+				and name = #{record.name}	
+			</if>
+			<if test="record.remark != null and !&quot;&quot;.equals(record.remark)">
+				and remark = #{record.remark}	
+			</if>
+			<if test="record.jdbcType != null and !&quot;&quot;.equals(record.jdbcType)">
+				and jdbcType = #{record.jdbcType}	
+			</if>
+			<if test="record.javaType != null and !&quot;&quot;.equals(record.javaType)">
+				and javaType = #{record.javaType}	
+			</if>
+			<if test="record.length != null and !&quot;&quot;.equals(record.length)">
+				and length = #{record.length}	
+			</if>
+			<if test="record.decimalPlaces != null and !&quot;&quot;.equals(record.decimalPlaces)">
+				and decimalPlaces = #{record.decimalPlaces}	
+			</if>
+			<if test="record.defaultValue != null and !&quot;&quot;.equals(record.defaultValue)">
+				and defaultValue = #{record.defaultValue}	
+			</if>
+			<if test="record.notNull != null and !&quot;&quot;.equals(record.notNull)">
+				and notNull = #{record.notNull}	
+			</if>
+			<if test="record.primaryKey != null and !&quot;&quot;.equals(record.primaryKey)">
+				and primaryKey = #{record.primaryKey}	
+			</if>
+			<if test="record.autoIncrease != null and !&quot;&quot;.equals(record.autoIncrease)">
+				and autoIncrease = #{record.autoIncrease}	
+			</if>
+			<if test="record.showInList != null and !&quot;&quot;.equals(record.showInList)">
+				and showInList = #{record.showInList}	
+			</if>
+			<if test="record.showInForm != null and !&quot;&quot;.equals(record.showInForm)">
+				and showInForm = #{record.showInForm}	
+			</if>
+			<if test="record.searchable != null and !&quot;&quot;.equals(record.searchable)">
+				and searchable = #{record.searchable}	
+			</if>
+			<if test="record.formType != null and !&quot;&quot;.equals(record.formType)">
+				and formType = #{record.formType}	
+			</if>
+			<if test="record.searchMethod != null and !&quot;&quot;.equals(record.searchMethod)">
+				and searchMethod = #{record.searchMethod}	
+			</if>
+			<if test="record.required != null and !&quot;&quot;.equals(record.required)">
+				and required = #{record.required}	
+			</if>
+			<if test="record.validate != null and !&quot;&quot;.equals(record.validate)">
+				and validate = #{record.validate}	
+			</if>
+			<if test="record.minLength != null and !&quot;&quot;.equals(record.minLength)">
+				and minLength = #{record.minLength}	
+			</if>
+			<if test="record.maxLength != null and !&quot;&quot;.equals(record.maxLength)">
+				and maxLength = #{record.maxLength}	
+			</if>
+			<if test="record.min != null and !&quot;&quot;.equals(record.min)">
+				and min = #{record.min}	
+			</if>
+			<if test="record.max != null and !&quot;&quot;.equals(record.max)">
+				and max = #{record.max}	
+			</if>
+			<if test="record.validatorType != null and !&quot;&quot;.equals(record.validatorType)">
+				and validatorType = #{record.validatorType}	
+			</if>
+		</where>
+		order by id desc
+	</select>
+	<select id="queryAllTableField" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.TableField">
+		select <include refid="Base_Column_List"/> from sys_table_field
+		<where>
+			and del_flag = 'N'
+			<if test="id != null and !&quot;&quot;.equals(id)">
+				and id = #{id}	
+			</if>
+			<if test="name != null and !&quot;&quot;.equals(name)">
+				and name = #{name}	
+			</if>
+			<if test="remark != null and !&quot;&quot;.equals(remark)">
+				and remark = #{remark}	
+			</if>
+			<if test="jdbcType != null and !&quot;&quot;.equals(jdbcType)">
+				and jdbcType = #{jdbcType}	
+			</if>
+			<if test="javaType != null and !&quot;&quot;.equals(javaType)">
+				and javaType = #{javaType}	
+			</if>
+			<if test="length != null and !&quot;&quot;.equals(length)">
+				and length = #{length}	
+			</if>
+			<if test="decimalPlaces != null and !&quot;&quot;.equals(decimalPlaces)">
+				and decimalPlaces = #{decimalPlaces}	
+			</if>
+			<if test="defaultValue != null and !&quot;&quot;.equals(defaultValue)">
+				and defaultValue = #{defaultValue}	
+			</if>
+			<if test="notNull != null and !&quot;&quot;.equals(notNull)">
+				and notNull = #{notNull}	
+			</if>
+			<if test="primaryKey != null and !&quot;&quot;.equals(primaryKey)">
+				and primaryKey = #{primaryKey}	
+			</if>
+			<if test="autoIncrease != null and !&quot;&quot;.equals(autoIncrease)">
+				and autoIncrease = #{autoIncrease}	
+			</if>
+			<if test="showInList != null and !&quot;&quot;.equals(showInList)">
+				and showInList = #{showInList}	
+			</if>
+			<if test="showInForm != null and !&quot;&quot;.equals(showInForm)">
+				and showInForm = #{showInForm}	
+			</if>
+			<if test="searchable != null and !&quot;&quot;.equals(searchable)">
+				and searchable = #{searchable}	
+			</if>
+			<if test="formType != null and !&quot;&quot;.equals(formType)">
+				and formType = #{formType}	
+			</if>
+			<if test="searchMethod != null and !&quot;&quot;.equals(searchMethod)">
+				and searchMethod = #{searchMethod}	
+			</if>
+			<if test="required != null and !&quot;&quot;.equals(required)">
+				and required = #{required}	
+			</if>
+			<if test="validate != null and !&quot;&quot;.equals(validate)">
+				and validate = #{validate}	
+			</if>
+			<if test="minLength != null and !&quot;&quot;.equals(minLength)">
+				and minLength = #{minLength}	
+			</if>
+			<if test="maxLength != null and !&quot;&quot;.equals(maxLength)">
+				and maxLength = #{maxLength}	
+			</if>
+			<if test="min != null and !&quot;&quot;.equals(min)">
+				and min = #{min}	
+			</if>
+			<if test="max != null and !&quot;&quot;.equals(max)">
+				and max = #{max}	
+			</if>
+			<if test="validatorType != null and !&quot;&quot;.equals(validatorType)">
+				and validatorType = #{validatorType}	
+			</if>
+		</where>
+		order by id desc
+	</select>
+	<select id="queryTableField" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.TableField">
+		select <include refid="Base_Column_List"/> from sys_table_field
+		<where>
+			and del_flag = 'N'
+			<if test="id != null and !&quot;&quot;.equals(id)">
+				and id = #{id}	
+			</if>
+			<if test="name != null and !&quot;&quot;.equals(name)">
+				and name = #{name}	
+			</if>
+			<if test="remark != null and !&quot;&quot;.equals(remark)">
+				and remark = #{remark}	
+			</if>
+			<if test="jdbcType != null and !&quot;&quot;.equals(jdbcType)">
+				and jdbcType = #{jdbcType}	
+			</if>
+			<if test="javaType != null and !&quot;&quot;.equals(javaType)">
+				and javaType = #{javaType}	
+			</if>
+			<if test="length != null and !&quot;&quot;.equals(length)">
+				and length = #{length}	
+			</if>
+			<if test="decimalPlaces != null and !&quot;&quot;.equals(decimalPlaces)">
+				and decimalPlaces = #{decimalPlaces}	
+			</if>
+			<if test="defaultValue != null and !&quot;&quot;.equals(defaultValue)">
+				and defaultValue = #{defaultValue}	
+			</if>
+			<if test="notNull != null and !&quot;&quot;.equals(notNull)">
+				and notNull = #{notNull}	
+			</if>
+			<if test="primaryKey != null and !&quot;&quot;.equals(primaryKey)">
+				and primaryKey = #{primaryKey}	
+			</if>
+			<if test="autoIncrease != null and !&quot;&quot;.equals(autoIncrease)">
+				and autoIncrease = #{autoIncrease}	
+			</if>
+			<if test="showInList != null and !&quot;&quot;.equals(showInList)">
+				and showInList = #{showInList}	
+			</if>
+			<if test="showInForm != null and !&quot;&quot;.equals(showInForm)">
+				and showInForm = #{showInForm}	
+			</if>
+			<if test="searchable != null and !&quot;&quot;.equals(searchable)">
+				and searchable = #{searchable}	
+			</if>
+			<if test="formType != null and !&quot;&quot;.equals(formType)">
+				and formType = #{formType}	
+			</if>
+			<if test="searchMethod != null and !&quot;&quot;.equals(searchMethod)">
+				and searchMethod = #{searchMethod}	
+			</if>
+			<if test="required != null and !&quot;&quot;.equals(required)">
+				and required = #{required}	
+			</if>
+			<if test="validate != null and !&quot;&quot;.equals(validate)">
+				and validate = #{validate}	
+			</if>
+			<if test="minLength != null and !&quot;&quot;.equals(minLength)">
+				and minLength = #{minLength}	
+			</if>
+			<if test="maxLength != null and !&quot;&quot;.equals(maxLength)">
+				and maxLength = #{maxLength}	
+			</if>
+			<if test="min != null and !&quot;&quot;.equals(min)">
+				and min = #{min}	
+			</if>
+			<if test="max != null and !&quot;&quot;.equals(max)">
+				and max = #{max}	
+			</if>
+			<if test="validatorType != null and !&quot;&quot;.equals(validatorType)">
+				and validatorType = #{validatorType}	
+			</if>
+		</where>
+		LIMIT 1
+	</select>
+	<update id="delete">
+		UPDATE sys_table_field SET del_flag = 'Y'
+		<where>
+			AND id = #{id}
+		</where>
+	</update>
+</mapper>
+

+ 34 - 0
src/main/java/com/izouma/awesomeadmin/dao/TableNiuseRongliangMapper.java

@@ -0,0 +1,34 @@
+package com.izouma.awesomeadmin.dao;
+
+import java.util.*;
+import com.izouma.awesomeadmin.datasource.DataSource;
+import org.springframework.stereotype.Repository;
+import com.izouma.awesomeadmin.model.TableNiuseRongliang;
+
+
+/**
+*  Dao接口
+*/
+@DataSource("dataSourceSqlserver")
+@Repository("com.zoumaframe.dao.TableNiuseRongliangMapper")
+public interface TableNiuseRongliangMapper{
+
+    int deleteByPrimaryKey(Integer id);
+
+    int insertSelective(TableNiuseRongliang record);
+
+    TableNiuseRongliang selectByPrimaryKey(Integer id);
+
+    int updateByPrimaryKeySelective(TableNiuseRongliang record);
+
+    List<TableNiuseRongliang> queryAllTableNiuseRongliang(TableNiuseRongliang record);
+
+    List<TableNiuseRongliang> queryTableNiuseRongliangByPage(Map<String, Object> parameter);
+
+    int delete(TableNiuseRongliang record);
+
+    TableNiuseRongliang queryTableNiuseRongliang(TableNiuseRongliang record);
+
+    List<TableNiuseRongliang> query(TableNiuseRongliang record);
+}
+

Разлика између датотеке није приказан због своје велике величине
+ 588 - 0
src/main/java/com/izouma/awesomeadmin/dao/TableNiuseRongliangMapper.xml


+ 34 - 0
src/main/java/com/izouma/awesomeadmin/dao/TableShouyiYaopinxinxiMapper.java

@@ -0,0 +1,34 @@
+package com.izouma.awesomeadmin.dao;
+
+import java.util.*;
+import com.izouma.awesomeadmin.datasource.DataSource;
+import org.springframework.stereotype.Repository;
+import com.izouma.awesomeadmin.model.TableShouyiYaopinxinxi;
+
+
+/**
+*  Dao接口
+*/
+@DataSource("dataSourceSqlserver")
+@Repository("com.zoumaframe.dao.TableShouyiYaopinxinxiMapper")
+public interface TableShouyiYaopinxinxiMapper{
+
+    int deleteByPrimaryKey(Integer id);
+
+    int insertSelective(TableShouyiYaopinxinxi record);
+
+    TableShouyiYaopinxinxi selectByPrimaryKey(Integer id);
+
+    int updateByPrimaryKeySelective(TableShouyiYaopinxinxi record);
+
+    List<TableShouyiYaopinxinxi> queryAllTableShouyiYaopinxinxi(TableShouyiYaopinxinxi record);
+
+    List<TableShouyiYaopinxinxi> queryTableShouyiYaopinxinxiByPage(Map<String, Object> parameter);
+
+    int delete(String id);
+
+    TableShouyiYaopinxinxi queryTableShouyiYaopinxinxi(TableShouyiYaopinxinxi record);
+
+    List<TableShouyiYaopinxinxi> query(TableShouyiYaopinxinxi record);
+}
+

+ 376 - 0
src/main/java/com/izouma/awesomeadmin/dao/TableShouyiYaopinxinxiMapper.xml

@@ -0,0 +1,376 @@
+<?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.izouma.awesomeadmin.dao.TableShouyiYaopinxinxiMapper">
+    <resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.TableShouyiYaopinxinxi">
+                                    <id column="id" property="id" jdbcType="INTEGER"/>
+                                                                        <result column="药品编号" property="药品编号" jdbcType="VARCHAR"/>
+                                                            <result column="药品名称" property="药品名称" jdbcType="VARCHAR"/>
+                                                            <result column="计量单位" property="计量单位" jdbcType="VARCHAR"/>
+                                                            <result column="规格" property="规格" jdbcType="VARCHAR"/>
+                                                            <result column="主要成分" property="主要成分" jdbcType="VARCHAR"/>
+                                                            <result column="有效成分" property="有效成分" jdbcType="VARCHAR"/>
+                                                            <result column="单价" property="单价" jdbcType="DECIMAL"/>
+                                                            <result column="生产厂家" property="生产厂家" jdbcType="VARCHAR"/>
+                                                            <result column="药品制定部门" property="药品制定部门" jdbcType="VARCHAR"/>
+                                                            <result column="FlagColumn" property="flagcolumn" jdbcType="INTEGER"/>
+                        </resultMap>
+    <sql id="Base_Column_List">
+                    ID,                    药品编号,                    药品名称,                    计量单位,                    规格,                    主要成分,                    有效成分,                    单价,                    生产厂家,                    药品制定部门,                    FlagColumn            </sql>
+    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer">
+        select
+        <include refid="Base_Column_List"/>
+        from Table_兽医_药品信息
+        where id = #{id,jdbcType=INTEGER}
+    </select>
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
+        delete from Table_兽医_药品信息
+        where id = #{id,jdbcType=INTEGER}
+    </delete>
+    <insert id="insertSelective" parameterType="com.izouma.awesomeadmin.model.TableShouyiYaopinxinxi"
+            useGeneratedKeys="true" keyProperty="id">
+        insert into Table_兽医_药品信息
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+                                                                            <if test="药品编号!= null">
+                        药品编号,
+                    </if>
+                                                                <if test="药品名称!= null">
+                        药品名称,
+                    </if>
+                                                                <if test="计量单位!= null">
+                        计量单位,
+                    </if>
+                                                                <if test="规格!= null">
+                        规格,
+                    </if>
+                                                                <if test="主要成分!= null">
+                        主要成分,
+                    </if>
+                                                                <if test="有效成分!= null">
+                        有效成分,
+                    </if>
+                                                                <if test="单价!= null">
+                        单价,
+                    </if>
+                                                                <if test="生产厂家!= null">
+                        生产厂家,
+                    </if>
+                                                                <if test="药品制定部门!= null">
+                        药品制定部门,
+                    </if>
+                                                                <if test="flagcolumn!= null">
+                        FlagColumn,
+                    </if>
+                                    </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+                                                                            <if test="药品编号 != null">
+                        #{药品编号,jdbcType=VARCHAR},
+                    </if>
+                                                                <if test="药品名称 != null">
+                        #{药品名称,jdbcType=VARCHAR},
+                    </if>
+                                                                <if test="计量单位 != null">
+                        #{计量单位,jdbcType=VARCHAR},
+                    </if>
+                                                                <if test="规格 != null">
+                        #{规格,jdbcType=VARCHAR},
+                    </if>
+                                                                <if test="主要成分 != null">
+                        #{主要成分,jdbcType=VARCHAR},
+                    </if>
+                                                                <if test="有效成分 != null">
+                        #{有效成分,jdbcType=VARCHAR},
+                    </if>
+                                                                <if test="单价 != null">
+                        #{单价,jdbcType=DECIMAL},
+                    </if>
+                                                                <if test="生产厂家 != null">
+                        #{生产厂家,jdbcType=VARCHAR},
+                    </if>
+                                                                <if test="药品制定部门 != null">
+                        #{药品制定部门,jdbcType=VARCHAR},
+                    </if>
+                                                                <if test="flagcolumn != null">
+                        #{flagcolumn,jdbcType=INTEGER},
+                    </if>
+                                    </trim>
+    </insert>
+    <update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.TableShouyiYaopinxinxi">
+        update Table_兽医_药品信息
+        <set>
+                                                                            <if test="药品编号 != null">
+                        药品编号= #{药品编号,jdbcType=VARCHAR},
+                    </if>
+                                                                <if test="药品名称 != null">
+                        药品名称= #{药品名称,jdbcType=VARCHAR},
+                    </if>
+                                                                <if test="计量单位 != null">
+                        计量单位= #{计量单位,jdbcType=VARCHAR},
+                    </if>
+                                                                <if test="规格 != null">
+                        规格= #{规格,jdbcType=VARCHAR},
+                    </if>
+                                                                <if test="主要成分 != null">
+                        主要成分= #{主要成分,jdbcType=VARCHAR},
+                    </if>
+                                                                <if test="有效成分 != null">
+                        有效成分= #{有效成分,jdbcType=VARCHAR},
+                    </if>
+                                                                <if test="单价 != null">
+                        单价= #{单价,jdbcType=DECIMAL},
+                    </if>
+                                                                <if test="生产厂家 != null">
+                        生产厂家= #{生产厂家,jdbcType=VARCHAR},
+                    </if>
+                                                                <if test="药品制定部门 != null">
+                        药品制定部门= #{药品制定部门,jdbcType=VARCHAR},
+                    </if>
+                                                                <if test="flagcolumn != null">
+                        FlagColumn= #{flagcolumn,jdbcType=INTEGER},
+                    </if>
+                                    </set>
+        where id = #{id,jdbcType=INTEGER}
+    </update>
+    <select id="queryTableShouyiYaopinxinxiByPage" parameterType="java.util.Map"
+            resultType="com.izouma.awesomeadmin.model.TableShouyiYaopinxinxi">
+        select
+        <include refid="Base_Column_List"/>
+        from Table_兽医_药品信息
+        <where>
+            and FlagColumn = 0
+                            <if test="record.id != null and !&quot;&quot;.equals(record.id)">
+                    and  ID = #{record.id}
+                </if>
+                            <if test="record.药品编号 != null and !&quot;&quot;.equals(record.药品编号)">
+                    and  药品编号 = #{record.药品编号}
+                </if>
+                            <if test="record.药品名称 != null and !&quot;&quot;.equals(record.药品名称)">
+                    and  药品名称 = #{record.药品名称}
+                </if>
+                            <if test="record.计量单位 != null and !&quot;&quot;.equals(record.计量单位)">
+                    and  计量单位 = #{record.计量单位}
+                </if>
+                            <if test="record.规格 != null and !&quot;&quot;.equals(record.规格)">
+                    and  规格 = #{record.规格}
+                </if>
+                            <if test="record.主要成分 != null and !&quot;&quot;.equals(record.主要成分)">
+                    and  主要成分 = #{record.主要成分}
+                </if>
+                            <if test="record.有效成分 != null and !&quot;&quot;.equals(record.有效成分)">
+                    and  有效成分 = #{record.有效成分}
+                </if>
+                            <if test="record.单价 != null and !&quot;&quot;.equals(record.单价)">
+                    and  单价 = #{record.单价}
+                </if>
+                            <if test="record.生产厂家 != null and !&quot;&quot;.equals(record.生产厂家)">
+                    and  生产厂家 = #{record.生产厂家}
+                </if>
+                            <if test="record.药品制定部门 != null and !&quot;&quot;.equals(record.药品制定部门)">
+                    and  药品制定部门 = #{record.药品制定部门}
+                </if>
+                            <if test="record.flagcolumn != null and !&quot;&quot;.equals(record.flagcolumn)">
+                    and  FlagColumn = #{record.flagcolumn}
+                </if>
+            
+            <if test="record.searchKey != null and !&quot;&quot;.equals(record.searchKey)">
+                <trim prefix="and (" suffix=")" prefixOverrides="OR" >
+                                                                                                                    OR  药品编号 LIKE concat('%',#{record.searchKey},'%')
+                                                                                                OR  药品名称 LIKE concat('%',#{record.searchKey},'%')
+                                                                                                OR  计量单位 LIKE concat('%',#{record.searchKey},'%')
+                                                                                                OR  规格 LIKE concat('%',#{record.searchKey},'%')
+                                                                                                OR  主要成分 LIKE concat('%',#{record.searchKey},'%')
+                                                                                                OR  有效成分 LIKE concat('%',#{record.searchKey},'%')
+                                                                                                OR  单价 LIKE concat('%',#{record.searchKey},'%')
+                                                                                                OR  生产厂家 LIKE concat('%',#{record.searchKey},'%')
+                                                                                                OR  药品制定部门 LIKE concat('%',#{record.searchKey},'%')
+                                                                                                OR  FlagColumn LIKE concat('%',#{record.searchKey},'%')
+                                                            </trim>
+            </if>
+            <if test="record.advancedQuery != null and !&quot;&quot;.equals(record.advancedQuery)">
+                <foreach item="item" index="index" collection="record.advancedQuery.split('_;')">
+                    <choose>
+                        <when test="item.indexOf('like') != -1">
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    concat('%',#{itemDetail},'%')
+                                </if>
+
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
+
+                            </foreach>
+                        </when>
+                        <otherwise>
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    #{itemDetail}
+                                </if>
+
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
+
+                            </foreach>
+                        </otherwise>
+                    </choose>
+
+
+                </foreach>
+
+
+            </if>
+        </where>
+        order by id desc
+    </select>
+    <select id="queryAllTableShouyiYaopinxinxi" parameterType="java.util.Map"
+            resultType="com.izouma.awesomeadmin.model.TableShouyiYaopinxinxi">
+        select
+        <include refid="Base_Column_List"/>
+        from Table_兽医_药品信息
+        <where>
+            and FlagColumn = 0
+                            <if test="id != null and !&quot;&quot;.equals(id)">
+                    and  ID = #{id}
+                </if>
+                            <if test="药品编号 != null and !&quot;&quot;.equals(药品编号)">
+                    and  药品编号 = #{药品编号}
+                </if>
+                            <if test="药品名称 != null and !&quot;&quot;.equals(药品名称)">
+                    and  药品名称 = #{药品名称}
+                </if>
+                            <if test="计量单位 != null and !&quot;&quot;.equals(计量单位)">
+                    and  计量单位 = #{计量单位}
+                </if>
+                            <if test="规格 != null and !&quot;&quot;.equals(规格)">
+                    and  规格 = #{规格}
+                </if>
+                            <if test="主要成分 != null and !&quot;&quot;.equals(主要成分)">
+                    and  主要成分 = #{主要成分}
+                </if>
+                            <if test="有效成分 != null and !&quot;&quot;.equals(有效成分)">
+                    and  有效成分 = #{有效成分}
+                </if>
+                            <if test="单价 != null and !&quot;&quot;.equals(单价)">
+                    and  单价 = #{单价}
+                </if>
+                            <if test="生产厂家 != null and !&quot;&quot;.equals(生产厂家)">
+                    and  生产厂家 = #{生产厂家}
+                </if>
+                            <if test="药品制定部门 != null and !&quot;&quot;.equals(药品制定部门)">
+                    and  药品制定部门 = #{药品制定部门}
+                </if>
+                            <if test="flagcolumn != null and !&quot;&quot;.equals(flagcolumn)">
+                    and  FlagColumn = #{flagcolumn}
+                </if>
+            
+            <if test="searchKey != null and !&quot;&quot;.equals(searchKey)">
+                <trim prefix="and (" suffix=")" prefixOverrides="OR" >
+                                                                                                                    OR  药品编号 LIKE concat('%',#{searchKey},'%')
+                                                                                                OR  药品名称 LIKE concat('%',#{searchKey},'%')
+                                                                                                OR  计量单位 LIKE concat('%',#{searchKey},'%')
+                                                                                                OR  规格 LIKE concat('%',#{searchKey},'%')
+                                                                                                OR  主要成分 LIKE concat('%',#{searchKey},'%')
+                                                                                                OR  有效成分 LIKE concat('%',#{searchKey},'%')
+                                                                                                OR  单价 LIKE concat('%',#{searchKey},'%')
+                                                                                                OR  生产厂家 LIKE concat('%',#{searchKey},'%')
+                                                                                                OR  药品制定部门 LIKE concat('%',#{searchKey},'%')
+                                                                                                OR  FlagColumn LIKE concat('%',#{searchKey},'%')
+                                                            </trim>
+            </if>
+            <if test="advancedQuery != null and !&quot;&quot;.equals(advancedQuery)">
+                <foreach item="item" index="index" collection="advancedQuery.split('_;')">
+                    <choose>
+                        <when test="item.indexOf('like') != -1">
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    concat('%',#{itemDetail},'%')
+                                </if>
+
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
+
+                            </foreach>
+                        </when>
+                        <otherwise>
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    #{itemDetail}
+                                </if>
+
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
+
+                            </foreach>
+                        </otherwise>
+                    </choose>
+
+
+                </foreach>
+
+
+            </if>
+        </where>
+        order by id desc
+    </select>
+    <select id="queryTableShouyiYaopinxinxi" parameterType="java.util.Map"
+            resultType="com.izouma.awesomeadmin.model.TableShouyiYaopinxinxi">
+        select top 1
+        <include refid="Base_Column_List"/>
+        from Table_兽医_药品信息
+        <where>
+            and FlagColumn = 0
+                            <if test="id != null and !&quot;&quot;.equals(id)">
+                    and ID = #{id}
+                </if>
+                            <if test="药品编号 != null and !&quot;&quot;.equals(药品编号)">
+                    and 药品编号 = #{药品编号}
+                </if>
+                            <if test="药品名称 != null and !&quot;&quot;.equals(药品名称)">
+                    and 药品名称 = #{药品名称}
+                </if>
+                            <if test="计量单位 != null and !&quot;&quot;.equals(计量单位)">
+                    and 计量单位 = #{计量单位}
+                </if>
+                            <if test="规格 != null and !&quot;&quot;.equals(规格)">
+                    and 规格 = #{规格}
+                </if>
+                            <if test="主要成分 != null and !&quot;&quot;.equals(主要成分)">
+                    and 主要成分 = #{主要成分}
+                </if>
+                            <if test="有效成分 != null and !&quot;&quot;.equals(有效成分)">
+                    and 有效成分 = #{有效成分}
+                </if>
+                            <if test="单价 != null and !&quot;&quot;.equals(单价)">
+                    and 单价 = #{单价}
+                </if>
+                            <if test="生产厂家 != null and !&quot;&quot;.equals(生产厂家)">
+                    and 生产厂家 = #{生产厂家}
+                </if>
+                            <if test="药品制定部门 != null and !&quot;&quot;.equals(药品制定部门)">
+                    and 药品制定部门 = #{药品制定部门}
+                </if>
+                            <if test="flagcolumn != null and !&quot;&quot;.equals(flagcolumn)">
+                    and FlagColumn = #{flagcolumn}
+                </if>
+            
+        </where>
+    </select>
+    <update id="delete">
+        UPDATE Table_兽医_药品信息 SET FlagColumn = 1
+        <where>
+            AND id = #{id}
+        </where>
+    </update>
+    <select id="query" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.TableShouyiYaopinxinxi">
+        select
+        <include refid="Base_Column_List"/>
+        from Table_兽医_药品信息
+        <where>
+            and FlagColumn = 0
+                                                                                                                                                                                                                                                                                                                                        </where>
+        order by id desc
+    </select>
+</mapper>
+

+ 33 - 0
src/main/java/com/izouma/awesomeadmin/dao/TestAaaMapper.java

@@ -0,0 +1,33 @@
+package com.izouma.awesomeadmin.dao;
+
+import java.util.*;
+import com.izouma.awesomeadmin.datasource.DataSource;
+import org.springframework.stereotype.Repository;
+import com.izouma.awesomeadmin.model.TestAaa;
+
+
+/**
+*  Dao接口
+*/
+@Repository("com.zoumaframe.dao.TestAaaMapper")
+public interface TestAaaMapper{
+
+    int deleteByPrimaryKey(Integer id);
+
+    int insertSelective(TestAaa record);
+
+    TestAaa selectByPrimaryKey(Integer id);
+
+    int updateByPrimaryKeySelective(TestAaa record);
+
+    List<TestAaa> queryAllTestAaa(TestAaa record);
+
+    List<TestAaa> queryTestAaaByPage(Map<String, Object> parameter);
+
+    int delete(TestAaa record);
+
+    TestAaa queryTestAaa(TestAaa record);
+
+    List<TestAaa> query(TestAaa record);
+}
+

+ 467 - 0
src/main/java/com/izouma/awesomeadmin/dao/TestAaaMapper.xml

@@ -0,0 +1,467 @@
+<?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.izouma.awesomeadmin.dao.TestAaaMapper">
+    <resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.TestAaa">
+        <id column="id" property="id" jdbcType="INTEGER"/>
+        <result column="del_flag" property="delFlag" jdbcType="CHAR"/>
+        <result column="image_url" property="imageUrl" jdbcType="VARCHAR"/>
+        <result column="test_name" property="testName" jdbcType="VARCHAR"/>
+        <result column="remark" property="remark" jdbcType="VARCHAR"/>
+        <result column="multi_select" property="multiSelect" jdbcType="VARCHAR"/>
+        <result column="test_time" property="testTime" jdbcType="TIMESTAMP"/>
+        <result column="login_user" property="loginUser" jdbcType="VARCHAR"/>
+        <result column="testc_time" property="testcTime" jdbcType="TIMESTAMP"/>
+        <result column="testc_date" property="testcDate" jdbcType="TIMESTAMP"/>
+        <result column="work_number" property="workNumber" jdbcType="VARCHAR"/>
+        <result column="depart_id" property="departId" jdbcType="VARCHAR"/>
+    </resultMap>
+    <sql id="Base_Column_List">
+        id, del_flag, image_url, test_name, remark, multi_select, test_time, login_user, testc_time, testc_date, work_number, depart_id    </sql>
+    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer">
+        select
+        <include refid="Base_Column_List"/>
+        from test_aaa
+        where id = #{id,jdbcType=INTEGER}
+    </select>
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
+        delete from test_aaa
+        where id = #{id,jdbcType=INTEGER}
+    </delete>
+    <insert id="insertSelective" parameterType="com.izouma.awesomeadmin.model.TestAaa" useGeneratedKeys="true"
+            keyProperty="id">
+        insert into test_aaa
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id!= null">
+                id,
+            </if>
+            <if test="delFlag!= null">
+                del_flag,
+            </if>
+            <if test="imageUrl!= null">
+                image_url,
+            </if>
+            <if test="testName!= null">
+                test_name,
+            </if>
+            <if test="remark!= null">
+                remark,
+            </if>
+            <if test="multiSelect!= null">
+                multi_select,
+            </if>
+            <if test="testTime!= null">
+                test_time,
+            </if>
+            <if test="loginUser!= null">
+                login_user,
+            </if>
+            <if test="testcTime!= null">
+                testc_time,
+            </if>
+            <if test="testcDate!= null">
+                testc_date,
+            </if>
+            <if test="workNumber!= null">
+                work_number,
+            </if>
+            <if test="departId!= null">
+                depart_id,
+            </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">
+                #{id,jdbcType=INTEGER},
+            </if>
+            <if test="delFlag != null">
+                #{delFlag,jdbcType=CHAR},
+            </if>
+            <if test="imageUrl != null">
+                #{imageUrl,jdbcType=VARCHAR},
+            </if>
+            <if test="testName != null">
+                #{testName,jdbcType=VARCHAR},
+            </if>
+            <if test="remark != null">
+                #{remark,jdbcType=VARCHAR},
+            </if>
+            <if test="multiSelect != null">
+                #{multiSelect,jdbcType=VARCHAR},
+            </if>
+            <if test="testTime != null">
+                #{testTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="loginUser != null">
+                #{loginUser,jdbcType=VARCHAR},
+            </if>
+            <if test="testcTime != null">
+                #{testcTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="testcDate != null">
+                #{testcDate,jdbcType=TIMESTAMP},
+            </if>
+            <if test="workNumber != null">
+                #{workNumber,jdbcType=VARCHAR},
+            </if>
+            <if test="departId != null">
+                #{departId,jdbcType=VARCHAR},
+            </if>
+        </trim>
+    </insert>
+    <update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.TestAaa">
+        update test_aaa
+        <set>
+            <if test="id != null">
+                id= #{id,jdbcType=INTEGER},
+            </if>
+            <if test="delFlag != null">
+                del_flag= #{delFlag,jdbcType=CHAR},
+            </if>
+            <if test="imageUrl != null">
+                image_url= #{imageUrl,jdbcType=VARCHAR},
+            </if>
+            <if test="testName != null">
+                test_name= #{testName,jdbcType=VARCHAR},
+            </if>
+            <if test="remark != null">
+                remark= #{remark,jdbcType=VARCHAR},
+            </if>
+            <if test="multiSelect != null">
+                multi_select= #{multiSelect,jdbcType=VARCHAR},
+            </if>
+            <if test="testTime != null">
+                test_time= #{testTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="loginUser != null">
+                login_user= #{loginUser,jdbcType=VARCHAR},
+            </if>
+            <if test="testcTime != null">
+                testc_time= #{testcTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="testcDate != null">
+                testc_date= #{testcDate,jdbcType=TIMESTAMP},
+            </if>
+            <if test="workNumber != null">
+                work_number= #{workNumber,jdbcType=VARCHAR},
+            </if>
+            <if test="departId != null">
+                depart_id= #{departId,jdbcType=VARCHAR},
+            </if>
+        </set>
+        where
+        <if test="id != null and !&quot;&quot;.equals(id)">
+            id = #{id,jdbcType=INTEGER}
+        </if>
+
+        <if test="idStr != null and !&quot;&quot;.equals(idStr)">
+            id in (${idStr})
+        </if>
+    </update>
+    <select id="queryTestAaaByPage" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.TestAaa">
+        select
+        <include refid="Base_Column_List"/>
+        from test_aaa
+        <where>
+            and del_flag = 'N'
+            <if test="record.idStr != null and !&quot;&quot;.equals(record.idStr)">
+                and id in (${record.idStr})
+            </if>
+            <if test="record.id != null and !&quot;&quot;.equals(record.id)">
+                and id = #{record.id}
+            </if>
+            <if test="record.delFlag != null and !&quot;&quot;.equals(record.delFlag)">
+                and del_flag = #{record.delFlag}
+            </if>
+            <if test="record.imageUrl != null and !&quot;&quot;.equals(record.imageUrl)">
+                and image_url = #{record.imageUrl}
+            </if>
+            <if test="record.testName != null and !&quot;&quot;.equals(record.testName)">
+                and test_name = #{record.testName}
+            </if>
+            <if test="record.remark != null and !&quot;&quot;.equals(record.remark)">
+                and remark = #{record.remark}
+            </if>
+            <if test="record.multiSelect != null and !&quot;&quot;.equals(record.multiSelect)">
+                and multi_select = #{record.multiSelect}
+            </if>
+            <if test="record.testTime != null and !&quot;&quot;.equals(record.testTime)">
+                and test_time = #{record.testTime}
+            </if>
+            <if test="record.loginUser != null and !&quot;&quot;.equals(record.loginUser)">
+                and login_user = #{record.loginUser}
+            </if>
+            <if test="record.testcTime != null and !&quot;&quot;.equals(record.testcTime)">
+                and testc_time = #{record.testcTime}
+            </if>
+            <if test="record.testcDate != null and !&quot;&quot;.equals(record.testcDate)">
+                and testc_date = #{record.testcDate}
+            </if>
+            <if test="record.workNumber != null and !&quot;&quot;.equals(record.workNumber)">
+                and work_number = #{record.workNumber}
+            </if>
+            <if test="record.departId != null and !&quot;&quot;.equals(record.departId)">
+                and depart_id = #{record.departId}
+            </if>
+            <if test="record.searchKey != null and !&quot;&quot;.equals(record.searchKey)">
+                <trim prefix="and (" suffix=")" prefixOverrides="OR">
+                    OR image_url LIKE concat('%',#{record.searchKey},'%')
+                    OR test_name LIKE concat('%',#{record.searchKey},'%')
+                    OR remark LIKE concat('%',#{record.searchKey},'%')
+                    OR multi_select LIKE concat('%',#{record.searchKey},'%')
+                    OR login_user LIKE concat('%',#{record.searchKey},'%')
+                    OR work_number LIKE concat('%',#{record.searchKey},'%')
+                    OR depart_id LIKE concat('%',#{record.searchKey},'%')
+                </trim>
+            </if>
+
+            <if test="record.advancedQuery != null and !&quot;&quot;.equals(record.advancedQuery)">
+                <foreach item="item" index="index" collection="record.advancedQuery.split('_;')">
+                    <choose>
+                        <when test="item.indexOf('like') != -1">
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    concat('%',#{itemDetail},'%')
+                                </if>
+
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
+
+                            </foreach>
+                        </when>
+                        <when test="item.indexOf('in') != -1">
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    (${itemDetail})
+                                </if>
+
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
+
+                            </foreach>
+                        </when>
+                        <otherwise>
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    #{itemDetail}
+                                </if>
+
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
+
+                            </foreach>
+                        </otherwise>
+                    </choose>
+
+
+                </foreach>
+
+
+            </if>
+
+        </where>
+        order by
+
+        <if test="record.orderByStr != null and !&quot;&quot;.equals(record.orderByStr)">
+
+
+            <trim suffixOverrides=",">
+                <foreach item="item" index="index" separator="," collection="record.orderByStr.split('_;')">
+                    <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                        ${itemDetail}
+                    </foreach>
+                </foreach>
+            </trim>
+            ,
+        </if>
+        id desc
+    </select>
+    <select id="queryAllTestAaa" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.TestAaa">
+        select
+        <include refid="Base_Column_List"/>
+        from test_aaa
+        <where>
+            and del_flag = 'N'
+            <if test="idStr != null and !&quot;&quot;.equals(idStr)">
+                and id in (${idStr})
+            </if>
+            <if test="id != null and !&quot;&quot;.equals(id)">
+                and id = #{id}
+            </if>
+            <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
+                and del_flag = #{delFlag}
+            </if>
+            <if test="imageUrl != null and !&quot;&quot;.equals(imageUrl)">
+                and image_url = #{imageUrl}
+            </if>
+            <if test="testName != null and !&quot;&quot;.equals(testName)">
+                and test_name = #{testName}
+            </if>
+            <if test="remark != null and !&quot;&quot;.equals(remark)">
+                and remark = #{remark}
+            </if>
+            <if test="multiSelect != null and !&quot;&quot;.equals(multiSelect)">
+                and multi_select = #{multiSelect}
+            </if>
+            <if test="testTime != null and !&quot;&quot;.equals(testTime)">
+                and test_time = #{testTime}
+            </if>
+            <if test="loginUser != null and !&quot;&quot;.equals(loginUser)">
+                and login_user = #{loginUser}
+            </if>
+            <if test="testcTime != null and !&quot;&quot;.equals(testcTime)">
+                and testc_time = #{testcTime}
+            </if>
+            <if test="testcDate != null and !&quot;&quot;.equals(testcDate)">
+                and testc_date = #{testcDate}
+            </if>
+            <if test="workNumber != null and !&quot;&quot;.equals(workNumber)">
+                and work_number = #{workNumber}
+            </if>
+            <if test="departId != null and !&quot;&quot;.equals(departId)">
+                and depart_id = #{departId}
+            </if>
+            <if test="searchKey != null and !&quot;&quot;.equals(searchKey)">
+                <trim prefix="and (" suffix=")" prefixOverrides="OR">
+                    OR image_url LIKE concat('%',#{searchKey},'%')
+                    OR test_name LIKE concat('%',#{searchKey},'%')
+                    OR remark LIKE concat('%',#{searchKey},'%')
+                    OR multi_select LIKE concat('%',#{searchKey},'%')
+                    OR login_user LIKE concat('%',#{searchKey},'%')
+                    OR work_number LIKE concat('%',#{searchKey},'%')
+                    OR depart_id LIKE concat('%',#{searchKey},'%')
+                </trim>
+            </if>
+            <if test="advancedQuery != null and !&quot;&quot;.equals(advancedQuery)">
+                <foreach item="item" index="index" collection="advancedQuery.split('_;')">
+                    <choose>
+                        <when test="item.indexOf('like') != -1">
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    concat('%',#{itemDetail},'%')
+                                </if>
+
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
+
+                            </foreach>
+                        </when>
+                        <when test="item.indexOf('in') != -1">
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    (${itemDetail})
+                                </if>
+
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
+
+                            </foreach>
+                        </when>
+                        <otherwise>
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    #{itemDetail}
+                                </if>
+
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
+
+                            </foreach>
+                        </otherwise>
+                    </choose>
+
+
+                </foreach>
+
+
+            </if>
+        </where>
+        order by
+
+        <if test="orderByStr != null and !&quot;&quot;.equals(orderByStr)">
+
+
+            <trim suffixOverrides=",">
+                <foreach item="item" index="index" separator="," collection="orderByStr.split('_;')">
+                    <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                        ${itemDetail}
+                    </foreach>
+                </foreach>
+            </trim>
+            ,
+        </if>
+
+        id desc
+    </select>
+    <select id="queryTestAaa" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.TestAaa">
+        select
+        <include refid="Base_Column_List"/>
+        from test_aaa
+        <where>
+            and del_flag = 'N'
+            <if test="id != null and !&quot;&quot;.equals(id)">
+                and id = #{id}
+            </if>
+            <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
+                and del_flag = #{delFlag}
+            </if>
+            <if test="imageUrl != null and !&quot;&quot;.equals(imageUrl)">
+                and image_url = #{imageUrl}
+            </if>
+            <if test="testName != null and !&quot;&quot;.equals(testName)">
+                and test_name = #{testName}
+            </if>
+            <if test="remark != null and !&quot;&quot;.equals(remark)">
+                and remark = #{remark}
+            </if>
+            <if test="multiSelect != null and !&quot;&quot;.equals(multiSelect)">
+                and multi_select = #{multiSelect}
+            </if>
+            <if test="testTime != null and !&quot;&quot;.equals(testTime)">
+                and test_time = #{testTime}
+            </if>
+            <if test="loginUser != null and !&quot;&quot;.equals(loginUser)">
+                and login_user = #{loginUser}
+            </if>
+            <if test="testcTime != null and !&quot;&quot;.equals(testcTime)">
+                and testc_time = #{testcTime}
+            </if>
+            <if test="testcDate != null and !&quot;&quot;.equals(testcDate)">
+                and testc_date = #{testcDate}
+            </if>
+            <if test="workNumber != null and !&quot;&quot;.equals(workNumber)">
+                and work_number = #{workNumber}
+            </if>
+            <if test="departId != null and !&quot;&quot;.equals(departId)">
+                and depart_id = #{departId}
+            </if>
+
+        </where>
+        LIMIT 1
+    </select>
+    <update id="delete">
+        UPDATE test_aaa SET del_flag = 'Y'
+        where
+        <if test="id != null and !&quot;&quot;.equals(id)">
+            id = #{id,jdbcType=INTEGER}
+        </if>
+
+        <if test="idStr != null and !&quot;&quot;.equals(idStr)">
+            id in (${idStr})
+        </if>
+    </update>
+    <select id="query" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.TestAaa">
+        select
+        <include refid="Base_Column_List"/>
+        from test_aaa
+        <where>
+            and del_flag = 'N'
+        </where>
+        order by id desc
+    </select>
+</mapper>
+

+ 33 - 0
src/main/java/com/izouma/awesomeadmin/dao/TestBbbCopyMapper.java

@@ -0,0 +1,33 @@
+package com.izouma.awesomeadmin.dao;
+
+import java.util.*;
+import com.izouma.awesomeadmin.datasource.DataSource;
+import org.springframework.stereotype.Repository;
+import com.izouma.awesomeadmin.model.TestBbbCopy;
+
+
+/**
+*  Dao接口
+*/
+@Repository("com.zoumaframe.dao.TestBbbCopyMapper")
+public interface TestBbbCopyMapper{
+
+    int deleteByPrimaryKey(Integer id);
+
+    int insertSelective(TestBbbCopy record);
+
+    TestBbbCopy selectByPrimaryKey(Integer id);
+
+    int updateByPrimaryKeySelective(TestBbbCopy record);
+
+    List<TestBbbCopy> queryAllTestBbbCopy(TestBbbCopy record);
+
+    List<TestBbbCopy> queryTestBbbCopyByPage(Map<String, Object> parameter);
+
+    int delete(String id);
+
+    TestBbbCopy queryTestBbbCopy(TestBbbCopy record);
+
+    List<TestBbbCopy> query(TestBbbCopy record);
+}
+

+ 237 - 0
src/main/java/com/izouma/awesomeadmin/dao/TestBbbCopyMapper.xml

@@ -0,0 +1,237 @@
+<?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.izouma.awesomeadmin.dao.TestBbbCopyMapper" >
+    <resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.TestBbbCopy" >
+                <id column="id" property="id" jdbcType="INTEGER" />
+                                        <result column="del_flag" property="delFlag" jdbcType="CHAR" />
+                                <result column="name_aaa" property="nameAaa" jdbcType="VARCHAR" />
+                                <result column="name_bbb" property="nameBbb" jdbcType="VARCHAR" />
+            </resultMap>
+    <sql id="Base_Column_List" >
+        <trim  suffixOverrides="," >
+            id,
+
+            del_flag,
+
+            name_aaa,
+
+            name_bbb,
+
+            </trim>
+    </sql>
+    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
+        select
+        <include refid="Base_Column_List" />
+        from test_bbb_copy
+        where id = #{id,jdbcType=INTEGER}
+    </select>
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
+        delete from test_bbb_copy
+        where id = #{id,jdbcType=INTEGER}
+    </delete>
+    <insert id="insertSelective" parameterType="com.izouma.awesomeadmin.model.TestBbbCopy" useGeneratedKeys="true" keyProperty="id">
+        insert into test_bbb_copy
+        <trim prefix="(" suffix=")" suffixOverrides="," >
+                <if test="id!= null" >
+                id,
+            </if>
+                <if test="delFlag!= null" >
+                del_flag,
+            </if>
+                <if test="nameAaa!= null" >
+                name_aaa,
+            </if>
+                <if test="nameBbb!= null" >
+                name_bbb,
+            </if>
+            </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides="," >
+                    <if test="id != null" >
+                #{id,jdbcType=INTEGER},
+            </if>
+                    <if test="delFlag != null" >
+                #{delFlag,jdbcType=CHAR},
+            </if>
+                    <if test="nameAaa != null" >
+                #{nameAaa,jdbcType=VARCHAR},
+            </if>
+                    <if test="nameBbb != null" >
+                #{nameBbb,jdbcType=VARCHAR},
+            </if>
+                </trim>
+    </insert>
+    <update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.TestBbbCopy" >
+        update test_bbb_copy
+        <set >
+                    <if test="id != null" >
+               id= #{id,jdbcType=INTEGER},
+            </if>
+                     <if test="delFlag != null" >
+               del_flag= #{delFlag,jdbcType=CHAR},
+            </if>
+                     <if test="nameAaa != null" >
+               name_aaa= #{nameAaa,jdbcType=VARCHAR},
+            </if>
+                     <if test="nameBbb != null" >
+               name_bbb= #{nameBbb,jdbcType=VARCHAR},
+            </if>
+                 </set>
+        where id = #{id,jdbcType=INTEGER}
+    </update>
+    <select id="queryTestBbbCopyByPage" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.TestBbbCopy">
+        select <include refid="Base_Column_List"/> from test_bbb_copy
+        <where>
+            and del_flag = 'N'
+                    <if test="record.id != null and !&quot;&quot;.equals(record.id)">
+                and  id = #{record.id}
+            </if>
+                     <if test="record.delFlag != null and !&quot;&quot;.equals(record.delFlag)">
+                and  del_flag = #{record.delFlag}
+            </if>
+                     <if test="record.nameAaa != null and !&quot;&quot;.equals(record.nameAaa)">
+                and  name_aaa = #{record.nameAaa}
+            </if>
+                     <if test="record.nameBbb != null and !&quot;&quot;.equals(record.nameBbb)">
+                and  name_bbb = #{record.nameBbb}
+            </if>
+                  <if test="record.searchKey != null and !&quot;&quot;.equals(record.searchKey)">
+             <trim prefix="and (" suffix=")" prefixOverrides="OR" >
+                                                                                               OR  del_flag LIKE concat('%',#{record.searchKey},'%')
+                                                                                                    OR  name_aaa LIKE concat('%',#{record.searchKey},'%')
+                                                                                                    OR  name_bbb LIKE concat('%',#{record.searchKey},'%')
+                                                             </trim>
+         </if>
+
+            <if test="record.advancedQuery != null and !&quot;&quot;.equals(record.advancedQuery)">
+                <foreach item="item" index="index" collection="record.advancedQuery.split('_;')">
+                    <choose>
+                        <when test="item.indexOf('like') != -1">
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    concat('%',#{itemDetail},'%')
+                                </if>
+
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
+
+                            </foreach>
+                        </when>
+                        <otherwise>
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    #{itemDetail}
+                                </if>
+
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
+
+                            </foreach>
+                        </otherwise>
+                    </choose>
+
+
+                </foreach>
+
+
+            </if>
+
+        </where>
+        order by id desc
+    </select>
+    <select id="queryAllTestBbbCopy" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.TestBbbCopy">
+        select <include refid="Base_Column_List"/> from test_bbb_copy
+        <where>
+            and del_flag = 'N'
+                    <if test="id != null and !&quot;&quot;.equals(id)">
+                and  id = #{id}
+            </if>
+                    <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
+                and  del_flag = #{delFlag}
+            </if>
+                    <if test="nameAaa != null and !&quot;&quot;.equals(nameAaa)">
+                and  name_aaa = #{nameAaa}
+            </if>
+                    <if test="nameBbb != null and !&quot;&quot;.equals(nameBbb)">
+                and  name_bbb = #{nameBbb}
+            </if>
+                    <if test="searchKey != null and !&quot;&quot;.equals(searchKey)">
+                <trim prefix="and (" suffix=")" prefixOverrides="OR" >
+                                                                                                                                                OR  del_flag LIKE concat('%',#{searchKey},'%')
+                                                                                                                                                        OR  name_aaa LIKE concat('%',#{searchKey},'%')
+                                                                                                                                                        OR  name_bbb LIKE concat('%',#{searchKey},'%')
+                                                                                        </trim>
+            </if>
+<if test="advancedQuery != null and !&quot;&quot;.equals(advancedQuery)">
+    <foreach item="item" index="index" collection="advancedQuery.split('_;')">
+        <choose>
+            <when test="item.indexOf('like') != -1">
+                <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                    <if test="detailIndex == 3">
+                        concat('%',#{itemDetail},'%')
+                    </if>
+
+                    <if test="detailIndex &lt; 3">
+                        ${itemDetail}
+                    </if>
+
+                </foreach>
+            </when>
+            <otherwise>
+                <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                    <if test="detailIndex == 3">
+                        #{itemDetail}
+                    </if>
+
+                    <if test="detailIndex &lt; 3">
+                        ${itemDetail}
+                    </if>
+
+                </foreach>
+            </otherwise>
+        </choose>
+
+
+    </foreach>
+
+
+</if>
+        </where>
+        order by id desc
+    </select>
+    <select id="queryTestBbbCopy" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.TestBbbCopy">
+        select <include refid="Base_Column_List"/> from test_bbb_copy
+        <where>
+            and del_flag = 'N'
+                    <if test="id != null and !&quot;&quot;.equals(id)">
+                and id = #{id}
+            </if>
+                     <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
+                and del_flag = #{delFlag}
+            </if>
+                     <if test="nameAaa != null and !&quot;&quot;.equals(nameAaa)">
+                and name_aaa = #{nameAaa}
+            </if>
+                     <if test="nameBbb != null and !&quot;&quot;.equals(nameBbb)">
+                and name_bbb = #{nameBbb}
+            </if>
+         
+        </where>
+        LIMIT 1
+    </select>
+    <update id="delete">
+        UPDATE test_bbb_copy SET del_flag = 'Y'
+        <where>
+            AND id = #{id}
+        </where>
+    </update>
+    <select id="query" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.TestBbbCopy">
+        select <include refid="Base_Column_List"/> from test_bbb_copy
+        <where>
+            and del_flag = 'N'
+                                                                                                                                    </where>
+        order by id desc
+    </select>
+</mapper>
+

+ 33 - 0
src/main/java/com/izouma/awesomeadmin/dao/TestBbbMapper.java

@@ -0,0 +1,33 @@
+package com.izouma.awesomeadmin.dao;
+
+import java.util.*;
+import com.izouma.awesomeadmin.datasource.DataSource;
+import org.springframework.stereotype.Repository;
+import com.izouma.awesomeadmin.model.TestBbb;
+
+
+/**
+*  Dao接口
+*/
+@Repository("com.zoumaframe.dao.TestBbbMapper")
+public interface TestBbbMapper{
+
+    int deleteByPrimaryKey(Integer id);
+
+    int insertSelective(TestBbb record);
+
+    TestBbb selectByPrimaryKey(Integer id);
+
+    int updateByPrimaryKeySelective(TestBbb record);
+
+    List<TestBbb> queryAllTestBbb(TestBbb record);
+
+    List<TestBbb> queryTestBbbByPage(Map<String, Object> parameter);
+
+    int delete(TestBbb record);
+
+    TestBbb queryTestBbb(TestBbb record);
+
+    List<TestBbb> query(TestBbb record);
+}
+

+ 306 - 0
src/main/java/com/izouma/awesomeadmin/dao/TestBbbMapper.xml

@@ -0,0 +1,306 @@
+<?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.izouma.awesomeadmin.dao.TestBbbMapper" >
+    <resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.TestBbb" >
+                <id column="id" property="id" jdbcType="INTEGER" />
+                                        <result column="del_flag" property="delFlag" jdbcType="CHAR" />
+                                <result column="name_aaa" property="nameAaa" jdbcType="VARCHAR" />
+                                <result column="name_bbb" property="nameBbb" jdbcType="VARCHAR" />
+                                <result column="name_ccc" property="nameCcc" jdbcType="VARCHAR" />
+                                <result column="name_ddd" property="nameDdd" jdbcType="VARCHAR" />
+            </resultMap>
+    <sql id="Base_Column_List" >
+        id, del_flag, name_aaa, name_bbb, name_ccc, name_ddd    </sql>
+    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
+        select
+        <include refid="Base_Column_List" />
+        from test_bbb
+        where id = #{id,jdbcType=INTEGER}
+    </select>
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
+        delete from test_bbb
+        where id = #{id,jdbcType=INTEGER}
+    </delete>
+    <insert id="insertSelective" parameterType="com.izouma.awesomeadmin.model.TestBbb" useGeneratedKeys="true" keyProperty="id">
+        insert into test_bbb
+        <trim prefix="(" suffix=")" suffixOverrides="," >
+                <if test="id!= null" >
+                id,
+            </if>
+                <if test="delFlag!= null" >
+                del_flag,
+            </if>
+                <if test="nameAaa!= null" >
+                name_aaa,
+            </if>
+                <if test="nameBbb!= null" >
+                name_bbb,
+            </if>
+                <if test="nameCcc!= null" >
+                name_ccc,
+            </if>
+                <if test="nameDdd!= null" >
+                name_ddd,
+            </if>
+            </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides="," >
+                    <if test="id != null" >
+                #{id,jdbcType=INTEGER},
+            </if>
+                    <if test="delFlag != null" >
+                #{delFlag,jdbcType=CHAR},
+            </if>
+                    <if test="nameAaa != null" >
+                #{nameAaa,jdbcType=VARCHAR},
+            </if>
+                    <if test="nameBbb != null" >
+                #{nameBbb,jdbcType=VARCHAR},
+            </if>
+                    <if test="nameCcc != null" >
+                #{nameCcc,jdbcType=VARCHAR},
+            </if>
+                    <if test="nameDdd != null" >
+                #{nameDdd,jdbcType=VARCHAR},
+            </if>
+                </trim>
+    </insert>
+    <update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.TestBbb" >
+        update test_bbb
+        <set >
+                    <if test="id != null" >
+               id= #{id,jdbcType=INTEGER},
+            </if>
+                     <if test="delFlag != null" >
+               del_flag= #{delFlag,jdbcType=CHAR},
+            </if>
+                     <if test="nameAaa != null" >
+               name_aaa= #{nameAaa,jdbcType=VARCHAR},
+            </if>
+                     <if test="nameBbb != null" >
+               name_bbb= #{nameBbb,jdbcType=VARCHAR},
+            </if>
+                     <if test="nameCcc != null" >
+               name_ccc= #{nameCcc,jdbcType=VARCHAR},
+            </if>
+                     <if test="nameDdd != null" >
+               name_ddd= #{nameDdd,jdbcType=VARCHAR},
+            </if>
+                 </set>
+        where
+        <if test="id != null and !&quot;&quot;.equals(id)">
+            id = #{id,jdbcType=INTEGER}
+        </if>
+
+        <if test="idStr != null and !&quot;&quot;.equals(idStr)">
+            id in (${idStr})
+        </if>
+    </update>
+    <select id="queryTestBbbByPage" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.TestBbb">
+        select <include refid="Base_Column_List"/> from test_bbb
+        <where>
+            and del_flag = 'N'
+            <if test="record.idStr != null and !&quot;&quot;.equals(record.idStr)">
+                and id in (${record.idStr})
+            </if>
+                    <if test="record.id != null and !&quot;&quot;.equals(record.id)">
+                and  id = #{record.id}
+            </if>
+                     <if test="record.delFlag != null and !&quot;&quot;.equals(record.delFlag)">
+                and  del_flag = #{record.delFlag}
+            </if>
+                     <if test="record.nameAaa != null and !&quot;&quot;.equals(record.nameAaa)">
+                and  name_aaa = #{record.nameAaa}
+            </if>
+                     <if test="record.nameBbb != null and !&quot;&quot;.equals(record.nameBbb)">
+                and  name_bbb = #{record.nameBbb}
+            </if>
+                     <if test="record.nameCcc != null and !&quot;&quot;.equals(record.nameCcc)">
+                and  name_ccc = #{record.nameCcc}
+            </if>
+                     <if test="record.nameDdd != null and !&quot;&quot;.equals(record.nameDdd)">
+                and  name_ddd = #{record.nameDdd}
+            </if>
+                  <if test="record.searchKey != null and !&quot;&quot;.equals(record.searchKey)">
+             <trim prefix="and (" suffix=")" prefixOverrides="OR" >
+                                                                                                                                                                                                                                                                                                                                                                                             </trim>
+         </if>
+
+            <if test="record.advancedQuery != null and !&quot;&quot;.equals(record.advancedQuery)">
+                <foreach item="item" index="index" collection="record.advancedQuery.split('_;')">
+                    <choose>
+                        <when test="item.indexOf('like') != -1">
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    concat('%',#{itemDetail},'%')
+                                </if>
+
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
+
+                            </foreach>
+                        </when>
+                        <otherwise>
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    #{itemDetail}
+                                </if>
+
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
+
+                            </foreach>
+                        </otherwise>
+                    </choose>
+
+
+                </foreach>
+
+
+            </if>
+
+        </where>
+        order by
+
+        <if test="record.orderByStr != null and !&quot;&quot;.equals(record.orderByStr)">
+
+
+            <trim suffixOverrides=",">
+                <foreach item="item" index="index" separator="," collection="record.orderByStr.split('_;')">
+                    <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                        ${itemDetail}
+                    </foreach>
+                </foreach>
+            </trim>
+            ,
+        </if>
+        id desc
+    </select>
+    <select id="queryAllTestBbb" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.TestBbb">
+        select <include refid="Base_Column_List"/> from test_bbb
+        <where>
+            and del_flag = 'N'
+            <if test="idStr != null and !&quot;&quot;.equals(idStr)">
+                and id in (${idStr})
+            </if>
+                    <if test="id != null and !&quot;&quot;.equals(id)">
+                and  id = #{id}
+            </if>
+                    <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
+                and  del_flag = #{delFlag}
+            </if>
+                    <if test="nameAaa != null and !&quot;&quot;.equals(nameAaa)">
+                and  name_aaa = #{nameAaa}
+            </if>
+                    <if test="nameBbb != null and !&quot;&quot;.equals(nameBbb)">
+                and  name_bbb = #{nameBbb}
+            </if>
+                    <if test="nameCcc != null and !&quot;&quot;.equals(nameCcc)">
+                and  name_ccc = #{nameCcc}
+            </if>
+                    <if test="nameDdd != null and !&quot;&quot;.equals(nameDdd)">
+                and  name_ddd = #{nameDdd}
+            </if>
+                    <if test="searchKey != null and !&quot;&quot;.equals(searchKey)">
+                <trim prefix="and (" suffix=")" prefixOverrides="OR" >
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                </trim>
+            </if>
+<if test="advancedQuery != null and !&quot;&quot;.equals(advancedQuery)">
+    <foreach item="item" index="index" collection="advancedQuery.split('_;')">
+        <choose>
+            <when test="item.indexOf('like') != -1">
+                <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                    <if test="detailIndex == 3">
+                        concat('%',#{itemDetail},'%')
+                    </if>
+
+                    <if test="detailIndex &lt; 3">
+                        ${itemDetail}
+                    </if>
+
+                </foreach>
+            </when>
+            <otherwise>
+                <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                    <if test="detailIndex == 3">
+                        #{itemDetail}
+                    </if>
+
+                    <if test="detailIndex &lt; 3">
+                        ${itemDetail}
+                    </if>
+
+                </foreach>
+            </otherwise>
+        </choose>
+
+
+    </foreach>
+
+
+</if>
+        </where>
+        order by
+
+        <if test="orderByStr != null and !&quot;&quot;.equals(orderByStr)">
+
+
+            <trim suffixOverrides=",">
+                <foreach item="item" index="index" separator="," collection="orderByStr.split('_;')">
+                    <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                        ${itemDetail}
+                    </foreach>
+                </foreach>
+            </trim>
+            ,
+        </if>
+
+        id desc
+    </select>
+    <select id="queryTestBbb" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.TestBbb">
+        select <include refid="Base_Column_List"/> from test_bbb
+        <where>
+            and del_flag = 'N'
+                    <if test="id != null and !&quot;&quot;.equals(id)">
+                and id = #{id}
+            </if>
+                     <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
+                and del_flag = #{delFlag}
+            </if>
+                     <if test="nameAaa != null and !&quot;&quot;.equals(nameAaa)">
+                and name_aaa = #{nameAaa}
+            </if>
+                     <if test="nameBbb != null and !&quot;&quot;.equals(nameBbb)">
+                and name_bbb = #{nameBbb}
+            </if>
+                     <if test="nameCcc != null and !&quot;&quot;.equals(nameCcc)">
+                and name_ccc = #{nameCcc}
+            </if>
+                     <if test="nameDdd != null and !&quot;&quot;.equals(nameDdd)">
+                and name_ddd = #{nameDdd}
+            </if>
+         
+        </where>
+        LIMIT 1
+    </select>
+    <update id="delete">
+        UPDATE test_bbb SET del_flag = 'Y'
+        where
+        <if test="id != null and !&quot;&quot;.equals(id)">
+            id = #{id,jdbcType=INTEGER}
+        </if>
+
+        <if test="idStr != null and !&quot;&quot;.equals(idStr)">
+            id in (${idStr})
+        </if>
+    </update>
+    <select id="query" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.TestBbb">
+        select <include refid="Base_Column_List"/> from test_bbb
+        <where>
+            and del_flag = 'N'
+                                                                                                                                                                                            </where>
+        order by id desc
+    </select>
+</mapper>
+

+ 34 - 0
src/main/java/com/izouma/awesomeadmin/dao/TestCaidanMapper.java

@@ -0,0 +1,34 @@
+package com.izouma.awesomeadmin.dao;
+
+import java.util.*;
+import com.izouma.awesomeadmin.datasource.DataSource;
+import org.springframework.stereotype.Repository;
+import com.izouma.awesomeadmin.model.TestCaidan;
+
+
+/**
+*  Dao接口
+*/
+@DataSource("dataSourceSqlserver")
+@Repository("com.zoumaframe.dao.TestCaidanMapper")
+public interface TestCaidanMapper{
+
+    int deleteByPrimaryKey(Integer id);
+
+    int insertSelective(TestCaidan record);
+
+    TestCaidan selectByPrimaryKey(Integer id);
+
+    int updateByPrimaryKeySelective(TestCaidan record);
+
+    List<TestCaidan> queryAllTestCaidan(TestCaidan record);
+
+    List<TestCaidan> queryTestCaidanByPage(Map<String, Object> parameter);
+
+    int delete(String id);
+
+    TestCaidan queryTestCaidan(TestCaidan record);
+
+    List<TestCaidan> query(TestCaidan record);
+}
+

+ 288 - 0
src/main/java/com/izouma/awesomeadmin/dao/TestCaidanMapper.xml

@@ -0,0 +1,288 @@
+<?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.izouma.awesomeadmin.dao.TestCaidanMapper">
+    <resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.TestCaidan">
+        <result column="SequenceID" property="sequenceid" jdbcType="INTEGER"/>
+        <result column="CaiDanXiangMing" property="caidanxiangming" jdbcType="VARCHAR"/>
+        <result column="CaiDanCiXu" property="caidancixu" jdbcType="SMALLINT"/>
+        <result column="URL" property="url" jdbcType="VARCHAR"/>
+        <result column="CaiDanShuoMing" property="caidanshuoming" jdbcType="VARCHAR"/>
+        <result column="ChuFaTiaoJian" property="chufatiaojian" jdbcType="VARCHAR"/>
+    </resultMap>
+    <sql id="Base_Column_List">
+        SequenceID, ID, CaiDanXiangMing, CaiDanCiXu, URL, CaiDanShuoMing, ChuFaTiaoJian            </sql>
+    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer">
+        select
+        <include refid="Base_Column_List"/>
+        from CaiDan_Table
+        where id = #{id,jdbcType=INTEGER}
+    </select>
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
+        delete
+        from CaiDan_Table
+        where id = #{id,jdbcType=INTEGER}
+    </delete>
+    <insert id="insertSelective" parameterType="com.izouma.awesomeadmin.model.TestCaidan"
+            useGeneratedKeys="true" keyProperty="id">
+        insert into CaiDan_Table
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="sequenceid!= null">
+                SequenceID,
+            </if>
+            <if test="caidanxiangming!= null">
+                CaiDanXiangMing,
+            </if>
+            <if test="caidancixu!= null">
+                CaiDanCiXu,
+            </if>
+            <if test="url!= null">
+                URL,
+            </if>
+            <if test="caidanshuoming!= null">
+                CaiDanShuoMing,
+            </if>
+            <if test="chufatiaojian!= null">
+                ChuFaTiaoJian,
+            </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="sequenceid != null">
+                #{sequenceid,jdbcType=INTEGER},
+            </if>
+            <if test="caidanxiangming != null">
+                #{caidanxiangming,jdbcType=VARCHAR},
+            </if>
+            <if test="caidancixu != null">
+                #{caidancixu,jdbcType=SMALLINT},
+            </if>
+            <if test="url != null">
+                #{url,jdbcType=VARCHAR},
+            </if>
+            <if test="caidanshuoming != null">
+                #{caidanshuoming,jdbcType=VARCHAR},
+            </if>
+            <if test="chufatiaojian != null">
+                #{chufatiaojian,jdbcType=VARCHAR},
+            </if>
+        </trim>
+    </insert>
+    <update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.TestCaidan">
+        update CaiDan_Table
+        <set>
+            <if test="sequenceid != null">
+                SequenceID= #{sequenceid,jdbcType=INTEGER},
+            </if>
+            <if test="caidanxiangming != null">
+                CaiDanXiangMing= #{caidanxiangming,jdbcType=VARCHAR},
+            </if>
+            <if test="caidancixu != null">
+                CaiDanCiXu= #{caidancixu,jdbcType=SMALLINT},
+            </if>
+            <if test="url != null">
+                URL= #{url,jdbcType=VARCHAR},
+            </if>
+            <if test="caidanshuoming != null">
+                CaiDanShuoMing= #{caidanshuoming,jdbcType=VARCHAR},
+            </if>
+            <if test="chufatiaojian != null">
+                ChuFaTiaoJian= #{chufatiaojian,jdbcType=VARCHAR},
+            </if>
+        </set>
+        where id = #{id,jdbcType=INTEGER}
+    </update>
+    <select id="queryTestCaidanByPage" parameterType="java.util.Map"
+            resultType="com.izouma.awesomeadmin.model.TestCaidan">
+        select
+        <include refid="Base_Column_List"/>
+        from CaiDan_Table
+        <where>
+            and 1 = 1
+            <if test="record.sequenceid != null and !&quot;&quot;.equals(record.sequenceid)">
+                and SequenceID = #{record.sequenceid}
+            </if>
+            <if test="record.id != null and !&quot;&quot;.equals(record.id)">
+                and ID = #{record.id}
+            </if>
+            <if test="record.caidanxiangming != null and !&quot;&quot;.equals(record.caidanxiangming)">
+                and CaiDanXiangMing = #{record.caidanxiangming}
+            </if>
+            <if test="record.caidancixu != null and !&quot;&quot;.equals(record.caidancixu)">
+                and CaiDanCiXu = #{record.caidancixu}
+            </if>
+            <if test="record.url != null and !&quot;&quot;.equals(record.url)">
+                and URL = #{record.url}
+            </if>
+            <if test="record.caidanshuoming != null and !&quot;&quot;.equals(record.caidanshuoming)">
+                and CaiDanShuoMing = #{record.caidanshuoming}
+            </if>
+            <if test="record.chufatiaojian != null and !&quot;&quot;.equals(record.chufatiaojian)">
+                and ChuFaTiaoJian = #{record.chufatiaojian}
+            </if>
+
+            <if test="record.searchKey != null and !&quot;&quot;.equals(record.searchKey)">
+                <trim prefix="and (" suffix=")" prefixOverrides="OR">
+                    OR CaiDanXiangMing LIKE concat('%',#{record.searchKey},'%')
+                    OR URL LIKE concat('%',#{record.searchKey},'%')
+                    OR CaiDanShuoMing LIKE concat('%',#{record.searchKey},'%')
+                    OR ChuFaTiaoJian LIKE concat('%',#{record.searchKey},'%')
+                </trim>
+            </if>
+            <if test="record.advancedQuery != null and !&quot;&quot;.equals(record.advancedQuery)">
+                <foreach item="item" index="index" collection="record.advancedQuery.split('_;')">
+                    <choose>
+                        <when test="item.indexOf('like') != -1">
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    concat('%',#{itemDetail},'%')
+                                </if>
+
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
+
+                            </foreach>
+                        </when>
+                        <otherwise>
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    #{itemDetail}
+                                </if>
+
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
+
+                            </foreach>
+                        </otherwise>
+                    </choose>
+
+
+                </foreach>
+
+
+            </if>
+        </where>
+        order by id desc
+    </select>
+    <select id="queryAllTestCaidan" parameterType="java.util.Map"
+            resultType="com.izouma.awesomeadmin.model.TestCaidan">
+        select
+        <include refid="Base_Column_List"/>
+        from CaiDan_Table
+        <where>
+            and 1 = 1
+            <if test="sequenceid != null and !&quot;&quot;.equals(sequenceid)">
+                and SequenceID = #{sequenceid}
+            </if>
+            <if test="id != null and !&quot;&quot;.equals(id)">
+                and ID = #{id}
+            </if>
+            <if test="caidanxiangming != null and !&quot;&quot;.equals(caidanxiangming)">
+                and CaiDanXiangMing = #{caidanxiangming}
+            </if>
+            <if test="caidancixu != null and !&quot;&quot;.equals(caidancixu)">
+                and CaiDanCiXu = #{caidancixu}
+            </if>
+            <if test="url != null and !&quot;&quot;.equals(url)">
+                and URL = #{url}
+            </if>
+            <if test="caidanshuoming != null and !&quot;&quot;.equals(caidanshuoming)">
+                and CaiDanShuoMing = #{caidanshuoming}
+            </if>
+            <if test="chufatiaojian != null and !&quot;&quot;.equals(chufatiaojian)">
+                and ChuFaTiaoJian = #{chufatiaojian}
+            </if>
+
+            <if test="searchKey != null and !&quot;&quot;.equals(searchKey)">
+                <trim prefix="and (" suffix=")" prefixOverrides="OR">
+                    OR CaiDanXiangMing LIKE concat('%',#{searchKey},'%')
+                    OR URL LIKE concat('%',#{searchKey},'%')
+                    OR CaiDanShuoMing LIKE concat('%',#{searchKey},'%')
+                    OR ChuFaTiaoJian LIKE concat('%',#{searchKey},'%')
+                </trim>
+            </if>
+            <if test="advancedQuery != null and !&quot;&quot;.equals(advancedQuery)">
+                <foreach item="item" index="index" collection="advancedQuery.split('_;')">
+                    <choose>
+                        <when test="item.indexOf('like') != -1">
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    concat('%',#{itemDetail},'%')
+                                </if>
+
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
+
+                            </foreach>
+                        </when>
+                        <otherwise>
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    #{itemDetail}
+                                </if>
+
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
+
+                            </foreach>
+                        </otherwise>
+                    </choose>
+
+
+                </foreach>
+
+
+            </if>
+        </where>
+        order by id desc
+    </select>
+    <select id="queryTestCaidan" parameterType="java.util.Map"
+            resultType="com.izouma.awesomeadmin.model.TestCaidan">
+        select top 1
+        <include refid="Base_Column_List"/>
+        from CaiDan_Table
+        <where>
+            and 1 = 1
+            <if test="sequenceid != null and !&quot;&quot;.equals(sequenceid)">
+                and SequenceID = #{sequenceid}
+            </if>
+            <if test="id != null and !&quot;&quot;.equals(id)">
+                and ID = #{id}
+            </if>
+            <if test="caidanxiangming != null and !&quot;&quot;.equals(caidanxiangming)">
+                and CaiDanXiangMing = #{caidanxiangming}
+            </if>
+            <if test="caidancixu != null and !&quot;&quot;.equals(caidancixu)">
+                and CaiDanCiXu = #{caidancixu}
+            </if>
+            <if test="url != null and !&quot;&quot;.equals(url)">
+                and URL = #{url}
+            </if>
+            <if test="caidanshuoming != null and !&quot;&quot;.equals(caidanshuoming)">
+                and CaiDanShuoMing = #{caidanshuoming}
+            </if>
+            <if test="chufatiaojian != null and !&quot;&quot;.equals(chufatiaojian)">
+                and ChuFaTiaoJian = #{chufatiaojian}
+            </if>
+
+        </where>
+    </select>
+    <delete id="delete">
+        delete
+        from CaiDan_Table
+        where id = #{id,jdbcType=INTEGER}
+    </delete>
+
+    <select id="query" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.TestCaidan">
+        select
+        <include refid="Base_Column_List"/>
+        from CaiDan_Table
+        <where>
+            and 1 = 1
+        </where>
+        order by id desc
+    </select>
+</mapper>
+

+ 33 - 0
src/main/java/com/izouma/awesomeadmin/dao/TestDeployMapper.java

@@ -0,0 +1,33 @@
+package com.izouma.awesomeadmin.dao;
+
+import java.util.*;
+import com.izouma.awesomeadmin.datasource.DataSource;
+import org.springframework.stereotype.Repository;
+import com.izouma.awesomeadmin.model.TestDeploy;
+
+
+/**
+*  Dao接口
+*/
+@Repository("com.zoumaframe.dao.TestDeployMapper")
+public interface TestDeployMapper{
+
+    int deleteByPrimaryKey(Integer id);
+
+    int insertSelective(TestDeploy record);
+
+    TestDeploy selectByPrimaryKey(Integer id);
+
+    int updateByPrimaryKeySelective(TestDeploy record);
+
+    List<TestDeploy> queryAllTestDeploy(TestDeploy record);
+
+    List<TestDeploy> queryTestDeployByPage(Map<String, Object> parameter);
+
+    int delete(String id);
+
+    TestDeploy queryTestDeploy(TestDeploy record);
+
+    List<TestDeploy> query(TestDeploy record);
+}
+

+ 212 - 0
src/main/java/com/izouma/awesomeadmin/dao/TestDeployMapper.xml

@@ -0,0 +1,212 @@
+<?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.izouma.awesomeadmin.dao.TestDeployMapper" >
+    <resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.TestDeploy" >
+        <id column="id" property="id" jdbcType="INTEGER" />
+        <result column="del_flag" property="delFlag" jdbcType="CHAR" />
+        <result column="name" property="name" jdbcType="VARCHAR" />
+    </resultMap>
+    <sql id="Base_Column_List" >
+        <trim  suffixOverrides="," >
+        id,
+
+        del_flag,
+
+        name,
+
+        </trim>
+    </sql>
+    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
+        select
+        <include refid="Base_Column_List" />
+        from test_deploy
+        where id = #{id,jdbcType=INTEGER}
+    </select>
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
+        delete from test_deploy
+        where id = #{id,jdbcType=INTEGER}
+    </delete>
+    <insert id="insertSelective" parameterType="com.izouma.awesomeadmin.model.TestDeploy" useGeneratedKeys="true" keyProperty="id">
+        insert into test_deploy
+        <trim prefix="(" suffix=")" suffixOverrides="," >
+            <if test="id!= null" >
+                id,
+            </if>
+            <if test="delFlag!= null" >
+                del_flag,
+            </if>
+            <if test="name!= null" >
+                name,
+            </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides="," >
+            <if test="id != null" >
+                #{id,jdbcType=INTEGER},
+            </if>
+            <if test="delFlag != null" >
+                #{delFlag,jdbcType=CHAR},
+            </if>
+            <if test="name != null" >
+                #{name,jdbcType=VARCHAR},
+            </if>
+        </trim>
+    </insert>
+    <update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.TestDeploy" >
+        update test_deploy
+        <set >
+            <if test="id != null" >
+               id= #{id,jdbcType=INTEGER},
+            </if>
+            <if test="delFlag != null" >
+               del_flag= #{delFlag,jdbcType=CHAR},
+            </if>
+            <if test="name != null" >
+               name= #{name,jdbcType=VARCHAR},
+            </if>
+        </set>
+        where id = #{id,jdbcType=INTEGER}
+    </update>
+    <select id="queryTestDeployByPage" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.TestDeploy">
+        select <include refid="Base_Column_List"/> from test_deploy
+        <where>
+            and del_flag = 'N'
+            <if test="record.id != null and !&quot;&quot;.equals(record.id)">
+                and  id = #{record.id}
+            </if>
+            <if test="record.delFlag != null and !&quot;&quot;.equals(record.delFlag)">
+                and  del_flag = #{record.delFlag}
+            </if>
+            <if test="record.name != null and !&quot;&quot;.equals(record.name)">
+                and  name = #{record.name}
+            </if>
+         <if test="record.searchKey != null and !&quot;&quot;.equals(record.searchKey)">
+             <trim prefix="and (" suffix=")" prefixOverrides="OR" >
+                 OR  name LIKE concat('%',#{record.searchKey},'%')
+             </trim>
+         </if>
+
+            <if test="record.advancedQuery != null and !&quot;&quot;.equals(record.advancedQuery)">
+                <foreach item="item" index="index" collection="record.advancedQuery.split('_;')">
+                    <choose>
+                        <when test="item.indexOf('like') != -1">
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    concat('%',#{itemDetail},'%')
+                                </if>
+
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
+
+                            </foreach>
+                        </when>
+                        <otherwise>
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    #{itemDetail}
+                                </if>
+
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
+
+                            </foreach>
+                        </otherwise>
+                    </choose>
+
+
+                </foreach>
+
+
+            </if>
+
+        </where>
+        order by id desc
+    </select>
+    <select id="queryAllTestDeploy" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.TestDeploy">
+        select <include refid="Base_Column_List"/> from test_deploy
+        <where>
+            and del_flag = 'N'
+            <if test="id != null and !&quot;&quot;.equals(id)">
+                and  id = #{id}
+            </if>
+            <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
+                and  del_flag = #{delFlag}
+            </if>
+            <if test="name != null and !&quot;&quot;.equals(name)">
+                and  name = #{name}
+            </if>
+            <if test="searchKey != null and !&quot;&quot;.equals(searchKey)">
+                <trim prefix="and (" suffix=")" prefixOverrides="OR" >
+                            OR  name LIKE concat('%',#{searchKey},'%')
+                </trim>
+            </if>
+<if test="advancedQuery != null and !&quot;&quot;.equals(advancedQuery)">
+    <foreach item="item" index="index" collection="advancedQuery.split('_;')">
+        <choose>
+            <when test="item.indexOf('like') != -1">
+                <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                    <if test="detailIndex == 3">
+                        concat('%',#{itemDetail},'%')
+                    </if>
+
+                    <if test="detailIndex &lt; 3">
+                        ${itemDetail}
+                    </if>
+
+                </foreach>
+            </when>
+            <otherwise>
+                <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                    <if test="detailIndex == 3">
+                        #{itemDetail}
+                    </if>
+
+                    <if test="detailIndex &lt; 3">
+                        ${itemDetail}
+                    </if>
+
+                </foreach>
+            </otherwise>
+        </choose>
+
+
+    </foreach>
+
+
+</if>
+        </where>
+        order by id desc
+    </select>
+    <select id="queryTestDeploy" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.TestDeploy">
+        select <include refid="Base_Column_List"/> from test_deploy
+        <where>
+            and del_flag = 'N'
+            <if test="id != null and !&quot;&quot;.equals(id)">
+                and id = #{id}
+            </if>
+            <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
+                and del_flag = #{delFlag}
+            </if>
+            <if test="name != null and !&quot;&quot;.equals(name)">
+                and name = #{name}
+            </if>
+
+        </where>
+        LIMIT 1
+    </select>
+    <update id="delete">
+        UPDATE test_deploy SET del_flag = 'Y'
+        <where>
+            AND id = #{id}
+        </where>
+    </update>
+    <select id="query" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.TestDeploy">
+        select <include refid="Base_Column_List"/> from test_deploy
+        <where>
+            and del_flag = 'N'
+        </where>
+        order by id desc
+    </select>
+</mapper>
+

+ 34 - 0
src/main/java/com/izouma/awesomeadmin/dao/TestSqlserverAaaMapper.java

@@ -0,0 +1,34 @@
+package com.izouma.awesomeadmin.dao;
+
+import java.util.*;
+import com.izouma.awesomeadmin.datasource.DataSource;
+import org.springframework.stereotype.Repository;
+import com.izouma.awesomeadmin.model.TestSqlserverAaa;
+
+
+/**
+*  Dao接口
+*/
+@DataSource("dataSourceSqlserver")
+@Repository("com.zoumaframe.dao.TestSqlserverAaaMapper")
+public interface TestSqlserverAaaMapper{
+
+    int deleteByPrimaryKey(Integer id);
+
+    int insertSelective(TestSqlserverAaa record);
+
+    TestSqlserverAaa selectByPrimaryKey(Integer id);
+
+    int updateByPrimaryKeySelective(TestSqlserverAaa record);
+
+    List<TestSqlserverAaa> queryAllTestSqlserverAaa(TestSqlserverAaa record);
+
+    List<TestSqlserverAaa> queryTestSqlserverAaaByPage(Map<String, Object> parameter);
+
+    int delete(String id);
+
+    TestSqlserverAaa queryTestSqlserverAaa(TestSqlserverAaa record);
+
+    List<TestSqlserverAaa> query(TestSqlserverAaa record);
+}
+

+ 228 - 0
src/main/java/com/izouma/awesomeadmin/dao/TestSqlserverAaaMapper.xml

@@ -0,0 +1,228 @@
+<?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.izouma.awesomeadmin.dao.TestSqlserverAaaMapper">
+    <resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.TestSqlserverAaa">
+                                    <id column="id" property="id" jdbcType="INTEGER"/>
+                                                                        <result column="del_flag" property="delFlag" jdbcType="CHAR"/>
+                                                            <result column="name_aaa" property="nameAaa" jdbcType="VARCHAR"/>
+                                                            <result column="name_bbb" property="nameBbb" jdbcType="VARCHAR"/>
+                        </resultMap>
+    <sql id="Base_Column_List">
+                    id,                    del_flag,                    name_aaa,                    name_bbb            </sql>
+    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer">
+        select
+        <include refid="Base_Column_List"/>
+        from test_sqlserver_aaa
+        where id = #{id,jdbcType=INTEGER}
+    </select>
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
+        delete from test_sqlserver_aaa
+        where id = #{id,jdbcType=INTEGER}
+    </delete>
+    <insert id="insertSelective" parameterType="com.izouma.awesomeadmin.model.TestSqlserverAaa"
+            useGeneratedKeys="true" keyProperty="id">
+        insert into test_sqlserver_aaa
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+                                                                            <if test="delFlag!= null">
+                        del_flag,
+                    </if>
+                                                                <if test="nameAaa!= null">
+                        name_aaa,
+                    </if>
+                                                                <if test="nameBbb!= null">
+                        name_bbb,
+                    </if>
+                                    </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+                                                                            <if test="delFlag != null">
+                        #{delFlag,jdbcType=CHAR},
+                    </if>
+                                                                <if test="nameAaa != null">
+                        #{nameAaa,jdbcType=VARCHAR},
+                    </if>
+                                                                <if test="nameBbb != null">
+                        #{nameBbb,jdbcType=VARCHAR},
+                    </if>
+                                    </trim>
+    </insert>
+    <update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.TestSqlserverAaa">
+        update test_sqlserver_aaa
+        <set>
+                                                                            <if test="delFlag != null">
+                        del_flag= #{delFlag,jdbcType=CHAR},
+                    </if>
+                                                                <if test="nameAaa != null">
+                        name_aaa= #{nameAaa,jdbcType=VARCHAR},
+                    </if>
+                                                                <if test="nameBbb != null">
+                        name_bbb= #{nameBbb,jdbcType=VARCHAR},
+                    </if>
+                                    </set>
+        where id = #{id,jdbcType=INTEGER}
+    </update>
+    <select id="queryTestSqlserverAaaByPage" parameterType="java.util.Map"
+            resultType="com.izouma.awesomeadmin.model.TestSqlserverAaa">
+        select
+        <include refid="Base_Column_List"/>
+        from test_sqlserver_aaa
+        <where>
+            and 1 = 1
+                            <if test="record.id != null and !&quot;&quot;.equals(record.id)">
+                    and  id = #{record.id}
+                </if>
+                            <if test="record.delFlag != null and !&quot;&quot;.equals(record.delFlag)">
+                    and  del_flag = #{record.delFlag}
+                </if>
+                            <if test="record.nameAaa != null and !&quot;&quot;.equals(record.nameAaa)">
+                    and  name_aaa = #{record.nameAaa}
+                </if>
+                            <if test="record.nameBbb != null and !&quot;&quot;.equals(record.nameBbb)">
+                    and  name_bbb = #{record.nameBbb}
+                </if>
+            
+            <if test="record.searchKey != null and !&quot;&quot;.equals(record.searchKey)">
+                <trim prefix="and (" suffix=")" prefixOverrides="OR" >
+                                                                                                                    OR  del_flag LIKE concat('%',#{record.searchKey},'%')
+                                                                                                OR  name_aaa LIKE concat('%',#{record.searchKey},'%')
+                                                                                                OR  name_bbb LIKE concat('%',#{record.searchKey},'%')
+                                                            </trim>
+            </if>
+            <if test="record.advancedQuery != null and !&quot;&quot;.equals(record.advancedQuery)">
+                <foreach item="item" index="index" collection="record.advancedQuery.split('_;')">
+                    <choose>
+                        <when test="item.indexOf('like') != -1">
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    concat('%',#{itemDetail},'%')
+                                </if>
+
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
+
+                            </foreach>
+                        </when>
+                        <otherwise>
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    #{itemDetail}
+                                </if>
+
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
+
+                            </foreach>
+                        </otherwise>
+                    </choose>
+
+
+                </foreach>
+
+
+            </if>
+        </where>
+        order by id desc
+    </select>
+    <select id="queryAllTestSqlserverAaa" parameterType="java.util.Map"
+            resultType="com.izouma.awesomeadmin.model.TestSqlserverAaa">
+        select
+        <include refid="Base_Column_List"/>
+        from test_sqlserver_aaa
+        <where>
+            and 1 = 1
+                            <if test="id != null and !&quot;&quot;.equals(id)">
+                    and  id = #{id}
+                </if>
+                            <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
+                    and  del_flag = #{delFlag}
+                </if>
+                            <if test="nameAaa != null and !&quot;&quot;.equals(nameAaa)">
+                    and  name_aaa = #{nameAaa}
+                </if>
+                            <if test="nameBbb != null and !&quot;&quot;.equals(nameBbb)">
+                    and  name_bbb = #{nameBbb}
+                </if>
+            
+            <if test="searchKey != null and !&quot;&quot;.equals(searchKey)">
+                <trim prefix="and (" suffix=")" prefixOverrides="OR" >
+                                                                                                                    OR  del_flag LIKE concat('%',#{searchKey},'%')
+                                                                                                OR  name_aaa LIKE concat('%',#{searchKey},'%')
+                                                                                                OR  name_bbb LIKE concat('%',#{searchKey},'%')
+                                                            </trim>
+            </if>
+            <if test="advancedQuery != null and !&quot;&quot;.equals(advancedQuery)">
+                <foreach item="item" index="index" collection="advancedQuery.split('_;')">
+                    <choose>
+                        <when test="item.indexOf('like') != -1">
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    concat('%',#{itemDetail},'%')
+                                </if>
+
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
+
+                            </foreach>
+                        </when>
+                        <otherwise>
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    #{itemDetail}
+                                </if>
+
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
+
+                            </foreach>
+                        </otherwise>
+                    </choose>
+
+
+                </foreach>
+
+
+            </if>
+        </where>
+        order by id desc
+    </select>
+    <select id="queryTestSqlserverAaa" parameterType="java.util.Map"
+            resultType="com.izouma.awesomeadmin.model.TestSqlserverAaa">
+        select top 1
+        <include refid="Base_Column_List"/>
+        from test_sqlserver_aaa
+        <where>
+            and 1 = 1
+                            <if test="id != null and !&quot;&quot;.equals(id)">
+                    and id = #{id}
+                </if>
+                            <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
+                    and del_flag = #{delFlag}
+                </if>
+                            <if test="nameAaa != null and !&quot;&quot;.equals(nameAaa)">
+                    and name_aaa = #{nameAaa}
+                </if>
+                            <if test="nameBbb != null and !&quot;&quot;.equals(nameBbb)">
+                    and name_bbb = #{nameBbb}
+                </if>
+            
+        </where>
+    </select>
+    <delete id="delete" >
+        delete from test_sqlserver_aaa
+        where id = #{id,jdbcType=INTEGER}
+    </delete>
+
+    <select id="query" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.TestSqlserverAaa">
+        select
+        <include refid="Base_Column_List"/>
+        from test_sqlserver_aaa
+        <where>
+            and 1 = 1
+                                                                                                                                    </where>
+        order by id desc
+    </select>
+</mapper>
+

+ 33 - 0
src/main/java/com/izouma/awesomeadmin/dao/TestaaaoneMapper.java

@@ -0,0 +1,33 @@
+package com.izouma.awesomeadmin.dao;
+
+import java.util.*;
+import com.izouma.awesomeadmin.datasource.DataSource;
+import org.springframework.stereotype.Repository;
+import com.izouma.awesomeadmin.model.Testaaaone;
+
+
+/**
+*  Dao接口
+*/
+@Repository("com.zoumaframe.dao.TestaaaoneMapper")
+public interface TestaaaoneMapper{
+
+    int deleteByPrimaryKey(Integer id);
+
+    int insertSelective(Testaaaone record);
+
+    Testaaaone selectByPrimaryKey(Integer id);
+
+    int updateByPrimaryKeySelective(Testaaaone record);
+
+    List<Testaaaone> queryAllTestaaaone(Testaaaone record);
+
+    List<Testaaaone> queryTestaaaoneByPage(Map<String, Object> parameter);
+
+    int delete(String id);
+
+    Testaaaone queryTestaaaone(Testaaaone record);
+
+    List<Testaaaone> query(Testaaaone record);
+}
+

+ 264 - 0
src/main/java/com/izouma/awesomeadmin/dao/TestaaaoneMapper.xml

@@ -0,0 +1,264 @@
+<?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.izouma.awesomeadmin.dao.TestaaaoneMapper" >
+    <resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.Testaaaone" >
+                <id column="id" property="id" jdbcType="INTEGER" />
+                                        <result column="del_flag" property="delFlag" jdbcType="CHAR" />
+                                <result column="test_name" property="testName" jdbcType="VARCHAR" />
+                                <result column="remark" property="remark" jdbcType="VARCHAR" />
+            </resultMap>
+    <sql id="Base_Column_List" >
+        <trim  suffixOverrides="," >
+            id,
+
+            del_flag,
+
+            test_name,
+
+            remark,
+
+            </trim>
+    </sql>
+    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
+        select
+        <include refid="Base_Column_List" />
+        from test_aaa
+        where id = #{id,jdbcType=INTEGER}
+    </select>
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
+        delete from test_aaa
+        where id = #{id,jdbcType=INTEGER}
+    </delete>
+    <insert id="insertSelective" parameterType="com.izouma.awesomeadmin.model.Testaaaone" useGeneratedKeys="true" keyProperty="id">
+        insert into test_aaa
+        <trim prefix="(" suffix=")" suffixOverrides="," >
+                <if test="id!= null" >
+                id,
+            </if>
+                <if test="delFlag!= null" >
+                del_flag,
+            </if>
+                <if test="testName!= null" >
+                test_name,
+            </if>
+                <if test="remark!= null" >
+                remark,
+            </if>
+            </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides="," >
+                    <if test="id != null" >
+                #{id,jdbcType=INTEGER},
+            </if>
+                    <if test="delFlag != null" >
+                #{delFlag,jdbcType=CHAR},
+            </if>
+                    <if test="testName != null" >
+                #{testName,jdbcType=VARCHAR},
+            </if>
+                    <if test="remark != null" >
+                #{remark,jdbcType=VARCHAR},
+            </if>
+                </trim>
+    </insert>
+    <update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.Testaaaone" >
+        update test_aaa
+        <set >
+                    <if test="id != null" >
+               id= #{id,jdbcType=INTEGER},
+            </if>
+                     <if test="delFlag != null" >
+               del_flag= #{delFlag,jdbcType=CHAR},
+            </if>
+                     <if test="testName != null" >
+               test_name= #{testName,jdbcType=VARCHAR},
+            </if>
+                     <if test="remark != null" >
+               remark= #{remark,jdbcType=VARCHAR},
+            </if>
+                 </set>
+        where id = #{id,jdbcType=INTEGER}
+    </update>
+    <select id="queryTestaaaoneByPage" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.Testaaaone">
+        select <include refid="Base_Column_List"/> from test_aaa
+        <where>
+            and del_flag = 'N'
+                    <if test="record.id != null and !&quot;&quot;.equals(record.id)">
+                and  id = #{record.id}
+            </if>
+                     <if test="record.delFlag != null and !&quot;&quot;.equals(record.delFlag)">
+                and  del_flag = #{record.delFlag}
+            </if>
+                     <if test="record.testName != null and !&quot;&quot;.equals(record.testName)">
+                and  test_name = #{record.testName}
+            </if>
+                     <if test="record.remark != null and !&quot;&quot;.equals(record.remark)">
+                and  remark = #{record.remark}
+            </if>
+                  <if test="record.searchKey != null and !&quot;&quot;.equals(record.searchKey)">
+             <trim prefix="and (" suffix=")" prefixOverrides="OR" >
+                                                                                                                                                                OR  test_name LIKE concat('%',#{record.searchKey},'%')
+                                                                                                    OR  remark LIKE concat('%',#{record.searchKey},'%')
+                                                             </trim>
+         </if>
+
+            <if test="record.advancedQuery != null and !&quot;&quot;.equals(record.advancedQuery)">
+                <foreach item="item" index="index" collection="record.advancedQuery.split('_;')">
+                    <choose>
+                        <when test="item.indexOf('like') != -1">
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    concat('%',#{itemDetail},'%')
+                                </if>
+
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
+
+                            </foreach>
+                        </when>
+                        <otherwise>
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    #{itemDetail}
+                                </if>
+
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
+
+                            </foreach>
+                        </otherwise>
+                    </choose>
+
+
+                </foreach>
+
+
+            </if>
+
+        </where>
+        order by
+
+        <if test="record.orderByStr != null and !&quot;&quot;.equals(record.orderByStr)">
+
+
+            <trim suffixOverrides=",">
+                <foreach item="item" index="index" separator="," collection="record.orderByStr.split('_;')">
+                    <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                        ${itemDetail}
+                    </foreach>
+                </foreach>
+            </trim>
+            ,
+        </if>
+        id desc
+    </select>
+    <select id="queryAllTestaaaone" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.Testaaaone">
+        select <include refid="Base_Column_List"/> from test_aaa
+        <where>
+            and del_flag = 'N'
+                    <if test="id != null and !&quot;&quot;.equals(id)">
+                and  id = #{id}
+            </if>
+                    <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
+                and  del_flag = #{delFlag}
+            </if>
+                    <if test="testName != null and !&quot;&quot;.equals(testName)">
+                and  test_name = #{testName}
+            </if>
+                    <if test="remark != null and !&quot;&quot;.equals(remark)">
+                and  remark = #{remark}
+            </if>
+                    <if test="searchKey != null and !&quot;&quot;.equals(searchKey)">
+                <trim prefix="and (" suffix=")" prefixOverrides="OR" >
+                                                                                                                                                                                                                                                OR  test_name LIKE concat('%',#{searchKey},'%')
+                                                                                                                                                        OR  remark LIKE concat('%',#{searchKey},'%')
+                                                                                        </trim>
+            </if>
+<if test="advancedQuery != null and !&quot;&quot;.equals(advancedQuery)">
+    <foreach item="item" index="index" collection="advancedQuery.split('_;')">
+        <choose>
+            <when test="item.indexOf('like') != -1">
+                <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                    <if test="detailIndex == 3">
+                        concat('%',#{itemDetail},'%')
+                    </if>
+
+                    <if test="detailIndex &lt; 3">
+                        ${itemDetail}
+                    </if>
+
+                </foreach>
+            </when>
+            <otherwise>
+                <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                    <if test="detailIndex == 3">
+                        #{itemDetail}
+                    </if>
+
+                    <if test="detailIndex &lt; 3">
+                        ${itemDetail}
+                    </if>
+
+                </foreach>
+            </otherwise>
+        </choose>
+
+
+    </foreach>
+
+
+</if>
+        </where>
+        order by
+
+        <if test="orderByStr != null and !&quot;&quot;.equals(orderByStr)">
+
+
+            <trim suffixOverrides=",">
+                <foreach item="item" index="index" separator="," collection="orderByStr.split('_;')">
+                    <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                        ${itemDetail}
+                    </foreach>
+                </foreach>
+            </trim>
+            ,
+        </if>
+
+        id desc
+    </select>
+    <select id="queryTestaaaone" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.Testaaaone">
+        select <include refid="Base_Column_List"/> from test_aaa
+        <where>
+            and del_flag = 'N'
+                    <if test="id != null and !&quot;&quot;.equals(id)">
+                and id = #{id}
+            </if>
+                     <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
+                and del_flag = #{delFlag}
+            </if>
+                     <if test="testName != null and !&quot;&quot;.equals(testName)">
+                and test_name = #{testName}
+            </if>
+                     <if test="remark != null and !&quot;&quot;.equals(remark)">
+                and remark = #{remark}
+            </if>
+         
+        </where>
+        LIMIT 1
+    </select>
+    <update id="delete">
+        UPDATE test_aaa SET del_flag = 'Y'
+        <where>
+            AND id = #{id}
+        </where>
+    </update>
+    <select id="query" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.Testaaaone">
+        select <include refid="Base_Column_List"/> from test_aaa
+        <where>
+            and del_flag = 'N'
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </where>
+        order by id desc
+    </select>
+</mapper>
+

+ 33 - 0
src/main/java/com/izouma/awesomeadmin/dao/TestgitMapper.java

@@ -0,0 +1,33 @@
+package com.izouma.awesomeadmin.dao;
+
+import java.util.*;
+import com.izouma.awesomeadmin.datasource.DataSource;
+import org.springframework.stereotype.Repository;
+import com.izouma.awesomeadmin.model.Testgit;
+
+
+/**
+*  Dao接口
+*/
+@Repository("com.zoumaframe.dao.TestgitMapper")
+public interface TestgitMapper{
+
+    int deleteByPrimaryKey(Integer id);
+
+    int insertSelective(Testgit record);
+
+    Testgit selectByPrimaryKey(Integer id);
+
+    int updateByPrimaryKeySelective(Testgit record);
+
+    List<Testgit> queryAllTestgit(Testgit record);
+
+    List<Testgit> queryTestgitByPage(Map<String, Object> parameter);
+
+    int delete(String id);
+
+    Testgit queryTestgit(Testgit record);
+
+    List<Testgit> query(Testgit record);
+}
+

+ 218 - 0
src/main/java/com/izouma/awesomeadmin/dao/TestgitMapper.xml

@@ -0,0 +1,218 @@
+<?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.izouma.awesomeadmin.dao.TestgitMapper" >
+    <resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.Testgit" >
+                <id column="id" property="id" jdbcType="INTEGER" />
+                                        <result column="del_flag" property="delFlag" jdbcType="CHAR" />
+            </resultMap>
+    <sql id="Base_Column_List" >
+        <trim  suffixOverrides="," >
+            id,
+
+            del_flag,
+
+            </trim>
+    </sql>
+    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
+        select
+        <include refid="Base_Column_List" />
+        from test_git
+        where id = #{id,jdbcType=INTEGER}
+    </select>
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
+        delete from test_git
+        where id = #{id,jdbcType=INTEGER}
+    </delete>
+    <insert id="insertSelective" parameterType="com.izouma.awesomeadmin.model.Testgit" useGeneratedKeys="true" keyProperty="id">
+        insert into test_git
+        <trim prefix="(" suffix=")" suffixOverrides="," >
+                <if test="id!= null" >
+                id,
+            </if>
+                <if test="delFlag!= null" >
+                del_flag,
+            </if>
+            </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides="," >
+                    <if test="id != null" >
+                #{id,jdbcType=INTEGER},
+            </if>
+                    <if test="delFlag != null" >
+                #{delFlag,jdbcType=CHAR},
+            </if>
+                </trim>
+    </insert>
+    <update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.Testgit" >
+        update test_git
+        <set >
+                    <if test="id != null" >
+               id= #{id,jdbcType=INTEGER},
+            </if>
+                     <if test="delFlag != null" >
+               del_flag= #{delFlag,jdbcType=CHAR},
+            </if>
+                 </set>
+        where id = #{id,jdbcType=INTEGER}
+    </update>
+    <select id="queryTestgitByPage" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.Testgit">
+        select <include refid="Base_Column_List"/> from test_git
+        <where>
+            and del_flag = 'N'
+                    <if test="record.id != null and !&quot;&quot;.equals(record.id)">
+                and  id = #{record.id}
+            </if>
+                     <if test="record.delFlag != null and !&quot;&quot;.equals(record.delFlag)">
+                and  del_flag = #{record.delFlag}
+            </if>
+                  <if test="record.searchKey != null and !&quot;&quot;.equals(record.searchKey)">
+             <trim prefix="and (" suffix=")" prefixOverrides="OR" >
+                                                                                                                         </trim>
+         </if>
+
+            <if test="record.advancedQuery != null and !&quot;&quot;.equals(record.advancedQuery)">
+                <foreach item="item" index="index" collection="record.advancedQuery.split('_;')">
+                    <choose>
+                        <when test="item.indexOf('like') != -1">
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    concat('%',#{itemDetail},'%')
+                                </if>
+
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
+
+                            </foreach>
+                        </when>
+                        <otherwise>
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    #{itemDetail}
+                                </if>
+
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
+
+                            </foreach>
+                        </otherwise>
+                    </choose>
+
+
+                </foreach>
+
+
+            </if>
+
+        </where>
+        order by
+
+        <if test="record.orderByStr != null and !&quot;&quot;.equals(record.orderByStr)">
+
+
+            <trim suffixOverrides=",">
+                <foreach item="item" index="index" separator="," collection="record.orderByStr.split('_;')">
+                    <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                        ${itemDetail}
+                    </foreach>
+                </foreach>
+            </trim>
+            ,
+        </if>
+        id desc
+    </select>
+    <select id="queryAllTestgit" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.Testgit">
+        select <include refid="Base_Column_List"/> from test_git
+        <where>
+            and del_flag = 'N'
+                    <if test="id != null and !&quot;&quot;.equals(id)">
+                and  id = #{id}
+            </if>
+                    <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
+                and  del_flag = #{delFlag}
+            </if>
+                    <if test="searchKey != null and !&quot;&quot;.equals(searchKey)">
+                <trim prefix="and (" suffix=")" prefixOverrides="OR" >
+                                                                                                                                                                                </trim>
+            </if>
+<if test="advancedQuery != null and !&quot;&quot;.equals(advancedQuery)">
+    <foreach item="item" index="index" collection="advancedQuery.split('_;')">
+        <choose>
+            <when test="item.indexOf('like') != -1">
+                <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                    <if test="detailIndex == 3">
+                        concat('%',#{itemDetail},'%')
+                    </if>
+
+                    <if test="detailIndex &lt; 3">
+                        ${itemDetail}
+                    </if>
+
+                </foreach>
+            </when>
+            <otherwise>
+                <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                    <if test="detailIndex == 3">
+                        #{itemDetail}
+                    </if>
+
+                    <if test="detailIndex &lt; 3">
+                        ${itemDetail}
+                    </if>
+
+                </foreach>
+            </otherwise>
+        </choose>
+
+
+    </foreach>
+
+
+</if>
+        </where>
+        order by
+
+        <if test="orderByStr != null and !&quot;&quot;.equals(orderByStr)">
+
+
+            <trim suffixOverrides=",">
+                <foreach item="item" index="index" separator="," collection="orderByStr.split('_;')">
+                    <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                        ${itemDetail}
+                    </foreach>
+                </foreach>
+            </trim>
+            ,
+        </if>
+
+        id desc
+    </select>
+    <select id="queryTestgit" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.Testgit">
+        select <include refid="Base_Column_List"/> from test_git
+        <where>
+            and del_flag = 'N'
+                    <if test="id != null and !&quot;&quot;.equals(id)">
+                and id = #{id}
+            </if>
+                     <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
+                and del_flag = #{delFlag}
+            </if>
+         
+        </where>
+        LIMIT 1
+    </select>
+    <update id="delete">
+        UPDATE test_git SET del_flag = 'Y'
+        <where>
+            AND id = #{id}
+        </where>
+    </update>
+    <select id="query" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.Testgit">
+        select <include refid="Base_Column_List"/> from test_git
+        <where>
+            and del_flag = 'N'
+                                                                            </where>
+        order by id desc
+    </select>
+</mapper>
+

+ 39 - 0
src/main/java/com/izouma/awesomeadmin/dao/UserInfoMapper.java

@@ -0,0 +1,39 @@
+package com.izouma.awesomeadmin.dao;
+
+import java.util.List;
+import java.util.Map;
+
+import org.springframework.stereotype.Repository;
+
+import com.izouma.awesomeadmin.model.UserInfo;
+
+/**
+ * user_info Dao接口
+ * Tue Apr 17 10:32:49 CST 2018  Suo Chen Cheng
+ */
+@Repository("com.izouma.awesomeadmin.dao.UserInfoMapper")
+public interface UserInfoMapper {
+
+    int deleteByPrimaryKey(Integer id);
+
+    int insertSelective(UserInfo record);
+
+    UserInfo selectByPrimaryKey(Integer id);
+
+    int updateByPrimaryKeySelective(UserInfo record);
+
+    List<UserInfo> queryAllUserInfo(UserInfo record);
+
+    List<UserInfo> queryUserInfosByPage(Map<String, Object> parameter);
+
+    int delete(String id);
+
+    UserInfo queryUserInfo(UserInfo record);
+
+    UserInfo login(Map<String, Object> parameter);
+
+    List<String> findDepartLeader(String userId);
+
+    List<String> findUserByRoleName(String roleName);
+}
+

+ 475 - 0
src/main/java/com/izouma/awesomeadmin/dao/UserInfoMapper.xml

@@ -0,0 +1,475 @@
+<?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.izouma.awesomeadmin.dao.UserInfoMapper">
+    <resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.UserInfo">
+        <id column="id" property="id" jdbcType="INTEGER"/>
+        <result column="username" property="username" jdbcType="VARCHAR"/>
+        <result column="nickname" property="nickname" jdbcType="VARCHAR"/>
+        <result column="password" property="password" jdbcType="VARCHAR"/>
+        <result column="icon" property="icon" jdbcType="VARCHAR"/>
+        <result column="birthday" property="birthday" jdbcType="TIMESTAMP"/>
+        <result column="sex" property="sex" jdbcType="CHAR"/>
+        <result column="open_id" property="openId" jdbcType="VARCHAR"/>
+        <result column="union_id" property="unionId" jdbcType="VARCHAR"/>
+        <result column="phone" property="phone" jdbcType="VARCHAR"/>
+        <result column="mail" property="mail" jdbcType="VARCHAR"/>
+        <result column="country" property="country" jdbcType="VARCHAR"/>
+        <result column="province" property="province" jdbcType="VARCHAR"/>
+        <result column="city" property="city" jdbcType="VARCHAR"/>
+        <result column="district" property="district" jdbcType="VARCHAR"/>
+        <result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
+        <result column="del_flag" property="delFlag" jdbcType="CHAR"/>
+        <result column="work_number" property="workNumber" jdbcType="VARCHAR"/>
+        <result column="config" property="config" jdbcType="VARCHAR"/>
+        <result column="mis_child" property="misChild" jdbcType="VARCHAR"/>
+        <result column="inherit_flag" property="inheritFlag" jdbcType="CHAR"/>
+        <association property="departId" javaType="string" column="id"
+                     select="com.izouma.awesomeadmin.dao.DepartInfoMapper.getUserDepartId"/>
+        <association property="roleId" javaType="string" column="id"
+                     select="com.izouma.awesomeadmin.dao.SysRoleMapper.getUserRoleId"/>
+    </resultMap>
+    <sql id="Base_Column_List">
+        id, username, nickname, icon, birthday, sex, open_id, union_id, phone, mail,
+        country, province, city, district, create_time, del_flag, work_number, config,
+        mis_child, inherit_flag, password
+    </sql>
+    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer">
+        select
+        <include refid="Base_Column_List"/>
+        from sys_user
+        where id = #{id,jdbcType=INTEGER}
+    </select>
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
+        delete
+        from sys_user
+        where id = #{id,jdbcType=INTEGER}
+    </delete>
+    <insert id="insertSelective" parameterType="com.izouma.awesomeadmin.model.UserInfo" useGeneratedKeys="true"
+            keyProperty="id">
+        insert into sys_user
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">
+                id,
+            </if>
+            <if test="username != null">
+                username,
+            </if>
+            <if test="nickname != null">
+                nickname,
+            </if>
+            <if test="password != null">
+                password,
+            </if>
+            <if test="icon != null">
+                icon,
+            </if>
+            <if test="birthday != null">
+                birthday,
+            </if>
+            <if test="sex != null">
+                sex,
+            </if>
+            <if test="openId != null">
+                open_id,
+            </if>
+            <if test="unionId != null">
+                union_id,
+            </if>
+            <if test="phone != null">
+                phone,
+            </if>
+            <if test="mail != null">
+                mail,
+            </if>
+            <if test="country != null">
+                country,
+            </if>
+            <if test="province != null">
+                province,
+            </if>
+            <if test="city != null">
+                city,
+            </if>
+            <if test="district != null">
+                district,
+            </if>
+            <if test="roleId != null">
+                role_id,
+            </if>
+            <if test="createTime != null">
+                create_time,
+            </if>
+            <if test="delFlag != null">
+                del_flag,
+            </if>
+            <if test="workNumber != null">
+                work_number,
+            </if>
+            <if test="config != null">
+                config,
+            </if>
+            <if test="misChild != null">
+                mis_child,
+            </if>
+            <if test="inheritFlag != null">
+                inherit_flag,
+            </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">
+                #{id,jdbcType=INTEGER},
+            </if>
+            <if test="username != null">
+                #{username,jdbcType=VARCHAR},
+            </if>
+            <if test="nickname != null">
+                #{nickname,jdbcType=VARCHAR},
+            </if>
+            <if test="password != null">
+                #{password,jdbcType=VARCHAR},
+            </if>
+            <if test="icon != null">
+                #{icon,jdbcType=VARCHAR},
+            </if>
+            <if test="birthday != null">
+                #{birthday,jdbcType=TIMESTAMP},
+            </if>
+            <if test="sex != null">
+                #{sex,jdbcType=CHAR},
+            </if>
+            <if test="openId != null">
+                #{openId,jdbcType=VARCHAR},
+            </if>
+            <if test="unionId != null">
+                #{unionId,jdbcType=VARCHAR},
+            </if>
+            <if test="phone != null">
+                #{phone,jdbcType=VARCHAR},
+            </if>
+            <if test="mail != null">
+                #{mail,jdbcType=VARCHAR},
+            </if>
+            <if test="country != null">
+                #{country,jdbcType=VARCHAR},
+            </if>
+            <if test="province != null">
+                #{province,jdbcType=VARCHAR},
+            </if>
+            <if test="city != null">
+                #{city,jdbcType=VARCHAR},
+            </if>
+            <if test="district != null">
+                #{district,jdbcType=VARCHAR},
+            </if>
+            <if test="roleId != null">
+                #{roleId,jdbcType=VARCHAR},
+            </if>
+            <if test="createTime != null">
+                #{createTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="delFlag != null">
+                #{delFlag,jdbcType=CHAR},
+            </if>
+            <if test="workNumber != null">
+                #{workNumber,jdbcType=VARCHAR},
+            </if>
+            <if test="config != null">
+                #{config,jdbcType=VARCHAR},
+            </if>
+            <if test="misChild != null">
+                #{misChild,jdbcType=VARCHAR},
+            </if>
+            <if test="inheritFlag != null">
+                #{inheritFlag,jdbcType=CHAR},
+            </if>
+        </trim>
+    </insert>
+    <update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.UserInfo">
+        update sys_user
+        <set>
+            <if test="username != null">
+                username = #{username,jdbcType=VARCHAR},
+            </if>
+            <if test="nickname != null">
+                nickname = #{nickname,jdbcType=VARCHAR},
+            </if>
+            <if test="password != null">
+                password = #{password,jdbcType=VARCHAR},
+            </if>
+            <if test="icon != null">
+                icon = #{icon,jdbcType=VARCHAR},
+            </if>
+            <if test="birthday != null">
+                birthday = #{birthday,jdbcType=TIMESTAMP},
+            </if>
+            <if test="sex != null">
+                sex = #{sex,jdbcType=CHAR},
+            </if>
+            <if test="openId != null">
+                open_id = #{openId,jdbcType=VARCHAR},
+            </if>
+            <if test="unionId != null">
+                union_id = #{unionId,jdbcType=VARCHAR},
+            </if>
+            <if test="phone != null">
+                phone = #{phone,jdbcType=VARCHAR},
+            </if>
+            <if test="mail != null">
+                mail = #{mail,jdbcType=VARCHAR},
+            </if>
+            <if test="country != null">
+                country = #{country,jdbcType=VARCHAR},
+            </if>
+            <if test="province != null">
+                province = #{province,jdbcType=VARCHAR},
+            </if>
+            <if test="city != null">
+                city = #{city,jdbcType=VARCHAR},
+            </if>
+            <if test="district != null">
+                district = #{district,jdbcType=VARCHAR},
+            </if>
+            <if test="roleId != null">
+                role_id = #{roleId,jdbcType=VARCHAR},
+            </if>
+            <if test="createTime != null">
+                create_time = #{createTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="delFlag != null">
+                del_flag = #{delFlag,jdbcType=CHAR},
+            </if>
+            <if test="workNumber != null">
+                work_number = #{workNumber,jdbcType=VARCHAR},
+            </if>
+            <if test="config != null">
+                config = #{config,jdbcType=VARCHAR},
+            </if>
+            <if test="misChild != null">
+                mis_child = #{misChild,jdbcType=VARCHAR},
+            </if>
+            <if test="inheritFlag != null">
+                inherit_flag = #{inheritFlag,jdbcType=CHAR},
+            </if>
+        </set>
+        where id = #{id,jdbcType=INTEGER}
+    </update>
+    <select id="queryUserInfosByPage" parameterType="java.util.Map"
+            resultType="com.izouma.awesomeadmin.model.UserInfo">
+        select
+        <include refid="Base_Column_List"/>
+        from sys_user
+        <where>
+            and del_flag = 'N'
+            <if test="record.id != null and !&quot;&quot;.equals(record.id)">
+                and id = #{record.id}
+            </if>
+            <if test="record.username != null and !&quot;&quot;.equals(record.username)">
+                and username = #{record.username}
+            </if>
+            <if test="record.nickname != null and !&quot;&quot;.equals(record.nickname)">
+                and nickname = #{record.nickname}
+            </if>
+            <if test="record.password != null and !&quot;&quot;.equals(record.password)">
+                and password = #{record.password}
+            </if>
+            <if test="record.icon != null and !&quot;&quot;.equals(record.icon)">
+                and icon = #{record.icon}
+            </if>
+            <if test="record.birthday != null and !&quot;&quot;.equals(record.birthday)">
+                and birthday = #{record.birthday}
+            </if>
+            <if test="record.sex != null and !&quot;&quot;.equals(record.sex)">
+                and sex = #{record.sex}
+            </if>
+            <if test="record.openId != null and !&quot;&quot;.equals(record.openId)">
+                and open_id = #{record.openId}
+            </if>
+            <if test="record.unionId != null and !&quot;&quot;.equals(record.unionId)">
+                and union_id = #{record.unionId}
+            </if>
+            <if test="record.phone != null and !&quot;&quot;.equals(record.phone)">
+                and phone = #{record.phone}
+            </if>
+            <if test="record.mail != null and !&quot;&quot;.equals(record.mail)">
+                and mail = #{record.mail}
+            </if>
+            <if test="record.country != null and !&quot;&quot;.equals(record.country)">
+                and country = #{record.country}
+            </if>
+            <if test="record.province != null and !&quot;&quot;.equals(record.province)">
+                and province = #{record.province}
+            </if>
+            <if test="record.city != null and !&quot;&quot;.equals(record.city)">
+                and city = #{record.city}
+            </if>
+            <if test="record.district != null and !&quot;&quot;.equals(record.district)">
+                and district = #{record.district}
+            </if>
+            <if test="record.roleId != null and !&quot;&quot;.equals(record.roleId)">
+                and role_id = #{record.roleId}
+            </if>
+            <if test="record.createTime != null and !&quot;&quot;.equals(record.createTime)">
+                and create_time = #{record.createTime}
+            </if>
+            <if test="record.delFlag != null and !&quot;&quot;.equals(record.delFlag)">
+                and del_flag = #{record.delFlag}
+            </if>
+        </where>
+        order by id desc
+    </select>
+    <select id="queryAllUserInfo" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.UserInfo">
+        select
+        <include refid="Base_Column_List"/>
+        from sys_user
+        <where>
+            and del_flag = 'N'
+            <if test="id != null and !&quot;&quot;.equals(id)">
+                and id = #{id}
+            </if>
+            <if test="username != null and !&quot;&quot;.equals(username)">
+                and username = #{username}
+            </if>
+            <if test="nickname != null and !&quot;&quot;.equals(nickname)">
+                and nickname = #{nickname}
+            </if>
+            <if test="password != null and !&quot;&quot;.equals(password)">
+                and password = #{password}
+            </if>
+            <if test="icon != null and !&quot;&quot;.equals(icon)">
+                and icon = #{icon}
+            </if>
+            <if test="birthday != null and !&quot;&quot;.equals(birthday)">
+                and birthday = #{birthday}
+            </if>
+            <if test="sex != null and !&quot;&quot;.equals(sex)">
+                and sex = #{sex}
+            </if>
+            <if test="openId != null and !&quot;&quot;.equals(openId)">
+                and open_id = #{openId}
+            </if>
+            <if test="unionId != null and !&quot;&quot;.equals(unionId)">
+                and union_id = #{unionId}
+            </if>
+            <if test="phone != null and !&quot;&quot;.equals(phone)">
+                and phone = #{phone}
+            </if>
+            <if test="mail != null and !&quot;&quot;.equals(mail)">
+                and mail = #{mail}
+            </if>
+            <if test="country != null and !&quot;&quot;.equals(country)">
+                and country = #{country}
+            </if>
+            <if test="province != null and !&quot;&quot;.equals(province)">
+                and province = #{province}
+            </if>
+            <if test="city != null and !&quot;&quot;.equals(city)">
+                and city = #{city}
+            </if>
+            <if test="district != null and !&quot;&quot;.equals(district)">
+                and district = #{district}
+            </if>
+            <if test="roleId != null and !&quot;&quot;.equals(roleId)">
+                and role_id = #{roleId}
+            </if>
+            <if test="createTime != null and !&quot;&quot;.equals(createTime)">
+                and create_time = #{createTime}
+            </if>
+            <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
+                and del_flag = #{delFlag}
+            </if>
+        </where>
+        order by id desc
+    </select>
+    <select id="queryUserInfo" parameterType="java.util.Map" resultMap="BaseResultMap">
+        select
+        <include refid="Base_Column_List"/>
+        from sys_user
+        <where>
+            and del_flag = 'N'
+            <if test="id != null and !&quot;&quot;.equals(id)">
+                and id = #{id}
+            </if>
+            <if test="username != null and !&quot;&quot;.equals(username)">
+                and username = #{username}
+            </if>
+            <if test="nickname != null and !&quot;&quot;.equals(nickname)">
+                and nickname = #{nickname}
+            </if>
+            <if test="password != null and !&quot;&quot;.equals(password)">
+                and password = #{password}
+            </if>
+            <if test="icon != null and !&quot;&quot;.equals(icon)">
+                and icon = #{icon}
+            </if>
+            <if test="birthday != null and !&quot;&quot;.equals(birthday)">
+                and birthday = #{birthday}
+            </if>
+            <if test="sex != null and !&quot;&quot;.equals(sex)">
+                and sex = #{sex}
+            </if>
+            <if test="openId != null and !&quot;&quot;.equals(openId)">
+                and open_id = #{openId}
+            </if>
+            <if test="unionId != null and !&quot;&quot;.equals(unionId)">
+                and union_id = #{unionId}
+            </if>
+            <if test="phone != null and !&quot;&quot;.equals(phone)">
+                and phone = #{phone}
+            </if>
+            <if test="mail != null and !&quot;&quot;.equals(mail)">
+                and mail = #{mail}
+            </if>
+            <if test="country != null and !&quot;&quot;.equals(country)">
+                and country = #{country}
+            </if>
+            <if test="province != null and !&quot;&quot;.equals(province)">
+                and province = #{province}
+            </if>
+            <if test="city != null and !&quot;&quot;.equals(city)">
+                and city = #{city}
+            </if>
+            <if test="district != null and !&quot;&quot;.equals(district)">
+                and district = #{district}
+            </if>
+            <if test="roleId != null and !&quot;&quot;.equals(roleId)">
+                and role_id = #{roleId}
+            </if>
+            <if test="createTime != null and !&quot;&quot;.equals(createTime)">
+                and create_time = #{createTime}
+            </if>
+            <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
+                and del_flag = #{delFlag}
+            </if>
+        </where>
+        LIMIT 1
+    </select>
+    <select id="login" resultMap="BaseResultMap" parameterType="java.util.Map">
+        SELECT
+        <include refid="Base_Column_List"/>
+        from sys_user
+        WHERE username = #{username} AND password = #{password} AND del_flag = 'N'
+    </select>
+    <select id="findDepartLeader" resultType="java.lang.String">
+        SELECT *
+        FROM (SELECT user_id, GROUP_CONCAT(depart_id ORDER BY depart_id) AS depart_id
+              FROM sys_user_depart
+              GROUP BY user_id) AS tmp
+                 LEFT JOIN sys_user_role ON tmp.user_id = sys_user_role.user_id
+        WHERE tmp.depart_id =
+              (SELECT GROUP_CONCAT(depart_id ORDER BY depart_id) FROM sys_user_depart WHERE user_id = #{userId})
+          AND role_id = 9
+    </select>
+    <select id="findUserByRoleName" resultType="java.lang.String">
+        SELECT user_id
+        FROM sys_user_role
+        WHERE FIND_IN_SET((SELECT id FROM sys_role WHERE enname = #{roleName}
+                                                     AND sys_role.del_flag = 'N'), role_id)
+    </select>
+    <update id="delete">
+        UPDATE sys_user SET del_flag = 'Y'
+        <where>
+            AND id = #{id}
+        </where>
+    </update>
+</mapper>
+

+ 23 - 0
src/main/java/com/izouma/awesomeadmin/datasource/DataService.java

@@ -0,0 +1,23 @@
+package com.izouma.awesomeadmin.datasource;
+
+import com.izouma.awesomeadmin.dto.Page;
+import com.izouma.awesomeadmin.model.SqlServerTest;
+import com.izouma.awesomeadmin.model.SuperUser;
+import com.izouma.awesomeadmin.model.Zouma;
+
+import java.util.List;
+
+public interface DataService {
+
+    /**
+     * <p>获取所有用户记录。</p>
+     *
+     * @return tblUser list
+     */
+    List<SuperUser> getSuperUserList();
+
+    List<Zouma> getZoumaList();
+
+    List<SqlServerTest> getSqlServerTestByPage(Page page);
+
+}

+ 44 - 0
src/main/java/com/izouma/awesomeadmin/datasource/DataServiceImpl.java

@@ -0,0 +1,44 @@
+package com.izouma.awesomeadmin.datasource;
+
+import com.izouma.awesomeadmin.constant.AppConstant;
+import com.izouma.awesomeadmin.dao.DataMapper;
+import com.izouma.awesomeadmin.dto.Page;
+import com.izouma.awesomeadmin.model.SqlServerTest;
+import com.izouma.awesomeadmin.model.SuperUser;
+import com.izouma.awesomeadmin.model.Zouma;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@Service
+// 默认DataServiceImpl下的所有方法均访问数据源1
+
+public class DataServiceImpl implements DataService {
+
+    @Autowired
+    private DataMapper dataMapper;
+
+    @Override
+    public List<SuperUser> getSuperUserList() {
+
+        return dataMapper.queryAllUsers();
+    }
+
+    @Override
+    public List<Zouma> getZoumaList() {
+        return dataMapper.queryZouma();
+    }
+
+    @Override
+
+    public List<SqlServerTest> getSqlServerTestByPage(Page page) {
+        Map<String, Object> parameter = new HashMap<String, Object>();
+        parameter.put(AppConstant.PAGE, page);
+
+        return dataMapper.getSqlServerTestByPage(parameter);
+    }
+
+}

+ 14 - 0
src/main/java/com/izouma/awesomeadmin/datasource/DataSource.java

@@ -0,0 +1,14 @@
+package com.izouma.awesomeadmin.datasource;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+@Target({TYPE, METHOD})
+@Retention(RUNTIME)
+public @interface DataSource {
+    String value();
+}

+ 67 - 0
src/main/java/com/izouma/awesomeadmin/datasource/DataSourceAspect.java

@@ -0,0 +1,67 @@
+package com.izouma.awesomeadmin.datasource;
+
+import org.aspectj.lang.JoinPoint;
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Before;
+import org.aspectj.lang.annotation.Pointcut;
+import org.aspectj.lang.reflect.MethodSignature;
+import org.springframework.stereotype.Component;
+
+import java.lang.reflect.Method;
+
+@Component
+@Aspect
+public class DataSourceAspect {
+
+    @Pointcut("execution(public * com.izouma.awesomeadmin.dao..*(..)))")
+    public void pointcut() {
+    }
+
+
+    /**
+     * 拦截目标方法,获取由@DataSource指定的数据源标识,设置到线程存储中以便切换数据源
+     *
+     * @param point
+     * @throws Exception
+     */
+    @Before(value = "pointcut()")
+    public void intercept(JoinPoint point) {
+        //默认使用默认datasource
+        DynamicDataSourceHolder.setDataSource("dataSource");
+
+        Class<?> target = point.getTarget().getClass();
+        MethodSignature signature = (MethodSignature) point.getSignature();
+        // 默认使用目标类型的注解,如果没有则使用其实现接口的注解
+        for (Class<?> clazz : target.getInterfaces()) {
+            resolveDataSource(clazz, signature.getMethod());
+        }
+        resolveDataSource(target, signature.getMethod());
+    }
+
+    /**
+     * 提取目标对象方法注解和类型注解中的数据源标识
+     *
+     * @param clazz
+     * @param method
+     */
+    private void resolveDataSource(Class<?> clazz, Method method) {
+        try {
+
+            Class<?>[] types = method.getParameterTypes();
+            // 默认使用类型注解
+            if (clazz.isAnnotationPresent(DataSource.class)) {
+                DataSource source = clazz.getAnnotation(DataSource.class);
+                DynamicDataSourceHolder.setDataSource(source.value());
+            }
+            // 方法注解可以覆盖类型注解
+            Method m = clazz.getMethod(method.getName(), types);
+            if (m != null && m.isAnnotationPresent(DataSource.class)) {
+                DataSource source = m.getAnnotation(DataSource.class);
+                DynamicDataSourceHolder.setDataSource(source.value());
+            }
+        } catch (Exception e) {
+            System.out.println(clazz + ":" + e.getMessage());
+        }
+    }
+
+}

+ 79 - 0
src/main/java/com/izouma/awesomeadmin/datasource/DynamicDataSource.java

@@ -0,0 +1,79 @@
+package com.izouma.awesomeadmin.datasource;
+
+import com.izouma.awesomeadmin.model.DataSourceInfo;
+import com.izouma.awesomeadmin.util.Const;
+import org.apache.commons.dbcp.BasicDataSource;
+import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;
+
+import javax.sql.DataSource;
+import java.util.HashMap;
+import java.util.Map;
+
+public class DynamicDataSource extends AbstractRoutingDataSource {
+    private static final Map targetDataSource = new HashMap<>();
+    protected DataSource masterDataSource;
+
+
+    @Override
+    protected DataSource determineTargetDataSource() {
+        // 根据数据库选择方案,拿到要访问的数据库
+        String dataSourceName = determineCurrentLookupKey();
+        if (!dataSourceName.equals("dataSource")) {
+            DataSource datasource = (DataSource) targetDataSource.get(DynamicDataSourceHolder.getDataSource());
+            if (datasource == null) {
+                datasource = createDataSource(DynamicDataSourceHolder.getDataSource());
+                targetDataSource.put(DynamicDataSourceHolder.getDataSource(), datasource);
+            }
+            return datasource;
+        } else {
+            return masterDataSource;
+        }
+
+    }
+
+    @Override
+    protected String determineCurrentLookupKey() {
+        return DynamicDataSourceHolder.getDataSource();
+    }
+
+    public DataSource getMasterDataSource() {
+        return masterDataSource;
+    }
+
+    public void setMasterDataSource(DataSource masterDataSource) {
+        this.masterDataSource = masterDataSource;
+    }
+
+    //创建数据源
+    private BasicDataSource createDataSource(String datasource) {
+
+        // 查询所需信息
+        DataSourceInfo dataSourceInfo = Const.DataSourceInfoMap.get(datasource);
+
+        if (dataSourceInfo != null) {
+
+            if ("Mysql".equals(dataSourceInfo.getDatabaseType())) {
+                return createDataSource("com.mysql.jdbc.Driver", "jdbc:mysql://" + dataSourceInfo.getUrl() + "/" + dataSourceInfo.getDatabaseName(), dataSourceInfo.getUsername(), dataSourceInfo.getPassword());
+            } else if ("SqlServer".equals(dataSourceInfo.getDatabaseType())) {
+
+                return createDataSource("com.microsoft.sqlserver.jdbc.SQLServerDriver", "jdbc:sqlserver://" + dataSourceInfo.getUrl() + ";DatabaseName=" + dataSourceInfo.getDatabaseName(), dataSourceInfo.getUsername(), dataSourceInfo.getPassword());
+            }
+
+        }
+        return null;
+    }
+
+    //创建数据源
+    private BasicDataSource createDataSource(String driverClassName, String url,
+                                             String username, String password) {
+        BasicDataSource dataSource = new BasicDataSource();
+        dataSource.setDriverClassName(driverClassName);
+        dataSource.setUrl(url);
+        dataSource.setUsername(username);
+        dataSource.setPassword(password);
+        dataSource.setTestWhileIdle(true);
+
+        return dataSource;
+    }
+
+}

+ 20 - 0
src/main/java/com/izouma/awesomeadmin/datasource/DynamicDataSourceHolder.java

@@ -0,0 +1,20 @@
+package com.izouma.awesomeadmin.datasource;
+
+public class DynamicDataSourceHolder {
+    /**
+     * 注意:数据源标识保存在线程变量中,避免多线程操作数据源时互相干扰
+     */
+    private static final ThreadLocal<String> THREAD_DATA_SOURCE = new ThreadLocal<String>();
+
+    public static String getDataSource() {
+        return THREAD_DATA_SOURCE.get();
+    }
+
+    public static void setDataSource(String dataSource) {
+        THREAD_DATA_SOURCE.set(dataSource);
+    }
+
+    public static void clearDataSource() {
+        THREAD_DATA_SOURCE.remove();
+    }
+}

+ 144 - 0
src/main/java/com/izouma/awesomeadmin/dto/Page.java

@@ -0,0 +1,144 @@
+package com.izouma.awesomeadmin.dto;
+
+import com.fasterxml.jackson.annotation.JsonAutoDetect;
+import com.fasterxml.jackson.annotation.JsonInclude;
+
+/**
+ * 分页对应的实体类
+ */
+@JsonAutoDetect
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class Page {
+
+    private static int DEFAULT_PAGE_SIZE = 20;
+
+    /**
+     * 总条数
+     */
+    private int        totalNumber;
+
+    /**
+     * 当前第几页
+     */
+    private int        currentPage;
+
+    /**
+     * 总页数
+     */
+    private int        totalPage;
+
+    /**
+     * 每页显示条数
+     */
+    private int        pageNumber        = DEFAULT_PAGE_SIZE;
+
+    /**
+     * 数据库中limit的参数,从第几条开始取
+     */
+    private int        dbIndex;
+
+    /**
+     * 数据库中limit的参数,一共取多少条
+     */
+    private int        dbNumber;
+
+
+    /**
+     * 根据当前对象中属性值计算并设置相关属性值
+     */
+    public void count() {
+
+        // 计算总页数
+        int totalPageTemp = this.totalNumber / this.pageNumber;
+        int plus = (this.totalNumber % this.pageNumber) == 0 ? 0 : 1;
+        totalPageTemp = totalPageTemp + plus;
+        if (totalPageTemp <= 0) {
+            totalPageTemp = 1;
+        }
+        this.totalPage = totalPageTemp;
+
+        // 设置当前页数
+        // 当前页数小于1设置为1
+        if (this.currentPage < 1) {
+            this.currentPage = 1;
+        }
+
+        // 设置limit的参数
+        this.dbIndex = (this.currentPage - 1) * this.pageNumber;
+        this.dbNumber = this.pageNumber;
+    }
+
+
+    public int getTotalNumber() {
+
+        return totalNumber;
+    }
+
+
+    public void setTotalNumber(int totalNumber) {
+
+        this.totalNumber = totalNumber;
+        //记录总条数时进行操作
+        this.count();
+    }
+
+
+    public int getCurrentPage() {
+
+        return currentPage;
+    }
+
+
+    public void setCurrentPage(int currentPage) {
+
+        this.currentPage = currentPage;
+    }
+
+
+    public int getTotalPage() {
+
+        return totalPage;
+    }
+
+
+    public void setTotalPage(int totalPage) {
+
+        this.totalPage = totalPage;
+    }
+
+
+    public int getPageNumber() {
+
+        return pageNumber;
+    }
+
+
+    public void setPageNumber(int pageNumber) {
+
+        this.pageNumber = pageNumber;
+    }
+
+
+    public int getDbIndex() {
+
+        return dbIndex;
+    }
+
+
+    public void setDbIndex(int dbIndex) {
+
+        this.dbIndex = dbIndex;
+    }
+
+
+    public int getDbNumber() {
+
+        return dbNumber;
+    }
+
+
+    public void setDbNumber(int dbNumber) {
+
+        this.dbNumber = dbNumber;
+    }
+}

+ 70 - 0
src/main/java/com/izouma/awesomeadmin/dto/Result.java

@@ -0,0 +1,70 @@
+package com.izouma.awesomeadmin.dto;
+
+import com.fasterxml.jackson.annotation.JsonAutoDetect;
+import com.fasterxml.jackson.annotation.JsonInclude;
+
+/**
+ * <p>封装json返回类型。</p>
+ *
+ * @author 姓名 <br />
+ * 更新履历 <br />
+ * 日期 : 姓名: 更新内容<br />
+ * @version 1.0
+ */
+@JsonAutoDetect
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class Result {
+
+    private boolean success;
+
+    private Object data;
+
+    private String error;
+
+
+    public Result(boolean success, Object data) {
+
+        this.success = success;
+        if (!success) {
+            this.error = data.toString();
+        } else {
+            this.data = data;
+        }
+    }
+
+    public boolean isSuccess() {
+
+        return success;
+    }
+
+
+    public void setSuccess(boolean success) {
+
+        this.success = success;
+    }
+
+
+    public Object getData() {
+
+        return data;
+    }
+
+
+    public void setData(Object data) {
+
+        this.data = data;
+    }
+
+
+    public String getError() {
+
+        return error;
+    }
+
+
+    public void setError(String error) {
+
+        this.error = error;
+    }
+
+}

+ 87 - 0
src/main/java/com/izouma/awesomeadmin/dto/TreeNode.java

@@ -0,0 +1,87 @@
+package com.izouma.awesomeadmin.dto;
+
+import java.util.List;
+
+public class TreeNode {
+
+    private String id;
+
+    private String parentId;
+
+    private String name;
+
+    private List<TreeNode> children;
+
+    private Object extra;
+
+    public Object getExtra() {
+        return extra;
+    }
+
+    public void setExtra(Object extra) {
+        this.extra = extra;
+    }
+
+    public TreeNode(String id, String name, String parentId) {
+        this.id = id;
+        this.parentId = parentId;
+        this.name = name;
+    }
+
+    public TreeNode(String id, String name, String parentId, Object extra) {
+        this.id = id;
+        this.parentId = parentId;
+        this.name = name;
+        this.extra = extra;
+    }
+
+    public TreeNode(String id, String name, TreeNode parent) {
+        this.id = id;
+        this.parentId = parent.getId();
+        this.name = name;
+    }
+
+
+    public String getParentId() {
+        return parentId;
+    }
+
+    public void setParentId(String parentId) {
+        this.parentId = parentId;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public List<TreeNode> getChildren() {
+        return children;
+    }
+
+    public void setChildren(List<TreeNode> children) {
+        this.children = children;
+    }
+
+    @Override
+    public String toString() {
+        return "TreeNode{" +
+                "id='" + id + '\'' +
+                ", parentId='" + parentId + '\'' +
+                ", name='" + name + '\'' +
+                ", children=" + children +
+                '}';
+    }
+
+}  

+ 32 - 0
src/main/java/com/izouma/awesomeadmin/dto/wx/AccessToken.java

@@ -0,0 +1,32 @@
+package com.izouma.awesomeadmin.dto.wx;
+
+public class AccessToken {
+
+    private String token;
+
+    private int    expiresIn;
+
+
+    public String getToken() {
+
+        return token;
+    }
+
+
+    public void setToken(String token) {
+
+        this.token = token;
+    }
+
+
+    public int getExpiresIn() {
+
+        return expiresIn;
+    }
+
+
+    public void setExpiresIn(int expiresIn) {
+
+        this.expiresIn = expiresIn;
+    }
+}

+ 69 - 0
src/main/java/com/izouma/awesomeadmin/dto/wx/BaseMessage.java

@@ -0,0 +1,69 @@
+package com.izouma.awesomeadmin.dto.wx;
+
+/**
+ * ��Ϣ����
+ * @author Stephen
+ *
+ */
+public class BaseMessage {
+
+    //���շ�΢�ź�
+    private String ToUserName;
+
+    //���ͷ�΢�ź�
+    private String FromUserName;
+
+    //����ʱ��
+    private long   CreateTime;
+
+    //��Ϣ����
+    private String MsgType;
+
+
+    public String getToUserName() {
+
+        return ToUserName;
+    }
+
+
+    public void setToUserName(String toUserName) {
+
+        ToUserName = toUserName;
+    }
+
+
+    public String getFromUserName() {
+
+        return FromUserName;
+    }
+
+
+    public void setFromUserName(String fromUserName) {
+
+        FromUserName = fromUserName;
+    }
+
+
+    public long getCreateTime() {
+
+        return CreateTime;
+    }
+
+
+    public void setCreateTime(long createTime) {
+
+        CreateTime = createTime;
+    }
+
+
+    public String getMsgType() {
+
+        return MsgType;
+    }
+
+
+    public void setMsgType(String msgType) {
+
+        MsgType = msgType;
+    }
+}

+ 54 - 0
src/main/java/com/izouma/awesomeadmin/dto/wx/CustomServiceMessage.java

@@ -0,0 +1,54 @@
+package com.izouma.awesomeadmin.dto.wx;
+
+import com.fasterxml.jackson.annotation.JsonAutoDetect;
+import com.fasterxml.jackson.annotation.JsonInclude;
+
+@JsonAutoDetect
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class CustomServiceMessage {
+	
+	private String touser;
+	
+	private String msgtype;
+	
+	private TextMessage text;
+	
+	private NewsMessage news;
+
+	public String getTouser() {
+		return touser;
+	}
+
+	
+	public NewsMessage getNews() {
+		return news;
+	}
+
+
+	public void setNews(NewsMessage news) {
+		this.news = news;
+	}
+
+
+	public void setTouser(String touser) {
+		this.touser = touser;
+	}
+
+	public String getMsgtype() {
+		return msgtype;
+	}
+
+	public void setMsgtype(String msgtype) {
+		this.msgtype = msgtype;
+	}
+
+	public TextMessage getText() {
+		return text;
+	}
+
+	public void setText(TextMessage text) {
+		this.text = text;
+	}
+
+	
+}

+ 18 - 0
src/main/java/com/izouma/awesomeadmin/dto/wx/Image.java

@@ -0,0 +1,18 @@
+package com.izouma.awesomeadmin.dto.wx;
+
+public class Image {
+
+    private String MediaId;
+
+
+    public String getMediaId() {
+
+        return MediaId;
+    }
+
+
+    public void setMediaId(String mediaId) {
+
+        MediaId = mediaId;
+    }
+}

+ 18 - 0
src/main/java/com/izouma/awesomeadmin/dto/wx/ImageMessage.java

@@ -0,0 +1,18 @@
+package com.izouma.awesomeadmin.dto.wx;
+
+public class ImageMessage extends BaseMessage {
+
+    private Image Image;
+
+
+    public Image getImage() {
+
+        return Image;
+    }
+
+
+    public void setImage(Image image) {
+
+        Image = image;
+    }
+}

+ 74 - 0
src/main/java/com/izouma/awesomeadmin/dto/wx/Music.java

@@ -0,0 +1,74 @@
+package com.izouma.awesomeadmin.dto.wx;
+
+public class Music {
+
+    private String Title;
+
+    private String Description;
+
+    private String MusicUrl;
+
+    private String HQMusicUrl;
+
+    private String ThumbMediaId;
+
+
+    public String getTitle() {
+
+        return Title;
+    }
+
+
+    public void setTitle(String title) {
+
+        Title = title;
+    }
+
+
+    public String getDescription() {
+
+        return Description;
+    }
+
+
+    public void setDescription(String description) {
+
+        Description = description;
+    }
+
+
+    public String getMusicUrl() {
+
+        return MusicUrl;
+    }
+
+
+    public void setMusicUrl(String musicUrl) {
+
+        MusicUrl = musicUrl;
+    }
+
+
+    public String getHQMusicUrl() {
+
+        return HQMusicUrl;
+    }
+
+
+    public void setHQMusicUrl(String hQMusicUrl) {
+
+        HQMusicUrl = hQMusicUrl;
+    }
+
+
+    public String getThumbMediaId() {
+
+        return ThumbMediaId;
+    }
+
+
+    public void setThumbMediaId(String thumbMediaId) {
+
+        ThumbMediaId = thumbMediaId;
+    }
+}

+ 18 - 0
src/main/java/com/izouma/awesomeadmin/dto/wx/MusicMessage.java

@@ -0,0 +1,18 @@
+package com.izouma.awesomeadmin.dto.wx;
+
+public class MusicMessage extends BaseMessage {
+
+    private Music Music;
+
+
+    public Music getMusic() {
+
+        return Music;
+    }
+
+
+    public void setMusic(Music music) {
+
+        Music = music;
+    }
+}

+ 58 - 0
src/main/java/com/izouma/awesomeadmin/dto/wx/News.java

@@ -0,0 +1,58 @@
+package com.izouma.awesomeadmin.dto.wx;
+
+public class News {
+
+    private String Title;
+
+    private String Description;
+
+    private String Picurl;
+
+    private String Url;
+
+
+    public String getTitle() {
+
+        return Title;
+    }
+
+
+    public void setTitle(String title) {
+
+        Title = title;
+    }
+
+
+    public String getDescription() {
+
+        return Description;
+    }
+
+
+    public void setDescription(String description) {
+
+        Description = description;
+    }
+
+
+    public String getPicurl() {
+		return Picurl;
+	}
+
+
+	public void setPicurl(String picurl) {
+		Picurl = picurl;
+	}
+
+
+	public String getUrl() {
+
+        return Url;
+    }
+
+
+    public void setUrl(String url) {
+
+        Url = url;
+    }
+}

+ 25 - 0
src/main/java/com/izouma/awesomeadmin/dto/wx/NewsMessage.java

@@ -0,0 +1,25 @@
+package com.izouma.awesomeadmin.dto.wx;
+
+import java.util.List;
+
+import com.fasterxml.jackson.annotation.JsonAutoDetect;
+import com.fasterxml.jackson.annotation.JsonInclude;
+
+@JsonAutoDetect
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class NewsMessage {
+
+    private List <News> Articles;
+
+
+    public List <News> getArticles() {
+
+        return Articles;
+    }
+
+
+    public void setArticles(List <News> articles) {
+
+        Articles = articles;
+    }
+}

+ 24 - 0
src/main/java/com/izouma/awesomeadmin/dto/wx/TemplateData.java

@@ -0,0 +1,24 @@
+package com.izouma.awesomeadmin.dto.wx;
+
+public class TemplateData {
+
+    private String value;  
+    private String color;  
+  
+    public String getValue() {  
+        return value;  
+    }  
+  
+    public void setValue(String value) {  
+        this.value = value;  
+    }  
+  
+    public String getColor() {  
+        return color;  
+    }  
+  
+    public void setColor(String color) {  
+        this.color = color;  
+    }  
+	
+}

+ 47 - 0
src/main/java/com/izouma/awesomeadmin/dto/wx/TemplateMessage.java

@@ -0,0 +1,47 @@
+package com.izouma.awesomeadmin.dto.wx;
+
+import java.util.Map;
+
+public class TemplateMessage {
+	
+	 private String touser;  
+	  
+	    private String template_id;  
+	  
+	    private String url;  
+	  
+	    private Map<String, TemplateData> data;  
+	  
+	    public String getTouser() {  
+	        return touser;  
+	    }  
+	  
+	    public void setTouser(String touser) {  
+	        this.touser = touser;  
+	    }  
+	  
+	    public String getTemplate_id() {  
+	        return template_id;  
+	    }  
+	  
+	    public void setTemplate_id(String template_id) {  
+	        this.template_id = template_id;  
+	    }  
+	  
+	    public String getUrl() {  
+	        return url;  
+	    }  
+	  
+	    public void setUrl(String url) {  
+	        this.url = url;  
+	    }  
+	  
+	    public Map<String, TemplateData> getData() {  
+	        return data;  
+	    }  
+	  
+	    public void setData(Map<String, TemplateData> data) {  
+	        this.data = data;  
+	    }  
+
+}

+ 37 - 0
src/main/java/com/izouma/awesomeadmin/dto/wx/TextMessage.java

@@ -0,0 +1,37 @@
+package com.izouma.awesomeadmin.dto.wx;
+
+import com.fasterxml.jackson.annotation.JsonAutoDetect;
+import com.fasterxml.jackson.annotation.JsonInclude;
+
+@JsonAutoDetect
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class TextMessage extends BaseMessage {
+
+    private String Content;
+
+    private String MsgId;
+
+
+    public String getContent() {
+
+        return Content;
+    }
+
+
+    public void setContent(String content) {
+
+        Content = content;
+    }
+
+
+    public String getMsgId() {
+
+        return MsgId;
+    }
+
+
+    public void setMsgId(String msgId) {
+
+        MsgId = msgId;
+    }
+}

+ 30 - 0
src/main/java/com/izouma/awesomeadmin/frame/GenController.java

@@ -0,0 +1,30 @@
+package com.izouma.awesomeadmin.frame;
+
+import com.izouma.awesomeadmin.dto.Result;
+import org.springframework.stereotype.Controller;
+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.ResponseBody;
+
+
+/**
+ * 自动生成控制类
+ * Suo Chen Cheng
+ */
+@Controller
+@RequestMapping("/gen")
+public class GenController {
+
+
+    @RequestMapping(value = "/byTable", method = RequestMethod.GET)
+    @ResponseBody
+    public Result byTable(@RequestParam(value = "tableName") String tableName) {
+
+
+
+        return new Result(true, "生成成功");
+    }
+
+
+}

+ 2026 - 0
src/main/java/com/izouma/awesomeadmin/frame/gen/GenEntity.java

@@ -0,0 +1,2026 @@
+package com.izouma.awesomeadmin.frame.gen;
+
+import com.izouma.awesomeadmin.frame.util.StringUtil;
+import com.izouma.awesomeadmin.util.PropertiesFileLoader;
+import org.apache.commons.lang.StringUtils;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.sql.*;
+import java.util.Date;
+
+
+public class GenEntity {
+
+    private static boolean f_util = false; // 是否需要导入包java.util.*
+    private static boolean f_sql = false; // 是否需要导入包java.sql.*
+    private static boolean f_math = false;//是否需要导入包 java.math.BigDecimal
+
+
+    public static void GenAll(TableParams tableParams) {
+
+        String[] colnames; // 列名数组
+        String[] colTypes; //列名类型数组
+        String[] colComments;//列名注释数组mybatis-generator-core
+
+        int[] colSizes; //列名大小数组
+
+        String PK_NAME = "id";//主键名
+        Connection con = null;
+
+        //查要生成实体类的表
+        String sql = "select * from " + tableParams.getTabelName();
+        PreparedStatement pStemt = null;
+        try {
+
+            PropertiesFileLoader propertiesFileLoader = new PropertiesFileLoader();
+            String JDBC_URL = propertiesFileLoader.getProperties("properties/jdbc.properties", "jdbc.url");
+            String JDBC_NAME = propertiesFileLoader.getProperties("properties/jdbc.properties", "jdbc.username");
+            String JDBC_PASS = propertiesFileLoader.getProperties("properties/jdbc.properties", "jdbc.password");
+            String JDBC_DRIVER = propertiesFileLoader.getProperties("properties/jdbc.properties", "jdbc.driverClassName");
+
+            try {
+                Class.forName(JDBC_DRIVER);
+            } catch (ClassNotFoundException e1) {
+                // TODO Auto-generated catch block
+                e1.printStackTrace();
+            }
+
+
+            //con = DriverManager.getConnection(JdbcConfig.URL, JdbcConfig.NAME, JdbcConfig.PASS);
+            con = DriverManager.getConnection(JDBC_URL, JDBC_NAME, JDBC_PASS);
+
+            pStemt = con.prepareStatement(sql);
+
+            ResultSetMetaData rsmd = pStemt.getMetaData();
+
+            ResultSet pkRSet = con.getMetaData().getPrimaryKeys(con.getCatalog().toUpperCase(),
+                    null, tableParams.getTabelName());
+
+            while (pkRSet.next()) {
+                System.out.println(pkRSet.getString("COLUMN_NAME"));
+                PK_NAME = pkRSet.getString("COLUMN_NAME");
+            }
+
+
+            int size = rsmd.getColumnCount();   //统计列
+            colComments = new String[size];
+            colnames = new String[size];
+            colTypes = new String[size];
+            colSizes = new int[size];
+            for (int i = 0; i < size; i++) {
+                colnames[i] = rsmd.getColumnName(i + 1);
+                colTypes[i] = rsmd.getColumnTypeName(i + 1);
+
+                if (colTypes[i].equalsIgnoreCase("datetime") || colTypes[i].equalsIgnoreCase("timestamp")) {
+                    f_util = true;
+                }
+                if (colTypes[i].equalsIgnoreCase("image") || colTypes[i].equalsIgnoreCase("text")) {
+                    f_sql = true;
+                }
+                if (colTypes[i].equalsIgnoreCase("decimal") || colTypes[i].equalsIgnoreCase("numeric")
+                        || colTypes[i].equalsIgnoreCase("real") || colTypes[i].equalsIgnoreCase("money")
+                        || colTypes[i].equalsIgnoreCase("smallmoney")) {
+                    f_math = true;
+                }
+                colSizes[i] = rsmd.getColumnDisplaySize(i + 1);
+            }
+
+
+            //获取注释
+            ResultSet rs = pStemt.executeQuery("show full columns from " + tableParams.getTabelName());
+            int j = 0;
+            while (rs.next()) {
+                colComments[j] = (rs.getString("Comment"));
+                j++;
+            }
+
+
+            //如果生成实体
+            if (tableParams.isModelFlag()) {
+
+                createModelFile(tableParams, colnames, colTypes, colComments);
+            }
+
+            //如果生成数据层
+            if (tableParams.isDaoFlag()) {
+
+                createDaoClassFile(tableParams);
+                createDaoXmlFile(tableParams, colnames, colTypes, PK_NAME);
+            }
+
+            //如果生成服务层
+            if (tableParams.isServiceFlag()) {
+
+                createServiceFile(tableParams, PK_NAME);
+                createServiceImplFile(tableParams, PK_NAME);
+            }
+
+            //如果生成控制层
+            if (tableParams.isControllerFlag()) {
+
+                createControllerFile(tableParams, PK_NAME);
+            }
+
+
+            //如果生成JSP
+            if (tableParams.isJspFlag()) {
+                createVueByPageFile(tableParams, PK_NAME, colnames, colComments);
+                createVueEditFile(tableParams, PK_NAME, colnames, colComments);
+            }
+
+            //关闭链接
+            pStemt.close();
+            pkRSet.close();
+            con.close();
+
+        } catch (SQLException e) {
+            e.printStackTrace();
+        } finally {
+
+
+        }
+    }
+
+    private static void createJspEditFile(TableParams tableParams, String pk_name, String[] colnames) {
+        String jspEditContent = parseJspEdit(tableParams.getTabelName(), pk_name, colnames);
+
+        try {
+            File directory = new File("");
+
+            String fileName = directory.getAbsolutePath() + "/" + changeToFolder(tableParams.getJspTargetPackage()) + StringUtil.underlineToCamel(tableParams.getTabelName()) + ".jsp";
+            System.out.println("文件路径:" + fileName);
+            FileWriter fw = new FileWriter(fileName);
+            PrintWriter pw = new PrintWriter(fw);
+            pw.println(jspEditContent);
+            pw.flush();
+            pw.close();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
+
+    private static String parseJspEdit(String tabelName, String pkName, String[] colnames) {
+
+        StringBuffer sb = new StringBuffer();
+
+
+        String upTableName = StringUtil.initcap(tabelName);
+        String downTableName = StringUtil.underlineToCamel(tabelName);
+
+
+        sb.append("<%@ page contentType=\"text/html;charset=UTF-8\" language=\"java\" %>\r\n");
+        sb.append("<html>\r\n");
+
+        sb.append("<head>\r\n");
+        sb.append("\t<jsp:include page=\"head.jsp\"/>\r\n");
+
+
+        sb.append("\t<title>com.izouma.awesomeadmin.frame</title>\r\n");
+
+        sb.append("</head>\r\n");
+
+        sb.append("<body>\r\n");
+
+        sb.append("<jsp:include page=\"contentBefore.jsp\"/>\r\n");
+        sb.append("<template>\r\n");
+
+        sb.append("\t<el-form ref=\"form\" :model=\"row_info\" label-width=\"80px\">\r\n");
+
+
+        for (int i = 0; i < colnames.length; i++) {
+
+            if (!pkName.equalsIgnoreCase(colnames[i])) {
+
+                sb.append("\t\t<el-form-item label=\"" + StringUtil.underlineToCamel(colnames[i]) + "\">\r\n");
+                sb.append("\t\t\t<el-input v-model=\"row_info." + StringUtil.underlineToCamel(colnames[i]) + "\"></el-input>\r\n");
+                sb.append("\t\t</el-form-item>\r\n");
+            }
+
+        }
+
+
+        sb.append("\t\t<el-form-item>\r\n");
+        sb.append("\t\t\t<el-button type=\"primary\" @click=\"onSubmit\">{{edit?'保存':'立即创建'}}</el-button>\r\n");
+        sb.append("\t\t\t<el-button>取消</el-button>\r\n");
+        sb.append("\t</el-form-item>\r\n");
+        sb.append("\t</el-form>\r\n");
+        sb.append("</template>\r\n");
+
+
+        sb.append("<jsp:include page=\"contentAfter.jsp\"/>\r\n");
+        sb.append("</body>\r\n");
+
+
+        sb.append("<script>\r\n");
+
+        sb.append("\tfunction getQueryString(name) {\r\n");
+        sb.append("\t\tvar reg = new RegExp(\"(^|&)\" + name + \"=([^&]*)(&|$)\", \"i\");\r\n");
+        sb.append("\t\tvar r = window.location.search.substr(1).match(reg);\r\n");
+        sb.append("\t\tif (r != null) return unescape(r[2]);\r\n");
+        sb.append("\t\treturn null;\r\n");
+        sb.append("\t}\r\n");
+
+        sb.append("\tnew Vue({\r\n");
+        sb.append("\t\tel: '#app',\r\n");
+        sb.append("\t\tcreated: function () {\r\n");
+        sb.append("\t\t\tvar " + StringUtil.underlineToCamel(pkName) + " = getQueryString('" + StringUtil.underlineToCamel(pkName) + "');\r\n");
+        sb.append("\t\t\tif (" + StringUtil.underlineToCamel(pkName) + ") {\r\n");
+        sb.append("\t\t\t\t$.get({\r\n");
+        sb.append("\t\t\t\t\turl: '../" + downTableName + "/get" + upTableName + "',\r\n");
+        sb.append("\t\t\t\t\tdata: {\r\n");
+        sb.append("\t\t\t\t\t\t" + StringUtil.underlineToCamel(pkName) + ": " + StringUtil.underlineToCamel(pkName) + "\r\n");
+        sb.append("\t\t\t\t\t}\r\n");
+        sb.append("\t\t\t\t}).then(function (res) {\r\n");
+        sb.append("\t\t\t\t\tif (res.success) {\r\n");
+        sb.append("\t\t\t\t\t\tthis.edit = true;\r\n");
+        sb.append("\t\t\t\t\t\tthis.row_info = res.data;\r\n");
+        sb.append("\t\t\t\t\t}\r\n");
+        sb.append("\t\t\t\t}.bind(this));\r\n");
+        sb.append("\t\t\t}\r\n");
+        sb.append("\t\t},\r\n");
+
+        sb.append("\t\tdata: function () {\r\n");
+        sb.append("\t\t\treturn {\r\n");
+        sb.append("\t\t\t\tmenu: '0-0',\r\n");
+        sb.append("\t\t\t\tuser: {\r\n");
+        sb.append("\t\t\t\t\tid: '',\n\r\n");
+        sb.append("\t\t\t\t\tusername: 'admin',\r\n");
+        sb.append("\t\t\t\t\tavatar: ''\r\n");
+        sb.append("\t\t\t\t},\r\n");
+        sb.append("\t\t\t\tloading: false,\r\n");
+        sb.append("\t\t\t\tedit: false,\r\n");
+        sb.append("\t\t\t\ttab: 1,\r\n");
+        sb.append("\t\t\t\trow_info : {},\r\n");
+        sb.append("\t\t\t};\r\n");
+        sb.append("\t\t},\r\n");
+
+
+        sb.append("\t\tmethods: {\r\n");
+        sb.append("\t\t\tlogout: function () {\r\n");
+        sb.append("\t\t\t\tthis.$confirm('确定要注销吗?', '提示', {\r\n");
+        sb.append("\t\t\t\t\tconfirmButtonText: '确定',\r\n");
+        sb.append("\t\t\t\t\tcancelButtonText: '取消',\r\n");
+        sb.append("\t\t\t\t\ttype: 'info'\r\n");
+        sb.append("\t\t\t\t}).then(function () {\r\n");
+        sb.append("\t\t\t\t\tlocalStorage.removeItem('user');\r\n");
+        sb.append("\t\t\t\t\tthis.$router.push({path: '/login'});\r\n");
+        sb.append("\t\t\t\t}.bind(this)).catch(function (e) {\r\n");
+        sb.append("\r\n");
+        sb.append("\t\t\t\t});\r\n");
+        sb.append("\t\t\t},\r\n");
+
+        sb.append("\t\t\tonSubmit: function () {\r\n");
+        sb.append("\t\t\t\tvar data = JSON.parse(JSON.stringify(this.row_info));\r\n");
+        sb.append("\t\t\t\t$.post({\r\n");
+        sb.append("\t\t\t\t\turl: this.edit ? '../" + downTableName + "/update' : '../" + downTableName + "/save',\r\n");
+        sb.append("\t\t\t\t\tdata: data\r\n");
+        sb.append("\t\t\t\t}).then(function (res) {\r\n");
+        sb.append("\t\t\t\t\tif (res.success) {\r\n");
+        sb.append("\t\t\t\t\t\tif (!this.edit) {\r\n");
+        sb.append("\t\t\t\t\t\t\tthis.row_info." + StringUtil.underlineToCamel(pkName) + " = res.data;\r\n");
+        sb.append("\t\t\t\t\t\t}\r\n");
+        sb.append("\t\t\t\t\t\tthis.edit = true;\r\n");
+        sb.append("\t\t\t\t\t\tthis.$message.success(this.edit ? '保存成功' : '创建成功');\r\n");
+        sb.append("\t\t\t\t\t} else {\r\n");
+        sb.append("\t\t\t\t\t\tthis.$message.error(this.edit ? '保存失败' : '创建失败');\r\n");
+        sb.append("\t\t\t\t\t}\r\n");
+        sb.append("\t\t\t\t}.bind(this))\r\n");
+        sb.append("\t\t\t},\r\n");
+
+        sb.append("\t\t}\r\n");
+        sb.append("\t})\r\n");
+        sb.append("</script>\r\n");
+        sb.append("</html>\r\n");
+
+
+        return sb.toString();
+
+
+    }
+
+    private static void createVueEditFile(TableParams tableParams, String pk_name, String[] colnames, String[] colComments) {
+        String jspEditContent = parseVueEdit(tableParams.getTabelName(), pk_name, colnames, colComments);
+
+        try {
+            File directory = new File("");
+
+            String fileName = directory.getAbsolutePath() + "/" + changeToFolder(tableParams.getJspTargetPackage()) + StringUtil.underlineToCamel(tableParams.getTabelName()) + ".vue";
+            System.out.println("文件路径:" + fileName);
+            FileWriter fw = new FileWriter(fileName);
+            PrintWriter pw = new PrintWriter(fw);
+            pw.println(jspEditContent);
+            pw.flush();
+            pw.close();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * 生成VUE 编辑页面
+     *
+     * @param tabelName
+     * @param pkName
+     * @param colnames
+     * @param colComments
+     * @return
+     */
+    private static String parseVueEdit(String tabelName, String pkName, String[] colnames, String[] colComments) {
+
+        StringBuffer sb = new StringBuffer();
+
+
+        String upTableName = StringUtil.initcap(tabelName);
+        String downTableName = StringUtil.underlineToCamel(tabelName);
+
+
+        sb.append("<template>\r\n");
+
+        sb.append("\t<div>\r\n");
+        sb.append("\t\t<el-form :model=\"formData\" :rules=\"rules\" ref=\"form\" label-width=\"80px\" label-position=\"right\" size=\"small\"\r\n");
+        sb.append("\t\t\t\tstyle=\"max-width: 500px;\">\r\n");
+
+
+        sb.append("\t\t\r\n");
+        sb.append("\t\t\r\n");
+
+
+        for (int i = 0; i < colnames.length; i++) {
+
+            if (!pkName.equalsIgnoreCase(colnames[i])) {
+
+                sb.append("\t\t\t<el-form-item prop=\"" + StringUtil.underlineToCamel(colnames[i]) +
+                        "\" label=\"" + (StringUtils.isNotEmpty(colComments[i]) ? colComments[i].split(":")[0] : colnames[i]) + "\">\r\n");
+                sb.append("\t\t\t\t<el-input v-model=\"formData." + StringUtil.underlineToCamel(colnames[i]) + "\"></el-input>\r\n");
+                sb.append("\t\t\t</el-form-item>\r\n");
+            }
+
+        }
+
+
+        sb.append("\t\t\t<el-form-item>\r\n");
+        sb.append("\t\t\t\t<el-button @click=\"onSave\" :loading=\"$store.state.fetchingData\" type=\"primary\">保存</el-button>\r\n");
+        sb.append("\t\t\t\t<el-button @click=\"$router.go(-1)\">取消</el-button>\r\n");
+        sb.append("\t\t\t</el-form-item>\r\n");
+        sb.append("\t\t</el-form>\r\n");
+        sb.append("\t</div>\r\n");
+        sb.append("</template>\r\n");
+
+
+        /**
+         * script
+         */
+        sb.append("<script>\r\n");
+
+        sb.append("\texport default {\r\n");
+
+        /**
+         * created
+         */
+        sb.append("\t\tcreated() {\r\n");
+        sb.append("\t\t\tif (this.$route.query.id) {\r\n");
+        sb.append("\t\t\t\tthis.$http.get({\r\n");
+        sb.append("\t\t\t\t\turl: '/" + downTableName + "/get" + upTableName + "',\r\n");
+        sb.append("\t\t\t\t\tdata: {\r\n");
+        sb.append("\t\t\t\t\t\tid: this.$route.query.id\r\n");
+        sb.append("\t\t\t\t\t}\r\n");
+        sb.append("\t\t\t\t}).then(res => {\r\n");
+        sb.append("\t\t\t\t\tif (res.success) {\r\n");
+        sb.append("\t\t\t\t\t\tthis.formData = res.data;\r\n");
+        sb.append("\t\t\t\t\t}\r\n");
+        sb.append("\t\t\t\t})\r\n");
+        sb.append("\t\t\t}\r\n");
+        sb.append("\t\t},\r\n");
+
+
+        /**
+         * data
+         */
+        sb.append("\t\tdata() {\r\n");
+        sb.append("\t\t\treturn {\r\n");
+        sb.append("\t\t\t\tsaving: false,\r\n");
+        sb.append("\t\t\t\tformData: {},\r\n");
+
+        sb.append("\t\t\t\trules: {\r\n");
+        for (int i = 0; i < colnames.length; i++) {
+
+            if (!pkName.equalsIgnoreCase(colnames[i])) {
+
+                sb.append("\t\t\t\t\t" + StringUtil.underlineToCamel(colnames[i]) + ": [\r\n");
+                sb.append("\t\t\t\t\t\t{required: true, message: '请输入" + (StringUtils.isNotEmpty(colComments[i]) ? colComments[i].split(":")[0] : colnames[i]) + "', trigger: 'blur'},\r\n");
+                sb.append("\t\t\t\t\t],\r\n");
+            }
+
+        }
+        sb.append("\t\t\t\t},\r\n");
+
+        sb.append("\t\t\t}\r\n");
+        sb.append("\t\t},\r\n");
+
+
+        /**
+         * methods
+         */
+        sb.append("\tmethods: {\r\n");
+
+        /**
+         * onSave
+         */
+        sb.append("\t\t\tonSave() {\r\n");
+        sb.append("\t\t\t\tthis.$refs.form.validate((valid) => {\r\n");
+        sb.append("\t\t\t\t\tif (valid) {\r\n");
+        sb.append("\t\t\t\t\t\tthis.submit();\r\n");
+        sb.append("\t\t\t\t\t} else {\r\n");
+        sb.append("\t\t\t\t\t\treturn false;\r\n");
+        sb.append("\t\t\t\t\t}\r\n");
+        sb.append("\t\t\t\t});\r\n");
+        sb.append("\t\t\t},\r\n");
+
+        /**
+         * submit
+         */
+        sb.append("\t\t\tsubmit() {\r\n");
+        sb.append("\t\t\t\tthis.$http.post({\r\n");
+        sb.append("\t\t\t\t\turl: this.formData.id ? '/" + downTableName + "/update' : '/" + downTableName + "/save',\r\n");
+        sb.append("\t\t\t\t\tdata: this.formData\r\n");
+        sb.append("\t\t\t\t}).then(res => {\r\n");
+        sb.append("\t\t\t\t\tif (res.success) {\r\n");
+        sb.append("\t\t\t\t\t\tthis.$message.success('成功');\r\n");
+        sb.append("\t\t\t\t\t\tthis.$router.go(-1);\r\n");
+        sb.append("\t\t\t\t\t} else {\r\n");
+        sb.append("\t\t\t\t\t\tthis.$message.warning('失败')\r\n");
+        sb.append("\t\t\t\t\t}\r\n");
+        sb.append("\t\t\t\t});\r\n");
+        sb.append("\t\t\t}\r\n");
+
+
+        sb.append("\t\t}\r\n");
+        sb.append("\t}\r\n");
+        sb.append("</script>\r\n");
+
+
+        sb.append("<style lang=\"less\" scoped>\r\n");
+        sb.append("\t\r\n");
+        sb.append("</style>\r\n");
+        sb.append("\r\n");
+
+
+        return sb.toString();
+
+
+    }
+
+
+    private static void createJspByPageFile(TableParams tableParams, String pkName, String[] colnames) {
+        String jspByPageContent = parseJspByPage(tableParams.getTabelName(), pkName, colnames);
+
+        try {
+            File directory = new File("");
+
+            String fileName = directory.getAbsolutePath() + "/" + changeToFolder(tableParams.getJspTargetPackage()) + StringUtil.underlineToCamel(tableParams.getTabelName()) + "s.jsp";
+            System.out.println("文件路径:" + fileName);
+            FileWriter fw = new FileWriter(fileName);
+            PrintWriter pw = new PrintWriter(fw);
+            pw.println(jspByPageContent);
+            pw.flush();
+            pw.close();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
+
+    private static String parseJspByPage(String tabelName, String pkName, String[] colnames) {
+
+        StringBuffer sb = new StringBuffer();
+
+
+        String downTableName = StringUtil.underlineToCamel(tabelName);
+
+
+        sb.append("<%@ page contentType=\"text/html;charset=UTF-8\" language=\"java\" %>\r\n");
+        sb.append("<html>\r\n");
+
+        sb.append("<head>\r\n");
+        sb.append("\t<jsp:include page=\"head.jsp\"/>\r\n");
+
+
+        sb.append("\t<title>com.izouma.awesomeadmin.frame</title>\r\n");
+
+        sb.append("</head>\r\n");
+
+        sb.append("<body>\r\n");
+
+        sb.append("<jsp:include page=\"contentBefore.jsp\"/>\r\n");
+        sb.append("<template>\r\n");
+
+        sb.append("\t<div class=\"filters\">\r\n");
+        sb.append("\t\t<el-button type=\"primary\" @click=\"create()\">创建</el-button>\r\n");
+        sb.append("\t\t<div class=\"num\"> 共{{totalNumber}}标签</div>\r\n");
+        sb.append("\t</div>\r\n");
+        sb.append("\r\n");
+
+        sb.append("\t<el-table :data=\"rows\"\r\n");
+        sb.append("\t\t\tref=\"table\"\r\n");
+        sb.append("\t\t\tstyle=\"width: 100%\"\r\n");
+        sb.append("\t\t\telement-loading-text=\"拼命加载中\"\r\n");
+        sb.append("\t\t\tstripe\r\n");
+        sb.append("\t\t\tv-loading=\"loading\">\r\n");
+
+        sb.append("\t\t\t<el-table-column\r\n");
+        sb.append("\t\t\t\ttype=\"index\"\r\n");
+        sb.append("\t\t\t\twidth=\"70\"\r\n");
+        sb.append("\t\t\t\talign=\"center\">\r\n");
+        sb.append("\t\t\t</el-table-column>\r\n");
+
+        for (int i = 0; i < colnames.length; i++) {
+
+            if (!pkName.equalsIgnoreCase(colnames[i])) {
+
+                sb.append("\t\t<el-table-column\r\n");
+                sb.append("\t\t\t\tprop=\"" + StringUtil.underlineToCamel(colnames[i]) + "\"\r\n");
+                sb.append("\t\t\t\tlabel=\"" + StringUtil.underlineToCamel(colnames[i]) + "\"\r\n");
+                sb.append("\t\t\t\talign=\"center\">\r\n");
+                sb.append("\t\t</el-table-column>\r\n");
+            }
+
+        }
+
+
+        sb.append("\t\t<el-table-column\r\n");
+        sb.append("\t\t\t\t:context=\"_self\"\r\n");
+        sb.append("\t\t\t\twidth=\"150\"\r\n");
+        sb.append("\t\t\t\tinline-template\r\n");
+        sb.append("\t\t\t\tlabel=\"操作\"\r\n");
+        sb.append("\t\t\t\talign=\"center\">\r\n");
+        sb.append("\t\t\t<div>\r\n");
+        sb.append("\t\t\t\t<el-button size=\"small\" @click=\"editRow(row)\">编辑</el-button>\r\n");
+        sb.append("\t\t\t\t<el-button size=\"small\" type=\"danger\" @click=\"deleteRow(row)\">删除</el-button>\r\n");
+        sb.append("\t\t\t</div>\r\n");
+        sb.append("\t\t</el-table-column>\r\n");
+
+        sb.append("\t</el-table>\r\n");
+
+        sb.append("\t<div class=\"pagination-wrapper\" v-show=\"!loading\">\r\n");
+        sb.append("\t\t<el-pagination layout=\"sizes, prev, pager, next\" :page-size=\"pageSize\" :total=\"totalNumber\"\r\n");
+        sb.append("\t\t\t\t\t:page-size=\"pageSize\"\r\n");
+        sb.append("\t\t\t\t\t:current-page=\"currentPage\" @current-change=\"pageChange\" @size-change=\"sizeChange\">\r\n");
+        sb.append("\t\t</el-pagination>\r\n");
+        sb.append("\t</div>\r\n");
+
+        sb.append("</template>\r\n");
+
+
+        sb.append("<jsp:include page=\"contentAfter.jsp\"/>\r\n");
+        sb.append("</body>\r\n");
+
+
+        sb.append("<script>\r\n");
+
+        sb.append("\tfunction getQueryString(name) {\r\n");
+        sb.append("\t\tvar reg = new RegExp(\"(^|&)\" + name + \"=([^&]*)(&|$)\", \"i\");\r\n");
+        sb.append("\t\tvar r = window.location.search.substr(1).match(reg);\r\n");
+        sb.append("\t\tif (r != null) return unescape(r[2]);\r\n");
+        sb.append("\t\treturn null;\r\n");
+        sb.append("\t}\r\n");
+
+        sb.append("\tnew Vue({\r\n");
+        sb.append("\t\tel: '#app',\r\n");
+        sb.append("\t\tcreated: function () {\r\n");
+        sb.append("\t\t\tthis.getRows();\r\n");
+        sb.append("\t\t},\r\n");
+
+        sb.append("\t\tdata: function () {\r\n");
+        sb.append("\t\t\treturn {\r\n");
+        sb.append("\t\t\t\tmenu: '0-0',\r\n");
+        sb.append("\t\t\t\tuser: {\r\n");
+        sb.append("\t\t\t\t\tid: '',\n\r\n");
+        sb.append("\t\t\t\t\tusername: 'admin',\r\n");
+        sb.append("\t\t\t\t\tavatar: ''\r\n");
+        sb.append("\t\t\t\t},\r\n");
+        sb.append("\t\t\t\tloading: false,\r\n");
+        sb.append("\t\t\t\ttotalNumber: 0,\r\n");
+        sb.append("\t\t\t\ttotalPage: 0,\r\n");
+        sb.append("\t\t\t\tcurrentPage: 1,\r\n");
+        sb.append("\t\t\t\tpageSize: 20,\r\n");
+        sb.append("\t\t\t\trows: []\r\n");
+        sb.append("\t\t\t};\r\n");
+        sb.append("\t\t},\r\n");
+
+
+        sb.append("\t\tmethods: {\r\n");
+        sb.append("\t\t\tlogout: function () {\r\n");
+        sb.append("\t\t\t\tthis.$confirm('确定要注销吗?', '提示', {\r\n");
+        sb.append("\t\t\t\t\tconfirmButtonText: '确定',\r\n");
+        sb.append("\t\t\t\t\tcancelButtonText: '取消',\r\n");
+        sb.append("\t\t\t\t\ttype: 'info'\r\n");
+        sb.append("\t\t\t\t}).then(function () {\r\n");
+        sb.append("\t\t\t\t\tlocalStorage.removeItem('user');\r\n");
+        sb.append("\t\t\t\t\tthis.$router.push({path: '/login'});\r\n");
+        sb.append("\t\t\t\t}.bind(this)).catch(function (e) {\r\n");
+        sb.append("\r\n");
+        sb.append("\t\t\t\t});\r\n");
+        sb.append("\t\t\t},\r\n");
+
+        sb.append("\t\t\tgetRows: function () {\r\n");
+        sb.append("\t\t\t\t$.get({\r\n");
+        sb.append("\t\t\t\t\turl: '../" + downTableName + "/page',\r\n");
+        sb.append("\t\t\t\t\tdata: {\r\n");
+        sb.append("\t\t\t\t\t\tcurrentPage: this.currentPage,\r\n");
+        sb.append("\t\t\t\t\t\tpageNumber: this.pageSize\r\n");
+        sb.append("\t\t\t\t\t}\r\n");
+        sb.append("\t\t\t\t}).then(function (res) {\r\n");
+        sb.append("\t\t\t\t\tif (res.success) {\r\n");
+        sb.append("\t\t\t\t\t\tthis.totalNumber = res.data.page.totalNumber;\r\n");
+        sb.append("\t\t\t\t\t\tthis.rows = res.data.pp;\r\n");
+        sb.append("\t\t\t\t\t}\r\n");
+        sb.append("\t\t\t\t}.bind(this))\r\n");
+        sb.append("\t\t\t},\r\n");
+
+
+        sb.append("\t\t\tpageChange: function (page) {\r\n");
+        sb.append("\t\t\t\tthis.currentPage = page;\r\n");
+        sb.append("\t\t\t\tthis.getRows();\r\n");
+        sb.append("\t\t\t},\r\n");
+
+        sb.append("\t\t\tsizeChange: function (size) {\r\n");
+        sb.append("\t\t\t\tthis.pageSize = size;\r\n");
+        sb.append("\t\t\t\tthis.getRows();\r\n");
+        sb.append("\t\t\t},\r\n");
+
+        sb.append("\t\t\teditRow: function (row) {\r\n");
+        sb.append("\t\t\t\twindow.location = '" + downTableName + "?" + StringUtil.underlineToCamel(pkName) + "=' + row." + StringUtil.underlineToCamel(pkName) + ";\r\n");
+        sb.append("\t\t\t},\r\n");
+
+
+        sb.append("\t\t\tdeleteRow: function (row) {\r\n");
+        sb.append("\t\t\t\tthis.$confirm('确定要删除吗?', '提示', {\r\n");
+        sb.append("\t\t\t\t\tconfirmButtonText: '删除',\r\n");
+        sb.append("\t\t\t\t\tcancelButtonText: '取消',\r\n");
+        sb.append("\t\t\t\t\ttype: 'warning'\r\n");
+        sb.append("\t\t\t\t}).then(function () {\r\n");
+        sb.append("\t\t\t\t\treturn $.post({\r\n");
+        sb.append("\t\t\t\t\t\turl: '../" + downTableName + "/del',\r\n");
+        sb.append("\t\t\t\t\t\tdata: {\r\n");
+        sb.append("\t\t\t\t\t\t\t" + StringUtil.underlineToCamel(pkName) + ": row." + StringUtil.underlineToCamel(pkName) + "\r\n");
+        sb.append("\t\t\t\t\t\t}\r\n");
+        sb.append("\t\t\t\t\t})\r\n");
+        sb.append("\t\t\t\t}.bind(this)).then(function (res) {\r\n");
+        sb.append("\t\t\t\t\tif (res.success) {\r\n");
+        sb.append("\t\t\t\t\t\tthis.$message.success('删除成功');\r\n");
+        sb.append("\t\t\t\t\t\tthis.getRows();\r\n");
+        sb.append("\t\t\t\t\t} else {\r\n");
+        sb.append("\t\t\t\t\t\tthis.$message.error('删除失败');\r\n");
+        sb.append("\t\t\t\t\t}\r\n");
+        sb.append("\t\t\t\t}.bind(this)).catch(function () {\r\n");
+        sb.append("\r\n");
+        sb.append("\t\t\t\t});\r\n");
+        sb.append("\t\t\t},\r\n");
+
+
+        sb.append("\t\t\tcreate: function () {\r\n");
+        sb.append("\t\t\t\twindow.location = '" + downTableName + "';\r\n");
+        sb.append("\t\t\t}\r\n");
+
+
+        sb.append("\t\t}\r\n");
+        sb.append("\t})\r\n");
+        sb.append("</script>\r\n");
+        sb.append("</html>\r\n");
+
+
+        return sb.toString();
+
+    }
+
+    private static void createVueByPageFile(TableParams tableParams, String pkName, String[] colnames, String[] colComments) {
+        String jspByPageContent = parseVueByPage(tableParams.getTabelName(), pkName, colnames, colComments);
+
+        try {
+            File directory = new File("");
+
+            String fileName = directory.getAbsolutePath() + "/" + changeToFolder(tableParams.getJspTargetPackage()) + StringUtil.underlineToCamel(tableParams.getTabelName()) + "s.vue";
+            System.out.println("文件路径:" + fileName);
+            FileWriter fw = new FileWriter(fileName);
+            PrintWriter pw = new PrintWriter(fw);
+            pw.println(jspByPageContent);
+            pw.flush();
+            pw.close();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
+
+    private static String parseVueByPage(String tabelName, String pkName, String[] colnames, String[] colComments) {
+
+        StringBuffer sb = new StringBuffer();
+
+
+        String downTableName = StringUtil.underlineToCamel(tabelName);
+
+
+        sb.append("<template>\r\n");
+        sb.append("\t<div>\r\n");
+
+        /**
+         * 筛选部分
+         */
+        sb.append("\t\t<div class=\"filters-container\">\r\n");
+
+        /**
+         * 关键字筛选
+         */
+        sb.append("\t\t\t<el-input placeholder=\"关键字\" size=\"small\" v-model=\"filter1\" clearable class=\"filter-item\"></el-input>\r\n");
+
+        /**
+         * 下拉框筛选
+         */
+        sb.append("\t\t\t<el-select placeholder=\"选择框\" size=\"small\" v-model=\"filter2\" clearable class=\"filter-item\">\r\n");
+        sb.append("\t\t\t\t<el-option\r\n");
+        sb.append("\t\t\t\t\tlabel=\"值1\"\r\n");
+        sb.append("\t\t\t\t\tvalue=\"item1\">\r\n");
+        sb.append("\t\t\t\t</el-option>\r\n");
+        sb.append("\t\t\t\t<el-option\r\n");
+        sb.append("\t\t\t\t\tlabel=\"值2\"\r\n");
+        sb.append("\t\t\t\t\tvalue=\"item1\">\r\n");
+        sb.append("\t\t\t\t</el-option>\r\n");
+        sb.append("\t\t\t</el-select>\r\n");
+
+
+        sb.append("\t\t\t<el-button @click=\"getData\" type=\"primary\" size=\"small\" icon=\"el-icon-search\" class=\"filter-item\">搜索\r\n");
+        sb.append("\t\t\t</el-button>\r\n");
+        sb.append("\t\t\t<el-button @click=\"$router.push('/" + downTableName + "')\" type=\"primary\" size=\"small\" icon=\"el-icon-edit\"\r\n");
+        sb.append("\t\t\t\t\t\tclass=\"filter-item\">添加\r\n");
+        sb.append("\t\t\t</el-button>\r\n");
+
+        sb.append("\t\t\t<el-dropdown trigger=\"click\" size=\"medium\" class=\"table-column-filter\">\r\n");
+        sb.append("\t\t\t\t<span>\r\n");
+        sb.append("\t\t\t\t筛选数据<i class=\"el-icon-arrow-down el-icon--right\"></i>\r\n");
+        sb.append("\t\t\t\t</span>\r\n");
+        sb.append("\t\t\t\t<el-dropdown-menu slot=\"dropdown\" class=\"table-column-filter-wrapper\">\r\n");
+        sb.append("\t\t\t\t\t<el-checkbox v-for=\"item in tableColumns\" :key=\"item.value\" v-model=\"item.show\">{{item.label}}\r\n");
+        sb.append("\t\t\t\t\t</el-checkbox>\r\n");
+        sb.append("\t\t\t\t</el-dropdown-menu>\r\n");
+        sb.append("\t\t\t</el-dropdown>\r\n");
+
+        sb.append("\t\t</div>\r\n");
+
+
+/**
+ * table
+ *
+ */
+        sb.append("\t\t<el-table\r\n");
+        sb.append("\t\t\t:data=\"tableData\"\r\n");
+        sb.append("\t\t\t:height=\"tableHeight\"\r\n");
+        sb.append("\t\t\tref=\"table\">\r\n");
+        sb.append("\t\t\t<el-table-column\r\n");
+        sb.append("\t\t\t\tv-if=\"multipleMode\"\r\n");
+        sb.append("\t\t\t\talign=\"center\"\r\n");
+        sb.append("\t\t\t\ttype=\"selection\"\r\n");
+        sb.append("\t\t\t\twidth=\"50\">\r\n");
+        sb.append("\t\t\t</el-table-column>\r\n");
+
+        sb.append("\t\t\t<el-table-column\r\n");
+        sb.append("\t\t\t\ttype=\"index\"\r\n");
+        sb.append("\t\t\t\tmin-width=\"50\"\r\n");
+        sb.append("\t\t\t\talign=\"center\">\r\n");
+        sb.append("\t\t\t</el-table-column>\r\n");
+
+
+        for (int i = 0; i < colnames.length; i++) {
+
+            if (!pkName.equalsIgnoreCase(colnames[i])) {
+
+                sb.append("\t\t\t<el-table-column\r\n");
+                sb.append("\t\t\t\tv-if=\"isColumnShow('" + StringUtil.underlineToCamel(colnames[i]) + "')\"\r\n");
+                sb.append("\t\t\t\tprop=\"" + StringUtil.underlineToCamel(colnames[i]) + "\"\r\n");
+                sb.append("\t\t\t\tlabel=\"" + (StringUtils.isNotEmpty(colComments[i]) ? colComments[i].split(":")[0] : colnames[i]) + "\"\r\n");
+                sb.append("\t\t\t\tmin-width=\"300\">\r\n");
+                sb.append("\t\t</el-table-column>\r\n");
+            }
+
+        }
+
+
+        sb.append("\t\t\t<el-table-column\r\n");
+        sb.append("\t\t\t\tlabel=\"操作\"\r\n");
+        sb.append("\t\t\t\talign=\"center\"\r\n");
+        sb.append("\t\t\t\tfixed=\"right\">\r\n");
+        sb.append("\t\t\t\t<template slot-scope=\"scope\">\r\n");
+        sb.append("\t\t\t\t\t<el-button @click=\"editRow(scope.row)\" type=\"primary\" size=\"mini\" plain>编辑</el-button>\r\n");
+        sb.append("\t\t\t\t</template>\r\n");
+        sb.append("\t\t\t</el-table-column>\r\n");
+
+        sb.append("\t\t</el-table>\r\n");
+
+
+        /**
+         * 翻页和批量操作
+         */
+
+
+        sb.append("\t\t<div class=\"pagination-wrapper\">\r\n");
+
+        sb.append("\t\t\t<div class=\"multiple-mode-wrapper\">\r\n");
+        sb.append("\t\t\t\t<el-button size=\"small\" v-if=\"!multipleMode\" @click=\"toggleMultipleMode(true)\">批量编辑</el-button>\r\n");
+        sb.append("\t\t\t\t<el-button-group v-else>\r\n");
+        sb.append("\t\t\t\t\t<el-button size=\"small\" @click=\"operation1\">批量操作1</el-button>\r\n");
+        sb.append("\t\t\t\t\t<el-button size=\"small\" @click=\"operation2\">批量操作2</el-button>\r\n");
+        sb.append("\t\t\t\t\t<el-button size=\"small\" @click=\"toggleMultipleMode(false)\">取消</el-button>\r\n");
+        sb.append("\t\t\t\t</el-button-group>\r\n");
+        sb.append("\t\t\t</div>\r\n");
+
+        sb.append("\t\t\t<el-pagination\r\n");
+        sb.append("\t\t\t\tbackground\r\n");
+        sb.append("\t\t\t\t@size-change=\"pageSizeChange\"\r\n");
+        sb.append("\t\t\t\t@current-change=\"currentPageChange\"\r\n");
+        sb.append("\t\t\t\t:current-page=\"currentPage\"\r\n");
+        sb.append("\t\t\t\t:page-sizes=\"[10, 20, 30, 40, 50]\"\r\n");
+        sb.append("\t\t\t\t:page-size=\"pageSize\"\r\n");
+        sb.append("\t\t\t\tlayout=\"total, sizes, prev, pager, next, jumper\"\r\n");
+        sb.append("\t\t\t\t:total=\"totalNumber\">\r\n");
+        sb.append("\t\t\t</el-pagination>\r\n");
+
+        sb.append("\t\t</div>\r\n");
+        sb.append("\t</div>\r\n");
+        sb.append("</template>\r\n");
+
+
+        /**
+         * script
+         */
+        sb.append("<script>\r\n");
+
+        sb.append("\timport {mapState} from 'vuex'\r\n");
+
+        sb.append("\r\n");
+        sb.append("\texport default {\r\n");
+
+        /**
+         * created
+         */
+        sb.append("\t\tcreated() {\r\n");
+        sb.append("\t\t\tthis.getData();\r\n");
+        sb.append("\t\t},\r\n");
+
+        /**
+         * data
+         */
+        sb.append("\t\tdata() {\r\n");
+        sb.append("\t\t\treturn {\r\n");
+        sb.append("\t\t\t\ttotalNumber: 0,\r\n");
+        sb.append("\t\t\t\ttotalPage: 0,\r\n");
+        sb.append("\t\t\t\tcurrentPage: 1,\r\n");
+        sb.append("\t\t\t\tpageSize: 20,\r\n");
+        sb.append("\t\t\t\ttableData: [],\r\n");
+        sb.append("\t\t\t\tfilter1: '',\r\n");
+        sb.append("\t\t\t\tfilter2: '',\r\n");
+
+        sb.append("\t\t\t\ttableColumns: [\r\n");
+
+        for (int i = 0; i < colnames.length; i++) {
+
+            if (!pkName.equalsIgnoreCase(colnames[i])) {
+
+                sb.append("\t\t\t\t{\r\n");
+                sb.append("\t\t\t\t\tlabel: '" + (StringUtils.isNotEmpty(colComments[i]) ? colComments[i].split(":")[0] : colnames[i]) + "',\r\n");
+                sb.append("\t\t\t\t\tvalue: '" + StringUtil.underlineToCamel(colnames[i]) + "',\r\n");
+                sb.append("\t\t\t\t\tshow: true\r\n");
+                sb.append("\t\t\t\t},\r\n");
+            }
+
+        }
+
+        sb.append("\t\t\t\t],\r\n");
+        sb.append("\t\t\t\tmultipleMode: false\r\n");
+        sb.append("\t\t\t}\r\n");
+        sb.append("\t\t},\r\n");
+
+
+        /**
+         * computed
+         */
+        sb.append("\t\tcomputed: {\r\n");
+        sb.append("\t\t\t...mapState(['tableHeight']),\r\n");
+        sb.append("\t\t\tselection() {\r\n");
+        sb.append("\t\t\t\treturn this.$refs.table.selection.map(i => i.id);\r\n");
+        sb.append("\t\t\t}\r\n");
+        sb.append("\t\t},\r\n");
+
+        /**
+         * methods
+         */
+        sb.append("\t\tmethods: {\r\n");
+
+        /**
+         * pageSizeChange
+         */
+        sb.append("\t\t\tpageSizeChange(size) {\r\n");
+        sb.append("\t\t\t\tthis.pageSize = size;\r\n");
+        sb.append("\t\t\t\tthis.getData();\r\n");
+        sb.append("\t\t\t},\r\n");
+
+
+        /**
+         * currentPageChange
+         */
+        sb.append("\t\t\tcurrentPageChange(page) {\r\n");
+        sb.append("\t\t\t\tthis.currentPage = page;\r\n");
+        sb.append("\t\t\t\tthis.getData();\r\n");
+        sb.append("\t\t\t},\r\n");
+
+        /**
+         * getData
+         */
+        sb.append("\t\t\tgetData() {\r\n");
+        sb.append("\t\t\t\tthis.$http.get({\r\n");
+        sb.append("\t\t\t\t\turl: '/" + downTableName + "/page',\r\n");
+        sb.append("\t\t\t\t\tdata: {\r\n");
+        sb.append("\t\t\t\t\t\tcurrentPage: this.currentPage,\r\n");
+        sb.append("\t\t\t\t\t\tpageNumber: this.pageSize\r\n");
+        sb.append("\t\t\t\t\t}\r\n");
+        sb.append("\t\t\t\t}).then(res => {\r\n");
+        sb.append("\t\t\t\t\tif (res.success) {\r\n");
+        sb.append("\t\t\t\t\t\tthis.totalNumber = res.data.page.totalNumber;\r\n");
+        sb.append("\t\t\t\t\t\tthis.tableData = res.data.pp;\r\n");
+        sb.append("\t\t\t\t\t}\r\n");
+        sb.append("\t\t\t\t})\r\n");
+        sb.append("\t\t\t},\r\n");
+
+
+        /**
+         * isColumnShow
+         */
+        sb.append("\t\t\tisColumnShow(column) {\r\n");
+        sb.append("\t\t\t\tvar row = this.tableColumns.find(i => i.value === column);\r\n");
+        sb.append("\t\t\t\treturn row ? row.show : false;\r\n");
+        sb.append("\t\t\t},\r\n");
+
+        /**
+         * toggleMultipleMode
+         */
+        sb.append("\t\t\ttoggleMultipleMode(multipleMode) {\r\n");
+        sb.append("\t\t\t\tthis.multipleMode = multipleMode;\r\n");
+        sb.append("\t\t\t\tif (!multipleMode) {\r\n");
+        sb.append("\t\t\t\t\tthis.$refs.table.clearSelection();\r\n");
+        sb.append("\t\t\t\t}\r\n");
+        sb.append("\t\t\t},\r\n");
+
+
+        /**
+         * editRow
+         */
+        sb.append("\t\t\teditRow(row) {\r\n");
+        sb.append("\t\t\t\tthis.$router.push({\r\n");
+        sb.append("\t\t\t\t\tpath: '/" + downTableName + "',\r\n");
+        sb.append("\t\t\t\t\tquery: {\r\n");
+        sb.append("\t\t\t\t\t\tid: row.id\r\n");
+        sb.append("\t\t\t\t\t}\r\n");
+        sb.append("\t\t\t\t})\r\n");
+        sb.append("\t\t\t},\r\n");
+
+
+        /**
+         * operation1
+         */
+        sb.append("\t\t\toperation1() {\r\n");
+        sb.append("\t\t\t\tthis.$notify({\r\n");
+        sb.append("\t\t\t\t\ttitle: '提示',\r\n");
+        sb.append("\t\t\t\t\tmessage: this.selection\r\n");
+        sb.append("\t\t\t\t});\r\n");
+        sb.append("\t\t\t},\r\n");
+
+
+        /**
+         * operation2
+         */
+        sb.append("\t\t\toperation2() {\r\n");
+        sb.append("\t\t\t\tthis.$message('操作2');\r\n");
+        sb.append("\t\t\t}\r\n");
+
+
+        sb.append("\t\t}\r\n");
+        sb.append("\t}\r\n");
+
+
+        sb.append("</script>\r\n");
+        sb.append("<style lang=\"less\" scoped>\r\n");
+        sb.append("\r\n");
+        sb.append("</style>\r\n");
+
+        sb.append("\r\n");
+
+        return sb.toString();
+
+    }
+
+    private static void createDaoClassFile(TableParams tableParams) {
+
+        String daoClassContent = parseDaoClass(tableParams);
+
+        try {
+            File directory = new File("");
+
+            String fileName = directory.getAbsolutePath() + "/src/main/java/" + changeToFolder(tableParams.getDaoTargetPackage()) + StringUtil.initcap(tableParams.getTabelName()) + "Mapper.java";
+            System.out.println("文件路径:" + fileName);
+            FileWriter fw = new FileWriter(fileName);
+            PrintWriter pw = new PrintWriter(fw);
+            pw.println(daoClassContent);
+            pw.flush();
+            pw.close();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
+
+    private static String parseDaoClass(TableParams tableParams) {
+
+        StringBuffer sb = new StringBuffer();
+
+
+        sb.append("package " + tableParams.getDaoTargetPackage() + ";\r\n");
+        sb.append("\r\n");
+
+        sb.append("import java.util.List;\r\n");
+        sb.append("import java.util.Map;\r\n");
+
+
+        sb.append("\r\n");
+
+        sb.append("import org.springframework.stereotype.Repository;\r\n");
+
+        sb.append("\r\n");
+
+        sb.append("import " + tableParams.getModelTargetPackage() + "." + StringUtil.initcap(tableParams.getTabelName()) + ";\r\n");
+        sb.append("\r\n");
+        //注释部分
+        sb.append("/**\r\n");
+        sb.append(" * " + tableParams.getTabelName() + " Dao接口\r\n");
+        sb.append(" * " + new Date() + "  Suo Chen Cheng\r\n");
+        sb.append(" */ \r\n");
+
+        //注解
+        sb.append("@Repository(\"" + tableParams.getDaoTargetPackage() + "." + StringUtil.initcap(tableParams.getTabelName()) + "Mapper\")\r\n");
+
+        //实体部分
+        sb.append("public interface " + StringUtil.initcap(tableParams.getTabelName()) + "Mapper {\r\n");
+
+        sb.append("\r\n");
+
+
+        sb.append("\tint deleteByPrimaryKey(Integer id);\r\n");
+        sb.append("\r\n");
+        sb.append("\tint insertSelective(" + StringUtil.initcap(tableParams.getTabelName()) + " record);\r\n");
+        sb.append("\r\n");
+        sb.append("\t" + StringUtil.initcap(tableParams.getTabelName()) + " selectByPrimaryKey(Integer id);\r\n");
+        sb.append("\r\n");
+        sb.append("\tint updateByPrimaryKeySelective(" + StringUtil.initcap(tableParams.getTabelName()) + " record);\r\n");
+        sb.append("\r\n");
+        sb.append("\tList <" + StringUtil.initcap(tableParams.getTabelName()) + "> queryAll" + StringUtil.initcap(tableParams.getTabelName()) + "(" + StringUtil.initcap(tableParams.getTabelName()) + " record);\r\n");
+        sb.append("\r\n");
+        sb.append("\tList <" + StringUtil.initcap(tableParams.getTabelName()) + "> query" + StringUtil.initcap(tableParams.getTabelName()) + "sByPage(Map <String, Object> parameter);\r\n");
+        sb.append("\r\n");
+        sb.append("\tint delete(String id);\r\n");
+        sb.append("\r\n");
+        sb.append("\t" + StringUtil.initcap(tableParams.getTabelName()) + " query" + StringUtil.initcap(tableParams.getTabelName()) + "(" + StringUtil.initcap(tableParams.getTabelName()) + " record);\r\n");
+
+
+        sb.append("}\r\n");
+
+        //System.out.println(sb.toString());
+        return sb.toString();
+    }
+
+    /**
+     * 生成 dao XML
+     *
+     * @param tableParams
+     * @param colnames
+     * @param colTypes
+     * @param pkName
+     */
+    private static void createDaoXmlFile(TableParams tableParams, String[] colnames, String[] colTypes, String pkName) {
+
+        String daoXmlContent = parseDaoXml(colnames, colTypes, tableParams, pkName);
+
+        try {
+            File directory = new File("");
+
+            String fileName = directory.getAbsolutePath() + "/src/main/java/" + changeToFolder(tableParams.getDaoTargetPackage()) + StringUtil.initcap(tableParams.getTabelName()) + "Mapper.xml";
+            System.out.println("文件路径:" + fileName);
+            FileWriter fw = new FileWriter(fileName);
+            PrintWriter pw = new PrintWriter(fw);
+            pw.println(daoXmlContent);
+            pw.flush();
+            pw.close();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * 解析 数据层 xml
+     *
+     * @param colnames
+     * @param colTypes
+     * @param tableParams
+     * @param pkName
+     * @return
+     */
+    private static String parseDaoXml(String[] colnames, String[] colTypes, TableParams tableParams, String pkName) {
+        StringBuffer sb = new StringBuffer();
+
+
+        sb.append("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\r\n");
+        sb.append("<!DOCTYPE mapper PUBLIC \"-//mybatis.org//DTD Mapper 3.0//EN\" \"http://mybatis.org/dtd/mybatis-3-mapper.dtd\" >\r\n");
+
+        sb.append("<mapper namespace=\"" + tableParams.getDaoTargetPackage() + "." + StringUtil.initcap(tableParams.getTabelName()) + "Mapper\" >\r\n");
+
+
+        parseDaoBaseResultMap(sb, colnames, colTypes, pkName, tableParams);
+        parseDaoBaseColumnList(sb, colnames);
+        parseDaoSelectByPrimaryKey(sb, pkName, tableParams.getTabelName());
+        parseDaoDeleteByPrimaryKey(sb, pkName, tableParams.getTabelName());
+        parseDaoInsertSelective(sb, pkName, tableParams, colnames, colTypes);
+        parseDaoUpdateByPrimaryKeySelective(sb, pkName, tableParams, colnames, colTypes);
+        parseDaoQueryByPage(sb, pkName, tableParams, colnames);
+        parseDaoQueryAll(sb, pkName, tableParams, colnames);
+        parseDaoQueryOne(sb, tableParams, colnames);
+        parseDaoDelete(sb, tableParams.getTabelName(), pkName);
+
+        sb.append("</mapper>\r\n");
+        return sb.toString();
+    }
+
+    /**
+     * 逻辑删除
+     *
+     * @param sb
+     * @param tabelName
+     * @param pkName
+     */
+    private static void parseDaoDelete(StringBuffer sb, String tabelName, String pkName) {
+        sb.append("\t<update id=\"delete\">\r\n");
+        sb.append("\t\tUPDATE " + tabelName + " SET del_flag = 'Y'\r\n");
+        sb.append("\t\t<where>\r\n");
+        sb.append("\t\t\tAND " + pkName + " = #{" + StringUtil.underlineToCamel(pkName) + "}\r\n");
+        sb.append("\t\t</where>\r\n");
+        sb.append("\t</update>\r\n");
+
+    }
+
+    /**
+     * 解析,查询一个
+     *
+     * @param sb
+     * @param tableParams
+     * @param colnames
+     */
+    private static void parseDaoQueryOne(StringBuffer sb, TableParams tableParams, String[] colnames) {
+        sb.append("\t<select id=\"query" + StringUtil.initcap(tableParams.getTabelName()) + "\" parameterType=\"java.util.Map\" resultType=\"" + tableParams.getModelTargetPackage() + "." + StringUtil.initcap(tableParams.getTabelName()) + "\">\r\n");
+        sb.append("\t\tselect <include refid=\"Base_Column_List\"/> from " + tableParams.getTabelName() + "\r\n");
+        sb.append("\t\t<where>\r\n");
+        sb.append("\t\t\tand del_flag = 'N'\r\n");
+
+
+        for (int i = 0; i < colnames.length; i++) {
+
+
+            sb.append("\t\t\t<if test=\"" + StringUtil.underlineToCamel(colnames[i]) + " != null and !&quot;&quot;.equals(" + StringUtil.underlineToCamel(colnames[i]) + ")\">\r\n");
+            sb.append("\t\t\t\tand " + colnames[i] + " = #{" + StringUtil.underlineToCamel(colnames[i]) + "}\t\n");
+            sb.append("\t\t\t</if>\r\n");
+
+        }
+
+
+        sb.append("\t\t</where>\r\n");
+        sb.append("\t\tLIMIT 1\r\n");
+        sb.append("\t</select>\r\n");
+    }
+
+    /**
+     * 解析,查询所有
+     *
+     * @param sb
+     * @param pkName
+     * @param tableParams
+     * @param colnames
+     */
+    private static void parseDaoQueryAll(StringBuffer sb, String pkName, TableParams tableParams, String[] colnames) {
+
+        sb.append("\t<select id=\"queryAll" + StringUtil.initcap(tableParams.getTabelName()) + "\" parameterType=\"java.util.Map\" resultType=\"" + tableParams.getModelTargetPackage() + "." + StringUtil.initcap(tableParams.getTabelName()) + "\">\r\n");
+        sb.append("\t\tselect <include refid=\"Base_Column_List\"/> from " + tableParams.getTabelName() + "\r\n");
+        sb.append("\t\t<where>\r\n");
+        sb.append("\t\t\tand del_flag = 'N'\r\n");
+
+
+        for (int i = 0; i < colnames.length; i++) {
+
+
+            sb.append("\t\t\t<if test=\"" + StringUtil.underlineToCamel(colnames[i]) + " != null and !&quot;&quot;.equals(" + StringUtil.underlineToCamel(colnames[i]) + ")\">\r\n");
+            sb.append("\t\t\t\tand " + colnames[i] + " = #{" + StringUtil.underlineToCamel(colnames[i]) + "}\t\n");
+            sb.append("\t\t\t</if>\r\n");
+
+        }
+
+
+        sb.append("\t\t</where>\r\n");
+        sb.append("\t\torder by " + pkName + " desc\r\n");
+        sb.append("\t</select>\r\n");
+    }
+
+    /**
+     * 解析,翻页查询
+     *
+     * @param sb
+     * @param pkName
+     * @param tableParams
+     * @param colnames
+     */
+    private static void parseDaoQueryByPage(StringBuffer sb, String pkName, TableParams tableParams, String[] colnames) {
+
+        sb.append("\t<select id=\"query" + StringUtil.initcap(tableParams.getTabelName()) + "sByPage\" parameterType=\"java.util.Map\" resultType=\"" + tableParams.getModelTargetPackage() + "." + StringUtil.initcap(tableParams.getTabelName()) + "\">\r\n");
+        sb.append("\t\tselect <include refid=\"Base_Column_List\"/> from " + tableParams.getTabelName() + "\r\n");
+        sb.append("\t\t<where>\r\n");
+        sb.append("\t\t\tand del_flag = 'N'\r\n");
+
+
+        for (int i = 0; i < colnames.length; i++) {
+
+
+            sb.append("\t\t\t<if test=\"record." + StringUtil.underlineToCamel(colnames[i]) + " != null and !&quot;&quot;.equals(record." + StringUtil.underlineToCamel(colnames[i]) + ")\">\r\n");
+            sb.append("\t\t\t\tand " + colnames[i] + " = #{record." + StringUtil.underlineToCamel(colnames[i]) + "}\t\n");
+            sb.append("\t\t\t</if>\r\n");
+
+        }
+
+
+        sb.append("\t\t</where>\r\n");
+        sb.append("\t\torder by " + pkName + " desc\r\n");
+        sb.append("\t</select>\r\n");
+
+    }
+
+    /**
+     * 解析,根据主键更新字段
+     *
+     * @param sb
+     * @param pkName
+     * @param tableParams
+     * @param colnames
+     * @param colTypes
+     */
+    private static void parseDaoUpdateByPrimaryKeySelective(StringBuffer sb, String pkName, TableParams tableParams, String[] colnames, String[] colTypes) {
+        sb.append("\t<update id=\"updateByPrimaryKeySelective\" parameterType=\"" + tableParams.getModelTargetPackage() + "." + StringUtil.initcap(tableParams.getTabelName()) + "\" >\r\n");
+        sb.append("\t\tupdate " + tableParams.getTabelName() + "\r\n");
+        sb.append("\t\t<set >\r\n");
+
+
+        for (int i = 0; i < colnames.length; i++) {
+
+            if (!pkName.equalsIgnoreCase(colnames[i])) {
+
+                sb.append("\t\t\t<if test=\"" + StringUtil.underlineToCamel(colnames[i]) + " != null\" >\r\n");
+                sb.append("\t\t\t\t" + colnames[i] + " = #{" + StringUtil.underlineToCamel(colnames[i]) + ",jdbcType=" + StringUtil.sqlType2JdbcType(colTypes[i]) + "},\t\n");
+                sb.append("\t\t\t</if>\r\n");
+            }
+
+        }
+
+        sb.append("\t\t</set>\r\n");
+        sb.append("\t\twhere " + pkName + " = #{" + StringUtil.underlineToCamel(pkName) + ",jdbcType=INTEGER}\r\n");
+        sb.append("\t</update>\r\n");
+    }
+
+    /**
+     * 解析,插入数据
+     *
+     * @param sb
+     * @param pkName
+     * @param tableParams
+     * @param colnames
+     * @param colTypes
+     */
+    private static void parseDaoInsertSelective(StringBuffer sb, String pkName, TableParams tableParams, String[] colnames, String[] colTypes) {
+        sb.append("\t<insert id=\"insertSelective\" parameterType=\"" + tableParams.getModelTargetPackage() + "." + StringUtil.initcap(tableParams.getTabelName()) + "\" useGeneratedKeys=\"true\" keyProperty=\"" + StringUtil.underlineToCamel(pkName) + "\">\r\n");
+        sb.append("\t\tinsert into " + tableParams.getTabelName() + "\r\n");
+        sb.append("\t\t<trim prefix=\"(\" suffix=\")\" suffixOverrides=\",\" >\r\n");
+
+
+        for (int i = 0; i < colnames.length; i++) {
+
+            sb.append("\t\t\t<if test=\"" + StringUtil.underlineToCamel(colnames[i]) + " != null\" >\r\n");
+            sb.append("\t\t\t\t" + colnames[i] + ",\t\n");
+            sb.append("\t\t\t</if>\r\n");
+
+        }
+
+        sb.append("\t\t</trim>\r\n");
+        sb.append("\t\t<trim prefix=\"values (\" suffix=\")\" suffixOverrides=\",\" >\r\n");
+        for (int i = 0; i < colnames.length; i++) {
+
+            sb.append("\t\t\t<if test=\"" + StringUtil.underlineToCamel(colnames[i]) + " != null\" >\r\n");
+            sb.append("\t\t\t\t#{" + StringUtil.underlineToCamel(colnames[i]) + ",jdbcType=" + StringUtil.sqlType2JdbcType(colTypes[i]) + "},\t\n");
+            sb.append("\t\t\t</if>\r\n");
+
+        }
+
+        sb.append("\t\t</trim>\r\n");
+        sb.append("\t</insert>\r\n");
+
+    }
+
+    /**
+     * 解析,根据主键删除
+     *
+     * @param sb
+     * @param pkName
+     * @param tabelName
+     */
+    private static void parseDaoDeleteByPrimaryKey(StringBuffer sb, String pkName, String tabelName) {
+
+        sb.append("\t<delete id=\"deleteByPrimaryKey\" parameterType=\"java.lang.Integer\" >\r\n");
+        sb.append("\t\tdelete from " + tabelName + "\r\n");
+        sb.append("\t\twhere " + pkName + " = #{" + StringUtil.underlineToCamel(pkName) + ",jdbcType=INTEGER}\r\n");
+        sb.append("\t</delete>\r\n");
+    }
+
+    /**
+     * 解析根据主键查询
+     *
+     * @param sb
+     * @param pkName
+     * @param tabelName
+     */
+    private static void parseDaoSelectByPrimaryKey(StringBuffer sb, String pkName, String tabelName) {
+        sb.append("\t<select id=\"selectByPrimaryKey\" resultMap=\"BaseResultMap\" parameterType=\"java.lang.Integer\" >\r\n");
+        sb.append("\t\tselect\r\n");
+        sb.append("\t\t<include refid=\"Base_Column_List\" />\r\n");
+        sb.append("\t\tfrom " + tabelName + "\r\n");
+        sb.append("\t\twhere " + pkName + " = #{" + StringUtil.underlineToCamel(pkName) + ",jdbcType=INTEGER}\r\n");
+        sb.append("\t</select>\r\n");
+
+    }
+
+    /**
+     * 解析baseColumnList
+     *
+     * @param sb
+     * @param colnames
+     */
+    private static void parseDaoBaseColumnList(StringBuffer sb, String[] colnames) {
+
+        sb.append("\t<sql id=\"Base_Column_List\" >\r\n");
+        sb.append("\t\t");
+        for (int i = 0; i < colnames.length; i++) {
+
+
+            if (i == colnames.length - 1) {
+
+                sb.append(" " + colnames[i] + "\r\n");
+            } else {
+
+                sb.append(" " + colnames[i] + ",");
+            }
+
+        }
+
+        sb.append("\t</sql>\r\n");
+
+    }
+
+    /**
+     * 解析BaseResultMap
+     *
+     * @param sb
+     * @param colnames
+     * @param colTypes
+     * @param pkName
+     * @param tableParams
+     */
+    private static void parseDaoBaseResultMap(StringBuffer sb, String[] colnames, String[] colTypes, String pkName, TableParams tableParams) {
+        sb.append("\t<resultMap id=\"BaseResultMap\" type=\"" + tableParams.getModelTargetPackage() + "." + StringUtil.initcap(tableParams.getTabelName()) + "\" >\r\n");
+        sb.append("\t\t<id column=\"" + pkName + "\" property=\"" + StringUtil.underlineToCamel(pkName) + "\" jdbcType=\"INTEGER\" />\r\n");
+        for (int i = 0; i < colnames.length; i++) {
+
+            if (!pkName.equalsIgnoreCase(colnames[i])) {
+
+                sb.append("\t\t<result column=\"" + colnames[i] + "\" property=\"" + StringUtil.underlineToCamel(colnames[i]) + "\" jdbcType=\"" + StringUtil.sqlType2JdbcType(colTypes[i]) + "\" />\r\n");
+            }
+
+        }
+
+        sb.append("\t</resultMap>\r\n");
+    }
+
+    private static void createServiceFile(TableParams tableParams, String pkName) {
+        String serviceContent = parseService(tableParams, pkName);
+
+        try {
+            File directory = new File("");
+
+            String fileName = directory.getAbsolutePath() + "/src/main/java/" + changeToFolder(tableParams.getServiceTargetPackage()) + StringUtil.initcap(tableParams.getTabelName()) + "Service.java";
+            System.out.println("文件路径:" + fileName);
+            FileWriter fw = new FileWriter(fileName);
+            PrintWriter pw = new PrintWriter(fw);
+            pw.println(serviceContent);
+            pw.flush();
+            pw.close();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * 生成service interface
+     *
+     * @param tableParams
+     * @param pkName
+     * @return
+     */
+    private static String parseService(TableParams tableParams, String pkName) {
+
+        StringBuffer sb = new StringBuffer();
+
+
+        sb.append("package " + tableParams.getServiceTargetPackage() + ";\r\n");
+        sb.append("\r\n");
+
+        sb.append("import java.util.List;\r\n");
+
+        sb.append("\r\n");
+
+        sb.append("import " + tableParams.getBasePackage() + ".dto.Page;\r\n");
+        sb.append("import " + tableParams.getModelTargetPackage() + "." + StringUtil.initcap(tableParams.getTabelName()) + ";\r\n");
+
+        sb.append("\r\n");
+
+        //注释部分
+        sb.append("/**\r\n");
+        sb.append(" * " + tableParams.getTabelName() + " service接口类\r\n");
+        sb.append(" * " + new Date() + "  Suo Chen Cheng\r\n");
+        sb.append(" */ \r\n");
+
+        //实体部分
+        sb.append("public interface " + StringUtil.initcap(tableParams.getTabelName()) + "Service {\r\n");
+        sb.append("\r\n");
+
+
+        sb.append("\tList <" + StringUtil.initcap(tableParams.getTabelName()) + "> get" + StringUtil.initcap(tableParams.getTabelName()) + "List(" + StringUtil.initcap(tableParams.getTabelName()) + " record);\r\n");
+        sb.append("\r\n");
+
+        sb.append("\tList <" + StringUtil.initcap(tableParams.getTabelName()) + "> get" + StringUtil.initcap(tableParams.getTabelName()) + "ByPage(Page page, " + StringUtil.initcap(tableParams.getTabelName()) + " record);\r\n");
+        sb.append("\r\n");
+
+        sb.append("\t" + StringUtil.initcap(tableParams.getTabelName()) + " get" + StringUtil.initcap(tableParams.getTabelName()) + "ById(String " + StringUtil.underlineToCamel(pkName) + ");\r\n");
+        sb.append("\r\n");
+
+        sb.append("\t" + StringUtil.initcap(tableParams.getTabelName()) + " get" + StringUtil.initcap(tableParams.getTabelName()) + "(" + StringUtil.initcap(tableParams.getTabelName()) + " record);\r\n");
+        sb.append("\r\n");
+
+        sb.append("\tboolean create" + StringUtil.initcap(tableParams.getTabelName()) + "(" + StringUtil.initcap(tableParams.getTabelName()) + " record);\r\n");
+        sb.append("\r\n");
+
+        sb.append("\tboolean delete" + StringUtil.initcap(tableParams.getTabelName()) + "(String " + StringUtil.underlineToCamel(pkName) + ");\r\n");
+        sb.append("\r\n");
+
+        sb.append("\tboolean update" + StringUtil.initcap(tableParams.getTabelName()) + "(" + StringUtil.initcap(tableParams.getTabelName()) + " record);\r\n");
+        sb.append("\r\n");
+
+        sb.append("}\r\n");
+
+        return sb.toString();
+
+    }
+
+    private static void createServiceImplFile(TableParams tableParams, String pkName) {
+        String serviceImplContent = parseServiceImpl(tableParams, pkName);
+
+        try {
+            File directory = new File("");
+
+            String fileName = directory.getAbsolutePath() + "/src/main/java/" + changeToFolder(tableParams.getImplTargetPackage()) + StringUtil.initcap(tableParams.getTabelName()) + "ServiceImpl.java";
+            System.out.println("文件路径:" + fileName);
+            FileWriter fw = new FileWriter(fileName);
+            PrintWriter pw = new PrintWriter(fw);
+            pw.println(serviceImplContent);
+            pw.flush();
+            pw.close();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
+
+    private static String parseServiceImpl(TableParams tableParams, String pkName) {
+        StringBuffer sb = new StringBuffer();
+
+        String upTableName = StringUtil.initcap(tableParams.getTabelName());
+        String downTableName = StringUtil.underlineToCamel(tableParams.getTabelName());
+
+        sb.append("package " + tableParams.getImplTargetPackage() + ";\r\n");
+        sb.append("\r\n");
+
+        sb.append("import java.util.HashMap;\r\n");
+        sb.append("import java.util.List;\r\n");
+        sb.append("import java.util.Map;\r\n");
+
+        sb.append("\r\n");
+
+        sb.append("import org.apache.log4j.Logger;\r\n");
+        sb.append("import org.springframework.beans.factory.annotation.Autowired;\r\n");
+        sb.append("import org.springframework.stereotype.Service;\r\n");
+        sb.append("\r\n");
+
+
+        sb.append("import " + tableParams.getBasePackage() + ".constant.AppConstant;\r\n");
+        sb.append("import " + tableParams.getDaoTargetPackage() + "." + upTableName + "Mapper;\r\n");
+        sb.append("import " + tableParams.getBasePackage() + ".dto.Page;\r\n");
+        sb.append("import " + tableParams.getModelTargetPackage() + "." + upTableName + ";\r\n");
+        sb.append("import " + tableParams.getServiceTargetPackage() + "." + upTableName + "Service;\r\n");
+
+        sb.append("\r\n");
+
+        //注释部分
+        sb.append("/**\r\n");
+        sb.append(" * " + tableParams.getTabelName() + " service接口实现类\r\n");
+        sb.append(" * " + new Date() + "  Suo Chen Cheng\r\n");
+        sb.append(" */ \r\n");
+
+        //实体部分
+        sb.append("@Service\r\n");
+        sb.append("public class " + upTableName + "ServiceImpl implements " + upTableName + "Service {\r\n");
+        sb.append("\r\n");
+
+
+        //日志部分
+        sb.append("\tprivate static Logger   logger = Logger.getLogger(" + upTableName + "ServiceImpl.class);\r\n");
+        sb.append("\r\n");
+
+
+        //引入mapper
+        sb.append("\t@Autowired\r\n");
+        sb.append("\tprivate " + upTableName + "Mapper " + downTableName + "Mapper;\r\n");
+        sb.append("\r\n");
+
+
+        //get ALL
+        sb.append("\t@Override\r\n");
+        sb.append("\tpublic List <" + upTableName + "> get" + upTableName + "List(" + upTableName + " record) {\r\n");
+        sb.append("\r\n");
+        sb.append("\t\tlogger.info(\"get" + upTableName + "List\");\r\n");
+        sb.append("\t\ttry {\r\n");
+        sb.append("\r\n");
+        sb.append("\t\t\treturn " + downTableName + "Mapper.queryAll" + upTableName + "(record);\r\n");
+        sb.append("\t\t} catch (Exception e) {\r\n");
+        sb.append("\t\t\tlogger.error(\"get" + upTableName + "List\", e);\r\n");
+        sb.append("\t\t}\r\n");
+        sb.append("\r\n");
+        sb.append("\t\treturn null;\r\n");
+        sb.append("\t}\r\n");
+        sb.append("\r\n");
+
+        //ByPage
+        sb.append("\t@Override\r\n");
+        sb.append("\tpublic List <" + upTableName + "> get" + upTableName + "ByPage(Page page, " + upTableName + " record) {\r\n");
+        sb.append("\r\n");
+        sb.append("\t\tlogger.info(\"get" + upTableName + "ByPage\");\r\n");
+        sb.append("\t\ttry {\r\n");
+        sb.append("\r\n");
+        sb.append("\t\t\tMap <String, Object> parameter = new HashMap <String, Object>();\r\n");
+        sb.append("\t\t\tparameter.put(\"record\", record);\r\n");
+        sb.append("\t\t\tparameter.put(AppConstant.PAGE, page);\r\n");
+        sb.append("\r\n");
+        sb.append("\t\t\treturn " + downTableName + "Mapper.query" + upTableName + "sByPage(parameter);\r\n");
+        sb.append("\t\t} catch (Exception e) {\r\n");
+        sb.append("\t\t\tlogger.error(\"get" + upTableName + "ByPage\", e);\r\n");
+        sb.append("\t\t}\r\n");
+        sb.append("\r\n");
+        sb.append("\t\treturn null;\r\n");
+        sb.append("\t}\r\n");
+        sb.append("\r\n");
+
+
+        //selectByPrimaryKey
+        sb.append("\t@Override\r\n");
+        sb.append("\tpublic " + upTableName + " get" + upTableName + "ById(String " + StringUtil.underlineToCamel(pkName) + ") {\r\n");
+        sb.append("\r\n");
+        sb.append("\t\tlogger.info(\"get" + upTableName + "ById\");\r\n");
+        sb.append("\t\ttry {\r\n");
+        sb.append("\r\n");
+        sb.append("\t\t\treturn " + downTableName + "Mapper.selectByPrimaryKey(Integer.valueOf(" + StringUtil.underlineToCamel(pkName) + "));\r\n");
+        sb.append("\t\t} catch (Exception e) {\r\n");
+        sb.append("\t\t\tlogger.error(\"get" + upTableName + "ById\", e);\r\n");
+        sb.append("\t\t}\r\n");
+        sb.append("\r\n");
+        sb.append("\t\treturn null;\r\n");
+        sb.append("\t}\r\n");
+        sb.append("\r\n");
+
+
+        //getOne
+        sb.append("\t@Override\r\n");
+        sb.append("\tpublic " + upTableName + " get" + upTableName + "(" + upTableName + " record) {\r\n");
+        sb.append("\r\n");
+        sb.append("\t\tlogger.info(\"get" + upTableName + "\");\r\n");
+        sb.append("\t\ttry {\r\n");
+        sb.append("\r\n");
+        sb.append("\t\t\treturn " + downTableName + "Mapper.query" + upTableName + "(record);\r\n");
+        sb.append("\t\t} catch (Exception e) {\r\n");
+        sb.append("\t\t\tlogger.error(\"get" + upTableName + "\", e);\r\n");
+        sb.append("\t\t}\r\n");
+        sb.append("\r\n");
+        sb.append("\t\treturn null;\r\n");
+        sb.append("\t}\r\n");
+        sb.append("\r\n");
+
+
+        //create
+        sb.append("\t@Override\r\n");
+        sb.append("\tpublic boolean create" + upTableName + "(" + upTableName + " record) {\r\n");
+        sb.append("\r\n");
+        sb.append("\t\tlogger.info(\"create" + upTableName + "\");\r\n");
+        sb.append("\t\ttry {\r\n");
+        sb.append("\r\n");
+        sb.append("\t\t\tint updates = " + downTableName + "Mapper.insertSelective(record);\r\n");
+        sb.append("\r\n");
+        sb.append("\t\t\tif (updates > 0) {\r\n");
+        sb.append("\t\t\t\treturn true;\r\n");
+        sb.append("\t\t\t}\r\n");
+        sb.append("\t\t} catch (Exception e) {\r\n");
+        sb.append("\t\t\tlogger.error(\"create" + upTableName + "\", e);\r\n");
+        sb.append("\t\t}\r\n");
+        sb.append("\r\n");
+        sb.append("\t\treturn false;\r\n");
+        sb.append("\t}\r\n");
+        sb.append("\r\n");
+
+
+        //delete
+        sb.append("\t@Override\r\n");
+        sb.append("\tpublic boolean delete" + upTableName + "(String " + StringUtil.underlineToCamel(pkName) + ") {\r\n");
+        sb.append("\r\n");
+        sb.append("\t\tlogger.info(\"delete" + upTableName + "\");\r\n");
+        sb.append("\t\ttry {\r\n");
+        sb.append("\r\n");
+        sb.append("\t\t\tint updates = " + downTableName + "Mapper.delete(" + StringUtil.underlineToCamel(pkName) + ");\r\n");
+        sb.append("\r\n");
+        sb.append("\t\t\tif (updates > 0) {\r\n");
+        sb.append("\t\t\t\treturn true;\r\n");
+        sb.append("\t\t\t}\r\n");
+        sb.append("\t\t} catch (Exception e) {\r\n");
+        sb.append("\t\t\tlogger.error(\"delete" + upTableName + "\", e);\r\n");
+        sb.append("\t\t}\r\n");
+        sb.append("\r\n");
+        sb.append("\t\treturn false;\r\n");
+        sb.append("\t}\r\n");
+        sb.append("\r\n");
+
+
+        //update
+        sb.append("\t@Override\r\n");
+        sb.append("\tpublic boolean update" + upTableName + "(" + upTableName + " record) {\r\n");
+        sb.append("\r\n");
+        sb.append("\t\tlogger.info(\"update" + upTableName + "\");\r\n");
+        sb.append("\t\ttry {\r\n");
+        sb.append("\r\n");
+        sb.append("\t\t\tint updates = " + downTableName + "Mapper.updateByPrimaryKeySelective(record);\r\n");
+        sb.append("\r\n");
+        sb.append("\t\t\tif (updates > 0) {\r\n");
+        sb.append("\t\t\t\treturn true;\r\n");
+        sb.append("\t\t\t}\r\n");
+        sb.append("\t\t} catch (Exception e) {\r\n");
+        sb.append("\t\t\tlogger.error(\"update" + upTableName + "\", e);\r\n");
+        sb.append("\t\t}\r\n");
+        sb.append("\r\n");
+        sb.append("\t\treturn false;\r\n");
+        sb.append("\t}\r\n");
+        sb.append("\r\n");
+
+        sb.append("}\r\n");
+
+        return sb.toString();
+    }
+
+    private static void createControllerFile(TableParams tableParams, String pkName) {
+        String controllerContent = parseController(tableParams, pkName);
+
+        try {
+            File directory = new File("");
+
+            String fileName = directory.getAbsolutePath() + "/src/main/java/" + changeToFolder(tableParams.getControllerTargetPackage()) + StringUtil.initcap(tableParams.getTabelName()) + "Controller.java";
+            System.out.println("文件路径:" + fileName);
+            FileWriter fw = new FileWriter(fileName);
+            PrintWriter pw = new PrintWriter(fw);
+            pw.println(controllerContent);
+            pw.flush();
+            pw.close();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * 控制类
+     *
+     * @param tableParams
+     * @param pkName
+     * @return
+     */
+    private static String parseController(TableParams tableParams, String pkName) {
+
+        StringBuffer sb = new StringBuffer();
+
+        String upTableName = StringUtil.initcap(tableParams.getTabelName());
+        String downTableName = StringUtil.underlineToCamel(tableParams.getTabelName());
+
+        sb.append("package " + tableParams.getControllerTargetPackage() + ";\r\n");
+        sb.append("\r\n");
+
+        sb.append("import java.util.HashMap;\r\n");
+        sb.append("import java.util.List;\r\n");
+        sb.append("import java.util.Map;\r\n");
+
+        sb.append("\r\n");
+
+        sb.append("import org.springframework.beans.factory.annotation.Autowired;\r\n");
+        sb.append("import org.springframework.stereotype.Controller;\r\n");
+        sb.append("import org.springframework.web.bind.annotation.RequestMapping;\r\n");
+        sb.append("import org.springframework.web.bind.annotation.RequestMethod;\r\n");
+        sb.append("import org.springframework.web.bind.annotation.RequestParam;\r\n");
+        sb.append("import org.springframework.web.bind.annotation.ResponseBody;\r\n");
+        sb.append("\r\n");
+
+
+        sb.append("import " + tableParams.getBasePackage() + ".constant.AppConstant;\r\n");
+        sb.append("import " + tableParams.getBasePackage() + ".dto.Page;\r\n");
+        sb.append("import " + tableParams.getBasePackage() + ".dto.Result;\r\n");
+        sb.append("import " + tableParams.getModelTargetPackage() + "." + upTableName + ";\r\n");
+        sb.append("import " + tableParams.getServiceTargetPackage() + "." + upTableName + "Service;\r\n");
+
+        sb.append("\r\n");
+
+        //注释部分
+        sb.append("/**\r\n");
+        sb.append(" * " + tableParams.getTabelName() + " controller类\r\n");
+        sb.append(" * " + new Date() + "  Suo Chen Cheng\r\n");
+        sb.append(" */ \r\n");
+
+        //实体部分
+        sb.append("@Controller\r\n");
+        sb.append("@RequestMapping(\"/" + downTableName + "\")\r\n");
+        sb.append("public class " + upTableName + "Controller extends BaseController  {\r\n");
+        sb.append("\r\n");
+
+
+        //引入
+        sb.append("\t@Autowired\r\n");
+        sb.append("\tprivate " + upTableName + "Service " + downTableName + "Service;\r\n");
+        sb.append("\r\n");
+
+
+        //get ALL
+        sb.append("\t/**\r\n");
+        sb.append("\t * <p>获取全部记录。</p>\r\n");
+        sb.append("\t */ \r\n");
+        sb.append("\t@RequestMapping(value = \"/all\", method = RequestMethod.GET)\r\n");
+        sb.append("\t@ResponseBody\r\n");
+        sb.append("\tpublic Result all(" + upTableName + " record) {\r\n");
+        sb.append("\r\n");
+        sb.append("\t\tList <" + upTableName + "> pp = " + downTableName + "Service.get" + upTableName + "List(record);\r\n");
+        sb.append("\t\treturn new Result(true, pp);\r\n");
+        sb.append("\t}\r\n");
+        sb.append("\r\n");
+
+
+        //get By id
+        sb.append("\t/**\r\n");
+        sb.append("\t * <p>根据Id。</p>\r\n");
+        sb.append("\t */ \r\n");
+        sb.append("\t@RequestMapping(value = \"/get" + upTableName + "\", method = RequestMethod.GET)\r\n");
+        sb.append("\t@ResponseBody\r\n");
+        sb.append("\tpublic Result get" + upTableName + "(@RequestParam(required = false, value = \"" + StringUtil.underlineToCamel(pkName) + "\") String " + StringUtil.underlineToCamel(pkName) + ") {\r\n");
+        sb.append("\r\n");
+        sb.append("\t\t" + upTableName + " data = " + downTableName + "Service.get" + upTableName + "ById(" + StringUtil.underlineToCamel(pkName) + ");\r\n");
+        sb.append("\t\treturn new Result(true, data);\r\n");
+        sb.append("\t}\r\n");
+        sb.append("\r\n");
+
+
+        //getOne
+        sb.append("\t/**\r\n");
+        sb.append("\t * <p>根据条件获取。</p>\r\n");
+        sb.append("\t */ \r\n");
+        sb.append("\t@RequestMapping(value = \"/getOne\", method = RequestMethod.GET)\r\n");
+        sb.append("\t@ResponseBody\r\n");
+        sb.append("\tpublic Result getOne(" + upTableName + " record) {\r\n");
+        sb.append("\r\n");
+        sb.append("\t\t" + upTableName + " data = " + downTableName + "Service.get" + upTableName + "(record);\r\n");
+        sb.append("\t\treturn new Result(true, data);\r\n");
+        sb.append("\t}\r\n");
+        sb.append("\r\n");
+
+
+        //page
+        sb.append("\t/**\r\n");
+        sb.append("\t * <p>分页查询。</p>\r\n");
+        sb.append("\t */ \r\n");
+        sb.append("\t@RequestMapping(value = \"/page\", method = RequestMethod.GET)\r\n");
+        sb.append("\t@ResponseBody\r\n");
+        sb.append("\tpublic Result page(Page page, " + upTableName + " record) {\r\n");
+        sb.append("\r\n");
+        sb.append("\t\tMap <String, Object> result = new HashMap <>();\r\n");
+        sb.append("\r\n");
+        sb.append("\t\tList <" + upTableName + "> pp = " + downTableName + "Service.get" + upTableName + "ByPage(page, record);\r\n");
+        sb.append("\r\n");
+        sb.append("\t\tresult.put(AppConstant.PAGE, page);\r\n");
+        sb.append("\t\tresult.put(\"pp\", pp);\r\n");
+        sb.append("\t\treturn new Result(true, result);\r\n");
+        sb.append("\t}\r\n");
+        sb.append("\r\n");
+
+
+        //save
+        sb.append("\t/**\r\n");
+        sb.append("\t * <p>保存。</p>\r\n");
+        sb.append("\t */ \r\n");
+        sb.append("\t@RequestMapping(value = \"/save\", method = RequestMethod.POST)\r\n");
+        sb.append("\t@ResponseBody\r\n");
+        sb.append("\tpublic Result save(" + upTableName + " record) {\r\n");
+        sb.append("\r\n");
+        sb.append("\t\tboolean num = " + downTableName + "Service.create" + upTableName + "(record);\r\n");
+        sb.append("\t\tif (num) {\r\n");
+        sb.append("\t\t\treturn new Result(true, record.get" + StringUtil.initcap(pkName) + "());\r\n");
+        sb.append("\t\t}\r\n");
+        sb.append("\t\treturn new Result(false, \"保存异常\");\r\n");
+        sb.append("\t}\r\n");
+        sb.append("\r\n");
+
+        //update
+        sb.append("\t/**\r\n");
+        sb.append("\t * <p>更新信息。</p>\r\n");
+        sb.append("\t */ \r\n");
+        sb.append("\t@RequestMapping(value = \"/update\", method = RequestMethod.POST)\r\n");
+        sb.append("\t@ResponseBody\r\n");
+        sb.append("\tpublic Result update" + upTableName + "(" + upTableName + " record) {\r\n");
+        sb.append("\r\n");
+        sb.append("\t\tboolean num = " + downTableName + "Service.update" + upTableName + "(record);\r\n");
+        sb.append("\t\tif (num) {\r\n");
+        sb.append("\t\t\treturn new Result(true, \"保存成功\");\r\n");
+        sb.append("\t\t}\r\n");
+        sb.append("\t\treturn new Result(false, \"保存异常\");\r\n");
+        sb.append("\t}\r\n");
+        sb.append("\r\n");
+
+
+        //del
+        sb.append("\t/**\r\n");
+        sb.append("\t * <p>删除。</p>\r\n");
+        sb.append("\t */ \r\n");
+        sb.append("\t@RequestMapping(value = \"/del\", method = RequestMethod.POST)\r\n");
+        sb.append("\t@ResponseBody\r\n");
+        sb.append("\tpublic Result delete" + upTableName + "(@RequestParam(required = true, value = \"" + StringUtil.underlineToCamel(pkName) + "\") String " + StringUtil.underlineToCamel(pkName) + ") {\r\n");
+        sb.append("\r\n");
+        sb.append("\t\tboolean num = " + downTableName + "Service.delete" + upTableName + "(" + StringUtil.underlineToCamel(pkName) + ");\r\n");
+        sb.append("\t\tif (num) {\r\n");
+        sb.append("\t\t\treturn new Result(true, \"删除成功\");\r\n");
+        sb.append("\t\t}\r\n");
+        sb.append("\t\treturn new Result(false, \"删除异常\");\r\n");
+        sb.append("\t}\r\n");
+        sb.append("\r\n");
+
+
+        sb.append("}\r\n");
+
+        return sb.toString();
+
+
+    }
+
+    /**
+     * 生成对象model文件
+     *
+     * @param tableParams 表
+     * @param colnames    字段名
+     * @param colTypes    字段类型
+     * @param colComments 字段注释
+     */
+    private static void createModelFile(TableParams tableParams, String[] colnames, String[] colTypes, String[] colComments) {
+        String modelContent = parseModel(colnames, colTypes, tableParams, colComments);
+
+        try {
+            File directory = new File("");
+
+            String fileName = directory.getAbsolutePath() + "/src/main/java/" + changeToFolder(tableParams.getModelTargetPackage()) + StringUtil.initcap(tableParams.getTabelName()) + ".java";
+            System.out.println("文件路径:" + fileName);
+            FileWriter fw = new FileWriter(fileName);
+            PrintWriter pw = new PrintWriter(fw);
+            pw.println(modelContent);
+            pw.flush();
+            pw.close();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
+
+    public static String changeToFolder(String packageName) {
+
+        return packageName.replaceAll("\\.", "\\/") + "/";
+    }
+
+    /**
+     * 功能:生成实体类主体代码
+     *
+     * @return
+     */
+    public static String parseModel(String[] colnames, String[] colTypes, TableParams tableParams, String[] colComments) {
+        StringBuffer sb = new StringBuffer();
+
+
+        sb.append("package " + tableParams.getModelTargetPackage() + ";\r\n");
+        sb.append("\r\n");
+
+        //判断是否导入工具包
+        if (f_util) {
+            sb.append("import java.util.*;\r\n");
+        }
+        if (f_sql) {
+            sb.append("import java.sql.*;\r\n");
+        }
+
+        if (f_math) {
+            sb.append("import java.math.*;\r\n");
+        }
+
+        sb.append("\r\n");
+
+        sb.append("import com.fasterxml.jackson.annotation.JsonAutoDetect;\r\n");
+        sb.append("import com.fasterxml.jackson.annotation.JsonInclude;\r\n");
+
+        sb.append("\r\n");
+
+        //注释部分
+        sb.append("/**\r\n");
+        sb.append(" * " + tableParams.getTabelName() + " 实体类\r\n");
+        sb.append(" * " + new Date() + "  Suo Chen Cheng\r\n");
+        sb.append(" */ \r\n");
+
+        //注解
+        sb.append("@JsonAutoDetect\r\n");
+        sb.append("@JsonInclude(JsonInclude.Include.NON_NULL)\r\n");
+
+        //实体部分
+        sb.append("public class " + StringUtil.initcap(tableParams.getTabelName()) + "{\r\n");
+        sb.append("\r\n");
+
+        processModelAllAttrs(sb, colnames, colTypes, colComments);//属性
+        processModelAllMethod(sb, colnames, colTypes);//get set方法
+        sb.append("}\r\n");
+
+        //System.out.println(sb.toString());
+        return sb.toString();
+    }
+
+    /**
+     * 功能:生成所有属性
+     *
+     * @param sb
+     */
+    public static void processModelAllAttrs(StringBuffer sb, String[] colnames, String[] colTypes, String[] colComments) {
+
+        for (int i = 0; i < colnames.length; i++) {
+/**
+ *
+ */
+            sb.append("/**\r\n");
+            //获取注释第一个为列名,分割符 __
+            sb.append("* \t " + (StringUtils.isNotEmpty(colComments[i]) ? colComments[i] : colnames[i]) + "\r\n");
+            sb.append("*/\r\n");
+            sb.append("\tprivate " + StringUtil.sqlType2JavaType(colTypes[i]) + " " + StringUtil.underlineToCamel(colnames[i]) + ";\r\n\r\n");
+        }
+
+    }
+
+    /**
+     * 功能:生成所有方法
+     *
+     * @param sb
+     */
+    public static void processModelAllMethod(StringBuffer sb, String[] colnames, String[] colTypes) {
+
+        for (int i = 0; i < colnames.length; i++) {
+            sb.append("\tpublic void set" + StringUtil.initcap(colnames[i]) + "(" + StringUtil.sqlType2JavaType(colTypes[i]) + " " +
+                    StringUtil.underlineToCamel(colnames[i]) + "){\r\n");
+            sb.append("\t\tthis." + StringUtil.underlineToCamel(colnames[i]) + "=" + StringUtil.underlineToCamel(colnames[i]) + ";\r\n");
+            sb.append("\t}\r\n\r\n");
+            sb.append("\tpublic " + StringUtil.sqlType2JavaType(colTypes[i]) + " get" + StringUtil.initcap(colnames[i]) + "(){\r\n");
+            sb.append("\t\treturn " + StringUtil.underlineToCamel(colnames[i]) + ";\r\n");
+            sb.append("\t}\r\n\r\n");
+        }
+
+    }
+
+
+}

+ 16 - 0
src/main/java/com/izouma/awesomeadmin/frame/gen/JdbcConfig.java

@@ -0,0 +1,16 @@
+package com.izouma.awesomeadmin.frame.gen;
+
+/**
+ * 数据库连接
+ */
+public interface JdbcConfig {
+
+    //数据库连接
+    String URL = "jdbc:mysql://120.55.131.232:3306/jee_zouma";
+
+    String NAME = "microball";
+
+    String PASS = "2wsx@WSX#EDC";
+
+    String DRIVER = "com.mysql.jdbc.Driver";
+}

+ 60 - 0
src/main/java/com/izouma/awesomeadmin/frame/gen/RunTool.java

@@ -0,0 +1,60 @@
+package com.izouma.awesomeadmin.frame.gen;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class RunTool {
+
+	/**
+	 * 出口 TODO
+	 *
+	 * @param args
+	 */
+	public static void main(String[] args) {
+
+		// 表名
+		List<String> tableNames = new ArrayList<>();
+//		 tableNames.add("share");
+		 tableNames.add("gen_code_model");
+//		 tableNames.add("version_control");
+
+		for (int i = 0; i < tableNames.size(); i++) {
+			TableParams tableParams = new TableParams();
+
+			tableParams.setTabelName(tableNames.get(i));
+			// model路径
+			tableParams.setModelTargetPackage("com.izouma.awesomeadmin.model");
+			// dao路径
+			tableParams.setDaoTargetPackage("com.izouma.awesomeadmin.dao");
+			// service 路径
+			tableParams.setServiceTargetPackage("com.izouma.awesomeadmin.service");
+			// service实现 路径
+			tableParams.setImplTargetPackage("com.izouma.awesomeadmin.service.impl");
+			// controller 路径
+			tableParams.setControllerTargetPackage("com.izouma.awesomeadmin.web");
+
+			// base 路径
+			tableParams.setBasePackage("com.izouma.awesomeadmin");
+
+			// jsp 路径
+			tableParams.setJspTargetPackage("src.main.vue.src.pages");
+
+			// model 开关
+			tableParams.setModelFlag(true);
+			// dao 开关
+			tableParams.setDaoFlag(true);
+			// service 开关
+			tableParams.setServiceFlag(true);
+
+			// controller开关
+			tableParams.setControllerFlag(true);
+
+			// jsp开关
+			tableParams.setJspFlag(true);
+
+			// 执行方法
+			GenEntity.GenAll(tableParams);
+		}
+
+	}
+}

Неке датотеке нису приказане због велике количине промена