package com.yunzhi.marketing.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yunzhi.marketing.base.ResponseBean;
import com.yunzhi.marketing.entity.TaPersonBuilding;
import com.yunzhi.marketing.entity.TaPointsExchange;
import com.yunzhi.marketing.mapper.TaPointsExchangeMapper;
import com.yunzhi.marketing.service.ITaPointsExchangeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 积分兑换记录  服务实现类
 * </p>
 *
 * @author jobob
 * @since 2019-07-25
 */
@Service
public class TaPointsExchangeServiceImpl extends ServiceImpl<TaPointsExchangeMapper, TaPointsExchange> implements ITaPointsExchangeService {
	
	@Autowired
	private TaPointsExchangeMapper taPointsExchangeMapper;
	
	
	/**
	 * 分页获取数据
	 *
	 * @param taPointsExchange
	 * @return
	 */
	@Override
	public ResponseBean selectList(Integer pageNum, Integer pageSize, TaPointsExchange taPointsExchange, List<TaPersonBuilding> taPersonBuildingList) {
		Page page = new Page(pageNum,pageSize);
		// 分页查询
		List<TaPointsExchange> list = taPointsExchangeMapper.selectListByParams(page,taPointsExchange,taPersonBuildingList);
		page.setRecords(list);
		return ResponseBean.success(page);
	}
}
