package com.yeejoin.amos.fas.business.service.impl;

import com.yeejoin.amos.fas.business.dao.mapper.BizMessageMapper;
import com.yeejoin.amos.fas.business.service.intfc.IBizMessageService;
import com.yeejoin.amos.fas.core.common.request.CommonPageable;
import com.yeejoin.amos.fas.dao.entity.NodeMessageView;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("iBizMessageService")
public class BizMessageServiceImpl implements IBizMessageService {



	@Autowired
	BizMessageMapper bizMessageMapper;



	public Page queryForPage(String time, String type, String title, String orgCode, CommonPageable pageable)
	{
		Long total = bizMessageMapper.queryCountForPage(time, type, title, orgCode);
		List<NodeMessageView> content = bizMessageMapper.queryForPage(time, type, title, orgCode,pageable.getOffset(),pageable.getPageSize());
		Page result = new PageImpl(content,pageable,total);
		return result;
	}






}
