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>

posted @ 2019-10-18 20:23  qing222  阅读(414)  评论(0编辑  收藏  举报