首页 > 其他分享 >12.1

12.1

时间:2023-12-18 21:25:39浏览次数:18  
标签:String teacher public 12.1 import com example

package com.example.service;

import com.example.mapper.UserMapper;
import com.example.pojo.Student;
import com.example.pojo.Teacher;
import com.example.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserService {
@Autowired
private UserMapper userMapper;

public int getByUser(String username, String password, String position) {
return userMapper.getByUser(username, password, position);
}

public void add(User user) {
String userName = user.getUserName();
String password = user.getPassword();
String position = user.getPosition();
userMapper.add(userName, password, position);
}

public void addTea(Teacher teacher) {
String teacherID = teacher.getTeacherID();
String teacherName=teacher.getTeacherName();
String teacherSex=teacher.getTeacherSex();
String teacherCollege = teacher.getTeacherCollege();
String position=teacher.getPosition();
userMapper.addTea(teacherID, teacherName, teacherSex,teacherCollege, position);
}

public void addStu(Student student) {
String studentID = student.getStudentID();
String studentName = student.getStudentName();
String studentSex = student.getStudentSex();
String studentClass = student.getStudentClass();
String studentMajor = student.getStudentMajor();
userMapper.addStu(studentID, studentName, studentSex, studentClass, studentMajor);
}
}
 
复制代码

TeacherService

复制代码
package com.example.service;

import com.example.mapper.TeacherMapper;
import com.example.pojo.Course;
import com.example.pojo.Information;
import com.example.pojo.Teacher;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TeacherService {
    @Autowired
    private TeacherMapper teacherMapper;

    public Teacher getName(String username) {
        return teacherMapper.getName(username);
    }

    public void addCourse(Course course) {
        String courseID = course.getCourseID();
        String courseName = course.getCourseName();
        int courseCount = course.getCourseCount();
        String courseTeacher = course.getCourseTeacher();
        int count = course.getCount();
        teacherMapper.addCourse(courseID, courseName, courseCount, courseTeacher, count);
    }

    public void updateTea(Teacher teacher) {
        String teacherID = teacher.getTeacherID();
        String teacherName = teacher.getTeacherName();
        String teacherSex = teacher.getTeacherSex();
        String teacherCollege = teacher.getTeacherCollege();
        String position = teacher.getPosition();
        teacherMapper.updateTea(teacherID, teacherName, teacherSex, teacherCollege, position);
    }

    public Teacher getByName(String name) {

        return teacherMapper.getByName(name);
    }

    public Teacher getAll(String username) {
        return teacherMapper.getAll(username);
    }

    public List<Course> getCourse(String name) {
        return teacherMapper.getCourse(name);
    }
}
复制代码

StudentService

复制代码
package com.example.service;

import com.example.mapper.StudentMapper;
import com.example.pojo.Course;
import com.example.pojo.Information;
import com.example.pojo.Student;
import com.example.pojo.Teacher;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StudentService {
    @Autowired
    private StudentMapper studentMapper;
    ;

    public Student getName(String username) {
        return studentMapper.getName(username);
    }

    public void update(Student student) {
        String studentID = student.getStudentID();
        String studentName = student.getStudentName();
        String studentSex = student.getStudentSex();
        String studentClass = student.getStudentClass();
        String studentMajor = student.getStudentMajor();
        studentMapper.update(studentID, studentName, studentSex, studentClass, studentMajor);
    }

    public Course selectCourse(String name) {
        return studentMapper.selectCourse(name);
    }

    public Teacher selectAll(String name) {
        return studentMapper.selectAll(name);
    }

    public List<Course> select() {
        return studentMapper.select();
    }

    public void choose1(Information information) {
        String courseID = information.getCourseID();
        String TeacherID = information.getTeacherID();
        String studentID = information.getStudentID();
        studentMapper.choose1(courseID, TeacherID, studentID);
    }

    public void updateCourse(String id, String count) {
        studentMapper.updateCourse(id, count);
    }

    public Course cc(String id) {
        return studentMapper.cc(id);
    }

    public List<Information> getInformation(String name) {
        return studentMapper.getInformation(name);
    }
}

标签:String,teacher,public,12.1,import,com,example
From: https://www.cnblogs.com/gjsgjs/p/17912303.html

相关文章

  • 12.1
     这一章讨论了在项目开始之前要面临的一些问题和挑战,以及如何应对和解决它们。作者提出了以下几个主题:不要搜集需求,而要挖掘需求。需求是用户想要解决的问题,而不是用户目前做事情的方式。要站在用户的角度,了解他们的真正需求和动机,而不是只听他们说的话。要使用原型、用例、词......
  • 闲话12.18
    上午打了一场模拟赛,垫底了。T1傻逼,不会,不可做。T2傻逼,把我卡爆。T3傻逼,时间全放T1了导致T3没啥时间想了,打了40pts跑路,最后20min想到一个和正解类似的做法,没时间写,哈哈。最终得分:\(0+60+40=100\),被众多人吊打哈哈哈哈哈。下午无聊改题,我记得有个人之前说要有时间了学......
  • 闲话 2023.12.18
    前天晚上打了CodeforcesRound915(Div.2),打的最好的一次,成功实现上大分......
  • 12.11
    <%@pagecontentType="text/html;charset=UTF-8"language="java"%><%@pageimport="java.sql.*"%><%@pageimport="javax.naming.*"%><%@pageimport="javax.*"%><html><body&g......
  • 12.1
    <%@pagecontentType="text/html;charset=UTF-8"language="java"%><%@pageimport="java.sql.*,java.io.*,javax.servlet.*,javax.servlet.http.*"%><html><head><title>插入数据到数据库</title><......
  • 12.18 《代码大全2》的后感
    《代码大全2》是一本非常值得推荐的软件开发类书籍。通过阅读本书,我深刻地体会到了软件开发的复杂性和重要性。书中详细介绍了软件开发的各个方面,包括需求分析、设计、编码、测试等,让我对软件开发有了更全面的了解。在阅读过程中,我深受书中作者的理念和方法的启发。作者强调了代......
  • 云原生周刊:Kubernetes v1.29 正式发布 | 2023.12.18
    开源项目推荐RobustaKRRRobustaKRR(KubernetesResourceRecommender)是一个用于优化Kubernetes集群中资源分配的CLI工具。它从Prometheus收集Pod使用数据,并建议CPU和内存的请求和限制。这降低了成本并提高了性能。LiqoLiqo是一个开源项目,可实现动态、无缝的Kuber......
  • (2023.12.18)wifi的频宽配置
    //网关设备上的WiFi问题单ht_capab:频宽可调HighThroughput高吞吐量能力参数VHT:VeryHighThroughput现在也叫WiFi5GuardInterval:保护间隔(无线提速参数)AX2和AX5:指的是2.4G频段和5G频段HT40+:次通道高于主通道HT40-:次通道低于主通道SHORT-GI-20:disabledifnotsetWPA2:体......
  • 12.13
    UserMapperpackagecom.example.mapper;importcom.example.pojo.Agent;importcom.example.pojo.Customer;importcom.example.pojo.House;importcom.example.pojo.Users;importorg.apache.ibatis.annotations.*;importjava.util.List;@Mapperpublicinterfa......
  • 12.14
    index.html<!DOCTYPEhtml><htmllang="en"><head><metacharset="UTF-8"><title>用户登录</title><style>button{display:block;margin-top:10px;......