DECODE(條件,foreach的值(與條件進行判斷),輸出的內容(當值與條件爲true,則返回內容))
tip:(Mapper.xml中select內的代碼)
…..(省略其他sql代碼)
<foreach collection="list" item="value" index="tmp" open="" close="" separator=",">
<![CDATA[
MAX(DECODE(A.sign, #{value}, A.code)) AS code#{tmp+1}
……(省略相同代碼)
]]
</foreach>
…..(省略其他sql代碼)