首页 > 其他分享 >12.4

12.4

时间:2023-12-18 21:25:55浏览次数:24  
标签:String org 12.4 apache import where Select

复制代码

package com.example.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserMapper {
    @Select("select count(*) from choice.user where UserName = #{username} and Password = #{password} and Position like concat('%', #{position}, '%')")
    int getByUser(@Param("username") String username, @Param("password") String password, @Param("position") String position);

    @Insert("insert into user(UserName, Password, Position) VALUES (#{username}, #{password}, #{position})")
    void add(String username, String password, String position);

    @Insert("insert into teacher(TeacherID,TeacherName,TeacherSex,TeacherCollege,Position) VALUES (#{teacherID},#{teacherName},#{teacherSex},#{teacherCollege},#{position})")
    void addTea(String teacherID, String teacherName, String teacherSex, String teacherCollege, String position);

    @Insert("INSERT INTO student(StudentID, StudentName, StudentSex, StudentClass, StudentMajor) VALUES (#{studentID},#{studentName},#{studentSex},#{studentClass},#{studentMajor})")
    void addStu(String studentID, String studentName, String studentSex, String studentClass, String studentMajor);
}
复制代码

TeacherMapper

复制代码
package com.example.mapper;

import com.example.pojo.Course;
import com.example.pojo.Information;
import com.example.pojo.Teacher;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface TeacherMapper {
    @Select("select * from teacher where TeacherID=#{username}")
    Teacher getName(String username);

    @Insert("insert into course(CourseID, CourseName, CourseCount, Courseteacher,Count) VALUES (#{courseID},#{courseName},#{courseCount},#{courseTeacher},#{count})")
    void addCourse(String courseID, String courseName, int courseCount, String courseTeacher, int count);

    @Update("update teacher set TeacherName=#{teacherName},TeacherSex=#{teacherSex},TeacherCollege=#{teacherCollege},Position=#{position} where TeacherID=#{teacherID}")
    void updateTea(String teacherID, String teacherName, String teacherSex, String teacherCollege, String position);

    @Select("select * from teacher where TeacherName=#{name}")
    Teacher getByName(String name);

    @Select("select * from teacher where TeacherID=#{username}")
    Teacher getAll(String username);

    @Select("select * from course where CourseTeacher=#{name}")
    List<Course> getCourse(String name);
}
复制代码

StudentMapper

复制代码
package com.example.mapper;

import com.example.pojo.Course;
import com.example.pojo.Information;
import com.example.pojo.Student;
import com.example.pojo.Teacher;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface StudentMapper {
    @Select("select * from choice.student where StudentID=#{username}")
    Student getName(String username);

    @Update("update choice.student set StudentName=#{studentName},StudentSex=#{studentSex},StudentClass=#{studentClass},StudentMajor=#{studentMajor} where StudentID=#{studentID}")
    void update(String studentID, String studentName, String studentSex, String studentClass, String studentMajor);

    @Select("select * from choice.course where CourseID=#{name}")
    Course selectCourse(String name);

    @Select("select * from choice.teacher where TeacherName=#{name}")
    Teacher selectAll(String name);

    @Select("SELECT * from choice.course")
    List<Course> select();

    @Insert("insert into choice.information(CourseID, TeacherID, StudentID) VALUES (#{courseID},#{teacherID},#{studentID})")
    void choose1(String courseID, String teacherID, String studentID);

    @Update("update  choice.course set Count=#{count} where CourseID=#{id}")
    void updateCourse(String id, String count);

    @Select("select * from choice.course where CourseID=#{id}")
    Course cc(String id);

    @Select("select * from choice.information where CourseID=#{id}")
    List<Information> getInformation(String name);
}

标签:String,org,12.4,apache,import,where,Select
From: https://www.cnblogs.com/gjsgjs/p/17912304.html

相关文章

  • 12.4
    UserMapperpackagecom.example.mapper;importorg.apache.ibatis.annotations.Insert;importorg.apache.ibatis.annotations.Mapper;importorg.apache.ibatis.annotations.Param;importorg.apache.ibatis.annotations.Select;@MapperpublicinterfaceUserMappe......
  • #7 2023.12.4
    419.arc137cDistinctNumbers注意到如果\(a_{n-1}+1\neqa_{n}\),显然是先手必胜的。然后一个人显然不会主动走到这个状态,于是\([0,a_n]\)之内的每个数都要被遍历一遍。于是答案就和\(n-a_n\)的奇偶性有关了。420.arc137dPrefixXORs大概只跟\(n-i\)和\(j\)......
  • 上周热点回顾(12.4-12.10)
    热点随笔:· 【故障公告】数据库服务器今年第七次CPU100%故障(12月8日又出现) (博客园团队)· C#/.NET/.NETCore优秀项目和框架2023年11月简报 (追逐时光者)· 带团队后的日常思考(十三) (咖啡机(K.F.J))· 公司敏感数据被上传Github,吓得我赶紧改提交记录 (程序员小富)· ......
  • 聪明办法学python-12.4——12.8笔记打卡
     python中Debug的方法  必要性:在于程序可能出现不符合预期结果的情况 困难:在于bug的出触发原因多种多样,只能看到最终结果 调试代码的基本思路:让bug在设计时更容易暴露出来,包括利用print和断言来解决简单问题,利用IDE进行调试 常见的错误:函数未定义会报错,需要检查函数......
  • 每日总结-23.12.4
    packagecom.example.demo2.controller;importcom.example.demo2.common.AjaxResult;importcom.example.demo2.entity.gongWenInfo;importcom.example.demo2.mapper.gongWenMapper;importorg.springframework.beans.factory.annotation.Autowired;importorg.spring......
  • 云原生周刊:K8s 的 YAML 技巧 | 2023.12.4
    开源项目推荐HelmfileHelmfile是用于部署HelmChart的声明性规范。其功能有:保留图表值文件的目录并维护版本控制中的更改。将CI/CD应用于配置更改。定期同步以避免环境偏差。Docketeer一款Docker和Kubernetes开发人员工具,用于管理容器并可视化集群和容器指标。......
  • 2023.12.4学习笔记(stm32跑马灯实验——库函数)
     STM32f4有七组引脚(GPIOx),每组引脚有16个IO口,每组由十个寄存器控制。   查找STM32引脚的功能,可以在STM32F04ZGT6文件50页左右查询,此文件所在的位置为硬件资料、芯片资料文件夹里。跑马灯实验思路步骤:1:使能时钟,调用函数RCC_AHB1PeriphClockCmd();       ......
  • 2023.12.4——每日总结
    学习所花时间(包括上课):9h代码量(行):0行博客量(篇):1篇今天,上午学习,下午学习;我了解到的知识点:1.jfinal明日计划:学习......
  • 2023.12.4 近期练习
    CF1845E这种\(01\)串的描述方式一般是提出\(1\)的位置去讨论,设原串\(1\)出现位置是\(p_1,...,p_m\).考虑最后生成的串的性质,描述其\(1\)的位置,\(q_1,...q_m\)。那么至少移动步数为\(\sum|p_i-q_i|\),因为\(1\)的位置是相对不变的。考虑一个一个\(1\)往里填,设\(......
  • 12.4每日总结
    今天完成了人机交互C/S结构用户界面设计【实验编号】10003809547j 图形用户界面设计【实验学时】8学时【实验环境】l 所需硬件环境为微机;l 所需软件环境为MicrosoftVisualStudio2013【实验内容】编写一整套Mis系统UI界面,Mis系统名称自拟,尽量运用到如下控件:l......