Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3657128
  • 博文数量: 365
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 2522
  • 用 户 组: 普通用户
  • 注册时间: 2019-10-28 13:40
文章分类

全部博文(365)

文章存档

2023年(8)

2022年(130)

2021年(155)

2020年(50)

2019年(22)

我的朋友

分类: 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 findStuByClassId(int id);

    //根据班级编号查询班级信息 id 班级信息 班级信息

    public ClassInfo findClassByClassId(int id);

    //根据班级编号查询所属姓名的学生

    public  List findStudNameByClassId(@Param("stuclassid") int stuclassid, @Param("studentName") String studentName);

    //根据ID修改学生信息

    public  int update (StudentInfo si);

    public StudentInfo findStudentById(String id);

    //根据数组查询所有学生信息 定义数组 int [] array

    public  List findStudentByArray(int [] array);

    //根据集合查学生信息

    public  List findStudentByList(List list);

    //根据Map查询

    public  List findStudentByMap(Map map);

    //Choose

    public  List findStudentByChoose(@Param("studentName")String studentName,@Param("studentAge")int studentAge,@Param("stuclassid")int stuclassid);

    //分页

    public  List findStudentByPage(@Param("pageSize")int pageSize,@Param("pageCode")int pageCode);

}

阅读(17267) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~