Commit de333899 authored by 高建强's avatar 高建强

item:添加告警日志分页列表

parent 580e0230
package com.yeejoin.equipmanage.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.equipmanage.common.utils.*;
import com.yeejoin.equipmanage.service.IEquipmentSpecificAlarmService;
import io.swagger.annotations.Api;
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.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@RestController
@Api(tags = "组态需求 -- API")
@RequestMapping(value = "/configure", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class ConfigureController {
public class ConfigureController extends AbstractBaseController {
@Autowired
private IEquipmentSpecificAlarmService equipmentSpecificAlarmService;
@RequestMapping(value = "/alarmLogPage", 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 system, 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(system) ? StringUtils.trimToNull(system) : null);
queryRequests.add(request7);
if (!ValidationUtil.isEmpty(reginParams.getPersonIdentity())) {
CommonRequest request13 = new CommonRequest();
request13.setName("bizOrgCode");
request13.setValue(StringUtil.isNotEmpty(reginParams.getPersonIdentity().getBizOrgCode()) ? reginParams.getPersonIdentity().getBizOrgCode() : null);
queryRequests.add(request13);
}
CommonPageInfoParam param = CommonPageParamUtil.fillCommonPageInfoParam(queryRequests, commonPageable);
Page<Map<String, Object>> list = equipmentSpecificAlarmService.pageQuery(param);
return CommonResponseUtil.success(list);
}
}
......@@ -139,6 +139,8 @@ public interface EquipmentSpecificAlarmMapper extends BaseMapper<EquipmentSpecif
Page<Map<String, Object>> page(Page page, @Param("param") CommonPageInfoParam param);
Page<Map<String, Object>> pageQuery(Page page, @Param("param") CommonPageInfoParam param);
List<HashMap<String, Object>> getAlarmList(CommonPageInfoParam param);
......
......@@ -3,7 +3,6 @@ package com.yeejoin.equipmanage.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yeejoin.equipmanage.common.datasync.entity.FireEquipmentFireAlarm;
import com.yeejoin.equipmanage.common.dto.OrgUsrDto;
import com.yeejoin.equipmanage.common.entity.EquipmentSpecificAlarm;
import com.yeejoin.equipmanage.common.entity.EquipmentSpecificAlarmLog;
import com.yeejoin.equipmanage.common.entity.dto.AlarmDTO;
......@@ -31,6 +30,8 @@ public interface IEquipmentSpecificAlarmService extends IService<EquipmentSpecif
Page<Map<String, Object>> listPage(CommonPageInfoParam param);
Page<Map<String, Object>> pageQuery(CommonPageInfoParam param);
void handleExport(HttpServletResponse response, List<Long> ids, String alarmType);
List<HashMap<String, Object>> getColumn(String alarmType);
......@@ -65,15 +66,13 @@ public interface IEquipmentSpecificAlarmService extends IService<EquipmentSpecif
List<EquipmentSpecificAlarmLog> getConfirmUser();
//各种类型统计
Integer getcountAlarmtype(String tyep);
//统计已处理和未处理
Integer getcountAlarmHandle(String tyep);
/**
*
* <pre>
* 根据装备id和查询指定状态告警数据
* </pre>
......
......@@ -257,6 +257,32 @@
ORDER BY wlesal.create_date DESC
</select>
<select id="pageQuery" resultType="java.util.HashMap">
SELECT
`wlesal`.`id` AS `id`,
`wles`.`code` AS `code`,
`wlesal`.`equipment_specific_name` AS `specificName`,
`wlesal`.`equipment_specific_index_key` AS `indexKey`,
`wlesal`.`equipment_specific_index_name` AS `indexName`,
`wlesal`.`equipment_specific_id` AS `specificId`,
IF
( `wlesal`.`clean_time` IS NOT NULL, '已消除', '未消除' ) AS `cleanStatus`,
`wlesal`.`iot_code` AS `iotCode`,
`wlesal`.`create_date` AS `createDate`
FROM
`wl_equipment_specific_alarm_log` `wlesal`
LEFT JOIN `wl_equipment_specific` `wles` ON `wlesal`.`equipment_specific_id` = `wles`.`id`
<where>
<if test="param.system != null and param.system != ''">
find_in_set( #{param.system}, `wlesal`.`system_codes` )
</if>
<if test="param.bizOrgCode != null and param.bizOrgCode != ''">
AND wles.biz_org_code like concat (#{param.bizOrgCode},'%')
</if>
</where>
ORDER BY
`wlesal`.`create_date` DESC
</select>
<select id="pageAlarmsInfo" resultType="Map">
SELECT
d.*
......
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