package com.fjs.scenic.service.news.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.fjs.scenic.entity.news.News;
import com.fjs.scenic.mapper.news.NewsMapper;
import com.fjs.scenic.service.news.NewsService;

@Service
public class NewsServiceImpl implements NewsService {

	@Autowired
	private NewsMapper newMapper;
	
	@Override
	public void insert(News record) {
		newMapper.insert(record);
	}

	@Override
	public List<News> select(News record) {
		return newMapper.select(record);
	}

	@Override
	public void update(News record) {
		newMapper.update(record);
	}

	@Override
	public void delete(News record) {
		newMapper.delete(record);
	}

	@Override
	public List<News> selectByParam(String field, String param) {
		Map<String, String> map = new HashMap<String, String>();
		map.put("field", field);
		map.put("param", param);
		return newMapper.selectByParam(map);
	}

	@Override
	public void updateByParam(String param) {
		Map<String, String> map = new HashMap<String, String>();
		map.put("param", param);
		newMapper.updateByParam(map);
	}

	@Override
	public void deleteByParam(String param) {
		Map<String, String> map = new HashMap<String, String>();
		map.put("param", param);
		newMapper.deleteByParam(map);
	}

}
