Commit a3d2aa39 authored by tianyiming's avatar tianyiming

直流中心bug修改

parent 16127e5c
......@@ -15,6 +15,7 @@ import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
......@@ -74,6 +75,43 @@ public class DCenterController extends AbstractBaseController {
return CommonResponseUtil.success(list);
}
@PersonIdentify
@RequestMapping(value = "/station-info", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "站点信息查询", produces = "application/json;charset=UTF-8", notes = "站点信息查询")
public ResponseModel stationInfo() {
return CommonResponseUtil.success(equipmentSpecificAlarmService.stationInfo());
}
@PersonIdentify
@RequestMapping(value = "/fireAlarmLogPage", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "消防报警列表分页查询", produces = "application/json;charset=UTF-8", notes = "消防报警列表分页查询")
public ResponseModel pageQuery(@RequestParam(required = false) String code,
@RequestParam(required = false) String typeCode,
@RequestParam(required = false) String bizOrgCode,
CommonPageable commonPageable) {
if (commonPageable.getPageNumber() == 0) {
commonPageable.setPageNumber(1);
}
ReginParams reginParams = getSelectedOrgInfo();
List<CommonRequest> queryRequests = new ArrayList<>();
CommonRequest request7 = new CommonRequest();
request7.setName("system");
request7.setValue(StringUtil.isNotEmpty(code) ? StringUtils.trimToNull(code) : null);
queryRequests.add(request7);
CommonRequest request8 = new CommonRequest();
request8.setName("specificIndexKey");
request8.setValue(StringUtil.isNotEmpty(typeCode) ? StringUtils.trimToNull(typeCode) : null);
queryRequests.add(request8);
CommonRequest request13 = new CommonRequest();
request13.setName("bizOrgCode");
request13.setValue(ObjectUtils.isEmpty(bizOrgCode) ? reginParams.getPersonIdentity().getBizOrgCode() : bizOrgCode);
queryRequests.add(request13);
CommonPageInfoParam param = CommonPageParamUtil.fillCommonPageInfoParam(queryRequests, commonPageable);
return CommonResponseUtil.success(equipmentSpecificAlarmService.dcFireAlarmLogPage(param));
}
/**
* 消防系统运行状态分页查询
* @param bizOrgCode
......
......@@ -223,6 +223,8 @@ public interface EquipmentSpecificAlarmMapper extends BaseMapper<EquipmentSpecif
, @Param("endTime") String endTime);
Page<Map<String, Object>> fireAlarmLogPage(Page page, @Param("param") CommonPageInfoParam param);
Page<Map<String, Object>> dcFireAlarmLogPage(Page page, @Param("param") CommonPageInfoParam param);
List<Map<String, Object>> alarmTrend(String bizOrgCode);
List<Map<String, Object>> stationInfo();
}
......@@ -96,6 +96,9 @@ public interface IEquipmentSpecificAlarmService extends IService<EquipmentSpecif
Page<Map<String, Object>> fireAlarmLogPage(CommonPageInfoParam param);
Page<Map<String, Object>> dcFireAlarmLogPage(CommonPageInfoParam param);
List<Map<String, Object>> stationInfo();
List<Map<String, Object>> alarmTrend(String bizOrgCode);
List<Map<String, Object>> allList(CommonPageInfoParam param);
......
......@@ -765,9 +765,19 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec
}
@Override
public Page<Map<String, Object>> dcFireAlarmLogPage(CommonPageInfoParam param) {
Page result = new Page<>(param.getPageNumber(), param.getPageSize());
return this.baseMapper.dcFireAlarmLogPage(result, param);
}
@Override
public List<Map<String, Object>> alarmTrend(String bizOrgCode) {
return this.baseMapper.alarmTrend(bizOrgCode);
}
@Override
public List<Map<String, Object>> stationInfo() {
return this.baseMapper.stationInfo();
}
@Override
public List<Map<String, Object>> allList(CommonPageInfoParam param) {
......
......@@ -1394,6 +1394,32 @@
ORDER BY
`wlesal`.`create_date` DESC
</select>
<select id="dcFireAlarmLogPage" resultType="java.util.HashMap">
SELECT
`wlesal`.equipment_specific_index_name type,
`wlesal`.equipment_specific_name alamContent,
DATE_FORMAT(`wlesal`.`create_date`,'%m-%d %H:%i:%s') createDate,
wlesal.location
FROM
`wl_equipment_specific_alarm_log` `wlesal`
LEFT JOIN `wl_equipment_specific_alarm` wesa ON wesa.id = wlesal.equipment_specific_alarm_id
LEFT JOIN `wl_equipment_specific` `wles` ON `wlesal`.`equipment_specific_id` = `wles`.`id`
<where>
wesa.`status` = 1
<if test="param.system != null and param.system != ''">
AND find_in_set( #{param.system}, `wlesal`.`system_codes` )
</if>
<if test="param.fireEquipmentSpecificIndexKey != null and param.fireEquipmentSpecificIndexKey != ''">
AND wlesal.type = #{param.fireEquipmentSpecificIndexKey}
</if>
<if test="param.bizOrgCode != null and param.bizOrgCode != ''">
AND wlesal.biz_org_code like concat (#{param.bizOrgCode},'%')
</if>
</where>
ORDER BY
`wlesal`.`create_date` DESC
</select>
<select id="alarmTrend" resultType="java.util.Map">
SELECT
`result`.`click_date` AS `click_date`,
......@@ -1479,4 +1505,31 @@
ORDER BY
`result`.`click_date`
</select>
<select id="stationInfo" resultType="java.util.Map">
SELECT
a.`name`,
a.`code`,
CASE
WHEN a.countAlarmTotal = 0 THEN
SUM( a.NAME ) ELSE count( a.`name` )
END AS alarmEquipTotal,
IFNULL( SUM( a.countAlarmTotal ), 0 ) countAlarmTotal
FROM
(
SELECT
fs.`name`,
fs.`code`,
IFNULL( sum( wesi.`status` ), 0 ) AS countAlarmTotal
FROM
idx_biz_station_info fs
LEFT JOIN wl_equipment_specific_alarm wesi ON wesi.station_code = fs.`code`
AND wesi.`status` = 1
GROUP BY
fs.id,
wesi.equipment_specific_id
) a
GROUP BY
a.`name`
</select>
</mapper>
\ No newline at end of file
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