package com.ruoyi.tuya.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.tuya.mapper.TuyaLeaveWordsMapper;
import com.ruoyi.tuya.domain.TuyaLeaveWords;
import com.ruoyi.tuya.service.ITuyaLeaveWordsService;

/**
 * 用户留言Service业务层处理
 * 
 * @author zf
 * @date 2022-08-23
 */
@Service
public class TuyaLeaveWordsServiceImpl implements ITuyaLeaveWordsService 
{
    @Autowired
    private TuyaLeaveWordsMapper tuyaLeaveWordsMapper;

    /**
     * 查询用户留言
     * 
     * @param wordsId 用户留言主键
     * @return 用户留言
     */
    @Override
    public TuyaLeaveWords selectTuyaLeaveWordsByWordsId(Long wordsId)
    {
        return tuyaLeaveWordsMapper.selectTuyaLeaveWordsByWordsId(wordsId);
    }

    /**
     * 查询用户留言列表
     * 
     * @param tuyaLeaveWords 用户留言
     * @return 用户留言
     */
    @Override
    public List<TuyaLeaveWords> selectTuyaLeaveWordsList(TuyaLeaveWords tuyaLeaveWords)
    {
        return tuyaLeaveWordsMapper.selectTuyaLeaveWordsList(tuyaLeaveWords);
    }

    /**
     * 新增用户留言
     * 
     * @param tuyaLeaveWords 用户留言
     * @return 结果
     */
    @Override
    public int insertTuyaLeaveWords(TuyaLeaveWords tuyaLeaveWords)
    {
        tuyaLeaveWords.setCreateTime(DateUtils.getNowDate());
        return tuyaLeaveWordsMapper.insertTuyaLeaveWords(tuyaLeaveWords);
    }

    /**
     * 修改用户留言
     * 
     * @param tuyaLeaveWords 用户留言
     * @return 结果
     */
    @Override
    public int updateTuyaLeaveWords(TuyaLeaveWords tuyaLeaveWords)
    {
        tuyaLeaveWords.setUpdateTime(DateUtils.getNowDate());
        return tuyaLeaveWordsMapper.updateTuyaLeaveWords(tuyaLeaveWords);
    }

    /**
     * 批量删除用户留言
     * 
     * @param wordsIds 需要删除的用户留言主键
     * @return 结果
     */
    @Override
    public int deleteTuyaLeaveWordsByWordsIds(Long[] wordsIds)
    {
        return tuyaLeaveWordsMapper.deleteTuyaLeaveWordsByWordsIds(wordsIds);
    }

    /**
     * 删除用户留言信息
     * 
     * @param wordsId 用户留言主键
     * @return 结果
     */
    @Override
    public int deleteTuyaLeaveWordsByWordsId(Long wordsId)
    {
        return tuyaLeaveWordsMapper.deleteTuyaLeaveWordsByWordsId(wordsId);
    }
}
