query wrapper根据时间区间查询
eq(Student::getName, "小芳").eq(Student::getSex, "女")
·
QueryWrapper<Student> queryWrapper = new QueryWrapper<>();
Date date = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String format = sdf.format(date);
queryWrapper.lambda()
.eq(Student::getName, "小芳")
.eq(Student::getSex, "女")
.le(Student::getStartTime,format)
.ge(Student::getEndTime,format);
List<Student> students= studentMapper.selectList(queryWrapper);
更多推荐
已为社区贡献10条内容
所有评论(0)