Commit fa31314f authored by KeYong's avatar KeYong

添加运行数据接口

parent 6afe3aa7
...@@ -15,6 +15,7 @@ import com.yeejoin.equipmanage.mapper.FireFightingSystemMapper; ...@@ -15,6 +15,7 @@ import com.yeejoin.equipmanage.mapper.FireFightingSystemMapper;
import com.yeejoin.equipmanage.service.IFireFightingSystemService; import com.yeejoin.equipmanage.service.IFireFightingSystemService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
...@@ -198,4 +199,20 @@ public class BigScreenController extends AbstractBaseController { ...@@ -198,4 +199,20 @@ public class BigScreenController extends AbstractBaseController {
return CommonResponseUtil.success(iFireFightingSystemService.getEquipmentsBySystemInfo(page, systemCode, equipmentCode)); return CommonResponseUtil.success(iFireFightingSystemService.getEquipmentsBySystemInfo(page, systemCode, equipmentCode));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "设备平台卡片-运行数据接口")
@GetMapping("/system/iot/log")
public ResponseModel getEquipmentsBySystemInfo(CommonPageable commonPageable,
@RequestParam(value = "bizOrgCode", required = false) String bizOrgCode,
@RequestParam(value = "systemCode",required = false)String systemCode,
@ApiParam(value = "设备名称", required = false) @RequestParam(required = false) String fireEquipmentName,
@ApiParam(value = "开始日期", required = false) @RequestParam(required = false) String startTime,
@ApiParam(value = "结束日期", required = false) @RequestParam(required = false) String endTime) {
if (commonPageable.getPageNumber() == 0) {
commonPageable.setPageNumber(1);
}
Page page = new Page<>(commonPageable.getPageNumber(), commonPageable.getPageSize());
return CommonResponseUtil.success(iFireFightingSystemService.getEquipmentRunLogBySysInfo(page, bizOrgCode, systemCode, fireEquipmentName, startTime, endTime));
}
} }
...@@ -740,4 +740,6 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE ...@@ -740,4 +740,6 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
List<Map<String, Object>> getFEquipInfoListCategory(@Param("bizOrgCode") String bizOrgCode); List<Map<String, Object>> getFEquipInfoListCategory(@Param("bizOrgCode") String bizOrgCode);
Page<Map<String, Object>> getEquipmentRunLogBySysInfo(Page page, @Param("bizOrgCode") String bizOrgCode, @Param("systemCode") String systemCode,
@Param("fireEquipmentName") String fireEquipmentName, @Param("startTime") String startTime, @Param("endTime") String endTime);
} }
...@@ -311,6 +311,8 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE ...@@ -311,6 +311,8 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
Page<Map<String, Object>> getEquipmentsBySystemInfo(Page page, String companyCode, String systemCode); Page<Map<String, Object>> getEquipmentsBySystemInfo(Page page, String companyCode, String systemCode);
Page<Map<String, Object>> getEquipmentRunLogBySysInfo(Page page, String bizOrgCode, String systemCode, String fireEquipmentName, String startTime, String endTime);
List<Map<String, Object>> getEquipExpiryStatistics(String bizOrgCode, Integer expiryDayNum); List<Map<String, Object>> getEquipExpiryStatistics(String bizOrgCode, Integer expiryDayNum);
Page<Map<String, String>> getEquipExpiryListByPage(String bizOrgCode, Integer expiryDayNum, Page page); Page<Map<String, String>> getEquipExpiryListByPage(String bizOrgCode, Integer expiryDayNum, Page page);
......
...@@ -2846,6 +2846,11 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -2846,6 +2846,11 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
return fireFightingSystemMapper.getEquipmentsBySystemInfo(page, null, systemCode, equipmentCode); return fireFightingSystemMapper.getEquipmentsBySystemInfo(page, null, systemCode, equipmentCode);
} }
@Override
public Page<Map<String, Object>> getEquipmentRunLogBySysInfo(Page page, String bizOrgCode, String systemCode, String fireEquipmentName, String startTime, String endTime) {
return fireFightingSystemMapper.getEquipmentRunLogBySysInfo(page, bizOrgCode, systemCode, fireEquipmentName, startTime, endTime);
}
public static List<OrgMenuDto> systemAndEquipmentTreeNew(List<Map<String,Object>> list) { public static List<OrgMenuDto> systemAndEquipmentTreeNew(List<Map<String,Object>> list) {
List<OrgMenuDto> menuList = list.stream() List<OrgMenuDto> menuList = list.stream()
.map(o -> new OrgMenuDto(Long.parseLong(o.get("id").toString()), o.get("name").toString(), .map(o -> new OrgMenuDto(Long.parseLong(o.get("id").toString()), o.get("name").toString(),
......
...@@ -6712,4 +6712,59 @@ ...@@ -6712,4 +6712,59 @@
ORDER BY ORDER BY
a.create_date DESC a.create_date DESC
</select> </select>
<select id="getEquipmentRunLogBySysInfo" resultType="Map">
SELECT
d.bizOrgName,
d.fireEquipmentCode,
d.fireEquipmentName,
d.eq_point_name,
d.e_value,
d.eq_point_unit,
d.source_name,
d.create_date
FROM
(
SELECT
spe.biz_org_name AS bizOrgName,
spe.biz_org_code AS bizOrgCode,
s.`system_type_code` AS systemTypeCode,
det.`name` as fireEquipmentName,
spe.`code` as fireEquipmentCode,
ein.name as eq_point_name,
CASE ind.value WHEN 'true' THEN '是'
WHEN 'false' THEN '否'
ELSE FORMAT(IFNULL(ind.value, 0), 2) END 'e_value',
ein.unit as eq_point_unit,
CONCAT(IFNULL(str.full_name,''),' ',IFNULL(sto.description,'')) as source_name,
DATE_FORMAT(ind.update_date, '%Y-%m-%d %H:%i:%S') as create_date
FROM
wl_equipment_specific_index as ind
left join wl_equipment_specific as spe on spe.id = ind.equipment_specific_id
left join f_fire_fighting_system s on FIND_IN_SET(s.id, spe.system_id) > 0
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_stock_detail as sto on sto.equipment_specific_id = spe.id
left join wl_warehouse_structure as str on sto.warehouse_structure_id = str.source_id
WHERE det.`name` IS NOT NULL AND ind.`value` IS NOT NULL AND ind.`value` != '' AND ein.is_iot = 1
) d
<where>
<if test="fireEquipmentName!=null">
d.fireEquipmentName LIKE '%${fireEquipmentName}%'
</if>
<if test="startTime != null and startTime != ''">
AND d.create_date &gt;= #{startTime}
</if>
<if test="endTime != null and endTime != ''">
AND d.create_date &lt;= #{endTime}
</if>
<if test="systemCode != null and systemCode != ''">
AND d.systemTypeCode = #{systemCode}
</if>
<if test="bizOrgCode != null and bizOrgCode != ''">
AND d.bizOrgCode like concat(#{bizOrgCode}, '%')
</if>
</where>
ORDER BY d.create_date desc
</select>
</mapper> </mapper>
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