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>
|
||||
</dependency>
|
||||
|
||||
<!--oracle驱动-->
|
||||
<dependency>
|
||||
<groupId>com.oracle</groupId>
|
||||
<artifactId>ojdbc6</artifactId>
|
||||
<version>11.2.0.3</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- 核心模块-->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
|
@ -146,6 +146,7 @@ mybatis-plus:
|
||||
localCacheScope: SESSION
|
||||
# 开启Mybatis二级缓存,默认为 true
|
||||
cacheEnabled: true
|
||||
jdbc-type-for-null: 'null'
|
||||
global-config:
|
||||
# 是否打印 Logo banner
|
||||
banner: true
|
||||
|
@ -22,12 +22,13 @@ import java.util.*;
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@TableName("sys_dept")
|
||||
@KeySequence(value = "seq_sys_dept")
|
||||
public class SysDept implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 部门ID */
|
||||
@TableId(value = "dept_id",type = IdType.AUTO)
|
||||
@TableId(value = "dept_id",type = IdType.INPUT)
|
||||
private Long deptId;
|
||||
|
||||
/** 父部门ID */
|
||||
|
@ -26,13 +26,14 @@ import java.util.Map;
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@TableName("sys_dict_data")
|
||||
@KeySequence(value = "seq_sys_dict_data")
|
||||
public class SysDictData implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 字典编码 */
|
||||
@Excel(name = "字典编码", cellType = ColumnType.NUMERIC)
|
||||
@TableId(value = "dict_code",type = IdType.AUTO)
|
||||
@TableId(value = "dict_code",type = IdType.INPUT)
|
||||
private Long dictCode;
|
||||
|
||||
/** 字典排序 */
|
||||
|
@ -25,13 +25,14 @@ import java.util.Map;
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@TableName("sys_dict_type")
|
||||
@KeySequence(value = "seq_sys_dict_type")
|
||||
public class SysDictType implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 字典主键 */
|
||||
@Excel(name = "字典主键", cellType = ColumnType.NUMERIC)
|
||||
@TableId(value = "dict_id",type = IdType.AUTO)
|
||||
@TableId(value = "dict_id",type = IdType.INPUT)
|
||||
private Long dictId;
|
||||
|
||||
/** 字典名称 */
|
||||
|
@ -21,12 +21,13 @@ import java.util.*;
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@TableName("sys_menu")
|
||||
@KeySequence(value = "seq_sys_menu")
|
||||
public class SysMenu implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 菜单ID */
|
||||
@TableId(value = "menu_id",type = IdType.AUTO)
|
||||
@TableId(value = "menu_id",type = IdType.INPUT)
|
||||
private Long menuId;
|
||||
|
||||
/** 菜单名称 */
|
||||
|
@ -25,13 +25,14 @@ import java.util.Map;
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@TableName("sys_role")
|
||||
@KeySequence(value = "seq_sys_role")
|
||||
public class SysRole implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 角色ID */
|
||||
@Excel(name = "角色序号", cellType = ColumnType.NUMERIC)
|
||||
@TableId(value = "role_id",type = IdType.AUTO)
|
||||
@TableId(value = "role_id",type = IdType.INPUT)
|
||||
private Long roleId;
|
||||
|
||||
/** 角色名称 */
|
||||
|
@ -31,13 +31,14 @@ import java.util.Map;
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@TableName("sys_user")
|
||||
@KeySequence(value = "seq_sys_user")
|
||||
public class SysUser implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 用户ID */
|
||||
@Excel(name = "用户序号", cellType = ColumnType.NUMERIC, prompt = "用户编号")
|
||||
@TableId(value = "user_id",type = IdType.AUTO)
|
||||
@TableId(value = "user_id",type = IdType.INPUT)
|
||||
private Long userId;
|
||||
|
||||
/** 部门ID */
|
||||
|
@ -107,7 +107,7 @@ public interface IServicePlus<T> extends IService<T> {
|
||||
|
||||
/**
|
||||
* 根据 Wrapper,查询一条记录 <br/>
|
||||
* <p>结果集,如果是多个会抛出异常,随机取一条加上限制条件 wrapper.last("LIMIT 1")</p>
|
||||
* <p>结果集,如果是多个会抛出异常,随机取一条加上限制条件 wrapper.last("and rownum <= 1")</p>
|
||||
*
|
||||
* @param kClass vo类型
|
||||
* @param queryWrapper 实体对象封装操作类 {@link com.baomidou.mybatisplus.core.conditions.query.QueryWrapper}
|
||||
@ -118,7 +118,7 @@ public interface IServicePlus<T> extends IService<T> {
|
||||
|
||||
/**
|
||||
* 根据 Wrapper,查询一条记录 <br/>
|
||||
* <p>结果集,如果是多个会抛出异常,随机取一条加上限制条件 wrapper.last("LIMIT 1")</p>
|
||||
* <p>结果集,如果是多个会抛出异常,随机取一条加上限制条件 wrapper.last("and rownum <= 1")</p>
|
||||
*
|
||||
* @param convertor 转换函数
|
||||
* @param queryWrapper 实体对象封装操作类 {@link com.baomidou.mybatisplus.core.conditions.query.QueryWrapper}
|
||||
|
@ -117,7 +117,7 @@ public class DataScopeAspect {
|
||||
deptAlias, user.getDeptId()));
|
||||
} else if (DATA_SCOPE_DEPT_AND_CHILD.equals(dataScope)) {
|
||||
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()));
|
||||
} else if (DATA_SCOPE_SELF.equals(dataScope)) {
|
||||
if (isUser) {
|
||||
|
@ -2,6 +2,7 @@ package com.ruoyi.framework.config;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.DbType;
|
||||
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.inner.OptimisticLockerInnerInterceptor;
|
||||
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
|
||||
@ -41,7 +42,7 @@ public class MybatisPlusConfig {
|
||||
public PaginationInnerInterceptor paginationInnerInterceptor() {
|
||||
PaginationInnerInterceptor paginationInnerInterceptor = new PaginationInnerInterceptor();
|
||||
// 设置数据库类型为mysql
|
||||
paginationInnerInterceptor.setDbType(DbType.MYSQL);
|
||||
paginationInnerInterceptor.setDbType(DbType.ORACLE);
|
||||
// 设置最大单页限制数量,默认 500 条,-1 不受限制
|
||||
paginationInnerInterceptor.setMaxLimit(-1L);
|
||||
return paginationInnerInterceptor;
|
||||
@ -106,4 +107,15 @@ public class MybatisPlusConfig {
|
||||
* 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;
|
||||
|
||||
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
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Configuration
|
||||
public class ScheduleConfig {
|
||||
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
|
||||
@Accessors(chain = true)
|
||||
@TableName("sys_job")
|
||||
@KeySequence(value = "seq_sys_job")
|
||||
public class SysJob implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ -35,7 +36,7 @@ public class SysJob implements Serializable {
|
||||
* 任务ID
|
||||
*/
|
||||
@Excel(name = "任务序号", cellType = ColumnType.NUMERIC)
|
||||
@TableId(value = "job_id", type = IdType.AUTO)
|
||||
@TableId(value = "job_id", type = IdType.INPUT)
|
||||
private Long jobId;
|
||||
|
||||
/**
|
||||
|
@ -21,13 +21,13 @@ import java.util.Map;
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@TableName("sys_job_log")
|
||||
public class SysJobLog
|
||||
{
|
||||
@KeySequence(value = "seq_sys_job_log")
|
||||
public class SysJobLog {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** ID */
|
||||
@Excel(name = "日志序号")
|
||||
@TableId(value = "job_log_id", type = IdType.AUTO)
|
||||
@TableId(value = "job_log_id", type = IdType.INPUT)
|
||||
private Long jobLogId;
|
||||
|
||||
/** 任务名称 */
|
||||
|
@ -32,10 +32,10 @@ public class SysJobLogServiceImpl extends ServiceImpl<SysJobLogMapper, SysJobLog
|
||||
.eq(StrUtil.isNotBlank(jobLog.getStatus()), SysJobLog::getStatus, jobLog.getStatus())
|
||||
.like(StrUtil.isNotBlank(jobLog.getInvokeTarget()), SysJobLog::getInvokeTarget, jobLog.getInvokeTarget())
|
||||
.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"))
|
||||
.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"));
|
||||
return PageUtils.buildDataInfo(page(PageUtils.buildPage(), lqw));
|
||||
}
|
||||
@ -55,10 +55,10 @@ public class SysJobLogServiceImpl extends ServiceImpl<SysJobLogMapper, SysJobLog
|
||||
.eq(StrUtil.isNotBlank(jobLog.getStatus()), SysJobLog::getStatus, jobLog.getStatus())
|
||||
.like(StrUtil.isNotBlank(jobLog.getInvokeTarget()), SysJobLog::getInvokeTarget, jobLog.getInvokeTarget())
|
||||
.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"))
|
||||
.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")));
|
||||
}
|
||||
|
||||
|
@ -25,6 +25,7 @@ import java.util.Map;
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@TableName("sys_config")
|
||||
@KeySequence(value = "seq_sys_config")
|
||||
public class SysConfig implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ -32,7 +33,7 @@ public class SysConfig implements Serializable {
|
||||
* 参数主键
|
||||
*/
|
||||
@Excel(name = "参数主键", cellType = ColumnType.NUMERIC)
|
||||
@TableId(value = "config_id", type = IdType.AUTO)
|
||||
@TableId(value = "config_id", type = IdType.INPUT)
|
||||
private Long configId;
|
||||
|
||||
/**
|
||||
|
@ -1,9 +1,6 @@
|
||||
package com.ruoyi.system.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.annotation.Excel.ColumnType;
|
||||
@ -26,6 +23,7 @@ import java.util.Map;
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@TableName("sys_logininfor")
|
||||
@KeySequence(value = "seq_sys_logininfor")
|
||||
public class SysLogininfor implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ -33,7 +31,7 @@ public class SysLogininfor implements Serializable {
|
||||
* ID
|
||||
*/
|
||||
@Excel(name = "序号", cellType = ColumnType.NUMERIC)
|
||||
@TableId(value = "info_id", type = IdType.AUTO)
|
||||
@TableId(value = "info_id", type = IdType.INPUT)
|
||||
private Long infoId;
|
||||
|
||||
/**
|
||||
|
@ -22,13 +22,14 @@ import java.util.Map;
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@TableName("sys_notice")
|
||||
@KeySequence(value = "seq_sys_notice")
|
||||
public class SysNotice implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 公告ID
|
||||
*/
|
||||
@TableId(value = "notice_id", type = IdType.AUTO)
|
||||
@TableId(value = "notice_id", type = IdType.INPUT)
|
||||
private Long noticeId;
|
||||
|
||||
/**
|
||||
|
@ -1,9 +1,6 @@
|
||||
package com.ruoyi.system.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.annotation.Excel.ColumnType;
|
||||
@ -26,6 +23,7 @@ import java.util.Map;
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@TableName("sys_oper_log")
|
||||
@KeySequence(value = "seq_sys_oper_log")
|
||||
public class SysOperLog implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ -33,7 +31,7 @@ public class SysOperLog implements Serializable {
|
||||
* 日志主键
|
||||
*/
|
||||
@Excel(name = "操作序号", cellType = ColumnType.NUMERIC)
|
||||
@TableId(value = "oper_id", type = IdType.AUTO)
|
||||
@TableId(value = "oper_id", type = IdType.INPUT)
|
||||
private Long operId;
|
||||
|
||||
/**
|
||||
|
@ -25,6 +25,7 @@ import java.util.Map;
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@TableName("sys_post")
|
||||
@KeySequence(value = "seq_sys_post")
|
||||
public class SysPost implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ -32,7 +33,7 @@ public class SysPost implements Serializable {
|
||||
* 岗位序号
|
||||
*/
|
||||
@Excel(name = "岗位序号", cellType = ColumnType.NUMERIC)
|
||||
@TableId(value = "post_id", type = IdType.AUTO)
|
||||
@TableId(value = "post_id", type = IdType.INPUT)
|
||||
private Long postId;
|
||||
|
||||
/**
|
||||
|
@ -52,10 +52,10 @@ public class SysConfigServiceImpl extends ServiceImpl<SysConfigMapper, SysConfig
|
||||
.eq(StrUtil.isNotBlank(config.getConfigType()), SysConfig::getConfigType, config.getConfigType())
|
||||
.like(StrUtil.isNotBlank(config.getConfigKey()), SysConfig::getConfigKey, config.getConfigKey())
|
||||
.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"))
|
||||
.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"));
|
||||
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())
|
||||
.like(StrUtil.isNotBlank(config.getConfigKey()), SysConfig::getConfigKey, config.getConfigKey())
|
||||
.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"))
|
||||
.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"));
|
||||
return baseMapper.selectList(lqw);
|
||||
}
|
||||
|
@ -123,7 +123,7 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
|
||||
public int selectNormalChildrenDeptById(Long deptId) {
|
||||
return count(new LambdaQueryWrapper<SysDept>()
|
||||
.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) {
|
||||
int result = count(new LambdaQueryWrapper<SysDept>()
|
||||
.eq(SysDept::getParentId, deptId)
|
||||
.last("limit 1"));
|
||||
.last("and rownum <= 1"));
|
||||
return result > 0 ? true : false;
|
||||
}
|
||||
|
||||
@ -165,7 +165,7 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
|
||||
SysDept info = getOne(new LambdaQueryWrapper<SysDept>()
|
||||
.eq(SysDept::getDeptName, dept.getDeptName())
|
||||
.eq(SysDept::getParentId, dept.getParentId())
|
||||
.last("limit 1"));
|
||||
.last("and rownum <= 1"));
|
||||
if (Validator.isNotNull(info) && info.getDeptId().longValue() != deptId.longValue()) {
|
||||
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) {
|
||||
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) {
|
||||
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())
|
||||
.like(StrUtil.isNotBlank(dictType.getDictType()), SysDictType::getDictType, dictType.getDictType())
|
||||
.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"))
|
||||
.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"));
|
||||
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())
|
||||
.like(StrUtil.isNotBlank(dictType.getDictType()), SysDictType::getDictType, dictType.getDictType())
|
||||
.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"))
|
||||
.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")));
|
||||
}
|
||||
|
||||
@ -228,7 +228,7 @@ public class SysDictTypeServiceImpl extends ServiceImpl<SysDictTypeMapper, SysDi
|
||||
Long dictId = Validator.isNull(dict.getDictId()) ? -1L : dict.getDictId();
|
||||
SysDictType dictType = getOne(new LambdaQueryWrapper<SysDictType>()
|
||||
.eq(SysDictType::getDictType, dict.getDictType())
|
||||
.last("limit 1"));
|
||||
.last("and rownum <= 1"));
|
||||
if (Validator.isNotNull(dictType) && dictType.getDictId().longValue() != dictId.longValue()) {
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
|
@ -32,10 +32,10 @@ public class SysLogininforServiceImpl extends ServiceImpl<SysLogininforMapper, S
|
||||
.eq(StrUtil.isNotBlank(logininfor.getStatus()), SysLogininfor::getStatus, logininfor.getStatus())
|
||||
.like(StrUtil.isNotBlank(logininfor.getUserName()), SysLogininfor::getUserName, logininfor.getUserName())
|
||||
.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"))
|
||||
.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"))
|
||||
.orderByDesc(SysLogininfor::getInfoId);
|
||||
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())
|
||||
.like(StrUtil.isNotBlank(logininfor.getUserName()),SysLogininfor::getUserName,logininfor.getUserName())
|
||||
.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"))
|
||||
.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"))
|
||||
.orderByDesc(SysLogininfor::getInfoId));
|
||||
}
|
||||
|
@ -276,7 +276,7 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
|
||||
SysMenu info = getOne(new LambdaQueryWrapper<SysMenu>()
|
||||
.eq(SysMenu::getMenuName,menu.getMenuName())
|
||||
.eq(SysMenu::getParentId,menu.getParentId())
|
||||
.last("limit 1"));
|
||||
.last("and rownum <= 1"));
|
||||
if (Validator.isNotNull(info) && info.getMenuId().longValue() != menuId.longValue()) {
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
|
@ -41,10 +41,10 @@ public class SysOperLogServiceImpl extends ServiceImpl<SysOperLogMapper, SysOper
|
||||
SysOperLog::getStatus, operLog.getStatus())
|
||||
.like(StrUtil.isNotBlank(operLog.getOperName()), SysOperLog::getOperName, operLog.getOperName())
|
||||
.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"))
|
||||
.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"))
|
||||
.orderByDesc(SysOperLog::getOperId);
|
||||
return PageUtils.buildDataInfo(page(PageUtils.buildPage(), lqw));
|
||||
@ -83,10 +83,10 @@ public class SysOperLogServiceImpl extends ServiceImpl<SysOperLogMapper, SysOper
|
||||
SysOperLog::getStatus,operLog.getStatus())
|
||||
.like(StrUtil.isNotBlank(operLog.getOperName()),SysOperLog::getOperName,operLog.getOperName())
|
||||
.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"))
|
||||
.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"))
|
||||
.orderByDesc(SysOperLog::getOperId));
|
||||
}
|
||||
|
@ -95,7 +95,7 @@ public class SysPostServiceImpl extends ServiceImpl<SysPostMapper, SysPost> impl
|
||||
public String checkPostNameUnique(SysPost post) {
|
||||
Long postId = Validator.isNull(post.getPostId()) ? -1L : post.getPostId();
|
||||
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()) {
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
@ -112,7 +112,7 @@ public class SysPostServiceImpl extends ServiceImpl<SysPostMapper, SysPost> impl
|
||||
public String checkPostCodeUnique(SysPost post) {
|
||||
Long postId = Validator.isNull(post.getPostId()) ? -1L : post.getPostId();
|
||||
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()) {
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
|
@ -119,7 +119,7 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
|
||||
public String checkRoleNameUnique(SysRole role) {
|
||||
Long roleId = Validator.isNull(role.getRoleId()) ? -1L : role.getRoleId();
|
||||
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()) {
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
@ -136,7 +136,7 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
|
||||
public String checkRoleKeyUnique(SysRole role) {
|
||||
Long roleId = Validator.isNull(role.getRoleId()) ? -1L : role.getRoleId();
|
||||
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()) {
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
|
@ -137,7 +137,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||
*/
|
||||
@Override
|
||||
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) {
|
||||
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();
|
||||
SysUser info = getOne(new LambdaQueryWrapper<SysUser>()
|
||||
.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()) {
|
||||
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();
|
||||
SysUser info = getOne(new LambdaQueryWrapper<SysUser>()
|
||||
.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()) {
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
|
@ -34,7 +34,7 @@
|
||||
AND parent_id = #{parentId}
|
||||
</if>
|
||||
<if test="deptName != null and deptName != ''">
|
||||
AND dept_name like concat('%', #{deptName}, '%')
|
||||
AND dept_name like concat(concat('%', #{deptName}), '%')
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND status = #{status}
|
||||
|
@ -38,7 +38,7 @@
|
||||
menu_type,
|
||||
visible,
|
||||
status,
|
||||
ifnull(perms, '') as perms,
|
||||
nvl(perms, '') as perms,
|
||||
icon,
|
||||
create_time
|
||||
from sys_menu
|
||||
@ -53,7 +53,7 @@
|
||||
m.component,
|
||||
m.visible,
|
||||
m.status,
|
||||
ifnull(m.perms, '') as perms,
|
||||
nvl(m.perms, '') as perms,
|
||||
m.is_frame,
|
||||
m.is_cache,
|
||||
m.menu_type,
|
||||
@ -68,14 +68,14 @@
|
||||
|
||||
<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,
|
||||
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
|
||||
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_role ro on ur.role_id = ro.role_id
|
||||
where ur.user_id = #{params.userId}
|
||||
<if test="menuName != null and menuName != ''">
|
||||
AND menu_name like concat('%', #{menuName}, '%')
|
||||
AND menu_name like concat(concat('%', #{menuName}), '%')
|
||||
</if>
|
||||
<if test="visible != null and visible != ''">
|
||||
AND visible = #{visible}
|
||||
@ -94,7 +94,7 @@
|
||||
m.component,
|
||||
m.visible,
|
||||
m.status,
|
||||
ifnull(m.perms, '') as perms,
|
||||
nvl(m.perms, '') as perms,
|
||||
m.is_frame,
|
||||
m.is_cache,
|
||||
m.menu_type,
|
||||
|
@ -10,10 +10,17 @@
|
||||
</resultMap>
|
||||
|
||||
<insert id="batchRoleDept">
|
||||
insert into sys_role_dept(role_id, dept_id) values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
(#{item.roleId},#{item.deptId})
|
||||
</foreach>
|
||||
insert all
|
||||
<foreach item="item" index="index" collection="list">
|
||||
into
|
||||
sys_role_dept(role_id, dept_id)
|
||||
values
|
||||
(
|
||||
#{item.roleId},
|
||||
#{item.deptId}
|
||||
)
|
||||
</foreach>
|
||||
SELECT 1 FROM DUAL
|
||||
</insert>
|
||||
|
||||
</mapper>
|
||||
|
@ -43,19 +43,19 @@
|
||||
<include refid="selectRoleVo"/>
|
||||
where r.del_flag = '0'
|
||||
<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 test="role.status != null and role.status != ''">
|
||||
AND r.status = #{role.status}
|
||||
</if>
|
||||
<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 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 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 test="role.params.dataScope != null and role.params.dataScope != ''">
|
||||
@ -68,19 +68,19 @@
|
||||
<include refid="selectRoleVo"/>
|
||||
where r.del_flag = '0'
|
||||
<if test="roleName != null and roleName != ''">
|
||||
AND r.role_name like concat('%', #{roleName}, '%')
|
||||
AND r.role_name like concat(concat('%', #{roleName}), '%')
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND r.status = #{status}
|
||||
</if>
|
||||
<if test="roleKey != null and roleKey != ''">
|
||||
AND r.role_key like concat('%', #{roleKey}, '%')
|
||||
AND r.role_key like concat(concat('%', #{roleKey}), '%')
|
||||
</if>
|
||||
<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 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 test="params.dataScope != null and params.dataScope != ''">
|
||||
|
@ -10,10 +10,17 @@
|
||||
</resultMap>
|
||||
|
||||
<insert id="batchRoleMenu">
|
||||
insert into sys_role_menu(role_id, menu_id) values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
(#{item.roleId},#{item.menuId})
|
||||
</foreach>
|
||||
insert all
|
||||
<foreach item="item" index="index" collection="list">
|
||||
into
|
||||
sys_role_menu(role_id, menu_id)
|
||||
values
|
||||
(
|
||||
#{item.roleId},
|
||||
#{item.menuId}
|
||||
)
|
||||
</foreach>
|
||||
SELECT 1 FROM DUAL
|
||||
</insert>
|
||||
|
||||
</mapper>
|
||||
|
@ -87,23 +87,23 @@
|
||||
left join sys_dept d on u.dept_id = d.dept_id
|
||||
where u.del_flag = '0'
|
||||
<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 test="user.status != null and user.status != ''">
|
||||
AND u.status = #{user.status}
|
||||
</if>
|
||||
<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 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 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 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},
|
||||
ancestors) ))
|
||||
ancestors) <![CDATA[ <> ]]> 0 ))
|
||||
</if>
|
||||
<!-- 数据范围过滤 -->
|
||||
<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
|
||||
where u.del_flag = '0'
|
||||
<if test="userName != null and userName != ''">
|
||||
AND u.user_name like concat('%', #{userName}, '%')
|
||||
AND u.user_name like concat(concat('%', #{userName}), '%')
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND u.status = #{status}
|
||||
</if>
|
||||
<if test="phonenumber != null and phonenumber != ''">
|
||||
AND u.phonenumber like concat('%', #{phonenumber}, '%')
|
||||
AND u.phonenumber like concat(concat('%',#{phonenumber}),'%')
|
||||
</if>
|
||||
<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 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 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},
|
||||
ancestors) ))
|
||||
ancestors) <![CDATA[ <> ]]> 0 ))
|
||||
</if>
|
||||
<!-- 数据范围过滤 -->
|
||||
<if test="params.dataScope != null and params.dataScope != ''">
|
||||
|
@ -10,10 +10,17 @@
|
||||
</resultMap>
|
||||
|
||||
<insert id="batchUserPost">
|
||||
insert into sys_user_post(user_id, post_id) values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
(#{item.userId},#{item.postId})
|
||||
</foreach>
|
||||
insert all
|
||||
<foreach item="item" index="index" collection="list" >
|
||||
into
|
||||
sys_user_post(user_id, post_id)
|
||||
values
|
||||
(
|
||||
#{item.userId},
|
||||
#{item.postId}
|
||||
)
|
||||
</foreach>
|
||||
SELECT 1 FROM DUAL
|
||||
</insert>
|
||||
|
||||
</mapper>
|
||||
|
@ -10,10 +10,17 @@
|
||||
</resultMap>
|
||||
|
||||
<insert id="batchUserRole">
|
||||
insert into sys_user_role(user_id, role_id) values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
(#{item.userId},#{item.roleId})
|
||||
</foreach>
|
||||
insert all
|
||||
<foreach item="item" index="index" collection="list">
|
||||
into
|
||||
sys_user_role(user_id, role_id)
|
||||
values
|
||||
(
|
||||
#{item.userId},
|
||||
#{item.roleId}
|
||||
)
|
||||
</foreach>
|
||||
SELECT 1 FROM DUAL
|
||||
</insert>
|
||||
|
||||
</mapper>
|
||||
|
Loading…
Reference in New Issue
Block a user