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.SafetyPersonnelMapper;
|
import com.ruoyi.safety.pojo.SafetyPersonnel;
|
import com.ruoyi.safety.service.SafetyPersonnelService;
|
import org.springframework.stereotype.Service;
|
|
@Service
|
public class SafetyPersonnelServiceImpl extends SafetyBaseServiceImpl<SafetyPersonnelMapper, SafetyPersonnel>
|
implements SafetyPersonnelService {
|
|
@Override
|
public IPage<SafetyPersonnel> queryPage(Page<SafetyPersonnel> page, SafetyPersonnel query) {
|
QueryWrapper<SafetyPersonnel> wrapper = new QueryWrapper<SafetyPersonnel>().orderByDesc("create_time");
|
if (query != null) {
|
if (hasText(query.getName())) {
|
wrapper.like("name", query.getName());
|
}
|
if (hasText(query.getDept())) {
|
wrapper.like("dept", query.getDept());
|
}
|
if (hasText(query.getPost())) {
|
wrapper.like("post", query.getPost());
|
}
|
if (query.getStatus() != null) {
|
wrapper.eq("status", query.getStatus());
|
}
|
}
|
return page(page, wrapper);
|
}
|
}
|