mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-22 15:21:53 +08:00
feat: 添加 vue3 时间区间查询
This commit is contained in:
parent
22429140bd
commit
bc233df980
@ -94,6 +94,19 @@ public class LambdaQueryWrapperX<T> extends LambdaQueryWrapper<T> {
|
||||
return this;
|
||||
}
|
||||
|
||||
public LambdaQueryWrapperX<T> betweenIfPresent(SFunction<T, ?> column, Object[] values) {
|
||||
if (values!= null && values.length >0 && values[0] != null && values[1] != null) {
|
||||
return (LambdaQueryWrapperX<T>) super.between(column, values[0], values[1]);
|
||||
}
|
||||
if (values != null && values[0] != null) {
|
||||
return (LambdaQueryWrapperX<T>) ge(column, values[0]);
|
||||
}
|
||||
if (values != null && values[1] != null) {
|
||||
return (LambdaQueryWrapperX<T>) le(column, values[2]);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
// ========== 重写父类方法,方便链式调用 ==========
|
||||
|
||||
@Override
|
||||
|
@ -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;
|
||||
|
||||
|
@ -33,7 +33,8 @@ public interface AdminUserMapper extends BaseMapperX<AdminUserDO> {
|
||||
.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));
|
||||
|
||||
|
@ -101,7 +101,7 @@ const crudSchemas = reactive<CrudSchema[]>([
|
||||
},
|
||||
{
|
||||
label: t('common.createTime'),
|
||||
field: 'daterange',
|
||||
field: 'createTime',
|
||||
table: {
|
||||
show: false
|
||||
},
|
||||
@ -115,7 +115,7 @@ const crudSchemas = reactive<CrudSchema[]>([
|
||||
show: true,
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
type: 'daterange',
|
||||
type: 'datetimerange',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss'
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user