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 姓名 年龄 + 学号 + 班级 + 删除操作 + 更新操作 + + - 删除 + 删除 更新