package com.cloudcross.ssp.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

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

import com.cloudcross.ssp.base.dao.GenericIBatisDao;
import com.cloudcross.ssp.common.utils.MapBuilder;
import com.cloudcross.ssp.common.utils.Pager;
import com.cloudcross.ssp.model.Acls;
import com.cloudcross.ssp.service.IAclsService;

public class AclsService implements IAclsService{
	@Autowired
	private GenericIBatisDao ibatisDao;
	
	@Override
	public Acls findById(Long id) {
		return ibatisDao.get("aclsSqlMapper.findById", id);
	}

	@Override
	public int countByParams(Map<String, Object> paramMap) {
		throw new UnsupportedOperationException();
	}

	@Override
	public List<Acls> findByParams(Map<String, Object> paramMap, Pager pager) {
		throw new UnsupportedOperationException();
	}

	@Override
	public boolean add(Acls t) {
		ibatisDao.save("aclsSqlMapper.addAcls", t);
		return true;
	}

	@Override
	public boolean edit(Acls t) {
		ibatisDao.save("aclsSqlMapper.editAcls", t);
		return true;
	}

	@Override
	public boolean updateStatus(List<Long> idList, int status) {
		throw new UnsupportedOperationException();
	}

	@Override
	public boolean deleteByBannerId(Long id) {
		ibatisDao.delete("aclsSqlMapper.deleteAcls", id);
		return true;
	}

	@Override
	public boolean deleteBatch(List<Long> lists, String type) {
		ibatisDao.delete("deleteAclsBatch", MapBuilder.create(HashMap.class)
				.add("idList", lists).add("type", type).map());
		return true;
	}

}
