TpPVideopileAlarmLogDaoImpl.java
3.46 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
package com.zteits.park.dao.impl;
import com.zteits.park.domain.TpPVideopileAlarmLog;
import com.zteits.park.domain.TpPVideopileAlarmLogExample;
import com.zteits.clouds.api.dto.park.param.TpPVideopileAlarmLogRequest;
import com.zteits.park.dao.TpPVideopileAlarmLogDao;
import com.zteits.park.mapper.TpPVideopileAlarmLogMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Date;
import java.util.List;
@Component
public class TpPVideopileAlarmLogDaoImpl implements TpPVideopileAlarmLogDao {
@Autowired
private TpPVideopileAlarmLogMapper tpPVideopileAlarmLogMapper;
@Override
public int deleteTpPVideopileAlarmLogByPrimaryKey(Long id, String opId, String opName) {
TpPVideopileAlarmLog record = new TpPVideopileAlarmLog();
record.setId(id);
record.setModifyOp(opId);
record.setModifyTime(new Date());
return tpPVideopileAlarmLogMapper.updateByPrimaryKeySelective(record);
}
@Override
public int saveTpPVideopileAlarmLog(TpPVideopileAlarmLog tpPVideopileAlarmLog) {
if(tpPVideopileAlarmLog.getCreateTime()==null){
tpPVideopileAlarmLog.setCreateTime(new Date());
}
if(tpPVideopileAlarmLog.getModifyTime()==null){
tpPVideopileAlarmLog.setModifyTime(new Date());
}
return tpPVideopileAlarmLogMapper.insertSelective(tpPVideopileAlarmLog);
}
@Override
public int updateByExampleSelective(TpPVideopileAlarmLog record, TpPVideopileAlarmLogExample example) {
return tpPVideopileAlarmLogMapper.updateByExampleSelective(record,example);
}
@Override
public int updateByPrimaryKeySelective(TpPVideopileAlarmLog record) {
return tpPVideopileAlarmLogMapper.updateByPrimaryKeySelective(record);
}
@Override
public List<TpPVideopileAlarmLog> selectByExample(TpPVideopileAlarmLogExample example) {
return tpPVideopileAlarmLogMapper.selectByExample(example);
}
@Override
public TpPVideopileAlarmLog queryByPrimaryKey(Long id) {
return tpPVideopileAlarmLogMapper.selectByPrimaryKey(id);
}
@Override
public List<TpPVideopileAlarmLog> queryTpPVideopileAlarmLog(TpPVideopileAlarmLogRequest request) {
//TODO 编写smapper实现
//return tpPVideopileAlarmLogSMapper.queryTpPVideopileAlarmLog(request);
return null;
}
@Override
public int batchDeleteTpPVideopileAlarmLogByPrimaryKey(List<Long> ids, String opId, String opName) {
TpPVideopileAlarmLog record = new TpPVideopileAlarmLog();
record.setModifyOp(opId);
record.setModifyTime(new Date());
//where条件
TpPVideopileAlarmLogExample example = new TpPVideopileAlarmLogExample();
example.createCriteria().andIdIn(ids);
return tpPVideopileAlarmLogMapper.updateByExampleSelective(record,example);
}
/*@Override
public PageInfo<TpPVideopileAlarmLog> queryTpPVideopileAlarmLogForPage(TpPVideopileAlarmLogRequest request) {
PageHelper.startPage(request.getBaseRequest().getPageNum(), request.getBaseRequest().getPageSize());
//TODO 编写smapper实现
*//*List<TpPVideopileAlarmLog> list = tpPVideopileAlarmLogSMapper.queryTpPVideopileAlarmLog(request);
if (CollectionUtils.isNotEmpty(list)) {
return new PageInfo<TpPVideopileAlarmLog>(list);
}*//*
return new PageInfo<TpPVideopileAlarmLog>(new ArrayList<TpPVideopileAlarmLog>());
}*/
}