| | |
| | |
|
| | | @Resource
|
| | | private ConfigMapper configMapper;
|
| | | |
| | |
|
| | | @Cacheable(value = "config")
|
| | | public List<Config> getAllList() {
|
| | |
| | | @Transactional
|
| | | public void update(List<Config> list) {
|
| | | for (Config config : list) {
|
| | | if (config.getValue() == null) {
|
| | | config.setValue("");
|
| | | }
|
| | | config.setCreatetime(new Date().getTime() + "");
|
| | | configMapper.updateByPrimaryKeySelective(config);
|
| | | }
|
| | |
| | |
|
| | | @CacheEvict(value = "config", allEntries = true)
|
| | | public void update(Config config) {
|
| | | if (config.getValue() == null)
|
| | | config.setValue("");
|
| | | |
| | | config.setCreatetime(new Date().getTime() + "");
|
| | | configMapper.updateByPrimaryKeySelective(config);
|
| | | }
|
| | |
| | | config.setCreatetime(currentTime + "");
|
| | | configMapper.updateByPrimaryKeySelective(config);
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | public Config getConfigBykeyNoCache(String key) {
|
| | | List<Config> list = configMapper.listByKey(key, null, null);
|
| | | if (list.size() == 0) {
|
| | | return null;
|
| | | }
|
| | | return list.get(0);
|
| | | }
|
| | | }
|