Skip to content
Snippets Groups Projects
Commit 0893552d authored by 李文博's avatar 李文博 :baseball:
Browse files

数据库完善

parent 8f2baf61
Branches
No related merge requests found
...@@ -15,5 +15,5 @@ public interface DoctorMapper { ...@@ -15,5 +15,5 @@ public interface DoctorMapper {
Doctor findByName(String name); Doctor findByName(String name);
Doctor findById(int id); Doctor findById(int id);
String findPswByName(String UserName); String findPswByName(String UserName);
void save(Doctor user); //void save(Doctor user);
} }
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.example.MonitorPatientStatus.mapper.DoctorMapper">
<select id="findByName" resultType="com.example.MonitorPatientStatus.entity.Doctor">
select * from doctor where username = #{name}
</select>
<select id="findPswByName" resultType="com.example.MonitorPatientStatus.entity.Doctor">
select password from doctor where username = #{UserName}
</select>
<select id="findAll" resultType="com.example.MonitorPatientStatus.entity.Doctor">
select * from doctor
</select>
<select id="findById" resultType="com.example.MonitorPatientStatus.entity.Doctor">
select password from doctor where id = #{id}
</select>
</mapper>
\ No newline at end of file
...@@ -12,7 +12,7 @@ import java.util.List; ...@@ -12,7 +12,7 @@ import java.util.List;
public interface ManagerMapper { public interface ManagerMapper {
List<Manager> findAll(); List<Manager> findAll();
Manager findByName(String name); Manager findByName(String name);
Manager findById(int id); //Manager findById(int id);
String findPswByName(String UserName); String findPswByName(String UserName);
void save(Manager user); //void save(Manager user);
} }
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.example.MonitorPatientStatus.mapper.ManagerMapper">
<select id="findByName" resultType="com.example.MonitorPatientStatus.entity.Manager">
select * from manager where username = #{name}
</select>
<select id="findPswByName" resultType="com.example.MonitorPatientStatus.entity.Patient">
select password from manager where username = #{UserName}
</select>
<select id="findAll" resultType="com.example.MonitorPatientStatus.entity.Patient">
select * from manager
</select>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.example.MonitorPatientStatus.mapper.PatientMapper">
<select id="findByName" resultType="com.example.MonitorPatientStatus.entity.Patient">
select * from patient where username = #{name}
</select>
<select id="findPswByName" resultType="com.example.MonitorPatientStatus.entity.Patient">
select password from patient where username = #{UserName}
</select>
<select id="findAll" resultType="com.example.MonitorPatientStatus.entity.Patient">
select * from patient
</select>
<insert id="save">
INSERT INTO patient set username=#{username},password=#{password}
</insert>
</mapper>
\ No newline at end of file
...@@ -17,5 +17,8 @@ ...@@ -17,5 +17,8 @@
</environments> </environments>
<mappers> <mappers>
<mapper resource="com/example/MonitorPatientStatus/mapper/DrugMapper.xml"/> <mapper resource="com/example/MonitorPatientStatus/mapper/DrugMapper.xml"/>
<mapper resource="com/example/MonitorPatientStatus/mapper/PatientMapper.xml"/>
<mapper resource="com/example/MonitorPatientStatus/mapper/ManagerMapper.xml"/>
<mapper resource="com/example/MonitorPatientStatus/mapper/DoctorMapper.xml"/>
</mappers> </mappers>
</configuration> </configuration>
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment