package com.ruoyi.system.service.impl;
|
|
import java.util.List;
|
import com.ruoyi.common.utils.DateUtils;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Service;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import java.util.ArrayList;
|
import java.util.Map;
|
|
import com.ruoyi.common.utils.StringUtils;
|
import com.ruoyi.system.mapper.SysStudentMapper;
|
import com.ruoyi.system.domain.SysStudent;
|
import com.ruoyi.system.service.ISysStudentService;
|
|
/**
|
* 学生信息Service业务层处理
|
*
|
* @author ruoyi
|
* @date 2021-10-28
|
*/
|
@Service
|
public class SysStudentServiceImpl extends ServiceImpl<SysStudentMapper, SysStudent> implements ISysStudentService
|
{
|
|
|
/**
|
* 查询学生信息列表
|
*
|
* @param sysStudent 学生信息
|
* @return 学生信息
|
*/
|
@Override
|
public List<SysStudent> queryList(SysStudent sysStudent) {
|
LambdaQueryWrapper<SysStudent> wrappers = Wrappers.lambdaQuery();
|
if (StringUtils.isNotBlank(sysStudent.getStudentName())){
|
wrappers.like(SysStudent::getStudentName ,sysStudent.getStudentName());
|
}
|
if (sysStudent.getStudentAge() != null){
|
wrappers.eq(SysStudent::getStudentAge ,sysStudent.getStudentAge());
|
}
|
if (StringUtils.isNotBlank(sysStudent.getStudentHobby())){
|
wrappers.eq(SysStudent::getStudentHobby ,sysStudent.getStudentHobby());
|
}
|
if (StringUtils.isNotBlank(sysStudent.getStudentSex())){
|
wrappers.eq(SysStudent::getStudentSex ,sysStudent.getStudentSex());
|
}
|
if (StringUtils.isNotBlank(sysStudent.getStudentStatus())){
|
wrappers.eq(SysStudent::getStudentStatus ,sysStudent.getStudentStatus());
|
}
|
Map<String, Object> params = sysStudent.getParams();
|
if (params.get("beginStudentBirthday") != null && params.get("endStudentBirthday") != null) {
|
wrappers.between(SysStudent::getStudentBirthday ,params.get("beginStudentBirthday"),params.get("endStudentBirthday"));
|
}
|
return this.list(wrappers);
|
}
|
|
}
|