package com.cloudcross.ssp.service.impl;

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

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.cloudcross.ssp.base.dao.GenericIBatisDao;
import com.cloudcross.ssp.common.utils.Pager;
import com.cloudcross.ssp.model.PlaceOperator;
import com.cloudcross.ssp.service.IPlaceOperatorService;

@Service
public class PlaceOperatorService implements IPlaceOperatorService{
	private static final Logger LOG = Logger.getLogger(PlaceOperatorService.class);
	@Autowired
	private GenericIBatisDao myBatisDao;
	
	@Override
	public Long findByNameAndOperatorId(Map<String, Object> paramMap) {
		return myBatisDao.get("placeOperatorSqlMapper.findByNameAndOperatorId", paramMap); 
	}

	@Override
	public List<String> findPlaceByOperator(Long OperatorId) {
		return myBatisDao.getList("placeOperatorSqlMapper.findPlaceByOperator", OperatorId);
	}

	@Override
	public List<Map<Long, String>> findPlace(Long OperatorId) {
		return myBatisDao.getList("placeOperatorSqlMapper.findPlace", OperatorId);
	}

	@Override
	public PlaceOperator findById(Long id) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public int countByParams(Map<String, Object> paramMap) {
		return myBatisDao.get("placeOperatorSqlMapper.countByParams", paramMap);
	}

	@Override
	public List<PlaceOperator> findByParams(Map<String, Object> paramMap,
			Pager pager) {
		paramMap.put("pager", pager);
		return myBatisDao.getList("placeOperatorSqlMapper.findByParams", paramMap);
	}

	@Override
	public boolean add(PlaceOperator t) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean edit(PlaceOperator t) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean updateStatus(List<Long> idList, int status) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public List<PlaceOperator> findByParams(Map<String, Object> paramMap) {
		return myBatisDao.getList("placeOperatorSqlMapper.findByParams1", paramMap);
	}

	@Override
	public int countByParamsBack(Map<String, Object> paramMap) {
		return myBatisDao.get("placeOperatorSqlMapper.countByParamsBack", paramMap);
	}

	@Override
	public List<PlaceOperator> findByParamsBack(Map<String, Object> paramMap,
			Pager pager) {
		paramMap.put("pager", pager);
		return myBatisDao.getList("placeOperatorSqlMapper.findByParamsBack", paramMap);
	}

	@Override
	public List<PlaceOperator> findByParamsBack(Map<String, Object> paramMap) {
		return myBatisDao.getList("placeOperatorSqlMapper.findByParams1Back", paramMap);
	}
	
	
	@Override
	public int countUnclassfiedPlace(Map<String, Object> paramMap) {
		return myBatisDao.get("placeOperatorSqlMapper.countUnclassfiedPlace", paramMap);
	}
	
	@Override
	public List<PlaceOperator> findUnclassfiedPlace(Map<String, Object> paramMap) {
		return myBatisDao.getList("placeOperatorSqlMapper.findUnclassfiedPlace", paramMap);
	}
	
	@Override
	public boolean update(Map<String, Object> paramMap) {
		myBatisDao.save("placeOperatorSqlMapper.update", paramMap);
		return true;
	}

}
