From b5e9732b2cbb7ce3e718de8befc1c7fd74b7da59 Mon Sep 17 00:00:00 2001 From: zz <193970753@qq.com> Date: Wed, 11 Sep 2024 16:01:12 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AC=AC=E5=85=AD=E6=AC=A1=E8=AF=BE=E6=8F=90?= =?UTF-8?q?=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../springboot/dao/IdcardMapper.java | 6 ++++++ .../springboot/dao/PersonidcardMapper.java | 10 ++++++++++ .../springboot/springboot/model/Person.java | 1 + .../springboot/springboot/model/idCard.java | 4 ++++ .../service/impl/PersonServiceimpl.java | 9 +++++++++ .../main/resources/mapper/IdcardMapper.xml | 13 ++++++++++++ .../resources/mapper/PersonidcardMapper.xml | 20 +++++++++++++++++++ .../main/resources/templates/personlist.html | 8 +++++++- 8 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 springboot/src/main/java/com/zhangzihao/springboot/springboot/dao/IdcardMapper.java create mode 100644 springboot/src/main/java/com/zhangzihao/springboot/springboot/dao/PersonidcardMapper.java create mode 100644 springboot/src/main/java/com/zhangzihao/springboot/springboot/model/idCard.java create mode 100644 springboot/src/main/resources/mapper/IdcardMapper.xml create mode 100644 springboot/src/main/resources/mapper/PersonidcardMapper.xml diff --git a/springboot/src/main/java/com/zhangzihao/springboot/springboot/dao/IdcardMapper.java b/springboot/src/main/java/com/zhangzihao/springboot/springboot/dao/IdcardMapper.java new file mode 100644 index 0000000..036d562 --- /dev/null +++ b/springboot/src/main/java/com/zhangzihao/springboot/springboot/dao/IdcardMapper.java @@ -0,0 +1,6 @@ +package com.zhangzihao.springboot.springboot.dao; + +public interface IdcardMapper { + public IdCard getIdCard(int id); + public int deleteIdCard(int id); +} diff --git a/springboot/src/main/java/com/zhangzihao/springboot/springboot/dao/PersonidcardMapper.java b/springboot/src/main/java/com/zhangzihao/springboot/springboot/dao/PersonidcardMapper.java new file mode 100644 index 0000000..bb37c91 --- /dev/null +++ b/springboot/src/main/java/com/zhangzihao/springboot/springboot/dao/PersonidcardMapper.java @@ -0,0 +1,10 @@ +package com.zhangzihao.springboot.springboot.dao; + +import com.zhangzihao.springboot.springboot.model.Person; + +import java.util.List; + +public interface PersonidcardMapper { + public List getAllPersons(); + public List getAllPersons1(); +} diff --git a/springboot/src/main/java/com/zhangzihao/springboot/springboot/model/Person.java b/springboot/src/main/java/com/zhangzihao/springboot/springboot/model/Person.java index 5e626d2..6b8960d 100644 --- a/springboot/src/main/java/com/zhangzihao/springboot/springboot/model/Person.java +++ b/springboot/src/main/java/com/zhangzihao/springboot/springboot/model/Person.java @@ -7,4 +7,5 @@ public class Person { private String name; private int age; private int id; + private IdCard idCard; } diff --git a/springboot/src/main/java/com/zhangzihao/springboot/springboot/model/idCard.java b/springboot/src/main/java/com/zhangzihao/springboot/springboot/model/idCard.java new file mode 100644 index 0000000..411178e --- /dev/null +++ b/springboot/src/main/java/com/zhangzihao/springboot/springboot/model/idCard.java @@ -0,0 +1,4 @@ +package com.zhangzihao.springboot.springboot.model; + +public class idCard { +} diff --git a/springboot/src/main/java/com/zhangzihao/springboot/springboot/service/impl/PersonServiceimpl.java b/springboot/src/main/java/com/zhangzihao/springboot/springboot/service/impl/PersonServiceimpl.java index 85ac8a2..1c7289e 100644 --- a/springboot/src/main/java/com/zhangzihao/springboot/springboot/service/impl/PersonServiceimpl.java +++ b/springboot/src/main/java/com/zhangzihao/springboot/springboot/service/impl/PersonServiceimpl.java @@ -1,6 +1,7 @@ package com.zhangzihao.springboot.springboot.service.impl; import com.zhangzihao.springboot.springboot.dao.PersonMapper; +import com.zhangzihao.springboot.springboot.dao.PersonidcardMapper; import com.zhangzihao.springboot.springboot.model.Person; import com.zhangzihao.springboot.springboot.service.PersonService; import org.springframework.beans.factory.annotation.Autowired; @@ -14,6 +15,14 @@ public class PersonServiceimpl implements PersonService { @Autowired private PersonMapper personMapper; + @Autowired + private PersonidcardMapper personIdcardMapper; + + @Override + public List getPersons(){ + return personIdcardMapper.getAllPersons1(); + } + @Override public List getPersons(){ return personMapper.getPersons(); diff --git a/springboot/src/main/resources/mapper/IdcardMapper.xml b/springboot/src/main/resources/mapper/IdcardMapper.xml new file mode 100644 index 0000000..0b07ef4 --- /dev/null +++ b/springboot/src/main/resources/mapper/IdcardMapper.xml @@ -0,0 +1,13 @@ + + + + + select * from person + + + + + + + + + + \ No newline at end of file diff --git a/springboot/src/main/resources/templates/personlist.html b/springboot/src/main/resources/templates/personlist.html index be4737d..20b44bf 100644 --- a/springboot/src/main/resources/templates/personlist.html +++ b/springboot/src/main/resources/templates/personlist.html @@ -18,14 +18,20 @@ id 姓名 年龄 + 学号 + 班级 + 删除操作 + 更新操作 + + - 删除 + 删除 更新