mybatis中if标签的test多判断怎么写

m0_37746602 2017-10-16 11:08:38
<if test="(acquiTime == null or acquiTime =='') and (plateNum == null or plateNum =='') and highspCode != null and highspCode !='' or highspCode !='000') and (chargeCode == null or chargeCode =='' or chargeCode =='000')">
AND datediff(now(),T1.ACQUI_TIME)=6
</if>


各位大神给看看,怎么写才对,这是我写的,运行报错
...全文
6020 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
吉吉g王 2017-10-16
  • 打赏
  • 举报
回复
highspCode !='' or highspCode !='000') 左边的括号没有
张悟空o 2017-10-16
  • 打赏
  • 举报
回复
<if test="(acquiTime == null or acquiTime =='') and (plateNum == null or plateNum =='') and highspCode != null and (highspCode !='' or highspCode !='000') and (chargeCode == null or chargeCode =='' or chargeCode =='000')"> AND datediff(now(),T1.ACQUI_TIME)=6 </if> 少了个括号吧
qq_39912309 2017-10-16
  • 打赏
  • 举报
回复
<if test="createUid != null and createUid != ''"> AND create_uid = #{createUid} </if> <if test="createCompanyCode != null and createCompanyCode != ''"> AND create_company_code = #{createCompanyCode} </if> <if test="state !=null and state !=''"> AND state = #{state} </if>类似这样

67,513

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧