<!--根据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