|
@@ -49,6 +49,8 @@
|
|
|
select="com.platform.dao.mapper.firm.FirmProducerMapper.selectNameById"/>
|
|
|
<association column="supplier_id" javaType="string" property="supplierName"
|
|
|
select="com.platform.dao.mapper.purchase.SupplierMapper.selectNameById"/>
|
|
|
+ <association column="id" javaType="Integer" property="currentStock"
|
|
|
+ select="com.platform.dao.mapper.store.SpareStoreMapper.selectTotalStock"/>
|
|
|
</resultMap>
|
|
|
<sql id="Base_Column_List">
|
|
|
id, no, unite_no, gg_no, name_no, name, type_id, level, initial_value, producer_id,
|
|
@@ -76,11 +78,9 @@
|
|
|
</sql>
|
|
|
<select id="selectPageList" parameterType="com.platform.dao.dto.sqarepartmanage.SparePartInfoDTO"
|
|
|
resultType="com.platform.dao.vo.query.sparepartmanage.SparePartInfoVO">
|
|
|
- select info.*
|
|
|
+ select info.*, SUM(spareStore.num) as currentStock
|
|
|
from t_spare_part_info info
|
|
|
- <if test="storeId != null and storeId != ''">
|
|
|
- LEFT JOIN t_spare_store spare on spare.spare_id = info.id
|
|
|
- </if>
|
|
|
+ LEFT JOIN t_spare_store spareStore on spareStore.spare_id = info.id
|
|
|
<if test="producerName != null and producerName != ''">
|
|
|
LEFT JOIN t_firm_producer producer on producer.id = info.producer_id
|
|
|
</if>
|
|
@@ -141,6 +141,7 @@
|
|
|
AND info.child_no=#{childNo}
|
|
|
</if>
|
|
|
</where>
|
|
|
+ group by info.id
|
|
|
</select>
|
|
|
|
|
|
<select id="selectById" parameterType="java.lang.Object" resultMap="BaseResultMap">
|