重构-系统配置模块

This commit is contained in:
季圣华
2019-03-09 14:11:34 +08:00
parent 691b494c69
commit 3a0f0191b4
12 changed files with 885 additions and 331 deletions

View File

@@ -31,13 +31,17 @@ public class SystemConfigComponent implements ICommonQuery {
}
private List<?> getSystemConfigList(Map<String, String> map) {
String search = map.get(Constants.SEARCH);
String companyName = StringUtil.getInfo(search, "companyName");
String order = QueryUtils.order(map);
return systemConfigService.select(QueryUtils.offset(map), QueryUtils.rows(map));
return systemConfigService.select(companyName, QueryUtils.offset(map), QueryUtils.rows(map));
}
@Override
public Long counts(Map<String, String> map) {
return systemConfigService.countSystemConfig();
String search = map.get(Constants.SEARCH);
String companyName = StringUtil.getInfo(search, "companyName");
return systemConfigService.countSystemConfig(companyName);
}
@Override

View File

@@ -33,12 +33,12 @@ public class SystemConfigService {
SystemConfigExample example = new SystemConfigExample();
return systemConfigMapper.selectByExample(example);
}
public List<SystemConfig> select(int offset, int rows) {
return systemConfigMapperEx.selectByConditionSystemConfig(offset, rows);
public List<SystemConfig> select(String companyName, int offset, int rows) {
return systemConfigMapperEx.selectByConditionSystemConfig(companyName, offset, rows);
}
public Long countSystemConfig() {
return systemConfigMapperEx.countsBySystemConfig();
public Long countSystemConfig(String companyName) {
return systemConfigMapperEx.countsBySystemConfig(companyName);
}
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
@@ -69,7 +69,7 @@ public class SystemConfigService {
public int checkIsNameExist(Long id, String name) {
SystemConfigExample example = new SystemConfigExample();
example.createCriteria().andIdNotEqualTo(id).andNameEqualTo(name);
example.createCriteria().andIdNotEqualTo(id).andCompanyNameEqualTo(name);
List<SystemConfig> list = systemConfigMapper.selectByExample(example);
return list.size();
}