mybatis-关于<update>的日常记录

!注意:,一定要有

<update id="updateByPrimaryKeySelective" parameterType="com.dhht.model.order.OrderInfo">
update order_info
<set>
<if test="sendOutStatus != null">
send_out_status = #{sendOutStatus,jdbcType=CHAR},
</if>
<if test="districtId != null">
district_id = #{districtId,jdbcType=CHAR},
</if>
<if test="isCancel != null">
is_cancel = #{isCancel,jdbcType=CHAR},
</if>
<if test="cancelTime != null">
cancel_time = #{cancelTime,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=CHAR}
</update>

猜你喜欢

转载自www.cnblogs.com/sung1024/p/11700542.html