|
@ -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 ";
|
|
@ -60,13 +78,16 @@ public class ZjxlSystemDictService extends BaseService {
|
|
|
if (systemDictType != null && systemDictType > 0){
|
|
|
sql += " and system_dict_type = "+systemDictType+"";
|
|
|
}
|
|
|
sql += " order by concat(system_dict_sort,system_dict_create_time) desc limit "+page+" , "+pagesize+"";
|
|
|
sql += " order by system_dict_sort asc,system_dict_create_time desc limit "+page+" , "+pagesize+"";
|
|
|
List<ZjxlSystemDict> systemDictList = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(ZjxlSystemDict.class));
|
|
|
return systemDictList;
|
|
|
}
|
|
|
|
|
|
public int allCount(){
|
|
|
public int allCount(String systemDictType){
|
|
|
String sql = "select count(*) from zjxl_system_dict ";
|
|
|
if (StringUtils.isNoneBlank(systemDictType)){
|
|
|
sql +="where system_dict_type ='"+systemDictType+"'";
|
|
|
}
|
|
|
Integer allCount = jdbcTemplate.queryForObject(sql, Integer.class);;
|
|
|
return allCount;
|
|
|
}
|
|
@ -87,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;
|
|
|
}
|
|
@ -97,16 +118,19 @@ public class ZjxlSystemDictService extends BaseService {
|
|
|
ZjxlSystemDict zjxlSystemDict = systemDictDao.findBySystemDictId(systemDictId);
|
|
|
if (zjxlSystemDict ==null){
|
|
|
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;
|
|
|
}
|
|
|
else{
|
|
|
if (StringUtils.isBlank(systemDictClassify)||StringUtils.isBlank(systemDictSubclassify)){
|
|
|
result.put("status",-2);
|
|
|
return result;
|
|
|
}
|
|
|
else{
|
|
|
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式
|