lxw
2022-07-14 22f6eef74d5aa6e8c660aef19cc081e8ef63303f
测试参数
5个文件已添加
389 ■■■■■ 已修改文件
src/main/java/com/whyc/controller/BattTestparamController.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/mapper/BattTestparamMapper.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/pojo/BattTestparam.java 304 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/BattTestparamService.java 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/BattTestparamMapper.xml 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/controller/BattTestparamController.java
New file
@@ -0,0 +1,25 @@
package com.whyc.controller;
import com.whyc.dto.Response;
import com.whyc.service.BattTestparamService;
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
@Api(tags = "历史监测")
@RequestMapping("BattTestparamController")
public class BattTestparamController {
    @Autowired
    private BattTestparamService service;
    @ApiOperation(value = "历史数据查看测试参数")
    @GetMapping("searchBattTestparam")
    private Response searchBattTestparam(@RequestParam int battGroupId, @RequestParam int testRecordCount) {
        return service.searchBattTestparam(battGroupId, testRecordCount);
    }
}
src/main/java/com/whyc/mapper/BattTestparamMapper.java
New file
@@ -0,0 +1,14 @@
package com.whyc.mapper;
import com.whyc.pojo.BattTestparam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface BattTestparamMapper extends CustomMapper<BattTestparam> {
    //判断表是否存在
    int judgeTable(@Param("battGroupId") String battGroupId);
    //查看测试参数
    List<BattTestparam> searchBattTestparam(int battGroupId, int testRecordCount);
}
src/main/java/com/whyc/pojo/BattTestparam.java
New file
@@ -0,0 +1,304 @@
package com.whyc.pojo;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
 * <p>
 *
 * </p>
 *
 * @author lxw
 * @since 2022-07-14
 */
@Data
@TableName(value = "tb_batt_testparam", schema = "db_dev_testparam")
@ApiModel(value = "BattTestparam对象", description = "")
public class BattTestparam implements Serializable {
    private static final long serialVersionUID = 1L;
    @TableId(value = "num", type = IdType.AUTO)
    private Long num;
    @ApiModelProperty(value = "参数更新时间")
    private Date recordTime;
    @ApiModelProperty(value = "电池组ID")
    @TableField("BattGroupId")
    private Integer battGroupId;
    @ApiModelProperty(value = "电池组放电次数对应db_batt_testdata.tb_batttestdata_inf")
    private Integer testRecordCount;
    private Integer opCmd;
    @ApiModelProperty(value = "测试类型")
    @TableField("TestCmd")
    private Integer testCmd;
    @ApiModelProperty(value = "放电小时率")
    @TableField("HourRate")
    private Integer hourRate;
    @ApiModelProperty(value = "放电电流(A)")
    @TableField("DisCurr")
    private Float disCurr;
    @ApiModelProperty(value = "放电容量(AH)")
    @TableField("DisCap")
    private Float disCap;
    @ApiModelProperty(value = "放电时长(分钟)")
    @TableField("DisTime")
    private Integer disTime;
    @ApiModelProperty(value = "组端下限(V)")
    @TableField("GroupVol_LOW")
    private Float groupvolLow;
    @ApiModelProperty(value = "单体下限(V)")
    @TableField("MonomerVol_LOW")
    private Float monomervolLow;
    @ApiModelProperty(value = "单体下限数量")
    @TableField("MonomerLowCount")
    private Integer monomerLowCount;
    @ApiModelProperty(value = "组号")
    @TableField("BattGroupNum")
    private Integer battGroupNum;
    @ApiModelProperty(value = "在线电压低处理")
    @TableField("OnlineVolLowAction")
    private Integer onlineVolLowAction;
    @ApiModelProperty(value = "升压上限(V)")
    @TableField("DCVolHighLimit")
    private Float dCVolHighLimit;
    @ApiModelProperty(value = "充电电流(V)")
    @TableField("ChargeCurrSet")
    private Float chargeCurrSet;
    @ApiModelProperty(value = "单体温度上限(℃)")
    @TableField("MonomerTmp_High")
    private Float monomertmpHigh;
    @TableField("AutoTestStartVol")
    private Float autoTestStartVol;
    @ApiModelProperty(value = "在线电压低阀值")
    @TableField("OnLineVol_Low")
    private Float onlinevolLow;
    @ApiModelProperty(value = "离线养护周期")
    @TableField("OffLineYH_Cycle")
    private Integer offlineyhCycle;
    @ApiModelProperty(value = "养护计划开始时间")
    @TableField("OffLineYHstarttime")
    private Date OffLineYHstarttime;
    @ApiModelProperty(value = "离线养护执行次数")
    @TableField("OffLineYHTimes")
    private Integer OffLineYHTimes;
    @ApiModelProperty(value = "离线养护每次执行周期")
    @TableField("OffLineYHOnceCycle")
    private Integer OffLineYHOnceCycle;
    @ApiModelProperty(value = "每组单体数")
    @TableField("MonCount")
    private Integer monCount;
    @ApiModelProperty(value = "单体电压")
    @TableField("MonVol")
    private Float monVol;
    @ApiModelProperty(value = "预放功率(0.1kw)")
    @TableField("DisPower")
    private Float disPower;
    @ApiModelProperty(value = "放电阻值(mΩ)")
    @TableField("DisPreRes")
    private Float disPreRes;
    @ApiModelProperty(value = "充电容量(AH)")
    @TableField("CharCap")
    private Integer charCap;
    @ApiModelProperty(value = "充电时长(min)")
    @TableField("CharTimeLong")
    private Integer charTimeLong;
    @ApiModelProperty(value = "浮充时长")
    @TableField("FloatCharTimeLong")
    private Integer floatCharTimeLong;
    @ApiModelProperty(value = "截止电流(0.1A)")
    @TableField("CharSotpCurr")
    private Float charSotpCurr;
    @ApiModelProperty(value = "单体上限(0.01V)")
    @TableField("MonVolHightLimit")
    private Float monVolHightLimit;
    @ApiModelProperty(value = "单体上限数量")
    @TableField("MonVolHightLimitCount")
    private Integer monVolHightLimitCount;
    @ApiModelProperty(value = "充电过温")
    @TableField("CharHighTmp")
    private Float charHighTmp;
    @ApiModelProperty(value = "放完静置(0-500分钟)")
    @TableField("DisWaitTime")
    private Integer disWaitTime;
    @ApiModelProperty(value = "充完静置(0-500分钟)")
    @TableField("CharWaitTime")
    private Integer charWaitTime;
    @ApiModelProperty(value = "恒流总阶段数[1-3]")
    @TableField("FlowOver_Count")
    private Integer flowoverCount;
    @ApiModelProperty(value = "恒流1阶段充电电流")
    @TableField("FlowOver_CharCurr_1")
    private Float flowoverCharcurr1;
    @ApiModelProperty(value = "恒流2阶段充电电流")
    @TableField("FlowOver_CharCurr_2")
    private Float flowoverCharcurr2;
    @ApiModelProperty(value = "恒流3阶段充电电流")
    @TableField("FlowOver_CharCurr_3")
    private Float flowoverCharcurr3;
    @ApiModelProperty(value = "恒流1阶段充电时长")
    @TableField("FlowOver_CharTime_1")
    private Integer flowoverChartime1;
    @ApiModelProperty(value = "恒流2阶段充电时长")
    @TableField("FlowOver_CharTime_2")
    private Integer flowoverChartime2;
    @ApiModelProperty(value = "恒流3阶段充电时长")
    @TableField("FlowOver_CharTime_3")
    private Integer flowoverChartime3;
    @ApiModelProperty(value = "充电电压(V)")
    @TableField("ChargeVolt")
    private Float chargeVolt;
    @ApiModelProperty(value = "恒流保护电压1")
    @TableField("C_ProtectVol1")
    private Float cprotectvol1;
    @ApiModelProperty(value = "恒流保护电压2")
    @TableField("C_ProtectVol2")
    private Float cprotectvol2;
    @ApiModelProperty(value = "恒流保护电压3")
    @TableField("C_ProtectVol3")
    private Float cprotectvol3;
    @ApiModelProperty(value = "恒流单体上限1")
    @TableField("C_mon_uppervol1")
    private Float cmonUppervol1;
    @ApiModelProperty(value = "恒流单体上限2")
    @TableField("C_mon_uppervol2")
    private Float cmonUppervol2;
    @ApiModelProperty(value = "恒流单体上限3")
    @TableField("C_mon_uppervol3")
    private Float cmonUppervol3;
    @ApiModelProperty(value = "恒流上限个数1")
    @TableField("C_mon_uppernum1")
    private Integer cmonUppernum1;
    @ApiModelProperty(value = "恒流上限个数2")
    @TableField("C_mon_uppernum2")
    private Integer cmonUppernum2;
    @ApiModelProperty(value = "恒流上限个数3")
    @TableField("C_mon_uppernum3")
    private Integer cmonUppernum3;
    @ApiModelProperty(value = "恒压总阶段数[1~3]")
    @TableField("HV_charge_num")
    private Integer hvChargeNum;
    @ApiModelProperty(value = "恒压阶段1充电电压")
    @TableField("HV_charge_Vol1")
    private Float hvChargeVol1;
    @ApiModelProperty(value = "恒压阶段2充电电压")
    @TableField("HV_charge_Vol2")
    private Float hvChargeVol2;
    @ApiModelProperty(value = "恒压阶段3充电电压")
    @TableField("HV_charge_Vol3")
    private Float hvChargeVol3;
    @ApiModelProperty(value = "恒压阶段1充电时间")
    @TableField("HV_time1")
    private Integer hvTime1;
    @ApiModelProperty(value = "恒压阶段2充电时间")
    @TableField("HV_time2")
    private Integer hvTime2;
    @ApiModelProperty(value = "恒压阶段3充电时间")
    @TableField("HV_time3")
    private Integer hvTime3;
    @ApiModelProperty(value = "恒压阶段1保护电流")
    @TableField("HV_ProtectCurr1")
    private Float hvProtectcurr1;
    @ApiModelProperty(value = "恒压阶段2保护电流")
    @TableField("HV_ProtectCurr2")
    private Float hvProtectcurr2;
    @ApiModelProperty(value = "恒压阶段3保护电流")
    @TableField("HV_ProtectCurr3")
    private Float hvProtectcurr3;
    @ApiModelProperty(value = "恒压阶段1单体上限")
    @TableField("HV_mon_uppervol1")
    private Float hvMonUppervol1;
    @ApiModelProperty(value = "恒压阶段2单体上限")
    @TableField("HV_mon_uppervol2")
    private Float hvMonUppervol2;
    @ApiModelProperty(value = "恒压阶段3单体上限")
    @TableField("HV_mon_uppervol3")
    private Float hvMonUppervol3;
    @ApiModelProperty(value = "恒压阶段1上限个数")
    @TableField("HV_mon_uppernum1")
    private Integer hvMonUppernum1;
    @ApiModelProperty(value = "恒压阶段2上限个数")
    @TableField("HV_mon_uppernum2")
    private Integer hvMonUppernum2;
    @ApiModelProperty(value = "恒压阶段3上限个数")
    @TableField("HV_mon_uppernum3")
    private Integer hvMonUppernum3;
}
src/main/java/com/whyc/service/BattTestparamService.java
New file
@@ -0,0 +1,29 @@
package com.whyc.service;
import com.github.pagehelper.PageInfo;
import com.whyc.dto.Response;
import com.whyc.mapper.BattTestparamMapper;
import com.whyc.pojo.BattTestparam;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service
public class BattTestparamService {
    @Resource
    private BattTestparamMapper mapper;
    //查看测试参数
    public Response searchBattTestparam(int battGroupId, int testRecordCount) {
        //判断表是否存在
        int tableNum = mapper.judgeTable(String.valueOf(battGroupId));
        if (tableNum > 0) {
            List<BattTestparam> list = mapper.searchBattTestparam(battGroupId, testRecordCount);
            PageInfo pageInfo = new PageInfo(list);
            return new Response().setII(1, list.size() > 0 ? true : false, pageInfo, "查询成功");
        } else {
            return new Response().setII(1, false, new PageInfo(), "测试参数不存在");
        }
    }
}
src/main/resources/mapper/BattTestparamMapper.xml
New file
@@ -0,0 +1,17 @@
<?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.BattTestparamMapper">
    <select id="judgeTable" resultType="java.lang.Integer">
        select count(*) as tableNum
        from INFORMATION_SCHEMA.TABLES
        where TABLE_SCHEMA = 'db_dev_testparam'
          and TABLE_NAME = 'tb_batt_testparam_${battGroupId}';
    </select>
    <select id="searchBattTestparam" resultType="com.whyc.pojo.BattTestparam">
        select distinct * from db_dev_testparam.tb_batt_testparam_#{battGroupId}
        <where>
            test_record_count=#{testRecordCount}
        </where>
    </select>
</mapper>