admin
2025-02-25 30d8e227e8d823b6c38c3b9c90ac2df03b63befe
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
package com.yeshi.fanli.service.impl.common;
 
import java.util.List;
 
import javax.annotation.Resource;
 
import com.yeshi.fanli.entity.SystemEnum;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
 
import com.yeshi.fanli.dao.mybatis.common.JumpDetailV2Mapper;
import com.yeshi.fanli.entity.common.JumpDetailV2;
import com.yeshi.fanli.service.inter.common.JumpDetailV2Service;
import com.yeshi.fanli.util.Constant;
 
@Service
public class JumpDetailV2ServiceImpl implements JumpDetailV2Service {
 
    @Resource
    private JumpDetailV2Mapper jumpDetailV2Mapper;
 
    @Override
    public int deleteByPrimaryKey(Long id) {
        return jumpDetailV2Mapper.deleteByPrimaryKey(id);
    }
 
    @Override
    public int insert(JumpDetailV2 record) {
        return jumpDetailV2Mapper.insert(record);
    }
 
    @Override
    public int insertSelective(JumpDetailV2 record) {
        return jumpDetailV2Mapper.insertSelective(record);
    }
 
    @Override
    public JumpDetailV2 selectByPrimaryKey(Long id) {
        return jumpDetailV2Mapper.selectByPrimaryKey(id);
    }
 
    @Override
    public int updateByPrimaryKeySelective(JumpDetailV2 record) {
        return jumpDetailV2Mapper.updateByPrimaryKeySelective(record);
    }
 
    @Override
    public int updateByPrimaryKey(JumpDetailV2 record) {
        return jumpDetailV2Mapper.updateByPrimaryKey(record);
    }
 
    @Override
    public List<JumpDetailV2> listByType(String type, SystemEnum system) {
        JumpDetailV2Mapper.DaoQuery daoQuery = new JumpDetailV2Mapper.DaoQuery();
        daoQuery.type = type;
        daoQuery.system = system;
        daoQuery.count = Integer.MAX_VALUE;
        return jumpDetailV2Mapper.list(daoQuery);
    }
 
    @Cacheable(value = "configCache", key = "'getByTypeCache-'+#type")
    @Override
    public JumpDetailV2 getByTypeCache(String type, SystemEnum system) {
 
        JumpDetailV2 jumpDetailV2 = null;
 
        List<JumpDetailV2> listByType = listByType(type, system);
 
        if (listByType != null && listByType.size() > 0) {
            jumpDetailV2 = listByType.get(0);
        } else {
            jumpDetailV2 = new JumpDetailV2();
        }
 
        return jumpDetailV2;
    }
 
    @Cacheable(value = "configCache", key = "'getByTypeCache-'+#type+'-'+#platform+'-'+#version")
    @Override
    public JumpDetailV2 getByTypeCache(String type, int platform, int version, SystemEnum system) {
        JumpDetailV2Mapper.DaoQuery daoQuery = new JumpDetailV2Mapper.DaoQuery();
        daoQuery.type = type;
        daoQuery.system = system;
        if (platform == 1) {
            daoQuery.maxAndroidVersion = version;
        } else {
            daoQuery.maxIOSVersion = version;
        }
        daoQuery.count = 1;
        List<JumpDetailV2> list = jumpDetailV2Mapper.list(daoQuery);
        if (list == null || list.size() == 0)
            return list.get(0);
        else
            return list.get(0);
    }
 
    @Override
    public List<JumpDetailV2> listJump(SystemEnum system) {
        JumpDetailV2Mapper.DaoQuery daoQuery = new JumpDetailV2Mapper.DaoQuery();
        daoQuery.count = Integer.MAX_VALUE;
        daoQuery.system = system;
        return jumpDetailV2Mapper.list(daoQuery);
    }
 
    @Override
    public int deleteBatchByPrimaryKey(List<Long> list) {
        return jumpDetailV2Mapper.deleteBatchByPrimaryKey(list);
    }
 
    @Override
    public List<JumpDetailV2> listQuery(long start, int count, String key, SystemEnum system) {
        JumpDetailV2Mapper.DaoQuery daoQuery = new JumpDetailV2Mapper.DaoQuery();
        daoQuery.key = key;
        daoQuery.start = start;
        daoQuery.count = count;
        daoQuery.system = system;
        return jumpDetailV2Mapper.list(daoQuery);
    }
 
    @Override
    public long countListQuery(String key, SystemEnum system) {
        JumpDetailV2Mapper.DaoQuery daoQuery = new JumpDetailV2Mapper.DaoQuery();
        daoQuery.key = key;
        daoQuery.system = system;
        return jumpDetailV2Mapper.count(daoQuery);
    }
 
}