|
@ -51,6 +51,24 @@ public class ZjxlSystemDictService extends BaseService {
|
|
|
return articleContentList;
|
|
|
}
|
|
|
|
|
|
public int findSystemDictClassifyByCondition(String systemDictClassify,String dictId){
|
|
|
String sql = "select count(1) from zjxl_system_dict where system_dict_classify = '"+systemDictClassify+"' ";
|
|
|
if (StringUtils.isNoneBlank(dictId)){
|
|
|
sql +="and system_dict_id <>'"+dictId+"' ";
|
|
|
}
|
|
|
Integer articleContentList = jdbcTemplate.queryForObject(sql, Integer.class);
|
|
|
return articleContentList;
|
|
|
}
|
|
|
|
|
|
public int findSystemDictSubclassifyByCondition(String systemDictSubclassify,String dictId){
|
|
|
String sql = "select count(1) from zjxl_system_dict where system_dict_subclassify = '"+systemDictSubclassify+"' ";
|
|
|
if (StringUtils.isNoneBlank(dictId)){
|
|
|
sql +="and system_dict_id <>'"+dictId+"' ";
|
|
|
}
|
|
|
Integer articleContentList = jdbcTemplate.queryForObject(sql, Integer.class);
|
|
|
return articleContentList;
|
|
|
}
|
|
|
|
|
|
|
|
|
public List<ZjxlSystemDict> findSystemDictById(String id,Integer systemDictType,Integer page,Integer pagesize){
|
|
|
String sql = "select * from zjxl_system_dict where 1=1 ";
|
|
@ -90,7 +108,7 @@ public class ZjxlSystemDictService extends BaseService {
|
|
|
if (systemDictType != null && systemDictType > 0){
|
|
|
sql += " and system_dict_type = "+systemDictType+"";
|
|
|
}
|
|
|
sql += " group by system_dict_classify ";
|
|
|
sql += " and system_dict_is_line ='1' group by system_dict_classify ";
|
|
|
List<ZjxlSystemDict> systemDictList = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(ZjxlSystemDict.class));
|
|
|
return systemDictList;
|
|
|
}
|
|
@ -102,9 +120,9 @@ public class ZjxlSystemDictService extends BaseService {
|
|
|
result.put("status",-1);
|
|
|
return result;
|
|
|
}
|
|
|
int systemDictClassifyList = findSystemDictClassify(systemDictClassify);
|
|
|
int systemDictClassifyList = findSystemDictClassifyByCondition(systemDictClassify,systemDictId);
|
|
|
//查询子分类是否存在
|
|
|
int systemDictSubclassifyList = findSystemDictSubclassify(systemDictSubclassify);
|
|
|
int systemDictSubclassifyList = findSystemDictSubclassifyByCondition(systemDictSubclassify,systemDictId);
|
|
|
if (systemDictClassifyList>0&&systemDictSubclassifyList>0){
|
|
|
result.put("status",0);
|
|
|
return result;
|