package com.ruoyi.tcZz.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.tcZz.domain.TcAqg;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.tcZz.mapper.TcWldvMapper;
import com.ruoyi.tcZz.domain.TcWldv;
import com.ruoyi.tcZz.service.ITcWldvService;

/**
 * 网络大VService业务层处理
 * 
 * @author ruoyi
 * @date 2023-10-13
 */
@Service
public class TcWldvServiceImpl implements ITcWldvService 
{
    @Autowired
    private TcWldvMapper tcWldvMapper;

    /**
     * 查询网络大V
     * 
     * @param id 网络大V主键
     * @return 网络大V
     */
    @Override
    public TcWldv selectTcWldvById(Long id)
    {
        return tcWldvMapper.selectTcWldvById(id);
    }

    /**
     * 查询网络大V列表
     * 
     * @param tcWldv 网络大V
     * @return 网络大V
     */
    @Override
    public List<TcWldv> selectTcWldvList(TcWldv tcWldv)
    {
        return tcWldvMapper.selectTcWldvList(tcWldv);
    }

    /**
     * 新增网络大V
     * 
     * @param tcWldv 网络大V
     * @return 结果
     */
    @Override
    public int insertTcWldv(TcWldv tcWldv)
    {
        tcWldv.setCreateTime(DateUtils.getNowDate());
        return tcWldvMapper.insertTcWldv(tcWldv);
    }

    /**
     * 修改网络大V
     * 
     * @param tcWldv 网络大V
     * @return 结果
     */
    @Override
    public int updateTcWldv(TcWldv tcWldv)
    {
        tcWldv.setUpdateTime(DateUtils.getNowDate());
        return tcWldvMapper.updateTcWldv(tcWldv);
    }

    /**
     * 批量删除网络大V
     * 
     * @param ids 需要删除的网络大V主键
     * @return 结果
     */
    @Override
    public int deleteTcWldvByIds(Long[] ids)
    {
        return tcWldvMapper.deleteTcWldvByIds(ids);
    }

    /**
     * 删除网络大V信息
     * 
     * @param id 网络大V主键
     * @return 结果
     */
    @Override
    public int deleteTcWldvById(Long id)
    {
        return tcWldvMapper.deleteTcWldvById(id);
    }

    @Override
    public String importUser(List<TcWldv> tcWldvList) {
        StringBuilder successMsg = new StringBuilder();
        if (!tcWldvList.isEmpty()) {
            for (TcWldv tcWldv : tcWldvList) {
                tcWldvMapper.insertTcWldv(tcWldv);
            }
            successMsg.append("导入成功");
        }
        return successMsg.toString();
    }

    @Override
    public void updateByisStatus(Integer isStatus,List<String> ids) {
        tcWldvMapper.updateByisStatus(isStatus,ids);
    }
}
