package com.cloudcross.ssp.service.impl;

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

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

import com.cloudcross.ssp.model.Place;
import com.cloudcross.ssp.service.IPlaceService;
import com.cloudcross.ssp.base.dao.GenericIBatisDao;
import com.cloudcross.ssp.common.utils.Pager;

@Service
public class PlaceService implements IPlaceService {

	@Autowired
	private GenericIBatisDao ibatisDao;
	@Override
	public Place findById(Long id) {
		return ibatisDao.get("placeSqlMapper.findById", id);
	}
	@Override
	public List<Place> findAll() {
		return ibatisDao.getList("placeSqlMapper.findAll");
	}
	@Override
	public int countByParams(Map<String, Object> paramMap) {
		return ibatisDao.get("placeSqlMapper.countByParams", paramMap);
	}

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

	@Override
	public boolean add(Place t) {
		ibatisDao.save("placeSqlMapper.add", t);
		return true;
	}

	@Override
	public boolean edit(Place 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<Place> findPlace() {
		// TODO Auto-generated method stub
		return ibatisDao.getList("placeSqlMapper.findAll");
	}
	@Override
	public List<Place> findUnclassfiedPlace() {
		return ibatisDao.getList("placeSqlMapper.findUnclassfiedPlace");
	}
	@Override
	public List<Place> findPlaceByPlaceClassId(Long placeClassId) {
		return ibatisDao.getList("placeSqlMapper.findPlaceByPlaceClassId", placeClassId);
	}


}
