src/main/java/com/whyc/controller/BattMaintDealarmController.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/whyc/controller/Fbs9100StateController.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/whyc/mapper/BattMaintDealarmMapper.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/whyc/mapper/Fbs9100StateMapper.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/whyc/service/BattMaintDealarmService.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/whyc/service/Fbs9100StateService.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/resources/mapper/BattMaintDealarmMapper.xml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/resources/mapper/Fbs9100StateMapper.xml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/main/java/com/whyc/controller/BattMaintDealarmController.java
@@ -35,9 +35,8 @@ @PostMapping("searchLow") @ApiOperation(notes = "TODO ", value = "电池组统计分析查询/serchLow") public Response<List<AllModel>> searchLow(@RequestBody Batt_Maint_Dealarm bmd) { return battMaintDealarmService.searchLow(bmd); // return null; //return battMaintDealarmService.searchLow(bmd); return null; } /** @@ -47,7 +46,7 @@ @ApiOperation(notes = "TODO ", value = "蓄电池组后评估/searchByCondition") public Response<List<AllModel>> searchByCondition(@RequestBody Batt_Maint_Dealarm bmd) { return battMaintDealarmService.searchByCondition(bmd); // return null; //return battMaintDealarmService.searchByCondition(bmd); return null; } } src/main/java/com/whyc/controller/Fbs9100StateController.java
@@ -1,7 +1,9 @@ package com.whyc.controller; import com.whyc.dto.Response; import com.whyc.pojo.UserInf; import com.whyc.service.Fbs9100StateService; import com.whyc.util.ActionUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; @@ -23,4 +25,11 @@ private Response serchContactorState(@RequestParam int devId){ return service.serchContactorState(devId); } @ApiOperation("FBS9100设备通信状态查询") @GetMapping("/searchByCondition") public Response searchByCondition(@RequestParam int devErrcommcount){ UserInf userInf = ActionUtil.getUser(); return service.searchByCondition(devErrcommcount,userInf.getUId().intValue()); } } src/main/java/com/whyc/mapper/BattMaintDealarmMapper.java
@@ -7,5 +7,5 @@ public interface BattMaintDealarmMapper extends CustomMapper<Batt_Maint_Dealarm>{ List<Battinf> serchLow(Batt_Maint_Dealarm bmd); List<Battinf> searchLow(Batt_Maint_Dealarm bmd); } src/main/java/com/whyc/mapper/Fbs9100StateMapper.java
@@ -1,6 +1,10 @@ package com.whyc.mapper; import com.whyc.pojo.Fbs9100State; import org.apache.ibatis.annotations.Param; import java.util.List; public interface Fbs9100StateMapper extends CustomMapper<Fbs9100State>{ List<Fbs9100State> searchByCondition(@Param("devErrcommcount") int devErrcommcount, @Param("uId") int uId); } src/main/java/com/whyc/service/BattMaintDealarmService.java
@@ -18,253 +18,4 @@ @Service public class BattMaintDealarmService { @Resource private BatttestdataInfService service; @Resource private BattMaintDealarmMapper mapper; @Resource private BattInfMapper battInfMapper; @Resource private BatttestdataInfMapper batttestdataInfMapper; /** * //1.2电池组统计分析查询 * * @param bmd * @return */ // SELECT DISTINCT // ( // db_battinf.tb_battinf.BattgroupId // ), // StationName1, // StationName, // stationip, // BattGroupName, // BattGroupName1, // moncount, // moncapstd, // monvolstd, // battproducer, // battproductdate, // battinusedate, // db_batt_testdata.tb_batttestdata_inf.test_record_count, // test_starttime // FROM // db_battinf.tb_battinf, // db_batt_testdata.tb_batttestdata_inf // WHERE // db_battinf.tb_battinf.battgroupid = db_batt_testdata.tb_batttestdata_inf.battgroupid // AND record_time >=? // AND record_time <=? // // <if test="battGroupId==0"> // and db_battinf.tb_battinf.battgroupid!=#{battGroupId} // </if> // <if test="battGroupId!=0"> // and db_battinf.tb_battinf.battgroupid==#{battGroupId} // </if> // // // AND db_battinf.tb_battinf.BattgroupId IN ( // SELECT DISTINCT // db_battinf.tb_battinf.battgroupid // FROM // db_battinf.tb_battinf, // db_user.tb_user_battgroup_baojigroup_battgroup, // db_user.tb_user_battgroup_baojigroup_usr, // db_user.tb_user_inf // WHERE // db_user.tb_user_battgroup_baojigroup_battgroup.BattGroupId = db_battinf.tb_battinf.BattGroupId // AND db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id = db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id // AND db_user.tb_user_inf.uid = db_user.tb_user_battgroup_baojigroup_usr.uid // AND db_user.tb_user_inf.uid =? // AND db_battinf.tb_battinf.stationname1 LIKE ? // AND db_battinf.tb_battinf.stationname LIKE ? // ) // // // <if test="test_type==2"> // and test_type=2 //充电 // </if> // ////用于放电类型 ////全部 // <if test="test_type==3&&test_starttype=0"> // and test_type=3 // </if> // <if test="test_type==3&&test_starttype=1"> // and (test_starttype<5 and test_type not in(2,9) and test_starttype!=2 AND test_starttype!=3) // </if> // <if test="test_type==3&&test_starttype=2"> // and (test_starttype=2 and test_type not in(2) ) // </if> // <if test="test_type==3&&test_starttype=3"> // and (test_starttype=3 and test_type not in(2) ) // </if> // order by db_battinf.tb_battinf.battgroupid asc,test_starttime asc // //TODO rzg battInfMapper public Response<List<AllModel>> searchLow(Batt_Maint_Dealarm bmd) { BatttestdataInf tdata = bmd.getBtestinf();//设定时间 List<Battinf> list = null; // List<Battinf> list = battInfMapper.serchByTestType(bmd); List<AllModel> listAll = new ArrayList<AllModel>(); if (list != null && list.size() > 0) { for (int i = 0; i < list.size(); i++) { Battinf binf = list.get(i); tdata.setBattGroupId(binf.getBattGroupId()); tdata.setGroupVol(binf.getMonVolStd());//标存电压 tdata.setTestCap(binf.getMonCapStd());//标存容量 tdata.setTestRecordCount(binf.getNum());//次数 //该电池组的放电结果 List list1 = null;//该电池组的放电结果 // List list1 = batttestdataInfMapper.serchDischargeTest(tdata);//该电池组的放电结果 ServiceModel model = new ServiceModel(); if (list1 != null && list1.size() > 0) { model.setCode(1); model.setData(list1);//1.2电池组统计分析查询 model.setMsg("查询成功!"); } else { model.setCode(0); model.setMsg("查询失败!"); } AllModel allmodel = new AllModel(); allmodel.setData(list.get(i)); allmodel.setTmodel(model); listAll.add(allmodel); } } return new Response<List<AllModel>>().set(1,listAll); // return null; } /** * 电池组性能评估 * * @param bmd * @return */ //TODO rzg battInfMapper // SELECT SQL_CALC_FOUND_ROWS DISTINCT // ( // db_battinf.tb_battinf.BattgroupId // ), // db_battinf.tb_battinf.stationid, // StationName1, // StationName, // stationip, // BattGroupName, // BattGroupName1, // moncount, // moncapstd, // monvolstd, // battproducer, // battproductdate, // battinusedate // FROM // db_battinf.tb_battinf // WHERE 1=1 // // <if test="battGroupId==0"> // and db_battinf.tb_battinf.battgroupid!=#{battGroupId} // </if> // // <if test="battGroupId!=0"> // and db_battinf.tb_battinf.battgroupid==#{battGroupId} // </if> // // AND db_battinf.tb_battinf.BattgroupId IN ( // SELECT DISTINCT // db_battinf.tb_battinf.battgroupid // FROM // db_battinf.tb_battinf, // db_user.tb_user_battgroup_baojigroup_battgroup, // db_user.tb_user_battgroup_baojigroup_usr, // db_user.tb_user_inf // WHERE // db_user.tb_user_battgroup_baojigroup_battgroup.BattGroupId = db_battinf.tb_battinf.BattGroupId // AND db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id = db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id // AND db_user.tb_user_inf.uid = db_user.tb_user_battgroup_baojigroup_usr.uid // AND db_user.tb_user_inf.uid =? // AND db_battinf.tb_battinf.stationname1 LIKE ? // AND db_battinf.tb_battinf.stationname LIKE ? // ) // // order by db_battinf.tb_battinf.battgroupid asc // //TODO RZG public Response<List<AllModel>> searchByCondition(Batt_Maint_Dealarm bmd) { BatttestdataInf tdata = bmd.getBtestinf();//设定时间 List<Battinf> list = null; // List<Battinf> list = battInfMapper.serchGroupAssess(bmd); List<AllModel> listAll = new ArrayList<AllModel>(); if (list != null && list.size() > 0) { for (int i = 0; i < list.size(); i++) { Battinf binf = list.get(i); tdata.setBattGroupId(binf.getBattGroupId()); tdata.setGroupVol(binf.getMonVolStd());//标存电压 tdata.setTestCap(binf.getMonCapStd());//标存容量 //该电池组的放电结果 List list1 = null;//该电池组的放电结果 // List list1 = batttestdataInfMapper.serchDischargeTest(tdata);//该电池组的放电结果 ServiceModel model = new ServiceModel(); if (list1 != null && list1.size() > 0) { model.setCode(1); model.setData(list1); model.setMsg("查询成功!"); } else { model.setCode(0); model.setMsg("查询失败!"); } AllModel allmodel = new AllModel(); allmodel.setData(list.get(i)); allmodel.setTmodel(model); listAll.add(allmodel); } } return new Response<List<AllModel>>().set(1, listAll); } // SELECT // battgroupid, // test_curr, // max_monvol, // min_monvol, // test_cap // FROM // db_batt_testdata.tb_batttestdata_inf // WHERE // battgroupid =? // AND record_time >=? // AND record_time <=? // AND db_batt_testdata.tb_batttestdata_inf.data_available = 1 // ////充电放电选择 全部 test_type=0不加条件 ////用于放电类型 ////全部 // <if test="test_type==3&&test_starttype=0"> // and test_type=3 // </if> // <if test="test_type==3&&test_starttype=1"> // and (test_starttype<5 and test_type not in(2,9) and test_starttype!=2 AND test_starttype!=3) // </if> // <if test="test_type==3&&test_starttype=2"> // and (test_starttype=2 and test_type not in(2) ) // </if> // <if test="test_type==3&&test_starttype=3"> // and (test_starttype=3 and test_type not in(2) ) // </if> // // order by test_starttime desc } src/main/java/com/whyc/service/Fbs9100StateService.java
@@ -4,6 +4,8 @@ import com.github.pagehelper.PageInfo; import com.whyc.dto.Response; import com.whyc.mapper.Fbs9100StateMapper; import com.whyc.pojo.Battinf; import com.whyc.pojo.Fbs9100State; import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.List; @@ -21,4 +23,10 @@ PageInfo pageInfo=new PageInfo(list); return new Response().set(1,pageInfo); } //FBS9100设备通信状态查询 public Response searchByCondition(int devErrcommcount,int uId){ List<Fbs9100State> list = mapper.searchByCondition(devErrcommcount,uId); return new Response().set(1,list,"查询成功"); } } src/main/resources/mapper/BattMaintDealarmMapper.xml
@@ -2,8 +2,48 @@ <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.whyc.mapper.BattMaintDealarmMapper" > <select id="serchLow" resultType="com.whyc.pojo.Battinf"> <select id="searchLow" resultType="com.whyc.pojo.Battinf"> select distinct(db_battinf.tb_battinf.BattgroupId),StationName1,StationName,stationip,BattGroupName,BattGroupName1,moncount,moncapstd,monvolstd,battproducer,battproductdate,battinusedate ,db_batt_testdata.tb_batttestdata_inf.test_record_count,test_starttime from db_battinf.tb_battinf,db_batt_testdata.tb_batttestdata_inf <where> db_battinf.tb_battinf.battgroupid=db_batt_testdata.tb_batttestdata_inf.battgroupid <if test=""> and record_time>=#{startTime} </if> <if test=""> and record_time <=#{endTime} </if> <if test="binf.battGroupId!=0"> and db_battinf.tb_battinf.battgroupid=#{binf.battGroupId} </if> <if test="userId!=null and userId!=0"> and db_battinf.tb_battinf.BattgroupId in(select distinct db_battinf.tb_battinf.battgroupid from db_battinf.tb_battinf,db_user.tb_user_battgroup_baojigroup_battgroup,db_user.tb_user_battgroup_baojigroup_usr,db_user.tb_user_inf where db_user.tb_user_battgroup_baojigroup_battgroup.BattGroupId=db_battinf.tb_battinf.BattGroupId and db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id=db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id and db_user.tb_user_inf.uid=db_user.tb_user_battgroup_baojigroup_usr.uid and db_user.tb_user_inf.uid=#{userId} and db_battinf.tb_battinf.stationName1 like CONCAT('%',#{stationName1},'%') and db_battinf.tb_battinf.stationName like CONCAT('%',#{stationName},'%') ) </if> <if test="testType==2"><!--充电--> and test_type=2 </if> <if test="testType==3 and testStartType==0"><!--放电 全部--> and test_type=3 </if> <if test="testType==3 and testStartType==1"><!--停电放电--> and (test_starttype<5 and test_type not in(2,9) and test_starttype!=2 AND test_starttype!=3) </if> <if test="testType==3 and testStartType==2"><!--假负载放电2--> and (test_starttype=2 and test_type not in(2) ) </if> <if test="testType==3 and testStartType==3"><!--节能放电3--> and (test_starttype=3 and test_type not in(2) ) </if> </where> order by db_battinf.tb_battinf.battgroupid asc,test_starttime asc </select> </mapper> src/main/resources/mapper/Fbs9100StateMapper.xml
@@ -2,5 +2,37 @@ <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.whyc.mapper.Fbs9100StateMapper"> <!-- fbs9100:op_cmd:0:全部;1:fbs9100,2:fbs9600 dev_errcommcount;0:通讯正常,1:通讯中断,100:全部 --> <select id="searchByCondition" resultType="com.whyc.pojo.Fbs9100State"> select tb_fbs9100_state.num,tb_fbs9100_state.dev_ip,tb_fbs9100_state.dev_version,record_datetime,tb_fbs9100_state.dev_id,op_cmd,dev_datetime,dev_testtype,dev_testgroupnum, dev_workstate,dev_alarmstate,dev_res_test_state,dev_onlinevollow,dev_eachgroup_battsum,dev_captest_onlinevol,dev_captest_groupvol,dev_captest_curr, dev_captest_cap,dev_captest_timelong,dev_restest_moncount,dev_restest_monindex,dev_commcount,dev_errcommcount,db_ram_db.tb_fbs9100_state.dev_61850alarms,dev_last_captest_stop_type, db_battinf.tb_battinf.StationName,db_battinf.tb_battinf.FbsDeviceName, COUNT(DISTINCT db_battinf.tb_battinf.BattGroupId) as cnt, group_CONCAT(db_ram_db.tb_batt_rtstate.online_vol ORDER BY db_ram_db.tb_batt_rtstate.BattGroupId separator '/') as online_vols,group_CONCAT(db_ram_db.tb_batt_rtstate.group_vol ORDER BY db_ram_db.tb_batt_rtstate.BattGroupId separator '/') as group_vols,group_CONCAT(db_ram_db.tb_batt_rtstate.group_curr ORDER BY db_ram_db.tb_batt_rtstate.BattGroupId separator '/') as group_currs from db_ram_db.tb_Fbs9100_state left outer join db_battinf.tb_battinf ON tb_fbs9100_state.dev_id=db_battinf.tb_battinf.FBSDeviceId LEFT OUTER JOIN db_ram_db.tb_batt_rtstate ON db_battinf.tb_battinf.battgroupid=db_ram_db.tb_batt_rtstate.battgroupid <if test="devErrcommcount=0"> where dev_errcommcount=0 </if> <if test="devErrcommcount=1"> where dev_errcommcount>0 </if> <if test="devErrcommcount=100"> where dev_errcommcount>-1 </if> <if test="uId!=null and uId!=0"> and db_battinf.tb_battinf.StationId in(select distinct db_battinf.tb_battinf.StationId from db_battinf.tb_battinf,db_user.tb_user_battgroup_baojigroup_battgroup,db_user.tb_user_battgroup_baojigroup_usr,db_user.tb_user_inf where db_user.tb_user_battgroup_baojigroup_battgroup.BattGroupId=db_battinf.tb_battinf.BattGroupId and db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id=db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id and db_user.tb_user_inf.uid=db_user.tb_user_battgroup_baojigroup_usr.uid and db_user.tb_user_inf.uid=#{uId} ) </if> GROUP BY tb_fbs9100_state.dev_id </select> </mapper>