Mybatis批量更新出現BadSqlGrammarException異常解決

1.xml寫法 批量更新sql如下

   <update id="updateDemo">
        <foreach collection="demos" item="demo" open="" separator=";" close="" index="index">
            update demo
            <set>
                <if test="null != demo.name">name = #{demo.name},</if>
                <if test="null != demo.age">age= #{demo.age}</if>
          
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章