方法12345678// 根据 entity 条件,删除记录int delete(@Param(Constants.WRAPPER) Wrapper<T> wrapper);// 删除(根据ID 批量删除)int deleteBatchIds(@Param(Constants.COLLECTION) Collection<? extends Serializable> idList);// 根据 ID 删除int deleteById(Serializable id);// 根据 columnMap 条件,删除记录int deleteByMap(@Param(Constants.COLUMN_MAP) Map<String, Object> columnMap); 测试代码delete123456@Testvoid delete() { QueryWrapper<BlogType> blogTypeQueryWrapper = new QueryWrapper<>(); blogTypeQueryWrapper.eq("name", "spring"); blogTypeMapper.delete(blogTypeQueryWrapper);} deleteBatchIds123456789@Testvoid deleteBatchIds() { List<Integer> idList = new ArrayList<>(); idList.add(29); idList.add(30); idList.add(31); int result = blogTypeMapper.deleteBatchIds(idList); System.out.println(result);} deleteById12345@Testvoid deleteById() { int result = blogTypeMapper.deleteById(32); System.out.println(result);} deleteByMap12345678@Testvoid deleteByMap() { Map<String, Object> map = new HashMap<>(16); map.put("name", 1); map.put("sortNum", 2); int result = blogTypeMapper.deleteByMap(map); System.out.println(result);}