标签:
最近在项目中遇到一个,需要根据传入的存有id的list,计算值,再起别名
<if test="channelList != null and channelList.size()>0"> <foreach collection="channelList" index="index" item="item" open="" separator="," close=""> SUM(CASE WHEN ccs.sub_type =#{item} AND ccs.type = 1 THEN ccs.num ELSE 0 END) AS ‘dispatchNum${item}‘ </foreach> </if>
标签:
原文地址:http://www.cnblogs.com/chn58/p/5630881.html