example
相当于where
updateByExampleSelective
第一个参数是 表 和 set哪个字段
第二个参数是 example where
使用案例:
public void deleteByListCode(String listCode) {
if (StringUtils.isBlank(listCode)) {
throw new BusinessException(DefaultErrorConstant.CRUD_DELETE_PARAM_FAIL);
}
// set:baProdListDetail where: example
BaProdListDetail baProdListDetail = new BaProdListDetail();
baProdListDetail.setStatus(BusinessConstants.STATUS_DELETE);
Example example = new Example(BaProdListDetail.class);
Example.Criteria criteria = example.createCriteria();
criteria.andEqualTo("listCode", listCode);
baProdListDetailMapper.updateByExampleSelective(baProdListDetail, example);
}