Mybatis foreach和if解决如果是某种角色,就有哪些的权限

193 阅读1分钟
List<TopicSummaryVo> selectRecommendTopicSummaryVos(@Param("userNmospRole") String userNmospRole, @Param("nmospPlateId") List<String> nmospPlateId, @Param("userBbsWeight") Integer userBbsWeight);
<if test="userNmospRole == 'claim_administrator' || userNmospRole == 'claim_normal'">
            <foreach collection="nmospPlateId" item="item" open="AND p.nmosp_plate_id IN (" separator="," close=")" >
                #{item}
            </foreach>
</if>