package com.ssm.service.impl.business;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.ssm.mapper.business.SmsUpMessageMapper;
import com.ssm.model.business.SmsUpMessage;
import com.ssm.util.page.BeanUtil;
import com.ssm.util.page.PagedResult;

@Service
public class SmsUpMessageServiceImpl implements
		com.ssm.service.business.SmsUpMessageService {

	@Autowired
	private SmsUpMessageMapper smsUpMessageMapper;

	@Override
	public int insertSelective(SmsUpMessage smsUpMessage) {
		
		return smsUpMessageMapper.insertSelective(smsUpMessage);
	}

	@Override
	public PagedResult<SmsUpMessage> selectsmsUpMessage(
			SmsUpMessage smsUpMessage, Integer pageNo, Integer pageSize) {
		pageNo = pageNo == null ? 1 : pageNo;
		pageSize = pageSize == null ? 10 : pageSize;
		PageHelper.startPage(pageNo, pageSize);
		List<SmsUpMessage> list = smsUpMessageMapper.selectsmsUpMessage(smsUpMessage);
		PagedResult<SmsUpMessage> pageResult = BeanUtil.toPagedResult(list);
		return pageResult;
	}
}
