package cn.net.caoyao.cpzshandset.service.bll;

import java.util.List;

import android.content.Context;
import cn.net.caoyao.cpzshandset.common.config.ConfigDBCreateService;
import cn.net.caoyao.cpzshandset.common.util.CacheGet;
import cn.net.caoyao.cpzshandset.db.presenter.GroupInfoDal;
import cn.net.cpzslibs.prot.handset.bean.res.LiqueurGroupInfoBean;

public class GroupInfoBll {
	private GroupInfoDal dal;
	public GroupInfoBll(Context context) {
		ConfigDBCreateService service = new ConfigDBCreateService();
		dal = service.createGroupInfoDal(new CacheGet(), context);
//		dal = new LiqueurGroupInfoDal(context);
	}
	/**
	 * 插入班组信息
	 * @param groupInfoBeans
	 */
	public void insertGroupInfoList(List<LiqueurGroupInfoBean> groupInfoBeans){
		if (dal == null || groupInfoBeans == null) return ;
		dal.insertGroupInfoList(groupInfoBeans);
	}
	/**
	 * 查询所有的班组信息
	 * @return
	 */
	public List<LiqueurGroupInfoBean> queryAllGroupInfo(){
		if(dal == null) return null;
		return dal.queryAllGroupInfo();
	}
	/**
	 * 通过id，查询对应的班组信息
	 * @param id
	 * @return
	 */
	public LiqueurGroupInfoBean queryGroupInfoById(long id){
		if(dal == null ) return null;
		return dal.queryGroupInfoById(id);
	}
	/**
	 * 删除所有的班组信息
	 */
	public void deleteAllGroupInfo(){
		if(dal == null) return;
		dal.deleteAllGroupInfo();
	}
	/**
	 * 通过id删除班组信息
	 */
	void deleteGroupInfoById(long id){
		if(dal == null) return;
		dal.deleteGroupInfoById(id);
	}
}
