feat: 连表查询完成
This commit is contained in:
parent
bc863932a9
commit
0c1d00d864
|
@ -15,15 +15,19 @@
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<!-- 分页查询${classTitle}内容 -->
|
<!-- 分页查询${classTitle}内容 -->
|
||||||
<select id="selectListByPage" resultType="$type">
|
<select id="selectListByPage" resultType="${type}Vo">
|
||||||
select
|
select
|
||||||
<include refid="Base_Column_List"/>
|
base.*,
|
||||||
from $tableName
|
create_user.username as create_username,
|
||||||
|
update_user.username as update_username
|
||||||
|
from $tableName base
|
||||||
|
left join sys_user create_user on create_user.id = base.create_user
|
||||||
|
left join sys_user update_user on update_user.id = base.update_user
|
||||||
<where>
|
<where>
|
||||||
is_deleted = 0
|
base.is_deleted = 0
|
||||||
#foreach($field in $pageQueryMap)
|
#foreach($field in $pageQueryMap)
|
||||||
<if test="dto.${field.property} != null and dto.${field.property} != ''">
|
<if test="dto.${field.property} != null and dto.${field.property} != ''">
|
||||||
and $field.column like CONCAT('%',#{dto.${field.property}},'%')
|
and base.$field.column like CONCAT('%',#{dto.${field.property}},'%')
|
||||||
</if>
|
</if>
|
||||||
#end
|
#end
|
||||||
</where>
|
</where>
|
||||||
|
|
|
@ -31,13 +31,7 @@ public class ${originalName}ServiceImpl extends ServiceImpl<${originalName}Mappe
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public PageResult<${originalName}Vo> get${originalName}List(Page<${originalName}> pageParams, ${originalName}Dto dto) {
|
public PageResult<${originalName}Vo> get${originalName}List(Page<${originalName}> pageParams, ${originalName}Dto dto) {
|
||||||
IPage<${originalName}> page = baseMapper.selectListByPage(pageParams, dto);
|
IPage<${originalName}Vo> page = baseMapper.selectListByPage(pageParams, dto);
|
||||||
|
|
||||||
List<${originalName}Vo> voList = page.getRecords().stream().map(${lowercaseName} -> {
|
|
||||||
${originalName}Vo ${lowercaseName}Vo = new ${originalName}Vo();
|
|
||||||
BeanUtils.copyProperties(${lowercaseName}, ${lowercaseName}Vo);
|
|
||||||
return ${lowercaseName}Vo;
|
|
||||||
}).toList();
|
|
||||||
|
|
||||||
return PageResult.<${originalName}Vo>builder()
|
return PageResult.<${originalName}Vo>builder()
|
||||||
.list(voList)
|
.list(voList)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package cn.bunny.dao.vo.log;
|
package cn.bunny.dao.vo.log;
|
||||||
|
|
||||||
import cn.bunny.dao.common.vo.BaseVo;
|
import cn.bunny.dao.common.vo.BaseUserVo;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ import lombok.*;
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@Builder
|
@Builder
|
||||||
@Schema(name = "QuartzExecuteLogVo对象", title = "调度任务执行日志返回对象", description = "调度任务执行日志返回对象")
|
@Schema(name = "QuartzExecuteLogVo对象", title = "调度任务执行日志返回对象", description = "调度任务执行日志返回对象")
|
||||||
public class QuartzExecuteLogVo extends BaseVo {
|
public class QuartzExecuteLogVo extends BaseUserVo {
|
||||||
|
|
||||||
@Schema(name = "jobName", title = "任务名称")
|
@Schema(name = "jobName", title = "任务名称")
|
||||||
private String jobName;
|
private String jobName;
|
||||||
|
|
|
@ -0,0 +1,41 @@
|
||||||
|
package cn.bunny.dao.vo.log;
|
||||||
|
|
||||||
|
import cn.bunny.dao.common.vo.BaseVo;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Builder
|
||||||
|
@Schema(name = "UserLoginLogLocalVo对象", title = "用户登录日志", description = "用户登录日志")
|
||||||
|
public class UserLoginLogLocalVo extends BaseVo {
|
||||||
|
|
||||||
|
@Schema(name = "userId", title = "用户Id")
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
@Schema(name = "username", title = "用户名")
|
||||||
|
private String username;
|
||||||
|
|
||||||
|
@Schema(name = "token", title = "登录token")
|
||||||
|
private String token;
|
||||||
|
|
||||||
|
@Schema(name = "ipAddress", title = "登录Ip")
|
||||||
|
private String ipAddress;
|
||||||
|
|
||||||
|
@Schema(name = "ipRegion", title = "登录Ip归属地")
|
||||||
|
private String ipRegion;
|
||||||
|
|
||||||
|
@Schema(name = "userAgent", title = "登录时代理")
|
||||||
|
private String userAgent;
|
||||||
|
|
||||||
|
@Schema(name = "type", title = "操作类型")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
@Schema(name = "xRequestedWith", title = "标识客户端是否是通过Ajax发送请求的")
|
||||||
|
@JsonProperty("xRequestedWith")
|
||||||
|
private String xRequestedWith;
|
||||||
|
|
||||||
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
package cn.bunny.dao.vo.log;
|
package cn.bunny.dao.vo.log;
|
||||||
|
|
||||||
import cn.bunny.dao.common.vo.BaseVo;
|
import cn.bunny.dao.common.vo.BaseUserVo;
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
|
@ -11,7 +11,7 @@ import lombok.*;
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@Builder
|
@Builder
|
||||||
@Schema(name = "UserLoginLogVo对象", title = "用户登录日志", description = "用户登录日志")
|
@Schema(name = "UserLoginLogVo对象", title = "用户登录日志", description = "用户登录日志")
|
||||||
public class UserLoginLogVo extends BaseVo {
|
public class UserLoginLogVo extends BaseUserVo {
|
||||||
|
|
||||||
@Schema(name = "userId", title = "用户Id")
|
@Schema(name = "userId", title = "用户Id")
|
||||||
private Long userId;
|
private Long userId;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package cn.bunny.dao.vo.quartz;
|
package cn.bunny.dao.vo.quartz;
|
||||||
|
|
||||||
import cn.bunny.dao.common.vo.BaseVo;
|
import cn.bunny.dao.common.vo.BaseUserVo;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ import lombok.*;
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@Builder
|
@Builder
|
||||||
@Schema(name = "SchedulersGroupVo", title = "任务调度分组返回对象", description = "任务调度分组返回对象")
|
@Schema(name = "SchedulersGroupVo", title = "任务调度分组返回对象", description = "任务调度分组返回对象")
|
||||||
public class SchedulersGroupVo extends BaseVo {
|
public class SchedulersGroupVo extends BaseUserVo {
|
||||||
|
|
||||||
@Schema(name = "groupName", title = "分组名称")
|
@Schema(name = "groupName", title = "分组名称")
|
||||||
private String groupName;
|
private String groupName;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package cn.bunny.dao.vo.system.files;
|
package cn.bunny.dao.vo.system.files;
|
||||||
|
|
||||||
import cn.bunny.dao.common.vo.BaseVo;
|
import cn.bunny.dao.common.vo.BaseUserVo;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ import lombok.*;
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@Builder
|
@Builder
|
||||||
@Schema(name = "FilesVo对象", title = "系统文件", description = "管理端系统文件返回信息")
|
@Schema(name = "FilesVo对象", title = "系统文件", description = "管理端系统文件返回信息")
|
||||||
public class FilesVo extends BaseVo {
|
public class FilesVo extends BaseUserVo {
|
||||||
|
|
||||||
@Schema(name = "filename", title = "文件的名称")
|
@Schema(name = "filename", title = "文件的名称")
|
||||||
private String filename;
|
private String filename;
|
||||||
|
|
|
@ -5,6 +5,7 @@ import cn.bunny.dao.entity.log.UserLoginLog;
|
||||||
import cn.bunny.dao.pojo.result.PageResult;
|
import cn.bunny.dao.pojo.result.PageResult;
|
||||||
import cn.bunny.dao.pojo.result.Result;
|
import cn.bunny.dao.pojo.result.Result;
|
||||||
import cn.bunny.dao.pojo.result.ResultCodeEnum;
|
import cn.bunny.dao.pojo.result.ResultCodeEnum;
|
||||||
|
import cn.bunny.dao.vo.log.UserLoginLogLocalVo;
|
||||||
import cn.bunny.dao.vo.log.UserLoginLogVo;
|
import cn.bunny.dao.vo.log.UserLoginLogVo;
|
||||||
import cn.bunny.services.service.UserLoginLogService;
|
import cn.bunny.services.service.UserLoginLogService;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
@ -48,13 +49,13 @@ public class UserLoginLogController {
|
||||||
|
|
||||||
@Operation(summary = "获取本地用户登录日志", description = "获取本地用户登录日志")
|
@Operation(summary = "获取本地用户登录日志", description = "获取本地用户登录日志")
|
||||||
@GetMapping("noManage/getUserLoginLogListByLocalUser/{page}/{limit}")
|
@GetMapping("noManage/getUserLoginLogListByLocalUser/{page}/{limit}")
|
||||||
public Mono<Result<PageResult<UserLoginLogVo>>> getUserLoginLogListByLocalUser(
|
public Mono<Result<PageResult<UserLoginLogLocalVo>>> getUserLoginLogListByLocalUser(
|
||||||
@Parameter(name = "page", description = "当前页", required = true)
|
@Parameter(name = "page", description = "当前页", required = true)
|
||||||
@PathVariable("page") Integer page,
|
@PathVariable("page") Integer page,
|
||||||
@Parameter(name = "limit", description = "每页记录数", required = true)
|
@Parameter(name = "limit", description = "每页记录数", required = true)
|
||||||
@PathVariable("limit") Integer limit) {
|
@PathVariable("limit") Integer limit) {
|
||||||
Page<UserLoginLog> pageParams = new Page<>(page, limit);
|
Page<UserLoginLog> pageParams = new Page<>(page, limit);
|
||||||
PageResult<UserLoginLogVo> voPageResult = userLoginLogService.getUserLoginLogListByLocalUser(pageParams);
|
PageResult<UserLoginLogLocalVo> voPageResult = userLoginLogService.getUserLoginLogListByLocalUser(pageParams);
|
||||||
return Mono.just(Result.success(voPageResult));
|
return Mono.just(Result.success(voPageResult));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package cn.bunny.services.factory;
|
package cn.bunny.services.factory;
|
||||||
|
|
||||||
import cn.bunny.dao.entity.log.UserLoginLog;
|
|
||||||
import cn.bunny.dao.pojo.result.PageResult;
|
import cn.bunny.dao.pojo.result.PageResult;
|
||||||
import cn.bunny.dao.vo.log.UserLoginLogVo;
|
import cn.bunny.dao.vo.log.UserLoginLogVo;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
@ -18,7 +17,7 @@ public class UserLoginLogFactory {
|
||||||
* @param page 分页结果
|
* @param page 分页结果
|
||||||
* @return 分页用户登录日志
|
* @return 分页用户登录日志
|
||||||
*/
|
*/
|
||||||
public PageResult<UserLoginLogVo> getUserLoginLogVoPageResult(IPage<UserLoginLog> page) {
|
public PageResult<UserLoginLogVo> getUserLoginLogVoPageResult(IPage<UserLoginLogVo> page) {
|
||||||
List<UserLoginLogVo> voList = page.getRecords().stream().map(userLoginLog -> {
|
List<UserLoginLogVo> voList = page.getRecords().stream().map(userLoginLog -> {
|
||||||
UserLoginLogVo userLoginLogVo = new UserLoginLogVo();
|
UserLoginLogVo userLoginLogVo = new UserLoginLogVo();
|
||||||
BeanUtils.copyProperties(userLoginLog, userLoginLogVo);
|
BeanUtils.copyProperties(userLoginLog, userLoginLogVo);
|
||||||
|
|
|
@ -2,6 +2,7 @@ package cn.bunny.services.mapper;
|
||||||
|
|
||||||
import cn.bunny.dao.dto.system.files.FilesDto;
|
import cn.bunny.dao.dto.system.files.FilesDto;
|
||||||
import cn.bunny.dao.entity.system.Files;
|
import cn.bunny.dao.entity.system.Files;
|
||||||
|
import cn.bunny.dao.vo.system.files.FilesVo;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
@ -28,7 +29,7 @@ public interface FilesMapper extends BaseMapper<Files> {
|
||||||
* @param dto 系统文件表查询表单
|
* @param dto 系统文件表查询表单
|
||||||
* @return 系统文件表分页结果
|
* @return 系统文件表分页结果
|
||||||
*/
|
*/
|
||||||
IPage<Files> selectListByPage(@Param("page") Page<Files> pageParams, @Param("dto") FilesDto dto);
|
IPage<FilesVo> selectListByPage(@Param("page") Page<Files> pageParams, @Param("dto") FilesDto dto);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 物理删除系统文件表
|
* 物理删除系统文件表
|
||||||
|
|
|
@ -2,6 +2,7 @@ package cn.bunny.services.mapper;
|
||||||
|
|
||||||
import cn.bunny.dao.dto.log.ScheduleExecuteLogDto;
|
import cn.bunny.dao.dto.log.ScheduleExecuteLogDto;
|
||||||
import cn.bunny.dao.entity.log.ScheduleExecuteLog;
|
import cn.bunny.dao.entity.log.ScheduleExecuteLog;
|
||||||
|
import cn.bunny.dao.vo.log.QuartzExecuteLogVo;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
@ -28,7 +29,7 @@ public interface ScheduleExecuteLogMapper extends BaseMapper<ScheduleExecuteLog>
|
||||||
* @param dto 调度任务执行日志查询表单
|
* @param dto 调度任务执行日志查询表单
|
||||||
* @return 调度任务执行日志分页结果
|
* @return 调度任务执行日志分页结果
|
||||||
*/
|
*/
|
||||||
IPage<ScheduleExecuteLog> selectListByPage(@Param("page") Page<ScheduleExecuteLog> pageParams, @Param("dto") ScheduleExecuteLogDto dto);
|
IPage<QuartzExecuteLogVo> selectListByPage(@Param("page") Page<ScheduleExecuteLog> pageParams, @Param("dto") ScheduleExecuteLogDto dto);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 物理删除调度任务执行日志
|
* 物理删除调度任务执行日志
|
||||||
|
|
|
@ -2,6 +2,7 @@ package cn.bunny.services.mapper;
|
||||||
|
|
||||||
import cn.bunny.dao.dto.quartz.group.SchedulersGroupDto;
|
import cn.bunny.dao.dto.quartz.group.SchedulersGroupDto;
|
||||||
import cn.bunny.dao.entity.quartz.SchedulersGroup;
|
import cn.bunny.dao.entity.quartz.SchedulersGroup;
|
||||||
|
import cn.bunny.dao.vo.quartz.SchedulersGroupVo;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
@ -28,7 +29,7 @@ public interface SchedulersGroupMapper extends BaseMapper<SchedulersGroup> {
|
||||||
* @param dto 任务调度分组查询表单
|
* @param dto 任务调度分组查询表单
|
||||||
* @return 任务调度分组分页结果
|
* @return 任务调度分组分页结果
|
||||||
*/
|
*/
|
||||||
IPage<SchedulersGroup> selectListByPage(@Param("page") Page<SchedulersGroup> pageParams, @Param("dto") SchedulersGroupDto dto);
|
IPage<SchedulersGroupVo> selectListByPage(@Param("page") Page<SchedulersGroup> pageParams, @Param("dto") SchedulersGroupDto dto);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 物理删除任务调度分组
|
* 物理删除任务调度分组
|
||||||
|
|
|
@ -2,6 +2,7 @@ package cn.bunny.services.mapper;
|
||||||
|
|
||||||
import cn.bunny.dao.dto.log.UserLoginLogDto;
|
import cn.bunny.dao.dto.log.UserLoginLogDto;
|
||||||
import cn.bunny.dao.entity.log.UserLoginLog;
|
import cn.bunny.dao.entity.log.UserLoginLog;
|
||||||
|
import cn.bunny.dao.vo.log.UserLoginLogVo;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
@ -28,7 +29,7 @@ public interface UserLoginLogMapper extends BaseMapper<UserLoginLog> {
|
||||||
* @param dto 用户登录日志查询表单
|
* @param dto 用户登录日志查询表单
|
||||||
* @return 用户登录日志分页结果
|
* @return 用户登录日志分页结果
|
||||||
*/
|
*/
|
||||||
IPage<UserLoginLog> selectListByPage(@Param("page") Page<UserLoginLog> pageParams, @Param("dto") UserLoginLogDto dto);
|
IPage<UserLoginLogVo> selectListByPage(@Param("page") Page<UserLoginLog> pageParams, @Param("dto") UserLoginLogDto dto);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 物理删除用户登录日志
|
* 物理删除用户登录日志
|
||||||
|
|
|
@ -3,6 +3,7 @@ package cn.bunny.services.service;
|
||||||
import cn.bunny.dao.dto.log.UserLoginLogDto;
|
import cn.bunny.dao.dto.log.UserLoginLogDto;
|
||||||
import cn.bunny.dao.entity.log.UserLoginLog;
|
import cn.bunny.dao.entity.log.UserLoginLog;
|
||||||
import cn.bunny.dao.pojo.result.PageResult;
|
import cn.bunny.dao.pojo.result.PageResult;
|
||||||
|
import cn.bunny.dao.vo.log.UserLoginLogLocalVo;
|
||||||
import cn.bunny.dao.vo.log.UserLoginLogVo;
|
import cn.bunny.dao.vo.log.UserLoginLogVo;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
@ -39,5 +40,5 @@ public interface UserLoginLogService extends IService<UserLoginLog> {
|
||||||
* @param pageParams 分页查询内容
|
* @param pageParams 分页查询内容
|
||||||
* @return 用户登录日志返回列表
|
* @return 用户登录日志返回列表
|
||||||
*/
|
*/
|
||||||
PageResult<UserLoginLogVo> getUserLoginLogListByLocalUser(Page<UserLoginLog> pageParams);
|
PageResult<UserLoginLogLocalVo> getUserLoginLogListByLocalUser(Page<UserLoginLog> pageParams);
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,16 +74,10 @@ public class FilesServiceImpl extends ServiceImpl<FilesMapper, Files> implements
|
||||||
@Override
|
@Override
|
||||||
public PageResult<FilesVo> getFilesList(Page<Files> pageParams, FilesDto dto) {
|
public PageResult<FilesVo> getFilesList(Page<Files> pageParams, FilesDto dto) {
|
||||||
// 分页查询菜单图标
|
// 分页查询菜单图标
|
||||||
IPage<Files> page = baseMapper.selectListByPage(pageParams, dto);
|
IPage<FilesVo> page = baseMapper.selectListByPage(pageParams, dto);
|
||||||
|
|
||||||
List<FilesVo> voList = page.getRecords().stream().map(files -> {
|
|
||||||
FilesVo filesVo = new FilesVo();
|
|
||||||
BeanUtils.copyProperties(files, filesVo);
|
|
||||||
return filesVo;
|
|
||||||
}).toList();
|
|
||||||
|
|
||||||
return PageResult.<FilesVo>builder()
|
return PageResult.<FilesVo>builder()
|
||||||
.list(voList)
|
.list(page.getRecords())
|
||||||
.pageNo(page.getCurrent())
|
.pageNo(page.getCurrent())
|
||||||
.pageSize(page.getSize())
|
.pageSize(page.getSize())
|
||||||
.total(page.getTotal())
|
.total(page.getTotal())
|
||||||
|
|
|
@ -9,7 +9,6 @@ import cn.bunny.services.service.ScheduleExecuteLogService;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import org.springframework.beans.BeanUtils;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -35,16 +34,10 @@ public class ScheduleExecuteLogServiceImpl extends ServiceImpl<ScheduleExecuteLo
|
||||||
@Override
|
@Override
|
||||||
public PageResult<QuartzExecuteLogVo> getQuartzExecuteLogList(Page<ScheduleExecuteLog> pageParams, ScheduleExecuteLogDto dto) {
|
public PageResult<QuartzExecuteLogVo> getQuartzExecuteLogList(Page<ScheduleExecuteLog> pageParams, ScheduleExecuteLogDto dto) {
|
||||||
// 分页查询菜单图标
|
// 分页查询菜单图标
|
||||||
IPage<ScheduleExecuteLog> page = baseMapper.selectListByPage(pageParams, dto);
|
IPage<QuartzExecuteLogVo> page = baseMapper.selectListByPage(pageParams, dto);
|
||||||
|
|
||||||
List<QuartzExecuteLogVo> voList = page.getRecords().stream().map(quartzExecuteLog -> {
|
|
||||||
QuartzExecuteLogVo quartzExecuteLogVo = new QuartzExecuteLogVo();
|
|
||||||
BeanUtils.copyProperties(quartzExecuteLog, quartzExecuteLogVo);
|
|
||||||
return quartzExecuteLogVo;
|
|
||||||
}).toList();
|
|
||||||
|
|
||||||
return PageResult.<QuartzExecuteLogVo>builder()
|
return PageResult.<QuartzExecuteLogVo>builder()
|
||||||
.list(voList)
|
.list(page.getRecords())
|
||||||
.pageNo(page.getCurrent())
|
.pageNo(page.getCurrent())
|
||||||
.pageSize(page.getSize())
|
.pageSize(page.getSize())
|
||||||
.total(page.getTotal())
|
.total(page.getTotal())
|
||||||
|
|
|
@ -40,16 +40,10 @@ public class SchedulersGroupServiceImpl extends ServiceImpl<SchedulersGroupMappe
|
||||||
@Override
|
@Override
|
||||||
public PageResult<SchedulersGroupVo> getSchedulersGroupList(Page<SchedulersGroup> pageParams, SchedulersGroupDto dto) {
|
public PageResult<SchedulersGroupVo> getSchedulersGroupList(Page<SchedulersGroup> pageParams, SchedulersGroupDto dto) {
|
||||||
// 分页查询菜单图标
|
// 分页查询菜单图标
|
||||||
IPage<SchedulersGroup> page = baseMapper.selectListByPage(pageParams, dto);
|
IPage<SchedulersGroupVo> page = baseMapper.selectListByPage(pageParams, dto);
|
||||||
|
|
||||||
List<SchedulersGroupVo> voList = page.getRecords().stream().map(schedulersGroup -> {
|
|
||||||
SchedulersGroupVo schedulersGroupVo = new SchedulersGroupVo();
|
|
||||||
BeanUtils.copyProperties(schedulersGroup, schedulersGroupVo);
|
|
||||||
return schedulersGroupVo;
|
|
||||||
}).toList();
|
|
||||||
|
|
||||||
return PageResult.<SchedulersGroupVo>builder()
|
return PageResult.<SchedulersGroupVo>builder()
|
||||||
.list(voList)
|
.list(page.getRecords())
|
||||||
.pageNo(page.getCurrent())
|
.pageNo(page.getCurrent())
|
||||||
.pageSize(page.getSize())
|
.pageSize(page.getSize())
|
||||||
.total(page.getTotal())
|
.total(page.getTotal())
|
||||||
|
|
|
@ -4,6 +4,7 @@ import cn.bunny.common.service.context.BaseContext;
|
||||||
import cn.bunny.dao.dto.log.UserLoginLogDto;
|
import cn.bunny.dao.dto.log.UserLoginLogDto;
|
||||||
import cn.bunny.dao.entity.log.UserLoginLog;
|
import cn.bunny.dao.entity.log.UserLoginLog;
|
||||||
import cn.bunny.dao.pojo.result.PageResult;
|
import cn.bunny.dao.pojo.result.PageResult;
|
||||||
|
import cn.bunny.dao.vo.log.UserLoginLogLocalVo;
|
||||||
import cn.bunny.dao.vo.log.UserLoginLogVo;
|
import cn.bunny.dao.vo.log.UserLoginLogVo;
|
||||||
import cn.bunny.services.factory.UserLoginLogFactory;
|
import cn.bunny.services.factory.UserLoginLogFactory;
|
||||||
import cn.bunny.services.mapper.UserLoginLogMapper;
|
import cn.bunny.services.mapper.UserLoginLogMapper;
|
||||||
|
@ -11,6 +12,7 @@ import cn.bunny.services.service.UserLoginLogService;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
@ -42,7 +44,7 @@ public class UserLoginLogServiceImpl extends ServiceImpl<UserLoginLogMapper, Use
|
||||||
@Override
|
@Override
|
||||||
public PageResult<UserLoginLogVo> getUserLoginLogList(Page<UserLoginLog> pageParams, UserLoginLogDto dto) {
|
public PageResult<UserLoginLogVo> getUserLoginLogList(Page<UserLoginLog> pageParams, UserLoginLogDto dto) {
|
||||||
// 分页查询菜单图标
|
// 分页查询菜单图标
|
||||||
IPage<UserLoginLog> page = baseMapper.selectListByPage(pageParams, dto);
|
IPage<UserLoginLogVo> page = baseMapper.selectListByPage(pageParams, dto);
|
||||||
|
|
||||||
return factory.getUserLoginLogVoPageResult(page);
|
return factory.getUserLoginLogVoPageResult(page);
|
||||||
}
|
}
|
||||||
|
@ -68,10 +70,21 @@ public class UserLoginLogServiceImpl extends ServiceImpl<UserLoginLogMapper, Use
|
||||||
* @return 用户登录日志返回列表
|
* @return 用户登录日志返回列表
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public PageResult<UserLoginLogVo> getUserLoginLogListByLocalUser(Page<UserLoginLog> pageParams) {
|
public PageResult<UserLoginLogLocalVo> getUserLoginLogListByLocalUser(Page<UserLoginLog> pageParams) {
|
||||||
Long userId = BaseContext.getUserId();
|
Long userId = BaseContext.getUserId();
|
||||||
IPage<UserLoginLog> page = baseMapper.selectListByPageWithLocalUser(pageParams, userId);
|
IPage<UserLoginLog> page = baseMapper.selectListByPageWithLocalUser(pageParams, userId);
|
||||||
|
|
||||||
return factory.getUserLoginLogVoPageResult(page);
|
List<UserLoginLogLocalVo> voList = page.getRecords().stream().map(userLoginLog -> {
|
||||||
|
UserLoginLogLocalVo userLoginLogVo = new UserLoginLogLocalVo();
|
||||||
|
BeanUtils.copyProperties(userLoginLog, userLoginLogVo);
|
||||||
|
return userLoginLogVo;
|
||||||
|
}).toList();
|
||||||
|
|
||||||
|
return PageResult.<UserLoginLogLocalVo>builder()
|
||||||
|
.list(voList)
|
||||||
|
.pageNo(page.getCurrent())
|
||||||
|
.pageSize(page.getSize())
|
||||||
|
.total(page.getTotal())
|
||||||
|
.build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,26 +23,29 @@
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<!-- 分页查询系统文件表内容 -->
|
<!-- 分页查询系统文件表内容 -->
|
||||||
<select id="selectListByPage" resultType="cn.bunny.dao.entity.system.Files">
|
<select id="selectListByPage" resultType="cn.bunny.dao.vo.system.files.FilesVo">
|
||||||
select
|
select
|
||||||
<include refid="Base_Column_List"/>
|
files.*,
|
||||||
from sys_files
|
create_user.username as create_username,
|
||||||
|
update_user.username as update_username
|
||||||
|
from sys_files files
|
||||||
|
left join sys_user create_user on create_user.id = files.create_user
|
||||||
|
left join sys_user update_user on update_user.id = files.update_user
|
||||||
<where>
|
<where>
|
||||||
is_deleted = 0
|
files.is_deleted = 0
|
||||||
<if test="dto.filename != null and dto.filename != ''">
|
<if test="dto.filename != null and dto.filename != ''">
|
||||||
and filename like CONCAT('%',#{dto.filename},'%')
|
and files.filename like CONCAT('%',#{dto.filename},'%')
|
||||||
</if>
|
</if>
|
||||||
<if test="dto.filepath != null and dto.filepath != ''">
|
<if test="dto.filepath != null and dto.filepath != ''">
|
||||||
and filepath like CONCAT('%',#{dto.filepath},'%')
|
and files.filepath like CONCAT('%',#{dto.filepath},'%')
|
||||||
</if>
|
</if>
|
||||||
<if test="dto.fileType != null and dto.fileType != ''">
|
<if test="dto.fileType != null and dto.fileType != ''">
|
||||||
and file_type like CONCAT('%',#{dto.fileType},'%')
|
and files.file_type like CONCAT('%',#{dto.fileType},'%')
|
||||||
</if>
|
</if>
|
||||||
<if test="dto.downloadCount != null and dto.downloadCount != ''">
|
<if test="dto.downloadCount != null and dto.downloadCount != ''">
|
||||||
and download_count like CONCAT('%',#{dto.downloadCount},'%')
|
and files.download_count like CONCAT('%',#{dto.downloadCount},'%')
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
order by update_time
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!-- 物理删除系统文件表 -->
|
<!-- 物理删除系统文件表 -->
|
||||||
|
|
|
@ -25,29 +25,32 @@
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<!-- 分页查询调度任务执行日志内容 -->
|
<!-- 分页查询调度任务执行日志内容 -->
|
||||||
<select id="selectListByPage" resultType="cn.bunny.dao.entity.log.ScheduleExecuteLog">
|
<select id="selectListByPage" resultType="cn.bunny.dao.vo.log.QuartzExecuteLogVo">
|
||||||
select
|
select
|
||||||
<include refid="Base_Column_List"/>
|
log.*,
|
||||||
from log_quartz_execute
|
create_user.username as create_username,
|
||||||
|
update_user.username as update_username
|
||||||
|
from log_quartz_execute log
|
||||||
|
left join sys_user create_user on create_user.id = log.create_user
|
||||||
|
left join sys_user update_user on update_user.id = log.update_user
|
||||||
<where>
|
<where>
|
||||||
is_deleted = 0
|
log.is_deleted = 0
|
||||||
<if test="dto.jobName != null and dto.jobName != ''">
|
<if test="dto.jobName != null and dto.jobName != ''">
|
||||||
and job_name like CONCAT('%',#{dto.jobName},'%')
|
and log.job_name like CONCAT('%',#{dto.jobName},'%')
|
||||||
</if>
|
</if>
|
||||||
<if test="dto.jobGroup != null and dto.jobGroup != ''">
|
<if test="dto.jobGroup != null and dto.jobGroup != ''">
|
||||||
and job_group like CONCAT('%',#{dto.jobGroup},'%')
|
and log.job_group like CONCAT('%',#{dto.jobGroup},'%')
|
||||||
</if>
|
</if>
|
||||||
<if test="dto.jobClassName != null and dto.jobClassName != ''">
|
<if test="dto.jobClassName != null and dto.jobClassName != ''">
|
||||||
and job_class_name like CONCAT('%',#{dto.jobClassName},'%')
|
and log.job_class_name like CONCAT('%',#{dto.jobClassName},'%')
|
||||||
</if>
|
</if>
|
||||||
<if test="dto.cronExpression != null and dto.cronExpression != ''">
|
<if test="dto.cronExpression != null and dto.cronExpression != ''">
|
||||||
and cron_expression like CONCAT('%',#{dto.cronExpression},'%')
|
and log.cron_expression like CONCAT('%',#{dto.cronExpression},'%')
|
||||||
</if>
|
</if>
|
||||||
<if test="dto.triggerName != null and dto.triggerName != ''">
|
<if test="dto.triggerName != null and dto.triggerName != ''">
|
||||||
and trigger_name like CONCAT('%',#{dto.triggerName},'%')
|
and log.trigger_name like CONCAT('%',#{dto.triggerName},'%')
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
order by update_time desc
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!-- 物理删除调度任务执行日志 -->
|
<!-- 物理删除调度任务执行日志 -->
|
||||||
|
|
|
@ -20,19 +20,23 @@
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<!-- 分页查询任务调度分组内容 -->
|
<!-- 分页查询任务调度分组内容 -->
|
||||||
<select id="selectListByPage" resultType="cn.bunny.dao.entity.quartz.SchedulersGroup">
|
<select id="selectListByPage" resultType="cn.bunny.dao.vo.quartz.SchedulersGroupVo">
|
||||||
select
|
select
|
||||||
<include refid="Base_Column_List"/>
|
schedulers_group.*,
|
||||||
from qrtz_schedulers_group
|
create_user.username as create_username,
|
||||||
|
update_user.username as update_username
|
||||||
|
from qrtz_schedulers_group schedulers_group
|
||||||
|
left join sys_user create_user on create_user.id = schedulers_group.create_user
|
||||||
|
left join sys_user update_user on update_user.id = schedulers_group.update_user
|
||||||
<where>
|
<where>
|
||||||
|
schedulers_group.is_deleted = 0
|
||||||
<if test="dto.groupName != null and dto.groupName != ''">
|
<if test="dto.groupName != null and dto.groupName != ''">
|
||||||
and group_name like CONCAT('%',#{dto.groupName},'%')
|
and schedulers_group.group_name like CONCAT('%',#{dto.groupName},'%')
|
||||||
</if>
|
</if>
|
||||||
<if test="dto.description != null and dto.description != ''">
|
<if test="dto.description != null and dto.description != ''">
|
||||||
and description like CONCAT('%',#{dto.description},'%')
|
and schedulers_group.description like CONCAT('%',#{dto.description},'%')
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
order by update_time desc
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!-- 物理删除任务调度分组 -->
|
<!-- 物理删除任务调度分组 -->
|
||||||
|
|
|
@ -26,26 +26,30 @@
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<!-- 分页查询用户登录日志内容 -->
|
<!-- 分页查询用户登录日志内容 -->
|
||||||
<select id="selectListByPage" resultType="cn.bunny.dao.entity.log.UserLoginLog">
|
<select id="selectListByPage" resultType="cn.bunny.dao.vo.log.UserLoginLogVo">
|
||||||
select
|
select
|
||||||
<include refid="Base_Column_List"/>
|
user_login.*,
|
||||||
from log_user_login
|
create_user.username as create_username,
|
||||||
|
update_user.username as update_username
|
||||||
|
from log_user_login user_login
|
||||||
|
left join sys_user create_user on create_user.id = user_login.create_user
|
||||||
|
left join sys_user update_user on update_user.id = user_login.update_user
|
||||||
<where>
|
<where>
|
||||||
is_deleted = 0
|
user_login.is_deleted = 0
|
||||||
<if test="dto.username != null and dto.username != ''">
|
<if test="dto.username != null and dto.username != ''">
|
||||||
and username like CONCAT('%',#{dto.username},'%')
|
and user_login.username like CONCAT('%',#{dto.username},'%')
|
||||||
</if>
|
</if>
|
||||||
<if test="dto.ipAddress != null and dto.ipAddress != ''">
|
<if test="dto.ipAddress != null and dto.ipAddress != ''">
|
||||||
and ip_address like CONCAT('%',#{dto.ipAddress},'%')
|
and user_login.ip_address like CONCAT('%',#{dto.ipAddress},'%')
|
||||||
</if>
|
</if>
|
||||||
<if test="dto.ipRegion != null and dto.ipRegion != ''">
|
<if test="dto.ipRegion != null and dto.ipRegion != ''">
|
||||||
and ip_region like CONCAT('%',#{dto.ipRegion},'%')
|
and user_login.ip_region like CONCAT('%',#{dto.ipRegion},'%')
|
||||||
</if>
|
</if>
|
||||||
<if test="dto.type != null and dto.type != ''">
|
<if test="dto.type != null and dto.type != ''">
|
||||||
and type like CONCAT('%',#{dto.type},'%')
|
and user_login.type like CONCAT('%',#{dto.type},'%')
|
||||||
</if>
|
</if>
|
||||||
<if test="dto.xRequestedWith != null and dto.xRequestedWith != ''">
|
<if test="dto.xRequestedWith != null and dto.xRequestedWith != ''">
|
||||||
and x_requested_with like CONCAT('%',#{dto.xRequestedWith},'%')
|
and user_login.x_requested_with like CONCAT('%',#{dto.xRequestedWith},'%')
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
@ -54,7 +58,7 @@
|
||||||
<select id="selectListByPageWithLocalUser" resultType="cn.bunny.dao.entity.log.UserLoginLog">
|
<select id="selectListByPageWithLocalUser" resultType="cn.bunny.dao.entity.log.UserLoginLog">
|
||||||
select
|
select
|
||||||
<include refid="Base_Column_List"/>
|
<include refid="Base_Column_List"/>
|
||||||
from log_user_login where user_id = #{id} order by create_time desc
|
from log_user_login where user_id = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!-- 物理删除用户登录日志 -->
|
<!-- 物理删除用户登录日志 -->
|
||||||
|
|
Loading…
Reference in New Issue