springcloud,mybatisplus,vue3,mysql,芋道系统,时间段查询
一.前端:
<el-form-item label="到访日期" prop="visitTime">
<el-date-picker
v-model="queryParams.visitTime"
value-format="YYYY-MM-DD"
type="daterange"
start-placeholder="开始日期"
end-placeholder="结束日期"
class="!w-240px"
/>
</el-form-item>
/** 查询列表 */
const getList = async () => {
loading.value = true
try {
const data = await VisitManageApi.getVisitManagePage(queryParams)
list.value = data.list
total.value = data.total
} finally {
loading.value = false
}
}
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
visitTime: [],
})
//API接口
+++++++++++++++++++++++++++++++++++++++++++++
export const VisitManageApi = {
// 查询到访管理分页
getVisitManagePage: async (params: any) => {
console.log(params)
return await request.get({ url: `/sale/visit-manage/page`, params })
},
}
二后端
//定义为数组,接收
Schema(description = "到访日期")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate[] visitTime;
//mybatisplus的lambdaquerywrapper查询
default PageResult<VisitManageDO> selectPage(VisitManagePageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<VisitManageDO>()
.betweenIfPresent(VisitManageDO::getVisitTime,reqVO.getVisitTime())
.orderByDesc(VisitManageDO::getId));
}
//实体类
@TableName("sale_visit_manage")
@KeySequence("sale_visit_manage_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class VisitManageDO extends BaseDO {
/**
* 主键id
*/
@TableId
private Long id;
/**
* 学员姓名
*/
private String studentName;
/**
* 手机号
*/
private String studentPhone;
/**
* 接待人员
*/
private String receptionPerson;
/**
* 学员来源
*
*
*/
private String studentSource;
/**
* 意向级别
*
*
*/
private String intentionLevel;
/**
* 当前年级
*
*
*/
private String studentGrade;
/**
* 就读学校
*
*
*/
private String studentSchool;
/**
* 是否试听
*/
private String listenStatus;
/**
* 是否签约
*/
private String signUpStatus;
/**
* 到访开始日期
*/
private LocalDate visitTimeBegin;
/**
* 到访日期
*/
private LocalDate visitTime;
/**
* 到访结束日期
*/
private LocalDate visitTimeEnd;
/**
* 备注
*/
private String remark;
}
原文地址:https://blog.csdn.net/2301_76604664/article/details/140364310
免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!