package cn.bsystem.ptConst.service;

 import cn.bsystem.ptConst.dao.XtbbxxDao;
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("xtbbxxService")
public class XtbbxxService extends BaseService {
	
	private static Log log = LogFactory.getLog(XtbbxxService.class);
	
	@Autowired
	private XtbbxxDao xtbbxxDao;
	
	/**
	 * 保存记录
	 */
	public void insert_Xtbbxx(Map map) throws SQLException{
		CommUtils.addParams(map, false);
		xtbbxxDao.insert_Xtbbxx(map);
	}

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

	/**
	 * Xtbbxx 分页
	 */
	public Map listXtbbxxByPage(Map map) throws SQLException {
		List<Map> list = xtbbxxDao.query_Xtbbxx(map);
		Integer totalCount = xtbbxxDao.count_Xtbbxx(map);
		map.clear();
		map.put("total", totalCount);
		map.put("rows", list);
		return map;
	}
}
