package org.springblade.modules.sqmy.service.impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.modules.sqmy.excel.FzrhyInfoExcel;
import org.springblade.modules.sqmy.mapper.FzrhyInfoMapper;
import org.springblade.modules.sqmy.pojo.entity.FzrhyInfoEntity;
import org.springblade.modules.sqmy.pojo.entity.FzrhyRyEntity;
import org.springblade.modules.sqmy.pojo.vo.FzrhyInfoVO;
import org.springblade.modules.sqmy.service.IFzrhyInfoService;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 每月安全负责人会议 服务实现类
 *
 * @author wth
 * @since 2024-11-12
 */
@Service
public class FzrhyInfoServiceImpl extends BaseServiceImpl<FzrhyInfoMapper, FzrhyInfoEntity> implements IFzrhyInfoService {

	@Override
	public IPage<FzrhyInfoVO> selectFzrhyInfoPage(IPage<FzrhyInfoVO> page, Map<String, Object> params) {
		return page.setRecords(baseMapper.selectFzrhyInfoPage(page, params));
	}

	@Override
	public List<FzrhyInfoExcel> exportFzrhyInfo(Wrapper<FzrhyInfoEntity> queryWrapper) {
		List<FzrhyInfoExcel> fzrhyInfoList = baseMapper.exportFzrhyInfo(queryWrapper);
		//fzrhyInfoList.forEach(fzrhyInfo -> {
		//	fzrhyInfo.setTypeName(DictCache.getValue(DictEnum.YES_NO, FzrhyInfoEntity.getType()));
		//});
		return fzrhyInfoList;
	}

	@Override
	public FzrhyInfoEntity getByFzrhy(Map<String, Object> params) {
		return baseMapper.getByFzrhy(params);
	}

	@Override
	public List<FzrhyRyEntity> selectFzrhyRy(Long id) {
		return baseMapper.selectFzrhyRy(id);
	}

}
