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