DeviceService.java
895 Bytes
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
package cn.com.glsx.admin.modules.service;
import cn.com.glsx.admin.modules.entity.Device;
import cn.com.glsx.admin.modules.mapper.DeviceMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* @Desc:设备service
* @Author huangxc
* @Date 2021/5/23
*/
@Service
public class DeviceService {
@Autowired
private DeviceMapper deviceMapper;
public void insertDevice(Device device) {
deviceMapper.insert(device);
}
Device getDeviceBySn(String sn) {
return deviceMapper.getDeviceBySn(sn);
}
/**
* 检查设备号是否存在(入库) false 不存在
* @param sn
*/
public boolean checkSnExist(String sn) {
Device device = deviceMapper.getDeviceBySn(sn);
if (device == null) {
return false;
}
return true;
}
}