MyBatis动态SQL小tips
来源:互联网 发布:厦门关键词优化 编辑:程序博客网 时间:2024/05/18 01:06
<!--待修复的任务/查询/模糊查询/按companyId查询--> <select id="needRepairLikeQuery_listPage" parameterType="page" resultType="pd"> SELECT cl.id AS id, cl.col_borrowerName AS colBorrowername, cl.col_borrowerIdcard AS colBorroweridcard, cl.qq AS qq, cl.phone AS phone, cc.com_name AS comName, ci.down_report_count AS downReportCount FROM com_customer_company_c_index AS ci INNER JOIN col_loan AS cl ON cl.id = ci.clid INNER JOIN com_company AS cc ON cl.col_company =cc.com_id <if test="pd.search != null and pd.search.length()>0"> WHERE cl.col_borrowerName LIKE '%${pd.search}%' OR cl.col_borrowerIdcard LIKE '%${pd.search}%' OR cl.phone LIKE '%${pd.search}%' </if> <if test="pd.companyId!=null and pd.companyId != '-1'"> AND cl.col_company = '${pd.companyId}' </if> AND cl.col_status = 0 ORDER BY cl.id DESC </select>
1/<if test="">中的多条件用and/or链接而非&&\||
2/有时候""是不等于null的,用String的.length()限制一下
0 0
- MyBatis动态SQL小tips
- mybatis小tips
- SQL 小tips
- 小TIPS:动态改变masterpage
- 小TIPS:动态改变masterpage
- Mybatis的sql动态查询小技巧(极客)
- mybatis动态SQL语句
- MyBatis动态SQL
- MyBatis 动态SQL
- Mybatis 动态SQL
- MyBatis动态SQL
- MyBatis动态SQL完整版
- mybatis动态sql
- mybatis动态SQL语句
- mybatis动态SQL语句
- MyBatis的动态SQL
- MyBatis动态SQL
- MyBatis动态SQL
- JS数组的属性以及方法
- android开发context介绍
- LNK2005:_wmemcmp 重复定义,及C4799:没有EMMS指令
- js动态添加表单form元素
- Java 多线程(六) synchronized关键字详解
- MyBatis动态SQL小tips
- leetcode(63).231. Power of Two
- 第12章:Continuous Latent Variables exercise 1-12
- 7 servlet的入门
- phpcms v9框架的目录结构分析
- centos 7 nodejs安装
- String,StringBuilder,StringBuffer
- LaTex常用特殊符号对应表
- 请求转发与重定向比较