package com.ruoyi.custclient.service.impl;

import java.util.List;

import com.alibaba.nacos.shaded.com.google.common.collect.Lists;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.common.core.utils.StringUtils;
import com.ruoyi.custclient.dto.QueryLabelCodeDto;
import com.ruoyi.custclient.mapper.LabelCodeMapper;
import com.ruoyi.custclient.service.ILabelCodeService;
import com.ruoyi.custclient.vo.PageLabelCodeVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.domain.LabelCode;
import org.springframework.util.CollectionUtils;

/**
 * 标签Service业务层处理
 *
 * @author ruoyi
 * @date 2024-10-17
 */
@Service
public class LabelCodeServiceImpl extends ServiceImpl<LabelCodeMapper, LabelCode> implements ILabelCodeService {
    @Autowired
    private LabelCodeMapper labelCodeMapper;

    /**
     * 查询标签
     *
     * @param id 标签主键
     * @return 标签
     */
    @Override
    public LabelCode selectLabelCodeById(Long id) {
        return labelCodeMapper.selectLabelCodeById(id);
    }

    /**
     * 查询标签列表
     *
     * @param labelCode 标签
     * @return 标签
     */
    @Override
    public List<LabelCode> selectLabelCodeList(LabelCode labelCode) {
        return labelCodeMapper.selectLabelCodeList(labelCode);
    }

    /**
     * 新增标签
     *
     * @param labelCode 标签
     * @return 结果
     */
    @Override
    public int insertLabelCode(LabelCode labelCode) {
        labelCode.setCreateTime(DateUtils.getNowDate());
        return labelCodeMapper.insertLabelCode(labelCode);
    }

    /**
     * 修改标签
     *
     * @param labelCode 标签
     * @return 结果
     */
    @Override
    public int updateLabelCode(LabelCode labelCode) {
        return labelCodeMapper.updateLabelCode(labelCode);
    }

    /**
     * 批量删除标签
     *
     * @param ids 需要删除的标签主键
     * @return 结果
     */
    @Override
    public int deleteLabelCodeByIds(Long[] ids) {
        return labelCodeMapper.deleteLabelCodeByIds(ids);
    }

    /**
     * 删除标签信息
     *
     * @param id 标签主键
     * @return 结果
     */
    @Override
    public int deleteLabelCodeById(Long id) {
        return labelCodeMapper.deleteLabelCodeById(id);
    }


}
