mybatis排序无效问题
发表于|更新于
|浏览量:
今天在mybatis.xml里加了段排序,一开始发现排序不生效,debug发现参数确实传过去了,但并没有执行排序逻辑
最后发现。。。
1 | //这样写法是错误的,mybatis会给它加上引号 |
要更改成$
1 | //也就是这样 |
这样会直接替换、拼接sql
相关推荐
2022-03-22
编写一个spring-boot-starter-fastjson
酷烈之祸,多起于玩忽之人;盛满之功,常败于细微之事。——《菜根谭》 这个starter是自己写的,主要就是注入了个FastJsonConfig 写法如下:首先引入gav,完整pom.xml如下: 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566<?xml version="1.0" encoding="UTF-8"?><project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://...
2024-02-03
阿里云oss-cloud-sdk-springboot3兼容问题
辛勤的蜂蜜永远没有时间悲哀。——布莱克 前两天提到了: minio临时凭证直传切换到阿里云oss | 阿超 但是忘记说依赖和配置了,因为我本地是jdk17+springboot3,所以需要修改,首先是依赖: 123456<!-- https://mvnrepository.com/artifact/com.aliyun.oss/aliyun-sdk-oss --> <dependency> <groupId>com.aliyun.oss</groupId> <artifactId>aliyun-sdk-oss</artifactId> <version>3.17.4</version> </dependency> 按照我原来的博客里肯定是不行的 阿里云OSS临时凭证前后端配合上传文件 | 阿超 不能使用原来的 12345<dependency> <gr...
2022-05-01
mapstruct的spring拓展
活着不一定要鲜艳,但一定要有自己的颜色。——张曙光 首先按照惯例放官网: https://mapstruct.org/documentation/spring-extensions/reference/html/ 基本的使用方式之前博客已经写过了我们就不再细表,这里简单放上链接 https://VampireAchao.github.io/2022/03/23/mapstruct/ 在此之前还要配置对应的依赖和插件 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 <properties> <java.version>1.8</java.version> <!-- 编译生成代码插件版本号开始(避免mapstruct和lombok冲突,因此此处指定一个兼容的版本) --> <lombok.version&g...
2021-07-02
redisson实现分布式锁
性格左右命运,气度影响格局。——余世雅博士 代码如下 123456789101112131415161718192021222324252627282930313233 public static int EXPIRE_SECONDS = 5 * 60; @Resource private RedissonClient redissonClient; /** * 加redisson分布式锁 * * @param lockName 锁名 * @param supplier 调用方法 * @return T * @author <achao1441470436@gmail.com> * @since 2021/7/2 17:42 */ @Override @Transactional(rollbackFor = Throwable.class, isolation = Isolation.READ_UNCOMMITTED, propagation = Propagation.REQUIRED) p...
2023-10-06
camel+minio实现预签名URL上传
充实的思想不在于言语的美丽,而在于它引以自豪的内容。——莎士比亚 Camel文档: Minio :: Apache Camel Minio文档: https://min.io/docs/minio/linux/developers/java/API.html#getPresignedObjectUrl Amazon文档: 使用预签名 URL - Amazon Simple Storage Service 然后核心配置如下: 123// For the generate Pre signed Url routefrom(direct("createUploadLink")) .to(minio(CamelConst.BUCKET_TEMPLATE).operation(MinioOperations.createUploadLink)); 其余配置部分参考 springboot+camel对接minio上传下载 接下来就是使用: 123456789101112131415161718import cn.hutool.core.io.IoUt...
2023-06-14
spring获取AliasFor增强的注解
无论何时,别让你自己卷进去反对他人。——歌德 此处是关于issue:https://gitee.com/dromara/stream-query/issues/I7BSNV 这里使用的一个自定义的@Table注解+@AliasFor来增强@TableName 1234567891011121314151617181920212223242526272829303132/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License&q...

阿超
我的名字叫阿超 年龄25岁 家在北京市 职业是软件开发 每天最晚也会在八点前回家 不抽烟 酒浅尝辄止 晚上十二点上床 保证睡足八个小时 睡前写一篇博客 再做二十分钟俯卧撑暖身 然后再睡觉 基本能熟睡到天亮 像婴儿一样不留下任何疲劳和压力 就这样迎来第二天的早晨 健康检查结果也显示我很正常 我想说明我是一个不论何时都追求内心平稳的人 不拘泥于胜负 不纠结于烦恼 不树立使我夜不能寐的敌人 这就是我在这社会的生活态度
Follow Me公告
This is my Blog