Browse Source

托书面料合并

zengtx 1 year ago
parent
commit
d7b3dd0509

+ 8 - 3
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/syShippingOrder/mapper/xml/SyShippingOrderMapper.xml

@@ -120,8 +120,10 @@ a.salesman, a.operating_department as operatingDepartment, a.purchase_outsourcin
         <if test='type == "面辅料"'>
             left join sy_packing_list_fabric_item c
             on a.tailoring_fabric_item_id = c.id
+            left join sy_declaration_elements b
+            on a.elements_Id = b.id
             where a.del_flag = 0 and sy_shipping_order_item_id = #{id}
-            group by a.tailoring_fabric_id order by style_number,smail_po desc
+            group by b.hs_code,b.declaration_name,b.declaration_unit order by style_number,smail_po desc
         </if>
 
     </select>
@@ -142,7 +144,7 @@ on a.elements_Id = b.id
 left join sy_packing_list_fabric_item c
 on a.tailoring_fabric_item_id = c.id
 where a.sy_shipping_order_item_id =#{id}
- GROUP BY a.group_id order by a.english_name desc
+ GROUP BY b.hs_code,b.declaration_name,b.declaration_unit order by a.english_name desc
     </select>
 
 
@@ -174,6 +176,7 @@ group by c.group_id) t group by t.elementsId,t.styleNumber,t.smailPo,t.unitPrice
 
 
 
+<!--    托书新增页合并按钮-->
     <select id="syShippingOrderMerge" resultType="org.jeecg.modules.documents.syShippingOrder.entity.VO.SyPackingList">
 
   select c.hs_code as hsCode,c.declaration_name as declarationName,GROUP_CONCAT(DISTINCT a.id) as tailoringFabricId ,GROUP_CONCAT(DISTINCT b.id) as tailoringFabricItemId,a.document_No as documentNo,a.create_by as createBy,
@@ -262,6 +265,7 @@ where a.del_flag = 0 and a.sy_shipping_order_item_id = #{id}  group by a.group_i
 	   select cVenCode as cvencode,cvenName as cvenname from Vendor where bVenService = '1'
     </select>
 
+    <!--    成衣的查询申报要素信息-->
     <select id="elmentsList"  resultType="org.jeecg.modules.documents.syShippingOrder.entity.SyShippingOrderItem">
         select a.* from sy_shipping_order_item a
         left join sy_declaration_elements b
@@ -272,6 +276,7 @@ where a.del_flag = 0 and a.sy_shipping_order_item_id = #{id}  group by a.group_i
 
     </select>
 
+<!--    面辅料的查询申报要素信息-->
     <select id="elmentsListFabric"  resultType="org.jeecg.modules.documents.syShippingOrder.entity.SyShippingOrderItem">
         select a.elements_Id as elementsId,GROUP_CONCAT(a.id) as id,b.hs_code as hsCode,b.declaration_name as declarationName,b.english_product_name as englishProductName,case when ready_fabric != '辅料' then sum(c.meter) else sum(c.actual_declared_quantity) end as meter,sum(a.number) as number,a.unit_price as unitPrice,
 round(sum(a.total_price),2) as totalPrice,round(sum(a.gross_weight),2) as grossWeight,round(sum(a.net_weight),2) as netWeight,'KG' as pcs,a.volume as volume,
@@ -283,7 +288,7 @@ left join sy_declaration_elements b
 on a.elements_Id = b.id
 left join sy_packing_list_fabric_item c
 on a.tailoring_fabric_item_id = c.id
-        where a.del_flag = 0 and a.sy_shipping_order_item_id = #{id} group by a.group_id order by a.english_name desc
+        where a.del_flag = 0 and a.sy_shipping_order_item_id = #{id} group by b.hs_code,b.declaration_name,b.declaration_unit order by a.english_name desc
 
     </select>