From a84916eb504db4bb18b9280cc8ab1c059824fb1e Mon Sep 17 00:00:00 2001 From: whyclxw <810412026@qq.com> Date: 星期一, 09 六月 2025 19:00:09 +0800 Subject: [PATCH] 统计1.2.5 --- src/main/java/com/whyc/controller/StatisticController.java | 16 ++ src/main/java/com/whyc/mapper/PowerInfMapper.java | 2 src/main/java/com/whyc/pojo/db_station/BattInf.java | 4 src/main/java/com/whyc/service/BaojigroupService.java | 12 + src/main/resources/mapper/BattInfMapper.xml | 28 ++++ src/main/java/com/whyc/dto/Statistic/DisChargeStic.java | 22 +++ src/main/java/com/whyc/service/BattInfService.java | 11 + src/main/java/com/whyc/constant/ChargeTypeEnum.java | 45 ++++++ src/main/java/com/whyc/service/BatttestdataInfService.java | 196 +++++++++++++++++++++++++++ src/main/resources/mapper/PowerInfMapper.xml | 10 + src/main/java/com/whyc/dto/Statistic/BanZu.java | 11 + src/main/java/com/whyc/mapper/BattInfMapper.java | 3 src/main/java/com/whyc/dto/Statistic/SticDischarge5Res.java | 23 +++ 13 files changed, 379 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/whyc/constant/ChargeTypeEnum.java b/src/main/java/com/whyc/constant/ChargeTypeEnum.java new file mode 100644 index 0000000..ad30470 --- /dev/null +++ b/src/main/java/com/whyc/constant/ChargeTypeEnum.java @@ -0,0 +1,45 @@ +package com.whyc.constant; + +import java.util.HashMap; +import java.util.Map; + +public enum ChargeTypeEnum { + ChargeType_1(1,"宸叉斁鐢�"), + ChargeTyp_2(2,"鏈斁鐢�"), + ; + + private Integer stateId; + private String stateName; + + ChargeTypeEnum(Integer stateId, String stateName) { + this.stateId = stateId; + this.stateName = stateName; + } + + public Integer getStateId() { + return stateId; + } + + public String getStateName() { + return stateName; + } + + public static String getValue(Integer stateId) { + if(stateId==null){ + return ""; + } + for (ChargeTypeEnum ele : values()) { + if(ele.getStateId().equals(stateId)) { + return ele.getStateName(); + } + } + return null; + } + public static Map<Integer,String> getOpInfo() { + Map<Integer,String> map=new HashMap<>(); + for (ChargeTypeEnum logOpEnum : ChargeTypeEnum.values()) { + map.put(logOpEnum.getStateId(),logOpEnum.getStateName()); + } + return map; + } +} \ No newline at end of file diff --git a/src/main/java/com/whyc/controller/StatisticController.java b/src/main/java/com/whyc/controller/StatisticController.java index 7aa11c5..77c5df3 100644 --- a/src/main/java/com/whyc/controller/StatisticController.java +++ b/src/main/java/com/whyc/controller/StatisticController.java @@ -67,6 +67,22 @@ return new Response().setII(1,true,map,"鍗曡妭鏁伴噺缁熻"); } + @ApiOperation(value = "鏈勾搴﹀凡鏀剧數鏁伴噺缁熻(1.2.5)") + @PostMapping("getDischr5Statistic") + public Response getDischr5Statistic(@RequestBody DisChargeStic stic){ + User uinf= ActionUtil.getUser(); + stic.setUid(uinf.getId()); + return battTinfService.getDischr5Statistic(stic); + } + + @ApiOperation(value = "鏈勾搴︽湭鏀剧數鏁伴噺缁熻(1.2.6)") + @PostMapping("getDischr6Statistic") + public Response getDischr6Statistic(@RequestBody DisChargeStic stic){ + User uinf= ActionUtil.getUser(); + stic.setUid(uinf.getId()); + return battTinfService.getDischr6Statistic(stic); + } + @ApiOperation(value = "绔欑偣淇℃伅缁熻(1.2.11)") @PostMapping("getStationStatistic") diff --git a/src/main/java/com/whyc/dto/Statistic/BanZu.java b/src/main/java/com/whyc/dto/Statistic/BanZu.java new file mode 100644 index 0000000..7965a0a --- /dev/null +++ b/src/main/java/com/whyc/dto/Statistic/BanZu.java @@ -0,0 +1,11 @@ +package com.whyc.dto.Statistic; + +import lombok.Data; + +@Data +public class BanZu { + private Integer baojiGroupId; + private String baojiGroupName; + private Integer dischargeNum; + private Integer nochargeNum; +} \ No newline at end of file diff --git a/src/main/java/com/whyc/dto/Statistic/DisChargeStic.java b/src/main/java/com/whyc/dto/Statistic/DisChargeStic.java new file mode 100644 index 0000000..9a7267f --- /dev/null +++ b/src/main/java/com/whyc/dto/Statistic/DisChargeStic.java @@ -0,0 +1,22 @@ +package com.whyc.dto.Statistic; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.util.Date; + +@Data +public class DisChargeStic { + private String provice; + private String city; + private String country; + private String stationName; + private Integer disChargeType; //1.宸叉斁鐢� 2.鏈斁鐢� 涓嶄紶鍏ㄩ儴 + private Integer uid; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date testStartTime;//寮�濮嬫椂闂� + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date testEndTime;//缁撴潫鏃堕棿 + private Integer pageNum; + private Integer pageSize; +} \ No newline at end of file diff --git a/src/main/java/com/whyc/dto/Statistic/SticDischarge5Res.java b/src/main/java/com/whyc/dto/Statistic/SticDischarge5Res.java new file mode 100644 index 0000000..5321168 --- /dev/null +++ b/src/main/java/com/whyc/dto/Statistic/SticDischarge5Res.java @@ -0,0 +1,23 @@ +package com.whyc.dto.Statistic; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.util.Date; + +@Data +public class SticDischarge5Res { + private String provice; + private String city; + private String country; + private String stationName; + private String battgroupName; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date testStartTime; + private Float realCap; //瀹為檯瀹归噺 + private Integer testTimelong; //娴嬭瘯鏃堕暱 + private Float testCap; //娴嬭瘯瀹归噺 + private String stopReason; //鍋滄鍘熷洜 + private String capperformance; //鐢垫睜鎬ц兘 + private Integer disChargeType; //1.宸叉斁鐢� 2.鏈斁鐢� 涓嶄紶鍏ㄩ儴 +} \ No newline at end of file diff --git a/src/main/java/com/whyc/mapper/BattInfMapper.java b/src/main/java/com/whyc/mapper/BattInfMapper.java index 2db0f50..0e66a3b 100644 --- a/src/main/java/com/whyc/mapper/BattInfMapper.java +++ b/src/main/java/com/whyc/mapper/BattInfMapper.java @@ -3,6 +3,7 @@ import com.whyc.dto.BattDto; import com.whyc.dto.InfoDto; import com.whyc.dto.Statistic.BattCompareStic; +import com.whyc.dto.Statistic.DisChargeStic; import com.whyc.dto.Statistic.MonStic; import com.whyc.dto.Statistic.StationStic; import com.whyc.pojo.db_station.BattInf; @@ -47,4 +48,6 @@ List<BattInf> getBattCompare16Statistic(@Param("stic") BattCompareStic stic); //钃勭數姹犵粍瀵规瘮鍒嗘瀽鐣岄潰 List<BattInf> getBattCompare17Statistic(@Param("stic") BattCompareStic stic); + //鏈勾搴﹀凡鏀剧數鏁伴噺缁熻(1.2.5) + List<BattInf> getDischr5Statistic(@Param("stic") DisChargeStic stic); } \ No newline at end of file diff --git a/src/main/java/com/whyc/mapper/PowerInfMapper.java b/src/main/java/com/whyc/mapper/PowerInfMapper.java index c478962..d4a31dc 100644 --- a/src/main/java/com/whyc/mapper/PowerInfMapper.java +++ b/src/main/java/com/whyc/mapper/PowerInfMapper.java @@ -24,4 +24,6 @@ List<String> getProtocolByUid(Integer uid); //鐢垫簮淇℃伅缁熻 List<PowerInf> getPowerStatistic(@Param("stic") StationStic stic); + //鏌ヨ鏈烘埧鎵�鍦ㄧ殑鐝粍 + String getGroupName(Integer powerId); } \ No newline at end of file diff --git a/src/main/java/com/whyc/pojo/db_station/BattInf.java b/src/main/java/com/whyc/pojo/db_station/BattInf.java index 7e27955..cd43901 100644 --- a/src/main/java/com/whyc/pojo/db_station/BattInf.java +++ b/src/main/java/com/whyc/pojo/db_station/BattInf.java @@ -114,4 +114,8 @@ @TableField(exist = false) @ApiModelProperty(value = "璁惧涓嬬數姹犵粍涓暟") private Integer battCount; + + @TableField(exist = false) + @ApiModelProperty(value = "鍖呮満缁勫悕绉�") + private String baojiGroupName; } diff --git a/src/main/java/com/whyc/service/BaojigroupService.java b/src/main/java/com/whyc/service/BaojigroupService.java index 2a3f9e3..4d55691 100644 --- a/src/main/java/com/whyc/service/BaojigroupService.java +++ b/src/main/java/com/whyc/service/BaojigroupService.java @@ -244,4 +244,16 @@ update.eq("station_id",sid); bjPowermapper.delete(update); } + //鏌ヨ鏈烘埧鎵�鍦ㄧ殑鐝粍 + public String getGroupName(Integer powerId) { + String groupName = powerInfMapper.getGroupName(powerId); + return groupName; + } + //鏌ヨ鎵�鏈夌殑鍖呮満缁勫悕闆嗗悎 + public List<Baojigroup> getGroupList() { + QueryWrapper wrapper=new QueryWrapper(); + wrapper.eq("team_flag",1); + List<Baojigroup> list=mapper.selectList(wrapper); + return list; + } } \ No newline at end of file diff --git a/src/main/java/com/whyc/service/BattInfService.java b/src/main/java/com/whyc/service/BattInfService.java index 7a44a74..a7061be 100644 --- a/src/main/java/com/whyc/service/BattInfService.java +++ b/src/main/java/com/whyc/service/BattInfService.java @@ -11,6 +11,7 @@ import com.whyc.dto.Real.QuarterDto; import com.whyc.dto.Response; import com.whyc.dto.Statistic.BattCompareStic; +import com.whyc.dto.Statistic.DisChargeStic; import com.whyc.dto.Statistic.MonStic; import com.whyc.dto.Statistic.StationStic; import com.whyc.factory.InfoFactory; @@ -442,7 +443,7 @@ public List<BattInf> getMonStatistic(MonStic stic) { return mapper.getMonStatistic(stic); } - //钃勭數姹犵粍瀵规瘮鍒嗘瀽鐣岄潰 + //钃勭數姹犵粍瀵规瘮鍒嗘瀽鐣岄潰15 public List<BattInf> getBattCompare15Statistic(BattCompareStic stic) { return mapper.getBattCompare15Statistic(stic); } @@ -451,12 +452,16 @@ Map<Integer,String> map= Capperformance.getOpInfo(); return new Response().setII(1,true,map,"鑾峰彇瀹归噺鎬ц兘(涓嬫媺)"); } - //钃勭數姹犵粍瀵规瘮鍒嗘瀽鐣岄潰 + //钃勭數姹犵粍瀵规瘮鍒嗘瀽鐣岄潰16 public List<BattInf> getBattCompare16Statistic(BattCompareStic stic) { return mapper.getBattCompare16Statistic(stic); } - //钃勭數姹犵粍瀵规瘮鍒嗘瀽鐣岄潰 + //钃勭數姹犵粍瀵规瘮鍒嗘瀽鐣岄潰17 public List<BattInf> getBattCompare17Statistic(BattCompareStic stic) { return mapper.getBattCompare17Statistic(stic); } + //鏈勾搴﹀凡鏀剧數鏁伴噺缁熻(1.2.5) + public List<BattInf> getDischr5Statistic(DisChargeStic stic) { + return mapper.getDischr5Statistic(stic); + } } \ No newline at end of file diff --git a/src/main/java/com/whyc/service/BatttestdataInfService.java b/src/main/java/com/whyc/service/BatttestdataInfService.java index bffa249..0f96191 100644 --- a/src/main/java/com/whyc/service/BatttestdataInfService.java +++ b/src/main/java/com/whyc/service/BatttestdataInfService.java @@ -16,7 +16,9 @@ import com.whyc.pojo.db_ram_db.BattRtdata; import com.whyc.pojo.db_ram_db.BattRtstate; import com.whyc.pojo.db_station.BattInf; +import com.whyc.pojo.db_user.Baojigroup; import com.whyc.util.PageInfoUtils; +import com.whyc.util.ThreadLocalUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -41,6 +43,9 @@ @Autowired(required = false) private AppParamService appParamService; + + @Autowired(required = false) + private BaojigroupService bjService; @@ -437,7 +442,7 @@ } } //1鏌ヨ绗﹀悎鏉′欢鐨勭數姹犵粍 - List<BattInf> binfList=battInfService.getBattCompare15Statistic(stic); + List<BattInf> binfList=battInfService.getBattCompare17Statistic(stic); if(binfList==null||binfList.size()==0){ return new Response().set(1,false,"褰撳墠鐢ㄦ埛鏈鐞嗘弧瓒虫潯浠剁殑鐢垫睜缁�"); } @@ -604,4 +609,193 @@ } return new Response().setII(1,true,map,"鍘嗗彶娴嬭瘯璁板綍"); } + //鏈勾搴﹀凡鏀剧數鏁伴噺缁熻(1.2.5) + public Response getDischr5Statistic(DisChargeStic stic) { + Map<String, Object> map=new HashMap<>(); + //鏌ヨ鍑烘墍鏈夌殑鐝粍骞惰祴浜堝垵濮嬪�� + setBanZuDefault(map); + //鑾峰彇鏍稿浼樺姡锛屾崯鍧忓弬鏁� + List<AppParam> paramList=appParamService.getHrParam(); + Float badValue=0f; + Float damageValue=0f; + if(paramList!=null){ + for (AppParam param:paramList) { + if(param.getParamNamePsx().equals("batt_mon_deteriorate_val")){ + badValue=param.getParamValue(); + } + if(param.getParamNamePsx().equals("batt_mon_damage_val")){ + damageValue=param.getParamValue(); + } + + } + } + //1鏌ヨ绗﹀悎鏉′欢鐨勭數姹犵粍 + List<BattInf> binfList=battInfService.getDischr5Statistic(stic); + if(binfList==null||binfList.size()==0){ + return new Response().set(1,false,"褰撳墠鐢ㄦ埛鏈鐞嗘弧瓒虫潯浠剁殑鐢垫睜缁�"); + } + List<SticDischarge5Res> reslist=new ArrayList<>(); + for (BattInf binf:binfList) { + //鏌ヨ鐢垫睜缁勬墍鍦ㄧ殑鐝粍 + String groupName=bjService.getGroupName(binf.getPowerId()); + SticDischarge5Res res=new SticDischarge5Res(); + res.setProvice(binf.getProvice()); + res.setCity(binf.getCity()); + res.setCountry(binf.getCountry()); + res.setStationName(binf.getStationName()); + res.setBattgroupName(binf.getBattgroupName()); + //2.鑾峰彇鐢垫睜缁勫湪缁欏畾鏃堕棿娈电殑鏀剧數璁板綍(鎸囧畾鏃堕棿娈电殑鏍囧噯鏍稿鏀剧數) + BatttestdataInf tinf =getLastStandardTestDataByTime(binf.getBattgroupId(),stic.getTestStartTime(),stic.getTestEndTime()); + if(tinf==null){ + res.setRealCap(0f); + res.setTestStartTime(ThreadLocalUtil.parse("1972-01-01 00:00:00",1)); + res.setTestTimelong(0); + res.setTestCap(0f); + res.setStopReason(""); + res.setCapperformance(Capperformance.getValue(Capperformance.BATTSTATE_4.getStateId())); + res.setDisChargeType(2); + if(!groupName.equals("none")){ + BanZu bz= (BanZu) map.get(groupName); + int nochargeNum=bz.getNochargeNum(); + bz.setNochargeNum(nochargeNum+1); + map.put(groupName,bz); + } + continue; + } + if(!groupName.equals("none")){ + BanZu bz= (BanZu) map.get(groupName); + int dischargeNum=bz.getDischargeNum(); + bz.setDischargeNum(dischargeNum+1); + map.put(groupName,bz); + } + res.setTestStartTime(tinf.getTestStarttime()); + res.setTestTimelong(tinf.getTestTimelong()); + res.setTestCap(tinf.getTestCap()); + res.setStopReason(StopReasonEnum.getValue(tinf.getTestStoptype())); + Float moncapStd=binf.getMoncapstd(); + int hourRate = BattCapFactory.GetHourRate(tinf.getTestCap(), tinf.getTestCurr()); + Float grouprealCap = (float) BattCapFactory.GetMonomerCap(tinf.getTestCap(), hourRate, tinf.getTestCap(), tinf.getMaxMonvol(), tinf.getMinMonvol(), tinf.getGroupVol(), BattCapFactory.CapType_Real); + res.setRealCap(grouprealCap); + res.setDisChargeType(1); + if(grouprealCap>=moncapStd*badValue){ + res.setCapperformance(Capperformance.getValue(Capperformance.BATTSTATE_1.getStateId())); + } + if(grouprealCap<=moncapStd*damageValue){ + res.setCapperformance(Capperformance.getValue(Capperformance.BATTSTATE_3.getStateId())); + } + if((grouprealCap>moncapStd*damageValue)&&(grouprealCap<moncapStd*badValue)){ + res.setCapperformance(Capperformance.getValue(Capperformance.BATTSTATE_2.getStateId())); + } + if(stic.getDisChargeType()==null){ + reslist.add(res); + }else{ + if(res.getDisChargeType()==stic.getDisChargeType()){ + reslist.add(res); + } + } + } + PageInfo pageInfo=PageInfoUtils.list2PageInfo(reslist, stic.getPageNum(), stic.getPageSize()); + return new Response().setIII(1,reslist.size()>0,pageInfo,map,"鏈勾搴﹀凡鏀剧數鏁伴噺缁熻"); + } + //鏌ヨ鍑烘墍鏈夌殑鐝粍骞惰祴浜堝垵濮嬪�� + private void setBanZuDefault(Map<String, Object> map) { + List<Baojigroup> banZuList=bjService.getGroupList(); + for (Baojigroup bj:banZuList) { + BanZu bz=new BanZu(); + bz.setBaojiGroupId(bj.getBaojiGroupId()); + bz.setBaojiGroupName(bj.getBaojiGroupName()); + bz.setDischargeNum(0); + bz.setNochargeNum(0); + map.put(bj.getBaojiGroupName(),bz); + } + } + + //鏈勾搴︽湭鏀剧數鏁伴噺缁熻(1.2.6) + public Response getDischr6Statistic(DisChargeStic stic) { + Map<String, Object> map=new HashMap<>(); + //鏌ヨ鍑烘墍鏈夌殑鐝粍骞惰祴浜堝垵濮嬪�� + setBanZuDefault(map); + //鑾峰彇鏍稿浼樺姡锛屾崯鍧忓弬鏁� + List<AppParam> paramList=appParamService.getHrParam(); + Float badValue=0f; + Float damageValue=0f; + if(paramList!=null){ + for (AppParam param:paramList) { + if(param.getParamNamePsx().equals("batt_mon_deteriorate_val")){ + badValue=param.getParamValue(); + } + if(param.getParamNamePsx().equals("batt_mon_damage_val")){ + damageValue=param.getParamValue(); + } + + } + } + //1鏌ヨ绗﹀悎鏉′欢鐨勭數姹犵粍 + List<BattInf> binfList=battInfService.getDischr5Statistic(stic); + if(binfList==null||binfList.size()==0){ + return new Response().set(1,false,"褰撳墠鐢ㄦ埛鏈鐞嗘弧瓒虫潯浠剁殑鐢垫睜缁�"); + } + List<SticDischarge5Res> reslist=new ArrayList<>(); + for (BattInf binf:binfList) { + //鏌ヨ鐢垫睜缁勬墍鍦ㄧ殑鐝粍 + String groupName=bjService.getGroupName(binf.getPowerId()); + SticDischarge5Res res=new SticDischarge5Res(); + res.setProvice(binf.getProvice()); + res.setCity(binf.getCity()); + res.setCountry(binf.getCountry()); + res.setStationName(binf.getStationName()); + res.setBattgroupName(binf.getBattgroupName()); + //2.鑾峰彇鐢垫睜缁勫湪缁欏畾鏃堕棿娈电殑鏀剧數璁板綍(鎸囧畾鏃堕棿娈电殑鏍囧噯鏍稿鏀剧數) + BatttestdataInf tinf =getLastStandardTestDataByTime(binf.getBattgroupId(),stic.getTestStartTime(),stic.getTestEndTime()); + if(tinf==null){ + res.setRealCap(0f); + res.setTestStartTime(ThreadLocalUtil.parse("1972-01-01 00:00:00",1)); + res.setTestTimelong(0); + res.setTestCap(0f); + res.setStopReason(""); + res.setCapperformance(Capperformance.getValue(Capperformance.BATTSTATE_4.getStateId())); + res.setDisChargeType(2); + if(!groupName.equals("none")){ + BanZu bz= (BanZu) map.get(groupName); + int nochargeNum=bz.getNochargeNum(); + bz.setNochargeNum(nochargeNum+1); + map.put(groupName,bz); + } + continue; + } + if(!groupName.equals("none")){ + BanZu bz= (BanZu) map.get(groupName); + int dischargeNum=bz.getDischargeNum(); + bz.setDischargeNum(dischargeNum+1); + map.put(groupName,bz); + } + res.setTestStartTime(tinf.getTestStarttime()); + res.setTestTimelong(tinf.getTestTimelong()); + res.setTestCap(tinf.getTestCap()); + res.setStopReason(StopReasonEnum.getValue(tinf.getTestStoptype())); + Float moncapStd=binf.getMoncapstd(); + int hourRate = BattCapFactory.GetHourRate(tinf.getTestCap(), tinf.getTestCurr()); + Float grouprealCap = (float) BattCapFactory.GetMonomerCap(tinf.getTestCap(), hourRate, tinf.getTestCap(), tinf.getMaxMonvol(), tinf.getMinMonvol(), tinf.getGroupVol(), BattCapFactory.CapType_Real); + res.setRealCap(grouprealCap); + res.setDisChargeType(1); + if(grouprealCap>=moncapStd*badValue){ + res.setCapperformance(Capperformance.getValue(Capperformance.BATTSTATE_1.getStateId())); + } + if(grouprealCap<=moncapStd*damageValue){ + res.setCapperformance(Capperformance.getValue(Capperformance.BATTSTATE_3.getStateId())); + } + if((grouprealCap>moncapStd*damageValue)&&(grouprealCap<moncapStd*badValue)){ + res.setCapperformance(Capperformance.getValue(Capperformance.BATTSTATE_2.getStateId())); + } + if(stic.getDisChargeType()==null){ + reslist.add(res); + }else{ + if(res.getDisChargeType()==stic.getDisChargeType()){ + reslist.add(res); + } + } + } + PageInfo pageInfo=PageInfoUtils.list2PageInfo(reslist, stic.getPageNum(), stic.getPageSize()); + return new Response().setII(1,reslist.size()>0,pageInfo,"鏈勾搴︽湭鏀剧數鏁伴噺缁熻"); + } } \ No newline at end of file diff --git a/src/main/resources/mapper/BattInfMapper.xml b/src/main/resources/mapper/BattInfMapper.xml index 5dcffe5..11389a9 100644 --- a/src/main/resources/mapper/BattInfMapper.xml +++ b/src/main/resources/mapper/BattInfMapper.xml @@ -318,5 +318,33 @@ order by tb_batt_inf.dev_id asc,battgroup_id asc </where> </select> + <select id="getDischr5Statistic" resultType="com.whyc.pojo.db_station.BattInf"> + select distinct tb_batt_inf.* + ,tb_station_inf.station_type,tb_station_inf.station_name,tb_station_inf.provice,tb_station_inf.city,tb_station_inf.country,tb_station_inf.full_name + from db_station.tb_batt_inf,db_station.tb_station_inf + <where> + tb_batt_inf.station_id=tb_station_inf.station_id + <if test="stic.provice!=null"> + and tb_station_inf.provice=#{stic.provice} + </if> + <if test="stic.city!=null"> + and tb_station_inf.city=#{stic.city} + </if> + <if test="stic.country!=null"> + and tb_station_inf.country=#{stic.country} + </if> + <if test="stic.stationName!=null"> + and tb_station_inf.station_name=#{stic.stationName} + </if> + <if test="stic.uid>100"> + and tb_batt_inf.station_id in( + select distinct station_id from db_user.tb_baojigroup_power,db_user.tb_baojigroup_usr + where tb_baojigroup_power.baoji_group_id=tb_baojigroup_usr.baoji_group_id + and tb_baojigroup_usr.uid=#{stic.uid} + ) + </if> + order by tb_batt_inf.dev_id asc,battgroup_id asc + </where> + </select> </mapper> \ No newline at end of file diff --git a/src/main/resources/mapper/PowerInfMapper.xml b/src/main/resources/mapper/PowerInfMapper.xml index cadaa69..7520c9f 100644 --- a/src/main/resources/mapper/PowerInfMapper.xml +++ b/src/main/resources/mapper/PowerInfMapper.xml @@ -111,5 +111,15 @@ order by tb_power_inf.power_id asc </where> </select> + <select id="getGroupName" resultType="java.lang.String"> + select distinct ifnull(baoji_group_name,'none') from db_user.tb_baojigroup,db_user.tb_baojigroup_power + <where> + tb_baojigroup.baoji_group_id=tb_baojigroup_power.baoji_group_id + and tb_baojigroup.team_flag=1 + <if test="powerId!=null"> + and power_id=#{powerId} + </if> + </where> + </select> </mapper> \ No newline at end of file -- Gitblit v1.9.1