package com.dgtly.system.service.impl;

import java.util.List;
import com.dgtly.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.dgtly.system.mapper.SysRidingLanternMapper;
import com.dgtly.system.domain.SysRidingLantern;
import com.dgtly.system.service.ISysRidingLanternService;
import com.dgtly.common.core.text.Convert;

/**
 * 走马灯提示语Service业务层处理
 * 
 * @author dgtly
 * @date 2022-11-22
 */
@Service
public class SysRidingLanternServiceImpl implements ISysRidingLanternService 
{
    @Autowired
    private SysRidingLanternMapper sysRidingLanternMapper;

    /**
     * 查询走马灯提示语
     * 
     * @param id 走马灯提示语ID
     * @return 走马灯提示语
     */
    @Override
    public SysRidingLantern selectSysRidingLanternById(Long id)
    {
        return sysRidingLanternMapper.selectSysRidingLanternById(id);
    }

    /**
     * 查询走马灯提示语列表
     * 
     * @param sysRidingLantern 走马灯提示语
     * @return 走马灯提示语
     */
    @Override
    public List<SysRidingLantern> selectSysRidingLanternList(SysRidingLantern sysRidingLantern)
    {
        return sysRidingLanternMapper.selectSysRidingLanternList(sysRidingLantern);
    }

    /**
     * 新增走马灯提示语
     * 
     * @param sysRidingLantern 走马灯提示语
     * @return 结果
     */
    @Override
    public int insertSysRidingLantern(SysRidingLantern sysRidingLantern)
    {
        sysRidingLantern.setCreateTime(DateUtils.getNowDate());
        return sysRidingLanternMapper.insertSysRidingLantern(sysRidingLantern);
    }

    /**
     * 修改走马灯提示语
     * 
     * @param sysRidingLantern 走马灯提示语
     * @return 结果
     */
    @Override
    public int updateSysRidingLantern(SysRidingLantern sysRidingLantern)
    {
        sysRidingLantern.setUpdateTime(DateUtils.getNowDate());
        return sysRidingLanternMapper.updateSysRidingLantern(sysRidingLantern);
    }

    /**
     * 删除走马灯提示语对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteSysRidingLanternByIds(String ids)
    {
        return sysRidingLanternMapper.deleteSysRidingLanternByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除走马灯提示语信息
     * 
     * @param id 走马灯提示语ID
     * @return 结果
     */
    @Override
    public int deleteSysRidingLanternById(Long id)
    {
        return sysRidingLanternMapper.deleteSysRidingLanternById(id);
    }

    /**
     * 有效的通知公告
     */
    @Override
    public List<SysRidingLantern> selectLanternList() {
        return sysRidingLanternMapper.selectLanternList();
    }
}
