0
点赞
收藏
分享

微信扫一扫

MySQL使用 QueryWrapper查询条件in可以直接使用数字的

zhyuzh3d 2022-05-17 阅读 72


Page<EventTagProcess> page = new Page<>(current, size);
QueryWrapper<EventTagProcess> qw = new QueryWrapper<>();

if (beginDate != null && !beginDate.equals("") && endDate != null && !endDate.equals("")) {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
beginDate = beginDate.concat(BEGIN_TIME);
endDate = endDate.concat(END_TIME);
Date startTime = formatter.parse(beginDate);
Date endTime = formatter.parse(endDate);
qw.between("create_time", startTime, endTime);
} catch (ParseException e) {
e.printStackTrace();
}
}
if (status != null) {
qw.eq("status", status);
} else {
qw.in("status", 0,1,3,4);
}
if (eventCode != null) {
qw.eq("event_code", eventCode);
}

qw.orderByDesc("id");
return eventTagProcessMapper.selectPage(page, qw);

不一样的结果的,使用需要注意

MySQL使用 QueryWrapper查询条件in可以直接使用数字的_Mysql


举报

相关推荐

0 条评论