package com.javaweb.geo.service.impl; import java.util.List; import com.javaweb.common.utils.DateUtils; import com.javaweb.common.utils.IdGenerate; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.javaweb.geo.mapper.DeviceLogMapper; import com.javaweb.geo.domain.DeviceLog; import com.javaweb.geo.service.IDeviceLogService; import com.javaweb.common.core.text.Convert; import org.springframework.util.ObjectUtils; import tk.mybatis.mapper.genid.GenIdUtil; /** * 设备出入库记录Service业务层处理 * * @author cxy * @date 2024-05-16 */ @Service public class DeviceLogServiceImpl implements IDeviceLogService { @Autowired private DeviceLogMapper deviceLogMapper; /** * 查询设备出入库记录 * * @param id 设备出入库记录ID * @return 设备出入库记录 */ @Override public DeviceLog selectDeviceLogById(String id) { return deviceLogMapper.selectDeviceLogById(id); } /** * 查询设备出入库记录列表 * * @param deviceLog 设备出入库记录 * @return 设备出入库记录 */ @Override public List selectDeviceLogList(DeviceLog deviceLog) { return deviceLogMapper.selectDeviceLogList(deviceLog); } /** * 新增设备出入库记录 * * @param deviceLog 设备出入库记录 * @return 结果 */ @Override public int insertDeviceLog(DeviceLog deviceLog) { if(ObjectUtils.isEmpty(deviceLog.getId())){ deviceLog.setId(IdGenerate.nextId()); } deviceLog.setCreateTime(DateUtils.getNowDate()); return deviceLogMapper.insertDeviceLog(deviceLog); } /** * 修改设备出入库记录 * * @param deviceLog 设备出入库记录 * @return 结果 */ @Override public int updateDeviceLog(DeviceLog deviceLog) { return deviceLogMapper.updateDeviceLog(deviceLog); } /** * 删除设备出入库记录对象 * * @param ids 需要删除的数据ID * @return 结果 */ @Override public int deleteDeviceLogByIds(String ids) { return deviceLogMapper.deleteDeviceLogByIds(Convert.toStrArray(ids)); } /** * 删除设备出入库记录信息 * * @param id 设备出入库记录ID * @return 结果 */ @Override public int deleteDeviceLogById(String id) { return deviceLogMapper.deleteDeviceLogById(id); } }