| | |
| | | package com.whyc.controller; |
| | | |
| | | import com.whyc.dto.Batt_Maint_Dealarm; |
| | | import com.whyc.dto.BattMaintDealarm; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.dto.paramter.BattinfPar; |
| | | import com.whyc.service.BadBattMonService; |
| | |
| | | */ |
| | | @PostMapping("/searchByInfo") |
| | | @ApiOperation(notes = "TODO ", value = "落后单体查询/searchByInfo") |
| | | public Response<List<Batt_Maint_Dealarm>> searchByInfo(@RequestBody BattinfPar battinfPar) { |
| | | public Response<List<BattMaintDealarm>> searchByInfo(@RequestBody BattinfPar battinfPar) { |
| | | |
| | | return service.searchByInfo(battinfPar);//TODO RZG |
| | | } |
| | |
| | | package com.whyc.controller; |
| | | |
| | | import com.whyc.dto.Batt_Maint_Dealarm; |
| | | import com.whyc.dto.BattMaintDealarm; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.pojo.Battinf; |
| | | import com.whyc.service.BattMaintService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 电池组单体统计分析查询 |
| | |
| | | */ |
| | | @PostMapping("/serchMonNum") |
| | | @ApiOperation(notes = "TODO ", value = "电池组单体统计分析查询/serchMonNum") |
| | | public Response<Object> serchMonNum(@RequestBody Batt_Maint_Dealarm bmd) { |
| | | public Response<Object> serchMonNum(@RequestBody BattMaintDealarm bmd) { |
| | | //TODO RZG |
| | | return service.serchMonNum(bmd); |
| | | } |
| | |
| | | package com.whyc.controller; |
| | | |
| | | import com.whyc.dto.AllModel; |
| | | import com.whyc.dto.Batt_Maint_Dealarm; |
| | | import com.whyc.dto.BattMaintDealarm; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.service.BattMaintDealarmService; |
| | | import io.swagger.annotations.Api; |
| | |
| | | //1.3根据电池组id查询电池的电导和充放电信息 |
| | | @PostMapping("searchLow") |
| | | @ApiOperation(notes = "TODO ", value = "电池组统计分析查询/serchLow") |
| | | public Response<List<AllModel>> searchLow(@RequestBody Batt_Maint_Dealarm bmd) { |
| | | public Response<List<AllModel>> searchLow(@RequestBody BattMaintDealarm bmd) { |
| | | //return battMaintDealarmService.searchLow(bmd); |
| | | return null; |
| | | } |
| | |
| | | */ |
| | | @PostMapping("searchByCondition") |
| | | @ApiOperation(notes = "TODO ", value = "蓄电池组后评估/searchByCondition") |
| | | public Response<List<AllModel>> searchByCondition(@RequestBody Batt_Maint_Dealarm bmd) { |
| | | public Response<List<AllModel>> searchByCondition(@RequestBody BattMaintDealarm bmd) { |
| | | |
| | | //return battMaintDealarmService.searchByCondition(bmd); |
| | | return null; |
| | |
| | | package com.whyc.controller; |
| | | |
| | | import com.whyc.dto.BattState; |
| | | import com.whyc.dto.Batt_Maint_Dealarm; |
| | | import com.whyc.dto.BattMaintDealarm; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.pojo.BattRtstate; |
| | | import com.whyc.service.BattRtstateService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | |
| | | @PostMapping("/searchBattLife") |
| | | @ApiOperation( value = "电池实时状态查询/searchBattLife") |
| | | public Response<List<BattState>> searchBattLife(@RequestBody Batt_Maint_Dealarm bmd) { |
| | | public Response<List<BattState>> searchBattLife(@RequestBody BattMaintDealarm bmd) { |
| | | |
| | | return service.searchBattLife(bmd); |
| | | } |
| | |
| | | package com.whyc.controller; |
| | | |
| | | import com.whyc.dto.Batt_Maint_Dealarm; |
| | | import com.whyc.dto.BattMaintDealarm; |
| | | import com.whyc.dto.Page; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.dto.paramter.AlarmPar; |
| | |
| | | return service.getAllByPage(page); |
| | | } |
| | | //测试 |
| | | public Response<List<Batt_Maint_Dealarm>> test(@RequestBody BattalarmData battalarmData){ |
| | | public Response<List<BattMaintDealarm>> test(@RequestBody BattalarmData battalarmData){ |
| | | return service.test(battalarmData); |
| | | } |
| | | @PostMapping("/serchByCondition") |
File was renamed from src/main/java/com/whyc/dto/Batt_Maint_Dealarm.java |
| | |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | @ApiModel |
| | | public class Batt_Maint_Dealarm implements Serializable { |
| | | public class BattMaintDealarm implements Serializable { |
| | | private Battinf binf; //battinf对象信息 |
| | | private BattalarmData adata; //Battalarm_data对象信息 |
| | | private BattMaintInf mainf; //Batt_maint_inf对象信息 |
| | |
| | | package com.whyc.mapper; |
| | | |
| | | import com.whyc.dto.Batt_Maint_Dealarm; |
| | | import com.whyc.dto.BattMaintDealarm; |
| | | import com.whyc.dto.paramter.BattinfPar; |
| | | import com.whyc.pojo.BadbattMon; |
| | | import com.whyc.pojo.BattRtstate; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | int updateByPrimaryKey(BadbattMon record); |
| | | |
| | | //落后单体查询:根据条件查询落后单体(用户管理的电池组) |
| | | List<Batt_Maint_Dealarm> searchByInfo(BattinfPar battinfPar); |
| | | List<BattMaintDealarm> searchByInfo(BattinfPar battinfPar); |
| | | |
| | | int searchNums(int uid); |
| | | |
| | |
| | | |
| | | List<BattInfAndEnduranceDTO> findBattProducerInfoByYearCode(@Param("yearCode") int yearCode,@Param("userId") int uId); |
| | | |
| | | List<Battinf> searchByTestType(@Param("tinf") BatttestdataInf tinf); |
| | | List<Battinf> searchByTestType(@Param("tinf") BatttestdataInf tinf,int userId); |
| | | } |
| | |
| | | package com.whyc.mapper; |
| | | |
| | | import com.whyc.dto.Batt_Maint_Dealarm; |
| | | import com.whyc.dto.BattMaintDealarm; |
| | | import com.whyc.pojo.Battinf; |
| | | import com.whyc.pojo.BatttestdataInf; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface BattMaintDealarmMapper extends CustomMapper<Batt_Maint_Dealarm>{ |
| | | public interface BattMaintDealarmMapper extends CustomMapper<BattMaintDealarm>{ |
| | | |
| | | List<Battinf> searchLow(Batt_Maint_Dealarm bmd); |
| | | List<Battinf> searchLow(BattMaintDealarm bmd); |
| | | |
| | | List<BatttestdataInf> searchByTestType(@Param("tinf") BatttestdataInf tinf); |
| | | } |
| | |
| | | package com.whyc.mapper; |
| | | |
| | | import com.whyc.dto.BattState; |
| | | import com.whyc.dto.Batt_Maint_Dealarm; |
| | | import com.whyc.dto.BattMaintDealarm; |
| | | import com.whyc.pojo.BattRtstate; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | |
| | | int updateByPrimaryKey(BattRtstate record); |
| | | |
| | | //电池组实时情况+实时电池续航能力查询 |
| | | List<BattState> searchBattLife(Batt_Maint_Dealarm bmd); |
| | | List<BattState> searchBattLife(BattMaintDealarm bmd); |
| | | |
| | | //作业管理-创建计划-创建计划 |
| | | BattRtstate getCurrentSate(int battGroupId); |
| | |
| | | |
| | | public interface BattSpareMapper extends CustomMapper<BattSpare> { |
| | | |
| | | int insertId(BattSpare spare); |
| | | |
| | | List<BattSpare> searchByCondition(@Param("spare") BattSpare spare); |
| | | } |
| | |
| | | package com.whyc.mapper; |
| | | |
| | | import com.whyc.dto.Batt_Maint_Dealarm; |
| | | import com.whyc.dto.BattMaintDealarm; |
| | | import com.whyc.dto.paramter.AlarmPar; |
| | | import com.whyc.dto.result.AlarmRes; |
| | | import com.whyc.dto.result.AlarmStaticRes; |
| | |
| | | |
| | | public interface BattalarmDataMapper extends CustomMapper<BattalarmData>{ |
| | | //测试 |
| | | List<Batt_Maint_Dealarm> test(BattalarmData battalarmData); |
| | | List<BattMaintDealarm> test(BattalarmData battalarmData); |
| | | |
| | | //历史告警查询 |
| | | List<AlarmRes> serchByInfo(AlarmPar par); |
| | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date recordTime; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @TableField(exist = false) |
| | | private Date recordTime1; |
| | | |
| | | private Integer testTimelong; |
| | | |
| | | private Integer testStoptype; |
| | |
| | | |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.dto.Batt_Maint_Dealarm; |
| | | import com.whyc.dto.BattMaintDealarm; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.dto.paramter.BattinfPar; |
| | | import com.whyc.mapper.BadbattMonMapper; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.swing.*; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | |
| | | @Resource |
| | | BadbattMonMapper badbattMonMapper; |
| | | |
| | | public Response<List<Batt_Maint_Dealarm>> searchByInfo(BattinfPar battinfPar) { |
| | | public Response<List<BattMaintDealarm>> searchByInfo(BattinfPar battinfPar) { |
| | | |
| | | //分页信息 |
| | | PageHelper.startPage(battinfPar.getPage().getPageCurr(), battinfPar.getPage().getPageSize()); |
| | | List<Batt_Maint_Dealarm> list = badbattMonMapper.searchByInfo(battinfPar); |
| | | PageInfo<Batt_Maint_Dealarm> pinfo = new PageInfo<>(list); |
| | | List<BattMaintDealarm> list = badbattMonMapper.searchByInfo(battinfPar); |
| | | PageInfo<BattMaintDealarm> pinfo = new PageInfo<>(list); |
| | | |
| | | return new Response<List<Batt_Maint_Dealarm>>().set(1, list, String.valueOf(pinfo.getTotal())); |
| | | return new Response<List<BattMaintDealarm>>().set(1, list, String.valueOf(pinfo.getTotal())); |
| | | } |
| | | //落后单体数量查询 |
| | | public Response searchNums() { |
| | |
| | | package com.whyc.service; |
| | | |
| | | import com.whyc.dto.AllModel; |
| | | import com.whyc.dto.Batt_Maint_Dealarm; |
| | | import com.whyc.dto.BattMaintDealarm; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.dto.ServiceModel; |
| | | import com.whyc.mapper.BattInfMapper; |
| | | import com.whyc.mapper.BattMaintDealarmMapper; |
| | | import com.whyc.mapper.BatttestdataInfMapper; |
| | | import com.whyc.pojo.Battinf; |
| | | import com.whyc.pojo.BatttestdataInf; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class BattMaintDealarmService { |
| | | @Resource |
| | | private BattMaintDealarmMapper mapper; |
| | | @Resource |
| | | private BattInfMapper battInfMapper; |
| | | |
| | | public Response searchLow(BattMaintDealarm bmd, int userId){ |
| | | BatttestdataInf tinf = new BatttestdataInf(); |
| | | List<Battinf> battinfList = battInfMapper.searchByTestType(tinf, userId); |
| | | BatttestdataInf tdata = bmd.getBtestinf(); |
| | | if (battinfList!=null && battinfList.size()>0){ |
| | | for (Battinf binf:battinfList) { |
| | | |
| | | } |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | } |
| | |
| | | package com.whyc.service; |
| | | |
| | | import com.whyc.dto.Batt_Maint_Dealarm; |
| | | import com.whyc.dto.BattMaintDealarm; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.dto.ServiceModel; |
| | | import com.whyc.mapper.BattMaintDealarmMapper; |
| | | import com.whyc.mapper.BattParamLowMapper; |
| | | import com.whyc.pojo.BattParamLow; |
| | | import com.whyc.pojo.Battinf; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | * @param bmd |
| | | * @return |
| | | */ |
| | | public Response<Object> serchMonNum(Batt_Maint_Dealarm bmd) { |
| | | public Response<Object> serchMonNum(BattMaintDealarm bmd) { |
| | | |
| | | List<Batt_Maint_Dealarm> list = null; //TODO dao.serchByCondition(bmd) 对应 实现 |
| | | List<BattMaintDealarm> list = null; //TODO dao.serchByCondition(bmd) 对应 实现 |
| | | // dao.serchByCondition(bmd); |
| | | // |
| | | BattParamLow lowCA=new BattParamLow(); |
| | |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.dto.BattState; |
| | | import com.whyc.dto.Batt_Maint_Dealarm; |
| | | import com.whyc.dto.BattMaintDealarm; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.mapper.BattRtstateMapper; |
| | | import com.whyc.pojo.BattRtstate; |
| | |
| | | * 落后单体查询:根据条件查询落后单体 |
| | | * @return |
| | | */ |
| | | public Response<List<BattState>> searchBattLife(Batt_Maint_Dealarm bmd) { |
| | | public Response<List<BattState>> searchBattLife(BattMaintDealarm bmd) { |
| | | |
| | | //分页信息 |
| | | PageHelper.startPage(bmd.getPage().getPageCurr(), bmd.getPage().getPageSize()); |
| | |
| | | } |
| | | |
| | | public Response add(BattSpare spare){ |
| | | int lastId = mapper.insert(spare); |
| | | mapper.insertId(spare); |
| | | int lastId = spare.getNum(); |
| | | if (lastId>0){ |
| | | BattSpareRecord record = new BattSpareRecord(); |
| | | record.setOperationType(0); |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.dto.AlarmDaoFactory; |
| | | import com.whyc.dto.Batt_Maint_Dealarm; |
| | | import com.whyc.dto.BattMaintDealarm; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.dto.paramter.AlarmPar; |
| | | import com.whyc.dto.result.AlarmRes; |
| | |
| | | return new Response<List<BattalarmData>>().set(1,iPage.getRecords(),String.valueOf(iPage.getTotal())); |
| | | } |
| | | //测试:根据电池组id查询所有的告警 |
| | | public Response<List<Batt_Maint_Dealarm>> test(BattalarmData balarm) { |
| | | public Response<List<BattMaintDealarm>> test(BattalarmData balarm) { |
| | | //分页信息 |
| | | PageHelper.startPage(1,20); |
| | | List<Batt_Maint_Dealarm> list=mapper.test(balarm); |
| | | PageInfo<Batt_Maint_Dealarm> pinfo=new PageInfo<Batt_Maint_Dealarm>(list); |
| | | return new Response<List<Batt_Maint_Dealarm>>().set(1,list,String.valueOf(pinfo.getPages())); |
| | | List<BattMaintDealarm> list=mapper.test(balarm); |
| | | PageInfo<BattMaintDealarm> pinfo=new PageInfo<BattMaintDealarm>(list); |
| | | return new Response<List<BattMaintDealarm>>().set(1,list,String.valueOf(pinfo.getPages())); |
| | | } |
| | | //电池告警实时查询 |
| | | public Response serchByCondition(AlarmPar par) { |
| | |
| | | from tb_badbatt_mon |
| | | where num = #{num,jdbcType=INTEGER} |
| | | </select> |
| | | <select id="searchByInfo" resultType="com.whyc.dto.Batt_Maint_Dealarm"> |
| | | <select id="searchByInfo" resultType="com.whyc.dto.BattMaintDealarm"> |
| | | SELECT SQL_CALC_FOUND_ROWS DISTINCT |
| | | web_site.tb_badbatt_mon.battgroupid, |
| | | web_site.tb_badbatt_mon.mon_num, |
| | |
| | | order by db_battinf.tb_battinf.battgroupid asc,test_starttime asc |
| | | |
| | | </select> |
| | | <select id="searchByTestType" resultType="com.whyc.pojo.BatttestdataInf"> |
| | | select battgroupid,test_curr,max_monvol,test_starttime,test_timelong,min_monvol,test_cap,min_monnum |
| | | from db_batt_testdata.tb_batttestdata_inf |
| | | <where> |
| | | db_batt_testdata.tb_batttestdata_inf.data_available=1 |
| | | <if test="tinf.battGroupId!=null"> |
| | | and battgroupid=#{tinf.battGroupId} |
| | | </if> |
| | | <if test="tinf.testRecordCount!=null"> |
| | | and test_record_count=#{tinf.testRecordCount} |
| | | </if> |
| | | <if test="tinf.recordTime!=null and tinf.recordTime1!=null"> |
| | | and record_time>=#{tinf.recordTime} and record_time<=#{tinf.recordTime1} |
| | | </if> |
| | | <if test="tinf.testType==2"><!--充电--> |
| | | and test_type=2 |
| | | </if> |
| | | <if test="tinf.testType==3 and tinf.testStartType==0"><!--放电 全部--> |
| | | and test_type=3 |
| | | </if> |
| | | <if test="tinf.testType==3 and tinf.testStartType==1"><!--停电放电--> |
| | | and (test_starttype<5 and test_type not in(2,9) and test_starttype!=2 AND test_starttype!=3) |
| | | </if> |
| | | <if test="tinf.testType==3 and tinf.testStartType==2"><!--假负载放电2--> |
| | | and (test_starttype=2 and test_type not in(2) ) |
| | | </if> |
| | | <if test="tinf.testType==3 and tinf.testStartType==3"><!--节能放电3--> |
| | | and (test_starttype=3 and test_type not in(2) ) |
| | | </if> |
| | | </where> |
| | | order by test_starttime desc |
| | | </select> |
| | | </mapper> |
| | |
| | | <?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.BattSpareMapper" > |
| | | <insert id="insertId" useGeneratedKeys="true" keyProperty="num" parameterType="com.whyc.pojo.BattSpare"> |
| | | <selectKey resultType="int" order="AFTER" keyProperty="num"> |
| | | select LAST_INSERT_ID() |
| | | </selectKey> |
| | | insert into db_battinf.tb_battspare (num,battProducer,battModel,battspare_time,MonCount,baojiGroup_id) |
| | | values (#{num},#{battProducer},#{battModel} ,#{battspareTime},#{monCount},#{baojiGroupId}) |
| | | </insert> |
| | | |
| | | |
| | | <select id="searchByCondition" resultType="com.whyc.pojo.BattSpare"> |
| | |
| | | <?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.BattalarmDataMapper" > |
| | | <resultMap id="bmd" type="com.whyc.dto.Batt_Maint_Dealarm"> |
| | | <resultMap id="bmd" type="com.whyc.dto.BattMaintDealarm"> |
| | | <association property="binf" javaType="com.whyc.pojo.Battinf"> |
| | | <result property="BattGroupId" column="BattGroupId"></result> |
| | | <result property="StationName" column="stationname"></result> |