Commit ae5335ae authored by maoying's avatar maoying

修改实时数据查询

parent 9d88e49c
...@@ -120,13 +120,6 @@ ...@@ -120,13 +120,6 @@
( (
SELECT SELECT
det.`name` as fireEquipmentName, det.`name` as fireEquipmentName,
spe.`code` as fireEquipmentCode,
ein.name as eq_point_name,
CASE ind.value WHEN 'true' THEN '是'
WHEN 'false' THEN '否'
ELSE ind.value END 'e_value',
ein.unit as eq_point_unit,
sce.name as source_name,
( (
SELECT SELECT
group_concat(DISTINCT f.`name`) group_concat(DISTINCT f.`name`)
...@@ -142,22 +135,19 @@ ...@@ -142,22 +135,19 @@
left join wl_equipment_specific as spe on spe.id = ind.equipment_specific_id left join wl_equipment_specific as spe on spe.id = ind.equipment_specific_id
left join wl_equipment_detail as det on spe.equipment_detail_id = det.id left join wl_equipment_detail as det on spe.equipment_detail_id = det.id
left join wl_equipment_index as ein on ind.equipment_index_id = ein.id left join wl_equipment_index as ein on ind.equipment_index_id = ein.id
left join wl_stock_detail as sto on sto.qr_code = spe.qr_code WHERE ind.`value` IS NOT NULL AND ind.`value` != ''
left join wl_warehouse_structure as str on sto.warehouse_structure_id = str.id
left join f_risk_source as sce on str.source_id = sce.id
) d ) d
WHERE <where>
1 = 1 <if test="fireEquipmentName!=null">
<if test="fireEquipmentName!=null"> AND d.fireEquipmentName LIKE '%${fireEquipmentName}%'
AND d.fireEquipmentName LIKE '%${fireEquipmentName}%' </if>
</if> <if test="equipmentName!=null">
<if test="equipmentName!=null"> AND d.equipmentName LIKE '%${equipmentName}%'
AND d.equipmentName LIKE '%${equipmentName}%' </if>
</if> <if test="startTime!=null">
<if test="startTime!=null"> AND d.create_date BETWEEN '${startTime}' AND '${endTime}'
AND d.create_date BETWEEN '${startTime}' AND '${endTime}' </if>
</if> </where>
AND e_value IS NOT NULL AND e_value != ''
</select> </select>
...@@ -192,18 +182,19 @@ ...@@ -192,18 +182,19 @@
left join wl_equipment_index as ein on ind.equipment_index_id = ein.id left join wl_equipment_index as ein on ind.equipment_index_id = ein.id
left join wl_stock_detail as sto on sto.equipment_specific_id = spe.id left join wl_stock_detail as sto on sto.equipment_specific_id = spe.id
left join wl_warehouse_structure as str on sto.warehouse_structure_id = str.id left join wl_warehouse_structure as str on sto.warehouse_structure_id = str.id
WHERE ind.`value` IS NOT NULL AND ind.`value` != ''
) d ) d
WHERE <where>
e_value IS NOT NULL AND e_value != '' <if test="fireEquipmentName!=null">
<if test="fireEquipmentName!=null"> AND d.fireEquipmentName LIKE '%${fireEquipmentName}%'
AND d.fireEquipmentName LIKE '%${fireEquipmentName}%' </if>
</if> <if test="equipmentName!=null">
<if test="equipmentName!=null"> AND d.equipmentName LIKE '%${equipmentName}%'
AND d.equipmentName LIKE '%${equipmentName}%' </if>
</if> <if test="startTime!=null">
<if test="startTime!=null"> AND d.create_date BETWEEN '${startTime}' AND '${endTime}'
AND d.create_date BETWEEN '${startTime}' AND '${endTime}' </if>
</if> </where>
ORDER BY d.create_date desc ORDER BY d.create_date desc
LIMIT ${start},${length} LIMIT ${start},${length}
</select> </select>
......
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