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.SqmyInfoExcel;
import org.springblade.modules.sqmy.mapper.SqmyInfoMapper;
import org.springblade.modules.sqmy.pojo.entity.SqmyInfoEntity;
import org.springblade.modules.sqmy.pojo.vo.SqmyInfoVO;
import org.springblade.modules.sqmy.service.ISqmyInfoService;
import org.springframework.stereotype.Service;

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

/**
 * 社情民意 服务实现类
 *
 * @author wth
 * @since 2024-11-12
 */
@Service
public class SqmyInfoServiceImpl extends BaseServiceImpl<SqmyInfoMapper, SqmyInfoEntity> implements ISqmyInfoService {

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

	@Override
	public List<SqmyInfoExcel> exportSqmyInfo(Wrapper<SqmyInfoEntity> queryWrapper) {
		List<SqmyInfoExcel> sqmyInfoList = baseMapper.exportSqmyInfo(queryWrapper);
		//sqmyInfoList.forEach(sqmyInfo -> {
		//	sqmyInfo.setTypeName(DictCache.getValue(DictEnum.YES_NO, SqmyInfoEntity.getType()));
		//});
		return sqmyInfoList;
	}

	@Override
	public int countByType(int type, Map<String, Object> params) {
		return baseMapper.countByType(type, params);
	}

}
