Freemarker: Removing values from list when they are missing from another table

核能气质少年 提交于 2019-12-24 19:23:25

问题


In field in a table I have a comma separated list of order IDs that I am splitting like this:

<#list alerts.AD_ID_LIST1?split(r'\s*,\s*', 'r') as idString>

What I need to do now is cross-reference each ID with another table to see if it exists in that table and that the ORDER_STATUS field does not have a value of deleted.

Then I need to output the new list of IDs with the missing and deleted order IDs removed so that I can loop through them based on their index. Can anyone give me an idea how to do this ? I was thinking a Macro or a function would be a good way to go but I'm not sure the best approach.

This is the code that executes afterward:

<#if idString_index % 2 == 0 && idString_has_next == false>

<!-- INCLUDE SINGLE CODE -->

<#elseif idString_index % 2 == 0 && idString_has_next == true>

<!-- Include LEFT SIDE CODE -->

<#else>

<!-- INCLUDE RIGHT SIDE CODE -->

</#if>

来源:https://stackoverflow.com/questions/46051640/freemarker-removing-values-from-list-when-they-are-missing-from-another-table

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!