Commit 98ecb762 authored by KeYong's avatar KeYong

更新消防炮查询接口

parent 3952d56d
......@@ -5,10 +5,7 @@ import com.yeejoin.equipmanage.service.IEquipmentInfoOnPlanService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
......@@ -36,8 +33,8 @@ public class EquipmentInfoOnPlanController {
@ApiOperation(httpMethod = "GET", value = "消防炮信息", notes = "消防炮信息")
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value ="/monitor", method = RequestMethod.GET)
public ResponseModel getFireMonitorInfo() {
List<Map<String, Object>> list = equipmentInfoOnPlanService.getFireMonitorInfo();
public ResponseModel getFireMonitorInfo(@RequestParam(required=false) Long fireEquipmentId) {
List<Map<String, Object>> list = equipmentInfoOnPlanService.getFireMonitorInfo(fireEquipmentId);
return ResponseHelper.buildResponse(list);
}
......
......@@ -203,6 +203,8 @@ public interface EquipmentSpecificMapper extends BaseMapper<EquipmentSpecific> {
List<EquiplistSpecificBySystemVO> getListByWarehouseStructureId(Long floorId);
List<Map<String, Object>> getFireMonitorOrFirePumpInfo(@Param("list") String[] strings);
List<Map<String, Object>> getFireMonitorInfo(@Param("fireEquipmentId") Long fireEquipmentId, @Param("list") String[] strings);
List<Map<String, Object>> getFirePumpInfo(@Param("list") String[] strings);
}
......@@ -20,7 +20,7 @@ public interface IEquipmentInfoOnPlanService {
* 消防炮信息
* @return
*/
List<Map<String, Object>> getFireMonitorInfo();
List<Map<String, Object>> getFireMonitorInfo(Long fireEquipmentId);
/**
* 消防泵信息
......
......@@ -31,14 +31,14 @@ public class EquipmentInfoOnPlanServiceImpl implements IEquipmentInfoOnPlanServi
String pumpCodes;
@Override
public List<Map<String, Object>> getFireMonitorInfo() {
public List<Map<String, Object>> getFireMonitorInfo(Long fireEquipmentId) {
String[] strings = monitorCodes.split(",");
return equipmentSpecificMapper.getFireMonitorOrFirePumpInfo(strings);
return equipmentSpecificMapper.getFireMonitorInfo(fireEquipmentId, strings);
}
@Override
public List<Map<String, Object>> getFirePumpInfo() {
String[] strings = pumpCodes.split(",");
return equipmentSpecificMapper.getFireMonitorOrFirePumpInfo(strings);
return equipmentSpecificMapper.getFirePumpInfo(strings);
}
}
......@@ -1499,7 +1499,34 @@
det.amount > 0 and spe.warehouse_structure_id =#{floorId}
</select>
<select id="getFireMonitorOrFirePumpInfo" resultType="Map">
<select id="getFireMonitorInfo" resultType="Map">
SELECT
wes.name,
wes.position,
wes.equipment_code equipmentCode,
wes.realtime_iot_index_name realtimeIotIndexName,
wes.realtime_iot_index_key realtimeIotIndexKey,
wes.realtime_iot_index_value realtimeIotIndexValue,
wes.value_label valueLabel,
wes.realtime_iot_es_index_id realtimeIotSpecificIndexId,
wes.realtime_iot_index_update_date realtiemIotIndexUpdateDate,
wes.realtime_iot_index_id realtimeIotIndexId
FROM
wl_equipment_specific wes
LEFT JOIN f_equipment_fire_equipment fire ON wes.id = fire.fire_equipment_id
<where>
<if test="list != null and list.length > 0">
<foreach collection="list" item="item" index="index" open="(" close=")" separator="OR">
wes.equipment_code LIKE <![CDATA[CONCAT(#{item},'%')]]>
</foreach>
</if>
<if test="fireEquipmentId != null and fireEquipmentId != ''">
AND wes.id = #{fireEquipmentId}
</if>
</where>
ORDER BY realtiemIotIndexUpdateDate DESC
</select>
<select id="getFirePumpInfo" resultType="Map">
SELECT
wes.name,
wes.position,
......
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