SmartVehicleBlueKeyServiceImpl.java
3.68 KB
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
package com.glsx.smart.service.impl;
import com.glsx.smart.dao.entity.SmartVehicleBlueKey;
import com.glsx.smart.dao.entity.SmartVehicleBlueKeyExample;
import com.glsx.smart.dao.mapper.SmartVehicleBlueKeyMapper;
import com.glsx.smart.service.SmartVehicleBlueKeyService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service
public class SmartVehicleBlueKeyServiceImpl implements SmartVehicleBlueKeyService {
@Resource
private SmartVehicleBlueKeyMapper smartVehicleBlueKeyMapper;
@Override
public long countByExample(SmartVehicleBlueKeyExample example) {
return smartVehicleBlueKeyMapper.countByExample(example);
}
@Override
public int deleteByExample(SmartVehicleBlueKeyExample example) {
return smartVehicleBlueKeyMapper.deleteByExample(example);
}
@Override
public int deleteByPrimaryKey(Long id) {
return smartVehicleBlueKeyMapper.deleteByPrimaryKey(id);
}
@Override
public int insert(SmartVehicleBlueKey record) {
return smartVehicleBlueKeyMapper.insert(record);
}
@Override
public int insertSelective(SmartVehicleBlueKey record) {
return smartVehicleBlueKeyMapper.insertSelective(record);
}
@Override
public List<SmartVehicleBlueKey> selectByExample(SmartVehicleBlueKeyExample example) {
return smartVehicleBlueKeyMapper.selectByExample(example);
}
@Override
public SmartVehicleBlueKey selectByPrimaryKey(Long id) {
return smartVehicleBlueKeyMapper.selectByPrimaryKey(id);
}
@Override
public int updateByExampleSelective(SmartVehicleBlueKey record, SmartVehicleBlueKeyExample example) {
return smartVehicleBlueKeyMapper.updateByExampleSelective(record, example);
}
@Override
public int updateByExample(SmartVehicleBlueKey record, SmartVehicleBlueKeyExample example) {
return smartVehicleBlueKeyMapper.updateByExample(record, example);
}
@Override
public int updateByPrimaryKeySelective(SmartVehicleBlueKey record) {
return smartVehicleBlueKeyMapper.updateByPrimaryKeySelective(record);
}
@Override
public int updateByPrimaryKey(SmartVehicleBlueKey record) {
return smartVehicleBlueKeyMapper.updateByPrimaryKey(record);
}
//查询车钥匙example,根据用户ID和sn查
@Override
public SmartVehicleBlueKeyExample getBlueKeyExampleByUserAndSn(Long userId, String sn) {
SmartVehicleBlueKeyExample example = new SmartVehicleBlueKeyExample();
example.createCriteria()
.andUserIdEqualTo(userId)
.andSnEqualTo(sn)
.andIsDeleteEqualTo(0);
return example;
}
@Override
public List<SmartVehicleBlueKey> selectByUserAndSn(Long userId, String sn) {
SmartVehicleBlueKeyExample example = getBlueKeyExampleByUserAndSn(userId,sn);
return smartVehicleBlueKeyMapper.selectByExample(example);
}
@Override
public List<SmartVehicleBlueKey> selectById(Long id) {
SmartVehicleBlueKeyExample example = new SmartVehicleBlueKeyExample();
example.createCriteria()
.andIdEqualTo(id)
.andIsDeleteEqualTo(0);
return smartVehicleBlueKeyMapper.selectByExample(example);
}
@Override
public int removeKeyByIds(List<Long> keyIds) {
return smartVehicleBlueKeyMapper.removeKeyByIds(keyIds);
}
@Override
public long countKeyByUser(long userId) {
SmartVehicleBlueKeyExample example = new SmartVehicleBlueKeyExample();
example.createCriteria()
.andUserIdEqualTo(userId);
return smartVehicleBlueKeyMapper.countByExample(example);
}
}