首页 > 其他分享 >11.20

11.20

时间:2023-12-18 12:33:59浏览次数:32  
标签:String 11.20 public logONMapper staff id name

今天实现Service类

LogOnService

package com.example.service;

import com.example.mapper.LogONMapper;
import com.example.pojo.Department;
import com.example.pojo.Staff;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

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

@Service
public class LogONService {
    @Autowired
    private LogONMapper logONMapper;

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

    public List<Department> selectCount() {
        return logONMapper.selectCount();
    }

    public int count() {
        return logONMapper.count();
    }

    public void addStaff(Staff staff) {
        String jobID = staff.getJobID();
        String name = staff.getName();
        String sex = staff.getSex();
        LocalDate birthday = staff.getBirthday();
        String department = staff.getDepartment();
        String role = staff.getRole();
        String password = staff.getPassword();
        logONMapper.addStaff(jobID, name, sex, birthday, department, role, password);
    }

    public void updateStaff(Staff staff) {
        String jobID = staff.getJobID();
        String name = staff.getName();
        String sex = staff.getSex();
        LocalDate birthday = staff.getBirthday();
        logONMapper.updateStaff(jobID, name, sex, birthday);
    }

    public List<Staff> getStaff() {
        String t = "2019";
        return logONMapper.getStaff(t);
    }

    public void deleteStaff(String id) {
        logONMapper.deleteStaff(id);
    }

    public int aDep(String id) {
        return logONMapper.aDep(id);
    }

    public int bDep(String name) {
        return logONMapper.bDep(name);
    }

    public void addDep(Department department) {
        String departmentID = department.getDepartmentID();
        String departmentName = department.getDepartmentName();
        logONMapper.addDep(departmentID, departmentName);
    }

    public void updateDep(Department department) {
        String departmentID = department.getDepartmentID();
        String departmentName = department.getDepartmentName();
        logONMapper.updateDep(departmentID, departmentName);
    }

    public int cDep(String id) {
        return logONMapper.cDep(id);
    }

    public void deleteDep(String id) {
        logONMapper.deleteDep(id);
    }

    public int dDep() {
        String name = "经理";
        return logONMapper.dDep(name);
    }

    public void updateRole(String id) {
        String name = "经理";
        logONMapper.updateRole(id, name);
    }

    public Staff selectById(String id) {
        return logONMapper.selectById(id);
    }

    public void update(String id, String password) {
        logONMapper.update(id, password);
    }
}

StaffService

package com.example.service;

import com.example.mapper.StaffMapper;
import com.example.pojo.Attendance;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StaffService {
    @Autowired
    private StaffMapper staffMapper;

    public void addStaff(Attendance attendance) {
        int id = attendance.getId();
        String attendanceTime = attendance.getAttendanceTime();
        String jobID = attendance.getJobID();
        String name = attendance.getName();
        String sex = attendance.getSex();
        String department = attendance.getDepartment();
        int attendanceType = attendance.getAttendanceType();
        String notes = attendance.getNotes();
        String approvedType = attendance.getApprovedType();
        staffMapper.addStaff(id, attendanceTime, jobID, name, sex, department, attendanceType, notes, approvedType);
    }

    public int count() {
        return staffMapper.count();
    }

    public List<Attendance> low() {
        int i = 0;
        return staffMapper.low(i);
    }

    public void approve(String name, String type, String i) {
        staffMapper.approve(name, type, i);
    }
}

 

标签:String,11.20,public,logONMapper,staff,id,name
From: https://www.cnblogs.com/zzqq1314/p/17910883.html

相关文章

  • 11.20
    今日学习内容<%--CreatedbyIntelliJIDEA.TochangethistemplateuseFile|Settings|FileTemplates.--%><%@pagecontentType="text/html;charset=UTF-8"language="java"%><html><head><title>Title</ti......
  • 2023衡山论坛 医学大数据与人工智能前沿论坛 2023.11.20-12
    中国抗癌协会肿瘤标志专业委员会南华大学附属第一医院南华大学计算机学院 湖南省生物医学工程协会 湖南省生物信息学会哈尔滨工业大学生命科学与技术学院   湖南省生物医学工程学会是由湖南省从事生物医学工程学科活动的科技工作者和有志于促进生物医学工程领域......
  • 微信小程序开发周记(11.20-11.26)
    实现1:下拉生成颜色可以不断显示随机颜色。下拉刷新可以重置颜色列表,上拉触底可以延申显示内容。wxml:<!--pages/getc/getc.wxml--><buttontype="primary"bind:tap="navifunc">后退</button><viewclass="num-item"wx:for="{{colorList}}"wx:key=......
  • 2023.11.20-2023.11.26 周记
    11.20星期一升旗仪式时间改到上午大课间了,前一节还正好是体育,之前太冷现在太热,真服了。与其说升旗仪式,到不如说是颁奖仪式。七年级年级前十:李泊璇、陈墨杋、黄耀民、周敬轩、牛文昊、张轩豪、秦子祺、时欣翔、徐颢扬、宋之萱。八年级年级前十:何家鼎、李承恩、朱鑫、陈亦飞、张......
  • 11.20会员管理系统建模
    用例图建模班级:信2205-2班         学号:20224082         姓名: 艾鑫一实验目的l 掌握客户需求的方法和步骤; l 了解以用例驱动的软件开发方法;l 掌握用例图的绘制方法;l 掌握RationalRose进行用例建模的具体方法和步骤;二实验环境及实验准备l......
  • 聪明办法学Python_task1_11.20-11.21
    聪明办法学Python_task1_11.20-11.211.task011.1Python灵魂三问1.2Python环境配置2.task022.1注释2.2基本控制台输出2.3错误2.4基本控制台输入2.5导入模块1.task01:Python简介/安装1.1Python灵魂三问为什么学Python?Python是全球最流行的编程语言......
  • 【2023潇湘夜雨】WIN10_Pro_22H2.19045.3754软件选装纯净版11.20
    【系统简介】=============================================================1.本次更新母盘来自WIN11_Pro_22H2.19045.3754。2.增加部分优化方案,手工精简部分较多。3.OS版本号为19045.3754。精简系统只是为部分用户安装,个别要求高的去MSDN下。4.集成《DrvCeo-2.15.0.5》网卡版、......
  • 敏捷冲刺11.20
    所属课程软件工程导论作业要求项目冲刺作业目标连续七天的敏捷冲刺github链接CampusSecond-handMarket--NoBailanGroup一、团队介绍1、团队名称:摆烂就不队2、团队成员姓名班级学号林劲辰(组长)计科2班3121004707......
  • 每日总结11.20
    命令模式1、理解命令模式的动机,掌握该模式的结构;2、能够利用命令模式解决实际问题。实验任务:多次撤销和重复的命令模式某系统需要提供一个命令集合(注:可以使用链表,栈等集合对象实现),用于存储一系列命令对象,并通过该命令集合实现多次undo()和redo()操作,可以使用加法运算来模拟实现。......
  • 2023.11.20——每日总结
    学习所花时间(包括上课):9h代码量(行):0行博客量(篇):1篇今天,上午学习,下午学习;我了解到的知识点:1.mybatis2.JavaGUI明日计划:学习......