package com.flossom.system.service.impl;

import java.util.List;

import com.flossom.common.core.domain.entity.WxModeTag;
import com.flossom.common.core.mapper.WxModeTagMapper;
import com.flossom.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.flossom.system.service.IWxModeTagService;

/**
 * 模式与标签关联Service业务层处理
 *
 * @author flossom
 * @date 2024-01-18
 */
@Service
public class WxModeTagServiceImpl implements IWxModeTagService
{
    @Autowired
    private WxModeTagMapper wxModeTagMapper;

    /**
     * 查询模式与标签关联
     *
     * @param id 模式与标签关联主键
     * @return 模式与标签关联
     */
    @Override
    public WxModeTag selectWxModeTagById(Long id)
    {
        return wxModeTagMapper.selectWxModeTagById(id);
    }

    /**
     * 查询模式与标签关联列表
     *
     * @param wxModeTag 模式与标签关联
     * @return 模式与标签关联
     */
    @Override
    public List<WxModeTag> selectWxModeTagList(WxModeTag wxModeTag)
    {
        return wxModeTagMapper.selectWxModeTagList(wxModeTag);
    }

    /**
     * 新增模式与标签关联
     *
     * @param wxModeTag 模式与标签关联
     * @return 结果
     */
    @Override
    public int insertWxModeTag(WxModeTag wxModeTag)
    {
        wxModeTag.setCreateTime(DateUtils.getNowDate());
        return wxModeTagMapper.insertWxModeTag(wxModeTag);
    }

    /**
     * 修改模式与标签关联
     *
     * @param wxModeTag 模式与标签关联
     * @return 结果
     */
    @Override
    public int updateWxModeTag(WxModeTag wxModeTag)
    {
        wxModeTag.setUpdateTime(DateUtils.getNowDate());
        return wxModeTagMapper.updateWxModeTag(wxModeTag);
    }

    /**
     * 批量删除模式与标签关联
     *
     * @param ids 需要删除的模式与标签关联主键
     * @return 结果
     */
    @Override
    public int deleteWxModeTagByIds(Long[] ids)
    {
        return wxModeTagMapper.deleteWxModeTagByIds(ids);
    }

    /**
     * 删除模式与标签关联信息
     *
     * @param id 模式与标签关联主键
     * @return 结果
     */
    @Override
    public int deleteWxModeTagById(Long id)
    {
        return wxModeTagMapper.deleteWxModeTagById(id);
    }

    @Override
    public int deleteWxModeTagByTagId(Long tagId) {
        return wxModeTagMapper.deleteWxModeTagByTagId(tagId);
    }
}
