Mybatis中如何判断集合的 size 不为空?

已解决

Mybatis中如何判断集合的 size 不为空?

展开
收起
游客gaiketk6mpmke 2022-04-01 17:32:27 684 分享 版权
1 条回答
写回答
取消 提交回答
  • 推荐回答

    使用foreach标签,挨个查询

    <if test="null != staffCodeList and staffCodeList.size > 0">
    and gui.USER_CODE not in
        <foreach collection="staffCodeList" item="staffCode" open="(" separator=","  close=")">
        #{staffCode}
        </foreach>
    </if>
    
    2022-04-01 19:34:47
    赞同 展开评论
问答分类:
问答标签:
问答地址: