
Mybatis相关
文章平均质量分 64
Mybatis、MybatisPlus相关
Koma_zhe
虚心学习,积累知识
展开
-
【MyBatis八股】MyBatis面试题
【MyBatis八股】MyBatis面试题原创 2023-08-21 16:59:39 · 1444 阅读 · 0 评论 -
【MyBatis占位符】Mybatis中的#{}和${}区别
【MyBatis占位符】Mybatis中的#{}和${}区别原创 2023-08-17 11:41:02 · 185 阅读 · 0 评论 -
【Mybatis&Java】解决Mybatis及MP出现返回的Map缺字段的问题
问题描述:select gantryId as "gantryId",name as "tollStationName",roadId as "roadId",countyName as "countyName",cityName as "cityName" from doorframedata where gantryId = "123456"List<Map<String, Object>> getTollStationData(String gantryId);因为原创 2021-12-01 14:33:52 · 2642 阅读 · 3 评论 -
Mybatis入门实例理论回顾
数据库表:附上sql:CREATE TABLE `student` ( `sid` char(10) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, `sname` char(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, `sc` double(5, 2) NULL DEFAULT NULL, `sm` double(5, 2) NULL DEFAULT NU原创 2021-11-21 17:38:00 · 770 阅读 · 0 评论 -
Mybatis中输入参数说明及其他配置
Mybatis入门理论及代码请点这主要内容Mybatis的其他设置(示例conf.xml)Mybatis内置的类型处理器自定义Mybatis类型处理器Mybatis内置别名Mybatis输入参数说明Mybatis的其他设置(示例conf.xml)conf.xml中<?xml version="1.0" encoding="UTF-8" ?><!DOCTYPE configurationPUBLIC "-//mybatis.org//DTD Config 3.0//EN"".原创 2021-11-21 21:06:53 · 1152 阅读 · 0 评论 -
Mybatis调用存储过程实例
举例子说明Mybatis调用存储过程查询某个年级的 学生总数。 输入:年级。 输出:该年级的学生总数根据学号删除学生查询某个年级的 学生总数。 输入:年级。 输出:该年级的学生总数创建存储过程:create or replace procedure queryCountByGradeWithProcedure(gName in varchar, scount out number )asbegin select count(*) into scount from student where原创 2021-11-21 21:49:28 · 903 阅读 · 0 评论 -
Mybatis输出参数实例
Mybatis输出参数实例输出参数为实体对象类型的集合输出参数类型为 HashMap输出参数类型为 resultType输出参数为实体对象类型的集合虽然输出类型为集合,但是resultType依然写 集合的元素类型(resltType="User"),接口使用List<User>接收。输出参数类型为 HashMap通过别名作为map的key <!-- 别名作为Map的key --> <select id="queryStudentOutByHashMap" res原创 2021-11-21 22:16:38 · 166 阅读 · 0 评论 -
Mybatis动态SQL及关联查询实例
实现:select stuno,stuname from student where stuname = #{stuName}and stuage = #{stuAge}第一种写法: <select id="queryStuByNOrAWishSQLTag" parameterType="student" resultType="student" > select stuno,stuname,stuage from student where 1=1 <!--<if原创 2021-11-21 22:52:32 · 768 阅读 · 0 评论 -
【MP】MybatisPlus简记及实例 (SpringBoot)
一个简单的 MP 项目:数据库表mp:(主键自增)类:@AllArgsConstructor@NoArgsConstructor@Data@TableName(value="student",keepGlobalPrefix=true) //映射表名public class Student extends Model<Student> { //IdType.AUTO:自增,依赖数据库,数据库字段得是自增TableId主键 @TableId(value = "stu原创 2021-11-22 22:44:16 · 1134 阅读 · 0 评论