<if test="(mac != null and mac != '') or (roomNo != null and roomNo != '') or (bedNo != null and bedNo!= '') or (kinds != null and kinds.size > 0)">
and
<trim prefix="(" prefixOverrides="or" suffix=")">
<if test="mac != null and mac != ''">
or device.mac like concat('%',#{mac},'%')
</if>
<if test="roomNo != null and roomNo != ''">
or room.no like concat('%', #{roomNo}, '%')
</if>
<if test="bedNo != null and bedNo!= ''">
or bed.no like concat('%', #{bedNo}, '%')
</if>
<if test="kinds != null and kinds.size > 0">
or device.kind in
<foreach collection="kinds" item="kind" index="index" open="(" close=")" separator=",">
#{kind}
</foreach>
</if>
</trim>
</if>

mybatis xml 中 trim 多余的符号的更多相关文章

  1. C#读取Xml中出现”&”等特殊符号

    原文:C#读取Xml中出现"&"等特殊符号 C#读取Xml中出现的特殊符号时用ASCII或者转定义名称代替.程序读进来后转成字符串后就自动变成相应的字符了,再度保存时会以正 ...

  2. java转义xml中的多余尖括号

    xml中的敏感字符是尖括号,如果xml的值中含有尖括号,那么在解析的时候就会报错,如: <?xml version="1.0" encoding="UTF-8&qu ...

  3. mybatis xml中大于号小于号的代替

    第一种写法(1): 原符号 < <= > >= & ' "替换符号 < <= > >= & &apos; " ...

  4. mybatis xml中是sql语句报错: Error creating document instance. Cause: org.xml.sax.SAXParseException: The

    最近项目折腾了老半天,找了资料才知道是这么回事... 因为语句中有一个小于号“<”,在XML中,会被当成一个页面元素来解析,不会处理为mysql的SQL语句的组成部分,修改如下: 1.在xml的 ...

  5. mybatis xml中的大于、小于等符号写法

    xml特殊符号转义写法 <          < >          > <>   <> &      & &apos;   ...

  6. mybatis xml 中的特殊符转义字符号和模糊查询

    xml特殊符号转义写法 < < 小于 <= <= 小于或等于 > > 大于 >= >= 大于或等于 <> <> 不等于 & ...

  7. mybatis XML中 遍历map写法

    <select id="selectMapTest" parameterType="java.util.HashMap" resultMap=" ...

  8. mybatis xml中返回map 参看aiwanpai

    <!-- 指定日期活动被创建次数查询结果数据集--> <resultMap id="countPlayTimesMap" type="HashMap&q ...

  9. mybatis xml中常见配置demo

    新增: <insert id="insertSelective" parameterType="map" > insert into BS_CHNG ...

随机推荐

  1. idea中Git的配置和Github上推拉项目

    1.去官网下载Git,并且安装它.安装步骤较为简单,此处就不再赘述. 2.在idea中配置Git信息 Git路径就是你电脑中安装Git的位置,找到git.exe文件(正常情况下,idea都会自动给你匹 ...

  2. 2. 使用Github

    2. 使用Github 2.1 目的 借助github托管项目代码 2.2 基本概念 仓库(Repository) 仓库用来存放项目代码,每个项目对应一个仓库,多个开源项目则有多个仓库 收藏(Star ...

  3. 使用Bootstrap typeahead插件实现搜索框自动补全的配置参数。

    示例代码: <input type="text" id="addr"/> <input type="text" hidde ...

  4. Android 动态控制OptionMenu的显示与隐藏

    在有些场景下,可能需要动态的显示和隐藏optionmenu,可以这样实现:如果在activity中默认实现了方法: onCreateOptionsMenu(Menu menu) 那么该OptionMe ...

  5. ZXing Blazor 扫码组件 , ssr/wasm通用

    项目介绍 本项目是利用 ZXing 进行封装的 Blazor 组件库 直接调用手机或者桌面电脑摄像头进行扫码 项目截图              项目地址 https://github.com/den ...

  6. Could not autowire. No beans of 'JavaMailSenderImpl' type found

  7. git远程建立仓库后,将本地项目推到远程报错 fatal: refusing to merge unrelated histories

    出现这个问题的最主要原因还是在于本地仓库和远程仓库实际上是独立的两个仓库,假如之前是直接clone的方式在本地仓库就不会有这个问题了. 解决方式是在命令后紧跟 --allow-unrelated-hi ...

  8. collections、time、datetime、random模块

    今日内容概要 1.re模块的其他知识 2.正则起别名与分组机制 3.collections模块 4.time与datetime模块 5.random随机数模块 今日内容详细 re模块的其他知识 imp ...

  9. “九韶杯”河科院程序设计协会第一届程序设计竞赛 D数列重组 next_permutation

    "九韶杯"河科院程序设计协会第一届程序设计竞赛 D数列重组  next_permutation 题目 原题链接: https://ac.nowcoder.com/acm/conte ...

  10. 判断是否微信,qq等登陆。进去不同的页面下载

    <!DOCTYPE html><html> <head> <meta charset="utf-8"> <title>安 ...