Commit 2a93904e authored by hongguangwu's avatar hongguangwu

1.5.8-hgw-时间区间

parent f21c1c41
...@@ -24,8 +24,13 @@ public class SysRoleInfoSearchVo extends SysRoleInfo { ...@@ -24,8 +24,13 @@ public class SysRoleInfoSearchVo extends SysRoleInfo {
/** /**
* 创建时间区间 [开始时间,结束时间] * 创建时间区间 [开始时间,结束时间]
*/ */
@Schema(description = "创建时间区间") @Schema(description = "创建时间起")
private LocalDateTime[] createTimes; private LocalDateTime createTimeStart;
/**
* 创建时间区间 [开始时间,结束时间]
*/
@Schema(description = "创建时间止")
private LocalDateTime createTimeEnd;
/** /**
* @Author fxj * @Author fxj
* 查询数据起 * 查询数据起
......
...@@ -16,7 +16,6 @@ package com.yifu.cloud.plus.v1.permission.service.impl;/* ...@@ -16,7 +16,6 @@ package com.yifu.cloud.plus.v1.permission.service.impl;/*
*/ */
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ArrayUtil;
import com.alibaba.excel.EasyExcel; import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter; import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.context.AnalysisContext; import com.alibaba.excel.context.AnalysisContext;
...@@ -159,10 +158,11 @@ public class SysRoleInfoServiceImpl extends ServiceImpl<SysRoleInfoMapper, SysRo ...@@ -159,10 +158,11 @@ public class SysRoleInfoServiceImpl extends ServiceImpl<SysRoleInfoMapper, SysRo
private LambdaQueryWrapper buildQueryWrapper(SysRoleInfoSearchVo entity) { private LambdaQueryWrapper buildQueryWrapper(SysRoleInfoSearchVo entity) {
LambdaQueryWrapper<SysRoleInfo> wrapper = Wrappers.lambdaQuery(); LambdaQueryWrapper<SysRoleInfo> wrapper = Wrappers.lambdaQuery();
if (ArrayUtil.isNotEmpty(entity.getCreateTimes())) { if (Common.isNotNull(entity.getCreateTimeStart())) {
wrapper.ge(SysRoleInfo::getCreateTime, entity.getCreateTimes()[0]) wrapper.ge(SysRoleInfo::getCreateTime, entity.getCreateTimeStart());
.le(SysRoleInfo::getCreateTime, }
entity.getCreateTimes()[1]); if (Common.isNotNull(entity.getCreateTimeEnd())) {
wrapper.le(SysRoleInfo::getCreateTime, entity.getCreateTimeEnd());
} }
if (Common.isNotNull(entity.getCreateName())) { if (Common.isNotNull(entity.getCreateName())) {
wrapper.eq(SysRoleInfo::getCreateName, entity.getCreateName()); wrapper.eq(SysRoleInfo::getCreateName, entity.getCreateName());
......
...@@ -78,6 +78,12 @@ ...@@ -78,6 +78,12 @@
<if test="sysRoleInfo.createTime != null"> <if test="sysRoleInfo.createTime != null">
AND a.CREATE_TIME = #{sysRoleInfo.createTime} AND a.CREATE_TIME = #{sysRoleInfo.createTime}
</if> </if>
<if test="sysRoleInfo.createTimeStart != null">
AND a.CREATE_TIME <![CDATA[ >= ]]> #{sysRoleInfo.createTimeStart}
</if>
<if test="sysRoleInfo.createTimeEnd != null">
AND a.CREATE_TIME <![CDATA[ <= ]]> #{sysRoleInfo.createTimeEnd}
</if>
<if test="sysRoleInfo.updateBy != null and sysRoleInfo.updateBy.trim() != ''"> <if test="sysRoleInfo.updateBy != null and sysRoleInfo.updateBy.trim() != ''">
AND a.UPDATE_BY = #{sysRoleInfo.updateBy} AND a.UPDATE_BY = #{sysRoleInfo.updateBy}
</if> </if>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment