package cn.bsystem.ptuserrole.service;

 import cn.bsystem.ptuserrole.dao.PtyhbmscbfDao;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.base.bean.BaseService;
import cn.base.util.CommUtils;

@Service("ptyhbmscbfService")
public class PtyhbmscbfService extends BaseService {
	
	private static Log log = LogFactory.getLog(PtyhbmscbfService.class);
	
	@Autowired
	private PtyhbmscbfDao ptyhbmscbfDao;
	
	/**
	 * 保存记录
	 */
	public void insert_Ptyhbmscbf(Map map) throws SQLException{
		CommUtils.addParams(map, false);
		ptyhbmscbfDao.insert_Ptyhbmscbf(map);
	}

	
	/**
	 * 修改记录
	 */
	public Integer update_Ptyhbmscbf(Map map) throws SQLException{
		CommUtils.validateUpdateParams(map);
		CommUtils.addParams(map, true);
		return ptyhbmscbfDao.update_Ptyhbmscbf(map);
	}
	
	/**
	 * 删除记录
	 */
	public Integer delete_Ptyhbmscbf(Map map) throws SQLException{
		CommUtils.validateDeleteParams(map);
		return ptyhbmscbfDao.delete_Ptyhbmscbf(map);
	}

	/**
	 * Ptyhbmscbf 分页
	 */
	public Map listPtyhbmscbfByPage(Map map) throws SQLException {
		List<Map> list = ptyhbmscbfDao.query_Ptyhbmscbf(map);
		Integer totalCount = ptyhbmscbfDao.count_Ptyhbmscbf(map);
		map.clear();
		map.put("total", totalCount);
		map.put("rows", list);
		return map;
	}
}
