分销修改

This commit is contained in:
张松
2025-10-28 14:03:40 +08:00
parent ea1c656034
commit 0b6a54b914
8 changed files with 27 additions and 15 deletions

View File

@@ -2,6 +2,9 @@ package com.czg.service.account.mapper;
import com.czg.account.entity.UserInfo;
import com.mybatisflex.core.BaseMapper;
import org.apache.ibatis.annotations.Update;
import java.math.BigDecimal;
/**
* 映射层。
@@ -11,4 +14,5 @@ import com.mybatisflex.core.BaseMapper;
*/
public interface UserInfoMapper extends BaseMapper<UserInfo> {
boolean updateAmount(long userId, BigDecimal amount);
}

View File

@@ -4,4 +4,8 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.czg.service.account.mapper.UserInfoMapper">
<update id="updateAmount">
update tb_user_info set distribution_amount = distribution_amount + #{amount} where id = #{id}
and distribution_amount + #{amount} >= 0
</update>
</mapper>