一、根据id删除
@Test
public void deleteById( String studyId) {
int rows = userMapper.deleteById(studyId);
System.out.println("删除条数:" + rows);
}
@Test
public void deleteByBatchIds(String [] studyIdList) {
int rows = userMapper.deleteBatchIds(studyIdList));
System.out.println("删除条数:" + rows);
}
二、其他普通删除
@Test
public void deleteByMap() {
Map<String, Object> map = new HashMap<>();
map.put("name", "协和医院");
map.put("department", "心内科");
int rows = userMapper.deleteByMap(map);
System.out.println("删除条数:" + rows);
}
三、以条件构造器为参数删除
@Test
public void deleteByWrapper(String StudyUId){
QueryWrapper wrapper = new QueryWrapper();
wrapper.eq("studyUId",StudyUId);
int rows=ecgWarningMapper.delete(wrapper);
System.out.println("删除条数:" + rows);
}