首页 > 其他 > 详细

freemarker在xml文件中遍历list数据

时间:2016-11-10 19:41:55      阅读:786      评论:0      收藏:0      [点我收藏+]

delete
   from pub_channelpackage
   where channelcode = :channelcode
   and channeltype = :channeltype
   <#if packids?exists && packids??>
    and packid in (
          <#list packids as packageId>
     ${packageId}<#if packageId_has_next>,</#if>
    </#list>)
   </#if>

1.<#if packids?exists && packids??>:表示存在packids对象,并且对象的个数不为0;

2.<#list packids as packageId>:表示list中的成员变量为packageId;

3.<#if packageId_has_next>,</#if>:表示如果循环结束,则不加",".如果不加后面有会多一个",".

 

freemarker在xml文件中遍历list数据

原文:http://www.cnblogs.com/nizuimeiabc1/p/6051711.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!