package com.fjs.scenic.service.scenic.impl;

import com.fjs.scenic.entity.scenic.Pics;
import com.fjs.scenic.mapper.scenic.PicsMapper;
import com.fjs.scenic.service.common.impl.BaseServiceImpl;
import com.fjs.scenic.service.scenic.PicsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

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

/**
 * This class is used for ...
 *
 * @author lfj
 * @version 1.0
 * @CreateDate ${date} ${time}
 */
@Service
public class PicsServiceImpl extends BaseServiceImpl<Pics> implements PicsService {
    @Autowired
    private PicsMapper picsMapper;

    @Override
    public int update(Pics pics) {
        return picsMapper.updateByFid(pics);
    }

    @Override
    public List<Pics> getPic(Integer fid) {
        return picsMapper.selectByFid(fid);
    }

    @Override
    public int update(List<Pics> picsList) {
        picsMapper.deleteByFid(picsList.get(0).getFid());
        return picsMapper.adds(picsList);
    }

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