地质所 沉降监测网建设项目
suerwei
2024-05-16 560e679c239af089e2ba79bdbec4bac331c01b4f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
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<DeviceLog> 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);
    }
}