|
@@ -95,10 +95,16 @@
|
|
</sql>
|
|
</sql>
|
|
<select id="selectList" parameterType="com.platform.dao.dto.store.OutStoreFormDTO"
|
|
<select id="selectList" parameterType="com.platform.dao.dto.store.OutStoreFormDTO"
|
|
resultType="com.platform.dao.vo.query.store.OutStoreFormVO">
|
|
resultType="com.platform.dao.vo.query.store.OutStoreFormVO">
|
|
- select outstoreform.*, store.name storeName,info.name as spareName
|
|
|
|
|
|
+ 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
|
|
from t_out_store_form as outstoreform
|
|
from t_out_store_form as outstoreform
|
|
left join t_store store on store.id = outstoreform.store_id
|
|
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_part_info info on outstoreform.spare_id = info.id
|
|
|
|
+ left join t_spare_store spareStore on
|
|
|
|
+ spareStore.spare_id = outstoreform.spare_id
|
|
<where>
|
|
<where>
|
|
<include refid="List_Condition"/>
|
|
<include refid="List_Condition"/>
|
|
<if test="useCompany != null and useCompany != ''">
|
|
<if test="useCompany != null and useCompany != ''">
|
|
@@ -162,4 +168,25 @@
|
|
</where>
|
|
</where>
|
|
GROUP BY spare_id
|
|
GROUP BY spare_id
|
|
</select>
|
|
</select>
|
|
|
|
+
|
|
|
|
+ <select id="getOutStoreFormCollect" resultType="com.platform.dao.vo.query.store.OutStoreFormVO"
|
|
|
|
+ parameterType="com.platform.dao.dto.store.OutStoreFormDTO">
|
|
|
|
+ select info.*,if(sum(form.in_num is null),0,form.in_num) totalNum,if(sum(form.in_num is null),0,form.in_num)*info.initial_value as totalPrice from t_spare_part_info info
|
|
|
|
+ left join t_out_store_form form on info.id = form.spare_id
|
|
|
|
+ left join t_spare_store spareStore on spareStore.spare_id = info.id
|
|
|
|
+ left join t_store store on store.id = spareStore.store_id
|
|
|
|
+ <where>
|
|
|
|
+ <if test="storeId!=null and storeId!=''">
|
|
|
|
+ store.id = #{storeId}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="searchTimeStart!=null and searchTimeStart!=''">
|
|
|
|
+ form.created_time <![CDATA[>=]]> #{searchTimeStart}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="searchTimeEnd!=null and searchTimeEnd!=''">
|
|
|
|
+ form.created_time <![CDATA[<=]]> #{searchTimeEnd}
|
|
|
|
+ </if>
|
|
|
|
+ </where>
|
|
|
|
+ group by info.id
|
|
|
|
+
|
|
|
|
+ </select>
|
|
</mapper>
|
|
</mapper>
|