3.1日javaweb

  今天继续进行项目的编写

复制代码
package com.example.service;

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

import java.time.LocalDateTime;
import java.util.List;

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

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

    public void add(Plan plan) {
         String name=plan.getName();
         int num=plan.getNumber();
         String sum=plan.getSum();
        String idea=plan.getIdea();
        String english=plan.getEnglish();
         String math=plan.getMath();
         LocalDateTime time=plan.getTime();
         userMapper.add(name,num,sum,idea,english,math,time);
    }

    public Plan decline(String type) {
        return userMapper.decline(type);
    }

    public List<Application> zizhi() {
        return userMapper.zizhi();
    }
}
复制代码
复制代码
package com.example.service;

import com.example.mapper.StudentMapper;
import com.example.pojo.Application;
import com.example.pojo.Plan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Random;

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

    public void addStudent(Application application) {
        String name = application.getName();
        String nameId = application.getNameId();
        String type = application.getType();
        int sum = application.getSum();
        int idea = application.getIdea();
        int english = application.getEnglish();
        int math = application.getMath();
        int major = application.getMajor();
        int status =application.getStatus();
        String username=application.getUsername();
        studentMapper.addStudent(name, nameId, type, sum, idea, english, math, major,status,username);
    }

    public Application select(String username) {
        return  studentMapper.select(username);
    }

    public List<Plan> getAll() {
        return  studentMapper.getAll();
    }
}
复制代码

 

posted @   new菜鸟  阅读(3)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· .NET10 - 预览版1新功能体验(一)
点击右上角即可分享
微信分享提示