package com.community.huiju.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.community.commom.mode.ResponseBean;
import com.community.commom.session.UserElement;
import com.community.huiju.model.AnnouncementTel;
import com.community.huiju.dao.AnnouncementTelMapper;
import com.community.huiju.model.Bill;
import com.community.huiju.service.IAnnouncementTelService;
import com.google.common.collect.Maps;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

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

/**
 * <p>
 * 物业号码表 服务实现类
 * </p>
 *
 * @author jobob
 * @since 2019-03-05
 */
@Service
public class AnnouncementTelServiceImpl extends ServiceImpl<AnnouncementTelMapper, AnnouncementTel> implements IAnnouncementTelService {
	
	@Autowired
	private AnnouncementTelMapper announcementTelMapper;
	
	/**
	 * 获取物业号码列表
	 *
	 * @param announcementTel
	 * @param pageNum
	 * @param pageSize
	 * @return
	 */
	@Override
	public ResponseBean getTelList(AnnouncementTel announcementTel, Integer pageNum, Integer pageSize) {
		ResponseBean responseBean = new ResponseBean();
		Page page = new Page(pageNum,pageSize);
		// 分页查询
		List<AnnouncementTel> list = announcementTelMapper.selectListByParams(page,announcementTel);
		Map<String, Object> map = Maps.newHashMap();
		map.put("list",list);
		map.put("total",page.getTotal());
		responseBean.addSuccess(map);
		return responseBean;
	}
}
