src/main/java/com/zgn/hospital/service/Impl/AppointServiceImpl.java

(开头部分) 6KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

package com.zgn.hospital.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.zgn.hospital.entity.appoint;
import com.zgn.hospital.entity.dept;
import com.zgn.hospital.entity.user;
import com.zgn.hospital.mapper.AppointMapper;
import com.zgn.hospital.mapper.DeptMapper;
import com.zgn.hospital.mapper.UserMapper;
import com.zgn.hospital.service.AppointService;
import com.zgn.hospital.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

/**
 * @program: hospital_info
 * @description:
 * @author: ZGN
 * @create: 2023-04-02 20:25
 */
@Service
public class AppointServiceImpl implements AppointService {
    @Autowired
    AppointMapper appointMapper;
    @Autowired
    DeptMapper deptMapper;
    @Autowired
    UserMapper userMapper;

    /**
     * 分页查找
     *
     * @param currentPage
     * @param size
     * @param appoint
     * @return
     */
    @Override
    public R selectByPage(int currentPage, int size, appoint appoint) {
        IPage<appoint> page=new Page(currentPage,size);
        QueryWrapper<appoint> appointQueryWrapper=new QueryWrapper<>();
        IPage<appoint> appointIPage=null;
        if(appoint.getConsultTime()!=null){
            appointQueryWrapper.eq("consult_time",appoint.getConsultTime());
        }
        if(!appoint.getUsername().equals("")){
            appointQueryWrapper.like("username",appoint.getUsername());
        }
        if(!appoint.getDeptname().equals("")){
            appointQueryWrapper.eq("deptname",appoint.getDeptname());
        }
        appointIPage=appointMapper.selectPage(page,appointQueryWrapper);
后面还有 144 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。