大屏:闲置装备分析
This commit is contained in:
parent
8ce8e73ed3
commit
c7dde73e4f
|
|
@ -63,6 +63,9 @@ public class DevInfo extends BaseEntity {
|
|||
@ApiModelProperty(value = "设备数量")
|
||||
private Integer deviceCount;
|
||||
|
||||
@ApiModelProperty(value = "比例范围")
|
||||
private String ratioRange;
|
||||
|
||||
@ApiModelProperty(value = "单位")
|
||||
@NotBlank(message = "单位不能为空")
|
||||
private String unitName;
|
||||
|
|
@ -272,5 +275,4 @@ public class DevInfo extends BaseEntity {
|
|||
|
||||
@ApiModelProperty(value = "累计租赁天数")
|
||||
private Integer totalLeaseDay;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -211,5 +211,7 @@ public interface DevInfoMapper {
|
|||
int updateTotalDevUpDay();
|
||||
|
||||
int updateTotalDevLeaseDay();
|
||||
|
||||
List<DevInfo> getIdleDevRatio();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import com.bonus.common.biz.utils.MathUtil;
|
|||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.material.device.domain.DevInfo;
|
||||
import com.bonus.material.device.mapper.DevInfoMapper;
|
||||
import com.bonus.material.device.service.DevInfoService;
|
||||
import com.bonus.material.largeScreen.entity.OrderData;
|
||||
import com.bonus.material.largeScreen.entity.OrderDto;
|
||||
import com.bonus.material.lease.mapper.MaLeaseInfoMapper;
|
||||
|
|
@ -16,6 +17,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -29,6 +31,10 @@ import java.util.List;
|
|||
public class LargeScreenController {
|
||||
@Resource
|
||||
private OrderService orderService;
|
||||
|
||||
@Resource
|
||||
private DevInfoService devInfoService;
|
||||
|
||||
@Resource
|
||||
private OrderMapper orderMapper;
|
||||
|
||||
|
|
@ -38,6 +44,13 @@ public class LargeScreenController {
|
|||
@Resource
|
||||
private MaLeaseInfoMapper leaseInfoMapper;
|
||||
|
||||
@ApiOperation("闲置装备分析")
|
||||
@GetMapping("/getIdleDevRatio")
|
||||
public AjaxResult getIdleDevRatio() {
|
||||
List<DevInfo> list = devInfoMapper.getIdleDevRatio();
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("订单数据")
|
||||
@GetMapping("/orderData")
|
||||
|
|
|
|||
|
|
@ -975,4 +975,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
where is_active = '1' and ma_status = '3'
|
||||
</update>
|
||||
|
||||
<select id="getIdleDevRatio" resultType="com.bonus.material.device.domain.DevInfo">
|
||||
SELECT
|
||||
CASE
|
||||
WHEN a.ratio is null or a.ratio < 0.3 THEN '0%-30%'
|
||||
WHEN a.ratio >= 0.3 AND ratio <= 0.8 THEN '30%-80%'
|
||||
ELSE '80%-100%'
|
||||
END AS ratio_range,
|
||||
COUNT(*) AS device_count
|
||||
FROM
|
||||
(SELECT total_lease_day/NULLIF(total_up_day+total_lease_day, 0) as ratio FROM ma_dev_info) a
|
||||
GROUP BY
|
||||
ratio_range
|
||||
ORDER BY
|
||||
ratio_range
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue