package com.flossom.system.service.impl;

import java.util.List;

import com.flossom.common.core.domain.entity.CtLeaveMessage;
import com.flossom.common.core.mapper.CtLeaveMessageMapper;
import com.flossom.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.flossom.system.service.ICtLeaveMessageService;

/**
 * 共创管理-留言管理Service业务层处理
 *
 * @author flossom
 * @date 2023-12-11
 */
@Service
public class CtLeaveMessageServiceImpl implements ICtLeaveMessageService
{
    @Autowired
    private CtLeaveMessageMapper ctLeaveMessageMapper;

    /**
     * 查询共创管理-留言管理
     *
     * @param id 共创管理-留言管理主键
     * @return 共创管理-留言管理
     */
    @Override
    public CtLeaveMessage selectCtLeaveMessageById(Long id)
    {
        return ctLeaveMessageMapper.selectCtLeaveMessageById(id);
    }

    /**
     * 查询共创管理-留言管理列表
     *
     * @param ctLeaveMessage 共创管理-留言管理
     * @return 共创管理-留言管理
     */
    @Override
    public List<CtLeaveMessage> selectCtLeaveMessageList(CtLeaveMessage ctLeaveMessage)
    {
        return ctLeaveMessageMapper.selectCtLeaveMessageList(ctLeaveMessage);
    }

    /**
     * 新增共创管理-留言管理
     *
     * @param ctLeaveMessage 共创管理-留言管理
     * @return 结果
     */
    @Override
    public int insertCtLeaveMessage(CtLeaveMessage ctLeaveMessage)
    {
        ctLeaveMessage.setCreateTime(DateUtils.getNowDate());
        return ctLeaveMessageMapper.insertCtLeaveMessage(ctLeaveMessage);
    }

    /**
     * 修改共创管理-留言管理
     *
     * @param ctLeaveMessage 共创管理-留言管理
     * @return 结果
     */
    @Override
    public int updateCtLeaveMessage(CtLeaveMessage ctLeaveMessage)
    {
        return ctLeaveMessageMapper.updateCtLeaveMessage(ctLeaveMessage);
    }

    /**
     * 批量删除共创管理-留言管理
     *
     * @param ids 需要删除的共创管理-留言管理主键
     * @return 结果
     */
    @Override
    public int deleteCtLeaveMessageByIds(Long[] ids)
    {
        return ctLeaveMessageMapper.deleteCtLeaveMessageByIds(ids);
    }

    /**
     * 删除共创管理-留言管理信息
     *
     * @param id 共创管理-留言管理主键
     * @return 结果
     */
    @Override
    public int deleteCtLeaveMessageById(Long id)
    {
        return ctLeaveMessageMapper.deleteCtLeaveMessageById(id);
    }
    /**
     * 查询共创管理-留言管理列表-特殊条件
     *
     * @param ctLeaveMessage 共创管理-留言管理
     * @return 共创管理-留言管理
     */
    @Override
    public List<CtLeaveMessage> selectCtLeaveMessageByCondition(CtLeaveMessage ctLeaveMessage) {
        return ctLeaveMessageMapper.selectCtLeaveMessageByCondition(ctLeaveMessage);
    }
}
