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.TcJbmapMapper;
import com.ruoyi.tcZz.domain.TcJbmap;
import com.ruoyi.tcZz.service.ITcJbmapService;

/**
 * 举报地图Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-10-13
 */
@Service
public class TcJbmapServiceImpl implements ITcJbmapService 
{
    @Autowired
    private TcJbmapMapper tcJbmapMapper;

    /**
     * 查询举报地图
     * 
     * @param id 举报地图主键
     * @return 举报地图
     */
    @Override
    public TcJbmap selectTcJbmapById(Long id)
    {
        return tcJbmapMapper.selectTcJbmapById(id);
    }

    /**
     * 查询举报地图列表
     * 
     * @param tcJbmap 举报地图
     * @return 举报地图
     */
    @Override
    public List<TcJbmap> selectTcJbmapList(TcJbmap tcJbmap)
    {
        return tcJbmapMapper.selectTcJbmapList(tcJbmap);
    }

    /**
     * 新增举报地图
     * 
     * @param tcJbmap 举报地图
     * @return 结果
     */
    @Override
    public int insertTcJbmap(TcJbmap tcJbmap)
    {
        tcJbmap.setCreateTime(DateUtils.getNowDate());
        return tcJbmapMapper.insertTcJbmap(tcJbmap);
    }

    /**
     * 修改举报地图
     * 
     * @param tcJbmap 举报地图
     * @return 结果
     */
    @Override
    public int updateTcJbmap(TcJbmap tcJbmap)
    {
        tcJbmap.setUpdateTime(DateUtils.getNowDate());
        return tcJbmapMapper.updateTcJbmap(tcJbmap);
    }

    /**
     * 批量删除举报地图
     * 
     * @param ids 需要删除的举报地图主键
     * @return 结果
     */
    @Override
    public int deleteTcJbmapByIds(Long[] ids)
    {
        return tcJbmapMapper.deleteTcJbmapByIds(ids);
    }

    /**
     * 删除举报地图信息
     * 
     * @param id 举报地图主键
     * @return 结果
     */
    @Override
    public int deleteTcJbmapById(Long id)
    {
        return tcJbmapMapper.deleteTcJbmapById(id);
    }

    @Override
    public String importUser(List<TcJbmap> tcJbmapList) {
        StringBuilder successMsg = new StringBuilder();
        if (!tcJbmapList.isEmpty()) {
            for (TcJbmap tcJbmap : tcJbmapList) {
                tcJbmapMapper.insertTcJbmap(tcJbmap);
            }
            successMsg.append("导入成功");
        }

        return successMsg.toString();
    }

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