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 queryBerthsForStatistic(int pageNum, int pageSize, Date beginTime, Date endTime) { PageHelper.startPage(pageNum, pageSize); List outparkLogs = outparkLogSMapper.queryBerthsForStatistic(beginTime, endTime); return new PageInfo<>(outparkLogs); } @Override public long countByExample(OutparkLogExample paramOutparkLogExample) { return this.outparkLogMapper.countByExample(paramOutparkLogExample); } }