diff --git a/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/query/LambdaQueryWrapperX.java b/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/query/LambdaQueryWrapperX.java index 463db3038..d9ba7c4be 100644 --- a/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/query/LambdaQueryWrapperX.java +++ b/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/query/LambdaQueryWrapperX.java @@ -94,6 +94,19 @@ public class LambdaQueryWrapperX extends LambdaQueryWrapper { return this; } + public LambdaQueryWrapperX betweenIfPresent(SFunction column, Object[] values) { + if (values!= null && values.length >0 && values[0] != null && values[1] != null) { + return (LambdaQueryWrapperX) super.between(column, values[0], values[1]); + } + if (values != null && values[0] != null) { + return (LambdaQueryWrapperX) ge(column, values[0]); + } + if (values != null && values[1] != null) { + return (LambdaQueryWrapperX) le(column, values[2]); + } + return this; + } + // ========== 重写父类方法,方便链式调用 ========== @Override diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserPageReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserPageReqVO.java index 00f20eb4d..ee539189e 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserPageReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserPageReqVO.java @@ -37,6 +37,10 @@ public class UserPageReqVO extends PageParam { @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private Date endTime; + @ApiModelProperty(value = "开始时间", example = "2020-10-24") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private Date[] createTime; + @ApiModelProperty(value = "部门编号", example = "1024", notes = "同时筛选子部门") private Long deptId; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/user/AdminUserMapper.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/user/AdminUserMapper.java index b7d5e3daa..353cffab5 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/user/AdminUserMapper.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/user/AdminUserMapper.java @@ -33,7 +33,8 @@ public interface AdminUserMapper extends BaseMapperX { .likeIfPresent(AdminUserDO::getUsername, reqVO.getUsername()) .likeIfPresent(AdminUserDO::getMobile, reqVO.getMobile()) .eqIfPresent(AdminUserDO::getStatus, reqVO.getStatus()) - .betweenIfPresent(AdminUserDO::getCreateTime, reqVO.getBeginTime(), reqVO.getEndTime()) + .betweenIfPresent(AdminUserDO::getCreateTime, reqVO.getBeginTime(),reqVO.getEndTime()) + .betweenIfPresent(AdminUserDO::getCreateTime, reqVO.getCreateTime()) .inIfPresent(AdminUserDO::getDeptId, deptIds) .orderByDesc(AdminUserDO::getId)); diff --git a/yudao-ui-admin-vue3/src/views/system/user/user.data.ts b/yudao-ui-admin-vue3/src/views/system/user/user.data.ts index 49d65e267..2039bc9fe 100644 --- a/yudao-ui-admin-vue3/src/views/system/user/user.data.ts +++ b/yudao-ui-admin-vue3/src/views/system/user/user.data.ts @@ -101,7 +101,7 @@ const crudSchemas = reactive([ }, { label: t('common.createTime'), - field: 'daterange', + field: 'createTime', table: { show: false }, @@ -115,7 +115,7 @@ const crudSchemas = reactive([ show: true, component: 'DatePicker', componentProps: { - type: 'daterange', + type: 'datetimerange', valueFormat: 'YYYY-MM-DD HH:mm:ss' } }