Blame view

parking-module-pay/src/main/java/com/zteits/pay/dao/impl/AppOrgDaoImpl.java 1.9 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
  package com.zteits.pay.dao.impl;/**
   * Created by wb on 2018/11/20.
   */
  
  import com.xiaoleilu.hutool.util.CollectionUtil;
  import com.zteits.clouds.api.apibase.constants.DataStatusEnum;
  import com.zteits.clouds.api.dto.pay.AppOrgDTO;
  import com.zteits.clouds.api.dto.pay.param.AppOrgRequest;
  import com.zteits.pay.dao.AppOrgDao;
  import com.zteits.pay.domain.AppOrg;
  import com.zteits.pay.domain.AppOrgExample;
  import com.zteits.pay.mapper.AppOrgMapper;
  import com.zteits.pay.mapper.smapper.AppOrgSMapper;
  import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.stereotype.Component;
  
  import java.util.List;
  
  /**
   * Copyright: Copyright (c) 2018  ZTE-ITS
   *
   * @ClassName: AppOrgDaoImpl
   * @Description:
   * @version: v1.0.0
   * @author: wangbiao
   * @date: 2018/11/20 9:30
   * Modification History:
   * Date         Author          Version         Description
   * ---------------------------------------------------------*
   * 2018/11/20    wangbiao         v1.0.0          创建
   */
  @Component
  public class AppOrgDaoImpl implements AppOrgDao {
  
      @Autowired
      private AppOrgSMapper appOrgSMapper;
      @Autowired
      private AppOrgMapper appOrgMapper;
  
      @Override
      public List<AppOrg> selectAllAppOrg() {
          AppOrgExample example = new AppOrgExample();
          example.createCriteria().andDataStateEqualTo(DataStatusEnum.DATA_STATUS_VALID.value());
          return  appOrgMapper.selectByExample(example);
      }
  
      @Override
      public AppOrg queryAppOrgByOrgId(String orgId) {
          AppOrgExample example = new AppOrgExample();
          example.createCriteria().andDataStateEqualTo(DataStatusEnum.DATA_STATUS_VALID.value())
                  .andOrgIdEqualTo(orgId);
          List<AppOrg> appOrgs = appOrgMapper.selectByExample(example);
          AppOrg appOrg = new AppOrg();
          if(CollectionUtil.isNotEmpty(appOrgs)){
              appOrg = appOrgs.get(0);
          }
          return appOrg;
      }
  }