OutParkLogDaoImpl.java
1.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
package com.zteits.park.dao.impl;
import java.util.Date;
import java.util.List;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.zteits.park.dao.OutParkLogDao;
import com.zteits.park.domain.OutparkLog;
import com.zteits.park.domain.OutparkLogExample;
import com.zteits.park.mapper.OutparkLogMapper;
import com.zteits.park.mapper.smapper.OutparkLogSMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class OutParkLogDaoImpl implements OutParkLogDao {
@Autowired
private OutparkLogMapper outparkLogMapper;
@Autowired
private OutparkLogSMapper outparkLogSMapper;
@Override
public Boolean SaveOutParkLog(OutparkLog irainOutparkLog) {
if (irainOutparkLog.getCreateTime() == null) {
irainOutparkLog.setCreateTime(new Date());
}
return outparkLogMapper.insertSelective(irainOutparkLog) == 1;
}
@Override
public PageInfo<OutparkLog> queryBerthsForStatistic(int pageNum, int pageSize, Date beginTime, Date endTime) {
PageHelper.startPage(pageNum, pageSize);
List<OutparkLog> outparkLogs = outparkLogSMapper.queryBerthsForStatistic(beginTime, endTime);
return new PageInfo<>(outparkLogs);
}
@Override
public long countByExample(OutparkLogExample paramOutparkLogExample) {
return this.outparkLogMapper.countByExample(paramOutparkLogExample);
}
}