Blame view

parking-module-park/src/main/java/com/zteits/park/dao/impl/ParkingLotGroupDaoImpl.java 2.43 KB
9af4a544   王彪总   新项目
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
  package com.zteits.park.dao.impl;
  
  import com.clouds.common.utils.SequenceUtil;
  import com.github.pagehelper.PageHelper;
  import com.github.pagehelper.PageInfo;
  import com.xiaoleilu.hutool.util.BeanUtil;
  import com.zteits.clouds.api.dto.park.param.parkgroup.ParkingLotGroupSaveReq;
  import com.zteits.park.dao.ParkingLotGroupDao;
  import com.zteits.park.domain.ParkingLotGroup;
  import com.zteits.park.mapper.ParkingLotGroupMapper;
  import com.zteits.park.mapper.smapper.ParkingLotGroupSmapper;
  import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.stereotype.Component;
  
  import java.util.Date;
  import java.util.List;
  
  /**
   * Copyright: Copyright (c) 2017  zteits
   *
   * @ClassName: ParkingLotGroupDaoImpl.java
   * @Description:
   * @version: v1.0.0
   * @author: wangfs
   * @date: 2021-04-19 10:57
   * Modification History:
   * Date             Author          Version            Description
   * ---------------------------------------------------------*
   * 2021-04-19     wangfs              v1.0.0               创建
   */
  @Component
  public class ParkingLotGroupDaoImpl implements ParkingLotGroupDao {
  
  
      @Autowired
      private ParkingLotGroupMapper parkingLotGroupMapper;
  
      @Autowired
      private ParkingLotGroupSmapper parkingLotGroupSmapper;
  
      @Override
      public Integer saveParkingLotGroup(ParkingLotGroupSaveReq req) {
          int flg =0;
          ParkingLotGroup record = new ParkingLotGroup();
          if(req != null){
              BeanUtil.copyProperties(req,record);
              record.setDataStatus(1);
              record.setParkNum(0);
              flg = parkingLotGroupMapper.insert(record);
          }
          return flg;
      }
  
      @Override
      public Integer updateParkingLotGroup(ParkingLotGroupSaveReq req) {
  
          ParkingLotGroup record = new ParkingLotGroup();
          record.setId(req.getId());
          record.setPlGroupName(req.getPlGroupName());
          record.setModfiyEmpid(req.getModfiyEmpid());
          record.setModfiyDate(new Date());
          return parkingLotGroupMapper.updateByPrimaryKeySelective(record);
      }
  
      @Override
      public PageInfo<ParkingLotGroup> queryParkGroupForPage(ParkingLotGroupSaveReq request) {
          //设置分页
          PageHelper.startPage(request.getBaseRequest().getPageNum(),request.getBaseRequest().getPageSize());
          //list
          List<ParkingLotGroup> list = parkingLotGroupSmapper.queryParkLontGroupForList(request);
          return new PageInfo<ParkingLotGroup>(list);
      }
  }