package com.ruoyi.safety.service.impl;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.ruoyi.safety.mapper.SafetyEmergencyResourceMapper;
|
import com.ruoyi.safety.pojo.SafetyEmergencyResource;
|
import com.ruoyi.safety.service.SafetyEmergencyResourceService;
|
import org.springframework.stereotype.Service;
|
|
@Service
|
public class SafetyEmergencyResourceServiceImpl
|
extends SafetyBaseServiceImpl<SafetyEmergencyResourceMapper, SafetyEmergencyResource>
|
implements SafetyEmergencyResourceService {
|
|
@Override
|
public IPage<SafetyEmergencyResource> queryPage(Page<SafetyEmergencyResource> page,
|
SafetyEmergencyResource query) {
|
QueryWrapper<SafetyEmergencyResource> wrapper =
|
new QueryWrapper<SafetyEmergencyResource>().orderByDesc("create_time");
|
if (query != null) {
|
if (hasText(query.getName())) {
|
wrapper.like("name", query.getName());
|
}
|
if (hasText(query.getType())) {
|
wrapper.like("type", query.getType());
|
}
|
if (query.getAreaId() != null) {
|
wrapper.eq("area_id", query.getAreaId());
|
}
|
if (query.getStatus() != null) {
|
wrapper.eq("status", query.getStatus());
|
}
|
}
|
return page(page, wrapper);
|
}
|
}
|