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

posted @ 2020-08-12 11:01  LQ_2017  阅读(1227)  评论(0编辑  收藏  举报