如果更新前后一致那就说明没有更新 所以更新查询条件一定不能和更新内容一样 将 身高为2米的(原来就有的条件)更新为 身高为2米的等于没变.没有意义 <update id="updateForEnterWave" parameterType="map"> update send_order <set> <if test="orderStatus!=null"> order_status = #{orderStatus}, </if> <if test="BCcode!=null"> wave_code = #{BCcode}, </if> <if test="pkWave!=null"> pk_wave = #{pkWave}, </if> <if test="handoverCode!=null"> handover_code=#{handoverCode}, </if> <if test="elecWeight!=null"> nfee_weit = #{elecWeight}, </if> <if test="orderStatus!=null"> order_status = #{orderStatus}, </if> <if test="itemCount!=null"> item_count = #{itemCount}, </if> </set> <where> <!-- 生成波次--> <if test="sendOrders!=null"> and pk_send_order in <foreach collection="sendOrders" separator="," item="val" open="(" close=")"> #{val} </foreach> </if> <if test="unorderStatus !=null"> and order_status != #{unorderStatus} </if> </where> </update>
mybaties 根据条件来进行更新的时候 条件一定不能和更新的一样.因为条件是指更新前的.set是更新后的
最新推荐文章于 2023-06-17 11:10:59 发布