Blame view

parking-module-pay/src/main/java/com/zteits/pay/dao/impl/TdCRechargeCardPicZipDaoImpl.java 3.64 KB
55f68655   王彪总   新项目
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
  package com.zteits.pay.dao.impl;
  import org.apache.commons.collections4.CollectionUtils;
  import com.github.pagehelper.PageHelper;
  import com.github.pagehelper.PageInfo;
  import com.zteits.pay.domain.TdCRechargeCardPicZip;
  import com.zteits.pay.domain.TdCRechargeCardPicZipExample;
  import com.zteits.clouds.api.dto.pay.param.TdCRechargeCardPicZipRequest;
  import com.zteits.pay.dao.TdCRechargeCardPicZipDao;
  import com.zteits.pay.mapper.TdCRechargeCardPicZipMapper;
  
  import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.stereotype.Component;
  
  import com.zteits.clouds.api.apibase.constants.DataStatusEnum;
  
  import java.util.ArrayList;
  import java.util.Date;
  import java.util.List;
  
  @Component
  public class TdCRechargeCardPicZipDaoImpl implements  TdCRechargeCardPicZipDao {
      @Autowired
      private TdCRechargeCardPicZipMapper tdCRechargeCardPicZipMapper;
  
      @Override
      public int saveTdCRechargeCardPicZip(TdCRechargeCardPicZip tdCRechargeCardPicZip) {
          if(tdCRechargeCardPicZip.getCreateDate()==null){
              tdCRechargeCardPicZip.setCreateDate(new Date());
          }
          return tdCRechargeCardPicZipMapper.insertSelective(tdCRechargeCardPicZip);
      }
  
      @Override
      public int updateByExampleSelective(TdCRechargeCardPicZip record, TdCRechargeCardPicZipExample example) {
          return tdCRechargeCardPicZipMapper.updateByExampleSelective(record,example);
      }
  
      @Override
      public int updateByPrimaryKeySelective(TdCRechargeCardPicZip record) {
          return tdCRechargeCardPicZipMapper.updateByPrimaryKeySelective(record);
      }
  
      @Override
      public List<TdCRechargeCardPicZip> selectByExample(TdCRechargeCardPicZipExample example) {
          return tdCRechargeCardPicZipMapper.selectByExample(example);
      }
  
      @Override
      public TdCRechargeCardPicZip queryByPrimaryKey(Long id) {
          return tdCRechargeCardPicZipMapper.selectByPrimaryKey(id);
      }
  
      @Override
      public List<TdCRechargeCardPicZip> queryTdCRechargeCardPicZip(TdCRechargeCardPicZipRequest request) {
          //TODO 编写smapper实现
          //return tdCRechargeCardPicZipSMapper.queryTdCRechargeCardPicZip(request);
          return null;
      }
  
      @Override
      public int batchDeleteTdCRechargeCardPicZipByPrimaryKey(List<Long> ids, String opId, String opName) {
          TdCRechargeCardPicZip record = new TdCRechargeCardPicZip();
          record.setModifyEmpId(opId);
          record.setModifyEmpName(opName);
          record.setModifyDate(new Date());
          record.setDataState(DataStatusEnum.DATA_STATUS_NO_VALID.value());
          TdCRechargeCardPicZipExample example = new TdCRechargeCardPicZipExample();
          example.createCriteria().andIdIn(ids);
          return tdCRechargeCardPicZipMapper.updateByExampleSelective(record,example);
      }
  
      @Override
      public PageInfo<TdCRechargeCardPicZip> queryTdCRechargeCardPicZipForPage(TdCRechargeCardPicZipRequest request) {
          PageHelper.startPage(request.getBaseRequest().getPageNum(), request.getBaseRequest().getPageSize());
          TdCRechargeCardPicZipExample example = new TdCRechargeCardPicZipExample();
          example.createCriteria().andDataStateEqualTo(DataStatusEnum.DATA_STATUS_VALID.value())
                  .andOrgIdEqualTo(request.getOrgId())
                  .andCreateDateBetween(request.getBeginDate(),request.getEndDate());
          example.setOrderByClause(" id desc");
          List<TdCRechargeCardPicZip> list = tdCRechargeCardPicZipMapper.selectByExample(example);
  
          if (CollectionUtils.isNotEmpty(list)) {
              return new PageInfo<TdCRechargeCardPicZip>(list);
          }
          return new PageInfo<TdCRechargeCardPicZip>(new ArrayList<TdCRechargeCardPicZip>());
      }
  }