mybatis批量修改数据


xxxMapper.xml:

<update id="updateSensorWarnings" parameterType="java.util.List" >
    <foreach collection="list" item="item" index="index" open="" close="" separator=";">
        update sensor_warning
        <set >
            <if test="item.handlePerson != null and item.handlePerson != ''  " >
                handle_person = #{item.handlePerson},
            </if>
            <if test="item.processProgress != null and item.processProgress != ''  " >
                process_progress = #{item.processProgress}
            </if>
        </set>
        where id = #{item.id}
    </foreach>
</update>

示例代码:


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM