package com.ruoyi.tcZz.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.tcZz.domain.TcWljgtj;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.tcZz.mapper.TcZdlyjgMapper;
import com.ruoyi.tcZz.domain.TcZdlyjg;
import com.ruoyi.tcZz.service.ITcZdlyjgService;

/**
 * 重点领域监管Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-10-13
 */
@Service
public class TcZdlyjgServiceImpl implements ITcZdlyjgService 
{
    @Autowired
    private TcZdlyjgMapper tcZdlyjgMapper;

    /**
     * 查询重点领域监管
     * 
     * @param id 重点领域监管主键
     * @return 重点领域监管
     */
    @Override
    public TcZdlyjg selectTcZdlyjgById(Long id)
    {
        return tcZdlyjgMapper.selectTcZdlyjgById(id);
    }

    /**
     * 查询重点领域监管列表
     * 
     * @param tcZdlyjg 重点领域监管
     * @return 重点领域监管
     */
    @Override
    public List<TcZdlyjg> selectTcZdlyjgList(TcZdlyjg tcZdlyjg)
    {
        return tcZdlyjgMapper.selectTcZdlyjgList(tcZdlyjg);
    }

    /**
     * 新增重点领域监管
     * 
     * @param tcZdlyjg 重点领域监管
     * @return 结果
     */
    @Override
    public int insertTcZdlyjg(TcZdlyjg tcZdlyjg)
    {
        tcZdlyjg.setCreateTime(DateUtils.getNowDate());
        return tcZdlyjgMapper.insertTcZdlyjg(tcZdlyjg);
    }

    /**
     * 修改重点领域监管
     * 
     * @param tcZdlyjg 重点领域监管
     * @return 结果
     */
    @Override
    public int updateTcZdlyjg(TcZdlyjg tcZdlyjg)
    {
        tcZdlyjg.setUpdateTime(DateUtils.getNowDate());
        return tcZdlyjgMapper.updateTcZdlyjg(tcZdlyjg);
    }

    /**
     * 批量删除重点领域监管
     * 
     * @param ids 需要删除的重点领域监管主键
     * @return 结果
     */
    @Override
    public int deleteTcZdlyjgByIds(Long[] ids)
    {
        return tcZdlyjgMapper.deleteTcZdlyjgByIds(ids);
    }

    /**
     * 删除重点领域监管信息
     * 
     * @param id 重点领域监管主键
     * @return 结果
     */
    @Override
    public int deleteTcZdlyjgById(Long id)
    {
        return tcZdlyjgMapper.deleteTcZdlyjgById(id);
    }

    @Override
    public String importUser(List<TcZdlyjg> tcZdlyjgList) {
        StringBuilder successMsg = new StringBuilder();
        if (!tcZdlyjgList.isEmpty()) {
            for (TcZdlyjg tcZdlyjg : tcZdlyjgList) {
                tcZdlyjgMapper.insertTcZdlyjg(tcZdlyjg);
            }
            successMsg.append("导入成功");
        }
        return successMsg.toString();
    }

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