Commit c8cb56fe authored by lisong's avatar lisong

修改电梯月度情况综述定时统计

parent fd9f770b
......@@ -95,7 +95,7 @@ public class AlertCalledDto extends BaseDto {
private String alertStageCode;
@ApiModelProperty(value = "组织机构")
private String orgCode;
private String bizOrgCode;
@ApiModelProperty(value = "使用单位")
private String useUnit;
......
......@@ -161,8 +161,8 @@ public class AlertCalled extends BaseEntity {
/**
* 组织机构
*/
@TableField("org_code")
private String orgCode;
@TableField("biz_org_code")
private String bizOrgCode;
/**
* 工单编号
......
......@@ -17,27 +17,19 @@
WHERE ORG_BRANCH_CODE LIKE concat(#{orgCode}, '%')) AS elevatorNum,
(SELECT COUNT(1)
FROM tz_alert_called
WHERE equipment_id IN (SELECT RECORD
FROM idx_biz_jg_supervision_info
WHERE ORG_BRANCH_CODE LIKE concat(#{orgCode}, '%') ) and call_time BETWEEN #{startDate} and #{endDate}) AS emergencyEventsAll,
WHERE biz_org_code LIKE concat(#{orgCode}, '%') and call_time BETWEEN #{startDate} and #{endDate}) AS emergencyEventsAll,
(SELECT COUNT(1)
FROM tz_alert_called
WHERE alarm_type_code = '960'
AND equipment_id IN (SELECT RECORD
FROM idx_biz_jg_supervision_info
WHERE ORG_BRANCH_CODE LIKE concat(#{orgCode}, '%')) and call_time BETWEEN #{startDate} and #{endDate}) AS trappedPeople,
AND biz_org_code LIKE concat(#{orgCode}, '%') and call_time BETWEEN #{startDate} and #{endDate}) AS trappedPeople,
(SELECT COUNT(1)
FROM tz_alert_called
WHERE alarm_type_code = '961'
AND equipment_id IN (SELECT RECORD
FROM idx_biz_jg_supervision_info
WHERE ORG_BRANCH_CODE LIKE concat(#{orgCode}, '%')) and call_time BETWEEN #{startDate} and #{endDate}) AS breakdownRescue,
AND biz_org_code LIKE concat(#{orgCode}, '%') and call_time BETWEEN #{startDate} and #{endDate}) AS breakdownRescue,
(SELECT COUNT(1)
FROM tz_alert_called
WHERE alarm_type_code = '962'
AND equipment_id IN (SELECT RECORD
FROM idx_biz_jg_supervision_info
WHERE ORG_BRANCH_CODE LIKE concat(#{orgCode}, '%')) and call_time BETWEEN #{startDate} and #{endDate}) AS complaint,
AND biz_org_code LIKE concat(#{orgCode}, '%') and call_time BETWEEN #{startDate} and #{endDate}) AS complaint,
(
SELECT (
(
......@@ -46,10 +38,7 @@
WHERE alert_called_id IN (
SELECT sequence_nbr
FROM tz_alert_called
WHERE equipment_id IN (
SELECT RECORD
FROM idx_biz_jg_supervision_info
WHERE ORG_BRANCH_CODE LIKE concat(#{orgCode}, '%')) and call_time BETWEEN #{startDate} and #{endDate})
WHERE biz_org_code LIKE concat(#{orgCode}, '%') and call_time BETWEEN #{startDate} and #{endDate})
AND field_code = 'trapped_num'
) - (
SELECT ifnull(SUM(field_value), 0)
......@@ -57,10 +46,7 @@
WHERE alert_called_id IN (
SELECT sequence_nbr
FROM tz_alert_called
WHERE equipment_id IN (
SELECT RECORD
FROM idx_biz_jg_supervision_info
WHERE ORG_BRANCH_CODE LIKE concat(#{orgCode}, '%')) and call_time BETWEEN #{startDate} and #{endDate})
WHERE biz_org_code LIKE concat(#{orgCode}, '%') and call_time BETWEEN #{startDate} and #{endDate})
AND field_code = 'die_num'
)
)) AS rescuePersonnel
......
......@@ -354,11 +354,13 @@
ifnull ( jui."LONGITUDE_LATITUDE"::json->> 'latitude', null ) AS latitude,
ifnull ( jui."LONGITUDE_LATITUDE"::json->> 'longitude', null ) AS longitude,
ifnull(jui.FACTORY_USE_SITE_STREET, '') AS street,
concat(jui.PROVINCE, '#',jui.CITY, '#',jui.COUNTY) AS regionCode
concat(jui.PROVINCE, '#',jui.CITY, '#',jui.COUNTY) AS regionCode,
jsi.ORG_BRANCH_CODE as orgCode
FROM
idx_biz_jg_use_info jui
LEFT JOIN idx_biz_jg_other_info joi ON jui.RECORD = joi.RECORD
LEFT JOIN idx_biz_jg_register_info jri ON jri.RECORD = jui.RECORD
LEFT JOIN idx_biz_jg_supervision_info jsi ON jsi.RECORD = jui.RECORD
WHERE
jri.EQU_LIST = '3000'
<if test="elevator.rescueCode!=null and elevator.rescueCode!='' ">
......
......@@ -592,6 +592,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
alertCalled.setCity(map.get("city").toString());
alertCalled.setDistrict(map.get("district").toString());
alertCalled.setRegionCode(map.get("regionCode").toString());
alertCalled.setBizOrgCode(map.get("orgCode").toString());
}
......
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