package com.op.wms.service.impl;

import java.util.List;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.op.wms.mapper.BaseEquipmentMapper;
import com.op.wms.domain.BaseEquipment;
import com.op.wms.service.IBaseEquipmentService;

/**
 * 设备管理Service业务层处理
 * 
 * @author Open Platform
 * @date 2023-07-20
 */
@Service
public class BaseEquipmentServiceImpl implements IBaseEquipmentService {
	@Autowired
	private BaseEquipmentMapper baseEquipmentMapper;

	/**
	 * 查询设备管理
	 * 
	 * @param equipmentId 设备管理主键
	 * @return 设备管理
	 */
	@Override
	@DS("#header.poolName")
	public BaseEquipment selectBaseEquipmentByEquipmentId(Long equipmentId) {
		return baseEquipmentMapper.selectBaseEquipmentByEquipmentId(equipmentId);
	}

	/**
	 * 查询设备管理列表
	 * 
	 * @param baseEquipment 设备管理
	 * @return 设备管理
	 */
	@Override
	@DS("#header.poolName")
	public List<BaseEquipment> selectBaseEquipmentList(BaseEquipment baseEquipment) {
		return baseEquipmentMapper.selectBaseEquipmentList(baseEquipment);
	}

	/**
	 * 新增设备管理
	 * 
	 * @param baseEquipment 设备管理
	 * @return 结果
	 */
	@Override
	@DS("#header.poolName")
	public int insertBaseEquipment(BaseEquipment baseEquipment) {
		baseEquipment.setCreateTime(DateUtils.getNowDate());
		return baseEquipmentMapper.insertBaseEquipment(baseEquipment);
	}

	/**
	 * 修改设备管理
	 * 
	 * @param baseEquipment 设备管理
	 * @return 结果
	 */
	@Override
	@DS("#header.poolName")
	public int updateBaseEquipment(BaseEquipment baseEquipment) {
		baseEquipment.setUpdateTime(DateUtils.getNowDate());
		return baseEquipmentMapper.updateBaseEquipment(baseEquipment);
	}

	/**
	 * 批量删除设备管理
	 * 
	 * @param equipmentIds 需要删除的设备管理主键
	 * @return 结果
	 */
	@Override
	@DS("#header.poolName")
	public int deleteBaseEquipmentByEquipmentIds(Long[] equipmentIds) {
		return baseEquipmentMapper.deleteBaseEquipmentByEquipmentIds(equipmentIds);
	}

	/**
	 * 删除设备管理信息
	 * 
	 * @param equipmentId 设备管理主键
	 * @return 结果
	 */
	@Override
	@DS("#header.poolName")
	public int deleteBaseEquipmentByEquipmentId(Long equipmentId) {
		return baseEquipmentMapper.deleteBaseEquipmentByEquipmentId(equipmentId);
	}
}
