package com.flossom.system.service.impl;

import java.util.List;

import com.flossom.common.core.domain.entity.WxUserTag;
import com.flossom.common.core.mapper.WxUserTagMapper;
import com.flossom.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.flossom.system.service.IWxUserTagService;

/**
 * 微信用户标签关联Service业务层处理
 *
 * @author flossom
 * @date 2023-12-19
 */
@Service
public class WxUserTagServiceImpl implements IWxUserTagService {
    @Autowired
    private WxUserTagMapper wxUserTagMapper;

    /**
     * 查询微信用户标签关联
     *
     * @param id 微信用户标签关联主键
     * @return 微信用户标签关联
     */
    @Override
    public WxUserTag selectWxUserTagById(Long id) {
        return wxUserTagMapper.selectWxUserTagById(id);
    }

    /**
     * 查询微信用户标签关联列表
     *
     * @param wxUserTag 微信用户标签关联
     * @return 微信用户标签关联
     */
    @Override
    public List<WxUserTag> selectWxUserTagList(WxUserTag wxUserTag) {
        return wxUserTagMapper.selectWxUserTagList(wxUserTag);
    }

    /**
     * 新增微信用户标签关联
     *
     * @param wxUserTag 微信用户标签关联
     * @return 结果
     */
    @Override
    public int insertWxUserTag(WxUserTag wxUserTag) {
        wxUserTag.setCreateTime(DateUtils.getNowDate());
        return wxUserTagMapper.insertWxUserTag(wxUserTag);
    }

    /**
     * 修改微信用户标签关联
     *
     * @param wxUserTag 微信用户标签关联
     * @return 结果
     */
    @Override
    public int updateWxUserTag(WxUserTag wxUserTag) {
        wxUserTag.setUpdateTime(DateUtils.getNowDate());
        return wxUserTagMapper.updateWxUserTag(wxUserTag);
    }

    /**
     * 批量删除微信用户标签关联
     *
     * @param ids 需要删除的微信用户标签关联主键
     * @return 结果
     */
    @Override
    public int deleteWxUserTagByIds(Long[] ids) {
        return wxUserTagMapper.deleteWxUserTagByIds(ids);
    }

    /**
     * 删除微信用户标签关联信息
     *
     * @param id 微信用户标签关联主键
     * @return 结果
     */
    @Override
    public int deleteWxUserTagById(Long id) {
        return wxUserTagMapper.deleteWxUserTagById(id);
    }

    @Override
    public int deleteWxUserTagByTagId(Long tagId) {
        return wxUserTagMapper.deleteWxUserTagByTagId(tagId);
    }
}
