liusheng
2024-01-19 c20e9a5dc79a642a1d59a3b4b98c9742fa58125b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
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);
    }
 
}