From c3f2b09d8dc64bc7e8100c01a15cb3c933b5d70e Mon Sep 17 00:00:00 2001 From: whyclxw <810412026@qq.com> Date: 星期四, 05 六月 2025 09:14:22 +0800 Subject: [PATCH] 修改提交 --- src/main/java/com/whyc/dto/Statistic/SticCompare16Res.java | 25 ++++ src/main/java/com/whyc/service/BattInfService.java | 8 + src/main/java/com/whyc/dto/Statistic/BattCompareStic.java | 8 + src/main/java/com/whyc/service/BatttestdataInfService.java | 188 +++++++++++++++++++++++++++++-- src/main/java/com/whyc/service/SubTablePageInfoService.java | 2 src/main/java/com/whyc/controller/StatisticController.java | 16 ++ src/main/java/com/whyc/mapper/BattInfMapper.java | 4 src/main/java/com/whyc/pojo/db_alarm/BattalarmDataHistory.java | 2 src/main/java/com/whyc/dto/Statistic/SticCompare17Res.java | 23 +++ src/main/resources/mapper/BattInfMapper.xml | 77 ++++++++++++ 10 files changed, 338 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/whyc/controller/StatisticController.java b/src/main/java/com/whyc/controller/StatisticController.java index d0db45b..048cbf2 100644 --- a/src/main/java/com/whyc/controller/StatisticController.java +++ b/src/main/java/com/whyc/controller/StatisticController.java @@ -87,6 +87,22 @@ return battTinfService.getBattCompare15Statistic(stic); } + @ApiOperation(value = "钃勭數姹犵粍瀵规瘮鍒嗘瀽鐣岄潰锛堜笉鍚屽搧鐗屽悓涓�鏃堕棿锛�(1.2.16)") + @PostMapping("getBattCompare16Statistic") + public Response getBattCompare16Statistic(@RequestBody BattCompareStic stic){ + User uinf= ActionUtil.getUser(); + stic.setUid(uinf.getId()); + return battTinfService.getBattCompare16Statistic(stic); + } + + @ApiOperation(value = "钃勭數姹犵粍瀵规瘮鍒嗘瀽鐣岄潰锛堝悓涓�鍝佺墝涓嶅悓鏃堕棿锛�(1.2.17)") + @PostMapping("getBattCompare17Statistic") + public Response getBattCompare17Statistic(@RequestBody BattCompareStic stic){ + User uinf= ActionUtil.getUser(); + stic.setUid(uinf.getId()); + return battTinfService.getBattCompare17Statistic(stic); + } + @ApiOperation(value = "璁惧宸ヤ綔鐘舵�佺粺璁�(1.2.21)") @PostMapping("getDeviceStateStatistic") public Response getDeviceStateStatistic(@RequestBody DeviceStateStic stic){ diff --git a/src/main/java/com/whyc/dto/Statistic/BattCompareStic.java b/src/main/java/com/whyc/dto/Statistic/BattCompareStic.java index 4a104c6..91a1d5a 100644 --- a/src/main/java/com/whyc/dto/Statistic/BattCompareStic.java +++ b/src/main/java/com/whyc/dto/Statistic/BattCompareStic.java @@ -14,10 +14,16 @@ private Integer uid; private Integer pageNum; private Integer pageSize; - private Integer performance;//鐢垫睜鎬ц兘锛�1浼樼锛�2鍔e寲锛�3鎹熷潖 + private Integer performance;//鐢垫睜鎬ц兘锛�1浼樼锛�2鍔e寲锛�3鎹熷潖 涓嶄紶鍏ㄩ儴 private String product; + private Float moncapstd;//鏍囩О瀹归噺 @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date testStartTime;//寮�濮嬫椂闂� @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date testEndTime;//缁撴潫鏃堕棿 + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date inuseStartTime;//寮�濮嬫椂闂� + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date inuseEndTime;//缁撴潫鏃堕棿 } \ No newline at end of file diff --git a/src/main/java/com/whyc/dto/Statistic/SticCompare16Res.java b/src/main/java/com/whyc/dto/Statistic/SticCompare16Res.java new file mode 100644 index 0000000..672a3e9 --- /dev/null +++ b/src/main/java/com/whyc/dto/Statistic/SticCompare16Res.java @@ -0,0 +1,25 @@ +package com.whyc.dto.Statistic; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.util.Date; + +@Data +public class SticCompare16Res { + private String provice; + private String city; + private String country; + private String stationName; + private String battgroupName; + private String product; + @JsonFormat(pattern = "yyyy-MM-dd") + private Date inuseTime; + private Float monvolstd; + private Float moncapstd; + private String stopReason; + private Float score; //璇勫垎 + private Float realCap; //瀹為檯瀹归噺 + private String precentCap; //瀹归噺鐧惧垎姣� + private String capperformance; //鎬ц兘 +} \ No newline at end of file diff --git a/src/main/java/com/whyc/dto/Statistic/SticCompare17Res.java b/src/main/java/com/whyc/dto/Statistic/SticCompare17Res.java new file mode 100644 index 0000000..265950c --- /dev/null +++ b/src/main/java/com/whyc/dto/Statistic/SticCompare17Res.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 SticCompare17Res { + private String provice; + private String city; + private String country; + private String stationName; + private String battgroupName; + private String product; + @JsonFormat(pattern = "yyyy-MM-dd") + private Date inuseTime; + private Float monvolstd; + private Integer monNum;//鍗曚綋缂栧彿 + private Float monrealCap; //鍗曚綋瀹為檯瀹归噺 + private String monprecentCap; //鍗曚綋瀹归噺鐧惧垎姣� + private String moncapperformance; //鍗曚綋鎬ц兘 +} \ 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 80890ac..2db0f50 100644 --- a/src/main/java/com/whyc/mapper/BattInfMapper.java +++ b/src/main/java/com/whyc/mapper/BattInfMapper.java @@ -43,4 +43,8 @@ List<BattInf> getMonStatistic(@Param("stic") MonStic stic); //钃勭數姹犵粍瀵规瘮鍒嗘瀽鐣岄潰 List<BattInf> getBattCompare15Statistic(@Param("stic") BattCompareStic stic); + //钃勭數姹犵粍瀵规瘮鍒嗘瀽鐣岄潰 + List<BattInf> getBattCompare16Statistic(@Param("stic") BattCompareStic stic); + //钃勭數姹犵粍瀵规瘮鍒嗘瀽鐣岄潰 + List<BattInf> getBattCompare17Statistic(@Param("stic") BattCompareStic stic); } \ No newline at end of file diff --git a/src/main/java/com/whyc/pojo/db_alarm/BattalarmDataHistory.java b/src/main/java/com/whyc/pojo/db_alarm/BattalarmDataHistory.java index 2be847b..8cde084 100644 --- a/src/main/java/com/whyc/pojo/db_alarm/BattalarmDataHistory.java +++ b/src/main/java/com/whyc/pojo/db_alarm/BattalarmDataHistory.java @@ -89,6 +89,6 @@ @TableField(exist = false) private String country;//鏈烘埧鍚嶇О @TableField(exist = false) - private String battGroupName;//鐢垫睜缁勫悕绉� + private String battgroupName;//鐢垫睜缁勫悕绉� } diff --git a/src/main/java/com/whyc/service/BattInfService.java b/src/main/java/com/whyc/service/BattInfService.java index 221859f..0c9f317 100644 --- a/src/main/java/com/whyc/service/BattInfService.java +++ b/src/main/java/com/whyc/service/BattInfService.java @@ -448,4 +448,12 @@ Map<Integer,String> map= Capperformance.getOpInfo(); return new Response().setII(1,true,map,"鑾峰彇瀹归噺鎬ц兘(涓嬫媺)"); } + //钃勭數姹犵粍瀵规瘮鍒嗘瀽鐣岄潰 + public List<BattInf> getBattCompare16Statistic(BattCompareStic stic) { + return mapper.getBattCompare16Statistic(stic); + } + //钃勭數姹犵粍瀵规瘮鍒嗘瀽鐣岄潰 + public List<BattInf> getBattCompare17Statistic(BattCompareStic stic) { + return mapper.getBattCompare17Statistic(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 d23e2bd..10b27d3 100644 --- a/src/main/java/com/whyc/service/BatttestdataInfService.java +++ b/src/main/java/com/whyc/service/BatttestdataInfService.java @@ -4,6 +4,7 @@ import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.whyc.constant.Capperformance; +import com.whyc.constant.StopReasonEnum; import com.whyc.dto.Response; import com.whyc.dto.Statistic.*; import com.whyc.factory.BattCapFactory; @@ -96,6 +97,20 @@ wrapper.eq("battgroup_id", battgroupId); wrapper.eq("test_type", 3); wrapper.eq("test_starttype", 3); + wrapper.last(" and test_timelong >= 7200 ORDER BY test_starttime DESC "); + wrapper.last("limit 1"); + BatttestdataInf tinf = mapper.selectOne(wrapper); + return tinf; + } + + //鑾峰彇鐢垫睜缁勫湪缁欏畾鏃堕棿娈电殑鏀剧數璁板綍(鎸囧畾鏃堕棿娈电殑鏍囧噯鏍稿鏀剧數) + private BatttestdataInf getLastStandardTestDataByTime(Integer battgroupId, Date testStartTime, Date testEndTime) { + QueryWrapper wrapper = new QueryWrapper(); + wrapper.eq("battgroup_id", battgroupId); + wrapper.eq("test_type", 3); + wrapper.eq("test_starttype", 3); + wrapper.gt("test_starttime",testStartTime); + wrapper.lt("test_starttime",testEndTime); wrapper.last(" and test_timelong >= 7200 ORDER BY test_starttime DESC "); wrapper.last("limit 1"); BatttestdataInf tinf = mapper.selectOne(wrapper); @@ -305,17 +320,166 @@ PageInfo pageInfo=PageInfoUtils.list2PageInfo(reslist, stic.getPageNum(), stic.getPageSize()); return new Response().setII(1,reslist.size()>0,pageInfo,"钃勭數姹犵粍瀵规瘮鍒嗘瀽鐣岄潰锛堝悓涓�鍝佺墝鍚屼竴鏃堕棿锛�"); } - //鑾峰彇鐢垫睜缁勫湪缁欏畾鏃堕棿娈电殑鏀剧數璁板綍(鎸囧畾鏃堕棿娈电殑鏍囧噯鏍稿鏀剧數) - private BatttestdataInf getLastStandardTestDataByTime(Integer battgroupId, Date testStartTime, Date testEndTime) { - QueryWrapper wrapper = new QueryWrapper(); - wrapper.eq("battgroup_id", battgroupId); - wrapper.eq("test_type", 3); - wrapper.eq("test_starttype", 3); - wrapper.gt("test_starttime",testStartTime); - wrapper.lt("test_starttime",testEndTime); - wrapper.last(" and test_timelong >= 7200 ORDER BY test_starttime DESC "); - wrapper.last("limit 1"); - BatttestdataInf tinf = mapper.selectOne(wrapper); - return tinf; + + //钃勭數姹犵粍瀵规瘮鍒嗘瀽鐣岄潰锛堜笉鍚屽搧鐗屽悓涓�鏃堕棿锛�(1.2.16) + public Response getBattCompare16Statistic(BattCompareStic stic) { + //鑾峰彇鏍稿浼樺姡锛屾崯鍧忓弬鏁� + 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.getBattCompare16Statistic(stic); + if(binfList==null||binfList.size()==0){ + return new Response().set(1,false,"褰撳墠鐢ㄦ埛鏈鐞嗘弧瓒虫潯浠剁殑鐢垫睜缁�"); + } + List<SticCompare16Res> reslist=new ArrayList<>(); + for (BattInf binf:binfList) { + SticCompare16Res res=new SticCompare16Res(); + res.setProvice(binf.getProvice()); + res.setCity(binf.getCity()); + res.setCountry(binf.getCountry()); + res.setStationName(binf.getStationName()); + res.setBattgroupName(binf.getBattgroupName()); + res.setProduct(binf.getProduct()); + res.setInuseTime(binf.getInuseTime()); + res.setMonvolstd(binf.getMonvolstd()); + res.setMoncapstd(binf.getMoncapstd()); + //2.鑾峰彇鐢垫睜缁勫湪缁欏畾鏃堕棿娈电殑鏀剧數璁板綍(鎸囧畾鏃堕棿娈电殑鏍囧噯鏍稿鏀剧數) + BatttestdataInf tinf =getLastStandardTestDataByTime(binf.getBattgroupId(),stic.getTestStartTime(),stic.getTestEndTime()); + if(tinf==null){ + res.setRealCap(0f); + res.setPrecentCap("0"); + res.setCapperformance(Capperformance.getValue(Capperformance.BATTSTATE_3.getStateId())); + res.setStopReason("--"); + continue; + } + 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); + //Float restCap = (float) BattCapFactory.GetMonomerCap(tinf.getTestCap(), hourRate, tinf.getTestCap(), tinf.getMaxMonvol(), tinf.getMinMonvol(), tinf.getGroupVol(), BattCapFactory.CapType_Rest); + res.setRealCap(grouprealCap); + 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())); + } + //淇濈暀5浣嶅皬鏁� + String precentCap = String.format("%.5f",(grouprealCap/binf.getMoncapstd()*100)); + //璇勫垎鐨勯�昏緫 + res.setScore(0f); + res.setPrecentCap(precentCap); + if(stic.getPerformance()==null){ + reslist.add(res); + }else{ + if(res.getCapperformance().equals(Capperformance.getValue(stic.getPerformance()))){ + reslist.add(res); + } + } + + } + PageInfo pageInfo=PageInfoUtils.list2PageInfo(reslist, stic.getPageNum(), stic.getPageSize()); + return new Response().setII(1,reslist.size()>0,pageInfo,"钃勭數姹犵粍瀵规瘮鍒嗘瀽鐣岄潰锛堜笉鍚屽搧鐗屽悓涓�鏃堕棿锛�"); + } + //钃勭數姹犵粍瀵规瘮鍒嗘瀽鐣岄潰锛堝悓涓�鍝佺墝涓嶅悓鏃堕棿锛�(1.2.17) + public Response getBattCompare17Statistic(BattCompareStic stic) { + //鑾峰彇鏍稿浼樺姡锛屾崯鍧忓弬鏁� + 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.getBattCompare15Statistic(stic); + if(binfList==null||binfList.size()==0){ + return new Response().set(1,false,"褰撳墠鐢ㄦ埛鏈鐞嗘弧瓒虫潯浠剁殑鐢垫睜缁�"); + } + List<SticCompare17Res> reslist=new ArrayList<>(); + for (BattInf binf:binfList) { + SticCompare17Res res=new SticCompare17Res(); + res.setProvice(binf.getProvice()); + res.setCity(binf.getCity()); + res.setCountry(binf.getCountry()); + res.setStationName(binf.getStationName()); + res.setBattgroupName(binf.getBattgroupName()); + res.setProduct(binf.getProduct()); + res.setInuseTime(binf.getInuseTime()); + res.setMonvolstd(binf.getMonvolstd()); + //2.鑾峰彇鐢垫睜缁勫湪缁欏畾鏃堕棿娈电殑鏀剧數璁板綍(鎸囧畾鏃堕棿娈电殑鏍囧噯鏍稿鏀剧數) + BatttestdataInf tinf =getLastStandardTestDataByTime(binf.getBattgroupId(),stic.getTestStartTime(),stic.getTestEndTime()); + /*if(tinf==null){ + res.setMonrealCap(0f); + res.setMonprecentCap("0"); + res.setCapperformance(Capperformance.getValue(Capperformance.BATTSTATE_3.getStateId())); + continue; + } + //鎵捐繖娆℃斁鐢电殑鏈�鍚庝竴绗旀暟鎹� + List<BatttestdataId> idDataList=battTestdataIdService.getLastDataByBattgroupId(tinf.getBattgroupId(),tinf.getTestRecordCount(),tinf.getRecordNum()); + if(idDataList==null||idDataList.size()==0){ + res.setRealCap(0f); + res.setPrecentCap("0"); + res.setCapperformance(Capperformance.getValue(Capperformance.BATTSTATE_3.getStateId())); + continue; + } + 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); + //Float restCap = (float) BattCapFactory.GetMonomerCap(tinf.getTestCap(), hourRate, tinf.getTestCap(), tinf.getMaxMonvol(), tinf.getMinMonvol(), tinf.getGroupVol(), BattCapFactory.CapType_Rest); + res.setRealCap(grouprealCap); + 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())); + } + //淇濈暀5浣嶅皬鏁� + String precentCap = String.format("%.5f",(grouprealCap/binf.getMoncapstd()*100)); + res.setPrecentCap(precentCap); + List<Integer> monNums=new ArrayList<>(); + for (BatttestdataId data:idDataList) {//姹傚崟浣撶殑 瀹為檯瀹归噺锛屾渶灏忓�煎氨鏄崟浣撶殑鍗曚綋鐢靛帇 + Float monrealCap = (float) BattCapFactory.GetMonomerCap(tinf.getTestCap(), hourRate, tinf.getTestCap(), tinf.getMaxMonvol(), data.getMonVol(), tinf.getGroupVol(), BattCapFactory.CapType_Real); + if (monrealCap <= moncapStd * damageValue) {//鎹熷潖鐨� + monNums.add(data.getMonNum()); + } + } + res.setMonNums(monNums); + if(stic.getPerformance()==0){ + reslist.add(res); + }else{ + if(res.getCapperformance().equals(Capperformance.getValue(stic.getPerformance()))){ + 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/java/com/whyc/service/SubTablePageInfoService.java b/src/main/java/com/whyc/service/SubTablePageInfoService.java index 8e0e373..fe8dea9 100644 --- a/src/main/java/com/whyc/service/SubTablePageInfoService.java +++ b/src/main/java/com/whyc/service/SubTablePageInfoService.java @@ -199,7 +199,7 @@ data.setProvice(rs.getString("provice")); data.setCity(rs.getString("city")); data.setCountry(rs.getString("country")); - data.setBattGroupName(rs.getString("battgroup_name")); + data.setBattgroupName(rs.getString("battgroup_name")); list.add(data); } return list; diff --git a/src/main/resources/mapper/BattInfMapper.xml b/src/main/resources/mapper/BattInfMapper.xml index d1e1416..0ec27f3 100644 --- a/src/main/resources/mapper/BattInfMapper.xml +++ b/src/main/resources/mapper/BattInfMapper.xml @@ -240,5 +240,82 @@ order by tb_batt_inf.dev_id asc,battgroup_id asc </where> </select> + <select id="getBattCompare16Statistic" 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.product!=null"> + and tb_batt_inf.product=#{stic.product} + </if> + <if test="stic.moncapstd!=null"> + and tb_batt_inf.moncapstd=#{stic.moncapstd} + </if> + <if test="stic.inuseStartTime!=null"> + and tb_batt_inf.inuse_time>=#{stic.inuseStartTime} + </if> + <if test="stic.inuseEndTime!=null"> + and tb_batt_inf.inuse_time<=#{stic.inuseEndTimee} + </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> + <select id="getBattCompare17Statistic" 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.product!=null"> + and tb_batt_inf.product=#{stic.product} + </if> + <if test="stic.inuseStartTime!=null"> + and tb_batt_inf.inuse_time>=#{stic.inuseStartTime} + </if> + <if test="stic.inuseEndTime!=null"> + and tb_batt_inf.inuse_time<=#{stic.inuseEndTimee} + </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 -- Gitblit v1.9.1