| | |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.yeshi.fanli.entity.SystemEnum; |
| | | import org.springframework.cache.annotation.Cacheable; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | @Service |
| | | public class JumpDetailV2ServiceImpl implements JumpDetailV2Service { |
| | | |
| | | @Resource |
| | | private JumpDetailV2Mapper jumpDetailV2Mapper; |
| | | @Resource |
| | | private JumpDetailV2Mapper jumpDetailV2Mapper; |
| | | |
| | | @Override |
| | | public int deleteByPrimaryKey(Long id) { |
| | | return jumpDetailV2Mapper.deleteByPrimaryKey(id); |
| | | } |
| | | @Override |
| | | public int deleteByPrimaryKey(Long id) { |
| | | return jumpDetailV2Mapper.deleteByPrimaryKey(id); |
| | | } |
| | | |
| | | @Override |
| | | public int insert(JumpDetailV2 record) { |
| | | return jumpDetailV2Mapper.insert(record); |
| | | } |
| | | @Override |
| | | public int insert(JumpDetailV2 record) { |
| | | return jumpDetailV2Mapper.insert(record); |
| | | } |
| | | |
| | | @Override |
| | | public int insertSelective(JumpDetailV2 record) { |
| | | return jumpDetailV2Mapper.insertSelective(record); |
| | | } |
| | | @Override |
| | | public int insertSelective(JumpDetailV2 record) { |
| | | return jumpDetailV2Mapper.insertSelective(record); |
| | | } |
| | | |
| | | @Override |
| | | public JumpDetailV2 selectByPrimaryKey(Long id) { |
| | | return jumpDetailV2Mapper.selectByPrimaryKey(id); |
| | | } |
| | | @Override |
| | | public JumpDetailV2 selectByPrimaryKey(Long id) { |
| | | return jumpDetailV2Mapper.selectByPrimaryKey(id); |
| | | } |
| | | |
| | | @Override |
| | | public int updateByPrimaryKeySelective(JumpDetailV2 record) { |
| | | return jumpDetailV2Mapper.updateByPrimaryKeySelective(record); |
| | | } |
| | | @Override |
| | | public int updateByPrimaryKeySelective(JumpDetailV2 record) { |
| | | return jumpDetailV2Mapper.updateByPrimaryKeySelective(record); |
| | | } |
| | | |
| | | @Override |
| | | public int updateByPrimaryKey(JumpDetailV2 record) { |
| | | return jumpDetailV2Mapper.updateByPrimaryKey(record); |
| | | } |
| | | @Override |
| | | public int updateByPrimaryKey(JumpDetailV2 record) { |
| | | return jumpDetailV2Mapper.updateByPrimaryKey(record); |
| | | } |
| | | |
| | | @Override |
| | | public List<JumpDetailV2> listByType(String type) { |
| | | return jumpDetailV2Mapper.listByType(type); |
| | | } |
| | | @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) { |
| | | @Cacheable(value = "configCache", key = "'getByTypeCache-'+#type") |
| | | @Override |
| | | public JumpDetailV2 getByTypeCache(String type, SystemEnum system) { |
| | | |
| | | JumpDetailV2 jumpDetailV2 = null; |
| | | JumpDetailV2 jumpDetailV2 = null; |
| | | |
| | | List<JumpDetailV2> listByType = listByType(type); |
| | | List<JumpDetailV2> listByType = listByType(type, system); |
| | | |
| | | if (listByType != null && listByType.size() > 0) { |
| | | jumpDetailV2 = listByType.get(0); |
| | | } else { |
| | | jumpDetailV2 = new JumpDetailV2(); |
| | | } |
| | | if (listByType != null && listByType.size() > 0) { |
| | | jumpDetailV2 = listByType.get(0); |
| | | } else { |
| | | jumpDetailV2 = new JumpDetailV2(); |
| | | } |
| | | |
| | | return jumpDetailV2; |
| | | } |
| | | return jumpDetailV2; |
| | | } |
| | | |
| | | @Cacheable(value = "configCache", key = "'getByTypeCache-'+#type+'-'+#platform+'-'+#version") |
| | | @Override |
| | | public JumpDetailV2 getByTypeCache(String type, int platform, int version) { |
| | | if (platform == 1) { |
| | | return jumpDetailV2Mapper.selectAndroidByTypeAndVersion(type, version); |
| | | } else { |
| | | return jumpDetailV2Mapper.selectIOSByTypeAndVersion(type, version); |
| | | } |
| | | } |
| | | @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() { |
| | | return jumpDetailV2Mapper.listJump(); |
| | | } |
| | | @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 int deleteBatchByPrimaryKey(List<Long> list) { |
| | | return jumpDetailV2Mapper.deleteBatchByPrimaryKey(list); |
| | | } |
| | | |
| | | @Override |
| | | public List<JumpDetailV2> listQuery(long start, int count, String key) { |
| | | return jumpDetailV2Mapper.listQuery(start, count, key); |
| | | } |
| | | @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) { |
| | | return jumpDetailV2Mapper.countListQuery(key); |
| | | } |
| | | @Override |
| | | public long countListQuery(String key, SystemEnum system) { |
| | | JumpDetailV2Mapper.DaoQuery daoQuery = new JumpDetailV2Mapper.DaoQuery(); |
| | | daoQuery.key = key; |
| | | daoQuery.system = system; |
| | | return jumpDetailV2Mapper.count(daoQuery); |
| | | } |
| | | |
| | | } |