package com.hxzk.gps.service.impl.HistoryPower;
|
|
import com.github.pagehelper.PageHelper;
|
import com.github.pagehelper.PageInfo;
|
import com.hxzk.gps.controller.HistoryPower.dto.TableSearchResult.TableSearchResult;
|
import com.hxzk.gps.entity.Attendance.TbKaoqing;
|
import com.hxzk.gps.entity.HistoryPower.TbHistoryPower;
|
import com.hxzk.gps.mapper.HistoryPower.TbHistoryPowerMapper;
|
import com.hxzk.gps.result.ListDataResult;
|
import com.hxzk.gps.result.ResultTable;
|
import com.hxzk.gps.result.table;
|
import com.hxzk.gps.service.HistoryPower.TbHistoryPowerService;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.hxzk.gps.util.GetUser.UserInfoUtil;
|
import com.hxzk.gps.util.MessageUtils.MessageUtils;
|
import com.hxzk.gps.util.Time.TimeUtil;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Service;
|
|
/**
|
* <p>
|
* 服务实现类
|
* </p>
|
*
|
* @author YuZhiTong
|
* @since 2025-05-27
|
*/
|
@Service
|
public class TbHistoryPowerServiceImpl extends ServiceImpl<TbHistoryPowerMapper, TbHistoryPower> implements TbHistoryPowerService {
|
@Autowired
|
TbHistoryPowerMapper historyPowerMapper;
|
/**
|
* 标签电量列表查询接口
|
* @param TableSearchResult
|
* @return ResultTable
|
* */
|
@Override
|
public ResultTable FindTagHistoryPowerInfo(TableSearchResult TableSearchResult) {
|
if (TableSearchResult.getHistoryPower().getTime() == null){
|
TableSearchResult.getHistoryPower().setTime(TimeUtil.GetYearMonthDay());
|
}else{
|
TableSearchResult.getHistoryPower().setTime(TimeUtil.ZhuanDate(TableSearchResult.getHistoryPower().getTime()));
|
}
|
PageHelper.startPage(TableSearchResult.getTableList().getPageNum(), TableSearchResult.getTableList().getPageSize());
|
PageInfo<TbHistoryPower> info = new PageInfo<>(historyPowerMapper.FindTagHistoryPowerInfo(UserInfoUtil.getUserCompany(), TableSearchResult.getHistoryPower().getTime(),TableSearchResult.getHistoryPower().getTagid()));
|
table<TbHistoryPower> achortable = new table<>(info.getList(), TableSearchResult.getTableList().getPageNum(), TableSearchResult.getTableList().getPageSize(), info.getTotal());
|
return ListDataResult.resultTableSuccess(achortable, MessageUtils.getMessage("Success"));
|
}
|
}
|