package com.newfiber.api.pc.service.impl; import com.baomidou.mybatisplus.mapper.EntityWrapper; import com.baomidou.mybatisplus.plugins.Page; import com.baomidou.mybatisplus.service.impl.ServiceImpl; import com.newfiber.api.core.commons.PageRequestObject; import com.newfiber.api.core.commons.PageResultObject; import com.newfiber.api.pc.dao.MeetPlanLevelMapper; import com.newfiber.api.pc.model.meet.MeetPlanLevel; import com.newfiber.api.pc.service.MeetPlanLevelService; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.StringUtils; /** * @Author:zzh * @CreateDate:2020/11/26 15:43 * @Description: */ @Service @Transactional(rollbackFor = Exception.class) public class MeetPlanLevelServiceImpl extends ServiceImpl<MeetPlanLevelMapper,MeetPlanLevel> implements MeetPlanLevelService { @Override public PageResultObject<MeetPlanLevel> queryPage(PageRequestObject<String> objectPage) { Page<MeetPlanLevel> page = new Page<>(objectPage.getCurrent(), objectPage.getSize()); EntityWrapper<MeetPlanLevel> wrapper = new EntityWrapper<>(); if(!StringUtils.isEmpty(objectPage.getObject())){ wrapper.like("m_level_name",objectPage.getObject()); } Page<MeetPlanLevel> meetPlanLevelPage = this.selectPage(page, wrapper); int count = this.selectCount(wrapper); return new PageResultObject<>(objectPage.getCurrent(), objectPage.getSize(),(long)count,meetPlanLevelPage.getRecords()); } }