装备上架按类型统计
This commit is contained in:
parent
2a15873c62
commit
cdb8193a75
|
|
@ -198,6 +198,8 @@ public interface DevInfoMapper {
|
|||
|
||||
Integer getDevUpNum();
|
||||
|
||||
List<DevInfo> getDevUpCountByType();
|
||||
|
||||
Integer getDevLeasingNum();
|
||||
|
||||
Integer getDevTypeNum();
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:liang.chao
|
||||
|
|
@ -75,11 +76,13 @@ public class LargeScreenController {
|
|||
public AjaxResult devCount() {
|
||||
Integer devNum = devInfoMapper.getDevNum();
|
||||
Integer devUpNum = devInfoMapper.getDevUpNum();
|
||||
List<DevInfo> devInfos = devInfoMapper.getDevUpCountByType();
|
||||
Integer devTypeNum = devInfoMapper.getDevTypeNum();
|
||||
Integer devQcWarningNum = devInfoMapper.getDevQcWarningNum();
|
||||
OrderData orderData = new OrderData();
|
||||
orderData.setDevNum(devNum);
|
||||
orderData.setDevUpNum(devUpNum);
|
||||
orderData.setDevInfos(devInfos);
|
||||
orderData.setDevTypeNum(devTypeNum);
|
||||
orderData.setDevQcWaningNum(devQcWarningNum);
|
||||
return AjaxResult.success(orderData);
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
package com.bonus.material.largeScreen.entity;
|
||||
|
||||
import com.bonus.material.device.domain.DevInfo;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:liang.chao
|
||||
|
|
@ -67,4 +69,7 @@ public class OrderData {
|
|||
|
||||
@ApiModelProperty(value = "最需装备")
|
||||
private String topPopularTypeName;
|
||||
|
||||
@ApiModelProperty(value = "装备统计列表")
|
||||
private List<DevInfo> devInfos;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -909,6 +909,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
AND ma_status = '2'
|
||||
</select>
|
||||
|
||||
<select id="getDevUpCountByType" resultType="com.bonus.material.device.domain.DevInfo">
|
||||
select b.type_name as typeName, sum(count) as deviceCount from
|
||||
(
|
||||
select mt3.type_name, a.count from (
|
||||
SELECT type_id, count(1) as count FROM ma_dev_info
|
||||
where is_active='1' and ma_status='2'
|
||||
group by type_id
|
||||
order by count(type_id) desc
|
||||
) a
|
||||
left join ma_type mt4 on mt4.type_id = a.type_id
|
||||
left join ma_type mt3 on mt3.type_id = mt4.parent_id
|
||||
) b
|
||||
group by type_name
|
||||
order by sum(count) desc
|
||||
</select>
|
||||
|
||||
<select id="getDevLeasingNum" resultType="java.lang.Integer">
|
||||
SELECT
|
||||
COUNT(1)
|
||||
|
|
|
|||
Loading…
Reference in New Issue