From 5ae03cab2b50915fe326c1b65b8f918653d228f0 Mon Sep 17 00:00:00 2001
From: Zhu Zhonghua <zhonghua@qq.com>
Date: 星期二, 08 四月 2025 22:45:30 +0800
Subject: [PATCH] 修改数据库为postgres

---
 aps-modules/aps-system/src/main/resources/mapper/system/SysDictDataMapper.xml    |    4 
 aps-modules/aps-system/src/main/resources/mapper/system/SysMenuMapper.xml        |   16 
 aps-modules/aps-system/src/main/resources/mapper/system/SysLogininforMapper.xml  |    2 
 aps-modules/aps-system/src/main/resources/mapper/system/SysPostMapper.xml        |    4 
 aps-modules/aps-gen/pom.xml                                                      |    9 
 aps-modules/aps-gen/src/main/resources/mapper/generator/GenTableColumnMapper.xml |    4 
 sql/aps_pg.sql                                                                   | 1132 +++++++++++++++++++++++++++++++++++++++++++++++
 aps-modules/aps-system/pom.xml                                                   |    6 
 aps-modules/aps-job/src/main/resources/mapper/job/SysJobLogMapper.xml            |    2 
 aps-modules/aps-system/src/main/resources/mapper/system/SysConfigMapper.xml      |    4 
 aps-modules/aps-gen/src/main/resources/mapper/generator/GenTableMapper.xml       |    4 
 aps-modules/aps-job/pom.xml                                                      |    9 
 aps-modules/aps-job/src/main/resources/bootstrap.yml                             |    2 
 aps-modules/aps-system/src/main/resources/mapper/system/SysDictTypeMapper.xml    |    4 
 aps-modules/aps-core/src/main/resources/bootstrap.yml                            |    2 
 aps-modules/aps-system/src/main/resources/bootstrap.yml                          |    2 
 aps-auth/src/main/resources/bootstrap.yml                                        |    2 
 aps-modules/aps-gen/src/main/resources/bootstrap.yml                             |    2 
 aps-modules/aps-job/src/main/resources/mapper/job/SysJobMapper.xml               |    4 
 aps-gateway/src/main/resources/bootstrap.yml                                     |    2 
 sql/aps_quartz.sql                                                               |  204 ++++++++
 aps-modules/aps-system/src/main/resources/mapper/system/SysOperLogMapper.xml     |    2 
 aps-modules/aps-system/src/main/resources/mapper/system/SysNoticeMapper.xml      |    4 
 aps-modules/aps-file/src/main/resources/bootstrap.yml                            |    2 
 aps-modules/aps-system/src/main/resources/mapper/system/SysRoleMapper.xml        |    4 
 aps-modules/aps-system/src/main/resources/mapper/system/SysDeptMapper.xml        |    4 
 aps-modules/aps-system/src/main/resources/mapper/system/SysUserMapper.xml        |    4 
 27 files changed, 1,397 insertions(+), 43 deletions(-)

diff --git a/aps-auth/src/main/resources/bootstrap.yml b/aps-auth/src/main/resources/bootstrap.yml
index 0bf4786..4f130a5 100644
--- a/aps-auth/src/main/resources/bootstrap.yml
+++ b/aps-auth/src/main/resources/bootstrap.yml
@@ -15,6 +15,7 @@
       discovery:
         # 鏈嶅姟娉ㄥ唽鍦板潃
         server-addr: 192.168.50.160:8848
+        namespace: 8e9f8829-4286-4925-943a-a6c242767ac2
         # 娉ㄥ唽Nacos鏃跺鍔犲厓鏁版嵁 鐢ㄤ簬GateWay杞彂
 #        metadata:
 #          local: zhl
@@ -26,3 +27,4 @@
         # 鍏变韩閰嶇疆
         shared-configs:
           - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
+        namespace: 8e9f8829-4286-4925-943a-a6c242767ac2
diff --git a/aps-gateway/src/main/resources/bootstrap.yml b/aps-gateway/src/main/resources/bootstrap.yml
index 4ccd994..c205191 100644
--- a/aps-gateway/src/main/resources/bootstrap.yml
+++ b/aps-gateway/src/main/resources/bootstrap.yml
@@ -15,6 +15,7 @@
       discovery:
         # 鏈嶅姟娉ㄥ唽鍦板潃
         server-addr: 192.168.50.160:8848
+        namespace: 8e9f8829-4286-4925-943a-a6c242767ac2
         # 娉ㄥ唽Nacos鏃跺鍔犲厓鏁版嵁 鐢ㄤ簬GateWay杞彂
 #        metadata:
 #          local: zhl
@@ -26,6 +27,7 @@
         # 鍏变韩閰嶇疆
         shared-configs:
           - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
+        namespace: 8e9f8829-4286-4925-943a-a6c242767ac2
     sentinel:
       # 鍙栨秷鎺у埗鍙版噿鍔犺浇
       eager: true
diff --git a/aps-modules/aps-core/src/main/resources/bootstrap.yml b/aps-modules/aps-core/src/main/resources/bootstrap.yml
index 4b06397..9582366 100644
--- a/aps-modules/aps-core/src/main/resources/bootstrap.yml
+++ b/aps-modules/aps-core/src/main/resources/bootstrap.yml
@@ -15,6 +15,7 @@
       discovery:
         # 鏈嶅姟娉ㄥ唽鍦板潃
         server-addr: 192.168.50.160:8848
+        namespace: 8e9f8829-4286-4925-943a-a6c242767ac2
         metadata:
           local: wwj
       config:
@@ -22,6 +23,7 @@
         server-addr: 192.168.50.160:8848
         # 閰嶇疆鏂囦欢鏍煎紡
         file-extension: yml
+        namespace: 8e9f8829-4286-4925-943a-a6c242767ac2
         # 鍏变韩閰嶇疆
         shared-configs:
           - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
diff --git a/aps-modules/aps-file/src/main/resources/bootstrap.yml b/aps-modules/aps-file/src/main/resources/bootstrap.yml
index 6f8474e..53b0900 100644
--- a/aps-modules/aps-file/src/main/resources/bootstrap.yml
+++ b/aps-modules/aps-file/src/main/resources/bootstrap.yml
@@ -15,11 +15,13 @@
       discovery:
         # 鏈嶅姟娉ㄥ唽鍦板潃
         server-addr: 192.168.50.160:8848
+        namespace: 8e9f8829-4286-4925-943a-a6c242767ac2
       config:
         # 閰嶇疆涓績鍦板潃
         server-addr: 192.168.50.160:8848
         # 閰嶇疆鏂囦欢鏍煎紡
         file-extension: yml
+        namespace: 8e9f8829-4286-4925-943a-a6c242767ac2
         # 鍏变韩閰嶇疆
         shared-configs:
           - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
diff --git a/aps-modules/aps-gen/pom.xml b/aps-modules/aps-gen/pom.xml
index ab4fd49..0805214 100644
--- a/aps-modules/aps-gen/pom.xml
+++ b/aps-modules/aps-gen/pom.xml
@@ -46,11 +46,12 @@
             <groupId>org.apache.velocity</groupId>
             <artifactId>velocity-engine-core</artifactId>
         </dependency>
-        
-        <!-- Mysql Connector -->
+
+        <!-- PostgreSql椹卞姩鍖� -->
         <dependency>
-            <groupId>com.mysql</groupId>
-            <artifactId>mysql-connector-j</artifactId>
+            <groupId>org.postgresql</groupId>
+            <artifactId>postgresql</artifactId>
+            <version>42.2.14</version>
         </dependency>
         
         <!-- RuoYi Common Log -->
diff --git a/aps-modules/aps-gen/src/main/resources/bootstrap.yml b/aps-modules/aps-gen/src/main/resources/bootstrap.yml
index 85e9497..681cf58 100644
--- a/aps-modules/aps-gen/src/main/resources/bootstrap.yml
+++ b/aps-modules/aps-gen/src/main/resources/bootstrap.yml
@@ -15,11 +15,13 @@
       discovery:
         # 鏈嶅姟娉ㄥ唽鍦板潃
         server-addr: 192.168.50.160:8848
+        namespace: 8e9f8829-4286-4925-943a-a6c242767ac2
       config:
         # 閰嶇疆涓績鍦板潃
         server-addr: 192.168.50.160:8848
         # 閰嶇疆鏂囦欢鏍煎紡
         file-extension: yml
+        namespace: 8e9f8829-4286-4925-943a-a6c242767ac2
         # 鍏变韩閰嶇疆
         shared-configs:
           - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
diff --git a/aps-modules/aps-gen/src/main/resources/mapper/generator/GenTableColumnMapper.xml b/aps-modules/aps-gen/src/main/resources/mapper/generator/GenTableColumnMapper.xml
index 7cd4c11..61f6400 100644
--- a/aps-modules/aps-gen/src/main/resources/mapper/generator/GenTableColumnMapper.xml
+++ b/aps-modules/aps-gen/src/main/resources/mapper/generator/GenTableColumnMapper.xml
@@ -85,7 +85,7 @@
 			<if test="dictType != null and dictType != ''">#{dictType},</if>
 			<if test="sort != null">#{sort},</if>
 			<if test="createBy != null and createBy != ''">#{createBy},</if>
-			sysdate()
+			now()
          )
     </insert>
 
@@ -105,7 +105,7 @@
             <if test="dictType != null">dict_type = #{dictType},</if>
             <if test="sort != null">sort = #{sort},</if>
             <if test="updateBy != null">update_by = #{updateBy},</if>
-            update_time = sysdate()
+            update_time = now()
         </set>
         where column_id = #{columnId}
     </update>
diff --git a/aps-modules/aps-gen/src/main/resources/mapper/generator/GenTableMapper.xml b/aps-modules/aps-gen/src/main/resources/mapper/generator/GenTableMapper.xml
index e8e9640..f25c7b2 100644
--- a/aps-modules/aps-gen/src/main/resources/mapper/generator/GenTableMapper.xml
+++ b/aps-modules/aps-gen/src/main/resources/mapper/generator/GenTableMapper.xml
@@ -167,7 +167,7 @@
 			<if test="genPath != null and genPath != ''">#{genPath},</if>
 			<if test="remark != null and remark != ''">#{remark},</if>
  			<if test="createBy != null and createBy != ''">#{createBy},</if>
-			sysdate()
+			now()
          )
     </insert>
     
@@ -191,7 +191,7 @@
             <if test="options != null and options != ''">options = #{options},</if>
             <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
             <if test="remark != null">remark = #{remark},</if>
-            update_time = sysdate()
+            update_time = now()
         </set>
         where table_id = #{tableId}
     </update>
diff --git a/aps-modules/aps-job/pom.xml b/aps-modules/aps-job/pom.xml
index 3e36b7f..4c3b39e 100644
--- a/aps-modules/aps-job/pom.xml
+++ b/aps-modules/aps-job/pom.xml
@@ -52,11 +52,12 @@
                 </exclusion>
             </exclusions>
         </dependency>
-        
-        <!-- Mysql Connector -->
+
+        <!-- PostgreSql椹卞姩鍖� -->
         <dependency>
-            <groupId>com.mysql</groupId>
-            <artifactId>mysql-connector-j</artifactId>
+            <groupId>org.postgresql</groupId>
+            <artifactId>postgresql</artifactId>
+            <version>42.2.14</version>
         </dependency>
         
         <!-- RuoYi Common Log -->
diff --git a/aps-modules/aps-job/src/main/resources/bootstrap.yml b/aps-modules/aps-job/src/main/resources/bootstrap.yml
index 18f9cca..c586ea0 100644
--- a/aps-modules/aps-job/src/main/resources/bootstrap.yml
+++ b/aps-modules/aps-job/src/main/resources/bootstrap.yml
@@ -15,11 +15,13 @@
       discovery:
         # 鏈嶅姟娉ㄥ唽鍦板潃
         server-addr: 192.168.50.160:8848
+        namespace: 8e9f8829-4286-4925-943a-a6c242767ac2
       config:
         # 閰嶇疆涓績鍦板潃
         server-addr: 192.168.50.160:8848
         # 閰嶇疆鏂囦欢鏍煎紡
         file-extension: yml
+        namespace: 8e9f8829-4286-4925-943a-a6c242767ac2
         # 鍏变韩閰嶇疆
         shared-configs:
           - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
diff --git a/aps-modules/aps-job/src/main/resources/mapper/job/SysJobLogMapper.xml b/aps-modules/aps-job/src/main/resources/mapper/job/SysJobLogMapper.xml
index d5fae57..bb5c8a7 100644
--- a/aps-modules/aps-job/src/main/resources/mapper/job/SysJobLogMapper.xml
+++ b/aps-modules/aps-job/src/main/resources/mapper/job/SysJobLogMapper.xml
@@ -87,7 +87,7 @@
  			<if test="jobMessage != null and jobMessage != ''">#{jobMessage},</if>
  			<if test="status != null and status != ''">#{status},</if>
  			<if test="exceptionInfo != null and exceptionInfo != ''">#{exceptionInfo},</if>
- 			sysdate()
+ 			now()
  		)
 	</insert>
 
diff --git a/aps-modules/aps-job/src/main/resources/mapper/job/SysJobMapper.xml b/aps-modules/aps-job/src/main/resources/mapper/job/SysJobMapper.xml
index 58353fc..f7d7396 100644
--- a/aps-modules/aps-job/src/main/resources/mapper/job/SysJobMapper.xml
+++ b/aps-modules/aps-job/src/main/resources/mapper/job/SysJobMapper.xml
@@ -75,7 +75,7 @@
  			<if test="status !=null">status = #{status},</if>
  			<if test="remark != null and remark != ''">remark = #{remark},</if>
  			<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
- 			update_time = sysdate()
+ 			update_time = now()
  		</set>
  		where job_id = #{jobId}
 	</update>
@@ -104,7 +104,7 @@
  			<if test="status != null and status != ''">#{status},</if>
  			<if test="remark != null and remark != ''">#{remark},</if>
  			<if test="createBy != null and createBy != ''">#{createBy},</if>
- 			sysdate()
+ 			now()
  		)
 	</insert>
 
diff --git a/aps-modules/aps-system/pom.xml b/aps-modules/aps-system/pom.xml
index f99a2a3..f7dacb0 100644
--- a/aps-modules/aps-system/pom.xml
+++ b/aps-modules/aps-system/pom.xml
@@ -42,9 +42,11 @@
         </dependency>
         
         <!-- Mysql Connector -->
+        <!-- PostgreSql椹卞姩鍖� -->
         <dependency>
-            <groupId>com.mysql</groupId>
-            <artifactId>mysql-connector-j</artifactId>
+            <groupId>org.postgresql</groupId>
+            <artifactId>postgresql</artifactId>
+            <version>42.2.14</version>
         </dependency>
         
         <!-- RuoYi Common DataSource -->
diff --git a/aps-modules/aps-system/src/main/resources/bootstrap.yml b/aps-modules/aps-system/src/main/resources/bootstrap.yml
index a5652fd..3d097e0 100644
--- a/aps-modules/aps-system/src/main/resources/bootstrap.yml
+++ b/aps-modules/aps-system/src/main/resources/bootstrap.yml
@@ -18,6 +18,7 @@
 #        ip: 192.168.50.13
         metadata:
           local: wwj
+        namespace: 8e9f8829-4286-4925-943a-a6c242767ac2
       config:
         # 閰嶇疆涓績鍦板潃
         server-addr: 192.168.50.160:8848
@@ -26,3 +27,4 @@
         # 鍏变韩閰嶇疆
         shared-configs:
           - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
+        namespace: 8e9f8829-4286-4925-943a-a6c242767ac2
diff --git a/aps-modules/aps-system/src/main/resources/mapper/system/SysConfigMapper.xml b/aps-modules/aps-system/src/main/resources/mapper/system/SysConfigMapper.xml
index faaade1..4825725 100644
--- a/aps-modules/aps-system/src/main/resources/mapper/system/SysConfigMapper.xml
+++ b/aps-modules/aps-system/src/main/resources/mapper/system/SysConfigMapper.xml
@@ -85,7 +85,7 @@
 			<if test="configType != null and configType != ''">#{configType},</if>
 			<if test="createBy != null and createBy != ''">#{createBy},</if>
 			<if test="remark != null and remark != ''">#{remark},</if>
- 			sysdate()
+ 			now()
 		)
     </insert>
 	 
@@ -98,7 +98,7 @@
             <if test="configType != null and configType != ''">config_type = #{configType},</if>
             <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
             <if test="remark != null">remark = #{remark},</if>
- 			update_time = sysdate()
+ 			update_time = now()
         </set>
         where config_id = #{configId}
     </update>
diff --git a/aps-modules/aps-system/src/main/resources/mapper/system/SysDeptMapper.xml b/aps-modules/aps-system/src/main/resources/mapper/system/SysDeptMapper.xml
index 9b3f825..c4db34b 100644
--- a/aps-modules/aps-system/src/main/resources/mapper/system/SysDeptMapper.xml
+++ b/aps-modules/aps-system/src/main/resources/mapper/system/SysDeptMapper.xml
@@ -109,7 +109,7 @@
  			<if test="email != null and email != ''">#{email},</if>
  			<if test="status != null">#{status},</if>
  			<if test="createBy != null and createBy != ''">#{createBy},</if>
- 			sysdate()
+ 			now()
  		)
 	</insert>
 	
@@ -125,7 +125,7 @@
  			<if test="email != null">email = #{email},</if>
  			<if test="status != null and status != ''">status = #{status},</if>
  			<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
- 			update_time = sysdate()
+ 			update_time = now()
  		</set>
  		where dept_id = #{deptId}
 	</update>
diff --git a/aps-modules/aps-system/src/main/resources/mapper/system/SysDictDataMapper.xml b/aps-modules/aps-system/src/main/resources/mapper/system/SysDictDataMapper.xml
index 00960fb..c5e8f9b 100644
--- a/aps-modules/aps-system/src/main/resources/mapper/system/SysDictDataMapper.xml
+++ b/aps-modules/aps-system/src/main/resources/mapper/system/SysDictDataMapper.xml
@@ -84,7 +84,7 @@
  			<if test="status != null">status = #{status},</if>
  			<if test="remark != null">remark = #{remark},</if>
  			<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
- 			update_time = sysdate()
+ 			update_time = now()
  		</set>
  		where dict_code = #{dictCode}
 	</update>
@@ -117,7 +117,7 @@
  			<if test="status != null">#{status},</if>
  			<if test="remark != null and remark != ''">#{remark},</if>
  			<if test="createBy != null and createBy != ''">#{createBy},</if>
- 			sysdate()
+ 			now()
  		)
 	</insert>
 	
diff --git a/aps-modules/aps-system/src/main/resources/mapper/system/SysDictTypeMapper.xml b/aps-modules/aps-system/src/main/resources/mapper/system/SysDictTypeMapper.xml
index 6a2265f..6b68d48 100644
--- a/aps-modules/aps-system/src/main/resources/mapper/system/SysDictTypeMapper.xml
+++ b/aps-modules/aps-system/src/main/resources/mapper/system/SysDictTypeMapper.xml
@@ -79,7 +79,7 @@
  			<if test="status != null">status = #{status},</if>
  			<if test="remark != null">remark = #{remark},</if>
  			<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
- 			update_time = sysdate()
+ 			update_time = now()
  		</set>
  		where dict_id = #{dictId}
 	</update>
@@ -98,7 +98,7 @@
  			<if test="status != null">#{status},</if>
  			<if test="remark != null and remark != ''">#{remark},</if>
  			<if test="createBy != null and createBy != ''">#{createBy},</if>
- 			sysdate()
+ 			now()
  		)
 	</insert>
 	
diff --git a/aps-modules/aps-system/src/main/resources/mapper/system/SysLogininforMapper.xml b/aps-modules/aps-system/src/main/resources/mapper/system/SysLogininforMapper.xml
index b5e5d1c..8c3f3ff 100644
--- a/aps-modules/aps-system/src/main/resources/mapper/system/SysLogininforMapper.xml
+++ b/aps-modules/aps-system/src/main/resources/mapper/system/SysLogininforMapper.xml
@@ -15,7 +15,7 @@
 
 	<insert id="insertLogininfor" parameterType="SysLogininfor">
 		insert into sys_logininfor (user_name, status, ipaddr, msg, access_time)
-		values (#{userName}, #{status}, #{ipaddr}, #{msg}, sysdate())
+		values (#{userName}, #{status}, #{ipaddr}, #{msg}, now())
 	</insert>
 	
 	<select id="selectLogininforList" parameterType="SysLogininfor" resultMap="SysLogininforResult">
diff --git a/aps-modules/aps-system/src/main/resources/mapper/system/SysMenuMapper.xml b/aps-modules/aps-system/src/main/resources/mapper/system/SysMenuMapper.xml
index fa4153a..ee7c555 100644
--- a/aps-modules/aps-system/src/main/resources/mapper/system/SysMenuMapper.xml
+++ b/aps-modules/aps-system/src/main/resources/mapper/system/SysMenuMapper.xml
@@ -29,7 +29,7 @@
 	</resultMap>
 
 	<sql id="selectMenuVo">
-        select menu_id, menu_name, parent_id, order_num, path, component, `query`, route_name, is_frame, is_cache, menu_type, visible, status, ifnull(perms,'') as perms, icon, create_time 
+        select menu_id, menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, COALESCE(perms,'') as perms, icon, create_time
 		from sys_menu
     </sql>
     
@@ -50,13 +50,13 @@
 	</select>
 	
 	<select id="selectMenuTreeAll" resultMap="SysMenuResult">
-		select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, m.route_name, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
+		select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.query, m.route_name, m.visible, m.status, COALESCE(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
 		from sys_menu m where m.menu_type in ('M', 'C') and m.status = 0
 		order by m.parent_id, m.order_num
 	</select>
 	
 	<select id="selectMenuListByUserId" parameterType="SysMenu" resultMap="SysMenuResult">
-		select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, m.route_name, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
+		select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.query, m.route_name, m.visible, m.status, COALESCE(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
 		from sys_menu m
 		left join sys_role_menu rm on m.menu_id = rm.menu_id
 		left join sys_user_role ur on rm.role_id = ur.role_id
@@ -75,7 +75,7 @@
 	</select>
     
     <select id="selectMenuTreeByUserId" parameterType="Long" resultMap="SysMenuResult">
-		select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, m.route_name, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
+		select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.query, m.route_name, m.visible, m.status, COALESCE(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
 		from sys_menu m
 			 left join sys_role_menu rm on m.menu_id = rm.menu_id
 			 left join sys_user_role ur on rm.role_id = ur.role_id
@@ -141,7 +141,7 @@
 			<if test="orderNum != null">order_num = #{orderNum},</if>
 			<if test="path != null and path != ''">path = #{path},</if>
 			<if test="component != null">component = #{component},</if>
-			<if test="query != null">`query` = #{query},</if>
+			<if test="query != null">query = #{query},</if>
 			<if test="routeName != null">route_name = #{routeName},</if>
 			<if test="isFrame != null and isFrame != ''">is_frame = #{isFrame},</if>
 			<if test="isCache != null and isCache != ''">is_cache = #{isCache},</if>
@@ -152,7 +152,7 @@
 			<if test="icon !=null and icon != ''">icon = #{icon},</if>
 			<if test="remark != null and remark != ''">remark = #{remark},</if>
 			<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
-			update_time = sysdate()
+			update_time = now()
 		</set>
 		where menu_id = #{menuId}
 	</update>
@@ -165,7 +165,7 @@
 		<if test="orderNum != null">order_num,</if>
 		<if test="path != null and path != ''">path,</if>
 		<if test="component != null and component != ''">component,</if>
-		<if test="query != null and query != ''">`query`,</if>
+		<if test="query != null and query != ''">query,</if>
 		<if test="routeName != null">route_name,</if>
 		<if test="isFrame != null and isFrame != ''">is_frame,</if>
 		<if test="isCache != null and isCache != ''">is_cache,</if>
@@ -195,7 +195,7 @@
 		<if test="icon != null and icon != ''">#{icon},</if>
 		<if test="remark != null and remark != ''">#{remark},</if>
 		<if test="createBy != null and createBy != ''">#{createBy},</if>
-		sysdate()
+		now()
 		)
 	</insert>
 	
diff --git a/aps-modules/aps-system/src/main/resources/mapper/system/SysNoticeMapper.xml b/aps-modules/aps-system/src/main/resources/mapper/system/SysNoticeMapper.xml
index d4649dc..0a41e5d 100644
--- a/aps-modules/aps-system/src/main/resources/mapper/system/SysNoticeMapper.xml
+++ b/aps-modules/aps-system/src/main/resources/mapper/system/SysNoticeMapper.xml
@@ -58,7 +58,7 @@
 			<if test="status != null and status != ''">#{status}, </if>
 			<if test="remark != null and remark != ''">#{remark},</if>
  			<if test="createBy != null and createBy != ''">#{createBy},</if>
- 			sysdate()
+ 			now()
 		)
     </insert>
 	 
@@ -70,7 +70,7 @@
             <if test="noticeContent != null">notice_content = #{noticeContent}, </if>
             <if test="status != null and status != ''">status = #{status}, </if>
             <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
- 			update_time = sysdate()
+ 			update_time = now()
         </set>
         where notice_id = #{noticeId}
     </update>
diff --git a/aps-modules/aps-system/src/main/resources/mapper/system/SysOperLogMapper.xml b/aps-modules/aps-system/src/main/resources/mapper/system/SysOperLogMapper.xml
index df4666b..e37f793 100644
--- a/aps-modules/aps-system/src/main/resources/mapper/system/SysOperLogMapper.xml
+++ b/aps-modules/aps-system/src/main/resources/mapper/system/SysOperLogMapper.xml
@@ -30,7 +30,7 @@
     
 	<insert id="insertOperlog" parameterType="SysOperLog">
 		insert into sys_oper_log(title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_param, json_result, status, error_msg, cost_time, oper_time)
-        values (#{title}, #{businessType}, #{method}, #{requestMethod}, #{operatorType}, #{operName}, #{deptName}, #{operUrl}, #{operIp}, #{operParam}, #{jsonResult}, #{status}, #{errorMsg}, #{costTime}, sysdate())
+        values (#{title}, #{businessType}, #{method}, #{requestMethod}, #{operatorType}, #{operName}, #{deptName}, #{operUrl}, #{operIp}, #{operParam}, #{jsonResult}, #{status}, #{errorMsg}, #{costTime}, now())
 	</insert>
 	
 	<select id="selectOperLogList" parameterType="SysOperLog" resultMap="SysOperLogResult">
diff --git a/aps-modules/aps-system/src/main/resources/mapper/system/SysPostMapper.xml b/aps-modules/aps-system/src/main/resources/mapper/system/SysPostMapper.xml
index 40c2319..830e8fe 100644
--- a/aps-modules/aps-system/src/main/resources/mapper/system/SysPostMapper.xml
+++ b/aps-modules/aps-system/src/main/resources/mapper/system/SysPostMapper.xml
@@ -81,7 +81,7 @@
  			<if test="status != null and status != ''">status = #{status},</if>
  			<if test="remark != null">remark = #{remark},</if>
  			<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
- 			update_time = sysdate()
+ 			update_time = now()
  		</set>
  		where post_id = #{postId}
 	</update>
@@ -104,7 +104,7 @@
  			<if test="status != null and status != ''">#{status},</if>
  			<if test="remark != null and remark != ''">#{remark},</if>
  			<if test="createBy != null and createBy != ''">#{createBy},</if>
- 			sysdate()
+ 			now()
  		)
 	</insert>
 	
diff --git a/aps-modules/aps-system/src/main/resources/mapper/system/SysRoleMapper.xml b/aps-modules/aps-system/src/main/resources/mapper/system/SysRoleMapper.xml
index 58d53ae..3ff7826 100644
--- a/aps-modules/aps-system/src/main/resources/mapper/system/SysRoleMapper.xml
+++ b/aps-modules/aps-system/src/main/resources/mapper/system/SysRoleMapper.xml
@@ -117,7 +117,7 @@
  			<if test="status != null and status != ''">#{status},</if>
  			<if test="remark != null and remark != ''">#{remark},</if>
  			<if test="createBy != null and createBy != ''">#{createBy},</if>
- 			sysdate()
+ 			now()
  		)
 	</insert>
 	
@@ -133,7 +133,7 @@
  			<if test="status != null and status != ''">status = #{status},</if>
  			<if test="remark != null">remark = #{remark},</if>
  			<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
- 			update_time = sysdate()
+ 			update_time = now()
  		</set>
  		where role_id = #{roleId}
 	</update>
diff --git a/aps-modules/aps-system/src/main/resources/mapper/system/SysUserMapper.xml b/aps-modules/aps-system/src/main/resources/mapper/system/SysUserMapper.xml
index aebd47b..5e80f08 100644
--- a/aps-modules/aps-system/src/main/resources/mapper/system/SysUserMapper.xml
+++ b/aps-modules/aps-system/src/main/resources/mapper/system/SysUserMapper.xml
@@ -170,7 +170,7 @@
  			<if test="status != null and status != ''">#{status},</if>
  			<if test="createBy != null and createBy != ''">#{createBy},</if>
  			<if test="remark != null and remark != ''">#{remark},</if>
- 			sysdate()
+ 			now()
  		)
 	</insert>
 	
@@ -189,7 +189,7 @@
  			<if test="loginDate != null">login_date = #{loginDate},</if>
  			<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
  			<if test="remark != null">remark = #{remark},</if>
- 			update_time = sysdate()
+ 			update_time = now()
  		</set>
  		where user_id = #{userId}
 	</update>
diff --git a/sql/aps_pg.sql b/sql/aps_pg.sql
new file mode 100644
index 0000000..947b601
--- /dev/null
+++ b/sql/aps_pg.sql
@@ -0,0 +1,1132 @@
+-- ----------------------------
+-- 1銆侀儴闂ㄨ〃
+-- ----------------------------
+
+drop table if exists  sys_dept;
+
+create table sys_dept (
+                          dept_id              BIGSERIAL not null,
+                          parent_id            BIGINT                 null default 0,
+                          ancestors            VARCHAR(50)          null,
+                          dept_name            VARCHAR(30)          null default '',
+                          order_num            INT4                 null default '0',
+                          leader               VARCHAR(20)          null default '',
+                          phone                VARCHAR(20)          null default '',
+                          email                VARCHAR(20)          null default '',
+                          status               CHAR(1)              null default '0',
+                          del_flag             CHAR(1)              null default '0',
+                          create_by            VARCHAR(64)          null default '',
+                          create_time          TIMESTAMP                 null,
+                          update_by            VARCHAR(64)          null default '',
+                          update_time          TIMESTAMP                 null,
+                          constraint PK_SYS_DEPT primary key (dept_id)
+);
+alter sequence if exists sys_dept_dept_id_seq restart with 200 cache 20;
+
+comment on table sys_dept is '閮ㄩ棬琛�';
+comment on column sys_dept.dept_id is '閮ㄩ棬id';
+comment on column sys_dept.parent_id is '鐖堕儴闂╥d';
+comment on column sys_dept.ancestors    is '绁栫骇鍒楄〃';
+comment on column sys_dept.dept_name is '閮ㄩ棬鍚嶇О';
+comment on column sys_dept.order_num is '鏄剧ず椤哄簭';
+comment on column sys_dept.leader is '璐熻矗浜�';
+comment on column sys_dept.phone is '鑱旂郴鐢佃瘽';
+comment on column sys_dept.email is '閭';
+comment on column sys_dept.status is '閮ㄩ棬鐘舵��:0姝e父,1鍋滅敤';
+comment on column sys_dept.del_flag     is '鍒犻櫎鏍囧織锛�0浠h〃瀛樺湪 2浠h〃鍒犻櫎锛�';
+comment on column sys_dept.create_by is '鍒涘缓鑰�';
+comment on column sys_dept.create_time is '鍒涘缓鏃堕棿';
+comment on column sys_dept.update_by is '鏇存柊鑰�';
+comment on column sys_dept.update_time is '鏇存柊鏃堕棿';
+
+-- ----------------------------
+-- 1.1 鍒濆鍖�-閮ㄩ棬琛ㄦ暟鎹�
+-- ----------------------------
+insert into sys_dept values(100,  0,   '0',          '姹熻嫃绉戞妧澶у',   0, '姹熸煇浜�', '15888888888', 'mr8god@hotmail.com', '0', '0', 'admin', now(), '', null);
+insert into sys_dept values(101,  100, '0,100',      '寮犲娓牎鍖�', 1, '姹熸煇浜�', '15888888888', 'mr8god@hotmail.com', '0', '0', 'admin', now(), '', null);
+insert into sys_dept values(102,  100, '0,100',      '鑻忓窞鐞嗗伐瀛﹂櫌', 2, '姹熸煇浜�', '15888888888', 'mr8god@hotmail.com', '0', '0', 'admin', now(), '', null);
+insert into sys_dept values(103,  101, '0,100,101',  '鐢垫皵涓庝俊鎭伐绋嬪闄�',   1, '姹熸煇浜�', '15888888888', 'mr8god@hotmail.com', '0', '0', 'admin',now(), '', null);
+insert into sys_dept values(104,  101, '0,100,101',  '鍟嗗闄�',   2, '姹熸煇浜�', '15888888888', 'mr8god@hotmail.com', '0', '0', 'admin',now(), '', null);
+insert into sys_dept values(105,  101, '0,100,101',  '鍏叡涓庢暀鑲插闄�',   3, '姹熸煇浜�', '15888888888', 'mr8god@hotmail.com', '0', '0', 'admin',now(), '', null);
+insert into sys_dept values(106,  101, '0,100,101',  '鍐堕噾涓庢潗鏂欏闄�',   4, '姹熸煇浜�', '15888888888', 'mr8god@hotmail.com', '0', '0', 'admin',now(), '', null);
+insert into sys_dept values(107,  101, '0,100,101',  '鏈烘涓庡姩鍔涘伐绋嬪闄�',   5, '姹熸煇浜�', '15888888888', 'mr8god@hotmail.com', '0', '0', 'admin',now(), '', null);
+insert into sys_dept values(108,  102, '0,100,102',  '鐢垫皵涓庝俊鎭伐绋嬪闄�',   1, '姹熸煇浜�', '15888888888', 'mr8god@hotmail.com', '0', '0', 'admin',now(), '', null);
+insert into sys_dept values(109,  102, '0,100,102',  '鍟嗗闄�',   2, '姹熸煇浜�', '15888888888', 'mr8god@hotmail.com', '0', '0', 'admin',now(), '', null);
+
+
+
+
+-- ----------------------------
+-- 2銆佺敤鎴蜂俊鎭〃
+-- ----------------------------
+drop table if exists sys_user;
+
+create table sys_user (
+                          user_id              BIGSERIAL not null,
+                          dept_id              BIGINT                 null default NULL,
+                          user_name           VARCHAR(30)          null default '',
+                          nick_name            VARCHAR(30)          null default '',
+                          user_type            VARCHAR(2)           null default '00',
+                          email                VARCHAR(100)         null default '',
+                          phonenumber          VARCHAR(20)          null default '',
+                          sex                  CHAR(1)              null default '0',
+                          avatar               VARCHAR(100)         null,
+                          password             VARCHAR(100)         null default '',
+                          salt                 VARCHAR(100)         null default '',
+                          status               CHAR(1)              null default '0',
+                          del_flag             CHAR(1)              null default '0',
+                          login_ip             VARCHAR(50)          null default '',
+                          login_date           TIMESTAMP				 null,
+                          pwd_update_date      TIMESTAMP				 null,
+                          create_by            VARCHAR(64)          null default '',
+                          create_time          TIMESTAMP                 null,
+                          update_by            VARCHAR(64)          null default '',
+                          update_time          TIMESTAMP                 null,
+                          remark               VARCHAR(500)         null,
+                          constraint PK_SYS_USER primary key (user_id)
+);
+
+alter sequence if exists sys_user_user_id_seq restart with 100 cache 20;
+
+comment on table sys_user is '鐢ㄦ埛淇℃伅琛�';
+comment on column sys_user.user_id is '鐢ㄦ埛ID';
+comment on column sys_user.dept_id is '閮ㄩ棬ID';
+comment on column sys_user.user_name is '鐧诲綍璐﹀彿';
+comment on column sys_user.nick_name is '鐢ㄦ埛鏄电О';
+comment on column sys_user.user_type is '绫诲瀷:Y榛樿鐢ㄦ埛,N闈為粯璁ょ敤鎴�';
+comment on column sys_user.email is '鐢ㄦ埛閭';
+comment on column sys_user.phonenumber is '鎵嬫満鍙风爜';
+comment on column sys_user.sex          is '鐢ㄦ埛鎬у埆锛�0鐢� 1濂� 2鏈煡锛�';
+comment on column sys_user.avatar       is '澶村儚璺緞';
+comment on column sys_user.password is '瀵嗙爜';
+comment on column sys_user.salt is '鐩愬姞瀵�';
+comment on column sys_user.status is '甯愬彿鐘舵��:0姝e父,1绂佺敤';
+comment on column sys_user.del_flag is '鎷掔粷鐧诲綍鎻忚堪';
+comment on column sys_user.login_ip     is '鏈�鍚庣櫥褰旾P';
+comment on column sys_user.login_date   is '鏈�鍚庣櫥褰曟椂闂�';
+comment on column sys_user.pwd_update_date   is '瀵嗙爜鏈�鍚庢洿鏂版椂闂�';
+comment on column sys_user.create_by is '鍒涘缓鑰�';
+comment on column sys_user.create_time is '鍒涘缓鏃堕棿';
+comment on column sys_user.update_by is '鏇存柊鑰�';
+comment on column sys_user.update_time is '鏇存柊鏃堕棿';
+comment on column sys_user.remark       is '澶囨敞';
+
+-- ----------------------------
+-- 鍒濆鍖�-鐢ㄦ埛淇℃伅琛ㄦ暟鎹�
+-- ----------------------------
+insert into sys_user values(1,  103, 'admin', 'admin', '00', 'Mr8god@hotmail.com', '17696748602', '0', '', '$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', '111111', '0', '0', '127.0.0.1', now(),now(), 'admin', now(), '', null, '绠$悊鍛�');
+insert into sys_user values(2,  100, 'JCW', '姹熸櫒鐐�', '00', '17696748622@163.com', '17696748622', '0', '', '$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', '0615a7', '0', '0', '172.23.128.1', now(),now(), 'admin', now(), '', null, '鍙涢�嗙殑瓒呯骇瀛︾敓锛屼富瑕佸仛鐨勪簨鎯呭氨鏄啿浠栦斧鐨�');
+
+
+-- ----------------------------
+-- 3銆佸矖浣嶄俊鎭〃
+-- ----------------------------
+drop table if exists sys_post;
+create table sys_post (
+                          post_id              BIGSERIAL not null,
+                          post_code            VARCHAR(64)          not null,
+                          post_name            VARCHAR(100)         not null,
+                          post_sort            INT4                 not null,
+                          status               CHAR(1)              not null,
+                          create_by            VARCHAR(64)          null default '',
+                          create_time          TIMESTAMP                 null,
+                          update_by            VARCHAR(64)          null default '',
+                          update_time          TIMESTAMP                 null,
+                          remark               VARCHAR(500)         null default '',
+                          constraint PK_SYS_POST primary key (post_id)
+);
+alter sequence if exists sys_post_post_id_seq restart with 10 cache 20;
+
+comment on table sys_post is '宀椾綅淇℃伅琛�';
+comment on column sys_post.post_id is '宀椾綅ID';
+comment on column sys_post.post_code is '宀椾綅缂栫爜';
+comment on column sys_post.post_name is '宀椾綅鍚嶇О';
+comment on column sys_post.post_sort is '鏄剧ず椤哄簭';
+comment on column sys_post.status is '鐘舵�侊紙0姝e父 1鍋滅敤锛�';
+comment on column sys_post.create_by is '鍒涘缓鑰�';
+comment on column sys_post.create_time is '鍒涘缓鏃堕棿';
+comment on column sys_post.update_by is '鏇存柊鑰�';
+comment on column sys_post.update_time is '鏇存柊鏃堕棿';
+comment on column sys_post.remark is '澶囨敞';
+
+-- ----------------------------
+-- 鍒濆鍖�-宀椾綅淇℃伅琛ㄦ暟鎹�
+-- ----------------------------
+insert into sys_post values(1, 'SuperAdmin',  '瓒呯骇绠$悊鍛�',    1, '0', 'admin', now(), '', now(), '');
+insert into sys_post values(2, 'smt',  '瀛︾敓绠$悊绉戣�佸笀',    2, '0', 'admin', now(), '', now(), '');
+insert into sys_post values(3, 'sct',  '浜岀骇瀛﹀洟鑰佸笀',    3, '0', 'admin', now(), '', now(), '');
+insert into sys_post values(4, 'ct',  '鐝甯�',    4, '0', 'admin', now(), '', now(), '');
+insert into sys_post values(5, 'stu',  '瀛︾敓鐢ㄦ埛',    5, '0', 'admin', now(), '', now(), '');
+insert into sys_post values(6, 'pndcjstu',  '鍙涢�嗙殑瓒呯骇瀛︾敓鐢ㄦ埛',    6, '0', 'admin', now(), '', now(), '');
+
+-- ----------------------------
+-- 4銆佽鑹蹭俊鎭〃
+-- ----------------------------
+drop table if exists sys_role;
+create table sys_role (
+                          role_id              BIGSERIAL not null,
+                          role_name            VARCHAR(30)          not null,
+                          role_key             VARCHAR(100)         not null,
+                          role_sort            INT4                 null,
+                          data_scope           CHAR(1)              default '1',
+                          menu_check_strictly  BOOLEAN             default '1',
+                          dept_check_strictly  BOOLEAN             default '1',
+                          status               CHAR(1)              null default '0',
+                          del_flag             CHAR(1)              null default '0',
+                          create_by            VARCHAR(64)          null default '',
+                          create_time          TIMESTAMP            null,
+                          update_by            VARCHAR(64)          null default '',
+                          update_time          TIMESTAMP            null,
+                          remark               VARCHAR(500)         null default '',
+                          constraint PK_SYS_ROLE primary key (role_id)
+);
+alter sequence if exists sys_role_role_id_seq restart with 100 cache 20;
+comment on table sys_role is '瑙掕壊淇℃伅琛�';
+comment on column sys_role.role_id is '瑙掕壊ID';
+comment on column sys_role.role_name is '瑙掕壊鍚嶇О';
+comment on column sys_role.role_key is '瑙掕壊鏉冮檺瀛楃涓�';
+comment on column sys_role.role_sort is '鏄剧ず椤哄簭';
+comment on column sys_role.data_scope   is '鏁版嵁鑼冨洿锛�1锛氬叏閮ㄦ暟鎹潈闄� 2锛氳嚜瀹氭暟鎹潈闄愶級';
+comment on column sys_role.status       is '瑙掕壊鐘舵�侊紙0姝e父 1鍋滅敤锛�';
+comment on column sys_role.del_flag     is '鍒犻櫎鏍囧織锛�0浠h〃瀛樺湪 2浠h〃鍒犻櫎锛�';
+comment on column sys_role.create_by is '鍒涘缓鑰�';
+comment on column sys_role.create_time is '鍒涘缓鏃堕棿';
+comment on column sys_role.update_by is '鏇存柊鑰�';
+comment on column sys_role.update_time is '鏇存柊鏃堕棿';
+comment on column sys_role.remark is '澶囨敞';
+-- ----------------------------
+-- 鍒濆鍖�-瑙掕壊淇℃伅琛ㄦ暟鎹�
+-- ----------------------------
+insert into sys_role values('1', '瓒呯骇绠$悊鍛�',        'admin',                1, 1, '1', '1', '0', '0', 'admin', now(), '', null, '瓒呯骇绠$悊鍛�');
+insert into sys_role values('2', '瓒呯骇鏆存皯姹熸煇浜�',     'angry',                2, 2, '1', '1', '0', '0', 'admin', now(), '', null, '鏅�氳鑹�');
+insert into sys_role values('3', '瀛︾敓绠$悊绉戣�佸笀',     'stu-man-teacher',      3, 2, '1', '1', '0', '0', 'admin', now(), '', null, '鏅�氳鑹�');
+insert into sys_role values('4', '浜岀骇瀛﹀洟鑰佸笀',       'sed-club-teacher',     4, 2, '1', '1', '0', '0', 'admin', now(), '', null, '鏅�氳鑹�');
+insert into sys_role values('5', '鐝甯�',            'class-tutor',         5, 2, '1', '1', '0', '0', 'admin', now(), '', null, '鏅�氳鑹�');
+insert into sys_role values('6', '瀛︾敓',             'student',              6, 2, '1', '1', '0', '0', 'admin', now(), '', null, '鏅�氳鑹�');
+
+
+
+-- ----------------------------
+-- 5銆佽彍鍗曟潈闄愯〃
+-- ----------------------------
+drop table if exists sys_menu;
+create table sys_menu (
+                          menu_id              BIGSERIAL            not null,
+                          menu_name            VARCHAR(50)          not null,
+                          parent_id            BIGINT               null default 0,
+                          order_num            INT4                 null default NULL,
+                          path                 VARCHAR(200)         null default '',
+                          component            VARCHAR(255)          null default '',
+                          is_frame             INT                  null default 1,
+                          is_cache             INT                  null default 0,
+                          menu_type            CHAR(1)              null default '',
+                          visible              INT              null default 0,
+                          status               int2             null default 0,
+                          perms                VARCHAR(100)         null default '',
+                          icon                 VARCHAR(100)         null default '',
+                          create_by            VARCHAR(64)          null default '',
+                          create_time          TIMESTAMP            null,
+                          update_by            VARCHAR(64)          null default '',
+                          update_time          TIMESTAMP            null,
+                          remark               VARCHAR(500)         null default '',
+                          constraint PK_SYS_MENU primary key (menu_id)
+);
+alter sequence if exists sys_menu_menu_id_seq restart with 2000 cache 20;
+
+comment on table sys_menu is '鑿滃崟鏉冮檺琛�';
+comment on column sys_menu.menu_id is '鑿滃崟ID';
+comment on column sys_menu.menu_name is '鑿滃崟鍚嶇О';
+comment on column sys_menu.parent_id is '鐖惰彍鍗旾D';
+comment on column sys_menu.order_num is '鏄剧ず椤哄簭';
+comment on column sys_menu.path is '璇锋眰鍦板潃';
+comment on column sys_menu.component       is '鎵撳紑鏂瑰紡锛坢enuItem椤电 menuBlank鏂扮獥鍙o級';
+comment on column sys_menu.is_frame is '鏄惁涓哄閾撅紙0鏄� 1鍚︼級';
+comment on column sys_menu.is_cache is '鏄惁缂撳瓨锛�0缂撳瓨 1涓嶇紦瀛橈級';
+comment on column sys_menu.menu_type is '绫诲瀷:M鐩綍,C鑿滃崟,F鎸夐挳';
+comment on column sys_menu.visible is '鑿滃崟鐘舵��:0鏄剧ず,1闅愯棌';
+comment on column sys_menu.status is '鑿滃崟鐘舵�侊紙0姝e父 1鍋滅敤锛�';
+comment on column sys_menu.perms is '鏉冮檺鏍囪瘑';
+comment on column sys_menu.icon is '鑿滃崟鍥炬爣';
+comment on column sys_menu.create_by is '鍒涘缓鑰�';
+comment on column sys_menu.create_time is '鍒涘缓鏃堕棿';
+comment on column sys_menu.update_by is '鏇存柊鑰�';
+comment on column sys_menu.update_time is '鏇存柊鏃堕棿';
+comment on column sys_menu.remark is '澶囨敞';
+
+-- ----------------------------
+-- 鍒濆鍖�-鑿滃崟淇℃伅琛ㄦ暟鎹�
+-- ----------------------------
+-- 涓�绾ц彍鍗�
+insert into sys_menu values('1', '绯荤粺绠$悊', '0', '1', 'system',                '',          1, 0,  'M',0, 0,'', 'system',              'admin', now(), '', null, '绯荤粺绠$悊鐩綍');
+insert into sys_menu values('2', '绯荤粺鐩戞帶', '0', '2', 'monitor',                '',          1, 0,  'M',0, 0,'', 'monitor',             'admin', now(), '', null, '绯荤粺鐩戞帶鐩綍');
+insert into sys_menu values('3', '绯荤粺宸ュ叿', '0', '3', 'tool',                '',          1, 0,  'M',0, 0,'', 'tool',                'admin', now(), '', null, '绯荤粺宸ュ叿鐩綍');
+insert into sys_menu values('4', '姹熸煇浜哄畼缃�', '0', '4', 'http://ruoyi.vip', 'menuBlank', 0, 0,  'C',0, 0,'', 'guide',          'admin', now(), '', null, '姹熸煇浜哄畼缃戝湴鍧�');
+-- 浜岀骇鑿滃崟
+insert into sys_menu values('100',  '鐢ㄦ埛绠$悊', '1', '1', 'user',          'system/user/index', 1, 0,  'C', 0, 0, 'system:user:list',         'user',                'admin', now(), '', null, '鐢ㄦ埛绠$悊鑿滃崟');
+insert into sys_menu values('101',  '瑙掕壊绠$悊', '1', '2', 'role',          'system/role/index', 1, 0,  'C', 0, 0, 'system:role:list',         'peoples',             'admin', now(), '', null, '瑙掕壊绠$悊鑿滃崟');
+insert into sys_menu values('102',  '鑿滃崟绠$悊', '1', '3', 'menu',          'system/menu/index', 1, 0,  'C', 0, 0, 'system:menu:list',         'tree-table',          'admin', now(), '', null, '鑿滃崟绠$悊鑿滃崟');
+insert into sys_menu values('103',  '閮ㄩ棬绠$悊', '1', '4', 'dept',          'system/dept/index', 1, 0,  'C', 0, 0, 'system:dept:list',         'tree',                'admin', now(), '', null, '閮ㄩ棬绠$悊鑿滃崟');
+insert into sys_menu values('104',  '宀椾綅绠$悊', '1', '5', 'post',          'system/post/index', 1, 0,  'C', 0, 0, 'system:post:list',         'post',                'admin', now(), '', null, '宀椾綅绠$悊鑿滃崟');
+insert into sys_menu values('105',  '瀛楀吀绠$悊', '1', '6', 'dict',          'system/dict/index', 1, 0,  'C', 0, 0, 'system:dict:list',         'dict',                'admin', now(), '', null, '瀛楀吀绠$悊鑿滃崟');
+insert into sys_menu values('106',  '鍙傛暟璁剧疆', '1', '7', 'config',        'system/config/index', 1, 0,  'C', 0, 0, 'system:config:list',       'edit',                'admin', now(), '', null, '鍙傛暟璁剧疆鑿滃崟');
+insert into sys_menu values('107',  '閫氱煡鍏憡', '1', '8', 'notice',        'system/notice/index', 1, 0,  'C', 0, 0, 'system:notice:list',       'message',             'admin', now(), '', null, '閫氱煡鍏憡鑿滃崟');
+insert into sys_menu values('108',  '鏃ュ織绠$悊', '1', '9', 'log',                     '', 1, 0,  'M', 0, 0, '',                         'log',                      'admin', now(), '', null, '鏃ュ織绠$悊鑿滃崟');
+insert into sys_menu values('109',  '鍦ㄧ嚎鐢ㄦ埛', '2', '1', 'online',       'monitor/online/index', 1, 0,  'C', 0, 0, 'monitor:online:list',      'online',              'admin', now(), '', null, '鍦ㄧ嚎鐢ㄦ埛鑿滃崟');
+insert into sys_menu values('110',  '瀹氭椂浠诲姟', '2', '2', 'job',          'monitor/job/index', 1, 0,  'C', 0, 0, 'monitor:job:list',         'job',                 'admin', now(), '', null, '瀹氭椂浠诲姟鑿滃崟');
+insert into sys_menu values('111',  '鏁版嵁鐩戞帶', '2', '3', 'druid',         'monitor/druid/index', 1, 0,  'C', 0, 0, 'monitor:data:list',        'druid',               'admin', now(), '', null, '鏁版嵁鐩戞帶鑿滃崟');
+insert into sys_menu values('112',  '鏈嶅姟鐩戞帶', '2', '4', 'server',       'monitor/server/index', 1, 0,  'C', 0, 0, 'monitor:server:list',      'server',              'admin', now(), '', null, '鏈嶅姟鐩戞帶鑿滃崟');
+insert into sys_menu values('113',  '缂撳瓨鐩戞帶', '2', '5', 'cache',          'monitor/cache/index', 1, 0,  'C', '0',  '0', 'monitor:cache:query',      'redis',                 'admin', now(), '', null, '缂撳瓨鐩戞帶鑿滃崟');
+insert into sys_menu values('114',  '琛ㄥ崟鏋勫缓', '3', '1', 'build',           'tool/build/index', 1, 0,  'C', 0, 0, 'tool:build:list',          'build',               'admin', now(), '', null, '琛ㄥ崟鏋勫缓鑿滃崟');
+insert into sys_menu values('115',  '浠g爜鐢熸垚', '3', '2', 'gen',             'tool/gen/index', 1, 0,  'C', 0, 0, 'tool:gen:list',            'code',                'admin', now(), '', null, '浠g爜鐢熸垚鑿滃崟');
+insert into sys_menu values('116',  '绯荤粺鎺ュ彛', '3', '3', 'swagger',        'tool/swagger/index', 1, 0,  'C', 0, 0, 'tool:swagger:list',        'swagger',             'admin', now(), '', null, '绯荤粺鎺ュ彛鑿滃崟');
+-- 涓夌骇鑿滃崟
+insert into sys_menu values('500',  '鎿嶄綔鏃ュ織', '108', '1', 'operlog',    'monitor/operlog/index', 1, 0,  'C', 0, 0, 'monitor:operlog:list',     'form',  'admin', now(), '', null, '鎿嶄綔鏃ュ織鑿滃崟');
+insert into sys_menu values('501',  '鐧诲綍鏃ュ織', '108', '2', 'logininfor', 'monitor/logininfor/index', 1, 0,  'C', 0, 0, 'monitor:logininfor:list',  'logininfor',  'admin', now(), '', null, '鐧诲綍鏃ュ織鑿滃崟');
+-- 鐢ㄦ埛绠$悊鎸夐挳
+insert into sys_menu values('1000', '鐢ㄦ埛鏌ヨ', '100', '1',  '#', '',  1, 0, 'F', 0, 0, 'system:user:query',        '#', 'admin', now(), '', null, '');
+insert into sys_menu values('1001', '鐢ㄦ埛鏂板', '100', '2',  '#', '',  1, 0, 'F', 0, 0, 'system:user:add',         '#', 'admin', now(), '', null, '');
+insert into sys_menu values('1002', '鐢ㄦ埛淇敼', '100', '3',  '#', '',  1, 0, 'F', 0, 0, 'system:user:edit',        '#', 'admin', now(), '', null, '');
+insert into sys_menu values('1003', '鐢ㄦ埛鍒犻櫎', '100', '4',  '#', '',  1, 0, 'F', 0, 0, 'system:user:remove',      '#', 'admin', now(), '', null, '');
+insert into sys_menu values('1004', '鐢ㄦ埛瀵煎嚭', '100', '5',  '#', '',  1, 0, 'F', 0, 0, 'system:user:export',      '#', 'admin', now(), '', null, '');
+insert into sys_menu values('1005', '鐢ㄦ埛瀵煎叆', '100', '6',  '#', '',  1, 0, 'F', 0, 0, 'system:user:import',      '#', 'admin', now(), '', null, '');
+insert into sys_menu values('1006', '閲嶇疆瀵嗙爜', '100', '7',  '#', '',  1, 0, 'F', 0, 0, 'system:user:resetPwd',    '#', 'admin', now(), '', null, '');
+-- 瑙掕壊绠$悊鎸夐挳
+insert into sys_menu values('1007', '瑙掕壊鏌ヨ', '101', '1',  '#', '',  1, 0, 'F', 0, 0, 'system:role:query',        '#', 'admin', now(), '', null, '');
+insert into sys_menu values('1008', '瑙掕壊鏂板', '101', '2',  '#', '',  1, 0, 'F', 0, 0, 'system:role:add',         '#', 'admin', now(), '', null, '');
+insert into sys_menu values('1009', '瑙掕壊淇敼', '101', '3',  '#', '',  1, 0, 'F', 0, 0, 'system:role:edit',        '#', 'admin', now(), '', null, '');
+insert into sys_menu values('1010', '瑙掕壊鍒犻櫎', '101', '4',  '#', '',  1, 0, 'F', 0, 0, 'system:role:remove',      '#', 'admin', now(), '', null, '');
+insert into sys_menu values('1011', '瑙掕壊瀵煎嚭', '101', '5',  '#', '',  1, 0, 'F', 0, 0, 'system:role:export',      '#', 'admin', now(), '', null, '');
+-- 鑿滃崟绠$悊鎸夐挳
+insert into sys_menu values('1012', '鑿滃崟鏌ヨ', '102', '1',  '#', '',  1, 0, 'F', 0, 0, 'system:menu:query',        '#', 'admin', now(), '', null, '');
+insert into sys_menu values('1013', '鑿滃崟鏂板', '102', '2',  '#', '',  1, 0, 'F', 0, 0, 'system:menu:add',         '#', 'admin', now(), '', null, '');
+insert into sys_menu values('1014', '鑿滃崟淇敼', '102', '3',  '#', '',  1, 0, 'F', 0, 0, 'system:menu:edit',        '#', 'admin', now(), '', null, '');
+insert into sys_menu values('1015', '鑿滃崟鍒犻櫎', '102', '4',  '#', '',  1, 0, 'F', 0, 0, 'system:menu:remove',      '#', 'admin', now(), '', null, '');
+-- 閮ㄩ棬绠$悊鎸夐挳
+insert into sys_menu values('1016', '閮ㄩ棬鏌ヨ', '103', '1',  '#', '',  1, 0, 'F', 0, 0, 'system:dept:query',        '#', 'admin', now(), '', null, '');
+insert into sys_menu values('1017', '閮ㄩ棬鏂板', '103', '2',  '#', '',  1, 0, 'F', 0, 0, 'system:dept:add',         '#', 'admin', now(), '', null, '');
+insert into sys_menu values('1018', '閮ㄩ棬淇敼', '103', '3',  '#', '',  1, 0, 'F', 0, 0, 'system:dept:edit',        '#', 'admin', now(), '', null, '');
+insert into sys_menu values('1019', '閮ㄩ棬鍒犻櫎', '103', '4',  '#', '',  1, 0, 'F', 0, 0, 'system:dept:remove',      '#', 'admin', now(), '', null, '');
+-- 宀椾綅绠$悊鎸夐挳
+insert into sys_menu values('1020', '宀椾綅鏌ヨ', '104', '1',  '#', '',  1, 0, 'F', 0, 0, 'system:post:query',        '#', 'admin', now(), '', null, '');
+insert into sys_menu values('1021', '宀椾綅鏂板', '104', '2',  '#', '',  1, 0, 'F', 0, 0, 'system:post:add',         '#', 'admin', now(), '', null, '');
+insert into sys_menu values('1022', '宀椾綅淇敼', '104', '3',  '#', '',  1, 0, 'F', 0, 0, 'system:post:edit',        '#', 'admin', now(), '', null, '');
+insert into sys_menu values('1023', '宀椾綅鍒犻櫎', '104', '4',  '#', '',  1, 0, 'F', 0, 0, 'system:post:remove',      '#', 'admin', now(), '', null, '');
+insert into sys_menu values('1024', '宀椾綅瀵煎嚭', '104', '5',  '#', '',  1, 0, 'F', 0, 0, 'system:post:export',      '#', 'admin', now(), '', null, '');
+-- 瀛楀吀绠$悊鎸夐挳
+insert into sys_menu values('1025', '瀛楀吀鏌ヨ', '105', '1', '#', '',  1, 0, 'F', 0, 0, 'system:dict:query',         '#', 'admin', now(), '', null, '');
+insert into sys_menu values('1026', '瀛楀吀鏂板', '105', '2', '#', '',  1, 0, 'F', 0, 0, 'system:dict:add',          '#', 'admin', now(), '', null, '');
+insert into sys_menu values('1027', '瀛楀吀淇敼', '105', '3', '#', '',  1, 0, 'F', 0, 0, 'system:dict:edit',         '#', 'admin', now(), '', null, '');
+insert into sys_menu values('1028', '瀛楀吀鍒犻櫎', '105', '4', '#', '',  1, 0, 'F', 0, 0, 'system:dict:remove',       '#', 'admin', now(), '', null, '');
+insert into sys_menu values('1029', '瀛楀吀瀵煎嚭', '105', '5', '#', '',  1, 0, 'F', 0, 0, 'system:dict:export',       '#', 'admin', now(), '', null, '');
+-- 鍙傛暟璁剧疆鎸夐挳
+insert into sys_menu values('1030', '鍙傛暟鏌ヨ', '106', '1', '#', '',  1, 0, 'F', 0, 0, 'system:config:query',      '#', 'admin', now(), '', null, '');
+insert into sys_menu values('1031', '鍙傛暟鏂板', '106', '2', '#', '',  1, 0, 'F', 0, 0, 'system:config:add',       '#', 'admin', now(), '', null, '');
+insert into sys_menu values('1032', '鍙傛暟淇敼', '106', '3', '#', '',  1, 0, 'F', 0, 0, 'system:config:edit',      '#', 'admin', now(), '', null, '');
+insert into sys_menu values('1033', '鍙傛暟鍒犻櫎', '106', '4', '#', '',  1, 0, 'F', 0, 0, 'system:config:remove',    '#', 'admin', now(), '', null, '');
+insert into sys_menu values('1034', '鍙傛暟瀵煎嚭', '106', '5', '#', '',  1, 0, 'F', 0, 0, 'system:config:export',    '#', 'admin', now(), '', null, '');
+-- 閫氱煡鍏憡鎸夐挳
+insert into sys_menu values('1035', '鍏憡鏌ヨ', '107', '1', '#', '',  1, 0, 'F', 0, 0, 'system:notice:query',      '#', 'admin', now(), '', null, '');
+insert into sys_menu values('1036', '鍏憡鏂板', '107', '2', '#', '',  1, 0, 'F', 0, 0, 'system:notice:add',       '#', 'admin', now(), '', null, '');
+insert into sys_menu values('1037', '鍏憡淇敼', '107', '3', '#', '',  1, 0, 'F', 0, 0, 'system:notice:edit',      '#', 'admin', now(), '', null, '');
+insert into sys_menu values('1038', '鍏憡鍒犻櫎', '107', '4', '#', '',  1, 0, 'F', 0, 0, 'system:notice:remove',    '#', 'admin', now(), '', null, '');
+-- 鎿嶄綔鏃ュ織鎸夐挳
+insert into sys_menu values('1039', '鎿嶄綔鏌ヨ', '500', '1', '#', '',  1, 0, 'F', 0, 0, 'monitor:operlog:query',    '#', 'admin', now(), '', null, '');
+insert into sys_menu values('1040', '鎿嶄綔鍒犻櫎', '500', '2', '#', '',  1, 0, 'F', 0, 0, 'monitor:operlog:remove',  '#', 'admin', now(), '', null, '');
+insert into sys_menu values('1041', '璇︾粏淇℃伅', '500', '3', '#', '',  1, 0, 'F', 0, 0, 'monitor:operlog:detail',  '#', 'admin', now(), '', null, '');
+insert into sys_menu values('1042', '鏃ュ織瀵煎嚭', '500', '4', '#', '',  1, 0, 'F', 0, 0, 'monitor:operlog:export',  '#', 'admin', now(), '', null, '');
+-- 鐧诲綍鏃ュ織鎸夐挳
+insert into sys_menu values('1043', '鐧诲綍鏌ヨ', '501', '1', '#', '',  1, 0, 'F', 0, 0, 'monitor:logininfor:query',         '#', 'admin', now(), '', null, '');
+insert into sys_menu values('1044', '鐧诲綍鍒犻櫎', '501', '2', '#', '',  1, 0, 'F', 0, 0, 'monitor:logininfor:remove',       '#', 'admin', now(), '', null, '');
+insert into sys_menu values('1045', '鏃ュ織瀵煎嚭', '501', '3', '#', '',  1, 0, 'F', 0, 0, 'monitor:logininfor:export',       '#', 'admin', now(), '', null, '');
+insert into sys_menu values('1046', '璐︽埛瑙i攣', '501', '4', '#', '',  1, 0, 'F', 0, 0, 'monitor:logininfor:unlock',       '#', 'admin', now(), '', null, '');
+-- 鍦ㄧ嚎鐢ㄦ埛鎸夐挳
+insert into sys_menu values('1047', '鍦ㄧ嚎鏌ヨ', '109', '1', '#', '',  1, 0, 'F', 0, 0, 'monitor:online:query',             '#', 'admin', now(), '', null, '');
+insert into sys_menu values('1048', '鎵归噺寮洪��', '109', '2', '#', '',  1, 0, 'F', 0, 0, 'monitor:online:batchForceLogout', '#', 'admin', now(), '', null, '');
+insert into sys_menu values('1049', '鍗曟潯寮洪��', '109', '3', '#', '',  1, 0, 'F', 0, 0, 'monitor:online:forceLogout',      '#', 'admin', now(), '', null, '');
+-- 瀹氭椂浠诲姟鎸夐挳
+insert into sys_menu values('1050', '浠诲姟鏌ヨ', '110', '1', '#', '',  1, 0, 'F', 0, 0, 'monitor:job:query',                '#', 'admin', now(), '', null, '');
+insert into sys_menu values('1051', '浠诲姟鏂板', '110', '2', '#', '',  1, 0, 'F', 0, 0, 'monitor:job:add',                 '#', 'admin', now(), '', null, '');
+insert into sys_menu values('1052', '浠诲姟淇敼', '110', '3', '#', '',  1, 0, 'F', 0, 0, 'monitor:job:edit',                '#', 'admin', now(), '', null, '');
+insert into sys_menu values('1053', '浠诲姟鍒犻櫎', '110', '4', '#', '',  1, 0, 'F', 0, 0, 'monitor:job:remove',              '#', 'admin', now(), '', null, '');
+insert into sys_menu values('1054', '鐘舵�佷慨鏀�', '110', '5', '#', '',  1, 0, 'F', 0, 0, 'monitor:job:changeStatus',        '#', 'admin', now(), '', null, '');
+insert into sys_menu values('1055', '浠诲姟璇︾粏', '110', '6', '#', '',  1, 0, 'F', 0, 0, 'monitor:job:detail',              '#', 'admin', now(), '', null, '');
+insert into sys_menu values('1056', '浠诲姟瀵煎嚭', '110', '7', '#', '',  1, 0, 'F', 0, 0, 'monitor:job:export',              '#', 'admin', now(), '', null, '');
+-- 浠g爜鐢熸垚鎸夐挳
+insert into sys_menu values('1057', '鐢熸垚鏌ヨ', '114', '1', '#', '',  1, 0, 'F', 0, 0, 'tool:gen:query',     '#', 'admin', now(), '', null, '');
+insert into sys_menu values('1058', '鐢熸垚淇敼', '114', '2', '#', '',  1, 0, 'F', 0, 0, 'tool:gen:edit',     '#', 'admin', now(), '', null, '');
+insert into sys_menu values('1059', '鐢熸垚鍒犻櫎', '114', '3', '#', '',  1, 0, 'F', 0, 0, 'tool:gen:remove',   '#', 'admin', now(), '', null, '');
+insert into sys_menu values('1060', '棰勮浠g爜', '114', '4', '#', '',  1, 0, 'F', 0, 0, 'tool:gen:preview',  '#', 'admin', now(), '', null, '');
+insert into sys_menu values('1061', '鐢熸垚浠g爜', '114', '5', '#', '',  1, 0, 'F', 0, 0, 'tool:gen:code',     '#', 'admin', now(), '', null, '');
+
+-- ----------------------------
+-- 6銆佺敤鎴峰拰瑙掕壊鍏宠仈琛�  鐢ㄦ埛N-1瑙掕壊
+-- ----------------------------
+drop table if exists sys_user_role;
+create table sys_user_role (
+                               user_id              BIGINT                 not null,
+                               role_id              BIGINT                 not null,
+                               constraint PK_SYS_USER_ROLE primary key (user_id, role_id)
+);
+
+comment on table sys_user_role is '鐢ㄦ埛鍜岃鑹插叧鑱旇〃';
+comment on column sys_user_role.user_id is '鐢ㄦ埛ID';
+comment on column sys_user_role.role_id is '瑙掕壊ID';
+
+-- ----------------------------
+-- 鍒濆鍖�-鐢ㄦ埛鍜岃鑹插叧鑱旇〃鏁版嵁
+-- ----------------------------
+insert into sys_user_role values ('1', '1');
+insert into sys_user_role values ('2', '2');
+
+
+-- ----------------------------
+-- 7銆佽鑹插拰鑿滃崟鍏宠仈琛�  瑙掕壊1-N鑿滃崟
+-- ----------------------------
+drop table if exists sys_role_menu;
+create table sys_role_menu (
+                               role_id              BIGINT                 not null,
+                               menu_id              BIGINT                 not null,
+                               constraint PK_SYS_ROLE_MENU primary key (role_id, menu_id)
+);
+
+comment on table sys_role_menu is '瑙掕壊鍜岃彍鍗曞叧鑱旇〃';
+comment on column sys_role_menu.role_id is '瑙掕壊ID';
+comment on column sys_role_menu.menu_id is '鑿滃崟ID';
+
+-- ----------------------------
+-- 鍒濆鍖�-瑙掕壊鍜岃彍鍗曞叧鑱旇〃鏁版嵁
+-- ----------------------------
+insert into sys_role_menu values ('2', '1');
+insert into sys_role_menu values ('2', '2');
+insert into sys_role_menu values ('2', '3');
+insert into sys_role_menu values ('2', '4');
+insert into sys_role_menu values ('2', '100');
+insert into sys_role_menu values ('2', '101');
+insert into sys_role_menu values ('2', '102');
+insert into sys_role_menu values ('2', '103');
+insert into sys_role_menu values ('2', '104');
+insert into sys_role_menu values ('2', '105');
+insert into sys_role_menu values ('2', '106');
+insert into sys_role_menu values ('2', '107');
+insert into sys_role_menu values ('2', '108');
+insert into sys_role_menu values ('2', '109');
+insert into sys_role_menu values ('2', '110');
+insert into sys_role_menu values ('2', '111');
+insert into sys_role_menu values ('2', '112');
+insert into sys_role_menu values ('2', '113');
+insert into sys_role_menu values ('2', '114');
+insert into sys_role_menu values ('2', '115');
+insert into sys_role_menu values ('2', '500');
+insert into sys_role_menu values ('2', '501');
+insert into sys_role_menu values ('2', '1000');
+insert into sys_role_menu values ('2', '1001');
+insert into sys_role_menu values ('2', '1002');
+insert into sys_role_menu values ('2', '1003');
+insert into sys_role_menu values ('2', '1004');
+insert into sys_role_menu values ('2', '1005');
+insert into sys_role_menu values ('2', '1006');
+insert into sys_role_menu values ('2', '1007');
+insert into sys_role_menu values ('2', '1008');
+insert into sys_role_menu values ('2', '1009');
+insert into sys_role_menu values ('2', '1010');
+insert into sys_role_menu values ('2', '1011');
+insert into sys_role_menu values ('2', '1012');
+insert into sys_role_menu values ('2', '1013');
+insert into sys_role_menu values ('2', '1014');
+insert into sys_role_menu values ('2', '1015');
+insert into sys_role_menu values ('2', '1016');
+insert into sys_role_menu values ('2', '1017');
+insert into sys_role_menu values ('2', '1018');
+insert into sys_role_menu values ('2', '1019');
+insert into sys_role_menu values ('2', '1020');
+insert into sys_role_menu values ('2', '1021');
+insert into sys_role_menu values ('2', '1022');
+insert into sys_role_menu values ('2', '1023');
+insert into sys_role_menu values ('2', '1024');
+insert into sys_role_menu values ('2', '1025');
+insert into sys_role_menu values ('2', '1026');
+insert into sys_role_menu values ('2', '1027');
+insert into sys_role_menu values ('2', '1028');
+insert into sys_role_menu values ('2', '1029');
+insert into sys_role_menu values ('2', '1030');
+insert into sys_role_menu values ('2', '1031');
+insert into sys_role_menu values ('2', '1032');
+insert into sys_role_menu values ('2', '1033');
+insert into sys_role_menu values ('2', '1034');
+insert into sys_role_menu values ('2', '1035');
+insert into sys_role_menu values ('2', '1036');
+insert into sys_role_menu values ('2', '1037');
+insert into sys_role_menu values ('2', '1038');
+insert into sys_role_menu values ('2', '1039');
+insert into sys_role_menu values ('2', '1040');
+insert into sys_role_menu values ('2', '1041');
+insert into sys_role_menu values ('2', '1042');
+insert into sys_role_menu values ('2', '1043');
+insert into sys_role_menu values ('2', '1044');
+insert into sys_role_menu values ('2', '1045');
+insert into sys_role_menu values ('2', '1046');
+insert into sys_role_menu values ('2', '1047');
+insert into sys_role_menu values ('2', '1048');
+insert into sys_role_menu values ('2', '1049');
+insert into sys_role_menu values ('2', '1050');
+insert into sys_role_menu values ('2', '1051');
+insert into sys_role_menu values ('2', '1052');
+insert into sys_role_menu values ('2', '1053');
+insert into sys_role_menu values ('2', '1054');
+insert into sys_role_menu values ('2', '1055');
+insert into sys_role_menu values ('2', '1056');
+insert into sys_role_menu values ('2', '1057');
+insert into sys_role_menu values ('2', '1058');
+insert into sys_role_menu values ('2', '1059');
+insert into sys_role_menu values ('2', '1060');
+insert into sys_role_menu values ('2', '1061');
+
+-- ----------------------------
+-- 8銆佽鑹插拰閮ㄩ棬鍏宠仈琛�  瑙掕壊1-N閮ㄩ棬
+-- ----------------------------
+drop table if exists sys_role_dept;
+
+create table sys_role_dept (
+                               role_id              BIGINT                 not null,
+                               dept_id              BIGINT                 not null,
+                               constraint PK_SYS_ROLE_DEPT primary key (role_id, dept_id)
+);
+
+comment on table sys_role_dept is '瑙掕壊鍜岄儴闂ㄥ叧鑱旇〃';
+comment on column sys_role_dept.role_id is '鐢ㄦ埛ID';
+comment on column sys_role_dept.dept_id is '宀椾綅ID';
+
+-- ----------------------------
+-- 鍒濆鍖�-瑙掕壊鍜岄儴闂ㄥ叧鑱旇〃鏁版嵁
+-- ----------------------------
+insert into sys_role_dept values ('2', '100');
+insert into sys_role_dept values ('2', '101');
+insert into sys_role_dept values ('2', '105');
+
+-- ----------------------------
+-- 9銆佺敤鎴蜂笌宀椾綅鍏宠仈琛�  鐢ㄦ埛1-N宀椾綅
+-- ----------------------------
+drop table if exists sys_user_post;
+create table sys_user_post (
+                               user_id              BIGINT                 not null,
+                               post_id              BIGINT                 not null,
+                               constraint PK_SYS_USER_POST primary key (user_id, post_id)
+);
+
+comment on table sys_user_post is '鐢ㄦ埛涓庡矖浣嶅叧鑱旇〃';
+comment on column sys_user_post.user_id is '鐢ㄦ埛ID';
+comment on column sys_user_post.post_id is '宀椾綅ID';
+
+-- ----------------------------
+-- 鍒濆鍖�-鐢ㄦ埛涓庡矖浣嶅叧鑱旇〃鏁版嵁
+-- ----------------------------
+insert into sys_user_post values ('1', '1');
+insert into sys_user_post values ('2', '2');
+
+-- ----------------------------
+-- 10銆佹搷浣滄棩蹇楄褰�
+-- ----------------------------
+drop table if exists sys_oper_log;
+create table sys_oper_log (
+                              oper_id              BIGSERIAL not null,
+                              title                VARCHAR(50)          null default '',
+                              business_type        INT4                 null default 0,
+                              method               VARCHAR(100)         null default '',
+                              request_method       VARCHAR(10)     	 null default '',
+                              operator_type        INT4                 null default 0,
+                              oper_name            VARCHAR(50)          null default '',
+                              dept_name            VARCHAR(50)          null default '',
+                              oper_url             VARCHAR(255)         null default '',
+                              oper_ip              VARCHAR(30)          null default '',
+                              oper_location        VARCHAR(255)   	     null default '',
+                              oper_param           VARCHAR(2000)        null default '',
+                              json_result          VARCHAR(2000)        null default '',
+                              status               CHAR(1)                 null default '0',
+                              error_msg            VARCHAR(2000)        null default '',
+                              oper_time            TIMESTAMP            null,
+                              constraint PK_SYS_OPER_LOG primary key (oper_id)
+);
+alter sequence if exists sys_oper_log_oper_id_seq restart with 100 cache 20;
+
+comment on table sys_oper_log is '鎿嶄綔鏃ュ織璁板綍';
+comment on column sys_oper_log.oper_id is '鏃ュ織涓婚敭';
+comment on column sys_oper_log.title is '妯″潡鏍囬';
+comment on column sys_oper_log.business_type is '涓氬姟绫诲瀷锛�0鍏跺畠 1鏂板 2淇敼 3鍒犻櫎锛�';
+comment on column sys_oper_log.method is '鏂规硶鍚嶇О';
+comment on column sys_oper_log.request_method is '璇锋眰鏂瑰紡';
+comment on column sys_oper_log.operator_type is '鎿嶄綔绫诲埆锛�0鍏跺畠 1鍚庡彴鐢ㄦ埛 2鎵嬫満绔敤鎴凤級';
+comment on column sys_oper_log.oper_name is '鐧诲綍璐﹀彿';
+comment on column sys_oper_log.dept_name is '閮ㄩ棬鍚嶇О';
+comment on column sys_oper_log.oper_url is '璇锋眰URL';
+comment on column sys_oper_log.oper_ip is '涓绘満鍦板潃';
+comment on column sys_oper_log.oper_location  is '鎿嶄綔鍦扮偣';
+comment on column sys_oper_log.oper_param is '璇锋眰鍙傛暟';
+comment on column sys_oper_log.json_result    is '杩斿洖鍙傛暟';
+comment on column sys_oper_log.status is '鎿嶄綔鐘舵�侊紙0姝e父 1寮傚父锛�';
+comment on column sys_oper_log.error_msg is '閿欒娑堟伅';
+comment on column sys_oper_log.oper_time is '鎿嶄綔鏃堕棿';
+
+
+-- ----------------------------
+-- 11銆佸瓧鍏哥被鍨嬭〃
+-- ----------------------------
+drop table if exists  sys_dict_type;
+create table sys_dict_type (
+                               dict_id              BIGSERIAL not null,
+                               dict_name            VARCHAR(100)         null default '',
+                               dict_type            VARCHAR(100)         null default '' unique,
+                               status               CHAR(1)              null default '0',
+                               create_by            VARCHAR(64)          null default '',
+                               create_time          TIMESTAMP                 null,
+                               update_by            VARCHAR(64)          null default '',
+                               update_time          TIMESTAMP                 null,
+                               remark               VARCHAR(500)         null default '',
+                               constraint PK_SYS_DICT_TYPE primary key (dict_id)
+);
+
+alter sequence if exists sys_dict_type_dict_id_seq restart with 100 cache 20;
+
+comment on table sys_dict_type is '瀛楀吀绫诲瀷琛�';
+comment on column sys_dict_type.dict_id is '瀛楀吀涓婚敭';
+comment on column sys_dict_type.dict_name is '瀛楀吀鍚嶇О';
+comment on column sys_dict_type.dict_type is '瀛楀吀绫诲瀷';
+comment on column sys_dict_type.status is '鐘舵�侊紙0姝e父 1绂佺敤锛�';
+comment on column sys_dict_type.create_by is '鍒涘缓鑰�';
+comment on column sys_dict_type.create_time is '鍒涘缓鏃堕棿';
+comment on column sys_dict_type.update_by is '鏇存柊鑰�';
+comment on column sys_dict_type.update_time is '鏇存柊鏃堕棿';
+comment on column sys_dict_type.remark is '澶囨敞';
+
+
+insert into sys_dict_type values(1,  '鐢ㄦ埛鎬у埆', 'sys_user_sex',        '0', 'admin', now(), '', null, '鐢ㄦ埛鎬у埆鍒楄〃');
+insert into sys_dict_type values(2,  '鑿滃崟鐘舵��', 'sys_show_hide',       '0', 'admin', now(), '', null, '鑿滃崟鐘舵�佸垪琛�');
+insert into sys_dict_type values(3,  '绯荤粺寮�鍏�', 'sys_normal_disable',  '0', 'admin', now(), '', null, '绯荤粺寮�鍏冲垪琛�');
+insert into sys_dict_type values(4,  '浠诲姟鐘舵��', 'sys_job_status',      '0', 'admin', now(), '', null, '浠诲姟鐘舵�佸垪琛�');
+insert into sys_dict_type values(5,  '浠诲姟鍒嗙粍', 'sys_job_group',       '0', 'admin', now(), '', null, '浠诲姟鍒嗙粍鍒楄〃');
+insert into sys_dict_type values(6,  '绯荤粺鏄惁', 'sys_yes_no',          '0', 'admin', now(), '', null, '绯荤粺鏄惁鍒楄〃');
+insert into sys_dict_type values(7,  '閫氱煡绫诲瀷', 'sys_notice_type',     '0', 'admin', now(), '', null, '閫氱煡绫诲瀷鍒楄〃');
+insert into sys_dict_type values(8,  '閫氱煡鐘舵��', 'sys_notice_status',   '0', 'admin', now(), '', null, '閫氱煡鐘舵�佸垪琛�');
+insert into sys_dict_type values(9,  '鎿嶄綔绫诲瀷', 'sys_oper_type',       '0', 'admin', now(), '', null, '鎿嶄綔绫诲瀷鍒楄〃');
+insert into sys_dict_type values(10, '绯荤粺鐘舵��', 'sys_common_status',   '0', 'admin', now(), '', null, '鐧诲綍鐘舵�佸垪琛�');
+
+-- ----------------------------
+-- 12銆佸瓧鍏告暟鎹〃
+-- ----------------------------
+drop table if exists  sys_dict_data;
+create table sys_dict_data (
+                               dict_code            BIGSERIAL not null,
+                               dict_sort            INT4                 null default 0,
+                               dict_label           VARCHAR(100)         null default '',
+                               dict_value           VARCHAR(100)         null default '',
+                               dict_type            VARCHAR(100)         null default '',
+                               css_class            VARCHAR(100)         null,
+                               list_class           VARCHAR(100)         null,
+                               is_default           CHAR(1)              null,
+                               status               CHAR(1)              null default '0',
+                               create_by            VARCHAR(64)          null default '',
+                               create_time          TIMESTAMP                 null,
+                               update_by            VARCHAR(64)          null default '',
+                               update_time          TIMESTAMP                 null,
+                               remark               VARCHAR(500)         null default '',
+                               constraint PK_SYS_DICT_DATA primary key (dict_code)
+);
+alter sequence if exists sys_dict_data_dict_code_seq restart with 100 cache 20;
+
+comment on table sys_dict_data is '瀛楀吀鏁版嵁琛�';
+comment on column sys_dict_data.dict_code is '瀛楀吀缂栫爜';
+comment on column sys_dict_data.dict_sort is '瀛楀吀鎺掑簭';
+comment on column sys_dict_data.dict_label is '瀛楀吀鏍囩';
+comment on column sys_dict_data.dict_value is '瀛楀吀閿��';
+comment on column sys_dict_data.dict_type is '瀛楀吀绫诲瀷';
+comment on column sys_dict_data.css_class     is '鏍峰紡灞炴�э紙鍏朵粬鏍峰紡鎵╁睍锛�';
+comment on column sys_dict_data.list_class    is '琛ㄦ牸鍥炴樉鏍峰紡';
+comment on column sys_dict_data.is_default    is '鏄惁榛樿锛圷鏄� N鍚︼級';
+comment on column sys_dict_data.status is  '鐘舵�侊紙0姝e父 1绂佺敤锛�';
+comment on column sys_dict_data.create_by is '鍒涘缓鑰�';
+comment on column sys_dict_data.create_time is '鍒涘缓鏃堕棿';
+comment on column sys_dict_data.update_by is '鏇存柊鑰�';
+comment on column sys_dict_data.update_time is '鏇存柊鏃堕棿';
+comment on column sys_dict_data.remark is '澶囨敞';
+
+insert into sys_dict_data values(1,  1,  '鐢�',       '0',       'sys_user_sex',        '',   '',        'Y', '0', 'admin', now(), '', null, '鎬у埆鐢�');
+insert into sys_dict_data values(2,  2,  '濂�',       '1',       'sys_user_sex',        '',   '',        'N', '0', 'admin', now(), '', null, '鎬у埆濂�');
+insert into sys_dict_data values(3,  3,  '鏈煡',     '2',       'sys_user_sex',        '',   '',        'N', '0', 'admin', now(), '', null, '鎬у埆鏈煡');
+insert into sys_dict_data values(4,  1,  '鏄剧ず',     '0',       'sys_show_hide',       '',   'primary', 'Y', '0', 'admin', now(), '', null, '鏄剧ず鑿滃崟');
+insert into sys_dict_data values(5,  2,  '闅愯棌',     '1',       'sys_show_hide',       '',   'danger',  'N', '0', 'admin', now(), '', null, '闅愯棌鑿滃崟');
+insert into sys_dict_data values(6,  1,  '姝e父',     '0',       'sys_normal_disable',  '',   'primary', 'Y', '0', 'admin', now(), '', null, '姝e父鐘舵��');
+insert into sys_dict_data values(7,  2,  '鍋滅敤',     '1',       'sys_normal_disable',  '',   'danger',  'N', '0', 'admin', now(), '', null, '鍋滅敤鐘舵��');
+insert into sys_dict_data values(8,  1,  '姝e父',     '0',       'sys_job_status',      '',   'primary', 'Y', '0', 'admin', now(), '', null, '姝e父鐘舵��');
+insert into sys_dict_data values(9,  2,  '鏆傚仠',     '1',       'sys_job_status',      '',   'danger',  'N', '0', 'admin', now(), '', null, '鍋滅敤鐘舵��');
+insert into sys_dict_data values(10, 1,  '榛樿',     'DEFAULT', 'sys_job_group',       '',   '',        'Y', '0', 'admin', now(), '', null, '榛樿鍒嗙粍');
+insert into sys_dict_data values(11, 2,  '绯荤粺',     'SYSTEM',  'sys_job_group',       '',   '',        'N', '0', 'admin', now(), '', null, '绯荤粺鍒嗙粍');
+insert into sys_dict_data values(12, 1,  '鏄�',       'Y',       'sys_yes_no',          '',   'primary', 'Y', '0', 'admin', now(), '', null, '绯荤粺榛樿鏄�');
+insert into sys_dict_data values(13, 2,  '鍚�',       'N',       'sys_yes_no',          '',   'danger',  'N', '0', 'admin', now(), '', null, '绯荤粺榛樿鍚�');
+insert into sys_dict_data values(14, 1,  '閫氱煡',     '1',       'sys_notice_type',     '',   'warning', 'Y', '0', 'admin', now(), '', null, '閫氱煡');
+insert into sys_dict_data values(15, 2,  '鍏憡',     '2',       'sys_notice_type',     '',   'success', 'N', '0', 'admin', now(), '', null, '鍏憡');
+insert into sys_dict_data values(16, 1,  '姝e父',     '0',       'sys_notice_status',   '',   'primary', 'Y', '0', 'admin', now(), '', null, '姝e父鐘舵��');
+insert into sys_dict_data values(17, 2,  '鍏抽棴',     '1',       'sys_notice_status',   '',   'danger',  'N', '0', 'admin', now(), '', null, '鍏抽棴鐘舵��');
+insert into sys_dict_data values(18, 99, '鍏朵粬',     '0',       'sys_oper_type',       '',   'info',    'N', '0', 'admin', now(), '', null, '鍏朵粬鎿嶄綔');
+insert into sys_dict_data values(19, 1,  '鏂板',     '1',       'sys_oper_type',       '',   'info',    'N', '0', 'admin', now(), '', null, '鏂板鎿嶄綔');
+insert into sys_dict_data values(20, 2,  '淇敼',     '2',       'sys_oper_type',       '',   'info',    'N', '0', 'admin', now(), '', null, '淇敼鎿嶄綔');
+insert into sys_dict_data values(21, 3,  '鍒犻櫎',     '3',       'sys_oper_type',       '',   'danger',  'N', '0', 'admin', now(), '', null, '鍒犻櫎鎿嶄綔');
+insert into sys_dict_data values(22, 4,  '鎺堟潈',     '4',       'sys_oper_type',       '',   'primary', 'N', '0', 'admin', now(), '', null, '鎺堟潈鎿嶄綔');
+insert into sys_dict_data values(23, 5,  '瀵煎嚭',     '5',       'sys_oper_type',       '',   'warning', 'N', '0', 'admin', now(), '', null, '瀵煎嚭鎿嶄綔');
+insert into sys_dict_data values(24, 6,  '瀵煎叆',     '6',       'sys_oper_type',       '',   'warning', 'N', '0', 'admin', now(), '', null, '瀵煎叆鎿嶄綔');
+insert into sys_dict_data values(25, 7,  '寮洪��',     '7',       'sys_oper_type',       '',   'danger',  'N', '0', 'admin', now(), '', null, '寮洪��鎿嶄綔');
+insert into sys_dict_data values(26, 8,  '鐢熸垚浠g爜', '8',       'sys_oper_type',       '',   'warning', 'N', '0', 'admin', now(), '', null, '鐢熸垚鎿嶄綔');
+insert into sys_dict_data values(27, 9,  '娓呯┖鏁版嵁', '9',       'sys_oper_type',       '',   'danger',  'N', '0', 'admin', now(), '', null, '娓呯┖鎿嶄綔');
+insert into sys_dict_data values(28, 1,  '鎴愬姛',     '0',       'sys_common_status',   '',   'primary', 'N', '0', 'admin', now(), '', null, '姝e父鐘舵��');
+insert into sys_dict_data values(29, 2,  '澶辫触',     '1',       'sys_common_status',   '',   'danger',  'N', '0', 'admin', now(), '', null, '鍋滅敤鐘舵��');
+
+-- ----------------------------
+-- 13銆佸弬鏁伴厤缃〃
+-- ----------------------------
+drop table if exists  sys_config;
+create table sys_config (
+                            config_id            BIGSERIAL not null,
+                            config_name          VARCHAR(100)         null default '0',
+                            config_key           VARCHAR(100)         null default '',
+                            config_value         VARCHAR(100)         null default '',
+                            config_type          CHAR(1)              null default '',
+                            create_by            VARCHAR(64)          null default '',
+                            create_time          TIMESTAMP                 null,
+                            update_by            VARCHAR(64)          null default '',
+                            update_time          TIMESTAMP                 null,
+                            remark               VARCHAR(500)         null default '',
+                            constraint PK_SYS_CONFIG primary key (config_id)
+);
+alter sequence if exists sys_config_config_id_seq restart with 100 cache 20;
+comment on table sys_config is '鍙傛暟閰嶇疆琛�';
+
+comment on column sys_config.config_id is '瀛楀吀缂栫爜';
+
+comment on column sys_config.config_name is '瀛楀吀鎺掑簭';
+
+comment on column sys_config.config_key is '瀛楀吀鏍囩';
+
+comment on column sys_config.config_value is '瀛楀吀閿��';
+
+comment on column sys_config.config_type is '瀛楀吀绫诲瀷';
+
+comment on column sys_config.create_by is '鍒涘缓鑰�';
+
+comment on column sys_config.create_time is '鍒涘缓鏃堕棿';
+
+comment on column sys_config.update_by is '鏇存柊鑰�';
+
+comment on column sys_config.update_time is '鏇存柊鏃堕棿';
+
+comment on column sys_config.remark is '澶囨敞';
+
+
+insert into sys_config values(1, '涓绘鏋堕〉-榛樿鐨偆鏍峰紡鍚嶇О',     'sys.index.skinName',       'skin-blue',     'Y', 'admin', now(), '', null, '钃濊壊 skin-blue銆佺豢鑹� skin-green銆佺传鑹� skin-purple銆佺孩鑹� skin-red銆侀粍鑹� skin-yellow');
+insert into sys_config values(2, '鐢ㄦ埛绠$悊-璐﹀彿鍒濆瀵嗙爜',         'sys.user.initPassword',    '123456',        'Y', 'admin', now(), '', null, '鍒濆鍖栧瘑鐮� 123456');
+insert into sys_config values(3, '涓绘鏋堕〉-渚ц竟鏍忎富棰�',           'sys.index.sideTheme',      'theme-dark',    'Y', 'admin', now(), '', null, '娣遍粦涓婚theme-dark锛屾祬鑹蹭富棰榯heme-light锛屾繁钃濅富棰榯heme-blue');
+insert into sys_config values(4, '璐﹀彿鑷姪-鏄惁寮�鍚敤鎴锋敞鍐屽姛鑳�', 'sys.account.registerUser', 'false',         'Y', 'admin', now(), '', null, '鏄惁寮�鍚敞鍐岀敤鎴峰姛鑳�');
+insert into sys_config values(5, '鐢ㄦ埛绠$悊-瀵嗙爜瀛楃鑼冨洿',         'sys.account.chrtype',              '0',             'Y', 'admin', now(), '', null, '榛樿浠绘剰瀛楃鑼冨洿锛�0浠绘剰锛堝瘑鐮佸彲浠ヨ緭鍏ヤ换鎰忓瓧绗︼級锛�1鏁板瓧锛堝瘑鐮佸彧鑳戒负0-9鏁板瓧锛夛紝2鑻辨枃瀛楁瘝锛堝瘑鐮佸彧鑳戒负a-z鍜孉-Z瀛楁瘝锛夛紝3瀛楁瘝鍜屾暟瀛楋紙瀵嗙爜蹇呴』鍖呭惈瀛楁瘝锛屾暟瀛楋級,4瀛楁瘝鏁板瓧鍜岀壒娈婂瓧绗︼紙鐩墠鏀寔鐨勭壒娈婂瓧绗﹀寘鎷細~!@#$%^&*()-=_+锛�');
+insert into sys_config values(6, '鐢ㄦ埛绠$悊-鍒濆瀵嗙爜淇敼绛栫暐',     'sys.account.initPasswordModify',   '0',             'Y', 'admin', now(), '', null, '0锛氬垵濮嬪瘑鐮佷慨鏀圭瓥鐣ュ叧闂紝娌℃湁浠讳綍鎻愮ず锛�1锛氭彁閱掔敤鎴凤紝濡傛灉鏈慨鏀瑰垵濮嬪瘑鐮侊紝鍒欏湪鐧诲綍鏃跺氨浼氭彁閱掍慨鏀瑰瘑鐮佸璇濇');
+insert into sys_config values(7, '鐢ㄦ埛绠$悊-璐﹀彿瀵嗙爜鏇存柊鍛ㄦ湡',     'sys.account.passwordValidateDays', '0',             'Y', 'admin', now(), '', null, '瀵嗙爜鏇存柊鍛ㄦ湡锛堝~鍐欐暟瀛楋紝鏁版嵁鍒濆鍖栧�间负0涓嶉檺鍒讹紝鑻ヤ慨鏀瑰繀椤讳负澶т簬0灏忎簬365鐨勬鏁存暟锛夛紝濡傛灉瓒呰繃杩欎釜鍛ㄦ湡鐧诲綍绯荤粺鏃讹紝鍒欏湪鐧诲綍鏃跺氨浼氭彁閱掍慨鏀瑰瘑鐮佸璇濇');
+insert into sys_config values(8, '涓绘鏋堕〉-鑿滃崟瀵艰埅鏄剧ず椋庢牸',     'sys.index.menuStyle',              'default',       'Y', 'admin', now(), '', null, '鑿滃崟瀵艰埅鏄剧ず椋庢牸锛坉efault涓哄乏渚у鑸彍鍗曪紝topnav涓洪《閮ㄥ鑸彍鍗曪級');
+insert into sys_config values(9, '涓绘鏋堕〉-鏄惁寮�鍚〉鑴�',         'sys.index.ignoreFooter',           'true',          'Y', 'admin', now(), '', null, '鏄惁寮�鍚簳閮ㄩ〉鑴氭樉绀猴紙true鏄剧ず锛宖alse闅愯棌锛�');
+
+-- ----------------------------
+-- 14銆佺郴缁熻闂褰�
+-- ----------------------------
+drop table if exists sys_logininfor;
+create table sys_logininfor (
+                                info_id              BIGSERIAL            not null,
+                                user_name           VARCHAR(50)           null default '',
+                                ipaddr               VARCHAR(50)          null default '',
+                                login_location       VARCHAR(255)         null,
+                                browser              VARCHAR(50)          null default '',
+                                os                   VARCHAR(50)          null default '',
+                                status               CHAR(1)              null default '0',
+                                msg                  VARCHAR(255)         null default '',
+                                login_time           TIMESTAMP                 null,
+                                constraint PK_SYS_LOGININFOR primary key (info_id)
+);
+
+alter sequence if exists sys_logininfor_info_id_seq restart with 100  cache 20;
+
+comment on table sys_logininfor is '绯荤粺璁块棶璁板綍';
+comment on column sys_logininfor.info_id is '璁块棶ID';
+comment on column sys_logininfor.user_name is '鐧诲綍璐﹀彿';
+comment on column sys_logininfor.ipaddr is '鐧诲綍IP鍦板潃';
+comment on column sys_logininfor.browser is '娴忚鍣ㄧ被鍨�';
+comment on column sys_logininfor.login_location is '鐧诲綍鍦扮偣';
+comment on column sys_logininfor.os is '鎿嶄綔绯荤粺';
+comment on column sys_logininfor.status is '鐧诲綍鐘舵�� 0鎴愬姛 1澶辫触';
+comment on column sys_logininfor.msg is '鎻愮ず娑堟伅';
+comment on column sys_logininfor.login_time is '璁块棶鏃堕棿';
+
+-- ----------------------------
+-- 15銆佸湪绾跨敤鎴疯褰�
+-- ----------------------------
+drop table if exists sys_user_online;
+create table sys_user_online (
+                                 sessionId            VARCHAR(50)          not null default '',
+                                 user_name           VARCHAR(50)          null default '',
+                                 dept_name            VARCHAR(50)          null default '',
+                                 ipaddr               VARCHAR(50)          null default '',
+                                 login_location       VARCHAR(255)         null,
+                                 browser              VARCHAR(50)          null default '',
+                                 os                   VARCHAR(50)          null default '',
+                                 status               VARCHAR(10)          null default '',
+                                 start_timestamp      TIMESTAMP                 null,
+                                 last_access_time     TIMESTAMP                 null,
+                                 expire_time          INT4                 null default 0,
+                                 constraint PK_SYS_USER_ONLINE primary key (sessionId)
+);
+
+comment on table sys_user_online is '鍦ㄧ嚎鐢ㄦ埛璁板綍';
+comment on column sys_user_online.sessionId is '鐢ㄦ埛浼氳瘽id';
+comment on column sys_user_online.user_name is '鐧诲綍璐﹀彿';
+comment on column sys_user_online.dept_name is '閮ㄩ棬鍚嶇О';
+comment on column sys_user_online.ipaddr is '鐧诲綍IP鍦板潃';
+comment on column sys_user_online.login_location    is '鐧诲綍鍦扮偣';
+comment on column sys_user_online.browser is '娴忚鍣ㄧ被鍨�';
+comment on column sys_user_online.os is '鎿嶄綔绯荤粺';
+comment on column sys_user_online.status is '鍦ㄧ嚎鐘舵�乷n_line鍦ㄧ嚎off_line绂荤嚎';
+comment on column sys_user_online.start_timestamp is 'session鍒涘缓鏃堕棿';
+comment on column sys_user_online.last_access_time is 'session鏈�鍚庤闂椂闂�';
+comment on column sys_user_online.expire_time is '瓒呮椂鏃堕棿锛屽崟浣嶄负鍒嗛挓';
+
+-- ----------------------------
+-- 16銆佸畾鏃朵换鍔¤皟搴﹁〃
+-- ----------------------------
+drop table if exists  sys_job;
+
+create table sys_job (
+                         job_id               BIGSERIAL not null,
+                         job_name             VARCHAR(64)          not null default '',
+                         job_group            VARCHAR(64)          not null default '',
+                         invoke_target        VARCHAR(500)         not null ,
+                         cron_expression      VARCHAR(255)         null default '',
+                         misfire_policy       VARCHAR(20)   		 null default '3',
+                         concurrent           CHAR(1)        	     null default '1',
+                         status               CHAR(1)              null default '0',
+                         create_by            VARCHAR(64)          null default '',
+                         create_time          TIMESTAMP                 null,
+                         update_by            VARCHAR(64)          null default '',
+                         update_time          TIMESTAMP                 null,
+                         remark               VARCHAR(500)         null default '',
+                         constraint PK_SYS_JOB primary key (job_id, job_name, job_group)
+);
+
+alter sequence if exists sys_job_job_id_seq restart with 100 cache 20;
+
+comment on table  sys_job                   is '瀹氭椂浠诲姟璋冨害琛�';
+comment on column sys_job.job_id            is '浠诲姟涓婚敭';
+comment on column sys_job.job_name          is '浠诲姟鍚嶇О';
+comment on column sys_job.job_group         is '浠诲姟缁勫悕';
+comment on column sys_job.invoke_target     is '璋冪敤鐩爣瀛楃涓�';
+comment on column sys_job.cron_expression   is 'cron鎵ц琛ㄨ揪寮�';
+comment on column sys_job.misfire_policy    is '璁″垝鎵ц閿欒绛栫暐锛�1绔嬪嵆鎵ц 2鎵ц涓�娆� 3鏀惧純鎵ц锛�';
+comment on column sys_job.concurrent        is '鏄惁骞跺彂鎵ц锛�0鍏佽 1绂佹锛�';
+comment on column sys_job.status            is '鐘舵�侊紙0姝e父 1鏆傚仠锛�';
+comment on column sys_job.create_by         is '鍒涘缓鑰�';
+comment on column sys_job.create_time       is '鍒涘缓鏃堕棿';
+comment on column sys_job.update_by         is '鏇存柊鑰�';
+comment on column sys_job.update_time       is '鏇存柊鏃堕棿';
+comment on column sys_job.remark            is '澶囨敞淇℃伅';
+
+insert into sys_job values(1, '绯荤粺榛樿锛堟棤鍙傦級', 'DEFAULT', 'ryTask.ryNoParams',        '0/10 * * * * ?', '3', '1', '1', 'admin', now(), '', null, '');
+insert into sys_job values(2, '绯荤粺榛樿锛堟湁鍙傦級', 'DEFAULT', E'ryTask.ryParams(\'ry\')',  '0/15 * * * * ?', '3', '1', '1', 'admin', now(), '', null, '');
+insert into sys_job values(3, '绯荤粺榛樿锛堝鍙傦級', 'DEFAULT', E'ryTask.ryMultipleParams(\'ry\', true, 2000L, 316.50D, 100)',  '0/20 * * * * ?', '3', '1', '1', 'admin', now(), '', null, '');
+
+-- ----------------------------
+-- 17銆佸畾鏃朵换鍔¤皟搴︽棩蹇楄〃
+-- ----------------------------
+drop table if exists sys_job_log;
+create table sys_job_log (
+                             job_log_id           BIGSERIAL not null,
+                             job_name             VARCHAR(64)          not null,
+                             job_group            VARCHAR(64)          not null,
+                             invoke_target        VARCHAR(500)    	 not null ,
+                             job_message          VARCHAR(500)         null,
+                             status               CHAR(1)          default '0',
+                             exception_info       VARCHAR(2000)                null,
+                             create_time          TIMESTAMP                 null,
+                             constraint PK_SYS_JOB_LOG primary key (job_log_id)
+);
+alter sequence if exists sys_job_log_job_log_id_seq  cache 20;
+
+comment on table  sys_job_log                   is '瀹氭椂浠诲姟璋冨害鏃ュ織琛�';
+comment on column sys_job_log.job_log_id        is '鏃ュ織涓婚敭';
+comment on column sys_job_log.job_name          is '浠诲姟鍚嶇О';
+comment on column sys_job_log.job_group         is '浠诲姟缁勫悕';
+comment on column sys_job_log.invoke_target     is '璋冪敤鐩爣瀛楃涓�';
+comment on column sys_job_log.job_message       is '鏃ュ織淇℃伅';
+comment on column sys_job_log.status            is '鎵ц鐘舵�侊紙0姝e父 1澶辫触锛�';
+comment on column sys_job_log.exception_info    is '寮傚父淇℃伅';
+comment on column sys_job_log.create_time       is '鍒涘缓鏃堕棿';
+
+
+-- ----------------------------
+-- 18銆侀�氱煡鍏憡琛�
+-- ----------------------------
+drop table if exists sys_notice;
+
+create table sys_notice (
+                            notice_id            BIGSERIAL not null,
+                            notice_title         VARCHAR(50)          not null,
+                            notice_type          CHAR(2)              not null,
+                            notice_content       VARCHAR(2000)        null,
+                            status               CHAR(1)              null default '0',
+                            create_by            VARCHAR(64)          null default '',
+                            create_time          TIMESTAMP            null,
+                            update_by            VARCHAR(64)          null default '',
+                            update_time          TIMESTAMP            null,
+                            remark               VARCHAR(255)         null,
+                            constraint PK_SYS_NOTICE primary key (notice_id)
+);
+alter sequence if exists sys_notice_notice_id_seq restart with 10 cache 20;
+comment on table  sys_notice                   is '閫氱煡鍏憡琛�';
+comment on column sys_notice.notice_id         is '鍏憡涓婚敭';
+comment on column sys_notice.notice_title      is '鍏憡鏍囬';
+comment on column sys_notice.notice_type       is '鍏憡绫诲瀷锛�1閫氱煡 2鍏憡锛�';
+comment on column sys_notice.notice_content    is '鍏憡鍐呭';
+comment on column sys_notice.status            is '鍏憡鐘舵�侊紙0姝e父 1鍏抽棴锛�';
+comment on column sys_notice.create_by         is '鍒涘缓鑰�';
+comment on column sys_notice.create_time       is '鍒涘缓鏃堕棿';
+comment on column sys_notice.update_by         is '鏇存柊鑰�';
+comment on column sys_notice.update_time       is '鏇存柊鏃堕棿';
+comment on column sys_notice.remark            is '澶囨敞';
+
+-- ----------------------------
+-- 鍒濆鍖�-鍏憡淇℃伅琛ㄦ暟鎹�
+-- ----------------------------
+insert into sys_notice values('1', '娓╅Θ鎻愰啋锛�2018-07-01 姹熸煇浜烘柊鐗堟湰鍙戝竷鍟�', '2', '鏂扮増鏈唴瀹�', '0', 'admin', now(), '', null, '绠$悊鍛�');
+insert into sys_notice values('2', '缁存姢閫氱煡锛�2018-07-01 姹熸煇浜虹郴缁熷噷鏅ㄧ淮鎶�', '1', '缁存姢鍐呭',   '0', 'admin', now(), '', null, '绠$悊鍛�');
+
+
+-- ----------------------------
+-- 19銆佷唬鐮佺敓鎴愪笟鍔¤〃
+-- ----------------------------
+drop table if exists gen_table;
+create table gen_table (
+                           table_id           BIGSERIAL       not null,
+                           table_name         VARCHAR(200)    default '',
+                           table_comment      VARCHAR(500)    default '',
+                           sub_table_name     VARCHAR(64)      default null,
+                           sub_table_fk_name  VARCHAR(64)      default null,
+                           class_name         VARCHAR(100)    default '',
+                           tpl_category       VARCHAR(200)    default 'crud',
+                           package_name       VARCHAR(100),
+                           module_name        VARCHAR(30),
+                           business_name      VARCHAR(30),
+                           function_name      VARCHAR(50),
+                           function_author    VARCHAR(50),
+                           gen_type           CHAR(1)          default '0',
+                           gen_path           VARCHAR(200)    default '/',
+                           options            VARCHAR(1000),
+                           create_by          VARCHAR(64)     default '',
+                           create_time        TIMESTAMP,
+                           update_by          VARCHAR(64)     default '',
+                           update_time        TIMESTAMP,
+                           remark             VARCHAR(500)    default null
+);
+
+alter sequence if exists gen_table_table_id_seq  cache 20;
+
+comment on table  gen_table                          is '浠g爜鐢熸垚涓氬姟琛�';
+comment on column gen_table.table_id                 is '缂栧彿';
+comment on column gen_table.table_name               is '琛ㄥ悕绉�';
+comment on column gen_table.table_comment            is '琛ㄦ弿杩�';
+comment on column gen_table.sub_table_name           is '鍏宠仈瀛愯〃鐨勮〃鍚�';
+comment on column gen_table.sub_table_fk_name        is '瀛愯〃鍏宠仈鐨勫閿悕';
+comment on column gen_table.class_name               is '瀹炰綋绫诲悕绉�';
+comment on column gen_table.tpl_category             is '浣跨敤鐨勬ā鏉匡紙crud鍗曡〃鎿嶄綔 tree鏍戣〃鎿嶄綔 sub涓诲瓙琛ㄦ搷浣滐級';
+comment on column gen_table.package_name             is '鐢熸垚鍖呰矾寰�';
+comment on column gen_table.module_name              is '鐢熸垚妯″潡鍚�';
+comment on column gen_table.business_name            is '鐢熸垚涓氬姟鍚�';
+comment on column gen_table.function_name            is '鐢熸垚鍔熻兘鍚�';
+comment on column gen_table.function_author          is '鐢熸垚鍔熻兘浣滆��';
+comment on column gen_table.gen_type                 is '鐢熸垚浠g爜鏂瑰紡锛�0zip鍘嬬缉鍖� 1鑷畾涔夎矾寰勶級';
+comment on column gen_table.gen_path                 is '鐢熸垚璺緞锛堜笉濉粯璁ら」鐩矾寰勶級';
+comment on column gen_table.options                  is '鍏跺畠鐢熸垚閫夐」';
+comment on column gen_table.create_by                is '鍒涘缓鑰�';
+comment on column gen_table.create_time              is '鍒涘缓鏃堕棿';
+comment on column gen_table.update_by                is '鏇存柊鑰�';
+comment on column gen_table.update_time              is '鏇存柊鏃堕棿';
+comment on column gen_table.remark                   is '澶囨敞';
+
+
+-- ----------------------------
+-- 20銆佷唬鐮佺敓鎴愪笟鍔¤〃瀛楁
+-- ----------------------------
+drop table if exists gen_table_column;
+create table gen_table_column (
+                                  column_id          BIGSERIAL      not null,
+                                  table_id           VARCHAR(64),
+                                  column_name        VARCHAR(200),
+                                  column_comment     VARCHAR(500),
+                                  column_type        VARCHAR(100),
+                                  java_type          VARCHAR(500),
+                                  java_field         VARCHAR(200),
+                                  is_pk              CHAR(1),
+                                  is_increment       CHAR(1),
+                                  is_required        CHAR(1),
+                                  is_insert          CHAR(1),
+                                  is_edit            CHAR(1),
+                                  is_list            CHAR(1),
+                                  is_query           CHAR(1),
+                                  query_type         VARCHAR(200)    default 'EQ',
+                                  html_type          VARCHAR(200),
+                                  dict_type          VARCHAR(200)    default '',
+                                  sort               INT4,
+                                  create_by          VARCHAR(64)     default '',
+                                  create_time        TIMESTAMP ,
+                                  update_by          VARCHAR(64)     default '',
+                                  update_time        TIMESTAMP
+);
+
+alter sequence if exists gen_table_column_column_id_seq  cache 20;
+
+comment on table  gen_table_column                   is '浠g爜鐢熸垚涓氬姟琛ㄥ瓧娈�';
+comment on column gen_table_column.column_id         is '缂栧彿';
+comment on column gen_table_column.table_id          is '褰掑睘琛ㄧ紪鍙�';
+comment on column gen_table_column.column_name       is '鍒楀悕绉�';
+comment on column gen_table_column.column_comment    is '鍒楁弿杩�';
+comment on column gen_table_column.column_type       is '鍒楃被鍨�';
+comment on column gen_table_column.java_type         is 'JAVA绫诲瀷';
+comment on column gen_table_column.java_field        is 'JAVA瀛楁鍚�';
+comment on column gen_table_column.is_pk             is '鏄惁涓婚敭锛�1鏄級';
+comment on column gen_table_column.is_increment      is '鏄惁鑷锛�1鏄級';
+comment on column gen_table_column.is_required       is '鏄惁蹇呭~锛�1鏄級';
+comment on column gen_table_column.is_insert         is '鏄惁涓烘彃鍏ュ瓧娈碉紙1鏄級';
+comment on column gen_table_column.is_edit           is '鏄惁缂栬緫瀛楁锛�1鏄級';
+comment on column gen_table_column.is_list           is '鏄惁鍒楄〃瀛楁锛�1鏄級';
+comment on column gen_table_column.is_query          is '鏄惁鏌ヨ瀛楁锛�1鏄級';
+comment on column gen_table_column.query_type        is '鏌ヨ鏂瑰紡锛堢瓑浜庛�佷笉绛変簬銆佸ぇ浜庛�佸皬浜庛�佽寖鍥达級';
+comment on column gen_table_column.html_type         is '鏄剧ず绫诲瀷锛堟枃鏈銆佹枃鏈煙銆佷笅鎷夋銆佸閫夋銆佸崟閫夋銆佹棩鏈熸帶浠讹級';
+comment on column gen_table_column.dict_type         is '瀛楀吀绫诲瀷';
+comment on column gen_table_column.sort              is '鎺掑簭';
+comment on column gen_table_column.create_by         is '鍒涘缓鑰�';
+comment on column gen_table_column.create_time       is '鍒涘缓鏃堕棿';
+comment on column gen_table_column.update_by         is '鏇存柊鑰�';
+comment on column gen_table_column.update_time       is '鏇存柊鏃堕棿';
+
+
+
+-- ----------------------------
+-- 鍑芥暟 锛屼唬鏇縨ysql鐨刦ind_in_set
+-- 渚嬪锛� select * from sys_dept where FIND_IN_SET (101,ancestors) <> 0
+-- mysql鍙帴鍙�0鎴栧叾瀹僴umber鍋氫负where 鏉′欢锛宲ostgresql鍙帴鍙楄〃杈惧紡鍋氫负where 鏉′欢 闇�瑕佹槑纭畾涔� 琛ㄨ揪寮弔rue  false
+-- ----------------------------
+-- CREATE OR REPLACE FUNCTION generate_subscripts(anyarray, int)
+-- RETURNS SETOF int AS $$
+-- SELECT generate_series(array_lower($1,$2), array_upper($1,$2))
+-- $$ LANGUAGE sql;
+
+
+-- CREATE OR REPLACE FUNCTION find_in_set(str text, strlist text)
+-- RETURNS int AS $$
+-- SELECT i
+--    FROM generate_subscripts(string_to_array($2,','),1) g(i)
+--   WHERE (string_to_array($2, ','))[i] = $1
+--   UNION ALL
+--   SELECT 0
+--   LIMIT 1
+-- $$ LANGUAGE sql STRICT;
+
+CREATE OR REPLACE FUNCTION find_in_set(BIGINT,VARCHAR)
+RETURNS BOOLEAN
+AS $BODY$
+DECLARE
+STR ALIAS FOR $1;
+  STRS ALIAS FOR $2;
+  POS INTEGER;
+  STATUS BOOLEAN;
+BEGIN
+SELECT POSITION( ','||STR||',' IN ','||STRS||',') INTO POS;
+IF POS > 0 THEN
+	  STATUS = TRUE;
+ELSE
+	  STATUS = FALSE;
+END IF;
+RETURN STATUS;
+END;
+$BODY$ LANGUAGE PLPGSQL;
+
+---鐢ㄦ埛澶勭悊鑷姩鐢熸垚鏃剁殑宸紓
+
+CREATE OR REPLACE view view_self_table_columns
+as select
+                     table_catalog ,
+                     table_schema ,
+                     table_name ,
+                     ordinal_position as sort,
+                     column_name ,
+                     data_type as TypeName,
+                     (case
+                          when (is_nullable = 'no' and contype !='p' ) then '1'
+                          else null
+                         end) as is_required,
+                     (case
+                          when contype = 'p' then '1'
+                          else '0'
+                         end) as is_pk,
+                     coalesce(character_maximum_length, numeric_precision,-1) as Length,
+                     numeric_scale as scale,
+                     case
+                         is_nullable when 'NO' then 0
+                                     else 1
+                         end as canNull,
+                     column_default as defaultval,
+                     case
+                         when position('nextval' in column_default)>0 then 1
+                         else 0
+                         end as IsIdentity,
+                     (case
+                          when position('nextval' in column_default)>0 then 1
+                          else 0
+                         end) as is_increment,
+                     c.DeText as column_comment,
+                     c.typname as column_type,
+                     c.contype,
+                     ordinal_position
+   from
+                     information_schema.columns
+                         left join (select
+                                        datname,pg_get_userbyid(relowner) AS tableowner,nspname,relname,attname, description as DeText,typname,pg_cons.contype
+                                    from
+                                        pg_class
+                                            left join pg_attribute pg_attr on
+                                            pg_attr.attrelid = pg_class.oid
+                                            left join pg_description pg_desc on
+                                            pg_desc.objoid = pg_attr.attrelid
+                                                and pg_desc.objsubid = pg_attr.attnum
+                                            left join pg_namespace pg_ns on
+                                            pg_ns."oid" = pg_class.relnamespace
+                                            left join pg_database on relowner = datdba
+                                            left join pg_type on pg_attr.atttypid = pg_type."oid"
+                                            left join (select pg_con.*,unnest(conkey) conkey_new from pg_constraint pg_con)  pg_cons on
+                                            pg_attr.attrelid = pg_class.oid
+                                                and pg_attr.attnum = pg_cons.conkey_new and pg_cons.conrelid = pg_class.oid
+                                    where
+                                        pg_attr.attnum>0
+                                      and pg_attr.attrelid = pg_class.oid
+                     ) c
+                                   on table_catalog = datname  and table_schema = nspname and table_name = relname and column_name = attname;
+--where
+--	table_schema = 'public'
+--	and table_name = 'sys_user_role'
+--order by ordinal_position asc
+
+
+
+CREATE OR REPLACE view view_self_table
+as select
+              datname as table_catalog,
+              pg_get_userbyid(relowner) AS tableowner,
+              nspname as table_schema,
+              relname as table_name,
+              cast(obj_description(relfilenode,'pg_class') as varchar) as table_comment ,
+              now() create_time,
+              now() update_time
+   from pg_class c
+            left join pg_namespace pg_ns on
+       pg_ns."oid" = c.relnamespace
+            left join pg_database on relowner = datdba
+   where relname in (select tablename from pg_tables)
\ No newline at end of file
diff --git a/sql/aps_quartz.sql b/sql/aps_quartz.sql
new file mode 100644
index 0000000..f86c257
--- /dev/null
+++ b/sql/aps_quartz.sql
@@ -0,0 +1,204 @@
+-- ----------------------------
+-- 1銆佸瓨鍌ㄦ瘡涓�涓凡閰嶇疆鐨� jobDetail 鐨勮缁嗕俊鎭�
+-- ----------------------------
+drop table if exists qrtz_job_details;
+CREATE TABLE qrtz_job_details
+(
+    SCHED_NAME VARCHAR(120) NOT NULL,
+    JOB_NAME  VARCHAR(200) NOT NULL,
+    JOB_GROUP VARCHAR(200) NOT NULL,
+    DESCRIPTION VARCHAR(250) NULL,
+    JOB_CLASS_NAME   VARCHAR(250) NOT NULL,
+    IS_DURABLE BOOL NOT NULL,
+    IS_NONCONCURRENT BOOL NOT NULL,
+    IS_UPDATE_DATA BOOL NOT NULL,
+    REQUESTS_RECOVERY BOOL NOT NULL,
+    JOB_DATA BYTEA NULL,
+    PRIMARY KEY (SCHED_NAME,JOB_NAME,JOB_GROUP)
+);
+
+-- ----------------------------
+-- 2銆� 瀛樺偍宸查厤缃殑 Trigger 鐨勪俊鎭�
+-- ----------------------------
+drop table if exists qrtz_triggers;
+CREATE TABLE qrtz_triggers
+(
+    SCHED_NAME VARCHAR(120) NOT NULL,
+    TRIGGER_NAME VARCHAR(200) NOT NULL,
+    TRIGGER_GROUP VARCHAR(200) NOT NULL,
+    JOB_NAME  VARCHAR(200) NOT NULL,
+    JOB_GROUP VARCHAR(200) NOT NULL,
+    DESCRIPTION VARCHAR(250) NULL,
+    NEXT_FIRE_TIME BIGINT NULL,
+    PREV_FIRE_TIME BIGINT NULL,
+    PRIORITY INTEGER NULL,
+    TRIGGER_STATE VARCHAR(16) NOT NULL,
+    TRIGGER_TYPE VARCHAR(8) NOT NULL,
+    START_TIME BIGINT NOT NULL,
+    END_TIME BIGINT NULL,
+    CALENDAR_NAME VARCHAR(200) NULL,
+    MISFIRE_INSTR SMALLINT NULL,
+    JOB_DATA BYTEA NULL,
+    PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
+    FOREIGN KEY (SCHED_NAME,JOB_NAME,JOB_GROUP)
+        REFERENCES QRTZ_JOB_DETAILS(SCHED_NAME,JOB_NAME,JOB_GROUP)
+);
+-- ----------------------------
+-- 3銆� 瀛樺偍绠�鍗曠殑 Trigger锛屽寘鎷噸澶嶆鏁帮紝闂撮殧锛屼互鍙婂凡瑙﹀彂鐨勬鏁�
+-- ----------------------------
+drop table if exists qrtz_simple_triggers;
+CREATE TABLE qrtz_simple_triggers
+(
+    SCHED_NAME VARCHAR(120) NOT NULL,
+    TRIGGER_NAME VARCHAR(200) NOT NULL,
+    TRIGGER_GROUP VARCHAR(200) NOT NULL,
+    REPEAT_COUNT BIGINT NOT NULL,
+    REPEAT_INTERVAL BIGINT NOT NULL,
+    TIMES_TRIGGERED BIGINT NOT NULL,
+    PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
+    FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
+        REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
+);
+-- ----------------------------
+-- 4銆� 瀛樺偍 Cron Trigger锛屽寘鎷� Cron 琛ㄨ揪寮忓拰鏃跺尯淇℃伅
+-- ----------------------------
+drop table if exists qrtz_cron_triggers;
+CREATE TABLE qrtz_cron_triggers
+(
+    SCHED_NAME VARCHAR(120) NOT NULL,
+    TRIGGER_NAME VARCHAR(200) NOT NULL,
+    TRIGGER_GROUP VARCHAR(200) NOT NULL,
+    CRON_EXPRESSION VARCHAR(120) NOT NULL,
+    TIME_ZONE_ID VARCHAR(80),
+    PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
+    FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
+        REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
+);
+
+-- ----------------------------
+-- 5銆� Trigger 浣滀负 Blob 绫诲瀷瀛樺偍(鐢ㄤ簬 Quartz 鐢ㄦ埛鐢� JDBC 鍒涘缓浠栦滑鑷繁瀹氬埗鐨� Trigger 绫诲瀷锛孞obStore 骞朵笉鐭ラ亾濡備綍瀛樺偍瀹炰緥鐨勬椂鍊�)
+-- ----------------------------
+drop table if exists qrtz_blob_triggers;
+CREATE TABLE qrtz_blob_triggers
+(
+    SCHED_NAME VARCHAR(120) NOT NULL,
+    TRIGGER_NAME VARCHAR(200) NOT NULL,
+    TRIGGER_GROUP VARCHAR(200) NOT NULL,
+    BLOB_DATA BYTEA NULL,
+    PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
+    FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
+        REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
+);
+
+-- ----------------------------
+-- 6銆� 浠� Blob 绫诲瀷瀛樺偍瀛樻斁鏃ュ巻淇℃伅锛� quartz鍙厤缃竴涓棩鍘嗘潵鎸囧畾涓�涓椂闂磋寖鍥�
+-- ----------------------------
+drop table if exists qrtz_calendars;
+CREATE TABLE qrtz_calendars
+(
+    SCHED_NAME VARCHAR(120) NOT NULL,
+    CALENDAR_NAME  VARCHAR(200) NOT NULL,
+    CALENDAR BYTEA NOT NULL,
+    PRIMARY KEY (SCHED_NAME,CALENDAR_NAME)
+);
+-- ----------------------------
+-- 7銆� 瀛樺偍宸叉殏鍋滅殑 Trigger 缁勭殑淇℃伅
+-- ----------------------------
+drop table if exists qrtz_paused_trigger_grps;
+CREATE TABLE qrtz_paused_trigger_grps
+(
+    SCHED_NAME VARCHAR(120) NOT NULL,
+    TRIGGER_GROUP  VARCHAR(200) NOT NULL,
+    PRIMARY KEY (SCHED_NAME,TRIGGER_GROUP)
+);
+
+-- ----------------------------
+-- 8銆� 瀛樺偍涓庡凡瑙﹀彂鐨� Trigger 鐩稿叧鐨勭姸鎬佷俊鎭紝浠ュ強鐩歌仈 Job 鐨勬墽琛屼俊鎭�
+-- ----------------------------
+drop table if exists qrtz_fired_triggers;
+CREATE TABLE qrtz_fired_triggers
+(
+    SCHED_NAME VARCHAR(120) NOT NULL,
+    ENTRY_ID VARCHAR(95) NOT NULL,
+    TRIGGER_NAME VARCHAR(200) NOT NULL,
+    TRIGGER_GROUP VARCHAR(200) NOT NULL,
+    INSTANCE_NAME VARCHAR(200) NOT NULL,
+    FIRED_TIME BIGINT NOT NULL,
+    SCHED_TIME BIGINT NOT NULL,
+    PRIORITY INTEGER NOT NULL,
+    STATE VARCHAR(16) NOT NULL,
+    JOB_NAME VARCHAR(200) NULL,
+    JOB_GROUP VARCHAR(200) NULL,
+    IS_NONCONCURRENT BOOL NULL,
+    REQUESTS_RECOVERY BOOL NULL,
+    PRIMARY KEY (SCHED_NAME,ENTRY_ID)
+);
+
+-- ----------------------------
+-- 9銆� 瀛樺偍灏戦噺鐨勬湁鍏� Scheduler 鐨勭姸鎬佷俊鎭紝鍋囧鏄敤浜庨泦缇や腑锛屽彲浠ョ湅鍒板叾浠栫殑 Scheduler 瀹炰緥
+-- ----------------------------
+drop table if exists qrtz_scheduler_state;
+CREATE TABLE qrtz_scheduler_state
+(
+    SCHED_NAME VARCHAR(120) NOT NULL,
+    INSTANCE_NAME VARCHAR(200) NOT NULL,
+    LAST_CHECKIN_TIME BIGINT NOT NULL,
+    CHECKIN_INTERVAL BIGINT NOT NULL,
+    PRIMARY KEY (SCHED_NAME,INSTANCE_NAME)
+);
+
+-- ----------------------------
+-- 10銆� 瀛樺偍绋嬪簭鐨勬偛瑙傞攣鐨勪俊鎭�(鍋囧浣跨敤浜嗘偛瑙傞攣)
+-- ----------------------------
+drop table if exists qrtz_locks;
+CREATE TABLE qrtz_locks
+(
+    SCHED_NAME VARCHAR(120) NOT NULL,
+    LOCK_NAME  VARCHAR(40) NOT NULL,
+    PRIMARY KEY (SCHED_NAME,LOCK_NAME)
+);
+
+drop table if exists qrtz_simprop_triggers;
+CREATE TABLE qrtz_simprop_triggers
+(
+    SCHED_NAME VARCHAR(120) NOT NULL,
+    TRIGGER_NAME VARCHAR(200) NOT NULL,
+    TRIGGER_GROUP VARCHAR(200) NOT NULL,
+    STR_PROP_1 VARCHAR(512) NULL,
+    STR_PROP_2 VARCHAR(512) NULL,
+    STR_PROP_3 VARCHAR(512) NULL,
+    INT_PROP_1 INT NULL,
+    INT_PROP_2 INT NULL,
+    LONG_PROP_1 BIGINT NULL,
+    LONG_PROP_2 BIGINT NULL,
+    DEC_PROP_1 NUMERIC(13,4) NULL,
+    DEC_PROP_2 NUMERIC(13,4) NULL,
+    BOOL_PROP_1 BOOL NULL,
+    BOOL_PROP_2 BOOL NULL,
+    PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
+    FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
+        REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
+);
+create index idx_qrtz_j_req_recovery on qrtz_job_details(SCHED_NAME,REQUESTS_RECOVERY);
+create index idx_qrtz_j_grp on qrtz_job_details(SCHED_NAME,JOB_GROUP);
+
+create index idx_qrtz_t_j on qrtz_triggers(SCHED_NAME,JOB_NAME,JOB_GROUP);
+create index idx_qrtz_t_jg on qrtz_triggers(SCHED_NAME,JOB_GROUP);
+create index idx_qrtz_t_c on qrtz_triggers(SCHED_NAME,CALENDAR_NAME);
+create index idx_qrtz_t_g on qrtz_triggers(SCHED_NAME,TRIGGER_GROUP);
+create index idx_qrtz_t_state on qrtz_triggers(SCHED_NAME,TRIGGER_STATE);
+create index idx_qrtz_t_n_state on qrtz_triggers(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP,TRIGGER_STATE);
+create index idx_qrtz_t_n_g_state on qrtz_triggers(SCHED_NAME,TRIGGER_GROUP,TRIGGER_STATE);
+create index idx_qrtz_t_next_fire_time on qrtz_triggers(SCHED_NAME,NEXT_FIRE_TIME);
+create index idx_qrtz_t_nft_st on qrtz_triggers(SCHED_NAME,TRIGGER_STATE,NEXT_FIRE_TIME);
+create index idx_qrtz_t_nft_misfire on qrtz_triggers(SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME);
+create index idx_qrtz_t_nft_st_misfire on qrtz_triggers(SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME,TRIGGER_STATE);
+create index idx_qrtz_t_nft_st_misfire_grp on qrtz_triggers(SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME,TRIGGER_GROUP,TRIGGER_STATE);
+
+create index idx_qrtz_ft_trig_inst_name on qrtz_fired_triggers(SCHED_NAME,INSTANCE_NAME);
+create index idx_qrtz_ft_inst_job_req_rcvry on qrtz_fired_triggers(SCHED_NAME,INSTANCE_NAME,REQUESTS_RECOVERY);
+create index idx_qrtz_ft_j_g on qrtz_fired_triggers(SCHED_NAME,JOB_NAME,JOB_GROUP);
+create index idx_qrtz_ft_jg on qrtz_fired_triggers(SCHED_NAME,JOB_GROUP);
+create index idx_qrtz_ft_t_g on qrtz_fired_triggers(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP);
+create index idx_qrtz_ft_tg on qrtz_fired_triggers(SCHED_NAME,TRIGGER_GROUP);
+commit;
\ No newline at end of file

--
Gitblit v1.9.3