MYSQL查询整月
SELECT * FROM team_member WHERE create_time > '2021-08%'
SELECT create_time FROM team_member WHERE DATE_FORMAT(create_time,"%Y-%m") = '2020-08'
void test1() throws ParseException {
QueryWrapper<Member> wrapper = new QueryWrapper<>();
// wrapper.last("order by case when parent_id=0 then id else parent_id END,parent_id,id");
// wrapper.addFilter
// wrapper.eq("DATE_FORMAT(start_time,\"%Y-%m\")","2021-07");
String dateStr="2021-08-11";
Date userDate = new SimpleDateFormat("yyyy-MM").parse(dateStr);
String firstStr = new SimpleDateFormat("yyyy-MM").format(userDate);
// wrapper.eq("DATE_FORMAT(start_time,\"%Y-%m\")",firstStr);
wrapper.like("start_time",firstStr);
List<Member> members = memberMapper.selectList(wrapper);
members.forEach(System.out::println);
}