每月流量统计
This commit is contained in:
@@ -12,6 +12,8 @@ import lombok.NoArgsConstructor;
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class PqsParam extends DeviceInfoParam.BusinessParam {
|
||||
@ApiModelProperty("装置id")
|
||||
private String devId;
|
||||
@ApiModelProperty("当前页码")
|
||||
private Integer pageNum;
|
||||
@ApiModelProperty("当前页条数")
|
||||
|
||||
@@ -22,10 +22,7 @@ import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -118,6 +115,16 @@ public class OperationContrController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getMonthFlow")
|
||||
@ApiOperation("获取每月流量")
|
||||
@ApiImplicitParam(name = "deviceInfoParam", value = "实体", required = true)
|
||||
public HttpResult<List<LineFlowMealDetailVO>> getMonthFlow (@RequestBody PqsParam deviceInfoParam){
|
||||
String methodDescribe = getMethodDescribe("getMonthFlow");
|
||||
LogUtil.njcnDebug(log, "{},参数集合:{}", methodDescribe, deviceInfoParam);
|
||||
List<LineFlowMealDetailVO> result = lineService.getMonthFlow(deviceInfoParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
|
||||
@@ -422,4 +422,6 @@ public interface LineMapper extends BaseMapper<Line> {
|
||||
|
||||
Page<LineFlowMealDetailVO> getNewDeviceRunStatistics (Page<LineFlowMealDetailVO> page,@Param("devs") List<String> list, @Param("startTime") DateTime startTime, @Param("endTime") DateTime endTime);
|
||||
Page<LineFlowMealDetailVO> getNewDeviceFlowStatistics (Page<LineFlowMealDetailVO> page,@Param("devs") List<String> list, @Param("startTime") DateTime startTime, @Param("endTime") DateTime endTime);
|
||||
|
||||
List<LineFlowMealDetailVO> getMonthFlow (@Param("devId") String devId,@Param("startTime") DateTime beginOfDay, @Param("endTime") DateTime endOfDay);
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@
|
||||
|
||||
<select id="getRunManageDevList" resultType="com.njcn.device.pq.pojo.vo.RunTimeVO">
|
||||
SELECT
|
||||
dev.Id as id,
|
||||
dev.Id AS id,
|
||||
area.NAME AS areaName,
|
||||
gd.NAME AS gdName,
|
||||
sub.NAME AS bdName,
|
||||
|
||||
@@ -1053,5 +1053,23 @@
|
||||
and d.com_flag = #{comFlag}
|
||||
and a.state = 1
|
||||
</select>
|
||||
<select id="getMonthFlow" resultType="com.njcn.device.pq.pojo.vo.LineFlowMealDetailVO">
|
||||
select t.*,
|
||||
(t.statisValue)/(t.flowMeal) flowProportion
|
||||
from (
|
||||
SELECT
|
||||
m.Dev_Id,
|
||||
ifnull(d.flow, (select flow from cld_flow_meal where type = 0 and flag = 1)) + ifnull(d1.flow, 0) flowMeal,
|
||||
ifnull(m.Actual_Value,0)/1024/1024 statisValue
|
||||
FROM cld_month_flow m
|
||||
LEFT JOIN cld_dev_meal c ON m.Dev_Id = c.line_id
|
||||
LEFT JOIN cld_flow_meal d ON c.Base_Meal_Id = d.id
|
||||
LEFT JOIN cld_flow_meal d1 ON c.Ream_Meal_Id = d1.id
|
||||
where m.Dev_Id = #{devId}
|
||||
and
|
||||
m.Time_Id between #{startTime} and #{endTime}
|
||||
) t
|
||||
ORDER BY flowProportion DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -208,4 +208,6 @@ public interface LineService {
|
||||
Page<TopMsgPO> dailyDeviceAbnormalStatistics(PqsParam param);
|
||||
|
||||
List<TopMsgPO> dailyDeviceAbnormal(DeviceInfoParam.BusinessParam conditionBusinessParam);
|
||||
|
||||
List<LineFlowMealDetailVO> getMonthFlow (PqsParam deviceInfoParam);
|
||||
}
|
||||
|
||||
@@ -403,6 +403,12 @@ public class LineServiceImpl extends ServiceImpl<LineMapper, Line> implements Li
|
||||
return topMsgDetails;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<LineFlowMealDetailVO> getMonthFlow(PqsParam deviceInfoParam) {
|
||||
List<LineFlowMealDetailVO> list = lineMapper.getMonthFlow(deviceInfoParam.getDevId(),DateUtil.beginOfDay(DateUtil.parse(deviceInfoParam.getSearchBeginTime())),DateUtil.endOfDay(DateUtil.parse(deviceInfoParam.getSearchEndTime())));
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<LineFlowMealDetailVO> getDeviceRunStatistics(DeviceInfoParam.BusinessParam deviceInfoParam) {
|
||||
ArrayList<LineFlowMealDetailVO> lineFlowMealDetailList = new ArrayList<>();
|
||||
|
||||
Reference in New Issue
Block a user