package com.ruoyi.tcZz.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.tcZz.domain.TcWljg;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.tcZz.mapper.TcFbqkMapper;
import com.ruoyi.tcZz.domain.TcFbqk;
import com.ruoyi.tcZz.service.ITcFbqkService;

/**
 * 分布情况 tc_fbqkService业务层处理
 * 
 * @author ruoyi
 * @date 2023-10-12
 */
@Service
public class TcFbqkServiceImpl implements ITcFbqkService 
{
    @Autowired
    private TcFbqkMapper tcFbqkMapper;

    /**
     * 查询分布情况 tc_fbqk
     * 
     * @param id 分布情况 tc_fbqk主键
     * @return 分布情况 tc_fbqk
     */
    @Override
    public TcFbqk selectTcFbqkById(Long id)
    {
        return tcFbqkMapper.selectTcFbqkById(id);
    }

    /**
     * 查询分布情况 tc_fbqk列表
     * 
     * @param tcFbqk 分布情况 tc_fbqk
     * @return 分布情况 tc_fbqk
     */
    @Override
    public List<TcFbqk> selectTcFbqkList(TcFbqk tcFbqk)
    {
        return tcFbqkMapper.selectTcFbqkList(tcFbqk);
    }

    /**
     * 新增分布情况 tc_fbqk
     * 
     * @param tcFbqk 分布情况 tc_fbqk
     * @return 结果
     */
    @Override
    public int insertTcFbqk(TcFbqk tcFbqk)
    {
        tcFbqk.setCreateTime(DateUtils.getNowDate());
        return tcFbqkMapper.insertTcFbqk(tcFbqk);
    }

    /**
     * 修改分布情况 tc_fbqk
     * 
     * @param tcFbqk 分布情况 tc_fbqk
     * @return 结果
     */
    @Override
    public int updateTcFbqk(TcFbqk tcFbqk)
    {
        tcFbqk.setUpdateTime(DateUtils.getNowDate());
        return tcFbqkMapper.updateTcFbqk(tcFbqk);
    }

    /**
     * 批量删除分布情况 tc_fbqk
     * 
     * @param ids 需要删除的分布情况 tc_fbqk主键
     * @return 结果
     */
    @Override
    public int deleteTcFbqkByIds(Long[] ids)
    {
        return tcFbqkMapper.deleteTcFbqkByIds(ids);
    }

    /**
     * 删除分布情况 tc_fbqk信息
     * 
     * @param id 分布情况 tc_fbqk主键
     * @return 结果
     */
    @Override
    public int deleteTcFbqkById(Long id)
    {
        return tcFbqkMapper.deleteTcFbqkById(id);
    }

    @Override
    public String importUser(List<TcFbqk> tcFbqkList) {
        StringBuilder successMsg = new StringBuilder();
        if (!tcFbqkList.isEmpty()) {
            for (TcFbqk tcFbqk : tcFbqkList) {
                tcFbqkMapper.insertTcFbqk(tcFbqk);
            }
            successMsg.append("导入成功");
        }

        return successMsg.toString();
    }

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