package com.xingxi.business.UserRefuseTag.service.impl;

import com.xingxi.common.core.text.Convert;
import com.xingxi.common.utils.DateUtils;
import com.xingxi.business.UserRefuseTag.domain.UserRefuseTag;
import com.xingxi.business.UserRefuseTag.mapper.UserRefuseTagMapper;
import com.xingxi.business.UserRefuseTag.service.IUserRefuseTagService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 用户避雷标签Service业务层处理
 *
 * @author xingxi
 * @date 2025-03-06
 */
@Service
public class UserRefuseTagServiceImpl implements IUserRefuseTagService {
    @Resource
    private UserRefuseTagMapper userRefuseTagMapper;

    /**
     * 查询用户避雷标签
     *
     * @param userRefuseId 用户避雷标签主键
     * @return 用户避雷标签
     */
    @Override
    public UserRefuseTag selectUserRefuseTagByUserRefuseId(Long userRefuseId) {
        return userRefuseTagMapper.selectUserRefuseTagByUserRefuseId(userRefuseId);
    }

    /**
     * 查询用户避雷标签列表
     *
     * @param userRefuseTag 用户避雷标签
     * @return 用户避雷标签
     */
    @Override
    public List<UserRefuseTag> selectUserRefuseTagList(UserRefuseTag userRefuseTag) {
        return userRefuseTagMapper.selectUserRefuseTagList(userRefuseTag);
    }

    /**
     * 新增用户避雷标签
     *
     * @param userRefuseTag 用户避雷标签
     * @return 结果
     */
    @Override
    public int insertUserRefuseTag(UserRefuseTag userRefuseTag) {
        userRefuseTag.setCreateTime(DateUtils.getNowDate());
        return userRefuseTagMapper.insertUserRefuseTag(userRefuseTag);
    }

    /**
     * 新增用户避雷标签
     *
     * @param userRefuseTagList 用户避雷标签
     * @return 结果
     */
    @Override
    public int batchInsertUserRefuseTag(List<UserRefuseTag> userRefuseTagList) {
        return userRefuseTagMapper.batchInsertUserRefuseTag(userRefuseTagList);
    }

    /**
     * 修改用户避雷标签
     *
     * @param userRefuseTag 用户避雷标签
     * @return 结果
     */
    @Override
    public int updateUserRefuseTag(UserRefuseTag userRefuseTag) {
        userRefuseTag.setUpdateTime(DateUtils.getNowDate());
        return userRefuseTagMapper.updateUserRefuseTag(userRefuseTag);
    }

    /**
     * 批量删除用户避雷标签
     *
     * @param userRefuseIds 需要删除的用户避雷标签主键
     * @return 结果
     */
    @Override
    public int deleteUserRefuseTagByUserRefuseIds(String userRefuseIds) {
        return userRefuseTagMapper.deleteUserRefuseTagByUserRefuseIds(Convert.toStrArray(userRefuseIds));
    }

    /**
     * 删除用户避雷标签信息
     *
     * @param userRefuseId 用户避雷标签主键
     * @return 结果
     */
    @Override
    public int deleteUserRefuseTagByUserRefuseId(Long userRefuseId) {
        return userRefuseTagMapper.deleteUserRefuseTagByUserRefuseId(userRefuseId);
    }

    /**
     * 逻辑删除用户避雷标签
     *
     * @param userRefuseId 用户避雷标签主键
     * @return 结果
     */
    @Override
    public int logicDeleteUserRefuseTagByUserRefuseId(Long userRefuseId) {
        return userRefuseTagMapper.logicDeleteUserRefuseTagByUserRefuseId(userRefuseId);
    }

    /**
     * 逻辑批量删除用户避雷标签
     *
     * @param userRefuseIds 需要删除的数据主键集合
     * @return 结果
     */
    @Override
    public int logicDeleteUserRefuseTagByUserRefuseIds(String[] userRefuseIds) {
        return userRefuseTagMapper.logicDeleteUserRefuseTagByUserRefuseIds(userRefuseIds);
    }

    /**
     * 逻辑批量删除用户避雷标签
     *
     * @param userRefuseTag 用户避雷标签
     * @return 结果
     */
    @Override
    public int logicDeleteUserRefuseTagByCondition(UserRefuseTag userRefuseTag) {
        return userRefuseTagMapper.logicDeleteUserRefuseTagByCondition(userRefuseTag);
    }
}
