| | |
| | | package com.whyc.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.dto.*; |
| | | import com.whyc.mapper.BattGroupDataMapper; |
| | | import com.whyc.mapper.FileParamMapper; |
| | | import com.whyc.pojo.FileInfo; |
| | | import com.whyc.pojo.FileParam; |
| | |
| | | public class FileParamService { |
| | | @Autowired(required = false) |
| | | private FileParamMapper mapper; |
| | | |
| | | @Autowired(required = false) |
| | | private BattGroupDataMapper dataMapper; |
| | | |
| | | @Autowired(required = false) |
| | | private FileParamMapper paramMapper; |
| | | |
| | | //解析xml文件(传参一个文件) |
| | | public Response getXmlValue(String filePath) { |
| | |
| | | return new Response().setII(1,list.size()>0,list,"返回所有的标称电压类型"); |
| | | } |
| | | //按照筛选条件查询数据库信息 |
| | | public Response getDataByCondition(Date testTime1, Date testTime2, int battVol) { |
| | | List<FileParam> list=mapper.getDataByCondition(testTime1,testTime2,battVol); |
| | | return new Response().setII(1,list.size()>0,list,"筛选数据库信息"); |
| | | public Response getDataByCondition(Date testTime1, Date testTime2, int battVol,int pageCurr,int pageSize) { |
| | | PageHelper.startPage(pageCurr,pageSize); |
| | | List<FileParam> list=mapper.getDataByCondition(testTime1,testTime2,battVol); |
| | | PageInfo pageInfo=new PageInfo(list); |
| | | return new Response().setII(1,list.size()>0,pageInfo,"筛选数据库信息"); |
| | | } |
| | | |
| | | |
| | | public FileParam getByFileId(String fileId) { |
| | | QueryWrapper<FileParam> query = Wrappers.query(); |
| | | query.eq("file_id",fileId).last(" limit 1"); |
| | | return mapper.selectOne(query); |
| | | } |
| | | //删除基站下数据 |
| | | public Response deleteDataById(int stationId, int fileId) { |
| | | //删除所有文件数据(指定机房id和文件id) |
| | | dataMapper.deleteDataAndInfo(stationId,fileId); |
| | | //删除所有文件参数 |
| | | paramMapper.deleteParamByFileId(fileId); |
| | | return new Response().set(1,"删除成功!"); |
| | | } |
| | | } |