package com.iamberry.wechat.service.drp;

import java.util.List;

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

import com.iamberry.wechat.core.entity.drp.PlaceRoleInfo;
import com.iamberry.wechat.face.drp.DrpRoleInfoService;
import com.iamberry.wechat.service.drp.dao.DrpRoleInfoDao;

@Service
public class DrpRoleInfoServiceImpl implements DrpRoleInfoService {
	
	@Autowired
	private DrpRoleInfoDao drpRoleInfoDao;

	
	public List<PlaceRoleInfo> getDrpRoleList(PlaceRoleInfo drpRoleInfo) {
		// TODO Auto-generated method stub
		return drpRoleInfoDao.getDrpRoleList(drpRoleInfo);
	}	

	
	public int selectDrpRoleCount(PlaceRoleInfo drpRoleInfo) {
		// TODO Auto-generated method stub
		int count = drpRoleInfoDao.selectDrpRoleCount(drpRoleInfo);
		return	count = count % drpRoleInfo.getPage().getPageSize() == 0? count/drpRoleInfo.getPage().getPageSize():(count/drpRoleInfo.getPage().getPageSize())+1;
	}

	
	public Integer addDrpRoleInfo(PlaceRoleInfo drpRoleInfo) {
		// TODO Auto-generated method stub
		return drpRoleInfoDao.addDrpRoleInfo(drpRoleInfo);
	}

	
	public PlaceRoleInfo selectDrpRoleInfo(PlaceRoleInfo drpRoleInfo) {
		// TODO Auto-generated method stub
		return this.drpRoleInfoDao.selectDrpRoleInfo(drpRoleInfo);
	}

	
	public Integer updateDrpRoleInfo(PlaceRoleInfo drpRoleInfo) {
		// TODO Auto-generated method stub
		return drpRoleInfoDao.updateDrpRoleInfo(drpRoleInfo);
	}

	
	public Integer updateDrpRoleStatus(PlaceRoleInfo drpRoleInfo) {
		// TODO Auto-generated method stub
		return drpRoleInfoDao.updateDrpRoleStatus(drpRoleInfo);
	}

	
	public List<PlaceRoleInfo> getDrpRoleList2() {
		// TODO Auto-generated method stub
		return drpRoleInfoDao.getDrpRoleList2();
	}

	
	public List<PlaceRoleInfo> getDrpRoleListByState() {
		// TODO Auto-generated method stub
		return drpRoleInfoDao.getDrpRoleListByState();
	}
}
