package com.amms.service.impl;

import java.util.List;
import java.util.Date;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.amms.mapper.MuseumIntroMapper;
import com.amms.domain.MuseumIntro;
import com.amms.service.IMuseumIntroService;
import com.amms.security.SecurityUtils;

/**
 * 博物馆简介Service业务层处理
 */
@Service
public class MuseumIntroServiceImpl implements IMuseumIntroService {

    @Autowired
    private MuseumIntroMapper museumIntroMapper;

    /**
     * 查询博物馆简介列表
     *
     * @param museumIntro 博物馆简介
     * @return 博物馆简介
     */
    @Override
    public List<MuseumIntro> selectMuseumIntroList(MuseumIntro museumIntro) {
        return museumIntroMapper.selectMuseumIntroList(museumIntro);
    }

    /**
     * 查询博物馆简介
     *
     * @param museumName 博物馆简介主键
     * @return 博物馆简介
     */
    @Override
    public MuseumIntro selectMuseumIntroByMuseumName(String museumName) {
        return museumIntroMapper.selectMuseumIntroByMuseumName(museumName);
    }

    /**
     * 新增博物馆简介
     *
     * @param museumIntro 博物馆简介
     * @return 结果
     */
    @Override
    public int insertMuseumIntro(MuseumIntro museumIntro) {
        return museumIntroMapper.insertMuseumIntro(museumIntro);
    }

    /**
     * 修改博物馆简介
     *
     * @param museumIntro 博物馆简介
     * @return 结果
     */
    @Override
    public int updateMuseumIntro(MuseumIntro museumIntro) {
        museumIntro.setUpdateTime(new Date());
        museumIntro.setUpdater(SecurityUtils.getCurrentUser().getId());
        return museumIntroMapper.updateMuseumIntro(museumIntro);
    }

    /**
     * 删除博物馆简介信息
     *
     * @param museumName 博物馆简介主键
     * @return 结果
     */
    @Override
    public int deleteMuseumIntroByMuseumName(String museumName) {
        return museumIntroMapper.deleteMuseumIntroByMuseumName(museumName);
    }

}
