whyclxw
2025-06-12 04f425c6d56dcc370156daa3cc6e79b7234a1b3d
Merge branch 'master' of http://118.89.139.230:10101/r/powerIntelligenceSystem
2个文件已修改
1个文件已添加
50 ■■■■■ 已修改文件
src/main/java/com/whyc/controller/AlarmInspectionResultController.java 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/pojo/web_site/AlarmInspectionResult.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/AlarmInspectionResultService.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/controller/AlarmInspectionResultController.java
New file
@@ -0,0 +1,30 @@
package com.whyc.controller;
import com.github.pagehelper.PageInfo;
import com.whyc.dto.Response;
import com.whyc.pojo.web_site.AlarmInspectionResult;
import com.whyc.service.AlarmInspectionResultService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("alarmInspectionResult")
@Api(tags = "告警巡检历史表")
public class AlarmInspectionResultController {
    @Autowired
    private AlarmInspectionResultService service;
    @ApiOperation("查询分页")
    @GetMapping("getPage")
    public Response<PageInfo<AlarmInspectionResult>> getPage(@RequestParam Integer pageNum,@RequestParam Integer pageSize,
                                                             @RequestParam(required = false) Integer stationId,@RequestParam(required = false) Integer inspectionType) {
        return service.getPage(pageNum, pageSize,stationId,inspectionType);
    }
}
src/main/java/com/whyc/pojo/web_site/AlarmInspectionResult.java
@@ -11,7 +11,7 @@
@ToString
@Data
@TableName(schema = "web_site",value ="tb_alarm_inspection")
@TableName(schema = "web_site",value ="tb_alarm_inspection_result")
@ApiModel("告警巡检实时表")
public class AlarmInspectionResult {
src/main/java/com/whyc/service/AlarmInspectionResultService.java
@@ -1,11 +1,16 @@
package com.whyc.service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.whyc.dto.Response;
import com.whyc.mapper.AlarmInspectionResultMapper;
import com.whyc.pojo.web_site.AlarmInspectionResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service
public class AlarmInspectionResultService {
@@ -16,4 +21,15 @@
    public void add(AlarmInspectionResult result) {
        mapper.insert(result);
    }
    public Response<PageInfo<AlarmInspectionResult>> getPage(Integer pageNum, Integer pageSize, Integer stationId, Integer inspectionType) {
        PageHelper.startPage(pageNum, pageSize);
        QueryWrapper<AlarmInspectionResult> query = Wrappers.query();
        query.eq(stationId  != null,"station_id", stationId);
        query.eq(inspectionType  != null,"inspection_type", inspectionType);
        query.orderByDesc("id");
        List<AlarmInspectionResult> list = mapper.selectList(query);
        PageInfo<AlarmInspectionResult> pageInfo = new PageInfo<>(list);
        return new Response<PageInfo<AlarmInspectionResult>>().set(1, pageInfo);
    }
}