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.SafetyTrainingPlanMapper;
|
import com.ruoyi.safety.pojo.SafetyTrainingPlan;
|
import com.ruoyi.safety.service.SafetyTrainingPlanService;
|
import org.springframework.stereotype.Service;
|
|
@Service
|
public class SafetyTrainingPlanServiceImpl
|
extends SafetyBaseServiceImpl<SafetyTrainingPlanMapper, SafetyTrainingPlan>
|
implements SafetyTrainingPlanService {
|
|
@Override
|
public IPage<SafetyTrainingPlan> queryPage(Page<SafetyTrainingPlan> page, SafetyTrainingPlan query) {
|
QueryWrapper<SafetyTrainingPlan> wrapper = new QueryWrapper<SafetyTrainingPlan>().orderByDesc("create_time");
|
if (query != null) {
|
if (hasText(query.getYear())) {
|
wrapper.eq("`year`", query.getYear());
|
}
|
if (hasText(query.getPost())) {
|
wrapper.like("post", query.getPost());
|
}
|
if (hasText(query.getLevel())) {
|
wrapper.eq("`level`", query.getLevel());
|
}
|
if (query.getStatus() != null) {
|
wrapper.eq("status", query.getStatus());
|
}
|
}
|
return page(page, wrapper);
|
}
|
}
|