| | |
| | | import com.whyc.dto.Statistic.DeviceStateStic; |
| | | import com.whyc.dto.Statistic.StationStic; |
| | | import com.whyc.pojo.db_user.User; |
| | | import com.whyc.service.BatttestdataInfService; |
| | | import com.whyc.service.DeviceStateService; |
| | | import com.whyc.service.PowerInfService; |
| | | import com.whyc.service.StationInfService; |
| | | import com.whyc.service.*; |
| | | import com.whyc.util.ActionUtil; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | |
| | | @Autowired |
| | | private BatttestdataInfService battTinfService; |
| | | @Autowired |
| | | private BattInfService battService; |
| | | |
| | | @Autowired |
| | | private PowerInfService powerInfService; |
| | |
| | | return powerInfService.getPowerStatistic(stic); |
| | | } |
| | | |
| | | @ApiOperation(value = "设备信息统计") |
| | | @PostMapping("getDevStatistic") |
| | | public Response getDevStatistic(@RequestBody StationStic stic){ |
| | | User uinf= ActionUtil.getUser(); |
| | | stic.setUid(uinf.getId()); |
| | | return battService.getDevStatistic(stic); |
| | | } |
| | | |
| | | |
| | | |
| | | @ApiOperation(value = "站点信息统计") |
| | | @PostMapping("getStationStatistic") |
| | | public Response getStationStatistic(@RequestBody StationStic stic){ |
| | |
| | | |
| | | import com.whyc.dto.BattDto; |
| | | import com.whyc.dto.InfoDto; |
| | | import com.whyc.dto.Statistic.StationStic; |
| | | import com.whyc.pojo.db_station.BattInf; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | |
| | | |
| | | //获取标称内阻(下拉) |
| | | List<Float> getMonResByUid(@Param("uid") Integer uid); |
| | | |
| | | //设备信息统计 |
| | | List<BattInf> getDevStatistic(@Param("stic") StationStic stic); |
| | | //获取设备下电池组个数 |
| | | Integer getBattCountBydevId(Integer devId); |
| | | } |
| | |
| | | @ApiModelProperty(value = "0:设备下新建电池组,1新建一个设备一个电池组") |
| | | private Integer addBinfFlag; |
| | | |
| | | @TableField(exist = false) |
| | | private String provice; |
| | | |
| | | @TableField(exist = false) |
| | | private String city; |
| | | |
| | | @TableField(exist = false) |
| | | private String country; |
| | | |
| | | @TableField(exist = false) |
| | | private String fullName; |
| | | |
| | | @TableField(exist = false) |
| | | private String stationType; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "设备下电池组个数") |
| | | private Integer battCount; |
| | | } |
| | |
| | | @TableField(exist = false) |
| | | private String city; |
| | | |
| | | |
| | | @TableField(exist = false) |
| | | private String country; |
| | | |
| | | @TableField(exist = false) |
| | | private String fullName; |
| | | |
| | | @TableField(exist = false) |
| | | private String stationType; |
| | | |
| | | |
| | | } |
| | |
| | | import com.whyc.dto.InfoDto; |
| | | import com.whyc.dto.Real.QuarterDto; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.dto.Statistic.StationStic; |
| | | import com.whyc.factory.InfoFactory; |
| | | import com.whyc.mapper.BattInfMapper; |
| | | import com.whyc.mapper.PowerInfMapper; |
| | |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | //设备信息统计 |
| | | public Response getDevStatistic(StationStic stic) { |
| | | PageHelper.startPage(stic.getPageNum(),stic.getPageSize()); |
| | | List<BattInf> list=mapper.getDevStatistic(stic); |
| | | for (BattInf binf:list) { |
| | | //获取设备下电池组个数 |
| | | int battCount=mapper.getBattCountBydevId(binf.getDevId()); |
| | | binf.setBattCount(battCount); |
| | | } |
| | | PageInfo<BattInf> pageInfo=new PageInfo<>(list); |
| | | return new Response().setII(1,list.size()>0,pageInfo,"设备信息统计"); |
| | | } |
| | | } |
| | |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.dto.Statistic.BattTinfStic; |
| | | import com.whyc.dto.Statistic.StationStic; |
| | | import com.whyc.factory.BattCapFactory; |
| | | import com.whyc.mapper.BattInfMapper; |
| | | import com.whyc.mapper.BatttestdataInfMapper; |
| | |
| | | </if> |
| | | </where> |
| | | </select> |
| | | <select id="getDevStatistic" resultType="com.whyc.pojo.db_station.BattInf"> |
| | | select distinct tb_batt_inf.dev_id,tb_batt_inf.dev_name,tb_batt_inf.dev_type,tb_batt_inf.dev_num,tb_batt_inf.dev_ip |
| | | ,tb_batt_inf.station_id,tb_batt_inf.power_id |
| | | ,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 |
| | | </where> |
| | | </select> |
| | | <select id="getBattCountBydevId" resultType="java.lang.Integer"> |
| | | select ifnull(count(*),0) from db_station.tb_batt_inf |
| | | <where> |
| | | dev_id=#{devId} |
| | | </where> |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | </where> |
| | | </select> |
| | | <select id="getPowerStatistic" resultType="com.whyc.pojo.db_station.PowerInf"> |
| | | select distinct tb_power_inf.*,tb_station_inf.station_name,tb_station_inf.provice,tb_station_inf.city,tb_station_inf.country,tb_station_inf.full_name |
| | | select distinct tb_power_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_power_inf,db_station.tb_station_inf |
| | | <where> |
| | | tb_power_inf.station_id=tb_station_inf.station_id |