| | |
| | | @Override |
| | | public R checkOrInsert(DictBiz dictBiz) { |
| | | |
| | | LambdaQueryWrapper<DictBiz> lqw = Wrappers.<DictBiz>query().lambda().eq(DictBiz::getCode, dictBiz.getCode()).eq(DictBiz::getDictKey, dictBiz.getDictKey()); |
| | | LambdaQueryWrapper<DictBiz> lqw = Wrappers.<DictBiz>query().lambda().eq(DictBiz::getCode, dictBiz.getCode()).eq(DictBiz::getDictKey, dictBiz.getDictKey()).eq(DictBiz::getDictValue, dictBiz.getDictValue()); |
| | | Long cnt = baseMapper.selectCount((Func.isEmpty(dictBiz.getId())) ? lqw : lqw.notIn(DictBiz::getId, dictBiz.getId())); |
| | | if (cnt > 0L) { |
| | | return R.fail("字典已经存在!"); |