48 lines
1.6 KiB
Java
48 lines
1.6 KiB
Java
package com.baiyun.dao;
|
|
|
|
import java.util.List;
|
|
|
|
import org.apache.ibatis.annotations.Delete;
|
|
import org.apache.ibatis.annotations.Mapper;
|
|
import org.apache.ibatis.annotations.Select;
|
|
import org.apache.ibatis.annotations.Update;
|
|
import org.springframework.stereotype.Repository;
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
|
|
import com.baiyun.enity.Admin;
|
|
import com.baiyun.enity.Patients;
|
|
|
|
/**
|
|
* @Description: TODO
|
|
* @author: bilibili
|
|
* @Date: 2021年6月14日
|
|
*/
|
|
@Mapper
|
|
@Repository
|
|
public interface AdminDao {
|
|
|
|
// 管理员登录
|
|
@Select("select * from admin where adminName = #{adminName} and adminPassword = #{adminPassword}")
|
|
Admin adminCheck(@PathVariable String adminName, @PathVariable String adminPassword);
|
|
|
|
// 删除患者信息
|
|
@Delete("delete from patients where id = #{id}")
|
|
int deletePatientById(@PathVariable int id);
|
|
|
|
// 根据姓名或者身份证号查找患者
|
|
@Select("select * from patients where patientID like concat('%',#{search},'%') union select * from patients where `name` like concat('%',#{search},'%')")
|
|
List<Patients> SearchPatientsByNameOrID(String search);
|
|
|
|
// 根据id修改患者信息
|
|
@Update("update patients set age=#{age},sex=#{sex},name=#{name},`describe`=#{describe}, password=#{password},patientID=#{patientID},phone=#{phone},address=#{address},email=#{email},update_time=now() where id=#{id}")
|
|
int updatePatientById(Patients patient);
|
|
|
|
// 根据id查询患者信息
|
|
@Select("select * from patients where id = #{id}")
|
|
Patients findPatientById(int id);
|
|
|
|
// 删除医生信息
|
|
@Delete("delete from doctors where id = #{id}")
|
|
int deleteDoctorById(@PathVariable int id);
|
|
}
|