package io.renren.modules.admin.service.impl; import org.apache.commons.lang.StringUtils; import org.springframework.stereotype.Service; import java.util.HashMap; import java.util.List; import java.util.Map; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import io.renren.common.utils.PageUtils; import io.renren.common.utils.Query; import io.renren.modules.admin.dao.MeetingImagesDao; import io.renren.modules.admin.entity.MeetingImagesEntity; import io.renren.modules.admin.service.MeetingImagesService; @Service("meetingImagesService") public class MeetingImagesServiceImpl extends ServiceImpl implements MeetingImagesService { @Override public PageUtils queryPage(Map params) { Long meetingId = Long.valueOf((String) params.get("meetingId")); String key = params.containsKey("key") ? (String) params.get("key") : null; IPage page = this.page(new Query().getPage(params), new QueryWrapper().eq("meeting_id", meetingId).like(StringUtils.isNotBlank(key), "title", key)); return new PageUtils(page); } @Override public PageUtils listImages(Map params) { Long meetingId = Long.valueOf((String) params.get("meetingId")); IPage page = this.page(new Query().getPage(params), new QueryWrapper().eq("meeting_id", meetingId).orderByDesc("sort").orderByAsc("id")); return new PageUtils(page); } }