package com.zteits.park.dao.impl; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.zteits.clouds.api.dto.park.dto.ParkBerthAppointmentParkRelDTO; import com.zteits.clouds.api.dto.park.dto.ParkBerthAppointmentParkRelDTO; import com.zteits.park.domain.ParkBerthAppointmentParkRel; import com.zteits.park.domain.ParkBerthAppointmentParkRelExample; import com.zteits.clouds.api.dto.park.param.ParkBerthAppointmentParkRelRequest; import com.zteits.park.dao.ParkBerthAppointmentParkRelDao; import com.zteits.park.mapper.ParkBerthAppointmentParkRelMapper; import com.zteits.park.mapper.smapper.ParkBerthAppointmentParkRelSMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import com.zteits.clouds.api.apibase.constants.DataStatusEnum; import java.util.Date; import java.util.List; @Component public class ParkBerthAppointmentParkRelDaoImpl implements ParkBerthAppointmentParkRelDao { @Autowired private ParkBerthAppointmentParkRelMapper parkBerthAppointmentParkRelMapper; @Autowired private ParkBerthAppointmentParkRelSMapper parkBerthAppointmentParkRelSMapper; @Override public int saveParkBerthAppointmentParkRel(ParkBerthAppointmentParkRel parkBerthAppointmentParkRel) { if(parkBerthAppointmentParkRel.getCreateTime()==null){ parkBerthAppointmentParkRel.setCreateTime(new Date()); } return parkBerthAppointmentParkRelMapper.insertSelective(parkBerthAppointmentParkRel); } @Override public int updateByExampleSelective(ParkBerthAppointmentParkRel record, ParkBerthAppointmentParkRelExample example) { return parkBerthAppointmentParkRelMapper.updateByExampleSelective(record,example); } @Override public int updateByPrimaryKeySelective(ParkBerthAppointmentParkRel record) { return parkBerthAppointmentParkRelMapper.updateByPrimaryKeySelective(record); } @Override public List selectByExample(ParkBerthAppointmentParkRelExample example) { return parkBerthAppointmentParkRelMapper.selectByExample(example); } @Override public ParkBerthAppointmentParkRel queryByPrimaryKey(Long id) { return parkBerthAppointmentParkRelMapper.selectByPrimaryKey(id); } @Override public List queryParkBerthAppointmentParkRel(ParkBerthAppointmentParkRelRequest request) { //TODO 编写smapper实现 //return parkBerthAppointmentParkRelSMapper.queryParkBerthAppointmentParkRel(request); return null; } @Override public int batchDeleteParkBerthAppointmentParkRelByPrimaryKey(List ids) { ParkBerthAppointmentParkRelExample example = new ParkBerthAppointmentParkRelExample(); example.createCriteria().andIdIn(ids); return parkBerthAppointmentParkRelMapper.deleteByExample(example); } /** * 根据appointmentConfigId删除记录 * @param plNos * @return */ @Override public int deleteAppointmentParkRelByAppointmentConfigId(List plNos) { ParkBerthAppointmentParkRelExample example = new ParkBerthAppointmentParkRelExample(); example.createCriteria().andPlNoIn(plNos); return parkBerthAppointmentParkRelMapper.deleteByExample(example); } @Override public PageInfo queryParkBerthAppointmentParkRelForPage(ParkBerthAppointmentParkRelRequest request) { PageHelper.startPage(request.getBaseRequest().getPageNum(), request.getBaseRequest().getPageSize()); List parkBerthAppointmentParkRelDTOS = parkBerthAppointmentParkRelMapper.queryParkBerthAppointmentParkRelForList(request); return new PageInfo(parkBerthAppointmentParkRelDTOS); } @Override public List queryAppointmentBerthParkList(ParkBerthAppointmentParkRelRequest request) { return parkBerthAppointmentParkRelSMapper.queryAppointmentBerthParkList(request); } /*@Override public PageInfo queryParkBerthAppointmentParkRelForPage(ParkBerthAppointmentParkRelRequest request) { PageHelper.startPage(request.getBaseRequest().getPageNum(), request.getBaseRequest().getPageSize()); //TODO 编写smapper实现 *//*List list = parkBerthAppointmentParkRelSMapper.queryParkBerthAppointmentParkRel(request); if (CollectionUtils.isNotEmpty(list)) { return new PageInfo(list); }*//* return new PageInfo(new ArrayList()); }*/ }