package org.springblade.command.service.impl;


import com.baomidou.mybatisplus.core.metadata.IPage;
import lombok.AllArgsConstructor;
import org.springblade.command.mapper.FzyjMapper;
import org.springblade.command.pojo.entity.FzyjEntity;
import org.springblade.command.pojo.vo.FzyjVO;
import org.springblade.command.pojo.vo.GsdwVO;
import org.springblade.command.service.IFzyjService;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;

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

/**
 * 服务实现类
 *
 * @author Chill
 */
@Service
@AllArgsConstructor
public class IFzyjServiceImpl extends BaseServiceImpl<FzyjMapper, FzyjEntity> implements IFzyjService {

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

	@Override
	public int countByUserId(Long userId) {
		return baseMapper.countByUserId(userId);
	}

	@Override
	public int countByDept(Long id) {
		return baseMapper.countByDept(id);
	}

	@Override
	public int countYqsByUserId(Long userId) {
		return baseMapper.countYqsByUserId(userId);
	}

	@Override
	public int countYqsByDept(Long id) {
		return baseMapper.countYqsByDept(id);
	}

	@Override
	public int countYfkByUserId(Long userId) {
		return baseMapper.countYfkByUserId(userId);
	}

	@Override
	public int countYfkByDept(Long id) {
		return baseMapper.countYfkByDept(id);
	}

	@Override
	public FzyjVO detail(Long syncId) {
		return baseMapper.detail(syncId);
	}

	@Override
	public List<GsdwVO> getGsdwBySyncId(Long syncId) {
		return baseMapper.getGsdwBySyncId(syncId);
	}

	@Override
	public List<FzyjVO> getUnpushedFzyj() {
		return baseMapper.getUnpushedFzyj();
	}

	@Override
	public boolean updatePushStatus(Long syncId) {
		return baseMapper.updatePushStatus(syncId) > 0;
	}

	@Override
	public List<FzyjVO> getUnpushedZp() {
		return baseMapper.getUnpushedZp();
	}
}
