https://blog.csdn.net/king007c/article/details/85276655
例:
<foreach collection="plantset_types" item="plant" separator="," open="'" close="'">
${plant.plant_id}
</foreach>
每個${plant.plant_id}獲取的值前後都會自動加空格,' 1 , 2 , 3',會導致判斷的值包含空格,無法正確匹配。
使用下面方法去除空格:
replace(<foreach collection="plantset_types" item="plant" separator="," open="'" close="'">
${plant.plant_id}
</foreach>,' ','')
使用SQL語句的replace方法,去掉所有的空格(缺點:去掉所有的空格)。
replace('字符串',' ','')