可以直接使用 contains判断

<foreach collection="list" item="item" index="index" separator="AND" open="(" close=")">

    <choose>
<when test='item.cname.contains("select") or item.cname.contains("checkbox") or item.cname.contains("date")'>
<if test='item.cname.contains("select") or item.cname.contains("checkbox")'>
find_in_set(#{item.value},base.${item.cname})
</if> <if test='item.cname.contains("date")'>
DATE_FORMAT(base.${item.cname},'%Y-%m-%d') = DATE_FORMAT(#{item.value},'%Y-%m-%d')
</if>
</when>
<otherwise>
base.${item.cname} = #{item.value}
</otherwise>
</choose> </foreach>

【mybatis】标签条件中判断入参属性值是否包含子字符串的更多相关文章

  1. springMVC如何判断入参是默认参数还是请求传过来的参数?

    springMVC如何判断入参是默认参数还是请求传过来的参数?

  2. MVC过滤器中获取实体类属性值

    本文地址:http://www.cnblogs.com/outtamyhead/p/3616913.html,转载请保留本地址! 最近在项目遇到了这个问题:获取Action行参中实体类的属性值,主要的 ...

  3. How to: Calculate a Property Value Based on Values from a Detail Collection 如何:基于详细信息集合中的值计算属性值

    This topic describes how to implement a business class, so that one of its properties is calculated ...

  4. js中获取css样式属性值

    关于js中style,currentStyle和getComputedStyle几个注意的地方 (1)用js的style只能获取元素的内联样式,内部样式和外部样式使用style是获取不到的.针对css ...

  5. python判断字符串中是否包含子字符串

    python判断字符串中是否包含子字符串 s = '1234问沃尔沃434' if s.find('沃尔沃') != -1:     print('存在') else:     print('不存在' ...

  6. 与元素类型 "item" 相关联的 "name" 属性值不能包含 '<' 字符。

    Android Studio 打包时,报错: 与元素类型 "item" 相关联的 "name" 属性值不能包含 '<' 字符. 这个问题自己百度也没有发现 ...

  7. python判断字符串是否包含子字符串

    python的string对象没有contains方法,不可以使用string.contains的方法判断是否包含子字符串,但是python有更简单的方法来替换contains函数 python的st ...

  8. 如何在 JavaScript 中检查字符串是否包含子字符串?

    如何在 JavaScript 中检查字符串是否包含子字符串? // var test4 = _.includes(string, substring); 该方法需要此文件 <script src ...

  9. shell 脚本中的入参获取与判断

    1.获取shell脚本的入参个数: $# 2.获取shell脚本的第n个入参的字符个数/字符串长度(注意这里的n需要替换为具体的数字,如果这个数字超过实际的入参个数,结果为0): ${#n}

随机推荐

  1. 智能家居-2.基于esp8266的语音控制系统(硬件篇)

    智能家居-1.基于esp8266的语音控制系统(开篇) 智能家居-2.基于esp8266的语音控制系统(硬件篇) 智能家居-3.基于esp8266的语音控制系统(软件篇) 赞赏支持 QQ:505645 ...

  2. TP5 Request 请求对象【转】

    app\index\controller\Index.php <?php namespace app\index\controller; use think\Request; class Ind ...

  3. springboot测试启动报错java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest(classes=...) with your test

    springboot测试启动报错: java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you ne ...

  4. Linux下经常使用的C/C++开源Socket库【转】

    转自:https://www.cnblogs.com/gccbuaa/p/7015599.html 1.      Linux Socket Programming In C++ : http://t ...

  5. Python元组与字符串操作(8)——三数排序多种实现

    练习 依次接收用户输入的3个数,排序后打印 1.转换int后,判断大小排序,使用分支结构完成 num1 = [] for i in range(3): num1.append(int(input('& ...

  6. 网络流之最大流Dinic --- poj 1459

    题目链接 Description A power network consists of nodes (power stations, consumers and dispatchers) conne ...

  7. 老男孩LINUX--打包压缩、查看、解压

    tar就是打包的意思,打包就是将多个文件或者目录放置到一起,整体的大小没有变化,tar可以调用一些压缩的软件,比如zip,在打包的同时进行压缩.先来上一个例子: tar zcvf /tmp/etc.t ...

  8. HttpRuntime应用程序运行时

    System.Web.HttpRuntime类是整个Asp.net服务器处理的入口. 这个类提供了一系列的静态属性,反映web应用程序域的设置信息,而且每个web应用程序域中存在一个System.We ...

  9. Codeforces Round #604 (Div. 2) D、E、F题解

    Beautiful Sequence Beautiful Mirrors Beautiful Bracket Sequence (easy version) Beautiful Sequence \[ ...

  10. 数据库创建,用户管理,导入dmp文件

    创建数据库文件 CREATE TABLESPACE toolset LOGGING DATAFILE '/home/oracle/app/oracle/oradata/orcl/toolset.dbf ...