sql问题

This commit is contained in:
2025-12-26 16:18:17 +08:00
parent 71ffdede19
commit 9e946443ec

View File

@@ -5,16 +5,24 @@
<mapper namespace="com.czg.service.market.mapper.MkDistributionUserMapper">
<update id="updateIncome">
update mk_distribution_user
set
<set>
<if test="pendingIncome != null">
total_income = total_income + #{pendingIncome},
</if>
<if test="receivedIncome != null">
total_income = total_income + #{receivedIncome},
</if>
pending_income = pending_income + #{pendingIncome},
received_income = received_income + #{receivedIncome},
withdrawn_income = withdrawn_income + #{withdrawIncome}
<if test="pendingIncome != null">
pending_income = pending_income + #{pendingIncome},
</if>
<if test="receivedIncome != null">
received_income = received_income + #{receivedIncome},
</if>
<if test="withdrawIncome != null">
withdrawn_income = withdrawn_income + #{withdrawIncome}
</if>
</set>
where id = #{id} and shop_id = #{shopId}
</update>