mybatis_批量修改(where id in())


 

<!--根据id数组批量修改  -->
    <update id="updateByIds" parameterType="com.mis.yxnz.entity.CalendarInfo">
        update calendar_info
        <set>
            <if test="name != null and name !=''">
                name = #{name,jdbcType=VARCHAR},
            </if>
            <if test="statuss != null and statuss !=''">
                statuss = #{statuss,jdbcType=VARCHAR},
            </if>
            <if test="remark != null and remark !=''">
                remark = #{remark,jdbcType=LONGVARCHAR},
            </if>
        </set>
        where id in
         <foreach collection="ids" index="index" item="item" open="(" separator="," close=")">
          #{item}
        </foreach>
    </update>
<!--dao层  -->
 int updateByIds(@Param("name") String name,@Param("statuss") String statuss ,@Param("remark") String remark,@Param("ids") String[] ids);

  详细链接:https://blog.csdn.net/u012427355/article/details/79580561


免责声明!

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



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