From 2afa26f57a788d3321ece138758b7cc19e103dc9 Mon Sep 17 00:00:00 2001 From: DongZeLiang <2746733890@qq.com> Date: Sun, 8 Oct 2023 19:53:56 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E4=BA=86=E5=AF=B9mybatis?= =?UTF-8?q?=E7=9A=84=E6=8B=93=E5=B1=95=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/ruoyi/RuoYiApplication.java | 2 - .../controller/system/BookInfoController.java | 2 +- .../src/main/resources/application.yml | 10 -- ruoyi-admin/src/main/resources/banner.txt | 22 ---- .../test/java/com/myplus/BookTestService.java | 4 +- ruoyi-common/pom.xml | 10 ++ .../framework/config/ApplicationConfig.java | 9 +- .../ruoyi/framework/config/MyBatisConfig.java | 109 ------------------ .../mapper/generator/GenTableColumnMapper.xml | 6 +- .../mapper/generator/GenTableMapper.xml | 12 +- .../mapper/quartz/SysJobLogMapper.xml | 6 +- .../resources/mapper/quartz/SysJobMapper.xml | 8 +- .../mapper/BookInfoMapper.java | 4 +- .../service/BookInfoService.java | 2 +- .../service/impl/BookInfoServiceImpl.java | 6 +- .../mapper/system/SysConfigMapper.xml | 10 +- .../resources/mapper/system/SysDeptMapper.xml | 8 +- .../mapper/system/SysDictDataMapper.xml | 10 +- .../mapper/system/SysDictTypeMapper.xml | 8 +- .../mapper/system/SysLogininforMapper.xml | 6 +- .../resources/mapper/system/SysMenuMapper.xml | 12 +- .../mapper/system/SysNoticeMapper.xml | 8 +- .../mapper/system/SysOperLogMapper.xml | 6 +- .../resources/mapper/system/SysPostMapper.xml | 8 +- .../mapper/system/SysRoleDeptMapper.xml | 2 +- .../resources/mapper/system/SysRoleMapper.xml | 8 +- .../mapper/system/SysRoleMenuMapper.xml | 2 +- .../resources/mapper/system/SysUserMapper.xml | 24 ++-- .../mapper/system/SysUserPostMapper.xml | 2 +- .../mapper/system/SysUserRoleMapper.xml | 4 +- 30 files changed, 101 insertions(+), 229 deletions(-) delete mode 100644 ruoyi-framework/src/main/java/com/ruoyi/framework/config/MyBatisConfig.java rename ruoyi-system/src/main/java/com/ruoyi/{system => book}/mapper/BookInfoMapper.java (74%) rename ruoyi-system/src/main/java/com/ruoyi/{system => book}/service/BookInfoService.java (88%) rename ruoyi-system/src/main/java/com/ruoyi/{system => book}/service/impl/BookInfoServiceImpl.java (72%) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java b/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java index 2d84d56..f566b4a 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java @@ -11,10 +11,8 @@ import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; * @author ruoyi */ @SpringBootApplication(exclude = {DataSourceAutoConfiguration.class}) -@MapperScan("com.ruoyi.system.mapper") public class RuoYiApplication { public static void main (String[] args) { - // System.setProperty("spring.devtools.restart.enabled", "false"); SpringApplication.run(RuoYiApplication.class, args); System.out.println("(♥◠‿◠)ノ゙ 若依启动成功 ლ(´ڡ`ლ)゙ \n" + " .-------. ____ __ \n" + diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/BookInfoController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/BookInfoController.java index 312f4b2..10f2352 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/BookInfoController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/BookInfoController.java @@ -2,7 +2,7 @@ package com.ruoyi.web.controller.system; import com.ruoyi.common.core.domain.Result; import com.ruoyi.system.domain.BookInfo; -import com.ruoyi.system.service.BookInfoService; +import com.ruoyi.book.service.BookInfoService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml index 3482c03..97c47a9 100644 --- a/ruoyi-admin/src/main/resources/application.yml +++ b/ruoyi-admin/src/main/resources/application.yml @@ -75,16 +75,6 @@ token: # MyBatis配置 mybatis: - # 搜索指定包别名 - typeAliasesPackage: com.ruoyi.**.domain - # 配置mapper的扫描,找到所有的mapper.xml映射文件 - mapperLocations: classpath*:mapper/**/*Mapper.xml - # 加载全局的配置文件 - configLocation: classpath:mybatis/mybatis-config.xml - -mybatis-plus: - # 搜索指定包别名 - typeAliasesPackage: com.ruoyi.**.domain # 配置mapper的扫描,找到所有的mapper.xml映射文件 mapperLocations: classpath*:mapper/**/*Mapper.xml # 加载全局的配置文件 diff --git a/ruoyi-admin/src/main/resources/banner.txt b/ruoyi-admin/src/main/resources/banner.txt index 0931cb8..c0e09cd 100644 --- a/ruoyi-admin/src/main/resources/banner.txt +++ b/ruoyi-admin/src/main/resources/banner.txt @@ -1,24 +1,2 @@ Application Version: ${ruoyi.version} Spring Boot Version: ${spring-boot.version} -//////////////////////////////////////////////////////////////////// -// _ooOoo_ // -// o8888888o // -// 88" . "88 // -// (| ^_^ |) // -// O\ = /O // -// ____/`---'\____ // -// .' \\| |// `. // -// / \\||| : |||// \ // -// / _||||| -:- |||||- \ // -// | | \\\ - /// | | // -// | \_| ''\---/'' | | // -// \ .-\__ `-` ___/-. / // -// ___`. .' /--.--\ `. . ___ // -// ."" '< `.___\_<|>_/___.' >'"". // -// | | : `- \`.;`\ _ /`;.`/ - ` : | | // -// \ \ `-. \_ __\ /__ _/ .-` / / // -// ========`-.____`-.___\_____/___.-`____.-'======== // -// `=---=' // -// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ // -// 佛祖保佑 永不宕机 永无BUG // -//////////////////////////////////////////////////////////////////// \ No newline at end of file diff --git a/ruoyi-admin/src/test/java/com/myplus/BookTestService.java b/ruoyi-admin/src/test/java/com/myplus/BookTestService.java index 083e35d..89dfcba 100644 --- a/ruoyi-admin/src/test/java/com/myplus/BookTestService.java +++ b/ruoyi-admin/src/test/java/com/myplus/BookTestService.java @@ -2,8 +2,8 @@ package com.myplus; import com.ruoyi.RuoYiApplication; import com.ruoyi.system.domain.BookInfo; -import com.ruoyi.system.mapper.BookInfoMapper; -import com.ruoyi.system.service.BookInfoService; +import com.ruoyi.book.mapper.BookInfoMapper; +import com.ruoyi.book.service.BookInfoService; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; diff --git a/ruoyi-common/pom.xml b/ruoyi-common/pom.xml index b71f1d4..ec5e828 100644 --- a/ruoyi-common/pom.xml +++ b/ruoyi-common/pom.xml @@ -46,6 +46,16 @@ com.baomidou mybatis-plus-boot-starter 3.5.3.1 + + + com.github.jsqlparser + jsqlparser + + + org.mybatis + mybatis + + diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ApplicationConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ApplicationConfig.java index e4e1e80..83f72ce 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ApplicationConfig.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ApplicationConfig.java @@ -17,7 +17,14 @@ import java.util.TimeZone; // 表示通过aop框架暴露该代理对象,AopContext能够访问 @EnableAspectJAutoProxy(exposeProxy = true) // 指定要扫描的Mapper类的包的路径 -@MapperScan("com.ruoyi.**.mapper") +@MapperScan( + { + "com.ruoyi.system.mapper", + "com.ruoyi.quartz.mapper", + "com.ruoyi.generator.mapper", + "com.ruoyi.book.mapper", + } + ) public class ApplicationConfig { /** * 时区配置 diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/MyBatisConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/MyBatisConfig.java deleted file mode 100644 index 632fa8b..0000000 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/MyBatisConfig.java +++ /dev/null @@ -1,109 +0,0 @@ -package com.ruoyi.framework.config; - -import com.ruoyi.common.utils.StringUtils; -import org.apache.ibatis.io.VFS; -import org.apache.ibatis.session.SqlSessionFactory; -import org.mybatis.spring.SqlSessionFactoryBean; -import org.mybatis.spring.boot.autoconfigure.SpringBootVFS; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.core.env.Environment; -import org.springframework.core.io.DefaultResourceLoader; -import org.springframework.core.io.Resource; -import org.springframework.core.io.support.PathMatchingResourcePatternResolver; -import org.springframework.core.io.support.ResourcePatternResolver; -import org.springframework.core.type.classreading.CachingMetadataReaderFactory; -import org.springframework.core.type.classreading.MetadataReader; -import org.springframework.core.type.classreading.MetadataReaderFactory; -import org.springframework.util.ClassUtils; - -import javax.sql.DataSource; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashSet; -import java.util.List; - -/** - * Mybatis支持*匹配扫描包 - * - * @author ruoyi - */ -@Configuration -public class MyBatisConfig { - static final String DEFAULT_RESOURCE_PATTERN = "**/*.class"; - @Autowired - private Environment env; - - public static String setTypeAliasesPackage (String typeAliasesPackage) { - ResourcePatternResolver resolver = (ResourcePatternResolver) new PathMatchingResourcePatternResolver(); - MetadataReaderFactory metadataReaderFactory = new CachingMetadataReaderFactory(resolver); - List allResult = new ArrayList(); - try { - for (String aliasesPackage : typeAliasesPackage.split(",")) { - List result = new ArrayList(); - aliasesPackage = ResourcePatternResolver.CLASSPATH_ALL_URL_PREFIX - + ClassUtils.convertClassNameToResourcePath(aliasesPackage.trim()) + "/" + DEFAULT_RESOURCE_PATTERN; - Resource[] resources = resolver.getResources(aliasesPackage); - if (resources != null && resources.length > 0) { - MetadataReader metadataReader = null; - for (Resource resource : resources) { - if (resource.isReadable()) { - metadataReader = metadataReaderFactory.getMetadataReader(resource); - try { - result.add(Class.forName(metadataReader.getClassMetadata().getClassName()).getPackage().getName()); - } catch (ClassNotFoundException e) { - e.printStackTrace(); - } - } - } - } - if (result.size() > 0) { - HashSet hashResult = new HashSet(result); - allResult.addAll(hashResult); - } - } - if (allResult.size() > 0) { - typeAliasesPackage = String.join(",", (String[]) allResult.toArray(new String[0])); - } else { - throw new RuntimeException("mybatis typeAliasesPackage 路径扫描错误,参数typeAliasesPackage:" + typeAliasesPackage + "未找到任何包"); - } - } catch (IOException e) { - e.printStackTrace(); - } - return typeAliasesPackage; - } - - public Resource[] resolveMapperLocations (String[] mapperLocations) { - ResourcePatternResolver resourceResolver = new PathMatchingResourcePatternResolver(); - List resources = new ArrayList(); - if (mapperLocations != null) { - for (String mapperLocation : mapperLocations) { - try { - Resource[] mappers = resourceResolver.getResources(mapperLocation); - resources.addAll(Arrays.asList(mappers)); - } catch (IOException e) { - // ignore - } - } - } - return resources.toArray(new Resource[resources.size()]); - } - - @Bean - public SqlSessionFactory sqlSessionFactory (DataSource dataSource) throws Exception { - String typeAliasesPackage = env.getProperty("mybatis.typeAliasesPackage"); - String mapperLocations = env.getProperty("mybatis.mapperLocations"); - String configLocation = env.getProperty("mybatis.configLocation"); - typeAliasesPackage = setTypeAliasesPackage(typeAliasesPackage); - VFS.addImplClass(SpringBootVFS.class); - - final SqlSessionFactoryBean sessionFactory = new SqlSessionFactoryBean(); - sessionFactory.setDataSource(dataSource); - sessionFactory.setTypeAliasesPackage(typeAliasesPackage); - sessionFactory.setMapperLocations(resolveMapperLocations(StringUtils.split(mapperLocations, ","))); - sessionFactory.setConfigLocation(new DefaultResourceLoader().getResource(configLocation)); - return sessionFactory.getObject(); - } -} diff --git a/ruoyi-generator/src/main/resources/mapper/generator/GenTableColumnMapper.xml b/ruoyi-generator/src/main/resources/mapper/generator/GenTableColumnMapper.xml index 85e9b7a..35a8357 100644 --- a/ruoyi-generator/src/main/resources/mapper/generator/GenTableColumnMapper.xml +++ b/ruoyi-generator/src/main/resources/mapper/generator/GenTableColumnMapper.xml @@ -4,7 +4,7 @@ "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + @@ -75,7 +75,7 @@ order by ordinal_position - + insert into gen_table_column ( table_id, column_name, @@ -119,7 +119,7 @@ ) - + update gen_table_column column_comment = #{columnComment}, diff --git a/ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml b/ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml index 67fec2c..d0aa89a 100644 --- a/ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml +++ b/ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml @@ -4,7 +4,7 @@ "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + @@ -28,7 +28,7 @@ - + @@ -77,7 +77,7 @@ from gen_table - @@ -95,7 +95,7 @@ - select table_name, table_comment, create_time, update_time from information_schema.tables where table_schema = (select database()) AND table_name NOT LIKE 'qrtz_%' AND table_name NOT LIKE 'gen_%' @@ -249,7 +249,7 @@ order by c.sort - + insert into gen_table ( table_name, table_comment, @@ -283,7 +283,7 @@ ) - + update gen_table table_name = #{tableName}, diff --git a/ruoyi-quartz/src/main/resources/mapper/quartz/SysJobLogMapper.xml b/ruoyi-quartz/src/main/resources/mapper/quartz/SysJobLogMapper.xml index 68e3304..ae7abae 100644 --- a/ruoyi-quartz/src/main/resources/mapper/quartz/SysJobLogMapper.xml +++ b/ruoyi-quartz/src/main/resources/mapper/quartz/SysJobLogMapper.xml @@ -4,7 +4,7 @@ "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + @@ -27,7 +27,7 @@ from sys_job_log - @@ -77,7 +77,7 @@ truncate table sys_job_log - + insert into sys_job_log( job_log_id, job_name, diff --git a/ruoyi-quartz/src/main/resources/mapper/quartz/SysJobMapper.xml b/ruoyi-quartz/src/main/resources/mapper/quartz/SysJobMapper.xml index 5438103..727c3fe 100644 --- a/ruoyi-quartz/src/main/resources/mapper/quartz/SysJobMapper.xml +++ b/ruoyi-quartz/src/main/resources/mapper/quartz/SysJobMapper.xml @@ -4,7 +4,7 @@ "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + @@ -35,7 +35,7 @@ from sys_job - @@ -75,7 +75,7 @@ - + update sys_job job_name = #{jobName}, @@ -92,7 +92,7 @@ where job_id = #{jobId} - + insert into sys_job( job_id, job_name, diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/BookInfoMapper.java b/ruoyi-system/src/main/java/com/ruoyi/book/mapper/BookInfoMapper.java similarity index 74% rename from ruoyi-system/src/main/java/com/ruoyi/system/mapper/BookInfoMapper.java rename to ruoyi-system/src/main/java/com/ruoyi/book/mapper/BookInfoMapper.java index 9da7197..7fcf132 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/BookInfoMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/book/mapper/BookInfoMapper.java @@ -1,14 +1,12 @@ -package com.ruoyi.system.mapper; +package com.ruoyi.book.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.ruoyi.system.domain.BookInfo; -import org.apache.ibatis.annotations.Mapper; /** * @author DongZl * @description: 书籍mapper层 * @Date 2023-10-7 上午 09:31 */ -@Mapper public interface BookInfoMapper extends BaseMapper { } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/BookInfoService.java b/ruoyi-system/src/main/java/com/ruoyi/book/service/BookInfoService.java similarity index 88% rename from ruoyi-system/src/main/java/com/ruoyi/system/service/BookInfoService.java rename to ruoyi-system/src/main/java/com/ruoyi/book/service/BookInfoService.java index 7abcda9..00342bb 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/BookInfoService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/book/service/BookInfoService.java @@ -1,4 +1,4 @@ -package com.ruoyi.system.service; +package com.ruoyi.book.service; import com.baomidou.mybatisplus.extension.service.IService; import com.ruoyi.system.domain.BookInfo; diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/BookInfoServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/book/service/impl/BookInfoServiceImpl.java similarity index 72% rename from ruoyi-system/src/main/java/com/ruoyi/system/service/impl/BookInfoServiceImpl.java rename to ruoyi-system/src/main/java/com/ruoyi/book/service/impl/BookInfoServiceImpl.java index e67cb7f..2f8390c 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/BookInfoServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/book/service/impl/BookInfoServiceImpl.java @@ -1,9 +1,9 @@ -package com.ruoyi.system.service.impl; +package com.ruoyi.book.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.book.service.BookInfoService; import com.ruoyi.system.domain.BookInfo; -import com.ruoyi.system.mapper.BookInfoMapper; -import com.ruoyi.system.service.BookInfoService; +import com.ruoyi.book.mapper.BookInfoMapper; import org.springframework.stereotype.Service; /** diff --git a/ruoyi-system/src/main/resources/mapper/system/SysConfigMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysConfigMapper.xml index 52f4678..d327baf 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysConfigMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysConfigMapper.xml @@ -4,7 +4,7 @@ "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + @@ -42,12 +42,12 @@ - - @@ -78,7 +78,7 @@ where config_key = #{configKey} limit 1 - + insert into sys_config ( config_name, config_key, @@ -98,7 +98,7 @@ ) - + update sys_config config_name = #{configName}, diff --git a/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml index 7c91d26..4124021 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml @@ -4,7 +4,7 @@ "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + @@ -38,7 +38,7 @@ from sys_dept d - where d.del_flag = '0' @@ -119,7 +119,7 @@ where dept_name=#{deptName} and parent_id = #{parentId} and del_flag = '0' limit 1 - + insert into sys_dept( dept_id, parent_id, @@ -147,7 +147,7 @@ ) - + update sys_dept parent_id = #{parentId}, diff --git a/ruoyi-system/src/main/resources/mapper/system/SysDictDataMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysDictDataMapper.xml index 8f043b2..9128e79 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysDictDataMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysDictDataMapper.xml @@ -4,7 +4,7 @@ "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + @@ -36,7 +36,7 @@ from sys_dict_data - @@ -52,7 +52,7 @@ order by dict_sort asc - where status = '0' and dict_type = #{dictType} order by dict_sort asc @@ -88,7 +88,7 @@ - + update sys_dict_data dict_sort = #{dictSort}, @@ -112,7 +112,7 @@ where dict_type = #{oldDictType} - + insert into sys_dict_data( dict_sort, dict_label, diff --git a/ruoyi-system/src/main/resources/mapper/system/SysDictTypeMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysDictTypeMapper.xml index 2e8f7be..b894f0b 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysDictTypeMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysDictTypeMapper.xml @@ -4,7 +4,7 @@ "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + @@ -20,7 +20,7 @@ from sys_dict_type - @@ -73,7 +73,7 @@ - + update sys_dict_type dict_name = #{dictName}, @@ -86,7 +86,7 @@ where dict_id = #{dictId} - + insert into sys_dict_type( dict_name, dict_type, diff --git a/ruoyi-system/src/main/resources/mapper/system/SysLogininforMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysLogininforMapper.xml index c33f818..589581a 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysLogininforMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysLogininforMapper.xml @@ -4,7 +4,7 @@ "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + @@ -16,12 +16,12 @@ - + insert into sys_logininfor (user_name, status, ipaddr, login_location, browser, os, msg, login_time) values (#{userName}, #{status}, #{ipaddr}, #{loginLocation}, #{browser}, #{os}, #{msg}, sysdate()) - select info_id, user_name, ipaddr, login_location, browser, os, status, msg, login_time from sys_logininfor diff --git a/ruoyi-system/src/main/resources/mapper/system/SysMenuMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysMenuMapper.xml index ee9da48..5716da9 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysMenuMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysMenuMapper.xml @@ -4,7 +4,7 @@ "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + @@ -46,7 +46,7 @@ from sys_menu - @@ -84,7 +84,7 @@ order by m.parent_id, m.order_num - 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 from sys_menu m @@ -181,12 +181,12 @@ where parent_id = #{menuId} - where menu_name=#{menuName} and parent_id = #{parentId} limit 1 - + update sys_menu menu_name = #{menuName}, @@ -209,7 +209,7 @@ where menu_id = #{menuId} - + insert into sys_menu( menu_id, parent_id, diff --git a/ruoyi-system/src/main/resources/mapper/system/SysNoticeMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysNoticeMapper.xml index d2b014b..6ec0837 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysNoticeMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysNoticeMapper.xml @@ -4,7 +4,7 @@ "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + @@ -36,7 +36,7 @@ where notice_id = #{noticeId} - @@ -51,7 +51,7 @@ - + insert into sys_notice ( notice_title, notice_type, @@ -71,7 +71,7 @@ ) - + update sys_notice notice_title = #{noticeTitle}, diff --git a/ruoyi-system/src/main/resources/mapper/system/SysOperLogMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysOperLogMapper.xml index 5612066..bf23c31 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysOperLogMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysOperLogMapper.xml @@ -4,7 +4,7 @@ "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + @@ -45,7 +45,7 @@ from sys_oper_log - + insert into sys_oper_log(title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, cost_time, oper_time) @@ -54,7 +54,7 @@ #{costTime}, sysdate()) - diff --git a/ruoyi-system/src/main/resources/mapper/system/SysPostMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysPostMapper.xml index dbe60f0..de3199a 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysPostMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysPostMapper.xml @@ -4,7 +4,7 @@ "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + @@ -29,7 +29,7 @@ from sys_post - @@ -79,7 +79,7 @@ where post_code=#{postCode} limit 1 - + update sys_post post_code = #{postCode}, @@ -93,7 +93,7 @@ where post_id = #{postId} - + insert into sys_post( post_id, post_code, diff --git a/ruoyi-system/src/main/resources/mapper/system/SysRoleDeptMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysRoleDeptMapper.xml index debad51..b76f4ec 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysRoleDeptMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysRoleDeptMapper.xml @@ -4,7 +4,7 @@ "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + diff --git a/ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml index 5fa657c..23341a2 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml @@ -4,7 +4,7 @@ "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + @@ -39,7 +39,7 @@ left join sys_dept d on u.dept_id = d.dept_id - where r.del_flag = '0' @@ -102,7 +102,7 @@ where r.role_key=#{roleKey} and r.del_flag = '0' limit 1 - + insert into sys_role( role_id, role_name, @@ -130,7 +130,7 @@ ) - + update sys_role role_name = #{roleName}, diff --git a/ruoyi-system/src/main/resources/mapper/system/SysRoleMenuMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysRoleMenuMapper.xml index 94c1d4e..70ee8ac 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysRoleMenuMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysRoleMenuMapper.xml @@ -4,7 +4,7 @@ "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + diff --git a/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml index a6fcfa3..cb69a2c 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml @@ -4,7 +4,7 @@ "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + @@ -23,11 +23,11 @@ - + - + @@ -37,7 +37,7 @@ - + @@ -82,7 +82,7 @@ left join sys_role r on r.role_id = ur.role_id - select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from sys_user u @@ -114,7 +114,7 @@ ${params.dataScope} - select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time from sys_user u left join sys_dept d on u.dept_id = d.dept_id @@ -131,7 +131,7 @@ ${params.dataScope} - select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time from sys_user u left join sys_dept d on u.dept_id = d.dept_id @@ -184,7 +184,7 @@ limit 1 - + insert into sys_user( user_id, dept_id, @@ -216,7 +216,7 @@ ) - + update sys_user dept_id = #{deptId}, @@ -237,19 +237,19 @@ where user_id = #{userId} - + update sys_user set status = #{status} where user_id = #{userId} - + update sys_user set avatar = #{avatar} where user_name = #{userName} - + update sys_user set password = #{password} where user_name = #{userName} diff --git a/ruoyi-system/src/main/resources/mapper/system/SysUserPostMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysUserPostMapper.xml index 8d42426..7c4ff34 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysUserPostMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysUserPostMapper.xml @@ -4,7 +4,7 @@ "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + diff --git a/ruoyi-system/src/main/resources/mapper/system/SysUserRoleMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysUserRoleMapper.xml index c9adadb..cef9fb1 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysUserRoleMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysUserRoleMapper.xml @@ -4,7 +4,7 @@ "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + @@ -35,7 +35,7 @@ - + delete from sys_user_role where user_id = #{userId}