| | |
| | | |
| | | @Override |
| | | public void addDataDic(String type, String code, Object value, String description) { |
| | | DataDictionaryCustom dic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(type, code); |
| | | addDataDic(type, code, value, description, true); |
| | | } |
| | | |
| | | String data = JSONObject.toJSONString(value); |
| | | @Override |
| | | public void addDataDic(String type, String code, Object value, String description, boolean isJson) { |
| | | DataDictionaryCustom dic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(type, code); |
| | | String data = null; |
| | | if (isJson) { |
| | | data = JSONObject.toJSONString(value); |
| | | } else { |
| | | data = (String) value; |
| | | } |
| | | |
| | | if (dic != null) { |
| | | dic.setValue(data); |
| | | dataDictionaryCustomMapper.updateById(dic); |
| | |
| | | dic.setDescription(description); |
| | | dataDictionaryCustomMapper.insert(dic); |
| | | } |
| | | |
| | | @Override |
| | | public String getDicByTypeAndCode(String type, String code) { |
| | | DataDictionaryCustom dic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(type, code); |
| | | if (dic != null) { |
| | | return dic.getValue(); |
| | | } |
| | | return null; |
| | | } |
| | | } |