分销日志
This commit is contained in:
@@ -14,5 +14,5 @@ import java.math.BigDecimal;
|
||||
*/
|
||||
public interface UserInfoMapper extends BaseMapper<UserInfo> {
|
||||
|
||||
int updateAmount(long userId, BigDecimal amount);
|
||||
int updateAmount(long userId, BigDecimal amount, Integer isOne);
|
||||
}
|
||||
|
||||
@@ -101,8 +101,8 @@ public class UserInfoServiceImpl extends ServiceImpl<UserInfoMapper, UserInfo> i
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateDistributionAmount(long userId, BigDecimal amount) {
|
||||
int b = mapper.updateAmount(userId, amount);
|
||||
public void updateDistributionAmount(long userId, BigDecimal amount, Integer isOne) {
|
||||
int b = mapper.updateAmount(userId, amount, isOne);
|
||||
if (b <= 0) {
|
||||
throw new CzgException("更新分销金额失败");
|
||||
}
|
||||
|
||||
@@ -6,6 +6,12 @@
|
||||
|
||||
<update id="updateAmount">
|
||||
update tb_user_info set distribution_amount = distribution_amount + #{amount} where id = #{userId}
|
||||
<if test="isOne != null and isOne == 1">
|
||||
,one_income = one_income + #{amount}
|
||||
</if>
|
||||
<if test="isOne != null and isOne == 2">
|
||||
,two_income = two_income + #{amount}
|
||||
</if>
|
||||
and distribution_amount + #{amount} >= 0
|
||||
</update>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user