|
@@ -117,7 +117,7 @@
|
|
|
resultType="com.platform.dao.vo.query.store.InStoreFormVO">
|
|
|
select instoreform.*, store.name storeName,
|
|
|
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.initial_value,info.unit,spareStore.num currentStock,
|
|
|
info.max_stock,info.min_stock,info.level,info.producer_id,
|
|
|
info.yt,producer.name as producerName,spareType.name as typeName
|
|
|
from t_in_store_form as instoreform
|
|
@@ -337,7 +337,7 @@
|
|
|
parameterType="com.platform.dao.dto.store.InStoreFormDTO">
|
|
|
select info.*,sum(form.in_num ) totalNum,
|
|
|
form.id inId,form.in_no inNo,store.id storeId,spareStore.spare_id spareId,
|
|
|
- spareType.name as typeName,sum(spareStore.num) currentStock,producer.name as producerName
|
|
|
+ spareType.name as typeName,spareStore.num currentStock,producer.name as producerName
|
|
|
from t_spare_part_info info
|
|
|
|
|
|
inner join t_in_store_form form on info.id = form.spare_id
|
|
@@ -355,6 +355,79 @@
|
|
|
<if test="searchTimeEnd!=null and searchTimeEnd!=''">
|
|
|
form.created_time <![CDATA[<=]]> #{searchTimeEnd}
|
|
|
</if>
|
|
|
+
|
|
|
+
|
|
|
+ <if test="spareIdList != null and spareIdList.size > 0">
|
|
|
+ and sparestore.spare_id in
|
|
|
+ <foreach item="item" index="index" collection="spareIdList" open="(" close=")" separator=",">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <if test="typeId != null and typeId != ''">
|
|
|
+ and info.type_id = #{typeId}
|
|
|
+ </if>
|
|
|
+ <if test="isSpecial != null and isSpecial != ''">
|
|
|
+ and info.is_special = #{isSpecial}
|
|
|
+ </if>
|
|
|
+ <if test="producerName != null and producerName != ''">
|
|
|
+ AND producer.name like concat('%',#{producerName},'%')
|
|
|
+ </if>
|
|
|
+ <if test="supplierName != null and supplierName != ''">
|
|
|
+ AND supplier.name like concat('%',#{supplierName},'%')
|
|
|
+ </if>
|
|
|
+ <if test="keyword != null and keyword != ''">
|
|
|
+ AND ( info.name like concat('%',#{keyword},'%') or
|
|
|
+ info.no like concat('%',#{keyword},'%'))
|
|
|
+ </if>
|
|
|
+ <if test="name != null and name != ''">
|
|
|
+ AND info.name = #{name}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="ggxh != null and ggxh != ''">
|
|
|
+ AND info.ggxh like concat('%',#{ggxh},'%')
|
|
|
+ </if>
|
|
|
+ <if test="initNo != null and initNo != ''">
|
|
|
+ AND info.init_no like concat('%',#{initNo},'%')
|
|
|
+ </if>
|
|
|
+ <if test="yt != null">
|
|
|
+ AND info.yt=#{yt}
|
|
|
+ </if>
|
|
|
+ <if test="storeId != null and storeId != ''">
|
|
|
+ AND spare.store_id=#{storeId}
|
|
|
+ </if>
|
|
|
+ <if test="level != null and level != ''">
|
|
|
+ AND info.level=#{level}
|
|
|
+ </if>
|
|
|
+ <if test="typeIds != null and typeIds.size > 0">
|
|
|
+ AND info.type_id in
|
|
|
+ <foreach item="item" index="index" collection="typeIds" open="(" close=")" separator=",">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="producerId != null and producerId != ''">
|
|
|
+ AND info.producer_id=#{producerId}
|
|
|
+ </if>
|
|
|
+ <if test="supplierId != null and producerId != ''">
|
|
|
+ AND info.supplier_id=#{supplierId}
|
|
|
+ </if>
|
|
|
+ <if test="parentTypeId != null and parentTypeId != ''">
|
|
|
+ AND info.parent_type_id=#{parentTypeId}
|
|
|
+ </if>
|
|
|
+ <!-- <if test="typeId != null and typeId != ''">
|
|
|
+ AND info.type_id=#{typeId}
|
|
|
+ </if>-->
|
|
|
+ <if test="parentNo != null and parentNo != ''">
|
|
|
+ AND info.parent_no=#{parentNo}
|
|
|
+ </if>
|
|
|
+ <if test="childNo != null and childNo != ''">
|
|
|
+ AND info.child_no=#{childNo}
|
|
|
+ </if>
|
|
|
+ <if test="brand!=null">
|
|
|
+ and info.brand like concat('%',#{brand},'%')
|
|
|
+ </if>
|
|
|
</where>
|
|
|
group by info.id
|
|
|
|