- 如下图所示结构为QueryWrapper/UpdateWrapper的基本用法
- 关于增删改查SQL的基本范例
查询
List<Practice> list = practiceService.list(new QueryWrapper<Practice>().select("PracticeID", "PracticeName", "PracticeUser", "QuestionTypes", "QuestionSubjects", "CreateDate", "TotalCount", "PracticeCount", "WrongCount", "LastPracticeDate", "LastPracticeQuestionID", "LastPracticeQuestionSubID")
.eq("practiceid", parentid).eq("practiceUser ", practiceUser));
删除
mymistakeService.remove(new QueryWrapper<Mymistake>().eq("practiceid",parentid));
修改
mymistakeService.update(new UpdateWrapper<Mymistake>().set(parentid!=null,"par",parentid));
保存
Mymistake a = new Mymistake();
a.setId("aaa");
mymistakeService.save(a);
评论区