|
@@ -2,6 +2,7 @@ package com.fjhx.mes.service.report.impl;
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
+import com.alibaba.fastjson2.JSONObject;
|
|
|
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
@@ -147,4 +148,16 @@ public class ReportLossesDetailsServiceImpl extends ServiceImpl<ReportLossesDeta
|
|
|
this.removeById(id);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public JSONObject lossesStatistics(ReportLossesDetailsSelectDto dto) {
|
|
|
+ IWrapper<Object> wrapper = IWrapper.getWrapper();
|
|
|
+ //近n天过滤
|
|
|
+ Integer pastDay = dto.getPastDay();
|
|
|
+ if (ObjectUtil.isNotEmpty(pastDay)) {
|
|
|
+ wrapper.ge("DATEDIFF(NOW(),rld.repo_time)", 0);
|
|
|
+ wrapper.le("DATEDIFF(NOW(),rld.repo_time)", pastDay);
|
|
|
+ }
|
|
|
+ return baseMapper.lossesStatistics(wrapper);
|
|
|
+ }
|
|
|
+
|
|
|
}
|