// 填充字典值
Vector vector = vectorMapper.selectByPrimaryKey(id);
VectorModel vectorModel = new VectorModel();
BeanCopyUtils.copy(vector, vectorModel);
List<String> dictidsList = new ArrayList<String>();
if (!StringUtils.isNullOrEmpty(vectorModel.getDamagelevel())) {
dictidsList.add(vectorModel.getDamagelevel());
}
if (!StringUtils.isNullOrEmpty(vectorModel.getDuration())) {
dictidsList.add(vectorModel.getDuration());
}
if (!StringUtils.isNullOrEmpty(vectorModel.getSecret())) {
dictidsList.add(vectorModel.getSecret());
}
if (dictidsList.size() != 0) {
DictExample de = new DictExample();
de.or().andIdIn(dictidsList);
List<Dict> dicts = dictMapper.selectByExample(de);
if (dicts != null && dicts.size() != 0) {
dicts.forEach(dict -> {
if (dict.getId().equals(vectorModel.getDamagelevel())) {
vectorModel.setDamagelevel(dict.getCnname());
} else if (dict.getId().equals(vectorModel.getSecret())) {
vectorModel.setSecret(dict.getCnname());
} else if (dict.getId().equals(vectorModel.getDuration())) {
vectorModel.setDuration(dict.getCnname());
}
});
}
}