判断数组的长度ids.length
<if test="ids!= null and ids.length>0 and tag==1">
AND id in
<foreach collection="codes" item="code" separator="," open="(" close=")" index="index">
#{id}
</foreach>
</if>
判断数组的长度ids.length
<if test="ids!= null and ids.length>0 and tag==1">
AND id in
<foreach collection="codes" item="code" separator="," open="(" close=")" index="index">
#{id}
</foreach>
</if>