admin
2019-11-25 e65037e672ecab852e2a6c5b242cdadfd1a58b33
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
package com.yeshi.fanli.dao.mybatis.redpack;
 
import java.math.BigDecimal;
import java.util.List;
 
import org.apache.ibatis.annotations.Param;
 
import com.yeshi.fanli.dao.BaseMapper;
import com.yeshi.fanli.entity.redpack.RedPackBalance;
import com.yeshi.fanli.vo.redpack.RedPackBalanceVO;
 
public interface RedPackBalanceMapper extends BaseMapper<RedPackBalance> {
    
    /**
     *    减掉用户红包金额
     * @param id
     * @param money
     */
    void subRedPack(@Param("id") long id, @Param("money") BigDecimal money);
 
    
    /**
     *   增加用户红包金额
     * @param id
     * @param money
     */
    void addRedPack(@Param("id") long id, @Param("money") BigDecimal money);
 
    
    /**
     * 查询用于更新余额-锁定
     * @param id
     * @return
     */
    RedPackBalance selectForUpdate(long id);
    
    /**
     * 商品列表查询
     * 
     * @param key
     * @param state
     * @param start
     * @param count
     * @return
     */
    List<RedPackBalanceVO> query(@Param("start") long start,@Param("count") int count, @Param("key") String key,
            @Param("state") Integer state, @Param("order") Integer order);
 
    /**
     * 商品计数
     * 
     * @param key
     * @param state
     * @return
     */
    long count(@Param("key") String key, @Param("state") Integer state);
    
    
    /**
     * 重置红包
     * @param id
     * @return
     */
    void resetRedPack(long id);
}