mirror of
https://github.com/dromara/RuoYi-Vue-Plus.git
synced 2025-09-30 15:16:41 +08:00
【update】 修改数据源为oracle数据库,调整system代码,部分sql兼容oracle数据库,已测试系统管理菜单下所有功能
This commit is contained in:
parent
f3aaa7ea7a
commit
37568f26a4
@ -30,6 +30,14 @@
|
|||||||
<artifactId>mysql-connector-java</artifactId>
|
<artifactId>mysql-connector-java</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!--oracle驱动-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.oracle</groupId>
|
||||||
|
<artifactId>ojdbc6</artifactId>
|
||||||
|
<version>11.2.0.3</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
<!-- 核心模块-->
|
<!-- 核心模块-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.ruoyi</groupId>
|
<groupId>com.ruoyi</groupId>
|
||||||
|
@ -146,6 +146,7 @@ mybatis-plus:
|
|||||||
localCacheScope: SESSION
|
localCacheScope: SESSION
|
||||||
# 开启Mybatis二级缓存,默认为 true
|
# 开启Mybatis二级缓存,默认为 true
|
||||||
cacheEnabled: true
|
cacheEnabled: true
|
||||||
|
jdbc-type-for-null: 'null'
|
||||||
global-config:
|
global-config:
|
||||||
# 是否打印 Logo banner
|
# 是否打印 Logo banner
|
||||||
banner: true
|
banner: true
|
||||||
|
@ -14,7 +14,7 @@ import java.util.*;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 部门表 sys_dept
|
* 部门表 sys_dept
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -22,12 +22,13 @@ import java.util.*;
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@TableName("sys_dept")
|
@TableName("sys_dept")
|
||||||
|
@KeySequence(value = "seq_sys_dept")
|
||||||
public class SysDept implements Serializable
|
public class SysDept implements Serializable
|
||||||
{
|
{
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/** 部门ID */
|
/** 部门ID */
|
||||||
@TableId(value = "dept_id",type = IdType.AUTO)
|
@TableId(value = "dept_id",type = IdType.INPUT)
|
||||||
private Long deptId;
|
private Long deptId;
|
||||||
|
|
||||||
/** 父部门ID */
|
/** 父部门ID */
|
||||||
@ -85,7 +86,7 @@ public class SysDept implements Serializable
|
|||||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private Date updateTime;
|
private Date updateTime;
|
||||||
|
|
||||||
/** 子部门 */
|
/** 子部门 */
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private List<SysDept> children = new ArrayList<SysDept>();
|
private List<SysDept> children = new ArrayList<SysDept>();
|
||||||
|
@ -18,7 +18,7 @@ import java.util.Map;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 字典数据表 sys_dict_data
|
* 字典数据表 sys_dict_data
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -26,13 +26,14 @@ import java.util.Map;
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@TableName("sys_dict_data")
|
@TableName("sys_dict_data")
|
||||||
|
@KeySequence(value = "seq_sys_dict_data")
|
||||||
public class SysDictData implements Serializable
|
public class SysDictData implements Serializable
|
||||||
{
|
{
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/** 字典编码 */
|
/** 字典编码 */
|
||||||
@Excel(name = "字典编码", cellType = ColumnType.NUMERIC)
|
@Excel(name = "字典编码", cellType = ColumnType.NUMERIC)
|
||||||
@TableId(value = "dict_code",type = IdType.AUTO)
|
@TableId(value = "dict_code",type = IdType.INPUT)
|
||||||
private Long dictCode;
|
private Long dictCode;
|
||||||
|
|
||||||
/** 字典排序 */
|
/** 字典排序 */
|
||||||
|
@ -17,7 +17,7 @@ import java.util.Map;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 字典类型表 sys_dict_type
|
* 字典类型表 sys_dict_type
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -25,13 +25,14 @@ import java.util.Map;
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@TableName("sys_dict_type")
|
@TableName("sys_dict_type")
|
||||||
|
@KeySequence(value = "seq_sys_dict_type")
|
||||||
public class SysDictType implements Serializable
|
public class SysDictType implements Serializable
|
||||||
{
|
{
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/** 字典主键 */
|
/** 字典主键 */
|
||||||
@Excel(name = "字典主键", cellType = ColumnType.NUMERIC)
|
@Excel(name = "字典主键", cellType = ColumnType.NUMERIC)
|
||||||
@TableId(value = "dict_id",type = IdType.AUTO)
|
@TableId(value = "dict_id",type = IdType.INPUT)
|
||||||
private Long dictId;
|
private Long dictId;
|
||||||
|
|
||||||
/** 字典名称 */
|
/** 字典名称 */
|
||||||
|
@ -13,7 +13,7 @@ import java.util.*;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 菜单权限表 sys_menu
|
* 菜单权限表 sys_menu
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -21,12 +21,13 @@ import java.util.*;
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@TableName("sys_menu")
|
@TableName("sys_menu")
|
||||||
|
@KeySequence(value = "seq_sys_menu")
|
||||||
public class SysMenu implements Serializable
|
public class SysMenu implements Serializable
|
||||||
{
|
{
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/** 菜单ID */
|
/** 菜单ID */
|
||||||
@TableId(value = "menu_id",type = IdType.AUTO)
|
@TableId(value = "menu_id",type = IdType.INPUT)
|
||||||
private Long menuId;
|
private Long menuId;
|
||||||
|
|
||||||
/** 菜单名称 */
|
/** 菜单名称 */
|
||||||
@ -65,7 +66,7 @@ public class SysMenu implements Serializable
|
|||||||
|
|
||||||
/** 显示状态(0显示 1隐藏) */
|
/** 显示状态(0显示 1隐藏) */
|
||||||
private String visible;
|
private String visible;
|
||||||
|
|
||||||
/** 菜单状态(0显示 1隐藏) */
|
/** 菜单状态(0显示 1隐藏) */
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ import java.util.Map;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 角色表 sys_role
|
* 角色表 sys_role
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -25,13 +25,14 @@ import java.util.Map;
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@TableName("sys_role")
|
@TableName("sys_role")
|
||||||
|
@KeySequence(value = "seq_sys_role")
|
||||||
public class SysRole implements Serializable
|
public class SysRole implements Serializable
|
||||||
{
|
{
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/** 角色ID */
|
/** 角色ID */
|
||||||
@Excel(name = "角色序号", cellType = ColumnType.NUMERIC)
|
@Excel(name = "角色序号", cellType = ColumnType.NUMERIC)
|
||||||
@TableId(value = "role_id",type = IdType.AUTO)
|
@TableId(value = "role_id",type = IdType.INPUT)
|
||||||
private Long roleId;
|
private Long roleId;
|
||||||
|
|
||||||
/** 角色名称 */
|
/** 角色名称 */
|
||||||
|
@ -31,13 +31,14 @@ import java.util.Map;
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@TableName("sys_user")
|
@TableName("sys_user")
|
||||||
|
@KeySequence(value = "seq_sys_user")
|
||||||
public class SysUser implements Serializable
|
public class SysUser implements Serializable
|
||||||
{
|
{
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/** 用户ID */
|
/** 用户ID */
|
||||||
@Excel(name = "用户序号", cellType = ColumnType.NUMERIC, prompt = "用户编号")
|
@Excel(name = "用户序号", cellType = ColumnType.NUMERIC, prompt = "用户编号")
|
||||||
@TableId(value = "user_id",type = IdType.AUTO)
|
@TableId(value = "user_id",type = IdType.INPUT)
|
||||||
private Long userId;
|
private Long userId;
|
||||||
|
|
||||||
/** 部门ID */
|
/** 部门ID */
|
||||||
|
@ -107,7 +107,7 @@ public interface IServicePlus<T> extends IService<T> {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据 Wrapper,查询一条记录 <br/>
|
* 根据 Wrapper,查询一条记录 <br/>
|
||||||
* <p>结果集,如果是多个会抛出异常,随机取一条加上限制条件 wrapper.last("LIMIT 1")</p>
|
* <p>结果集,如果是多个会抛出异常,随机取一条加上限制条件 wrapper.last("and rownum <= 1")</p>
|
||||||
*
|
*
|
||||||
* @param kClass vo类型
|
* @param kClass vo类型
|
||||||
* @param queryWrapper 实体对象封装操作类 {@link com.baomidou.mybatisplus.core.conditions.query.QueryWrapper}
|
* @param queryWrapper 实体对象封装操作类 {@link com.baomidou.mybatisplus.core.conditions.query.QueryWrapper}
|
||||||
@ -118,7 +118,7 @@ public interface IServicePlus<T> extends IService<T> {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据 Wrapper,查询一条记录 <br/>
|
* 根据 Wrapper,查询一条记录 <br/>
|
||||||
* <p>结果集,如果是多个会抛出异常,随机取一条加上限制条件 wrapper.last("LIMIT 1")</p>
|
* <p>结果集,如果是多个会抛出异常,随机取一条加上限制条件 wrapper.last("and rownum <= 1")</p>
|
||||||
*
|
*
|
||||||
* @param convertor 转换函数
|
* @param convertor 转换函数
|
||||||
* @param queryWrapper 实体对象封装操作类 {@link com.baomidou.mybatisplus.core.conditions.query.QueryWrapper}
|
* @param queryWrapper 实体对象封装操作类 {@link com.baomidou.mybatisplus.core.conditions.query.QueryWrapper}
|
||||||
|
@ -117,7 +117,7 @@ public class DataScopeAspect {
|
|||||||
deptAlias, user.getDeptId()));
|
deptAlias, user.getDeptId()));
|
||||||
} else if (DATA_SCOPE_DEPT_AND_CHILD.equals(dataScope)) {
|
} else if (DATA_SCOPE_DEPT_AND_CHILD.equals(dataScope)) {
|
||||||
sqlString.append(StrUtil.format(
|
sqlString.append(StrUtil.format(
|
||||||
" OR {}dept_id IN ( SELECT dept_id FROM sys_dept WHERE dept_id = {} or find_in_set( {} , ancestors ) )",
|
" OR {}dept_id IN ( SELECT dept_id FROM sys_dept WHERE dept_id = {} or find_in_set( {} , ancestors ) <![CDATA[ <> ]]> 0 )",
|
||||||
deptAlias, user.getDeptId(), user.getDeptId()));
|
deptAlias, user.getDeptId(), user.getDeptId()));
|
||||||
} else if (DATA_SCOPE_SELF.equals(dataScope)) {
|
} else if (DATA_SCOPE_SELF.equals(dataScope)) {
|
||||||
if (isUser) {
|
if (isUser) {
|
||||||
|
@ -2,6 +2,7 @@ package com.ruoyi.framework.config;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.DbType;
|
import com.baomidou.mybatisplus.annotation.DbType;
|
||||||
import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
|
import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
|
||||||
|
import com.baomidou.mybatisplus.extension.incrementer.OracleKeyGenerator;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
|
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.inner.OptimisticLockerInnerInterceptor;
|
import com.baomidou.mybatisplus.extension.plugins.inner.OptimisticLockerInnerInterceptor;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
|
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
|
||||||
@ -41,7 +42,7 @@ public class MybatisPlusConfig {
|
|||||||
public PaginationInnerInterceptor paginationInnerInterceptor() {
|
public PaginationInnerInterceptor paginationInnerInterceptor() {
|
||||||
PaginationInnerInterceptor paginationInnerInterceptor = new PaginationInnerInterceptor();
|
PaginationInnerInterceptor paginationInnerInterceptor = new PaginationInnerInterceptor();
|
||||||
// 设置数据库类型为mysql
|
// 设置数据库类型为mysql
|
||||||
paginationInnerInterceptor.setDbType(DbType.MYSQL);
|
paginationInnerInterceptor.setDbType(DbType.ORACLE);
|
||||||
// 设置最大单页限制数量,默认 500 条,-1 不受限制
|
// 设置最大单页限制数量,默认 500 条,-1 不受限制
|
||||||
paginationInnerInterceptor.setMaxLimit(-1L);
|
paginationInnerInterceptor.setMaxLimit(-1L);
|
||||||
return paginationInnerInterceptor;
|
return paginationInnerInterceptor;
|
||||||
@ -106,4 +107,15 @@ public class MybatisPlusConfig {
|
|||||||
* https://baomidou.com/guide/interceptor-dynamic-table-name.html
|
* https://baomidou.com/guide/interceptor-dynamic-table-name.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sequence主键自增
|
||||||
|
*
|
||||||
|
* @return 返回oracle自增类
|
||||||
|
* @author zhenggc
|
||||||
|
* @date 2019/1/2
|
||||||
|
*/
|
||||||
|
@Bean
|
||||||
|
public OracleKeyGenerator oracleKeyGenerator(){
|
||||||
|
return new OracleKeyGenerator();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,13 +1,57 @@
|
|||||||
package com.ruoyi.quartz.config;
|
package com.ruoyi.quartz.config;
|
||||||
|
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
/**
|
import org.springframework.scheduling.quartz.SchedulerFactoryBean;
|
||||||
* 定时任务配置
|
import javax.sql.DataSource;
|
||||||
*
|
import java.util.Properties;
|
||||||
* @author Lion Li
|
|
||||||
*/
|
/**
|
||||||
@Configuration
|
* 定时任务配置
|
||||||
public class ScheduleConfig {
|
*
|
||||||
|
* @author ruoyi
|
||||||
}
|
*/
|
||||||
|
@Configuration
|
||||||
|
public class ScheduleConfig
|
||||||
|
{
|
||||||
|
@Bean
|
||||||
|
public SchedulerFactoryBean schedulerFactoryBean(DataSource dataSource)
|
||||||
|
{
|
||||||
|
SchedulerFactoryBean factory = new SchedulerFactoryBean();
|
||||||
|
factory.setDataSource(dataSource);
|
||||||
|
|
||||||
|
// quartz参数
|
||||||
|
Properties prop = new Properties();
|
||||||
|
prop.put("org.quartz.scheduler.instanceName", "RuoyiScheduler");
|
||||||
|
prop.put("org.quartz.scheduler.instanceId", "AUTO");
|
||||||
|
// 线程池配置
|
||||||
|
prop.put("org.quartz.threadPool.class", "org.quartz.simpl.SimpleThreadPool");
|
||||||
|
prop.put("org.quartz.threadPool.threadCount", "20");
|
||||||
|
prop.put("org.quartz.threadPool.threadPriority", "5");
|
||||||
|
// JobStore配置
|
||||||
|
prop.put("org.quartz.jobStore.class", "org.quartz.impl.jdbcjobstore.JobStoreTX");
|
||||||
|
// 集群配置
|
||||||
|
prop.put("org.quartz.jobStore.isClustered", "true");
|
||||||
|
prop.put("org.quartz.jobStore.clusterCheckinInterval", "15000");
|
||||||
|
prop.put("org.quartz.jobStore.maxMisfiresToHandleAtATime", "1");
|
||||||
|
prop.put("org.quartz.jobStore.txIsolationLevelSerializable", "true");
|
||||||
|
|
||||||
|
// sqlserver 启用
|
||||||
|
// prop.put("org.quartz.jobStore.selectWithLockSQL", "SELECT * FROM {0}LOCKS UPDLOCK WHERE LOCK_NAME = ?");
|
||||||
|
prop.put("org.quartz.jobStore.misfireThreshold", "12000");
|
||||||
|
prop.put("org.quartz.jobStore.tablePrefix", "QRTZ_");
|
||||||
|
factory.setQuartzProperties(prop);
|
||||||
|
|
||||||
|
factory.setSchedulerName("RuoyiScheduler");
|
||||||
|
// 延时启动
|
||||||
|
factory.setStartupDelay(1);
|
||||||
|
factory.setApplicationContextSchedulerContextKey("applicationContextKey");
|
||||||
|
// 可选,QuartzScheduler
|
||||||
|
// 启动时更新己存在的Job,这样就不用每次修改targetObject后删除qrtz_job_details表对应记录了
|
||||||
|
factory.setOverwriteExistingJobs(true);
|
||||||
|
// 设置自动启动,默认为true
|
||||||
|
factory.setAutoStartup(true);
|
||||||
|
|
||||||
|
return factory;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -28,6 +28,7 @@ import java.util.Map;
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@TableName("sys_job")
|
@TableName("sys_job")
|
||||||
|
@KeySequence(value = "seq_sys_job")
|
||||||
public class SysJob implements Serializable {
|
public class SysJob implements Serializable {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@ -35,7 +36,7 @@ public class SysJob implements Serializable {
|
|||||||
* 任务ID
|
* 任务ID
|
||||||
*/
|
*/
|
||||||
@Excel(name = "任务序号", cellType = ColumnType.NUMERIC)
|
@Excel(name = "任务序号", cellType = ColumnType.NUMERIC)
|
||||||
@TableId(value = "job_id", type = IdType.AUTO)
|
@TableId(value = "job_id", type = IdType.INPUT)
|
||||||
private Long jobId;
|
private Long jobId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,78 +1,78 @@
|
|||||||
package com.ruoyi.quartz.domain;
|
package com.ruoyi.quartz.domain;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.*;
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.ruoyi.common.annotation.Excel;
|
import com.ruoyi.common.annotation.Excel;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 定时任务调度日志表 sys_job_log
|
* 定时任务调度日志表 sys_job_log
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@TableName("sys_job_log")
|
@TableName("sys_job_log")
|
||||||
public class SysJobLog
|
@KeySequence(value = "seq_sys_job_log")
|
||||||
{
|
public class SysJobLog {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/** ID */
|
/** ID */
|
||||||
@Excel(name = "日志序号")
|
@Excel(name = "日志序号")
|
||||||
@TableId(value = "job_log_id", type = IdType.AUTO)
|
@TableId(value = "job_log_id", type = IdType.INPUT)
|
||||||
private Long jobLogId;
|
private Long jobLogId;
|
||||||
|
|
||||||
/** 任务名称 */
|
/** 任务名称 */
|
||||||
@Excel(name = "任务名称")
|
@Excel(name = "任务名称")
|
||||||
private String jobName;
|
private String jobName;
|
||||||
|
|
||||||
/** 任务组名 */
|
/** 任务组名 */
|
||||||
@Excel(name = "任务组名")
|
@Excel(name = "任务组名")
|
||||||
private String jobGroup;
|
private String jobGroup;
|
||||||
|
|
||||||
/** 调用目标字符串 */
|
/** 调用目标字符串 */
|
||||||
@Excel(name = "调用目标字符串")
|
@Excel(name = "调用目标字符串")
|
||||||
private String invokeTarget;
|
private String invokeTarget;
|
||||||
|
|
||||||
/** 日志信息 */
|
/** 日志信息 */
|
||||||
@Excel(name = "日志信息")
|
@Excel(name = "日志信息")
|
||||||
private String jobMessage;
|
private String jobMessage;
|
||||||
|
|
||||||
/** 执行状态(0正常 1失败) */
|
/** 执行状态(0正常 1失败) */
|
||||||
@Excel(name = "执行状态", readConverterExp = "0=正常,1=失败")
|
@Excel(name = "执行状态", readConverterExp = "0=正常,1=失败")
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
/** 异常信息 */
|
/** 异常信息 */
|
||||||
@Excel(name = "异常信息")
|
@Excel(name = "异常信息")
|
||||||
private String exceptionInfo;
|
private String exceptionInfo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建时间
|
* 创建时间
|
||||||
*/
|
*/
|
||||||
@TableField(fill = FieldFill.INSERT)
|
@TableField(fill = FieldFill.INSERT)
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 请求参数
|
* 请求参数
|
||||||
*/
|
*/
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private Map<String, Object> params = new HashMap<>();
|
private Map<String, Object> params = new HashMap<>();
|
||||||
|
|
||||||
/** 开始时间 */
|
/** 开始时间 */
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private Date startTime;
|
private Date startTime;
|
||||||
|
|
||||||
/** 停止时间 */
|
/** 停止时间 */
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private Date stopTime;
|
private Date stopTime;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,114 +1,114 @@
|
|||||||
package com.ruoyi.quartz.service.impl;
|
package com.ruoyi.quartz.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.lang.Validator;
|
import cn.hutool.core.lang.Validator;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
import com.ruoyi.common.utils.PageUtils;
|
import com.ruoyi.common.utils.PageUtils;
|
||||||
import com.ruoyi.quartz.domain.SysJobLog;
|
import com.ruoyi.quartz.domain.SysJobLog;
|
||||||
import com.ruoyi.quartz.mapper.SysJobLogMapper;
|
import com.ruoyi.quartz.mapper.SysJobLogMapper;
|
||||||
import com.ruoyi.quartz.service.ISysJobLogService;
|
import com.ruoyi.quartz.service.ISysJobLogService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 定时任务调度日志信息 服务层
|
* 定时任务调度日志信息 服务层
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class SysJobLogServiceImpl extends ServiceImpl<SysJobLogMapper, SysJobLog> implements ISysJobLogService {
|
public class SysJobLogServiceImpl extends ServiceImpl<SysJobLogMapper, SysJobLog> implements ISysJobLogService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TableDataInfo<SysJobLog> selectPageJobLogList(SysJobLog jobLog) {
|
public TableDataInfo<SysJobLog> selectPageJobLogList(SysJobLog jobLog) {
|
||||||
Map<String, Object> params = jobLog.getParams();
|
Map<String, Object> params = jobLog.getParams();
|
||||||
LambdaQueryWrapper<SysJobLog> lqw = new LambdaQueryWrapper<SysJobLog>()
|
LambdaQueryWrapper<SysJobLog> lqw = new LambdaQueryWrapper<SysJobLog>()
|
||||||
.like(StrUtil.isNotBlank(jobLog.getJobName()), SysJobLog::getJobName, jobLog.getJobName())
|
.like(StrUtil.isNotBlank(jobLog.getJobName()), SysJobLog::getJobName, jobLog.getJobName())
|
||||||
.eq(StrUtil.isNotBlank(jobLog.getJobGroup()), SysJobLog::getJobGroup, jobLog.getJobGroup())
|
.eq(StrUtil.isNotBlank(jobLog.getJobGroup()), SysJobLog::getJobGroup, jobLog.getJobGroup())
|
||||||
.eq(StrUtil.isNotBlank(jobLog.getStatus()), SysJobLog::getStatus, jobLog.getStatus())
|
.eq(StrUtil.isNotBlank(jobLog.getStatus()), SysJobLog::getStatus, jobLog.getStatus())
|
||||||
.like(StrUtil.isNotBlank(jobLog.getInvokeTarget()), SysJobLog::getInvokeTarget, jobLog.getInvokeTarget())
|
.like(StrUtil.isNotBlank(jobLog.getInvokeTarget()), SysJobLog::getInvokeTarget, jobLog.getInvokeTarget())
|
||||||
.apply(Validator.isNotEmpty(params.get("beginTime")),
|
.apply(Validator.isNotEmpty(params.get("beginTime")),
|
||||||
"date_format(create_time,'%y%m%d') >= date_format({0},'%y%m%d')",
|
"create_time >= TO_DATE({0},'yyyy-MM-dd HH24:mi:ss')",
|
||||||
params.get("beginTime"))
|
params.get("beginTime"))
|
||||||
.apply(Validator.isNotEmpty(params.get("endTime")),
|
.apply(Validator.isNotEmpty(params.get("endTime")),
|
||||||
"date_format(create_time,'%y%m%d') <= date_format({0},'%y%m%d')",
|
"create_time <= TO_DATE({0},'yyyy-MM-dd HH24:mi:ss')",
|
||||||
params.get("endTime"));
|
params.get("endTime"));
|
||||||
return PageUtils.buildDataInfo(page(PageUtils.buildPage(), lqw));
|
return PageUtils.buildDataInfo(page(PageUtils.buildPage(), lqw));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取quartz调度器日志的计划任务
|
* 获取quartz调度器日志的计划任务
|
||||||
*
|
*
|
||||||
* @param jobLog 调度日志信息
|
* @param jobLog 调度日志信息
|
||||||
* @return 调度任务日志集合
|
* @return 调度任务日志集合
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<SysJobLog> selectJobLogList(SysJobLog jobLog) {
|
public List<SysJobLog> selectJobLogList(SysJobLog jobLog) {
|
||||||
Map<String, Object> params = jobLog.getParams();
|
Map<String, Object> params = jobLog.getParams();
|
||||||
return list(new LambdaQueryWrapper<SysJobLog>()
|
return list(new LambdaQueryWrapper<SysJobLog>()
|
||||||
.like(StrUtil.isNotBlank(jobLog.getJobName()), SysJobLog::getJobName, jobLog.getJobName())
|
.like(StrUtil.isNotBlank(jobLog.getJobName()), SysJobLog::getJobName, jobLog.getJobName())
|
||||||
.eq(StrUtil.isNotBlank(jobLog.getJobGroup()), SysJobLog::getJobGroup, jobLog.getJobGroup())
|
.eq(StrUtil.isNotBlank(jobLog.getJobGroup()), SysJobLog::getJobGroup, jobLog.getJobGroup())
|
||||||
.eq(StrUtil.isNotBlank(jobLog.getStatus()), SysJobLog::getStatus, jobLog.getStatus())
|
.eq(StrUtil.isNotBlank(jobLog.getStatus()), SysJobLog::getStatus, jobLog.getStatus())
|
||||||
.like(StrUtil.isNotBlank(jobLog.getInvokeTarget()), SysJobLog::getInvokeTarget, jobLog.getInvokeTarget())
|
.like(StrUtil.isNotBlank(jobLog.getInvokeTarget()), SysJobLog::getInvokeTarget, jobLog.getInvokeTarget())
|
||||||
.apply(Validator.isNotEmpty(params.get("beginTime")),
|
.apply(Validator.isNotEmpty(params.get("beginTime")),
|
||||||
"date_format(create_time,'%y%m%d') >= date_format({0},'%y%m%d')",
|
"create_time >= TO_DATE({0},'yyyy-MM-dd HH24:mi:ss')",
|
||||||
params.get("beginTime"))
|
params.get("beginTime"))
|
||||||
.apply(Validator.isNotEmpty(params.get("endTime")),
|
.apply(Validator.isNotEmpty(params.get("endTime")),
|
||||||
"date_format(create_time,'%y%m%d') <= date_format({0},'%y%m%d')",
|
"create_time <= TO_DATE({0},'yyyy-MM-dd HH24:mi:ss')",
|
||||||
params.get("endTime")));
|
params.get("endTime")));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过调度任务日志ID查询调度信息
|
* 通过调度任务日志ID查询调度信息
|
||||||
*
|
*
|
||||||
* @param jobLogId 调度任务日志ID
|
* @param jobLogId 调度任务日志ID
|
||||||
* @return 调度任务日志对象信息
|
* @return 调度任务日志对象信息
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public SysJobLog selectJobLogById(Long jobLogId) {
|
public SysJobLog selectJobLogById(Long jobLogId) {
|
||||||
return getById(jobLogId);
|
return getById(jobLogId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增任务日志
|
* 新增任务日志
|
||||||
*
|
*
|
||||||
* @param jobLog 调度日志信息
|
* @param jobLog 调度日志信息
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void addJobLog(SysJobLog jobLog) {
|
public void addJobLog(SysJobLog jobLog) {
|
||||||
baseMapper.insert(jobLog);
|
baseMapper.insert(jobLog);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除调度日志信息
|
* 批量删除调度日志信息
|
||||||
*
|
*
|
||||||
* @param logIds 需要删除的数据ID
|
* @param logIds 需要删除的数据ID
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int deleteJobLogByIds(Long[] logIds) {
|
public int deleteJobLogByIds(Long[] logIds) {
|
||||||
return baseMapper.deleteBatchIds(Arrays.asList(logIds));
|
return baseMapper.deleteBatchIds(Arrays.asList(logIds));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除任务日志
|
* 删除任务日志
|
||||||
*
|
*
|
||||||
* @param jobId 调度日志ID
|
* @param jobId 调度日志ID
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int deleteJobLogById(Long jobId) {
|
public int deleteJobLogById(Long jobId) {
|
||||||
return baseMapper.deleteById(jobId);
|
return baseMapper.deleteById(jobId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 清空任务日志
|
* 清空任务日志
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void cleanJobLog() {
|
public void cleanJobLog() {
|
||||||
remove(new LambdaQueryWrapper<>());
|
remove(new LambdaQueryWrapper<>());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,6 +25,7 @@ import java.util.Map;
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@TableName("sys_config")
|
@TableName("sys_config")
|
||||||
|
@KeySequence(value = "seq_sys_config")
|
||||||
public class SysConfig implements Serializable {
|
public class SysConfig implements Serializable {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@ -32,7 +33,7 @@ public class SysConfig implements Serializable {
|
|||||||
* 参数主键
|
* 参数主键
|
||||||
*/
|
*/
|
||||||
@Excel(name = "参数主键", cellType = ColumnType.NUMERIC)
|
@Excel(name = "参数主键", cellType = ColumnType.NUMERIC)
|
||||||
@TableId(value = "config_id", type = IdType.AUTO)
|
@TableId(value = "config_id", type = IdType.INPUT)
|
||||||
private Long configId;
|
private Long configId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,9 +1,6 @@
|
|||||||
package com.ruoyi.system.domain;
|
package com.ruoyi.system.domain;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.ruoyi.common.annotation.Excel;
|
import com.ruoyi.common.annotation.Excel;
|
||||||
import com.ruoyi.common.annotation.Excel.ColumnType;
|
import com.ruoyi.common.annotation.Excel.ColumnType;
|
||||||
@ -26,6 +23,7 @@ import java.util.Map;
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@TableName("sys_logininfor")
|
@TableName("sys_logininfor")
|
||||||
|
@KeySequence(value = "seq_sys_logininfor")
|
||||||
public class SysLogininfor implements Serializable {
|
public class SysLogininfor implements Serializable {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@ -33,7 +31,7 @@ public class SysLogininfor implements Serializable {
|
|||||||
* ID
|
* ID
|
||||||
*/
|
*/
|
||||||
@Excel(name = "序号", cellType = ColumnType.NUMERIC)
|
@Excel(name = "序号", cellType = ColumnType.NUMERIC)
|
||||||
@TableId(value = "info_id", type = IdType.AUTO)
|
@TableId(value = "info_id", type = IdType.INPUT)
|
||||||
private Long infoId;
|
private Long infoId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -22,13 +22,14 @@ import java.util.Map;
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@TableName("sys_notice")
|
@TableName("sys_notice")
|
||||||
|
@KeySequence(value = "seq_sys_notice")
|
||||||
public class SysNotice implements Serializable {
|
public class SysNotice implements Serializable {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 公告ID
|
* 公告ID
|
||||||
*/
|
*/
|
||||||
@TableId(value = "notice_id", type = IdType.AUTO)
|
@TableId(value = "notice_id", type = IdType.INPUT)
|
||||||
private Long noticeId;
|
private Long noticeId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,9 +1,6 @@
|
|||||||
package com.ruoyi.system.domain;
|
package com.ruoyi.system.domain;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.ruoyi.common.annotation.Excel;
|
import com.ruoyi.common.annotation.Excel;
|
||||||
import com.ruoyi.common.annotation.Excel.ColumnType;
|
import com.ruoyi.common.annotation.Excel.ColumnType;
|
||||||
@ -26,6 +23,7 @@ import java.util.Map;
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@TableName("sys_oper_log")
|
@TableName("sys_oper_log")
|
||||||
|
@KeySequence(value = "seq_sys_oper_log")
|
||||||
public class SysOperLog implements Serializable {
|
public class SysOperLog implements Serializable {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@ -33,7 +31,7 @@ public class SysOperLog implements Serializable {
|
|||||||
* 日志主键
|
* 日志主键
|
||||||
*/
|
*/
|
||||||
@Excel(name = "操作序号", cellType = ColumnType.NUMERIC)
|
@Excel(name = "操作序号", cellType = ColumnType.NUMERIC)
|
||||||
@TableId(value = "oper_id", type = IdType.AUTO)
|
@TableId(value = "oper_id", type = IdType.INPUT)
|
||||||
private Long operId;
|
private Long operId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -25,6 +25,7 @@ import java.util.Map;
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@TableName("sys_post")
|
@TableName("sys_post")
|
||||||
|
@KeySequence(value = "seq_sys_post")
|
||||||
public class SysPost implements Serializable {
|
public class SysPost implements Serializable {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@ -32,7 +33,7 @@ public class SysPost implements Serializable {
|
|||||||
* 岗位序号
|
* 岗位序号
|
||||||
*/
|
*/
|
||||||
@Excel(name = "岗位序号", cellType = ColumnType.NUMERIC)
|
@Excel(name = "岗位序号", cellType = ColumnType.NUMERIC)
|
||||||
@TableId(value = "post_id", type = IdType.AUTO)
|
@TableId(value = "post_id", type = IdType.INPUT)
|
||||||
private Long postId;
|
private Long postId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -52,10 +52,10 @@ public class SysConfigServiceImpl extends ServiceImpl<SysConfigMapper, SysConfig
|
|||||||
.eq(StrUtil.isNotBlank(config.getConfigType()), SysConfig::getConfigType, config.getConfigType())
|
.eq(StrUtil.isNotBlank(config.getConfigType()), SysConfig::getConfigType, config.getConfigType())
|
||||||
.like(StrUtil.isNotBlank(config.getConfigKey()), SysConfig::getConfigKey, config.getConfigKey())
|
.like(StrUtil.isNotBlank(config.getConfigKey()), SysConfig::getConfigKey, config.getConfigKey())
|
||||||
.apply(Validator.isNotEmpty(params.get("beginTime")),
|
.apply(Validator.isNotEmpty(params.get("beginTime")),
|
||||||
"date_format(create_time,'%y%m%d') >= date_format({0},'%y%m%d')",
|
"create_time >= TO_DATE({0},'yyyy-MM-dd HH24:mi:ss')",
|
||||||
params.get("beginTime"))
|
params.get("beginTime"))
|
||||||
.apply(Validator.isNotEmpty(params.get("endTime")),
|
.apply(Validator.isNotEmpty(params.get("endTime")),
|
||||||
"date_format(create_time,'%y%m%d') <= date_format({0},'%y%m%d')",
|
"create_time <= TO_DATE({0},'yyyy-MM-dd HH24:mi:ss')",
|
||||||
params.get("endTime"));
|
params.get("endTime"));
|
||||||
return PageUtils.buildDataInfo(page(PageUtils.buildPage(), lqw));
|
return PageUtils.buildDataInfo(page(PageUtils.buildPage(), lqw));
|
||||||
}
|
}
|
||||||
@ -107,10 +107,10 @@ public class SysConfigServiceImpl extends ServiceImpl<SysConfigMapper, SysConfig
|
|||||||
.eq(StrUtil.isNotBlank(config.getConfigType()), SysConfig::getConfigType, config.getConfigType())
|
.eq(StrUtil.isNotBlank(config.getConfigType()), SysConfig::getConfigType, config.getConfigType())
|
||||||
.like(StrUtil.isNotBlank(config.getConfigKey()), SysConfig::getConfigKey, config.getConfigKey())
|
.like(StrUtil.isNotBlank(config.getConfigKey()), SysConfig::getConfigKey, config.getConfigKey())
|
||||||
.apply(Validator.isNotEmpty(params.get("beginTime")),
|
.apply(Validator.isNotEmpty(params.get("beginTime")),
|
||||||
"date_format(create_time,'%y%m%d') >= date_format({0},'%y%m%d')",
|
"create_time >= TO_DATE({0},'yyyy-MM-dd HH24:mi:ss')",
|
||||||
params.get("beginTime"))
|
params.get("beginTime"))
|
||||||
.apply(Validator.isNotEmpty(params.get("endTime")),
|
.apply(Validator.isNotEmpty(params.get("endTime")),
|
||||||
"date_format(create_time,'%y%m%d') <= date_format({0},'%y%m%d')",
|
"create_time <= TO_DATE({0},'yyyy-MM-dd HH24:mi:ss')",
|
||||||
params.get("endTime"));
|
params.get("endTime"));
|
||||||
return baseMapper.selectList(lqw);
|
return baseMapper.selectList(lqw);
|
||||||
}
|
}
|
||||||
|
@ -123,7 +123,7 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
|
|||||||
public int selectNormalChildrenDeptById(Long deptId) {
|
public int selectNormalChildrenDeptById(Long deptId) {
|
||||||
return count(new LambdaQueryWrapper<SysDept>()
|
return count(new LambdaQueryWrapper<SysDept>()
|
||||||
.eq(SysDept::getStatus, 0)
|
.eq(SysDept::getStatus, 0)
|
||||||
.apply("find_in_set({0}, ancestors)", deptId));
|
.apply("find_in_set({0}, ancestors) <> 0", deptId));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -136,7 +136,7 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
|
|||||||
public boolean hasChildByDeptId(Long deptId) {
|
public boolean hasChildByDeptId(Long deptId) {
|
||||||
int result = count(new LambdaQueryWrapper<SysDept>()
|
int result = count(new LambdaQueryWrapper<SysDept>()
|
||||||
.eq(SysDept::getParentId, deptId)
|
.eq(SysDept::getParentId, deptId)
|
||||||
.last("limit 1"));
|
.last("and rownum <= 1"));
|
||||||
return result > 0 ? true : false;
|
return result > 0 ? true : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -165,7 +165,7 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
|
|||||||
SysDept info = getOne(new LambdaQueryWrapper<SysDept>()
|
SysDept info = getOne(new LambdaQueryWrapper<SysDept>()
|
||||||
.eq(SysDept::getDeptName, dept.getDeptName())
|
.eq(SysDept::getDeptName, dept.getDeptName())
|
||||||
.eq(SysDept::getParentId, dept.getParentId())
|
.eq(SysDept::getParentId, dept.getParentId())
|
||||||
.last("limit 1"));
|
.last("and rownum <= 1"));
|
||||||
if (Validator.isNotNull(info) && info.getDeptId().longValue() != deptId.longValue()) {
|
if (Validator.isNotNull(info) && info.getDeptId().longValue() != deptId.longValue()) {
|
||||||
return UserConstants.NOT_UNIQUE;
|
return UserConstants.NOT_UNIQUE;
|
||||||
}
|
}
|
||||||
@ -239,7 +239,7 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
|
|||||||
*/
|
*/
|
||||||
public void updateDeptChildren(Long deptId, String newAncestors, String oldAncestors) {
|
public void updateDeptChildren(Long deptId, String newAncestors, String oldAncestors) {
|
||||||
List<SysDept> children = list(new LambdaQueryWrapper<SysDept>()
|
List<SysDept> children = list(new LambdaQueryWrapper<SysDept>()
|
||||||
.apply("find_in_set({0},ancestors)",deptId));
|
.apply("find_in_set({0},ancestors) <> 0",deptId));
|
||||||
for (SysDept child : children) {
|
for (SysDept child : children) {
|
||||||
child.setAncestors(child.getAncestors().replaceFirst(oldAncestors, newAncestors));
|
child.setAncestors(child.getAncestors().replaceFirst(oldAncestors, newAncestors));
|
||||||
}
|
}
|
||||||
|
@ -52,10 +52,10 @@ public class SysDictTypeServiceImpl extends ServiceImpl<SysDictTypeMapper, SysDi
|
|||||||
.eq(StrUtil.isNotBlank(dictType.getStatus()), SysDictType::getStatus, dictType.getStatus())
|
.eq(StrUtil.isNotBlank(dictType.getStatus()), SysDictType::getStatus, dictType.getStatus())
|
||||||
.like(StrUtil.isNotBlank(dictType.getDictType()), SysDictType::getDictType, dictType.getDictType())
|
.like(StrUtil.isNotBlank(dictType.getDictType()), SysDictType::getDictType, dictType.getDictType())
|
||||||
.apply(Validator.isNotEmpty(params.get("beginTime")),
|
.apply(Validator.isNotEmpty(params.get("beginTime")),
|
||||||
"date_format(create_time,'%y%m%d') >= date_format({0},'%y%m%d')",
|
"create_time >= TO_DATE({0},'yyyy-MM-dd HH24:mi:ss')",
|
||||||
params.get("beginTime"))
|
params.get("beginTime"))
|
||||||
.apply(Validator.isNotEmpty(params.get("endTime")),
|
.apply(Validator.isNotEmpty(params.get("endTime")),
|
||||||
"date_format(create_time,'%y%m%d') <= date_format({0},'%y%m%d')",
|
"create_time <= TO_DATE({0},'yyyy-MM-dd HH24:mi:ss')",
|
||||||
params.get("endTime"));
|
params.get("endTime"));
|
||||||
return PageUtils.buildDataInfo(page(PageUtils.buildPage(), lqw));
|
return PageUtils.buildDataInfo(page(PageUtils.buildPage(), lqw));
|
||||||
}
|
}
|
||||||
@ -74,10 +74,10 @@ public class SysDictTypeServiceImpl extends ServiceImpl<SysDictTypeMapper, SysDi
|
|||||||
.eq(StrUtil.isNotBlank(dictType.getStatus()), SysDictType::getStatus, dictType.getStatus())
|
.eq(StrUtil.isNotBlank(dictType.getStatus()), SysDictType::getStatus, dictType.getStatus())
|
||||||
.like(StrUtil.isNotBlank(dictType.getDictType()), SysDictType::getDictType, dictType.getDictType())
|
.like(StrUtil.isNotBlank(dictType.getDictType()), SysDictType::getDictType, dictType.getDictType())
|
||||||
.apply(Validator.isNotEmpty(params.get("beginTime")),
|
.apply(Validator.isNotEmpty(params.get("beginTime")),
|
||||||
"date_format(create_time,'%y%m%d') >= date_format({0},'%y%m%d')",
|
"create_time >= TO_DATE({0},'yyyy-MM-dd HH24:mi:ss')",
|
||||||
params.get("beginTime"))
|
params.get("beginTime"))
|
||||||
.apply(Validator.isNotEmpty(params.get("endTime")),
|
.apply(Validator.isNotEmpty(params.get("endTime")),
|
||||||
"date_format(create_time,'%y%m%d') <= date_format({0},'%y%m%d')",
|
"create_time <= TO_DATE({0},'yyyy-MM-dd HH24:mi:ss')",
|
||||||
params.get("endTime")));
|
params.get("endTime")));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -228,7 +228,7 @@ public class SysDictTypeServiceImpl extends ServiceImpl<SysDictTypeMapper, SysDi
|
|||||||
Long dictId = Validator.isNull(dict.getDictId()) ? -1L : dict.getDictId();
|
Long dictId = Validator.isNull(dict.getDictId()) ? -1L : dict.getDictId();
|
||||||
SysDictType dictType = getOne(new LambdaQueryWrapper<SysDictType>()
|
SysDictType dictType = getOne(new LambdaQueryWrapper<SysDictType>()
|
||||||
.eq(SysDictType::getDictType, dict.getDictType())
|
.eq(SysDictType::getDictType, dict.getDictType())
|
||||||
.last("limit 1"));
|
.last("and rownum <= 1"));
|
||||||
if (Validator.isNotNull(dictType) && dictType.getDictId().longValue() != dictId.longValue()) {
|
if (Validator.isNotNull(dictType) && dictType.getDictId().longValue() != dictId.longValue()) {
|
||||||
return UserConstants.NOT_UNIQUE;
|
return UserConstants.NOT_UNIQUE;
|
||||||
}
|
}
|
||||||
|
@ -32,10 +32,10 @@ public class SysLogininforServiceImpl extends ServiceImpl<SysLogininforMapper, S
|
|||||||
.eq(StrUtil.isNotBlank(logininfor.getStatus()), SysLogininfor::getStatus, logininfor.getStatus())
|
.eq(StrUtil.isNotBlank(logininfor.getStatus()), SysLogininfor::getStatus, logininfor.getStatus())
|
||||||
.like(StrUtil.isNotBlank(logininfor.getUserName()), SysLogininfor::getUserName, logininfor.getUserName())
|
.like(StrUtil.isNotBlank(logininfor.getUserName()), SysLogininfor::getUserName, logininfor.getUserName())
|
||||||
.apply(Validator.isNotEmpty(params.get("beginTime")),
|
.apply(Validator.isNotEmpty(params.get("beginTime")),
|
||||||
"date_format(login_time,'%y%m%d') >= date_format({0},'%y%m%d')",
|
"login_time >= TO_DATE({0},'yyyy-MM-dd HH24:mi:ss')",
|
||||||
params.get("beginTime"))
|
params.get("beginTime"))
|
||||||
.apply(Validator.isNotEmpty(params.get("endTime")),
|
.apply(Validator.isNotEmpty(params.get("endTime")),
|
||||||
"date_format(login_time,'%y%m%d') <= date_format({0},'%y%m%d')",
|
"login_time <= TO_DATE({0},'yyyy-MM-dd HH24:mi:ss')",
|
||||||
params.get("endTime"))
|
params.get("endTime"))
|
||||||
.orderByDesc(SysLogininfor::getInfoId);
|
.orderByDesc(SysLogininfor::getInfoId);
|
||||||
return PageUtils.buildDataInfo(page(PageUtils.buildPage(), lqw));
|
return PageUtils.buildDataInfo(page(PageUtils.buildPage(), lqw));
|
||||||
@ -66,10 +66,10 @@ public class SysLogininforServiceImpl extends ServiceImpl<SysLogininforMapper, S
|
|||||||
.eq(StrUtil.isNotBlank(logininfor.getStatus()),SysLogininfor::getStatus,logininfor.getStatus())
|
.eq(StrUtil.isNotBlank(logininfor.getStatus()),SysLogininfor::getStatus,logininfor.getStatus())
|
||||||
.like(StrUtil.isNotBlank(logininfor.getUserName()),SysLogininfor::getUserName,logininfor.getUserName())
|
.like(StrUtil.isNotBlank(logininfor.getUserName()),SysLogininfor::getUserName,logininfor.getUserName())
|
||||||
.apply(Validator.isNotEmpty(params.get("beginTime")),
|
.apply(Validator.isNotEmpty(params.get("beginTime")),
|
||||||
"date_format(login_time,'%y%m%d') >= date_format({0},'%y%m%d')",
|
"login_time >= TO_DATE({0},'yyyy-MM-dd HH24:mi:ss')",
|
||||||
params.get("beginTime"))
|
params.get("beginTime"))
|
||||||
.apply(Validator.isNotEmpty(params.get("endTime")),
|
.apply(Validator.isNotEmpty(params.get("endTime")),
|
||||||
"date_format(login_time,'%y%m%d') <= date_format({0},'%y%m%d')",
|
"login_time <= TO_DATE({0},'yyyy-MM-dd HH24:mi:ss')",
|
||||||
params.get("endTime"))
|
params.get("endTime"))
|
||||||
.orderByDesc(SysLogininfor::getInfoId));
|
.orderByDesc(SysLogininfor::getInfoId));
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ import java.util.stream.Collectors;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 菜单 业务层处理
|
* 菜单 业务层处理
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
@ -276,7 +276,7 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
|
|||||||
SysMenu info = getOne(new LambdaQueryWrapper<SysMenu>()
|
SysMenu info = getOne(new LambdaQueryWrapper<SysMenu>()
|
||||||
.eq(SysMenu::getMenuName,menu.getMenuName())
|
.eq(SysMenu::getMenuName,menu.getMenuName())
|
||||||
.eq(SysMenu::getParentId,menu.getParentId())
|
.eq(SysMenu::getParentId,menu.getParentId())
|
||||||
.last("limit 1"));
|
.last("and rownum <= 1"));
|
||||||
if (Validator.isNotNull(info) && info.getMenuId().longValue() != menuId.longValue()) {
|
if (Validator.isNotNull(info) && info.getMenuId().longValue() != menuId.longValue()) {
|
||||||
return UserConstants.NOT_UNIQUE;
|
return UserConstants.NOT_UNIQUE;
|
||||||
}
|
}
|
||||||
|
@ -41,10 +41,10 @@ public class SysOperLogServiceImpl extends ServiceImpl<SysOperLogMapper, SysOper
|
|||||||
SysOperLog::getStatus, operLog.getStatus())
|
SysOperLog::getStatus, operLog.getStatus())
|
||||||
.like(StrUtil.isNotBlank(operLog.getOperName()), SysOperLog::getOperName, operLog.getOperName())
|
.like(StrUtil.isNotBlank(operLog.getOperName()), SysOperLog::getOperName, operLog.getOperName())
|
||||||
.apply(Validator.isNotEmpty(params.get("beginTime")),
|
.apply(Validator.isNotEmpty(params.get("beginTime")),
|
||||||
"date_format(oper_time,'%y%m%d') >= date_format({0},'%y%m%d')",
|
"oper_time >= TO_DATE({0},'yyyy-MM-dd HH24:mi:ss')",
|
||||||
params.get("beginTime"))
|
params.get("beginTime"))
|
||||||
.apply(Validator.isNotEmpty(params.get("endTime")),
|
.apply(Validator.isNotEmpty(params.get("endTime")),
|
||||||
"date_format(oper_time,'%y%m%d') <= date_format({0},'%y%m%d')",
|
"oper_time <= TO_DATE({0},'yyyy-MM-dd HH24:mi:ss')",
|
||||||
params.get("endTime"))
|
params.get("endTime"))
|
||||||
.orderByDesc(SysOperLog::getOperId);
|
.orderByDesc(SysOperLog::getOperId);
|
||||||
return PageUtils.buildDataInfo(page(PageUtils.buildPage(), lqw));
|
return PageUtils.buildDataInfo(page(PageUtils.buildPage(), lqw));
|
||||||
@ -83,10 +83,10 @@ public class SysOperLogServiceImpl extends ServiceImpl<SysOperLogMapper, SysOper
|
|||||||
SysOperLog::getStatus,operLog.getStatus())
|
SysOperLog::getStatus,operLog.getStatus())
|
||||||
.like(StrUtil.isNotBlank(operLog.getOperName()),SysOperLog::getOperName,operLog.getOperName())
|
.like(StrUtil.isNotBlank(operLog.getOperName()),SysOperLog::getOperName,operLog.getOperName())
|
||||||
.apply(Validator.isNotEmpty(params.get("beginTime")),
|
.apply(Validator.isNotEmpty(params.get("beginTime")),
|
||||||
"date_format(oper_time,'%y%m%d') >= date_format({0},'%y%m%d')",
|
"oper_time >= TO_DATE({0},'yyyy-MM-dd HH24:mi:ss')",
|
||||||
params.get("beginTime"))
|
params.get("beginTime"))
|
||||||
.apply(Validator.isNotEmpty(params.get("endTime")),
|
.apply(Validator.isNotEmpty(params.get("endTime")),
|
||||||
"date_format(oper_time,'%y%m%d') <= date_format({0},'%y%m%d')",
|
"oper_time <= TO_DATE({0},'yyyy-MM-dd HH24:mi:ss')",
|
||||||
params.get("endTime"))
|
params.get("endTime"))
|
||||||
.orderByDesc(SysOperLog::getOperId));
|
.orderByDesc(SysOperLog::getOperId));
|
||||||
}
|
}
|
||||||
|
@ -95,7 +95,7 @@ public class SysPostServiceImpl extends ServiceImpl<SysPostMapper, SysPost> impl
|
|||||||
public String checkPostNameUnique(SysPost post) {
|
public String checkPostNameUnique(SysPost post) {
|
||||||
Long postId = Validator.isNull(post.getPostId()) ? -1L : post.getPostId();
|
Long postId = Validator.isNull(post.getPostId()) ? -1L : post.getPostId();
|
||||||
SysPost info = getOne(new LambdaQueryWrapper<SysPost>()
|
SysPost info = getOne(new LambdaQueryWrapper<SysPost>()
|
||||||
.eq(SysPost::getPostName, post.getPostName()).last("limit 1"));
|
.eq(SysPost::getPostName, post.getPostName()).last("and rownum <= 1"));
|
||||||
if (Validator.isNotNull(info) && info.getPostId().longValue() != postId.longValue()) {
|
if (Validator.isNotNull(info) && info.getPostId().longValue() != postId.longValue()) {
|
||||||
return UserConstants.NOT_UNIQUE;
|
return UserConstants.NOT_UNIQUE;
|
||||||
}
|
}
|
||||||
@ -112,7 +112,7 @@ public class SysPostServiceImpl extends ServiceImpl<SysPostMapper, SysPost> impl
|
|||||||
public String checkPostCodeUnique(SysPost post) {
|
public String checkPostCodeUnique(SysPost post) {
|
||||||
Long postId = Validator.isNull(post.getPostId()) ? -1L : post.getPostId();
|
Long postId = Validator.isNull(post.getPostId()) ? -1L : post.getPostId();
|
||||||
SysPost info = getOne(new LambdaQueryWrapper<SysPost>()
|
SysPost info = getOne(new LambdaQueryWrapper<SysPost>()
|
||||||
.eq(SysPost::getPostCode, post.getPostCode()).last("limit 1"));
|
.eq(SysPost::getPostCode, post.getPostCode()).last("and rownum <= 1"));
|
||||||
if (Validator.isNotNull(info) && info.getPostId().longValue() != postId.longValue()) {
|
if (Validator.isNotNull(info) && info.getPostId().longValue() != postId.longValue()) {
|
||||||
return UserConstants.NOT_UNIQUE;
|
return UserConstants.NOT_UNIQUE;
|
||||||
}
|
}
|
||||||
|
@ -119,7 +119,7 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
|
|||||||
public String checkRoleNameUnique(SysRole role) {
|
public String checkRoleNameUnique(SysRole role) {
|
||||||
Long roleId = Validator.isNull(role.getRoleId()) ? -1L : role.getRoleId();
|
Long roleId = Validator.isNull(role.getRoleId()) ? -1L : role.getRoleId();
|
||||||
SysRole info = getOne(new LambdaQueryWrapper<SysRole>()
|
SysRole info = getOne(new LambdaQueryWrapper<SysRole>()
|
||||||
.eq(SysRole::getRoleName, role.getRoleName()).last("limit 1"));
|
.eq(SysRole::getRoleName, role.getRoleName()).last("and rownum <= 1"));
|
||||||
if (Validator.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue()) {
|
if (Validator.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue()) {
|
||||||
return UserConstants.NOT_UNIQUE;
|
return UserConstants.NOT_UNIQUE;
|
||||||
}
|
}
|
||||||
@ -136,7 +136,7 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
|
|||||||
public String checkRoleKeyUnique(SysRole role) {
|
public String checkRoleKeyUnique(SysRole role) {
|
||||||
Long roleId = Validator.isNull(role.getRoleId()) ? -1L : role.getRoleId();
|
Long roleId = Validator.isNull(role.getRoleId()) ? -1L : role.getRoleId();
|
||||||
SysRole info = getOne(new LambdaQueryWrapper<SysRole>()
|
SysRole info = getOne(new LambdaQueryWrapper<SysRole>()
|
||||||
.eq(SysRole::getRoleKey, role.getRoleKey()).last("limit 1"));
|
.eq(SysRole::getRoleKey, role.getRoleKey()).last("and rownum <= 1"));
|
||||||
if (Validator.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue()) {
|
if (Validator.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue()) {
|
||||||
return UserConstants.NOT_UNIQUE;
|
return UserConstants.NOT_UNIQUE;
|
||||||
}
|
}
|
||||||
|
@ -137,7 +137,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String checkUserNameUnique(String userName) {
|
public String checkUserNameUnique(String userName) {
|
||||||
int count = count(new LambdaQueryWrapper<SysUser>().eq(SysUser::getUserName, userName).last("limit 1"));
|
int count = count(new LambdaQueryWrapper<SysUser>().eq(SysUser::getUserName, userName).last("and rownum <= 1"));
|
||||||
if (count > 0) {
|
if (count > 0) {
|
||||||
return UserConstants.NOT_UNIQUE;
|
return UserConstants.NOT_UNIQUE;
|
||||||
}
|
}
|
||||||
@ -155,7 +155,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
|||||||
Long userId = Validator.isNull(user.getUserId()) ? -1L : user.getUserId();
|
Long userId = Validator.isNull(user.getUserId()) ? -1L : user.getUserId();
|
||||||
SysUser info = getOne(new LambdaQueryWrapper<SysUser>()
|
SysUser info = getOne(new LambdaQueryWrapper<SysUser>()
|
||||||
.select(SysUser::getUserId, SysUser::getPhonenumber)
|
.select(SysUser::getUserId, SysUser::getPhonenumber)
|
||||||
.eq(SysUser::getPhonenumber, user.getPhonenumber()).last("limit 1"));
|
.eq(SysUser::getPhonenumber, user.getPhonenumber()).last("and rownum <= 1"));
|
||||||
if (Validator.isNotNull(info) && info.getUserId().longValue() != userId.longValue()) {
|
if (Validator.isNotNull(info) && info.getUserId().longValue() != userId.longValue()) {
|
||||||
return UserConstants.NOT_UNIQUE;
|
return UserConstants.NOT_UNIQUE;
|
||||||
}
|
}
|
||||||
@ -173,7 +173,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
|||||||
Long userId = Validator.isNull(user.getUserId()) ? -1L : user.getUserId();
|
Long userId = Validator.isNull(user.getUserId()) ? -1L : user.getUserId();
|
||||||
SysUser info = getOne(new LambdaQueryWrapper<SysUser>()
|
SysUser info = getOne(new LambdaQueryWrapper<SysUser>()
|
||||||
.select(SysUser::getUserId, SysUser::getEmail)
|
.select(SysUser::getUserId, SysUser::getEmail)
|
||||||
.eq(SysUser::getEmail, user.getEmail()).last("limit 1"));
|
.eq(SysUser::getEmail, user.getEmail()).last("and rownum <= 1"));
|
||||||
if (Validator.isNotNull(info) && info.getUserId().longValue() != userId.longValue()) {
|
if (Validator.isNotNull(info) && info.getUserId().longValue() != userId.longValue()) {
|
||||||
return UserConstants.NOT_UNIQUE;
|
return UserConstants.NOT_UNIQUE;
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
AND parent_id = #{parentId}
|
AND parent_id = #{parentId}
|
||||||
</if>
|
</if>
|
||||||
<if test="deptName != null and deptName != ''">
|
<if test="deptName != null and deptName != ''">
|
||||||
AND dept_name like concat('%', #{deptName}, '%')
|
AND dept_name like concat(concat('%', #{deptName}), '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="status != null and status != ''">
|
<if test="status != null and status != ''">
|
||||||
AND status = #{status}
|
AND status = #{status}
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
menu_type,
|
menu_type,
|
||||||
visible,
|
visible,
|
||||||
status,
|
status,
|
||||||
ifnull(perms, '') as perms,
|
nvl(perms, '') as perms,
|
||||||
icon,
|
icon,
|
||||||
create_time
|
create_time
|
||||||
from sys_menu
|
from sys_menu
|
||||||
@ -53,7 +53,7 @@
|
|||||||
m.component,
|
m.component,
|
||||||
m.visible,
|
m.visible,
|
||||||
m.status,
|
m.status,
|
||||||
ifnull(m.perms, '') as perms,
|
nvl(m.perms, '') as perms,
|
||||||
m.is_frame,
|
m.is_frame,
|
||||||
m.is_cache,
|
m.is_cache,
|
||||||
m.menu_type,
|
m.menu_type,
|
||||||
@ -68,14 +68,14 @@
|
|||||||
|
|
||||||
<select id="selectMenuListByUserId" parameterType="SysMenu" resultMap="SysMenuResult">
|
<select id="selectMenuListByUserId" parameterType="SysMenu" resultMap="SysMenuResult">
|
||||||
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.visible, m.status,
|
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, 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
|
nvl(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
|
from sys_menu m
|
||||||
left join sys_role_menu rm on m.menu_id = rm.menu_id
|
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
|
left join sys_user_role ur on rm.role_id = ur.role_id
|
||||||
left join sys_role ro on ur.role_id = ro.role_id
|
left join sys_role ro on ur.role_id = ro.role_id
|
||||||
where ur.user_id = #{params.userId}
|
where ur.user_id = #{params.userId}
|
||||||
<if test="menuName != null and menuName != ''">
|
<if test="menuName != null and menuName != ''">
|
||||||
AND menu_name like concat('%', #{menuName}, '%')
|
AND menu_name like concat(concat('%', #{menuName}), '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="visible != null and visible != ''">
|
<if test="visible != null and visible != ''">
|
||||||
AND visible = #{visible}
|
AND visible = #{visible}
|
||||||
@ -94,7 +94,7 @@
|
|||||||
m.component,
|
m.component,
|
||||||
m.visible,
|
m.visible,
|
||||||
m.status,
|
m.status,
|
||||||
ifnull(m.perms, '') as perms,
|
nvl(m.perms, '') as perms,
|
||||||
m.is_frame,
|
m.is_frame,
|
||||||
m.is_cache,
|
m.is_cache,
|
||||||
m.menu_type,
|
m.menu_type,
|
||||||
@ -143,4 +143,4 @@
|
|||||||
and ur.user_id = #{userId}
|
and ur.user_id = #{userId}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
@ -10,10 +10,17 @@
|
|||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<insert id="batchRoleDept">
|
<insert id="batchRoleDept">
|
||||||
insert into sys_role_dept(role_id, dept_id) values
|
insert all
|
||||||
<foreach item="item" index="index" collection="list" separator=",">
|
<foreach item="item" index="index" collection="list">
|
||||||
(#{item.roleId},#{item.deptId})
|
into
|
||||||
</foreach>
|
sys_role_dept(role_id, dept_id)
|
||||||
|
values
|
||||||
|
(
|
||||||
|
#{item.roleId},
|
||||||
|
#{item.deptId}
|
||||||
|
)
|
||||||
|
</foreach>
|
||||||
|
SELECT 1 FROM DUAL
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
@ -43,19 +43,19 @@
|
|||||||
<include refid="selectRoleVo"/>
|
<include refid="selectRoleVo"/>
|
||||||
where r.del_flag = '0'
|
where r.del_flag = '0'
|
||||||
<if test="role.roleName != null and role.roleName != ''">
|
<if test="role.roleName != null and role.roleName != ''">
|
||||||
AND r.role_name like concat('%', #{role.roleName}, '%')
|
AND r.role_name like concat(concat('%', #{role.roleName}), '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="role.status != null and role.status != ''">
|
<if test="role.status != null and role.status != ''">
|
||||||
AND r.status = #{role.status}
|
AND r.status = #{role.status}
|
||||||
</if>
|
</if>
|
||||||
<if test="role.roleKey != null and role.roleKey != ''">
|
<if test="role.roleKey != null and role.roleKey != ''">
|
||||||
AND r.role_key like concat('%', #{role.roleKey}, '%')
|
AND r.role_key like concat(concat('%', #{role.roleKey}), '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="role.params.beginTime != null and role.params.beginTime != ''"><!-- 开始时间检索 -->
|
<if test="role.params.beginTime != null and role.params.beginTime != ''"><!-- 开始时间检索 -->
|
||||||
and date_format(r.create_time,'%y%m%d') >= date_format(#{role.params.beginTime},'%y%m%d')
|
and r.create_time >= to_date(#{role.params.beginTime},'yyyy-MM-dd HH24:mi:ss')
|
||||||
</if>
|
</if>
|
||||||
<if test="role.params.endTime != null and role.params.endTime != ''"><!-- 结束时间检索 -->
|
<if test="role.params.endTime != null and role.params.endTime != ''"><!-- 结束时间检索 -->
|
||||||
and date_format(r.create_time,'%y%m%d') <= date_format(#{role.params.endTime},'%y%m%d')
|
and r.create_time <= to_date(#{role.params.endTime},'yyyy-MM-dd HH24:mi:ss')
|
||||||
</if>
|
</if>
|
||||||
<!-- 数据范围过滤 -->
|
<!-- 数据范围过滤 -->
|
||||||
<if test="role.params.dataScope != null and role.params.dataScope != ''">
|
<if test="role.params.dataScope != null and role.params.dataScope != ''">
|
||||||
@ -68,19 +68,19 @@
|
|||||||
<include refid="selectRoleVo"/>
|
<include refid="selectRoleVo"/>
|
||||||
where r.del_flag = '0'
|
where r.del_flag = '0'
|
||||||
<if test="roleName != null and roleName != ''">
|
<if test="roleName != null and roleName != ''">
|
||||||
AND r.role_name like concat('%', #{roleName}, '%')
|
AND r.role_name like concat(concat('%', #{roleName}), '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="status != null and status != ''">
|
<if test="status != null and status != ''">
|
||||||
AND r.status = #{status}
|
AND r.status = #{status}
|
||||||
</if>
|
</if>
|
||||||
<if test="roleKey != null and roleKey != ''">
|
<if test="roleKey != null and roleKey != ''">
|
||||||
AND r.role_key like concat('%', #{roleKey}, '%')
|
AND r.role_key like concat(concat('%', #{roleKey}), '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
||||||
and date_format(r.create_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d')
|
and r.create_time >= to_date(#{params.beginTime},'yyyy-MM-dd HH24:mi:ss')
|
||||||
</if>
|
</if>
|
||||||
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
||||||
and date_format(r.create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d')
|
and r.create_time <= to_date(#{params.endTime},'yyyy-MM-dd HH24:mi:ss')
|
||||||
</if>
|
</if>
|
||||||
<!-- 数据范围过滤 -->
|
<!-- 数据范围过滤 -->
|
||||||
<if test="params.dataScope != null and params.dataScope != ''">
|
<if test="params.dataScope != null and params.dataScope != ''">
|
||||||
|
@ -10,10 +10,17 @@
|
|||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<insert id="batchRoleMenu">
|
<insert id="batchRoleMenu">
|
||||||
insert into sys_role_menu(role_id, menu_id) values
|
insert all
|
||||||
<foreach item="item" index="index" collection="list" separator=",">
|
<foreach item="item" index="index" collection="list">
|
||||||
(#{item.roleId},#{item.menuId})
|
into
|
||||||
</foreach>
|
sys_role_menu(role_id, menu_id)
|
||||||
|
values
|
||||||
|
(
|
||||||
|
#{item.roleId},
|
||||||
|
#{item.menuId}
|
||||||
|
)
|
||||||
|
</foreach>
|
||||||
|
SELECT 1 FROM DUAL
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
@ -87,23 +87,23 @@
|
|||||||
left join sys_dept d on u.dept_id = d.dept_id
|
left join sys_dept d on u.dept_id = d.dept_id
|
||||||
where u.del_flag = '0'
|
where u.del_flag = '0'
|
||||||
<if test="user.userName != null and user.userName != ''">
|
<if test="user.userName != null and user.userName != ''">
|
||||||
AND u.user_name like concat('%', #{user.userName}, '%')
|
AND u.user_name like concat(concat('%', #{user.userName}), '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="user.status != null and user.status != ''">
|
<if test="user.status != null and user.status != ''">
|
||||||
AND u.status = #{user.status}
|
AND u.status = #{user.status}
|
||||||
</if>
|
</if>
|
||||||
<if test="user.phonenumber != null and user.phonenumber != ''">
|
<if test="user.phonenumber != null and user.phonenumber != ''">
|
||||||
AND u.phonenumber like concat('%', #{user.phonenumber}, '%')
|
AND u.phonenumber like concat(concat('%',#{user.phonenumber}),'%')
|
||||||
</if>
|
</if>
|
||||||
<if test="user.params.beginTime != null and user.params.beginTime != ''"><!-- 开始时间检索 -->
|
<if test="user.params.beginTime != null and user.params.beginTime != ''"><!-- 开始时间检索 -->
|
||||||
AND date_format(u.create_time,'%y%m%d') >= date_format(#{user.params.beginTime},'%y%m%d')
|
AND u.create_time >= to_date(#{user.params.beginTime},'yyyy-MM-dd HH24:mi:ss')
|
||||||
</if>
|
</if>
|
||||||
<if test="user.params.endTime != null and user.params.endTime != ''"><!-- 结束时间检索 -->
|
<if test="user.params.endTime != null and user.params.endTime != ''"><!-- 结束时间检索 -->
|
||||||
AND date_format(u.create_time,'%y%m%d') <= date_format(#{user.params.endTime},'%y%m%d')
|
AND u.create_time <= to_date(#{user.params.endTime},'yyyy-MM-dd HH24:mi:ss')
|
||||||
</if>
|
</if>
|
||||||
<if test="user.deptId != null and user.deptId != 0">
|
<if test="user.deptId != null and user.deptId != 0">
|
||||||
AND (u.dept_id = #{user.deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{user.deptId},
|
AND (u.dept_id = #{user.deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{user.deptId},
|
||||||
ancestors) ))
|
ancestors) <![CDATA[ <> ]]> 0 ))
|
||||||
</if>
|
</if>
|
||||||
<!-- 数据范围过滤 -->
|
<!-- 数据范围过滤 -->
|
||||||
<if test="user.params.dataScope != null and user.params.dataScope != ''">
|
<if test="user.params.dataScope != null and user.params.dataScope != ''">
|
||||||
@ -118,23 +118,23 @@
|
|||||||
left join sys_dept d on u.dept_id = d.dept_id
|
left join sys_dept d on u.dept_id = d.dept_id
|
||||||
where u.del_flag = '0'
|
where u.del_flag = '0'
|
||||||
<if test="userName != null and userName != ''">
|
<if test="userName != null and userName != ''">
|
||||||
AND u.user_name like concat('%', #{userName}, '%')
|
AND u.user_name like concat(concat('%', #{userName}), '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="status != null and status != ''">
|
<if test="status != null and status != ''">
|
||||||
AND u.status = #{status}
|
AND u.status = #{status}
|
||||||
</if>
|
</if>
|
||||||
<if test="phonenumber != null and phonenumber != ''">
|
<if test="phonenumber != null and phonenumber != ''">
|
||||||
AND u.phonenumber like concat('%', #{phonenumber}, '%')
|
AND u.phonenumber like concat(concat('%',#{phonenumber}),'%')
|
||||||
</if>
|
</if>
|
||||||
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
||||||
AND date_format(u.create_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d')
|
AND u.create_time >= to_date(#{params.beginTime},'yyyy-MM-dd HH24:mi:ss')
|
||||||
</if>
|
</if>
|
||||||
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
||||||
AND date_format(u.create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d')
|
AND u.create_time <= to_date(#{params.endTime},'yyyy-MM-dd HH24:mi:ss')
|
||||||
</if>
|
</if>
|
||||||
<if test="deptId != null and deptId != 0">
|
<if test="deptId != null and deptId != 0">
|
||||||
AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId},
|
AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId},
|
||||||
ancestors) ))
|
ancestors) <![CDATA[ <> ]]> 0 ))
|
||||||
</if>
|
</if>
|
||||||
<!-- 数据范围过滤 -->
|
<!-- 数据范围过滤 -->
|
||||||
<if test="params.dataScope != null and params.dataScope != ''">
|
<if test="params.dataScope != null and params.dataScope != ''">
|
||||||
|
@ -10,10 +10,17 @@
|
|||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<insert id="batchUserPost">
|
<insert id="batchUserPost">
|
||||||
insert into sys_user_post(user_id, post_id) values
|
insert all
|
||||||
<foreach item="item" index="index" collection="list" separator=",">
|
<foreach item="item" index="index" collection="list" >
|
||||||
(#{item.userId},#{item.postId})
|
into
|
||||||
</foreach>
|
sys_user_post(user_id, post_id)
|
||||||
|
values
|
||||||
|
(
|
||||||
|
#{item.userId},
|
||||||
|
#{item.postId}
|
||||||
|
)
|
||||||
|
</foreach>
|
||||||
|
SELECT 1 FROM DUAL
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
@ -10,10 +10,17 @@
|
|||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<insert id="batchUserRole">
|
<insert id="batchUserRole">
|
||||||
insert into sys_user_role(user_id, role_id) values
|
insert all
|
||||||
<foreach item="item" index="index" collection="list" separator=",">
|
<foreach item="item" index="index" collection="list">
|
||||||
(#{item.userId},#{item.roleId})
|
into
|
||||||
</foreach>
|
sys_user_role(user_id, role_id)
|
||||||
|
values
|
||||||
|
(
|
||||||
|
#{item.userId},
|
||||||
|
#{item.roleId}
|
||||||
|
)
|
||||||
|
</foreach>
|
||||||
|
SELECT 1 FROM DUAL
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
Loading…
Reference in New Issue
Block a user