From 08468edd452df50429f67ebcc6ee08799fddea5e Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期二, 25 一月 2022 16:36:55 +0800
Subject: [PATCH] 移除sqlite支持

---
 /dev/null                                                        |    0 
 src/main/java/com/genersoft/iot/vmp/storager/dao/RoleMapper.java |   10 +++++-----
 src/main/resources/application-dev.yml                           |   17 +++--------------
 src/main/resources/application-docker.yml                        |   23 ++++++-----------------
 4 files changed, 14 insertions(+), 36 deletions(-)

diff --git a/src/main/java/com/genersoft/iot/vmp/storager/dao/RoleMapper.java b/src/main/java/com/genersoft/iot/vmp/storager/dao/RoleMapper.java
index be20a69..66a60b9 100644
--- a/src/main/java/com/genersoft/iot/vmp/storager/dao/RoleMapper.java
+++ b/src/main/java/com/genersoft/iot/vmp/storager/dao/RoleMapper.java
@@ -11,12 +11,12 @@
 @Repository
 public interface RoleMapper {
 
-    @Insert("INSERT INTO role (name, authority, createTime, updateTime) VALUES" +
+    @Insert("INSERT INTO user_role (name, authority, createTime, updateTime) VALUES" +
             "('${name}', '${authority}', '${createTime}', '${updateTime}')")
     int add(Role role);
 
     @Update(value = {" <script>" +
-            "UPDATE role " +
+            "UPDATE user_role " +
             "SET updateTime='${updateTime}' " +
             "<if test=\"name != null\">, name='${name}'</if>" +
             "<if test=\"authority != null\">, authority='${authority}'</if>" +
@@ -24,12 +24,12 @@
             " </script>"})
     int update(Role role);
 
-    @Delete("DELETE FROM role WHERE  id != 1 and id=#{id}")
+    @Delete("DELETE FROM user_role WHERE  id != 1 and id=#{id}")
     int delete(int id);
 
-    @Select("select * FROM role WHERE id=#{id}")
+    @Select("select * FROM user_role WHERE id=#{id}")
     Role selectById(int id);
 
-    @Select("select * FROM role")
+    @Select("select * FROM user_role")
     List<Role> selectAll();
 }
diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml
index 7829ca4..1051d96 100644
--- a/src/main/resources/application-dev.yml
+++ b/src/main/resources/application-dev.yml
@@ -19,23 +19,12 @@
     # [鍙�塢 jdbc鏁版嵁搴撻厤缃�, 椤圭洰浣跨敤sqlite浣滀负鏁版嵁搴擄紝涓�鑸笉闇�瑕侀厤缃�
     datasource:
         # 浣跨敤mysql 鎵撳紑23-28琛屾敞閲婏紝 鍒犻櫎29-36琛�
-        # name: wvp
-        # url: jdbc:mysql://127.0.0.1:3306/wvp?useUnicode=true&characterEncoding=UTF8&rewriteBatchedStatements=true&allowMultiQueries=true
-        # username:
-        # password:
-        # type: com.alibaba.druid.pool.DruidDataSource
-        # driver-class-name: com.mysql.cj.jdbc.Driver
-        name: eiot
-        url: jdbc:sqlite::resource:wvp.sqlite
+        name: wvp
+        url: jdbc:mysql://127.0.0.1:3306/wvp?useUnicode=true&characterEncoding=UTF8&rewriteBatchedStatements=true&allowMultiQueries=true
         username:
         password:
         type: com.alibaba.druid.pool.DruidDataSource
-        driver-class-name:  org.sqlite.JDBC
-        journal_mode: WAL
-        synchronous: NORMAL
-        transaction_mode: IMMEDIATE
-        max-active: 1
-        min-idle: 1
+        driver-class-name: com.mysql.cj.jdbc.Driver
 
 # [鍙�塢 WVP鐩戝惉鐨凥TTP绔彛, 缃戦〉鍜屾帴鍙h皟鐢ㄩ兘鏄繖涓鍙�
 server:
diff --git a/src/main/resources/application-docker.yml b/src/main/resources/application-docker.yml
index 56efb46..2f6992f 100644
--- a/src/main/resources/application-docker.yml
+++ b/src/main/resources/application-docker.yml
@@ -19,23 +19,12 @@
     # [鍙�塢 jdbc鏁版嵁搴撻厤缃�, 椤圭洰浣跨敤sqlite浣滀负鏁版嵁搴擄紝涓�鑸笉闇�瑕侀厤缃�
     datasource:
         # 浣跨敤mysql 鎵撳紑23-28琛屾敞閲婏紝 鍒犻櫎29-36琛�
-        # name: wvp
-        # url: jdbc:mysql://127.0.0.1:3306/wvp?useUnicode=true&characterEncoding=UTF8&rewriteBatchedStatements=true&allowMultiQueries=true
-        # username:
-        # password:
-        # type: com.alibaba.druid.pool.DruidDataSource
-        # driver-class-name: com.mysql.cj.jdbc.Driver
-        name: eiot
-        url: jdbc:sqlite::resource:wvp.sqlite
-        username:
-        password:
-        type: com.alibaba.druid.pool.DruidDataSource
-        driver-class-name:  org.sqlite.JDBC
-        journal_mode: WAL
-        synchronous: NORMAL
-        transaction_mode: IMMEDIATE
-        max-active: 1
-        min-idle: 1
+         name: wvp
+         url: jdbc:mysql://127.0.0.1:3306/wvp?useUnicode=true&characterEncoding=UTF8&rewriteBatchedStatements=true&allowMultiQueries=true
+         username: root
+         password: root
+         type: com.alibaba.druid.pool.DruidDataSource
+         driver-class-name: com.mysql.cj.jdbc.Driver
 
 # [鍙�塢 WVP鐩戝惉鐨凥TTP绔彛, 缃戦〉鍜屾帴鍙h皟鐢ㄩ兘鏄繖涓鍙�
 server:
diff --git a/src/main/resources/wvp.sqlite b/src/main/resources/wvp.sqlite
deleted file mode 100644
index b317a62..0000000
--- a/src/main/resources/wvp.sqlite
+++ /dev/null
Binary files differ

--
Gitblit v1.8.0