分销修改
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user