|
@@ -1,8 +1,10 @@
|
|
|
package com.game.business.service.impl;
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import java.util.List;
|
|
|
import com.game.common.utils.DateUtils;
|
|
|
+import com.game.common.utils.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import com.game.business.mapper.AppUserAgentMapper;
|
|
@@ -29,7 +31,6 @@ public class AppUserAgentServiceImpl extends ServiceImpl<AppUserAgentMapper, App
|
|
|
* @return 用户代理表
|
|
|
*/
|
|
|
@Override
|
|
|
- @DataSource(DataSourceType.SLAVE)
|
|
|
public AppUserAgent selectAppUserAgentById(Long id) {
|
|
|
return appUserAgentMapper.selectAppUserAgentById(id);
|
|
|
}
|
|
@@ -41,7 +42,6 @@ public class AppUserAgentServiceImpl extends ServiceImpl<AppUserAgentMapper, App
|
|
|
* @return 用户代理表
|
|
|
*/
|
|
|
@Override
|
|
|
- @DataSource(DataSourceType.SLAVE)
|
|
|
public List<AppUserAgent> selectAppUserAgentList(AppUserAgent appUserAgent) {
|
|
|
return appUserAgentMapper.selectAppUserAgentList(appUserAgent);
|
|
|
}
|
|
@@ -53,7 +53,6 @@ public class AppUserAgentServiceImpl extends ServiceImpl<AppUserAgentMapper, App
|
|
|
* @return 结果
|
|
|
*/
|
|
|
@Override
|
|
|
- @DataSource(DataSourceType.SLAVE)
|
|
|
public int insertAppUserAgent(AppUserAgent appUserAgent) {
|
|
|
appUserAgent.setCreateTime(DateUtils.getNowDate());
|
|
|
return appUserAgentMapper.insertAppUserAgent(appUserAgent);
|
|
@@ -66,7 +65,6 @@ public class AppUserAgentServiceImpl extends ServiceImpl<AppUserAgentMapper, App
|
|
|
* @return 结果
|
|
|
*/
|
|
|
@Override
|
|
|
- @DataSource(DataSourceType.SLAVE)
|
|
|
public int updateAppUserAgent(AppUserAgent appUserAgent) {
|
|
|
appUserAgent.setUpdateTime(DateUtils.getNowDate());
|
|
|
return appUserAgentMapper.updateAppUserAgent(appUserAgent);
|
|
@@ -79,7 +77,6 @@ public class AppUserAgentServiceImpl extends ServiceImpl<AppUserAgentMapper, App
|
|
|
* @return 结果
|
|
|
*/
|
|
|
@Override
|
|
|
- @DataSource(DataSourceType.SLAVE)
|
|
|
public int deleteAppUserAgentByIds(Long[] ids) {
|
|
|
return appUserAgentMapper.deleteAppUserAgentByIds(ids);
|
|
|
}
|
|
@@ -91,8 +88,24 @@ public class AppUserAgentServiceImpl extends ServiceImpl<AppUserAgentMapper, App
|
|
|
* @return 结果
|
|
|
*/
|
|
|
@Override
|
|
|
- @DataSource(DataSourceType.SLAVE)
|
|
|
public int deleteAppUserAgentById(Long id) {
|
|
|
return appUserAgentMapper.deleteAppUserAgentById(id);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 统计用户代理人数
|
|
|
+ * */
|
|
|
+ @Override
|
|
|
+ public int countAgent(Long userId, String beginTime, String endTime) {
|
|
|
+ LambdaQueryWrapper<AppUserAgent> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper.eq(AppUserAgent::getPid,userId);
|
|
|
+ if(StringUtils.isNotBlank(beginTime)){
|
|
|
+ queryWrapper.ge(AppUserAgent::getCreateTime,beginTime);
|
|
|
+ }
|
|
|
+ if(StringUtils.isNotBlank(endTime)){
|
|
|
+ queryWrapper.le(AppUserAgent::getCreateTime,endTime);
|
|
|
+ }
|
|
|
+ queryWrapper.eq(AppUserAgent::getAuditStatus,"1");
|
|
|
+ return appUserAgentMapper.selectCount(queryWrapper).intValue();
|
|
|
+ }
|
|
|
}
|