|
@@ -428,19 +428,17 @@ public class StatisticServiceImpl implements StatisticService {
|
|
|
|
|
|
|
|
// 定义不同状态的条件
|
|
// 定义不同状态的条件
|
|
|
Map<String, String> statusConditions = new HashMap<>();
|
|
Map<String, String> statusConditions = new HashMap<>();
|
|
|
- statusConditions.put("停用", "she_bei_zhuang_ta='停用' and di_dian_='%s'");
|
|
|
|
|
- statusConditions.put("合格", "she_bei_zhuang_ta='合格' and di_dian_='%s'");
|
|
|
|
|
|
|
+ statusConditions.put("暂停使用", "she_bei_zhuang_ta='暂停使用' and di_dian_='%s'");
|
|
|
|
|
+ statusConditions.put("正常使用", "she_bei_zhuang_ta='正常使用' and di_dian_='%s'");
|
|
|
statusConditions.put("总和", "di_dian_='%s'");
|
|
statusConditions.put("总和", "di_dian_='%s'");
|
|
|
- statusConditions.put("限用", "she_bei_zhuang_ta='限用' and di_dian_='%s'");
|
|
|
|
|
- statusConditions.put("报废", "she_bei_zhuang_ta='报废' and di_dian_='%s'");
|
|
|
|
|
|
|
+ statusConditions.put("停止使用", "she_bei_zhuang_ta='停止使用' and di_dian_='%s'");
|
|
|
|
|
|
|
|
// 定义每个状态对应的字段名
|
|
// 定义每个状态对应的字段名
|
|
|
Map<String, String> fieldNameMap = new HashMap<>();
|
|
Map<String, String> fieldNameMap = new HashMap<>();
|
|
|
- fieldNameMap.put("停用", "numS");
|
|
|
|
|
- fieldNameMap.put("合格", "numR");
|
|
|
|
|
|
|
+ fieldNameMap.put("暂停使用", "numS");
|
|
|
|
|
+ fieldNameMap.put("正常使用", "numR");
|
|
|
fieldNameMap.put("总和", "numAll");
|
|
fieldNameMap.put("总和", "numAll");
|
|
|
- fieldNameMap.put("限用", "numLimit");
|
|
|
|
|
- fieldNameMap.put("报废", "numScrap");
|
|
|
|
|
|
|
+ fieldNameMap.put("停止使用", "numScrap");
|
|
|
|
|
|
|
|
// 处理每个状态
|
|
// 处理每个状态
|
|
|
for (Map.Entry<String, String> entry : statusConditions.entrySet()) {
|
|
for (Map.Entry<String, String> entry : statusConditions.entrySet()) {
|
|
@@ -528,16 +526,14 @@ public class StatisticServiceImpl implements StatisticService {
|
|
|
"FROM ibps_party_entity p LEFT JOIN t_sbdj q ON q.bian_zhi_bu_men_ = p.id_ AND %s" +
|
|
"FROM ibps_party_entity p LEFT JOIN t_sbdj q ON q.bian_zhi_bu_men_ = p.id_ AND %s" +
|
|
|
"WHERE p.path_ like '%%%s%%' AND p.depth_ >= 3 GROUP BY p.id_, p.name_, p.depth_";
|
|
"WHERE p.path_ like '%%%s%%' AND p.depth_ >= 3 GROUP BY p.id_, p.name_, p.depth_";
|
|
|
|
|
|
|
|
- String stop = " she_bei_zhuang_ta='停用' and di_dian_='"+getDiDian()+"' ";
|
|
|
|
|
- String enable = " she_bei_zhuang_ta='合格' and di_dian_='"+getDiDian()+"' ";
|
|
|
|
|
|
|
+ String stop = " she_bei_zhuang_ta='暂停使用' and di_dian_='"+getDiDian()+"' ";
|
|
|
|
|
+ String enable = " she_bei_zhuang_ta='正常使用' and di_dian_='"+getDiDian()+"' ";
|
|
|
String sum = " di_dian_='"+getDiDian()+"'";
|
|
String sum = " di_dian_='"+getDiDian()+"'";
|
|
|
- String limit = " she_bei_zhuang_ta='限用' and di_dian_='"+getDiDian()+"' ";
|
|
|
|
|
- String scrap = " she_bei_zhuang_ta='报废' and di_dian_='"+getDiDian()+"' ";
|
|
|
|
|
|
|
+ String scrap = " she_bei_zhuang_ta='停止使用' and di_dian_='"+getDiDian()+"' ";
|
|
|
|
|
|
|
|
String stopSql = String.format(sql,stop,getDiDian());
|
|
String stopSql = String.format(sql,stop,getDiDian());
|
|
|
String enableSql = String.format(sql,enable,getDiDian());
|
|
String enableSql = String.format(sql,enable,getDiDian());
|
|
|
String sumSql = String.format(sql,sum,getDiDian());
|
|
String sumSql = String.format(sql,sum,getDiDian());
|
|
|
- String limitSql = String.format(sql,limit,getDiDian());
|
|
|
|
|
String scrapSql = String.format(sql,scrap,getDiDian());
|
|
String scrapSql = String.format(sql,scrap,getDiDian());
|
|
|
|
|
|
|
|
List<Map<String, Object>> stopList = (List<Map<String, Object>>) commonDao.query(stopSql);
|
|
List<Map<String, Object>> stopList = (List<Map<String, Object>>) commonDao.query(stopSql);
|
|
@@ -601,26 +597,6 @@ public class StatisticServiceImpl implements StatisticService {
|
|
|
intactData.add(intac);
|
|
intactData.add(intac);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- List<Map<String, Object>> limitList = (List<Map<String, Object>>) commonDao.query(limitSql);
|
|
|
|
|
- for (Map<String, Object> map : limitList){
|
|
|
|
|
- EquipIntactDTO intac = new EquipIntactDTO();
|
|
|
|
|
- intac.setOrg(map.get("name_").toString());
|
|
|
|
|
- intac.setDepth(Integer.parseInt(map.get("depth_").toString()));
|
|
|
|
|
- intac.setNumLimit(Integer.parseInt(map.get("value").toString()));
|
|
|
|
|
- limitNum = limitNum + Integer.parseInt(map.get("value").toString());
|
|
|
|
|
- existsDept.add(map.get("name_").toString());
|
|
|
|
|
- intactData.add(intac);
|
|
|
|
|
- }
|
|
|
|
|
- for (Map<String, Object> map : limitList){
|
|
|
|
|
- if ("3".equals(map.get("depth_").toString())){
|
|
|
|
|
- EquipIntactDTO intac = new EquipIntactDTO();
|
|
|
|
|
- intac.setOrg(map.get("name_").toString());
|
|
|
|
|
- intac.setDepth(Integer.parseInt(map.get("depth_").toString()));
|
|
|
|
|
- intac.setNumLimit(limitNum);
|
|
|
|
|
- existsDept.add(map.get("name_").toString());
|
|
|
|
|
- intactData.add(intac);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
List<Map<String, Object>> scrapList = (List<Map<String, Object>>) commonDao.query(scrapSql);
|
|
List<Map<String, Object>> scrapList = (List<Map<String, Object>>) commonDao.query(scrapSql);
|
|
|
for (Map<String, Object> map : scrapList){
|
|
for (Map<String, Object> map : scrapList){
|
|
|
EquipIntactDTO intac = new EquipIntactDTO();
|
|
EquipIntactDTO intac = new EquipIntactDTO();
|
|
@@ -679,7 +655,7 @@ public class StatisticServiceImpl implements StatisticService {
|
|
|
// 设备总数
|
|
// 设备总数
|
|
|
EquipTotalityDTO totalityDTO = new EquipTotalityDTO();
|
|
EquipTotalityDTO totalityDTO = new EquipTotalityDTO();
|
|
|
totalityDTO.setSum(total);
|
|
totalityDTO.setSum(total);
|
|
|
- String stopSQL= "SELECT COUNT(*) as nums from t_sbdj WHERE she_bei_zhuang_ta='停用' and di_dian_='%s'";
|
|
|
|
|
|
|
+ String stopSQL= "SELECT COUNT(*) as nums from t_sbdj WHERE she_bei_zhuang_ta='暂停使用' and di_dian_='%s'";
|
|
|
stopSQL = String.format(stopSQL,getDiDian());
|
|
stopSQL = String.format(stopSQL,getDiDian());
|
|
|
int stopNums = Integer.parseInt(commonDao.queryOne(stopSQL).get("nums").toString());
|
|
int stopNums = Integer.parseInt(commonDao.queryOne(stopSQL).get("nums").toString());
|
|
|
totalityDTO.setStop(stopNums);
|
|
totalityDTO.setStop(stopNums);
|