上一页 1 ··· 16 17 18 19 20
摘要: 场景 在日常项目开发中,前端向后端传参时,可能会遇到需要传 List 类型的参数。比如批量删除时将多个 ID 以集合的形式传给后台。 前端传参 此时前端传参有两种方式: 1、多个同名 key key = value1 & key = value2 & key = value3 2、逗号分隔 valu 阅读全文
posted @ 2021-06-15 17:26 天航星 阅读(5755) 评论(0) 推荐(0) 编辑
摘要: MyBatis-Plus在实际工作中常用到的配置,供自己和大家查阅学习。 mybatis-plus: mapperPackage: com.**.**.mapper # 对应的 XML 文件位置 mapperLocations: classpath*:mapper/**/*Mapper.xml # 阅读全文
posted @ 2021-06-08 15:29 天航星 阅读(2544) 评论(0) 推荐(0) 编辑
摘要: MyBatis-Plus官网的代码生成器配置不是特别全,在此整理了较为完整的配置,供自己和大家查阅学习。 // 代码生成器 AutoGenerator mpg = new AutoGenerator(); // 全局配置 GlobalConfig gc = new GlobalConfig(); / 阅读全文
posted @ 2021-06-08 15:28 天航星 阅读(93) 评论(0) 推荐(0) 编辑
摘要: 阿拉伯数字转汉字: public static String number2chinese(int src) { final String num[] = {"零", "一", "二", "三", "四", "五", "六", "七", "八", "九"}; final String unit[] 阅读全文
posted @ 2021-06-01 12:13 天航星 阅读(1654) 评论(0) 推荐(0) 编辑
摘要: 描述 SpringBoot + Mybatis-plus 项目,运行时出现如下错误: ognl.NoSuchPropertyException:没有对应属性异常 Invalid bound statement (not found):绑定语句无效(未找到) 分析 项目出现这两个异常,一般有如下可能: 阅读全文
posted @ 2021-05-31 14:06 天航星 阅读(408) 评论(0) 推荐(0) 编辑
摘要: 一般查询 字段取别名 别名不用加单引号,as 可省略。 select t.id ID, t.name 名称 from grade t; 拼接字符串 concat(a, b) select concat('姓名:', t.name) 新名字 from student t; 不能用 || 字段去重 se 阅读全文
posted @ 2021-05-31 13:49 天航星 阅读(90) 评论(0) 推荐(0) 编辑
摘要: 插入 插入多个字段 insert into grade (`name`) values ('大一'),('大二'),('大三'),('大四'); 修改 设置时间为当前时间 update `student` set `birthday` = CURRENT_TIME where id = 1; 主键加 阅读全文
posted @ 2021-05-31 13:48 天航星 阅读(52) 评论(0) 推荐(0) 编辑
摘要: 表相关 修改表名 alter table grade rename hang; 新增表字段 alter table grade add `name` varchar(100); 修改表字段类型 alter table grade modify `name` varchar(100); 修改表字段名和 阅读全文
posted @ 2021-05-31 13:46 天航星 阅读(62) 评论(0) 推荐(0) 编辑
摘要: 数据库相关 创建数据库 create database sail; 创建名称为特殊字符或关键字的数据库 create database `create`; 创建数据库(如果不存在) create database if not exists sail; 删除数据库 drop database sai 阅读全文
posted @ 2021-05-31 11:28 天航星 阅读(71) 评论(0) 推荐(0) 编辑
上一页 1 ··· 16 17 18 19 20