package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ClewImgMapper;
import com.ruoyi.system.domain.ClewImg;
import com.ruoyi.system.service.IClewImgService;
import com.ruoyi.common.core.text.Convert;

/**
 * 线索图片Service业务层处理
 *
 * @author ruoyi
 * @date 2023-11-06
 */
@Service
public class ClewImgServiceImpl implements IClewImgService
{
    @Autowired
    private ClewImgMapper clewImgMapper;

    /**
     * 查询线索图片
     *
     * @param id 线索图片主键
     * @return 线索图片
     */
    @Override
    public ClewImg selectClewImgById(Long id)
    {
        return clewImgMapper.selectClewImgById(id);
    }

    /**
     * 查询线索图片列表
     *
     * @param clewImg 线索图片
     * @return 线索图片
     */
    @Override
    public List<ClewImg> selectClewImgList(ClewImg clewImg)
    {
        return clewImgMapper.selectClewImgList(clewImg);
    }

    /**
     * 新增线索图片
     *
     * @param clewImg 线索图片
     * @return 结果
     */
    @Override
    public int insertClewImg(ClewImg clewImg)
    {
        clewImg.setCreateTime(DateUtils.getNowDate());
        return clewImgMapper.insertClewImg(clewImg);
    }

    /**
     * 修改线索图片
     *
     * @param clewImg 线索图片
     * @return 结果
     */
    @Override
    public int updateClewImg(ClewImg clewImg)
    {
        clewImg.setUpdateTime(DateUtils.getNowDate());
        return clewImgMapper.updateClewImg(clewImg);
    }

    /**
     * 批量删除线索图片
     *
     * @param ids 需要删除的线索图片主键
     * @return 结果
     */
    @Override
    public int deleteClewImgByIds(String ids)
    {
        return clewImgMapper.deleteClewImgByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除线索图片信息
     *
     * @param id 线索图片主键
     * @return 结果
     */
    @Override
    public int deleteClewImgById(Long id)
    {
        return clewImgMapper.deleteClewImgById(id);
    }
}
