minidao中的FreeMarke

2018-08-31 19:13:22
minidao 中使用FreeMarker


where 1=1 
<#if  roleCode =="HO"> and t.roleCode like '%HO%'</#if>
<#if vo.userName ?exists  && vo.userName ?length gt 0> AND t.USERNAME like '%' ||:vo.userName|| '%' </#if>
<#if vo.realName ?exists  && vo.realName ?length gt 0> AND t.REALNAME like '%' ||:vo.realName || '%' </#if>


 select  count(1)  from  ORDER  where   OTHERID='${itemId}' and  DETAIL_ID='${id}'

 

 不可以用 ':vo.userName' ,它是字符串 可以 '${id}'  最好使用 :vo.userName

 

freemarker 中文?号 会出现如下错误
Lexical error: encountered "\uff1f" (65311), after "".
freemarker.core.ParseException: Syntax error in template "sql_-1231282527" in line 50, column 53:
Lexical error: encountered "\uff1f" (65311), after "".

 

java util data 
<#if (vo.datab?date)?exists>
    AND  to_char( m.datab ,'YYYY-MM-DD')= '${vo.datab?string["yyyy-MM-dd"]}'
</#if>
<#if (vo.datbi?date)?exists>
    AND  to_char( m.datbi ,'YYYY-MM-DD')='${vo.datbi?string["yyyy-MM-dd"]}'
</#if>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值