统计订单数,按角色
This commit is contained in:
parent
b958763adf
commit
ea37a7df12
|
|
@ -147,4 +147,13 @@ public class OrderDetailDto {
|
|||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
private String reliefEndTime;
|
||||
|
||||
@ApiModelProperty(value = "true:出租方 false:承租方")
|
||||
private boolean flag;
|
||||
|
||||
@ApiModelProperty(value = "买方承租方公司id")
|
||||
private Integer buyerCompany;
|
||||
|
||||
@ApiModelProperty(value = "卖方出租方公司id")
|
||||
private Integer sellerCompany;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -217,6 +217,12 @@ public class OrderServiceImpl implements OrderService {
|
|||
|
||||
@Override
|
||||
public List<OrderInfoDto> getOrderStatusCount(OrderDetailDto dto) throws Exception {
|
||||
//true:出租方 false:承租方
|
||||
if (dto.isFlag()) {
|
||||
dto.setSellerCompany(SecurityUtils.getLoginUser().getSysUser().getCompanyId().intValue());
|
||||
} else {
|
||||
dto.setBuyerCompany(SecurityUtils.getLoginUser().getSysUser().getCompanyId().intValue());
|
||||
}
|
||||
List<OrderInfoDto> orderInfoDto = orderMapper.getOrderStatusCount(dto);
|
||||
return orderInfoDto;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -320,10 +320,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
select a.order_status as orderStatus, count(a.order_status) as orderCount from
|
||||
(
|
||||
SELECT
|
||||
order_id,
|
||||
min(order_status) as order_status
|
||||
mods.order_id,
|
||||
min(mods.order_status) as order_status
|
||||
FROM
|
||||
ma_order_details
|
||||
ma_order_details mods
|
||||
LEFT JOIN ma_order_info moi ON mods.order_id = moi.order_id
|
||||
LEFT JOIN ma_dev_info mdi ON mods.ma_id = mdi.ma_id
|
||||
WHERE
|
||||
1=1
|
||||
<if test="buyerCompany != null">
|
||||
AND moi.buyer_company = #{buyerCompany}
|
||||
</if>
|
||||
<if test="sellerCompany != null">
|
||||
AND mdi.own_co = #{sellerCompany}
|
||||
</if>
|
||||
GROUP BY order_id
|
||||
) a
|
||||
group by a.order_status
|
||||
|
|
|
|||
Loading…
Reference in New Issue