| | |
| | | |
| | | //删除fileid对应的数据(stationId,fileId) |
| | | int deleteDataAndInfo(int stationId, int fileId); |
| | | |
| | | //3.删除所有文件数据 |
| | | void deleteDataAndInfoByStationId(int stationId); |
| | | } |
| | |
| | | |
| | | import com.whyc.pojo.FileInfo; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface FileInfoMapper extends CustomMapper<FileInfo>{ |
| | | |
| | | //查询出最大文件id |
| | |
| | | |
| | | //删除机房下文件信息(stationId,fileId) |
| | | int deleteFileInStation(int stationId, int fileId); |
| | | |
| | | //查询出机房下所有的文件fileIds |
| | | List<Integer> selectListFiles(int stationId); |
| | | } |
| | |
| | | List<FileParam> getDataByCondition(Date testTime1, Date testTime2, int battVol); |
| | | //删除fileid对应的参数 |
| | | int deleteParamByFileId(int fileId); |
| | | //删除所有文件参数 |
| | | void deleteParamByStationId(int stationId); |
| | | } |
| | |
| | | stationName=stationName+"-"+stationName3; |
| | | } |
| | | wrapper.eq("station_name",stationName); |
| | | //先删除该基站挂载的所有文件 |
| | | //1.先查出机房的id |
| | | int stationId=mapper.selectIdByName(stationName); |
| | | if(stationId==0){ |
| | | return new Response().set(1,false,"机房不存在"); |
| | | }else { |
| | | //3.删除所有文件数据 |
| | | dataMapper.deleteDataAndInfoByStationId(stationId); |
| | | //4.删除所有文件参数 |
| | | paramMapper.deleteParamByStationId(stationId); |
| | | } |
| | | //最终删除基站 |
| | | int flag=mapper.delete(wrapper); |
| | | return new Response().set(1,flag>0,"删除操作"); |
| | | return new Response().set(1,flag>0,"删除成功"); |
| | | } |
| | | //移除台站下文件(单个文件) |
| | | @Transactional |
| | |
| | | LEFT JOIN tb_battgroup_info c ON o.battGroup_id = c.battGroup_id |
| | | WHERE c.station_id=#{stationId} and c.file_id=#{fileId} |
| | | </delete> |
| | | <delete id="deleteDataAndInfoByStationId"> |
| | | DELETE o,c |
| | | FROM tb_battgroup_data o |
| | | LEFT JOIN tb_battgroup_info c ON o.battGroup_id = c.battGroup_id |
| | | WHERE c.station_id=#{stationId} |
| | | </delete> |
| | | |
| | | <select id="getListWithTestTime" resultType="com.whyc.pojo.BattgroupData"> |
| | | SELECT data.*,info.test_time FROM db_res_meter.tb_battgroup_data data,db_res_meter.tb_battgroup_info info |
| | |
| | | select ifnull(max(file_id),0) from db_res_meter.tb_file_info |
| | | where station_id=#{stationId} and file_url=#{filePath} |
| | | </select> |
| | | <select id="selectListFiles" resultType="java.lang.Integer"> |
| | | select distinct file_id from db_res_meter.tb_file_info where station_id=#{stationId} |
| | | </select> |
| | | </mapper> |
| | |
| | | <delete id="deleteParamByFileId"> |
| | | delete from tb_file_param where file_id=#{fileId} |
| | | </delete> |
| | | <delete id="deleteParamByStationId"> |
| | | DELETE o,c |
| | | FROM tb_file_param o |
| | | LEFT JOIN tb_file_info c ON o.file_id = c.file_id |
| | | WHERE c.station_id=#{stationId} |
| | | </delete> |
| | | |
| | | |
| | | <select id="getMonVolStd" resultType="Integer"> |