diff --git a/pom.xml b/pom.xml index f049195..ed8d7e8 100644 --- a/pom.xml +++ b/pom.xml @@ -5,19 +5,19 @@ <groupId>com.jg</groupId> <artifactId>jg-boot</artifactId> -<!-- <version>3.8.7</version>--> + <!-- <version>3.8.7</version>--> <version>4.0.0</version> <packaging>jar</packaging> <name>jg</name> -<!-- <url>http://www.jg.vip</url>--> + <!-- <url>http://www.jg.vip</url>--> <description>JG管理系统</description> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.5.15</version> - <relativePath /> + <relativePath/> </parent> <properties> @@ -110,6 +110,13 @@ <scope>runtime</scope> </dependency> + <!-- openGauss驱动包 --> + <dependency> + <groupId>com.huaweicloud.gaussdb</groupId> + <artifactId>opengaussjdbc</artifactId> + <version>503.2.T35</version> + </dependency> + <!-- pagehelper 分页插件 --> <dependency> <groupId>com.github.pagehelper</groupId> @@ -250,26 +257,26 @@ </exclusions> </dependency> - </dependencies> + </dependencies> - <build> - <finalName>${project.artifactId}</finalName> - <plugins> - <plugin> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-maven-plugin</artifactId> - <configuration> - <fork>true</fork> <!-- 如果没有该配置,devtools不会生效 --> - </configuration> - </plugin> - </plugins> + <build> + <finalName>${project.artifactId}</finalName> + <plugins> + <plugin> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-maven-plugin</artifactId> + <configuration> + <fork>true</fork> <!-- 如果没有该配置,devtools不会生效 --> + </configuration> + </plugin> + </plugins> <resources> <resource> <directory>src/main/resources</directory> <filtering>true</filtering> </resource> </resources> - </build> + </build> <profiles> <profile> diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index 213be75..2e9ef9e 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -2,13 +2,16 @@ spring: datasource: type: com.alibaba.druid.pool.DruidDataSource - driverClassName: com.mysql.cj.jdbc.Driver + driverClassName: com.huawei.opengauss.jdbc.Driver druid: # 主库数据源 master: - url: jdbc:mysql://localhost:3306/jgwebsite?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 - username: root - password: 123456 +# url: jdbc:mysql://localhost:3306/jgwebsite?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 +# username: root +# password: 123456 + url: jdbc:opengauss://IP:端口/数据库?searchpath=模式 + username: 用户名 + password: 密码 # 从库数据源 slave: # 从数据源开关/默认关闭 @@ -35,7 +38,7 @@ spring: # 配置一个连接在池中最大生存的时间,单位是毫秒 maxEvictableIdleTimeMillis: 900000 # 配置检测连接是否有效 - validationQuery: SELECT 1 FROM DUAL + validationQuery: SELECT 1 testWhileIdle: true testOnBorrow: false testOnReturn: false diff --git a/src/main/resources/mybatis/monitor/SysLogininforMapper.xml b/src/main/resources/mybatis/monitor/SysLogininforMapper.xml index e74d584..2db56b6 100644 --- a/src/main/resources/mybatis/monitor/SysLogininforMapper.xml +++ b/src/main/resources/mybatis/monitor/SysLogininforMapper.xml @@ -17,8 +17,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" </resultMap> <insert id="insertLogininfor" parameterType="SysLogininfor"> - insert into sys_logininfor (user_name, status, ipaddr, login_location, browser, os, msg, login_time) - values (#{userName}, #{status}, #{ipaddr}, #{loginLocation}, #{browser}, #{os}, #{msg}, sysdate()) + insert into sys_logininfor (user_name, status, ipaddr, login_location, browser, os, msg) + values (#{userName}, #{status}, #{ipaddr}, #{loginLocation}, #{browser}, #{os}, #{msg}) </insert> <select id="selectLogininforList" parameterType="SysLogininfor" resultMap="SysLogininforResult"> diff --git a/src/main/resources/mybatis/system/SysMenuMapper.xml b/src/main/resources/mybatis/system/SysMenuMapper.xml index 50eb803..305dd1f 100644 --- a/src/main/resources/mybatis/system/SysMenuMapper.xml +++ b/src/main/resources/mybatis/system/SysMenuMapper.xml @@ -28,7 +28,7 @@ </resultMap> <sql id="selectMenuVo"> - select menu_id, menu_name, parent_id, order_num, path, component, `query`, 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, is_frame, is_cache, menu_type, visible, status, perms as perms, icon, create_time from sys_menu </sql> @@ -49,13 +49,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.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.visible, m.status, 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.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.visible, m.status, 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 @@ -74,7 +74,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.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.visible, m.status, 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 @@ -140,7 +140,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="isFrame != null and isFrame != ''">is_frame = #{isFrame},</if> <if test="isCache != null and isCache != ''">is_cache = #{isCache},</if> <if test="menuType != null and menuType != ''">menu_type = #{menuType},</if> @@ -163,7 +163,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="isFrame != null and isFrame != ''">is_frame,</if> <if test="isCache != null and isCache != ''">is_cache,</if> <if test="menuType != null and menuType != ''">menu_type,</if> diff --git a/src/main/resources/mybatis/system/SysUserMapper.xml b/src/main/resources/mybatis/system/SysUserMapper.xml index 1bf2c84..a672eb9 100644 --- a/src/main/resources/mybatis/system/SysUserMapper.xml +++ b/src/main/resources/mybatis/system/SysUserMapper.xml @@ -190,7 +190,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" <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() </set> where user_id = #{userId} </update>