mybatis Mybatis使用like(Mysql和oracle占位符写法)

ORACLE select * from tableName where name like CONCAT(CONCAT('%', #{name}),'%');   MYSQL select * from tableName where name like CONCAT('%',#{name},'%'); 

2022-12-10 355 阅读

mybatis Mybatis 中的转义字符

在MyBatis中,经常用到动态sql。Mybatis使用的 *.xml文件格式,需要对有些字符进行转义。     1. 转义方式字符 转义符号 备注< &lt; 小于<= &lt;= 小于等于> &a...

2022-12-10 404 阅读

mybatis mybatis 中 if-test 判断大坑

【<if test="takeWay == '0'">】mybatis的if判断 单个的字符要写到双引号里面才行,改为<if test='takeWay == "1"'>或者改为<if test="takeWay == '1'.toString() "> .xm...

2022-12-10 261 阅读

mybatis mybatis if-else(写法)

mybaits 中没有else要用chose when otherwise 代替 范例一 <!--批量插入用户--> <insert id="insertBusinessUserList" parameterType="java.util.List"> insert into `bus...

2022-12-10 232 阅读

mybatis mybatis传入多个数组或者多个list的实现

mybatis传入多个数组或多个list此博客给出了mybatis传入多个数组或者多个List,传入多个数组或者多个List,传入多个数组或者多个List,而非传入多个参数的一种实现。(PS:传入多个参数很简...

2022-12-10 424 阅读

mybatis mybatis之foreach用法

在做mybatis的mapper.xml文件的时候,我们时常用到这样的情况:动态生成sql语句的查询条件,这个时候我们就可以用mybatis的foreach了 foreach元素的属性主要有item,index,collection,ope...

2022-12-10 218 阅读