Registered-reservation-syst.../src/Springboot_hosptial/src/main/java/com/baiyun/dao/PatientsDao.java

44 lines
1.1 KiB
Java

package com.baiyun.dao;
import java.util.List;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import com.baiyun.enity.Patients;
/**
* @Description: TODO
* @author: bilibili
* @Date: 2021年6月15日
*/
@Mapper
@Repository
public interface PatientsDao {
/*
* 患者登录
*/
@Select("select * from patients where `name`=#{name} and password=#{password}")
public Patients patientLogin(String name, String password);
/*
* 查询所有患者
*/
@Select("select * from patients")
public List<Patients> searchAllPatients();
/*
* 患者注册
*/
@Insert("insert into patients(age,sex,`name`,`describe`,`password`,patientID,phone,address,email,create_time) values(#{age},#{sex},#{name},#{describe},#{password},#{patientID},#{phone},#{address},#{email},now())")
public Integer registerPatient(Patients patients);
/*
* 根据id查询患者
*/
@Select(" select * from patients where id=#{id}")
Patients findPatientById(int id);
}