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.TcWlaqzcqyMapper;
import com.ruoyi.tcZz.domain.TcWlaqzcqy;
import com.ruoyi.tcZz.service.ITcWlaqzcqyService;

/**
 * 网络安全支持单位Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-10-13
 */
@Service
public class TcWlaqzcqyServiceImpl implements ITcWlaqzcqyService 
{
    @Autowired
    private TcWlaqzcqyMapper tcWlaqzcqyMapper;

    /**
     * 查询网络安全支持单位
     * 
     * @param id 网络安全支持单位主键
     * @return 网络安全支持单位
     */
    @Override
    public TcWlaqzcqy selectTcWlaqzcqyById(Long id)
    {
        return tcWlaqzcqyMapper.selectTcWlaqzcqyById(id);
    }

    /**
     * 查询网络安全支持单位列表
     * 
     * @param tcWlaqzcqy 网络安全支持单位
     * @return 网络安全支持单位
     */
    @Override
    public List<TcWlaqzcqy> selectTcWlaqzcqyList(TcWlaqzcqy tcWlaqzcqy)
    {
        return tcWlaqzcqyMapper.selectTcWlaqzcqyList(tcWlaqzcqy);
    }

    /**
     * 新增网络安全支持单位
     * 
     * @param tcWlaqzcqy 网络安全支持单位
     * @return 结果
     */
    @Override
    public int insertTcWlaqzcqy(TcWlaqzcqy tcWlaqzcqy)
    {
        tcWlaqzcqy.setCreateTime(DateUtils.getNowDate());
        return tcWlaqzcqyMapper.insertTcWlaqzcqy(tcWlaqzcqy);
    }

    /**
     * 修改网络安全支持单位
     * 
     * @param tcWlaqzcqy 网络安全支持单位
     * @return 结果
     */
    @Override
    public int updateTcWlaqzcqy(TcWlaqzcqy tcWlaqzcqy)
    {
        tcWlaqzcqy.setUpdateTime(DateUtils.getNowDate());
        return tcWlaqzcqyMapper.updateTcWlaqzcqy(tcWlaqzcqy);
    }

    /**
     * 批量删除网络安全支持单位
     * 
     * @param ids 需要删除的网络安全支持单位主键
     * @return 结果
     */
    @Override
    public int deleteTcWlaqzcqyByIds(Long[] ids)
    {
        return tcWlaqzcqyMapper.deleteTcWlaqzcqyByIds(ids);
    }

    /**
     * 删除网络安全支持单位信息
     * 
     * @param id 网络安全支持单位主键
     * @return 结果
     */
    @Override
    public int deleteTcWlaqzcqyById(Long id)
    {
        return tcWlaqzcqyMapper.deleteTcWlaqzcqyById(id);
    }

    @Override
    public String importUser(List<TcWlaqzcqy> tcWlaqzcqyList) {
        StringBuilder successMsg = new StringBuilder();
        if (!tcWlaqzcqyList.isEmpty()) {
            for (TcWlaqzcqy tcWlaqzcqy : tcWlaqzcqyList) {
                tcWlaqzcqyMapper.insertTcWlaqzcqy(tcWlaqzcqy);
            }
            successMsg.append("导入成功");
        }
        return successMsg.toString();
    }

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