|
@@ -98,19 +98,17 @@
|
|
|
select outstoreform.*, store.name storeName,info.name as spareName,
|
|
|
info.type_id,info.no,info.name,info.ggxh,info.brand,
|
|
|
info.initial_value,info.unit,sum(if(spareStore.num is null,0,spareStore.num)) currentStock,
|
|
|
- info.max_stock,info.min_stock,info.level,info.producer_id,
|
|
|
- info.yt
|
|
|
+ info.max_stock,info.min_stock,info.level,info.producer_id,producer.name as producerName,
|
|
|
+ info.yt,spareType.name as typeName
|
|
|
from t_out_store_form as outstoreform
|
|
|
- left join t_store store on store.id = outstoreform.store_id
|
|
|
left join t_spare_part_info info on outstoreform.spare_id = info.id
|
|
|
left join t_spare_store spareStore on
|
|
|
spareStore.spare_id = outstoreform.spare_id
|
|
|
- <if test="producerName != null and producerName != ''">
|
|
|
- LEFT JOIN t_firm_producer producer on producer.id = info.producer_id
|
|
|
- </if>
|
|
|
- <if test="supplierName != null and supplierName != ''">
|
|
|
- LEFT JOIN t_supplier supplier on supplier.id = info.supplier_id
|
|
|
- </if>
|
|
|
+ left join t_store store on store.id = spareStore.store_id
|
|
|
+ LEFT JOIN t_firm_producer producer on producer.id = info.producer_id
|
|
|
+ LEFT JOIN t_supplier supplier on supplier.id = info.supplier_id
|
|
|
+ left join t_spare_type spareType on spareType.id = info.type_id
|
|
|
+
|
|
|
<where>
|
|
|
<include refid="List_Condition"/>
|
|
|
<if test="useCompany != null and useCompany != ''">
|
|
@@ -280,9 +278,8 @@
|
|
|
<select id="getOutStoreFormCollect" resultType="com.platform.dao.vo.query.store.OutStoreFormVO"
|
|
|
parameterType="com.platform.dao.dto.store.OutStoreFormDTO">
|
|
|
select info.*,sum(form.out_num ) totalNum,sum(form.out_num )*info.initial_value as totalPrice,form.id outId,
|
|
|
- form.out_no outNo,store.id storeId,spareStore.spare_id spareId,
|
|
|
+ form.out_no outNo,store.id storeId,spareStore.spare_id spareId,store.name as storeName,
|
|
|
spareType.name as typeName,sum(spareStore.num) currentStock,producer.name as producerName
|
|
|
-
|
|
|
from t_spare_part_info info
|
|
|
inner join t_out_store_form form on info.id = form.spare_id
|
|
|
left join t_spare_store spareStore on spareStore.spare_id = info.id
|