Commit 08468edd452df50429f67ebcc6ee08799fddea5e

Authored by 648540858
1 parent 5c2d27f7

移除sqlite支持

src/main/java/com/genersoft/iot/vmp/storager/dao/RoleMapper.java
@@ -11,12 +11,12 @@ import java.util.List; @@ -11,12 +11,12 @@ import java.util.List;
11 @Repository 11 @Repository
12 public interface RoleMapper { 12 public interface RoleMapper {
13 13
14 - @Insert("INSERT INTO role (name, authority, createTime, updateTime) VALUES" + 14 + @Insert("INSERT INTO user_role (name, authority, createTime, updateTime) VALUES" +
15 "('${name}', '${authority}', '${createTime}', '${updateTime}')") 15 "('${name}', '${authority}', '${createTime}', '${updateTime}')")
16 int add(Role role); 16 int add(Role role);
17 17
18 @Update(value = {" <script>" + 18 @Update(value = {" <script>" +
19 - "UPDATE role " + 19 + "UPDATE user_role " +
20 "SET updateTime='${updateTime}' " + 20 "SET updateTime='${updateTime}' " +
21 "<if test=\"name != null\">, name='${name}'</if>" + 21 "<if test=\"name != null\">, name='${name}'</if>" +
22 "<if test=\"authority != null\">, authority='${authority}'</if>" + 22 "<if test=\"authority != null\">, authority='${authority}'</if>" +
@@ -24,12 +24,12 @@ public interface RoleMapper { @@ -24,12 +24,12 @@ public interface RoleMapper {
24 " </script>"}) 24 " </script>"})
25 int update(Role role); 25 int update(Role role);
26 26
27 - @Delete("DELETE FROM role WHERE id != 1 and id=#{id}") 27 + @Delete("DELETE FROM user_role WHERE id != 1 and id=#{id}")
28 int delete(int id); 28 int delete(int id);
29 29
30 - @Select("select * FROM role WHERE id=#{id}") 30 + @Select("select * FROM user_role WHERE id=#{id}")
31 Role selectById(int id); 31 Role selectById(int id);
32 32
33 - @Select("select * FROM role") 33 + @Select("select * FROM user_role")
34 List<Role> selectAll(); 34 List<Role> selectAll();
35 } 35 }
src/main/resources/application-dev.yml
@@ -19,23 +19,12 @@ spring: @@ -19,23 +19,12 @@ spring:
19 # [可选] jdbc数据库配置, 项目使用sqlite作为数据库,一般不需要配置 19 # [可选] jdbc数据库配置, 项目使用sqlite作为数据库,一般不需要配置
20 datasource: 20 datasource:
21 # 使用mysql 打开23-28行注释, 删除29-36行 21 # 使用mysql 打开23-28行注释, 删除29-36行
22 - # name: wvp  
23 - # url: jdbc:mysql://127.0.0.1:3306/wvp?useUnicode=true&characterEncoding=UTF8&rewriteBatchedStatements=true&allowMultiQueries=true  
24 - # username:  
25 - # password:  
26 - # type: com.alibaba.druid.pool.DruidDataSource  
27 - # driver-class-name: com.mysql.cj.jdbc.Driver  
28 - name: eiot  
29 - url: jdbc:sqlite::resource:wvp.sqlite 22 + name: wvp
  23 + url: jdbc:mysql://127.0.0.1:3306/wvp?useUnicode=true&characterEncoding=UTF8&rewriteBatchedStatements=true&allowMultiQueries=true
30 username: 24 username:
31 password: 25 password:
32 type: com.alibaba.druid.pool.DruidDataSource 26 type: com.alibaba.druid.pool.DruidDataSource
33 - driver-class-name: org.sqlite.JDBC  
34 - journal_mode: WAL  
35 - synchronous: NORMAL  
36 - transaction_mode: IMMEDIATE  
37 - max-active: 1  
38 - min-idle: 1 27 + driver-class-name: com.mysql.cj.jdbc.Driver
39 28
40 # [可选] WVP监听的HTTP端口, 网页和接口调用都是这个端口 29 # [可选] WVP监听的HTTP端口, 网页和接口调用都是这个端口
41 server: 30 server:
src/main/resources/application-docker.yml
@@ -19,23 +19,12 @@ spring: @@ -19,23 +19,12 @@ spring:
19 # [可选] jdbc数据库配置, 项目使用sqlite作为数据库,一般不需要配置 19 # [可选] jdbc数据库配置, 项目使用sqlite作为数据库,一般不需要配置
20 datasource: 20 datasource:
21 # 使用mysql 打开23-28行注释, 删除29-36行 21 # 使用mysql 打开23-28行注释, 删除29-36行
22 - # name: wvp  
23 - # url: jdbc:mysql://127.0.0.1:3306/wvp?useUnicode=true&characterEncoding=UTF8&rewriteBatchedStatements=true&allowMultiQueries=true  
24 - # username:  
25 - # password:  
26 - # type: com.alibaba.druid.pool.DruidDataSource  
27 - # driver-class-name: com.mysql.cj.jdbc.Driver  
28 - name: eiot  
29 - url: jdbc:sqlite::resource:wvp.sqlite  
30 - username:  
31 - password:  
32 - type: com.alibaba.druid.pool.DruidDataSource  
33 - driver-class-name: org.sqlite.JDBC  
34 - journal_mode: WAL  
35 - synchronous: NORMAL  
36 - transaction_mode: IMMEDIATE  
37 - max-active: 1  
38 - min-idle: 1 22 + name: wvp
  23 + url: jdbc:mysql://127.0.0.1:3306/wvp?useUnicode=true&characterEncoding=UTF8&rewriteBatchedStatements=true&allowMultiQueries=true
  24 + username: root
  25 + password: root
  26 + type: com.alibaba.druid.pool.DruidDataSource
  27 + driver-class-name: com.mysql.cj.jdbc.Driver
39 28
40 # [可选] WVP监听的HTTP端口, 网页和接口调用都是这个端口 29 # [可选] WVP监听的HTTP端口, 网页和接口调用都是这个端口
41 server: 30 server:
src/main/resources/wvp.sqlite deleted 100644 → 0
No preview for this file type