Commit 89233536 authored by 张森's avatar 张森

检测信号查询sqlbug修改

趋势图添加bizOrgCode过滤
parent 8304bd21
......@@ -81,8 +81,9 @@ public class AlarmStatisticController extends AbstractBaseController {
@ApiOperation(value = "报警趋势统计")
@GetMapping("/statistic/trend")
public ResponseModel getSystemAlarmTrend(@RequestParam(value = "systemCode", required = false)String systemCode,
@RequestParam(value = "updateTime", required = false)String updateTime) {
return CommonResponseUtil.success(iFireFightingSystemService.getCenterSystemAlarmTrend(systemCode, updateTime));
@RequestParam(value = "updateTime", required = false)String updateTime,
@RequestParam(value = "bizOrgCode", required = false) String bizOrgCode) {
return CommonResponseUtil.success(iFireFightingSystemService.getCenterSystemAlarmTrend(systemCode, updateTime, bizOrgCode));
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
......
......@@ -173,8 +173,9 @@ public class BigScreenController extends AbstractBaseController {
@ApiOperation(value = "卡片BigSystem报警趋势统计")
@GetMapping("/statistic/trend")
public ResponseModel getSystemAlarmTrend(@RequestParam(value = "systemCode", required = false)String systemCode,
@RequestParam(value = "updateTime", required = false)String updateTime) {
return CommonResponseUtil.success(iFireFightingSystemService.getSystemAlarmTrend(systemCode, updateTime));
@RequestParam(value = "updateTime", required = false)String updateTime,
@RequestParam(value = "bizOrgCode", required = false) String bizOrgCode) {
return CommonResponseUtil.success(iFireFightingSystemService.getSystemAlarmTrend(systemCode, updateTime, bizOrgCode));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
......
......@@ -742,7 +742,7 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
Map<String, String> getSystemAlarmStatistic(@Param("systemCode") String systemCode, @Param("startDate") String startDate, @Param("endDate") String endDate);
List<Map<String, Object>> getSystemAlarmTrend(@Param("systemCode") String systemCode, @Param("updateTime") String updateTime);
List<Map<String, Object>> getSystemAlarmTrend(@Param("systemCode") String systemCode, @Param("updateTime") String updateTime, @Param("bizOrgCode") String bizOrgCode);
List<Map<String, Object>> getSystemAlarmTrendForSbpt(@Param("systemCode") String systemCode, @Param("updateTime") String updateTime);
......
......@@ -11,6 +11,7 @@ import com.yeejoin.equipmanage.common.entity.FireFightingSystemEntity;
import com.yeejoin.equipmanage.common.entity.dto.EquipTypeAmountPageDTO;
import com.yeejoin.equipmanage.common.entity.vo.*;
import com.yeejoin.equipmanage.common.vo.*;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.HashMap;
import java.util.List;
......@@ -348,9 +349,9 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
List<Map<String, String>> getSystemAlarmStatistic(String systemCode, String startDate, String endDate);
Map<String, Object> getSystemAlarmTrend(String systemCode, String updateTime);
Map<String, Object> getSystemAlarmTrend(String systemCode, String updateTime, String bizOrgCode);
Map<String, Object> getCenterSystemAlarmTrend(String systemCode, String updateTime);
Map<String, Object> getCenterSystemAlarmTrend(String systemCode, String updateTime, String bizOrgCode);
List<Map<String, Object>> getFireCannonInfo(String bizOrgCode);
......
......@@ -50,6 +50,7 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
......@@ -2760,11 +2761,11 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
}
@Override
public Map<String, Object> getSystemAlarmTrend(String systemCode, String updateTime) {
public Map<String, Object> getSystemAlarmTrend(String systemCode, String updateTime, String bizOrgCode) {
if(!StringUtil.isNotEmpty(updateTime)) {
updateTime = new SimpleDateFormat(DateUtils.DATE_PATTERN).format(new Date());
}
List<Map<String, Object>> result = fireFightingSystemMapper.getSystemAlarmTrend(systemCode, updateTime);
List<Map<String, Object>> result = fireFightingSystemMapper.getSystemAlarmTrend(systemCode, updateTime, bizOrgCode);
Map<String, Object> resMap = new HashMap<>();
resMap.put("xAxisData", result.stream().map(x -> x.get("date")).collect(Collectors.toList()));
List<Map<String, Object>> list = new ArrayList<>();
......@@ -2785,11 +2786,11 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
}
@Override
public Map<String, Object> getCenterSystemAlarmTrend(String systemCode, String updateTime) {
public Map<String, Object> getCenterSystemAlarmTrend(String systemCode, String updateTime, String bizOrgCode) {
if(!StringUtil.isNotEmpty(updateTime)) {
updateTime = new SimpleDateFormat(DateUtils.DATE_PATTERN).format(new Date());
}
List<Map<String, Object>> result = fireFightingSystemMapper.getSystemAlarmTrend(systemCode, updateTime);
List<Map<String, Object>> result = fireFightingSystemMapper.getSystemAlarmTrend(systemCode, updateTime, bizOrgCode);
Map<String, Object> resMap = new HashMap<>();
resMap.put("xAxisData", result.stream().map(x -> x.get("date")).collect(Collectors.toList()));
List<Map<String, Object>> list = new ArrayList<>();
......
......@@ -6706,6 +6706,9 @@
<if test="systemCode != null and systemCode != ''">
AND fs.`code` = #{systemCode}
</if>
<if test="bizOrgCode!=null and bizOrgCode!=''">
r.biz_org_code like concat(#{bizOrgCode}, '%')
</if>
</where>
GROUP BY
LEFT ( r.update_date, 10 )
......@@ -6998,7 +7001,7 @@
*
FROM
(
(SELECT count( 1 ) FROM wl_equipment_specific_index a LEFT JOIN wl_equipment_index b ON a.equipment_index_id = b.id WHERE b.is_iot = 1) AS indexNum,
(SELECT count( 1 ) AS indexNum FROM wl_equipment_specific_index a LEFT JOIN wl_equipment_index b ON a.equipment_index_id = b.id WHERE b.is_iot = 1) AS indexNum,
(SELECT count( 1 ) AS equipNum FROM wl_equipment_specific es LEFT JOIN wl_equipment e ON e.`code` = es.equipment_code WHERE e.is_iot = 1
<if test="bizOrgCode!=null and bizOrgCode!=''">
AND es.biz_org_code LIKE CONCAT(#{bizOrgCode},'%')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment