mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-14 05:42:06 +08:00
新增部件打印查询接口
This commit is contained in:
+94
@@ -0,0 +1,94 @@
|
|||||||
|
package com.cf.imes.module.executor.controller.admin.order.vo.order;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @author Gqr
|
||||||
|
* @since 2026/5/11 10:43
|
||||||
|
*/
|
||||||
|
@Schema(description = "管理后台 - 生产单明细打印信息 Response VO")
|
||||||
|
@Data
|
||||||
|
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||||
|
public class OrderPrintDetailRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "订单ID")
|
||||||
|
private Long orderId;
|
||||||
|
|
||||||
|
@Schema(description = "房间名称-板材类型显示")
|
||||||
|
private String roomName;
|
||||||
|
|
||||||
|
@Schema(description = "柜体名称")
|
||||||
|
private String bodyName;
|
||||||
|
|
||||||
|
@Schema(description = "板材ID")
|
||||||
|
private Long plateId;
|
||||||
|
|
||||||
|
@Schema(description = "板编号")
|
||||||
|
private String plateNo;
|
||||||
|
|
||||||
|
@Schema(description = "自定义板编号")
|
||||||
|
private String customPlateNo;
|
||||||
|
|
||||||
|
@Schema(description = "板名称")
|
||||||
|
private String plateName;
|
||||||
|
|
||||||
|
@Schema(description = "材料")
|
||||||
|
private String material;
|
||||||
|
|
||||||
|
@Schema(description = "颜色")
|
||||||
|
private String color;
|
||||||
|
|
||||||
|
@Schema(description = "宽度")
|
||||||
|
private Double width;
|
||||||
|
|
||||||
|
@Schema(description = "长度")
|
||||||
|
private Double height;
|
||||||
|
|
||||||
|
@Schema(description = "厚度")
|
||||||
|
private Double thickness;
|
||||||
|
|
||||||
|
@Schema(description = "备注(板材和配件都要传递)")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(description = "配件名称-配件类型显示")
|
||||||
|
private String partsName;
|
||||||
|
|
||||||
|
@Schema(description = "配件ID")
|
||||||
|
private Long partsId;
|
||||||
|
|
||||||
|
@Schema(description = "型号")
|
||||||
|
private String model;
|
||||||
|
|
||||||
|
@Schema(description = "规格")
|
||||||
|
private String spec;
|
||||||
|
|
||||||
|
@Schema(description = "明细配件类型, 2 五金/配件 3 其他 4 报价配件")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
@Schema(description = "单位")
|
||||||
|
private String unit;
|
||||||
|
|
||||||
|
@Schema(description = "品牌")
|
||||||
|
private String brand;
|
||||||
|
|
||||||
|
@Schema(description = "厂家")
|
||||||
|
private String factory;
|
||||||
|
|
||||||
|
@Schema(description = "配件颜色")
|
||||||
|
private String partsColor;
|
||||||
|
|
||||||
|
@Schema(description = "开料长")
|
||||||
|
private BigDecimal splitHeight;
|
||||||
|
|
||||||
|
@Schema(description = "开料宽")
|
||||||
|
private BigDecimal splitWidth;
|
||||||
|
|
||||||
|
@Schema(description = "数量")
|
||||||
|
private Double num;
|
||||||
|
}
|
||||||
+52
@@ -0,0 +1,52 @@
|
|||||||
|
package com.cf.imes.module.executor.controller.admin.order.vo.order;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 生产单信息打印 Response VO")
|
||||||
|
@Data
|
||||||
|
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||||
|
public class OrderPrintInfoRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "订单号", example = "15091")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "订单日期")
|
||||||
|
private LocalDateTime orderDate;
|
||||||
|
|
||||||
|
@Schema(description = "交付日期")
|
||||||
|
private LocalDateTime deliveryDate;
|
||||||
|
|
||||||
|
@Schema(description = "订单类型", example = "1")
|
||||||
|
private Integer orderType;
|
||||||
|
|
||||||
|
@Schema(description = "自定义单号")
|
||||||
|
private String customOrderNo;
|
||||||
|
|
||||||
|
@Schema(description = "客户")
|
||||||
|
private String customer;
|
||||||
|
|
||||||
|
@Schema(description = "客户地址")
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
@Schema(description = "客户电话")
|
||||||
|
private String phoneNumber;
|
||||||
|
|
||||||
|
@Schema(description = "经销商")
|
||||||
|
private String dealer;
|
||||||
|
|
||||||
|
@Schema(description = "经销商电话")
|
||||||
|
private String dealerPhoneNumber;
|
||||||
|
|
||||||
|
@Schema(description = "业务员")
|
||||||
|
private String salesman;
|
||||||
|
|
||||||
|
@Schema(description = "拆单员")
|
||||||
|
private String splitter;
|
||||||
|
|
||||||
|
@Schema(description = "备注", example = "你猜")
|
||||||
|
private String remark;
|
||||||
|
}
|
||||||
+25
@@ -0,0 +1,25 @@
|
|||||||
|
package com.cf.imes.module.executor.controller.admin.order.vo.order;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @author Gqr
|
||||||
|
* @since 2026/5/11 10:42
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 生产单打印信息 Response VO")
|
||||||
|
@Data
|
||||||
|
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||||
|
public class OrderPrintRespVO {
|
||||||
|
@Schema(description = "生产单明细打印信息列表")
|
||||||
|
private List<OrderPrintDetailRespVO> orderPrintDetailRespVOList;
|
||||||
|
|
||||||
|
@Schema(description = "生产单信息打印列表")
|
||||||
|
private List<OrderPrintInfoRespVO> orderPrintInfoVOList;
|
||||||
|
}
|
||||||
+8
@@ -2,6 +2,7 @@ package com.cf.imes.module.executor.controller.admin.ordercomponent;
|
|||||||
|
|
||||||
import com.cf.imes.framework.common.pojo.CommonResult;
|
import com.cf.imes.framework.common.pojo.CommonResult;
|
||||||
import com.cf.imes.framework.common.pojo.PageResult;
|
import com.cf.imes.framework.common.pojo.PageResult;
|
||||||
|
import com.cf.imes.module.executor.controller.admin.order.vo.order.OrderPrintRespVO;
|
||||||
import com.cf.imes.module.executor.controller.admin.order.vo.order.OrdersViewCadViewInfoRespVO;
|
import com.cf.imes.module.executor.controller.admin.order.vo.order.OrdersViewCadViewInfoRespVO;
|
||||||
import com.cf.imes.module.executor.controller.admin.ordercomponent.vo.OrderComponentRespVO;
|
import com.cf.imes.module.executor.controller.admin.ordercomponent.vo.OrderComponentRespVO;
|
||||||
import com.cf.imes.module.executor.controller.admin.ordercomponent.vo.OrderDetailComponentListReqVO;
|
import com.cf.imes.module.executor.controller.admin.ordercomponent.vo.OrderDetailComponentListReqVO;
|
||||||
@@ -106,4 +107,11 @@ public class OrderComponentController {
|
|||||||
orderComponentService.restoreOrderComponent(orderId, id);
|
orderComponentService.restoreOrderComponent(orderId, id);
|
||||||
return success(true);
|
return success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/print")
|
||||||
|
@Operation(summary = "获取订单部件打印列表")
|
||||||
|
@PreAuthorize("@ss.hasPermission('production:assemblyList:print')")
|
||||||
|
public CommonResult<OrderPrintRespVO> getOrderComponentPrintList(@Valid @RequestBody OrderDetailComponentListReqVO reqVO) {
|
||||||
|
return success(orderComponentService.getOrderComponentPrintList(reqVO));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+19
@@ -8,6 +8,7 @@ import com.cf.imes.module.executor.controller.admin.manage.pack.vo.PlateDetailsR
|
|||||||
import com.cf.imes.module.executor.controller.admin.order.vo.order.OrderGoodsDetailRespVO;
|
import com.cf.imes.module.executor.controller.admin.order.vo.order.OrderGoodsDetailRespVO;
|
||||||
import com.cf.imes.module.executor.controller.admin.order.vo.order.OrderGoodsRespVO;
|
import com.cf.imes.module.executor.controller.admin.order.vo.order.OrderGoodsRespVO;
|
||||||
import com.cf.imes.module.executor.controller.admin.order.vo.order.OrderPlatesDetailRespVO;
|
import com.cf.imes.module.executor.controller.admin.order.vo.order.OrderPlatesDetailRespVO;
|
||||||
|
import com.cf.imes.module.executor.controller.admin.order.vo.order.OrderPrintDetailRespVO;
|
||||||
import com.cf.imes.module.executor.controller.admin.orderParts.vo.OrderPartsRespVO;
|
import com.cf.imes.module.executor.controller.admin.orderParts.vo.OrderPartsRespVO;
|
||||||
import com.cf.imes.module.executor.controller.admin.plate.vo.PlateRespVO;
|
import com.cf.imes.module.executor.controller.admin.plate.vo.PlateRespVO;
|
||||||
import com.cf.imes.module.executor.dal.dataobject.orderItem.OrderItemDO;
|
import com.cf.imes.module.executor.dal.dataobject.orderItem.OrderItemDO;
|
||||||
@@ -280,4 +281,22 @@ public interface OrderItemMapper extends BaseMapperX<OrderItemDO> {
|
|||||||
List<OrdersViewPartsPageDO> selectOrderViewParts(@Param("orderId") Long orderId,
|
List<OrdersViewPartsPageDO> selectOrderViewParts(@Param("orderId") Long orderId,
|
||||||
@Param("bodyIds") Set<Long> bodyIds,
|
@Param("bodyIds") Set<Long> bodyIds,
|
||||||
@Param("componentIds") Set<Long> componentIds);
|
@Param("componentIds") Set<Long> componentIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询订单板件打印信息列表
|
||||||
|
*
|
||||||
|
* @param orderIds
|
||||||
|
* @param componentIds
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<OrderPrintDetailRespVO> selectOrdersPrintPlatesList(@Param("orderIds") List<Long> orderIds, @Param("componentIds") Set<Long> componentIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询订单板件打印信息列表
|
||||||
|
*
|
||||||
|
* @param orderIds
|
||||||
|
* @param componentIds
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<OrderPrintDetailRespVO> selectOrdersPrintPartsList(@Param("orderIds") List<Long> orderIds, @Param("componentIds") Set<Long> componentIds);
|
||||||
}
|
}
|
||||||
+8
@@ -222,4 +222,12 @@ public interface OrderService {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<PackOrdersInfoRespVO> getPackOrdersInfo(List<Long> orderIds);
|
List<PackOrdersInfoRespVO> getPackOrdersInfo(List<Long> orderIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取订单打印信息
|
||||||
|
*
|
||||||
|
* @param orderIds
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<OrderPrintInfoRespVO> getOrderPrintInfo(List<Long> orderIds);
|
||||||
}
|
}
|
||||||
+13
@@ -1794,4 +1794,17 @@ public class OrderServiceImpl implements OrderService {
|
|||||||
);
|
);
|
||||||
return BeanUtil.copyToList(orderDOS, PackOrdersInfoRespVO.class);
|
return BeanUtil.copyToList(orderDOS, PackOrdersInfoRespVO.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<OrderPrintInfoRespVO> getOrderPrintInfo(List<Long> orderIds) {
|
||||||
|
// 查询订单
|
||||||
|
List<OrderDO> orderDOS = orderMapper.selectList(new LambdaQueryWrapper<OrderDO>()
|
||||||
|
.in(OrderDO::getId, orderIds)
|
||||||
|
.eq(OrderDO::getDeleted, DeletedCodeEnum.NOT_DELETED.getStatus())
|
||||||
|
.select(OrderDO::getId, OrderDO::getOrderDate, OrderDO::getDeliveryDate, OrderDO::getOrderType, OrderDO::getCustomOrderNo
|
||||||
|
, OrderDO::getCustomer, OrderDO::getAddress, OrderDO::getPhoneNumber, OrderDO::getDealer, OrderDO::getDealerPhoneNumber
|
||||||
|
, OrderDO::getSalesman, OrderDO::getSplitter, OrderDO::getRemark)
|
||||||
|
);
|
||||||
|
return BeanUtil.copyToList(orderDOS, OrderPrintInfoRespVO.class);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
+9
@@ -1,6 +1,7 @@
|
|||||||
package com.cf.imes.module.executor.service.ordercomponent;
|
package com.cf.imes.module.executor.service.ordercomponent;
|
||||||
|
|
||||||
import com.cf.imes.framework.common.pojo.PageResult;
|
import com.cf.imes.framework.common.pojo.PageResult;
|
||||||
|
import com.cf.imes.module.executor.controller.admin.order.vo.order.OrderPrintRespVO;
|
||||||
import com.cf.imes.module.executor.controller.admin.order.vo.order.OrdersViewCadViewInfoRespVO;
|
import com.cf.imes.module.executor.controller.admin.order.vo.order.OrdersViewCadViewInfoRespVO;
|
||||||
import com.cf.imes.module.executor.controller.admin.ordercomponent.vo.OrderComponentRespVO;
|
import com.cf.imes.module.executor.controller.admin.ordercomponent.vo.OrderComponentRespVO;
|
||||||
import com.cf.imes.module.executor.controller.admin.ordercomponent.vo.OrderDetailComponentListReqVO;
|
import com.cf.imes.module.executor.controller.admin.ordercomponent.vo.OrderDetailComponentListReqVO;
|
||||||
@@ -111,4 +112,12 @@ public interface OrderComponentService {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
OrdersViewCadViewInfoRespVO getOrderViewCadInfo(OrderDetailComponentPageReqVO pageReqVO);
|
OrdersViewCadViewInfoRespVO getOrderViewCadInfo(OrderDetailComponentPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询部件打印信息
|
||||||
|
*
|
||||||
|
* @param pageReqVO
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
OrderPrintRespVO getOrderComponentPrintList(OrderDetailComponentListReqVO pageReqVO);
|
||||||
}
|
}
|
||||||
+23
@@ -17,6 +17,8 @@ import com.cf.imes.framework.common.pojo.PageResult;
|
|||||||
import com.cf.imes.framework.common.util.Assert.AssertUtils;
|
import com.cf.imes.framework.common.util.Assert.AssertUtils;
|
||||||
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
import com.cf.imes.framework.security.core.util.SecurityFrameworkUtils;
|
import com.cf.imes.framework.security.core.util.SecurityFrameworkUtils;
|
||||||
|
import com.cf.imes.module.executor.controller.admin.order.vo.order.OrderPrintDetailRespVO;
|
||||||
|
import com.cf.imes.module.executor.controller.admin.order.vo.order.OrderPrintRespVO;
|
||||||
import com.cf.imes.module.executor.controller.admin.order.vo.order.OrdersViewCadViewInfoRespVO;
|
import com.cf.imes.module.executor.controller.admin.order.vo.order.OrdersViewCadViewInfoRespVO;
|
||||||
import com.cf.imes.module.executor.controller.admin.ordercomponent.vo.OrderComponentRespVO;
|
import com.cf.imes.module.executor.controller.admin.ordercomponent.vo.OrderComponentRespVO;
|
||||||
import com.cf.imes.module.executor.controller.admin.ordercomponent.vo.OrderDetailComponentListReqVO;
|
import com.cf.imes.module.executor.controller.admin.ordercomponent.vo.OrderDetailComponentListReqVO;
|
||||||
@@ -38,6 +40,7 @@ import com.cf.imes.module.executor.dal.mysql.ordercomponent.OrderComponentMapper
|
|||||||
import com.cf.imes.module.executor.dal.mysql.plate.PlateMapper;
|
import com.cf.imes.module.executor.dal.mysql.plate.PlateMapper;
|
||||||
import com.cf.imes.module.executor.service.manage.pack.PackService;
|
import com.cf.imes.module.executor.service.manage.pack.PackService;
|
||||||
import com.cf.imes.module.executor.service.order.OrderInfoVersionControlService;
|
import com.cf.imes.module.executor.service.order.OrderInfoVersionControlService;
|
||||||
|
import com.cf.imes.module.executor.service.order.OrderService;
|
||||||
import com.cf.imes.module.infra.api.file.FileApi;
|
import com.cf.imes.module.infra.api.file.FileApi;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -101,6 +104,9 @@ public class OrderComponentServiceImpl implements OrderComponentService {
|
|||||||
@Resource
|
@Resource
|
||||||
private PackService packService;
|
private PackService packService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private OrderService orderService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<OrderComponentRespVO> getOrderComponentList(OrderDetailComponentListReqVO reqVO) {
|
public List<OrderComponentRespVO> getOrderComponentList(OrderDetailComponentListReqVO reqVO) {
|
||||||
List<OrderComponentRespVO> resultList = new ArrayList<>();
|
List<OrderComponentRespVO> resultList = new ArrayList<>();
|
||||||
@@ -856,4 +862,21 @@ public class OrderComponentServiceImpl implements OrderComponentService {
|
|||||||
ordersViewCadViewInfoRespVO.setParts(partResult);
|
ordersViewCadViewInfoRespVO.setParts(partResult);
|
||||||
return ordersViewCadViewInfoRespVO;
|
return ordersViewCadViewInfoRespVO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public OrderPrintRespVO getOrderComponentPrintList(OrderDetailComponentListReqVO pageReqVO) {
|
||||||
|
OrderPrintRespVO result = new OrderPrintRespVO();
|
||||||
|
List<Long> orderIds = pageReqVO.getOrderIds();
|
||||||
|
Set<Long> componentIds = pageReqVO.getComponentIds();
|
||||||
|
|
||||||
|
// 订单信息
|
||||||
|
result.setOrderPrintInfoVOList(orderService.getOrderPrintInfo(orderIds));
|
||||||
|
|
||||||
|
// 组合板件+配件
|
||||||
|
List<OrderPrintDetailRespVO> ordersPrintPlatesList = orderItemMapper.selectOrdersPrintPlatesList(orderIds, componentIds);
|
||||||
|
ordersPrintPlatesList.addAll(orderItemMapper.selectOrdersPrintPartsList(orderIds, componentIds));
|
||||||
|
|
||||||
|
result.setOrderPrintDetailRespVOList(ordersPrintPlatesList);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
+90
@@ -770,4 +770,94 @@
|
|||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectOrdersPrintPlatesList" resultType="com.cf.imes.module.executor.controller.admin.order.vo.order.OrderPrintDetailRespVO">
|
||||||
|
SELECT
|
||||||
|
p.order_id,
|
||||||
|
p.plate_no,
|
||||||
|
p.name,
|
||||||
|
p.width,
|
||||||
|
p.height,
|
||||||
|
p.thickness,
|
||||||
|
p.split_width,
|
||||||
|
p.split_height,
|
||||||
|
p.split_thickness,
|
||||||
|
p.custom_plate_no,
|
||||||
|
p.id,
|
||||||
|
p.remark,
|
||||||
|
g.material,
|
||||||
|
g.brand,
|
||||||
|
g.color,
|
||||||
|
ob.room_name AS roomName,
|
||||||
|
ob.name AS bodyName
|
||||||
|
FROM (
|
||||||
|
SELECT
|
||||||
|
plate_id,
|
||||||
|
MIN(body_id) AS body_id
|
||||||
|
FROM order_item
|
||||||
|
WHERE plate_id != 0 and source_id = 0
|
||||||
|
<if test="orderIds != null and orderIds.size() > 0">
|
||||||
|
AND order_id IN
|
||||||
|
<foreach item="orderId" collection="orderIds" open="(" separator="," close=")">
|
||||||
|
#{orderId}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
<if test="componentIds != null and componentIds.size() > 0">
|
||||||
|
AND comp_id IN
|
||||||
|
<foreach item="componentId" collection="componentIds" open="(" separator="," close=")">
|
||||||
|
#{componentId}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
GROUP BY plate_id
|
||||||
|
) i
|
||||||
|
INNER JOIN order_plate p ON p.id = i.plate_id
|
||||||
|
INNER JOIN order_goods g ON g.id = p.goods_id
|
||||||
|
INNER JOIN order_body ob ON ob.id = i.body_id
|
||||||
|
WHERE p.deleted = false
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectOrdersPrintPartsList" resultType="com.cf.imes.module.executor.controller.admin.order.vo.order.OrderPrintDetailRespVO">
|
||||||
|
SELECT
|
||||||
|
op.order_id,
|
||||||
|
op.id,
|
||||||
|
op.type,
|
||||||
|
op.name as partsName,
|
||||||
|
op.material,
|
||||||
|
op.color,
|
||||||
|
op.model,
|
||||||
|
op.spec,
|
||||||
|
op.unit,
|
||||||
|
op.brand,
|
||||||
|
op.factory,
|
||||||
|
op.remark,
|
||||||
|
ob.room_name AS roomName,
|
||||||
|
ob.name AS bodyName,
|
||||||
|
i.num
|
||||||
|
FROM (
|
||||||
|
SELECT
|
||||||
|
parts_id,
|
||||||
|
MIN(body_id) AS body_id,
|
||||||
|
SUM(num) AS num
|
||||||
|
FROM order_item
|
||||||
|
WHERE plate_id = 0 and source_id = 0
|
||||||
|
<if test="orderIds != null and orderIds.size() > 0">
|
||||||
|
AND order_id IN
|
||||||
|
<foreach item="orderId" collection="orderIds" open="(" separator="," close=")">
|
||||||
|
#{orderId}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
<if test="componentIds != null and componentIds.size() > 0">
|
||||||
|
AND comp_id IN
|
||||||
|
<foreach item="componentId" collection="componentIds" open="(" separator="," close=")">
|
||||||
|
#{componentId}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
GROUP BY parts_id
|
||||||
|
) i
|
||||||
|
INNER JOIN order_parts op
|
||||||
|
ON op.id = i.parts_id
|
||||||
|
INNER JOIN order_body ob ON ob.id = i.body_id
|
||||||
|
WHERE op.deleted = false
|
||||||
|
ORDER BY op.id, op.type
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
Reference in New Issue
Block a user