left join wl_equipment_specific as spe on sto.qr_code = spe.qr_code
left join wl_equipment_specific as spe on sto.equipment_specific_id = spe.id
<iftest="equipmentId != null and equipmentId!='null' ">
<iftest="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>
...
@@ -68,12 +68,12 @@
...
@@ -68,12 +68,12 @@
count(1)
count(1)
from
from
wl_stock_detail as sto
wl_stock_detail as sto
left join wl_equipment_specific as spe on sto.qr_code = spe.qr_code
left join wl_equipment_specific as spe on sto.equipment_specific_id = spe.id
left join wl_warehouse_structure as ware on sto.warehouse_structure_id = ware .id
left join wl_warehouse_structure as ware on sto.warehouse_structure_id = ware .id
left join wl_equipment_detail as det on sto.equipment_detail_id = det.id
left join wl_equipment_detail as det on sto.equipment_detail_id = det.id
left join wl_equipment as equ on det.equipment_id = equ.id
left join wl_equipment as equ on det.equipment_id = equ.id
left join wl_equipment_category as cate on equ.category_id = cate.id
left join wl_equipment_category as cate on equ.category_id = cate.id
left join f_equipment_fire_equipment as fire on sto.id = fire.fire_equipment_id
left join f_equipment_fire_equipment as fire on spe.id = fire.fire_equipment_id
where sto.amount <![CDATA[>]]> 0
where sto.amount <![CDATA[>]]> 0
<iftest="name != null and name!='null' ">
<iftest="name != null and name!='null' ">
and (det.name like CONCAT('%',#{name},'%') or ware.full_name like CONCAT('%',#{name},'%') or spe.iot_code like CONCAT('%',#{name},'%') or spe.code like CONCAT('%',#{name},'%'))
and (det.name like CONCAT('%',#{name},'%') or ware.full_name like CONCAT('%',#{name},'%') or spe.iot_code like CONCAT('%',#{name},'%') or spe.code like CONCAT('%',#{name},'%'))