分类: Python/Ruby
2021-03-17 17:22:23
package cn.yyj1.entity;
public class StudentInfo {
private String studentid;
private String studentName;
private String studentSex;
private String studentPhone;
private String studentAddress;
private int studentAge;
private int stuclassid;
//私有的 类型 名字
//只有空的构造方法 才能查到className 的信息
private ClassInfo classInfo;
public String getStudentid() {
return studentid;
}
public void setStudentid(String studentid) {
this.studentid = studentid;
}
public String getStudentName() {
return studentName;
}
public void setStudentName(String studentName) {
this.studentName = studentName;
}
public String getStudentSex() {
return studentSex;
}
public void setStudentSex(String studentSex) {
this.studentSex = studentSex;
}
public String getStudentPhone() {
return studentPhone;
}
public void setStudentPhone(String studentPhone) {
this.studentPhone = studentPhone;
}
public String getStudentAddress() {
return studentAddress;
}
public void setStudentAddress(String studentAddress) {
this.studentAddress = studentAddress;
}
public int getStudentAge() {
return studentAge;
}
public void setStudentAge(int studentAge) {
this.studentAge = studentAge;
}
public int getStuclassid() {
return stuclassid;
}
public void setStuclassid(int stuclassid) {
this.stuclassid = stuclassid;
}
public ClassInfo getClassInfo() {
return classInfo;
}
public void setClassInfo(ClassInfo classInfo) {
this.classInfo = classInfo;
}
public StudentInfo(String studentid, String studentName, String studentSex, String studentPhone, String studentAddress, int studentAge, int stuclassid, ClassInfo classInfo) {
this.studentid = studentid;
this.studentName = studentName;
this.studentSex = studentSex;
this.studentPhone = studentPhone;
this.studentAddress = studentAddress;
this.studentAge = studentAge;
this.stuclassid = stuclassid;
this.classInfo = classInfo;
}
public StudentInfo(String studentName, String studentSex, String studentPhone, String studentAddress, int studentAge, int stuclassid, ClassInfo classInfo) {
this.studentName = studentName;
this.studentSex = studentSex;
this.studentPhone = studentPhone;
this.studentAddress = studentAddress;
this.studentAge = studentAge;
this.stuclassid = stuclassid;
this.classInfo = classInfo;
}
public StudentInfo() {
}
}
package cn.yyj1.mapper;
import cn.yyj1.entity.ClassInfo;
import cn.yyj1.entity.StudentInfo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
public interface StudentInfoMapper {
//根据班级编号查询所属班级的所有学生信息 id 班级编号 所属这个班级的学生
public List
//根据班级编号查询班级信息 id 班级信息 班级信息
public ClassInfo findClassByClassId(int id);
//根据班级编号查询所属姓名的学生
public List
//根据ID修改学生信息
public int update (StudentInfo si);
public StudentInfo findStudentById(String id);
//根据数组查询所有学生信息 定义数组 int [] array
public List
//根据集合查学生信息
public List
//根据Map查询
public List
//Choose
public List
//分页
public List
}