whyclxw
2022-01-18 d1b648071c23af0cf5df91cdf3b80cca70cbfc0f
在线监测-实时监控-LD9
3个文件已添加
1个文件已修改
81 ■■■■■ 已修改文件
src/main/java/com/whyc/controller/Ld9testdatastopController.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/mapper/Ld9testdatastopMapper.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/Ld9testdatastopService.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/Ld9testdatastopMapper.xml 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/controller/Ld9testdatastopController.java
New file
@@ -0,0 +1,31 @@
package com.whyc.controller;
import com.whyc.dto.Response;
import com.whyc.service.Ld9testdatastopService;
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;
@Api(tags = "在线监测-实时监控")
@RestController
@RequestMapping("Ld9testdatastopAction")
public class Ld9testdatastopController {
    @Autowired
    private Ld9testdatastopService service;
    @ApiOperation(value = "查询LD9测试组端数据",notes = "Ld9testdatastopAction_ld9action_serchByInfo")
    @GetMapping("serchByInfo")
    public Response serchByInfo(@RequestParam int testRecordCount, @RequestParam int battGroupId, @RequestParam int testMonNum){
        return  service.serchByInfo(testRecordCount,battGroupId,testMonNum);
    }
    @ApiOperation(value = "查询LD9一次测试中所有单体的实际容量",notes = "Ld9testdatastopAction_ld9action_serchByCondition")
    @GetMapping("serchByCondition")
    public Response serchByCondition(@RequestParam int testRecordCount, @RequestParam int battGroupId){
        return  service.serchByCondition(testRecordCount,battGroupId);
    }
}
src/main/java/com/whyc/mapper/Ld9testdatastopMapper.java
New file
@@ -0,0 +1,12 @@
package com.whyc.mapper;
import com.whyc.pojo.Ld9testdatastop;
import java.util.List;
public interface Ld9testdatastopMapper extends CustomMapper<Ld9testdatastop>{
    //查询LD9测试组端数据
    List<Ld9testdatastop> serchByInfo(int testRecordCount, int battGroupId, int testMonNum);
    //查询LD9一次测试中所有单体的实际容量
    List<Ld9testdatastop> serchByCondition(int testRecordCount, int battGroupId);
}
src/main/java/com/whyc/service/Ld9testdatastopService.java
@@ -1,7 +1,29 @@
package com.whyc.service;
import com.github.pagehelper.PageInfo;
import com.whyc.dto.Response;
import com.whyc.mapper.Ld9testdatastopMapper;
import com.whyc.pojo.Ld9testdatastop;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service
public class Ld9testdatastopService {
    @Resource
    private Ld9testdatastopMapper mapper;
    //查询LD9测试组端数据
    public Response serchByInfo(int testRecordCount, int battGroupId, int testMonNum) {
        List<Ld9testdatastop> list=mapper.serchByInfo(testRecordCount,battGroupId,testMonNum);
        PageInfo pageInfo=new PageInfo(list);
        return new Response().set(1,pageInfo);
    }
    //查询LD9一次测试中所有单体的实际容量
    public Response serchByCondition(int testRecordCount, int battGroupId) {
        List<Ld9testdatastop> list=mapper.serchByCondition(testRecordCount,battGroupId);
        PageInfo pageInfo=new PageInfo(list);
        return new Response().set(1,pageInfo);
    }
}
src/main/resources/mapper/Ld9testdatastopMapper.xml
New file
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.whyc.mapper.Ld9testdatastopMapper">
    <select id="serchByInfo" resultType="com.whyc.pojo.Ld9testdatastop">
        select num,BattGroupId,test_record_count,test_type,test_starttime,record_time,test_timelong,group_vol,test_curr,test_cap,mon_num,mon_vol,test_monnum,max_monvol,min_monvol,test_stopreason
        from db_ld9_testdata.tb_ld9testdatastop_${battGroupId}
        where test_record_count=#{testRecordCount} and test_monnum=#{testMonNum}
    </select>
    <select id="serchByCondition" resultType="com.whyc.pojo.Ld9testdatastop">
        select num,BattGroupId,test_record_count,test_type,test_starttime,record_time,test_timelong,group_vol,test_curr,test_cap,mon_num,mon_vol,test_monnum,max_monvol,min_monvol,test_stopreason
        from db_ld9_testdata.tb_ld9testdatastop_${battGroupId}
        where test_record_count=#{testRecordCount}
    </select>
</mapper>