package org.springblade.modules.application.history.service.impl;

import org.springblade.modules.application.history.excel.ApplicationHistoryExcel;
import org.springblade.modules.application.history.mapper.ApplicationHistoryMapper;
import org.springblade.modules.application.history.pojo.entity.ApplicationHistoryEntity;
import org.springblade.modules.application.history.pojo.vo.ApplicationHistoryVO;
import org.springblade.modules.application.history.service.IApplicationHistoryService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseServiceImpl;
import java.util.List;

/**
 * 应用历史 服务实现类
 *
 * @author BladeX
 * @since 2024-10-15
 */
@Service
public class ApplicationHistoryServiceImpl extends BaseServiceImpl<ApplicationHistoryMapper, ApplicationHistoryEntity> implements IApplicationHistoryService {

	@Override
	public IPage<ApplicationHistoryVO> selectHistoryPage(IPage<ApplicationHistoryVO> page, ApplicationHistoryVO history) {
		return page.setRecords(baseMapper.selectHistoryPage(page, history));
	}

	@Override
	public List<ApplicationHistoryExcel> exportHistory(Wrapper<ApplicationHistoryEntity> queryWrapper) {
		List<ApplicationHistoryExcel> historyList = baseMapper.exportHistory(queryWrapper);
		//historyList.forEach(history -> {
		//	history.setTypeName(DictCache.getValue(DictEnum.YES_NO, History.getType()));
		//});
		return historyList;
	}

}
