Commit 88311086 authored by 田涛's avatar 田涛

Bug-770修复 电力设备添加配套设备

parent 1553b8b0
...@@ -40,7 +40,13 @@ ...@@ -40,7 +40,13 @@
spe.system_id, spe.system_id,
manage.name as system_name manage.name as system_name
from from
wl_stock_detail as sto (
SELECT amount,
(SELECT equipment_specific_id FROM wl_stock_detail WHERE stock_id = stk.id limit 1) AS equipment_specific_id,
(SELECT warehouse_structure_id FROM wl_stock_detail WHERE stock_id = stk.id limit 1) AS warehouse_structure_id,
(SELECT equipment_detail_id FROM wl_stock_detail WHERE stock_id = stk.id limit 1) AS equipment_detail_id
FROM wl_stock stk
) AS sto
left join wl_equipment_specific as spe on sto.equipment_specific_id = spe.id left join wl_equipment_specific as spe on sto.equipment_specific_id = spe.id
<if test="equipmentId != null and equipmentId!='null' "> <if test="equipmentId != null and equipmentId!='null' ">
left join f_equipment_fire_equipment as fire on spe.id = fire.fire_equipment_id left join f_equipment_fire_equipment as fire on spe.id = fire.fire_equipment_id
...@@ -73,8 +79,14 @@ ...@@ -73,8 +79,14 @@
<select id="getEquipmentBySpeCount" resultType="int">select <select id="getEquipmentBySpeCount" resultType="int">select
count(1) count(1)
from from
wl_stock_detail as sto (
left join wl_equipment_specific as spe on sto.qr_code = spe.qr_code SELECT amount,
(SELECT equipment_specific_id FROM wl_stock_detail WHERE stock_id = stk.id limit 1) AS equipment_specific_id,
(SELECT warehouse_structure_id FROM wl_stock_detail WHERE stock_id = stk.id limit 1) AS warehouse_structure_id,
(SELECT equipment_detail_id FROM wl_stock_detail WHERE stock_id = stk.id limit 1) AS equipment_detail_id
FROM wl_stock stk
) AS sto
left join wl_equipment_specific as spe on sto.equipment_specific_id = spe.id
<if test="equipmentId != null and equipmentId!='null' "> <if test="equipmentId != null and equipmentId!='null' ">
left join f_equipment_fire_equipment as fire on spe.id = fire.fire_equipment_id left join f_equipment_fire_equipment as fire on spe.id = fire.fire_equipment_id
</if> </if>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment