首页 > 其他分享 >1.23

1.23

时间:2024-01-26 18:27:27浏览次数:20  
标签:String baoxiao userMapper id application 1.23 public

今天实现Service类

package com.example.service;

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

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

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

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

    public Staff getName(String username) {
        return userMapper.getName(username);
    }

    public int count(String id) {
        return userMapper.count(id);
    }

    public void add1(Application application) {
        String id = application.getId();
        String name = application.getName();
        String department = application.getDepartment();
        String destination = application.getDestination();
        LocalDateTime departureDate = application.getDepartureDate();
        LocalDateTime returnDate = application.getReturnDate();
        String type = application.getType();
        String typeContent = application.getTypeContent();
        String reason = application.getReason();
        String state = application.getState();
        userMapper.add1(id, name, department, destination, departureDate, returnDate, type, typeContent, reason, state);
    }

    public void update1(Application application) {
        String id = application.getId();
        String name = application.getName();
        String department = application.getDepartment();
        String destination = application.getDestination();
        LocalDateTime departureDate = application.getDepartureDate();
        LocalDateTime returnDate = application.getReturnDate();
        String type = application.getType();
        String typeContent = application.getTypeContent();
        String reason = application.getReason();
        String state = application.getState();
        userMapper.update1(id, name, department, destination, departureDate, returnDate, type, typeContent, reason, state);
    }

    public Application reasonable(String id) {
        String state = "待审批";
        return userMapper.reasonable(id, state);
    }

    public void delete(String id) {
        userMapper.delete(id);
    }

    public void add2(Baoxiao baoxiao) {
        String id = baoxiao.getId();
        String name = baoxiao.getName();
        String department = baoxiao.getDepartment();
        String destination = baoxiao.getDestination();
        LocalDateTime departureDate = baoxiao.getDepartureDate();
        LocalDateTime returnDate = baoxiao.getReturnDate();
        String Reason = baoxiao.getReason();
        int StartFare = baoxiao.getStartFare();
        int ReturnFare = baoxiao.getReturnFare();
        int foodAllowance = baoxiao.getFoodAllowance();
        int localTrans = baoxiao.getLocalTrans();
        int Accommodation = baoxiao.getAccommodation();
        int totalAmount = baoxiao.getTotalAmount();
        String schedule = baoxiao.getSchedule();
        userMapper.add2(id, name, department, destination, departureDate, returnDate, Reason, StartFare, ReturnFare, foodAllowance, localTrans, Accommodation, totalAmount, schedule);
    }

    public int pay1(String id) {
        return userMapper.pay1(id);
    }

    public Baoxiao examine(String id) {
        String state = "退回";
        return userMapper.examine(id, state);
    }

    public void update2(Baoxiao baoxiao) {
        String id = baoxiao.getId();
        String name = baoxiao.getName();
        String department = baoxiao.getDepartment();
        String destination = baoxiao.getDestination();
        LocalDateTime departureDate = baoxiao.getDepartureDate();
        LocalDateTime returnDate = baoxiao.getReturnDate();
        String Reason = baoxiao.getReason();
        int StartFare = baoxiao.getStartFare();
        int ReturnFare = baoxiao.getReturnFare();
        int foodAllowance = baoxiao.getFoodAllowance();
        int localTrans = baoxiao.getLocalTrans();
        int Accommodation = baoxiao.getAccommodation();
        int totalAmount = baoxiao.getTotalAmount();
        String schedule = baoxiao.getSchedule();
        userMapper.update2(id, name, department, destination, departureDate, returnDate, Reason, StartFare, ReturnFare, foodAllowance, localTrans, Accommodation, totalAmount, schedule);
    }

    public List<Application> selectApp(String name) {
        return userMapper.selectApp(name);
    }

    public List<Baoxiao> selectBao(String name) {
        return userMapper.selectBao(name);
    }

    public List<Application> select1(String id) {
        return userMapper.select1(id);
    }

    public void updateById(String id, String state) {
        userMapper.updateById(id, state);
    }

    public void updateById2(String id, String state) {
        userMapper.updateById2(id, state);
    }
}

 

标签:String,baoxiao,userMapper,id,application,1.23,public
From: https://www.cnblogs.com/zzqq1314/p/17990415

相关文章

  • 1.23总结
    packagemainimport("fmt""os")funcmain(){commandArgs:=os.Argsfmt.Println(commandArgs)}执行程序:递归浏览指定目录下所有文件gorunmain.go--namels--value/etc-r输出:[/tmp/go-build2637413899/b001/exe/main--namels--value/etc-r]命令行参数......
  • 1.23
    模拟赛题根本不想调啊。但是真的是模拟赛题吗,显然它不应当按照模拟赛来看,但是只有这样才会让我好受些。实力本来就不足,现在我就是在为之前的颓废而买单,错误的心态,过慢的进度,大量的颓废以及贺题解的恶习终于回报了我,所有小题都狠狠地挂分,当然最后的提高难度的题也是直接暴力,菜就......
  • 1.23闲话
    推歌:光与影的对白/洛天依byCopy快期末考试了,所以来机房的只有我了但是我说的不对,今天其实有不少来的但是晚三之前就走光了找到了几张存起来的夏虫图,但是貌似有点小?唯一一张大图放末尾了阿$\infty$阿$\infty$我对贪心策略大幅改进,现在可以过掉很多数据了,感觉再改一下就......
  • 百度网盘(百度云)SVIP超级会员共享账号每日更新(2024.01.23)
    一、百度网盘SVIP超级会员共享账号可能很多人不懂这个共享账号是什么意思,小编在这里给大家做一下解答。我们多知道百度网盘很大的用处就是类似U盘,不同的人把文件上传到百度网盘,别人可以直接下载,避免了U盘的物理载体,直接在网上就实现文件传输。百度网盘SVIP会员可以让自己百度账......
  • 1.23学习进度
    1.RDD定义:弹性分布式数据集,是spark中最基本的数据抽象,代表一个不可变、可分区、里面的元素可并行计算的集合2.RDD五大特性   Alistofpartitions:RDD是有分区的   Afunctionforcomputingeachsplit:计算方法会做用到每一个分片(分区)之上   Alistofdependencies......
  • 01.23 算法补全:后缀数组
    秉着技多不压身的想法,我认为在有些时候后缀数组的直接建法还是有用处的,于是决定快速地补一下这个算法。以后看看能不能每天稳定产出一篇,随便什么的文章。可能是一个trick的记录,也能是算法补全,或者是题解慢报/速报,亦或是鲜花。这些内容会同步发表于我的洛谷blog:https://www.luo......
  • 2024.1.23-每日进度笔记
    今天,我尝试在mysql插入数据后获取自增字段的值。 参考:百度文心一言的回复。 publicstaticintinsertTimu(StringtimuLeixing,StringtimuWenti,StringtimuDaan,StringtimuXuanxiang)throwsException{intres=0;Connectionconnection=uti......
  • 2024.1.23日报
    今天继续完成spark实验,已经是最后一个了关于这次的数据集,用到的是adult.data和adult.test两个两个数据集都要进行一下预处理首先就是删除最后的空行,然后test文件第一行数据格式有问题,删掉另外就是test文件每行最后有个.,可以采用把所有的K.替换成为K的方式处理完之后上传到hd......
  • 【2024.01.23】搭建幻兽帕鲁palworld私人服务器,并配置难度
    使用docker进行部署无疑是最快的项目地址:https://github.com/thijsvanloef/palworld-server-docker代码内容services:palworld:image:thijsvanloef/palworld-server-docker:latestrestart:unless-stoppedcontainer_name:palworld-serverpo......
  • 11.23
    <%@pagecontentType="text/html;charset=UTF-8"language="java"%><%@pageimport="java.sql.*"%><%@pageimport="javax.naming.*"%><%@pageimport="javax.*"%><html><body&g......