String startDate = "2022-10-10";
String endDate = "2022-10-30";
QueryWrapper<BpSubscribe> queryWrapper = new QueryWrapper<>();
queryWrapper.select().apply(StrUtil.isNotBlank(startDate),
"date_format (create_date,'%Y-%m-%d') >= date_format('" + startDate + "','%Y-%m-%d')")
.apply(StrUtil.isNotBlank(endDate),
"date_format (create_date,'%Y-%m-%d') <= date_format('" + endDate + "','%Y-%m-%d')");
List<BpSubscribe> bpSubscribes = bpSubscribeService.list(queryWrapper);
MybatisPlus queries by time period
Guess you like
Origin blog.csdn.net/weixin_43192102/article/details/127517798
Ranking