TpPInspectEqpPropertyDaoImpl.java
4.18 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
package com.zteits.park.dao.impl;
import com.zteits.clouds.api.apibase.constants.DataStatusEnum;
import com.zteits.park.domain.TpPInspectEqpProperty;
import com.zteits.park.domain.TpPInspectEqpPropertyExample;
import com.zteits.clouds.api.dto.park.param.TpPInspectEqpPropertyRequest;
import com.zteits.park.dao.TpPInspectEqpPropertyDao;
import com.zteits.park.mapper.TpPInspectEqpPropertyMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Date;
import java.util.List;
@Component
public class TpPInspectEqpPropertyDaoImpl implements TpPInspectEqpPropertyDao {
@Autowired
private TpPInspectEqpPropertyMapper tpPInspectEqpPropertyMapper;
@Override
public int deleteTpPInspectEqpPropertyByPrimaryKey(Long id, String opId, String opName) {
TpPInspectEqpProperty record = new TpPInspectEqpProperty();
record.setId(id);
record.setModifyOp(opId);
record.setModifyTime(new Date());
return tpPInspectEqpPropertyMapper.updateByPrimaryKeySelective(record);
}
@Override
public int saveTpPInspectEqpProperty(TpPInspectEqpProperty tpPInspectEqpProperty) {
if(tpPInspectEqpProperty.getCreateTime()==null){
tpPInspectEqpProperty.setCreateTime(new Date());
}
if(tpPInspectEqpProperty.getModifyTime()==null){
tpPInspectEqpProperty.setModifyTime(new Date());
}
return tpPInspectEqpPropertyMapper.insertSelective(tpPInspectEqpProperty);
}
@Override
public int updateByExampleSelective(TpPInspectEqpProperty record, TpPInspectEqpPropertyExample example) {
return tpPInspectEqpPropertyMapper.updateByExampleSelective(record,example);
}
@Override
public int updateByPrimaryKeySelective(TpPInspectEqpProperty record) {
return tpPInspectEqpPropertyMapper.updateByPrimaryKeySelective(record);
}
@Override
public List<TpPInspectEqpProperty> selectByExample(TpPInspectEqpPropertyExample example) {
return tpPInspectEqpPropertyMapper.selectByExample(example);
}
@Override
public TpPInspectEqpProperty queryByPrimaryKey(Long id) {
return tpPInspectEqpPropertyMapper.selectByPrimaryKey(id);
}
@Override
public List<TpPInspectEqpProperty> queryTpPInspectEqpProperty(TpPInspectEqpPropertyRequest request) {
TpPInspectEqpPropertyExample example = new TpPInspectEqpPropertyExample();
example.createCriteria().andInspectEqpNoEqualTo(request.getInspectEqpNo())
.andDataStateEqualTo(DataStatusEnum.DATA_STATUS_VALID.value());
return tpPInspectEqpPropertyMapper.selectByExample(example);
}
@Override
public int batchDeleteTpPInspectEqpPropertyByPrimaryKey(List<Long> ids, String opId, String opName) {
TpPInspectEqpProperty record = new TpPInspectEqpProperty();
record.setModifyOp(opId);
record.setModifyTime(new Date());
//where条件
TpPInspectEqpPropertyExample example = new TpPInspectEqpPropertyExample();
example.createCriteria().andIdIn(ids);
return tpPInspectEqpPropertyMapper.updateByExampleSelective(record,example);
}
@Override
public List<TpPInspectEqpProperty> queryEqpPropertyByEqpPropertyNo(List<String> eqpPropertyNoList) {
TpPInspectEqpPropertyExample example = new TpPInspectEqpPropertyExample();
example.createCriteria().andInspectEqpPropertyNoIn(eqpPropertyNoList)
.andDataStateEqualTo(DataStatusEnum.DATA_STATUS_VALID.value());
return tpPInspectEqpPropertyMapper.selectByExample(example);
}
/*@Override
public PageInfo<TpPInspectEqpProperty> queryTpPInspectEqpPropertyForPage(TpPInspectEqpPropertyRequest request) {
PageHelper.startPage(request.getBaseRequest().getPageNum(), request.getBaseRequest().getPageSize());
//TODO 编写smapper实现
*//*List<TpPInspectEqpProperty> list = tpPInspectEqpPropertySMapper.queryTpPInspectEqpProperty(request);
if (CollectionUtils.isNotEmpty(list)) {
return new PageInfo<TpPInspectEqpProperty>(list);
}*//*
return new PageInfo<TpPInspectEqpProperty>(new ArrayList<TpPInspectEqpProperty>());
}*/
}