每月流量统计
This commit is contained in:
@@ -12,6 +12,8 @@ import lombok.NoArgsConstructor;
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
public class PqsParam extends DeviceInfoParam.BusinessParam {
|
public class PqsParam extends DeviceInfoParam.BusinessParam {
|
||||||
|
@ApiModelProperty("装置id")
|
||||||
|
private String devId;
|
||||||
@ApiModelProperty("当前页码")
|
@ApiModelProperty("当前页码")
|
||||||
private Integer pageNum;
|
private Integer pageNum;
|
||||||
@ApiModelProperty("当前页条数")
|
@ApiModelProperty("当前页条数")
|
||||||
|
|||||||
@@ -22,10 +22,7 @@ import lombok.RequiredArgsConstructor;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -118,6 +115,16 @@ public class OperationContrController extends BaseController {
|
|||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
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)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
|||||||
@@ -420,6 +420,8 @@ public interface LineMapper extends BaseMapper<Line> {
|
|||||||
|
|
||||||
List<LineFlowMealDetailVO> getDeviceRunStatistics(@Param("list") List<String> list, @Param("startTime") DateTime startTime, @Param("endTime") DateTime endTime);
|
List<LineFlowMealDetailVO> getDeviceRunStatistics(@Param("list") List<String> list, @Param("startTime") DateTime startTime, @Param("endTime") DateTime endTime);
|
||||||
|
|
||||||
Page<LineFlowMealDetailVO> getNewDeviceRunStatistics(Page<LineFlowMealDetailVO> page,@Param("devs") List<String> list, @Param("startTime") DateTime startTime, @Param("endTime") DateTime endTime);
|
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);
|
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 id="getRunManageDevList" resultType="com.njcn.device.pq.pojo.vo.RunTimeVO">
|
||||||
SELECT
|
SELECT
|
||||||
dev.Id as id,
|
dev.Id AS id,
|
||||||
area.NAME AS areaName,
|
area.NAME AS areaName,
|
||||||
gd.NAME AS gdName,
|
gd.NAME AS gdName,
|
||||||
sub.NAME AS bdName,
|
sub.NAME AS bdName,
|
||||||
@@ -170,7 +170,7 @@
|
|||||||
#{item2}
|
#{item2}
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
<if test="manufacturers.size()!=0">
|
<if test="manufacturers.size() != 0">
|
||||||
and device.Manufacturer in
|
and device.Manufacturer in
|
||||||
<foreach collection="manufacturers" item="item3" separator="," open="(" close=")">
|
<foreach collection="manufacturers" item="item3" separator="," open="(" close=")">
|
||||||
#{item3}
|
#{item3}
|
||||||
|
|||||||
@@ -1053,5 +1053,23 @@
|
|||||||
and d.com_flag = #{comFlag}
|
and d.com_flag = #{comFlag}
|
||||||
and a.state = 1
|
and a.state = 1
|
||||||
</select>
|
</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>
|
</mapper>
|
||||||
|
|||||||
@@ -208,4 +208,6 @@ public interface LineService {
|
|||||||
Page<TopMsgPO> dailyDeviceAbnormalStatistics(PqsParam param);
|
Page<TopMsgPO> dailyDeviceAbnormalStatistics(PqsParam param);
|
||||||
|
|
||||||
List<TopMsgPO> dailyDeviceAbnormal(DeviceInfoParam.BusinessParam conditionBusinessParam);
|
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;
|
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
|
@Override
|
||||||
public List<LineFlowMealDetailVO> getDeviceRunStatistics(DeviceInfoParam.BusinessParam deviceInfoParam) {
|
public List<LineFlowMealDetailVO> getDeviceRunStatistics(DeviceInfoParam.BusinessParam deviceInfoParam) {
|
||||||
ArrayList<LineFlowMealDetailVO> lineFlowMealDetailList = new ArrayList<>();
|
ArrayList<LineFlowMealDetailVO> lineFlowMealDetailList = new ArrayList<>();
|
||||||
|
|||||||
Reference in New Issue
Block a user