自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(24)
  • 收藏
  • 关注

原创 使用STRAIGHT_JOIN替换INNER JOIN,解决子查询排序失效问题

MySQL子查询排序失效

2023-02-15 17:17:55 214

原创 MySQL插入数据时查询已有数据并设置为字段值

MySQL插入数据时查询已有数据并设置为字段值

2022-11-08 14:34:09 963

原创 springboot多数据源报错:找不到数据源,加载不到xml文件

@Primary @Bean("ds1SqlSessionFactory") public SqlSessionFactory ds1SqlSessionFactory(@Qualifier("ds1DataSource") DataSource dataSource) throws Exception { MybatisSqlSessionFactoryBean sqlSessionFactory = new MybatisSqlSessionFactoryBean();

2021-12-28 18:02:41 1471

原创 ES搜索使用总结

1.排序只能是数字,日期格式的2.(对象.属性)字段索引类型必须是nested,否则通过对象.属性查询时报错3.建索引时,未指定类型的字段,默认为text类型,且有fields属性4.索引名称只能是小写字母,不能是大写5.text会进行分词,keyword不会进行分词6.分词器"analyzer": “ik_max_word” “ik_smart”7.date类型默认为:2021-08-04T 12:34:56.000 或时间戳8.数据更新有三种机制,不更新,立即更新,等待更新,如果不设置,会

2021-08-04 12:37:15 185

原创 springboot接收日期参数差一天的问题

解决方法:1.@DateTimeFormat(pattern = “yyyy-MM-dd”)@JsonFormat(pattern=“yyyy-MM-dd”,timezone=“GMT+8”)private Date award_date;//这里是你自己的时间类型的字段,在它上面加上这两个注解在连接数据库的语句后面添加参数:characterEncoding=utf8&allowMultiQueries=true&useSSL=false&serverTimezo

2021-08-04 11:26:07 859 1

原创 mybatis中and和or的使用方法

在使用or和and混合使用时,name成立并且想要age和bj其中一个成立就显示,这样写:QueryWrapper userWrapper = new QueryWrapper();userWrapper.eq(“name”, name); userWrapper.eq(“age”,age).or().eq(“bj”, bj);出来的sql语句:select * from user where(name=? and age=? and bj=? )这样写是三个条件都成立才能显示,跟自己想要的不一

2021-07-30 09:31:38 2770

原创 springboot启动报错

Parameter 2 of constructor in com.lenovo.chinaservice.trigger.application.impl.TriggerServiceImpl requied…原因:要注入的类未添加注解@Component

2021-07-20 12:08:20 1391

原创 使用fastjson将json串转为List<T>

ParameterizedTypeImpl type = new ParameterizedTypeImpl(new Type[]{PropertyCommon.class}, null, List.class); List<PropertyCommon> o = JSONObject.parseObject(savedSearchConfig.getConfigValue(), type);将一个json串转换为指定类型实体的List,...

2021-07-09 15:33:33 1392

原创 mysql无效的语句不一定会导致报错

SELECT *FROM t_testWHERE create_user = '1399627302760910850'AND '健康的说法45345'

2021-06-02 17:28:32 81

原创 Vue前端处理后端返回的文件流乱码,导出Excel

export function exportDataList () { return axios.get('/export?tableName=list', { responseType: 'blob' })}exportData() { exportDataList().then((res) => { this.downloadfile(res) }).catch((err) => { console.log('错误信息', e.

2021-05-13 10:13:38 4212 2

原创 mybatis遍历Map

<insert id="insert" parameterType="com.modular.table.param.CustomDataParam"> insert into ${param.tableName} <foreach collection="param.params.keys" item="key" open="(" close=")" separator=","> ${key.

2021-05-11 16:04:37 5137 1

原创 springboot接收前端Vue的文件

后端代码,用注解@RequestPart接收,而不是@requestParampublic ResponseData importDataByStream(String tableName, @RequestPart("file") MultipartFile file) throws Exception {}前端代码,用new FormData()来传递fileimportData() { const formData = new FormData() formD

2021-05-08 15:08:11 887

原创 MySQL数据库关键字集合

public static List<String> keyList() { String[] keys = {"ADD", "ALL", "ALTER", "ANALYZE", "AND", "AS", "ASC", "ASENSITIVE", "BEFORE", "BETWEEN", "BIGINT", "BINARY", "BLOB", "BOTH", "BY", "CALL", "CASCADE", "CASE", "CHANGE", ".

2021-04-02 13:50:20 506

原创 spring boot中,使用LocalDateTime.now()相差八小时

解决方法:在启动类中加入代码:@SpringBootApplicationpublic class SwappingApplication { public static void main(String[] args) { SpringApplication.run(SwappingApplication.class, args); } @PostConstruct void started() { // Tim

2021-03-10 10:15:38 4041

原创 mybatis中一对一,一对多

<resultMap type="SysUser" id="SysUserResult"> <id property="userId" column="user_id" /> <result property="deptId" column="dept_id" /> <result property="userName" column="user_name" /> &l...

2021-02-20 18:16:31 180

原创 使用@AllArgsConstructor导致@value注入失败

@AllArgsConstructor@RestController@RequestMapping("xx/xx" )public class WxUserController extends BaseController { private final WxUserService service; private final PointsDetailService pointsDetailService; private final WxUserPoints.

2021-01-25 10:16:09 1251 1

原创 使用mybatis-plus的getById()查询到的数据为null

原因就是没有加@tableId注解,加上后就可以了.

2021-01-20 11:49:01 3334 3

原创 There is no getter for property named ‘null‘ in ‘class xxx

错误原因是用mybatis-plus根据id更新(updateById)数据时报错,还以为是前端传输的数据的问题ID字段必须加上@TableId注解,才可以用updateById的方法,加上注解后解决问题

2021-01-20 11:46:25 937

原创 thymeleaf之遍历集合,list属性的索引下标写法

​​​ <div class='danxuan' th:if="${dan.size()>0}"> <div style="font-size: 18px;"><img th:src="@{/assets/img/classroom/ti.png}" alt="" st...

2019-11-23 14:32:00 5984 1

原创 hibernate的order by 失效

在hql语句中,多写了一个 ")" ,导致 order by 字段 desc 不生效(但是在火狐浏览器中可以生效),去掉括号后排序字段生效了!大坑啊,还好我火眼金睛,找到了那个多余的 ")" ,哈哈哈哈!...

2019-10-12 16:11:51 544

原创 idea中使用Git在工具栏中添加push按钮

2019-09-20 14:53:27 5205 6

原创 Java枚举学习心得

今天正式系统的学习了一下enum,发现和java class 有很多相似的地方,以前没怎么使用过,现在觉得确实很好用public enum StatusEnum { aa(4,"dd"),// 定义枚举名称 cc(8), bb(3,"ee"){// 还可以在枚举名称中,重写公共方法 public boolean ifdd(){ r...

2019-09-12 18:11:42 179

原创 mysql(find_in_set)判断某个字符在另一个以逗号分割的字符中(2)

2019-09-09 16:43:32 271

原创 idea修改for循环快捷键

2019-09-09 16:40:09 601

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除