新增findBattProducerInfoByTime接口
| | |
| | | |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.dto.ServiceModel; |
| | | import com.whyc.dto.paramter.DateTimePar; |
| | | import com.whyc.pojo.Battinf; |
| | | import com.whyc.pojo.UserInf; |
| | | import com.whyc.service.BattInfService; |
| | |
| | | return service.findBattProducerInfoByYearCode(yearCode,userInf.getUId().intValue()); |
| | | } |
| | | |
| | | @PostMapping("/findBattProducerInfoByTime") |
| | | @ApiOperation(value = "根据电池使用时间段查询站点及电池品牌基础信息",notes = "") |
| | | public Response findBattProducerInfoByTime(@RequestBody DateTimePar dateTimePar){ |
| | | UserInf userInf = ActionUtil.getUser(); |
| | | return service.findBattProducerInfoByTime(dateTimePar.getStartTime(),dateTimePar.getEndTime(),userInf.getUId().intValue()); |
| | | } |
| | | |
| | | @GetMapping("/findBattInfByStationId") |
| | | @ApiOperation("根据机房id获取电池信息") |
| | | public Response findBattInfByStationId(@RequestParam String stationId){ |
New file |
| | |
| | | package com.whyc.dto.paramter; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | import lombok.ToString; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @ToString |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class DateTimePar { |
| | | @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") |
| | | private Date startTime; |
| | | @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") |
| | | private Date endTime; |
| | | } |
| | |
| | | import com.whyc.pojo.Battinf; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | public interface BattInfMapper extends CustomMapper<Battinf>{ |
| | |
| | | |
| | | List<BattInfAndEnduranceDTO> findBattProducerInfoByYearCode(@Param("yearCode") int yearCode,@Param("userId") int uId); |
| | | |
| | | List<BattInfAndEnduranceDTO> findBattProducerInfoByTime(@Param("startTime") Date startTime,@Param("endTime") Date endTime, @Param("userId") int uId); |
| | | |
| | | List<Battinf> searchByTestType(@Param("tinf") ReportBattDTO tinf, @Param("userId") int userId); |
| | | |
| | | //报表统计-电池组评估 |
| | |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | |
| | | return new Response().set(1,list,"查询成功"); |
| | | } |
| | | |
| | | public Response findBattProducerInfoByTime(Date startTime,Date endTime, int uId){ |
| | | List<BattInfAndEnduranceDTO> list = battInfMapper.findBattProducerInfoByTime(startTime,endTime,uId); |
| | | return new Response().set(1,list,"查询成功"); |
| | | } |
| | | |
| | | public Response findBattInfoByStationId(String stationId){ |
| | | QueryWrapper<Battinf> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("stationId",stationId); |
| | |
| | | group by binf.StationId order by bInf.StationName |
| | | </select> |
| | | |
| | | <select id="findBattProducerInfoByTime" resultMap="BattInfAndEndurance"> |
| | | select StationName,StationName3,BattGroupId,BattModel,BattProducer,BattProductDate,BattInUseDate,station_install,install_user,load_curr,bEnd.* |
| | | from db_battinf.tb_battinf bInf left join web_site.tb_batt_endurance bEnd on bInf.FBSDeviceId = bEnd.deviceid |
| | | <where> |
| | | <if test="startTime!=null and endTime!=null"> |
| | | and BattInUseDate >= #{startTime} and BattInUseDate<= #{endTime} |
| | | </if> |
| | | <if test="userId!=null and userId!=0"> |
| | | and 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}) |
| | | </if> |
| | | </where> |
| | | group by binf.StationId order by bInf.StationName |
| | | </select> |
| | | |
| | | <select id="searchByTestType" 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,db_batt_testdata.tb_batttestdata_inf.test_starttime |