1
zj
2025-07-10 37670b2ff5379e8603d3b0eec6d493daf2d6cfcb
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
package com.nq.service.impl;
 
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.nq.common.ServerResponse;
import com.nq.dao.FundsTradingAccountMapper;
import com.nq.pojo.FundsTradingAccount;
import com.nq.service.IFundsTradingAccountService;
import org.springframework.stereotype.Service;
 
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
 
/**
 * 配资交易账户
 * @author lr
 * @date 2020/07/24
 */
@Service("IFundsTradingAccountService")
public class FundsTradingAccountServiceImpl implements IFundsTradingAccountService {
 
    @Resource
    private FundsTradingAccountMapper fundsTradingAccountMapper;
 
 
    @Override
    public int insert(FundsTradingAccount model) {
        int ret = 0;
        if (model == null) {
            return 0;
        }
        ret = fundsTradingAccountMapper.insert(model);
        return ret;
    }
 
    @Override
    public int update(FundsTradingAccount model) {
        int ret = fundsTradingAccountMapper.update(model);
        return ret>0 ? ret: 0;
    }
 
    /**
     * 配资交易账户-保存
     */
    @Override
    public ServerResponse save(FundsTradingAccount model) {
        int ret = 0;
        if(model!=null && model.getId()>0){
            ret = fundsTradingAccountMapper.update(model);
        } else{
            ret = fundsTradingAccountMapper.insert(model);
        }
        if(ret>0){
            return ServerResponse.createBySuccessMsg("操作成功");
        }
        return ServerResponse.createByErrorMsg("操作失败");
    }
 
    /*配资交易账户-查询列表*/
    @Override
    public ServerResponse<PageInfo> getList(int pageNum, int pageSize, String keyword, Integer status, HttpServletRequest request){
        PageHelper.startPage(pageNum, pageSize);
        List<FundsTradingAccount> listData = this.fundsTradingAccountMapper.pageList(pageNum, pageSize, keyword, status);
        PageInfo pageInfo = new PageInfo(listData);
        pageInfo.setList(listData);
        return ServerResponse.createBySuccess(pageInfo);
    }
 
    /*配资交易账户-查询详情*/
    @Override
    public ServerResponse getDetail(int id) {
        return ServerResponse.createBySuccess(this.fundsTradingAccountMapper.load(id));
    }
 
    /**
     * 配资交易账户-查询最新交易账户编号
     */
    @Override
    public ServerResponse getMaxNumber() {
        int ret = fundsTradingAccountMapper.getMaxNumber();
        return ServerResponse.createBySuccess(String.valueOf(ret));
    }
 
}