Commit 50e06241 authored by suhuiguang's avatar suhuiguang

1.告警数量统计

parent f983f414
......@@ -113,4 +113,17 @@ public class MsgLogController extends BaseController {
public ResponseModel<List<MsgLogDto>> selectForList() {
return ResponseHelper.buildResponse(msgLogServiceImpl.queryForMsgLogList());
}
}
/**
* 告警数量统计
*
* @return Integer
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "告警数量统计", notes = "告警数量统计")
@GetMapping(value = "/count")
public ResponseModel<Integer> countByTerminalType(
@RequestParam(value = "terminalType",required = false) String terminalType) {
return ResponseHelper.buildResponse(msgLogServiceImpl.countByTerminalType(terminalType));
}
}
\ No newline at end of file
package com.yeejoin.amos.boot.module.tzs.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.boot.module.tzs.api.entity.MsgLog;
import com.yeejoin.amos.boot.module.tzs.api.mapper.MsgLogMapper;
import com.yeejoin.amos.boot.module.tzs.api.service.IMsgLogService;
import com.yeejoin.amos.boot.module.tzs.api.dto.MsgLogDto;
import org.apache.commons.lang3.StringUtils;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
......@@ -30,4 +32,8 @@ public class MsgLogServiceImpl extends BaseService<MsgLogDto,MsgLog,MsgLogMapper
public List<MsgLogDto> queryForMsgLogList() {
return this.queryForList("" , false);
}
public Integer countByTerminalType(String terminalType) {
return this.list(new LambdaQueryWrapper<MsgLog>().eq(StringUtils.isNotEmpty(terminalType),MsgLog::getTerminalType,terminalType)).size();
}
}
\ 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