package com.cloudcross.ssp.back.service.impl;

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

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

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

@Service
public class AclsService implements IAclsService {

	@Autowired
	private GenericIBatisDao ibatisDao;

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

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

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

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

	@Override
	public Acls findById(Long id) {
		return ibatisDao.get("back.aclsSqlMapper.findById", id);
	}

	/*
	 * 批量删除acls
	 */
	@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;
	}

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

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