package com.ruoyi.system.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.IllegalShipData;
import com.ruoyi.system.mapper.IllegalShipDataMapper;
import com.ruoyi.system.service.IIllegalShipDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 嫌疑违法船舶Service业务层处理
 *
 * @author xintong
 * @date 2021-11-05
 */
@Service
public class IllegalShipDataServiceImpl implements IIllegalShipDataService {
    @Autowired
    private IllegalShipDataMapper illegalShipDataMapper;

    /**
     * 查询嫌疑违法船舶
     *
     * @param id 嫌疑违法船舶ID
     * @return 嫌疑违法船舶
     */
    @Override
    public IllegalShipData selectIllegalShipDataById(Long id) {
        return illegalShipDataMapper.selectIllegalShipDataById(id);
    }

    /**
     * 查询嫌疑违法船舶列表
     *
     * @param illegalShipData 嫌疑违法船舶
     * @return 嫌疑违法船舶
     */
    @Override
    public List<IllegalShipData> selectIllegalShipDataList(IllegalShipData illegalShipData) {
        return illegalShipDataMapper.selectIllegalShipDataList(illegalShipData);
    }

    /**
     * 新增嫌疑违法船舶
     *
     * @param illegalShipData 嫌疑违法船舶
     * @return 结果
     */
    @Override
    public int insertIllegalShipData(IllegalShipData illegalShipData) {
        return illegalShipDataMapper.insertIllegalShipData(illegalShipData);
    }

    /**
     * 修改嫌疑违法船舶
     *
     * @param illegalShipData 嫌疑违法船舶
     * @return 结果
     */
    @Override
    public int updateIllegalShipData(IllegalShipData illegalShipData) {
        illegalShipData.setUpdateTime(DateUtils.getNowDate());
        return illegalShipDataMapper.updateIllegalShipData(illegalShipData);
    }

    /**
     * 批量删除嫌疑违法船舶
     *
     * @param ids 需要删除的嫌疑违法船舶ID
     * @return 结果
     */
    @Override
    public int deleteIllegalShipDataByIds(Long[] ids) {
        return illegalShipDataMapper.deleteIllegalShipDataByIds(ids);
    }

    /**
     * 删除嫌疑违法船舶信息
     *
     * @param id 嫌疑违法船舶ID
     * @return 结果
     */
    @Override
    public int deleteIllegalShipDataById(Long id) {
        return illegalShipDataMapper.deleteIllegalShipDataById(id);
    }
}
