TdCCommonProblemDaoImpl.java
3.31 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
package com.zteits.pay.dao.impl;
import com.alipay.api.domain.DataEnumValue;
import com.zteits.pay.domain.TdCCommonProblem;
import com.zteits.pay.domain.TdCCommonProblemExample;
import com.zteits.clouds.api.dto.pay.param.TdCCommonProblemRequest;
import com.zteits.pay.dao.TdCCommonProblemDao;
import com.zteits.pay.mapper.TdCCommonProblemMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.zteits.clouds.api.apibase.constants.DataStatusEnum;
import java.util.Date;
import java.util.List;
@Component
public class TdCCommonProblemDaoImpl implements TdCCommonProblemDao {
@Autowired
private TdCCommonProblemMapper tdCCommonProblemMapper;
@Override
public int saveTdCCommonProblem(TdCCommonProblem tdCCommonProblem) {
if(tdCCommonProblem.getCreateDate()==null){
tdCCommonProblem.setCreateDate(new Date());
}
return tdCCommonProblemMapper.insertSelective(tdCCommonProblem);
}
@Override
public int updateByExampleSelective(TdCCommonProblem record, TdCCommonProblemExample example) {
return tdCCommonProblemMapper.updateByExampleSelective(record,example);
}
@Override
public int updateByPrimaryKeySelective(TdCCommonProblem record) {
return tdCCommonProblemMapper.updateByPrimaryKeySelective(record);
}
@Override
public List<TdCCommonProblem> selectByExample(TdCCommonProblemExample example) {
return tdCCommonProblemMapper.selectByExample(example);
}
@Override
public TdCCommonProblem queryByPrimaryKey(Long id) {
return tdCCommonProblemMapper.selectByPrimaryKey(id);
}
@Override
public List<TdCCommonProblem> queryTdCCommonProblem(TdCCommonProblemRequest request) {
TdCCommonProblemExample example = new TdCCommonProblemExample();
TdCCommonProblemExample.Criteria criteria = example.createCriteria();
criteria.andDataStateEqualTo(DataStatusEnum.DATA_STATUS_VALID.value());
criteria.andOrgIdEqualTo(request.getOrgId());
if(request.getFeedbackCode() != null){
criteria.andFeedbackCodeEqualTo(request.getFeedbackCode());
}
return tdCCommonProblemMapper.selectByExample(example);
}
@Override
public int batchDeleteTdCCommonProblemByPrimaryKey(List<Long> ids, String opId, String opName) {
TdCCommonProblem record = new TdCCommonProblem();
record.setModifyEmpid(opId);
record.setModifyDate(new Date());
record.setDataState(DataStatusEnum.DATA_STATUS_NO_VALID.value());
TdCCommonProblemExample example = new TdCCommonProblemExample();
example.createCriteria().andIdIn(ids);
return tdCCommonProblemMapper.updateByExampleSelective(record,example);
}
/*@Override
public PageInfo<TdCCommonProblem> queryTdCCommonProblemForPage(TdCCommonProblemRequest request) {
PageHelper.startPage(request.getBaseRequest().getPageNum(), request.getBaseRequest().getPageSize());
//TODO 编写smapper实现
*//*List<TdCCommonProblem> list = tdCCommonProblemSMapper.queryTdCCommonProblem(request);
if (CollectionUtils.isNotEmpty(list)) {
return new PageInfo<TdCCommonProblem>(list);
}*//*
return new PageInfo<TdCCommonProblem>(new ArrayList<TdCCommonProblem>());
}*/
}