Commit 1ee4d61e authored by 刘林's avatar 刘林

Merge remote-tracking branch 'origin/develop_tzs_register' into develop_tzs_register

parents 1e5459b0 395c40b5
...@@ -84,4 +84,7 @@ public class UseUnitDto extends BaseDto { ...@@ -84,4 +84,7 @@ public class UseUnitDto extends BaseDto {
@ApiModelProperty(value = "人员信息") @ApiModelProperty(value = "人员信息")
List<DutyPersonDto> dutyPersonList; List<DutyPersonDto> dutyPersonList;
@ApiModelProperty(value = "值班电话,前端取的固定key为dutyPhone和维保块一样")
private String dutyPhone;
} }
...@@ -213,15 +213,15 @@ ...@@ -213,15 +213,15 @@
and a.skill_group = #{groupCode} and a.skill_group = #{groupCode}
<if test="workOrderNumber != null and workOrderNumber != ''"> <if test="workOrderNumber != null and workOrderNumber != ''">
AND a.work_order_number like AND a.work_order_number like
CONCAT(CONCAT('%',#{workOrderNumber}),'%') CONCAT('%',#{workOrderNumber},'%')
</if> </if>
<if test="creator != null and creator != ''"> <if test="creator != null and creator != ''">
AND a.rec_user_name like AND a.rec_user_name like
CONCAT(CONCAT('%',#{creator}),'%') CONCAT('%',#{creator},'%')
</if> </if>
<if test="emergency != null and emergency != ''"> <if test="emergency != null and emergency != ''">
AND a.emergency_person like AND a.emergency_person like
CONCAT(CONCAT('%',#{emergency}),'%') CONCAT('%',#{emergency},'%')
</if> </if>
<if test="emergencyTimeStart != null "> <if test="emergencyTimeStart != null ">
and #{emergencyTimeStart} <![CDATA[ <= ]]> and #{emergencyTimeStart} <![CDATA[ <= ]]>
...@@ -233,18 +233,18 @@ ...@@ -233,18 +233,18 @@
</if> </if>
<if test="emergencyCall != null and emergencyCall != ''"> <if test="emergencyCall != null and emergencyCall != ''">
AND a.emergency_call like AND a.emergency_call like
CONCAT(CONCAT('%',#{emergencyCall}),'%') CONCAT('%',#{emergencyCall},'%')
</if> </if>
<if test="deviceId != null and deviceId != ''"> <if test="deviceId != null and deviceId != ''">
AND a.device_id like CONCAT(CONCAT('%',#{deviceId}),'%') AND a.device_id like CONCAT('%',#{deviceId},'%')
</if> </if>
<if test="elevatorAddress != null and elevatorAddress != ''"> <if test="elevatorAddress != null and elevatorAddress != ''">
AND ibjui.ADDRESS like AND ibjui.ADDRESS like
CONCAT(CONCAT('%',#{elevatorAddress}),'%') CONCAT('%',#{elevatorAddress},'%')
</if> </if>
<if test="district != null and district != ''"> <if test="district != null and district != ''">
AND a.district like AND a.district like
CONCAT(CONCAT('%',#{district}),'%') CONCAT('%',#{district},'%')
</if> </if>
<if test="alertType != null and alertType != ''"> <if test="alertType != null and alertType != ''">
AND a.alarm_type_code = #{alertType} AND a.alarm_type_code = #{alertType}
...@@ -296,11 +296,23 @@ ...@@ -296,11 +296,23 @@
) as ) as
rescueComplete rescueComplete
FROM FROM
tz_alert_called tz left join tcb_elevator el on tz.equipment_id = el.sequence_nbr where tz.is_delete=0 tz_alert_called tz
left join
(SELECT
jui.RECORD AS sequenceNbr,
concat_ws('#', jui.PROVINCE,jui.CITY,jui.COUNTY) AS regionCode
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
WHERE
jri.EQU_LIST = '3000'
) el on tz.equipment_id = el.sequenceNbr
where tz.is_delete=0
and tz.call_time >= (select current_date()) and tz.call_time >= (select current_date())
and (select date_add(current_date(), interval 1 day)) >= tz.call_time and (select date_add(current_date(), interval 1 day)) >= tz.call_time
<if test="regionCode != null and regionCode != ''"> <if test="regionCode != null and regionCode != ''">
AND el.region_code like CONCAT(CONCAT('%',#{regionCode}),'%') AND el.regionCode like CONCAT('%',#{regionCode},'%')
</if> </if>
</select> </select>
<select id="getImportantEventCount" resultType="java.util.Map"> <select id="getImportantEventCount" resultType="java.util.Map">
...@@ -324,20 +336,32 @@ ...@@ -324,20 +336,32 @@
) afv ON ac.sequence_nbr = afv.alert_called_id ) afv ON ac.sequence_nbr = afv.alert_called_id
WHERE WHERE
ac.alarm_type_code = '960' and ac.is_delete=0 ac.alarm_type_code = '960' and ac.is_delete=0
) tzs left join tcb_elevator te on tzs.equipment_id = te.sequence_nbr ) tzs
left join
(
SELECT
jui.RECORD AS sequenceNbr,
concat_ws('#', jui.PROVINCE,jui.CITY,jui.COUNTY) AS regionCode
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
WHERE
jri.EQU_LIST = '3000'
) te on tzs.equipment_id = te.sequenceNbr
where 1=1 where 1=1
and tzs.call_time >= (select current_date()) and tzs.call_time >= (select current_date())
and (select date_add(current_date(), interval 1 day)) >= tzs.call_time and (select date_add(current_date(), interval 1 day)) >= tzs.call_time
<if test="regionCode != null and regionCode != ''"> <if test="regionCode != null and regionCode != ''">
AND te.region_code like CONCAT(CONCAT('%',#{regionCode}),'%') AND te.regionCode like CONCAT('%',#{regionCode},'%')
</if> </if>
</select> </select>
<select id="getImportantEventDetail" resultType="java.util.Map"> <select id="getImportantEventDetail" resultType="java.util.Map">
select tzs.contact_phone,tzs.rec_user_name, select tzs.contact_phone,tzs.rec_user_name,
tzs.alert_stage as type,tzs.emergency_person,tzs.alarm_type,tzs.alert_source,tzs.address, tzs.alert_stage as type,tzs.emergency_person,tzs.alarm_type,tzs.alert_source,tzs.address,
tzs.device_id,tzs.contact_user,tzs.alarm_type_code,tzs.sequence_nbr,date_format(tzs.call_time,"%Y-%m-%d %H:%i:%S") call_time, tzs.device_id,tzs.contact_user,tzs.alarm_type_code,tzs.sequence_nbr,date_format(tzs.call_time,'%Y-%m-%d %H:%i:%S') call_time,
tzs.rec_user_id,tzs.registration_code,tzs.emergency_call,tzs.type_code,tzs.equipment_id tzs.rec_user_id,tzs.registration_code,tzs.emergency_call,tzs.type_code,tzs.equipment_id
,te.latitude ,te.region_code ,te.longitude,tzs.injured from ( ,te.latitude ,te.regionCode as region_code ,te.longitude,tzs.injured from (
SELECT SELECT
ac.*,'有伤亡' as injured ac.*,'有伤亡' as injured
FROM FROM
...@@ -357,21 +381,35 @@ ...@@ -357,21 +381,35 @@
) afv ON ac.sequence_nbr = afv.alert_called_id ) afv ON ac.sequence_nbr = afv.alert_called_id
WHERE WHERE
ac.alarm_type_code = '960' and ac.is_delete=0 ac.alarm_type_code = '960' and ac.is_delete=0
) tzs left join tcb_elevator te on tzs.equipment_id = te.sequence_nbr ) tzs
left join
(
SELECT
jui.RECORD AS sequenceNbr,
concat_ws('#', jui.PROVINCE,jui.CITY,jui.COUNTY) AS regionCode,
ifnull ( jui."LONGITUDE_LATITUDE"::json->> 'latitude', null ) AS latitude,
ifnull ( jui."LONGITUDE_LATITUDE"::json->> 'longitude', null ) AS longitude
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
WHERE
jri.EQU_LIST = '3000'
) te on tzs.equipment_id = te.sequenceNbr
where 1=1 where 1=1
and tzs.call_time >= (select current_date()) and tzs.call_time >= (select current_date())
and (select date_add(current_date(), interval 1 day)) >= tzs.call_time and (select date_add(current_date(), interval 1 day)) >= tzs.call_time
<if test="regionCode != null and regionCode != ''"> <if test="regionCode != null and regionCode != ''">
AND te.region_code like CONCAT(CONCAT('%',#{regionCode}),'%') AND te.regionCode like CONCAT('%',#{regionCode},'%')
</if> </if>
</select> </select>
<select id="getTodayEmergencyDetail" resultType="java.util.Map"> <select id="getTodayEmergencyDetail" resultType="java.util.Map">
select tzs.contact_phone,tzs.rec_user_name, select tzs.contact_phone,tzs.rec_user_name,
tzs.alert_stage as type,tzs.emergency_person,tzs.alarm_type,tzs.alert_source,tzs.address, tzs.alert_stage as type,tzs.emergency_person,tzs.alarm_type,tzs.alert_source,tzs.address,
tzs.device_id,tzs.contact_user,tzs.alarm_type_code,tzs.sequence_nbr,date_format(tzs.call_time,"%Y-%m-%d %H:%i:%S") call_time, tzs.device_id,tzs.contact_user,tzs.alarm_type_code,tzs.sequence_nbr,date_format(tzs.call_time,'%Y-%m-%d %H:%i:%S') call_time,
tzs.rec_user_id,tzs.registration_code,tzs.emergency_call,tzs.type_code,tzs.equipment_id tzs.rec_user_id,tzs.registration_code,tzs.emergency_call,tzs.type_code,tzs.equipment_id
,te.latitude ,te.region_code ,te.longitude,tzs.injured from ( ,te.latitude ,te.regionCode as region_code ,te.longitude,tzs.injured from (
SELECT SELECT
ac.*,'有伤亡' as injured ac.*,'有伤亡' as injured
FROM FROM
...@@ -390,12 +428,26 @@ ...@@ -390,12 +428,26 @@
) afv ON ac.sequence_nbr = afv.alert_called_id ) afv ON ac.sequence_nbr = afv.alert_called_id
WHERE WHERE
ac.alarm_type_code = '960' and ac.is_delete=0 ac.alarm_type_code = '960' and ac.is_delete=0
) tzs left join tcb_elevator te on tzs.equipment_id = te.sequence_nbr ) tzs
left join
(
SELECT
jui.RECORD AS sequenceNbr,
concat_ws('#', jui.PROVINCE,jui.CITY,jui.COUNTY) AS regionCode,
ifnull ( jui."LONGITUDE_LATITUDE"::json->> 'latitude', null ) AS latitude,
ifnull ( jui."LONGITUDE_LATITUDE"::json->> 'longitude', null ) AS longitude
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
WHERE
jri.EQU_LIST = '3000'
) te on tzs.equipment_id = te.sequenceNbr
where 1=1 where 1=1
and tzs.call_time >= (select current_date()) and tzs.call_time >= (select current_date())
and (select date_add(current_date(), interval 1 day)) >= tzs.call_time and (select date_add(current_date(), interval 1 day)) >= tzs.call_time
<if test="regionCode != null and regionCode != ''"> <if test="regionCode != null and regionCode != ''">
AND te.region_code like CONCAT(CONCAT('%',#{regionCode}),'%') AND te.regionCode like CONCAT('%',#{regionCode},'%')
</if> </if>
<if test="rescueTotal != null and rescueTotal != ''"> <if test="rescueTotal != null and rescueTotal != ''">
AND tzs.alert_stage_code in ('860','861','862') AND tzs.alert_stage_code in ('860','861','862')
...@@ -403,14 +455,12 @@ ...@@ -403,14 +455,12 @@
<if test="rescueComplete != null and rescueComplete != ''"> <if test="rescueComplete != null and rescueComplete != ''">
AND tzs.alert_stage_code in ('864','865','866') AND tzs.alert_stage_code in ('864','865','866')
</if> </if>
union all union all
select tzs.contact_phone,tzs.rec_user_name, select tzs.contact_phone,tzs.rec_user_name,
tzs.alert_stage as type,tzs.emergency_person,tzs.alarm_type,tzs.alert_source,tzs.address, tzs.alert_stage as type,tzs.emergency_person,tzs.alarm_type,tzs.alert_source,tzs.address,
tzs.device_id,tzs.contact_user,tzs.alarm_type_code,tzs.sequence_nbr,date_format(tzs.call_time,"%Y-%m-%d %H:%i:%S") call_time, tzs.device_id,tzs.contact_user,tzs.alarm_type_code,tzs.sequence_nbr,date_format(tzs.call_time,'%Y-%m-%d %H:%i:%S') call_time,
tzs.rec_user_id,tzs.registration_code,tzs.emergency_call,tzs.type_code,tzs.equipment_id tzs.rec_user_id,tzs.registration_code,tzs.emergency_call,tzs.type_code,tzs.equipment_id
,te.latitude ,te.region_code ,te.longitude,tzs.injured from ( ,te.latitude ,te.regionCode as region_code ,te.longitude,tzs.injured from (
select *,'无伤亡' as injured from tz_alert_called where sequence_nbr not in ( select *,'无伤亡' as injured from tz_alert_called where sequence_nbr not in (
SELECT SELECT
alert_called_id alert_called_id
...@@ -423,13 +473,26 @@ ...@@ -423,13 +473,26 @@
and tz_alert_form_value.is_delete=0 and tz_alert_form_value.is_delete=0
group by alert_called_id group by alert_called_id
) and alarm_type_code = '960' and is_delete=0 ) and alarm_type_code = '960' and is_delete=0
) tzs left join tcb_elevator te on tzs.equipment_id = te.sequence_nbr ) tzs
left join
(
SELECT
jui.RECORD AS sequenceNbr,
concat_ws('#', jui.PROVINCE,jui.CITY,jui.COUNTY) AS regionCode,
ifnull ( jui."LONGITUDE_LATITUDE"::json->> 'latitude', null ) AS latitude,
ifnull ( jui."LONGITUDE_LATITUDE"::json->> 'longitude', null ) AS longitude
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
WHERE
jri.EQU_LIST = '3000'
) te on tzs.equipment_id = te.sequenceNbr
where 1=1 where 1=1
and tzs.call_time >= (select current_date()) and tzs.call_time >= (select current_date())
and (select date_add(current_date(), interval 1 day)) >= tzs.call_time and (select date_add(current_date(), interval 1 day)) >= tzs.call_time
<if test="regionCode != null and regionCode != ''"> <if test="regionCode != null and regionCode != ''">
AND te.region_code like CONCAT(CONCAT('%',#{regionCode}),'%') AND te.regionCode like CONCAT('%',#{regionCode},'%')
</if> </if>
<if test="rescueTotal != null and rescueTotal != ''"> <if test="rescueTotal != null and rescueTotal != ''">
AND tzs.alert_stage_code in ('860','861','862') AND tzs.alert_stage_code in ('860','861','862')
...@@ -487,7 +550,18 @@ ...@@ -487,7 +550,18 @@
a.call_time as reportTime, a.call_time as reportTime,
p.feedback_finish_time as finishTime p.feedback_finish_time as finishTime
from tz_alert_called a from tz_alert_called a
LEFT JOIN tcb_elevator e on e.sequence_nbr = a.equipment_id LEFT JOIN
(
SELECT
jui.RECORD AS sequenceNbr,
ifnull ( jui.ADDRESS, null ) AS address
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
WHERE
jri.EQU_LIST = '3000'
) e on e.sequenceNbr = a.equipment_id
LEFT JOIN tz_dispatch_paper p on p.alert_id = a.sequence_nbr LEFT JOIN tz_dispatch_paper p on p.alert_id = a.sequence_nbr
where a.emergency_call =#{phone} where a.emergency_call =#{phone}
and a.is_delete = 0 and a.is_delete = 0
...@@ -581,7 +655,7 @@ ...@@ -581,7 +655,7 @@
SELECT SELECT
a.sequence_nbr AS alertId, a.sequence_nbr AS alertId,
a.region_code AS regionCode, a.region_code AS regionCode,
e.rescue_code AS rescueCode, e.rescueCode AS rescueCode,
a.alarm_type_code AS alarmTypeCode, a.alarm_type_code AS alarmTypeCode,
a.alarm_type AS alarmType, a.alarm_type AS alarmType,
CONCAT(e.province ,e.city ,e.district) AS area, CONCAT(e.province ,e.city ,e.district) AS area,
...@@ -590,15 +664,35 @@ ...@@ -590,15 +664,35 @@
e.longitude AS longitude, e.longitude AS longitude,
e.latitude AS latitude, e.latitude AS latitude,
a.alert_stage AS alertStatus, a.alert_stage AS alertStatus,
e.sequence_nbr AS elevatorId, e.sequenceNbr AS elevatorId,
e.register_code AS elevatorCode, e.registerCode AS elevatorCode,
p.feedback_finish_time AS finishTime p.feedback_finish_time AS finishTime
FROM tz_alert_called a FROM tz_alert_called a
<choose> <choose>
<when test="equipmentClassCode == '3000'"> <when test="equipmentClassCode == '3000'">
LEFT JOIN tcb_elevator e ON e.sequence_nbr = a.equipment_id and a.equipment_classification_code = #{equipmentClassCode} LEFT JOIN (SELECT
jui.RECORD AS sequenceNbr,
ifnull ( jui.USE_INNER_CODE, null ) AS innerNum,
ifnull ( joi.CODE96333, null ) AS rescueCode,
ifnull ( joi.SUPERVISORY_CODE, null ) AS registerCode,
ifnull ( jui.ADDRESS, null ) AS address,
ifnull ( jui.PROVINCE_NAME, null ) AS province,
ifnull ( jui.CITY_NAME, null ) AS city,
ifnull ( jui.COUNTY_NAME, null ) AS district,
ifnull ( jui."LONGITUDE_LATITUDE"::json->> 'latitude', null ) AS latitude,
ifnull ( jui."LONGITUDE_LATITUDE"::json->> 'longitude', null ) AS longitude
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
WHERE
jri.EQU_LIST = '3000') e ON e.sequenceNbr = a.equipment_id
LEFT JOIN tz_dispatch_paper p ON p.alert_id = a.sequence_nbr LEFT JOIN tz_dispatch_paper p ON p.alert_id = a.sequence_nbr
where a.is_delete = 0 AND a.alert_status = 1 AND e.rescue_code = #{equipmentCode} where
a.is_delete = 0
AND a.alert_status = 1
AND e.rescueCode = #{equipmentCode}
and a.equipment_classification_code = #{equipmentClassCode}
</when> </when>
<otherwise> <otherwise>
AND a.alert_status = 0 AND a.alert_status = 0
...@@ -621,9 +715,23 @@ ...@@ -621,9 +715,23 @@
FROM tz_alert_called a FROM tz_alert_called a
<choose> <choose>
<when test="equipmentClassCode == '3000'"> <when test="equipmentClassCode == '3000'">
LEFT JOIN tcb_elevator e ON e.sequence_nbr = a.equipment_id and a.equipment_classification_code = #{equipmentClassCode} LEFT JOIN
(SELECT
jui.RECORD AS sequenceNbr,
ifnull ( joi.CODE96333, null ) AS rescueCode,
ifnull ( joi.SUPERVISORY_CODE, null ) AS registerCode
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
WHERE
jri.EQU_LIST = '3000') e ON e.sequenceNbr = a.equipment_id
LEFT JOIN tz_dispatch_paper p ON p.alert_id = a.sequence_nbr LEFT JOIN tz_dispatch_paper p ON p.alert_id = a.sequence_nbr
where a.is_delete = 0 AND a.alert_status = 1 AND e.rescue_code = #{equipmentCode} where
a.is_delete = 0
AND a.alert_status = 1
AND e.rescueCode = #{equipmentCode}
and a.equipment_classification_code = #{equipmentClassCode}
</when> </when>
<otherwise> <otherwise>
AND a.alert_status = 0 AND a.alert_status = 0
...@@ -678,15 +786,15 @@ ...@@ -678,15 +786,15 @@
and a.biz_org_code like concat(#{orgCode}, '%') and a.biz_org_code like concat(#{orgCode}, '%')
<if test="dto.workOrderNumber != null and dto.workOrderNumber != ''"> <if test="dto.workOrderNumber != null and dto.workOrderNumber != ''">
AND a.work_order_number like AND a.work_order_number like
CONCAT(CONCAT('%',#{dto.workOrderNumber}),'%') CONCAT('%',#{dto.workOrderNumber},'%')
</if> </if>
<if test="dto.creator != null and dto.creator != ''"> <if test="dto.creator != null and dto.creator != ''">
AND a.rec_user_name like AND a.rec_user_name like
CONCAT(CONCAT('%',#{dto.creator}),'%') CONCAT('%',#{dto.creator},'%')
</if> </if>
<if test="dto.emergency != null and dto.emergency != ''"> <if test="dto.emergency != null and dto.emergency != ''">
AND a.emergency_person like AND a.emergency_person like
CONCAT(CONCAT('%',#{dto.emergency}),'%') CONCAT('%',#{dto.emergency},'%')
</if> </if>
<if test="dto.emergencyTimeStart != null "> <if test="dto.emergencyTimeStart != null ">
and #{dto.emergencyTimeStart} <![CDATA[ <= ]]> and #{dto.emergencyTimeStart} <![CDATA[ <= ]]>
...@@ -698,18 +806,18 @@ ...@@ -698,18 +806,18 @@
</if> </if>
<if test="dto.emergencyCall != null and dto.emergencyCall != ''"> <if test="dto.emergencyCall != null and dto.emergencyCall != ''">
AND a.emergency_call like AND a.emergency_call like
CONCAT(CONCAT('%',#{dto.emergencyCall}),'%') CONCAT('%',#{dto.emergencyCall},'%')
</if> </if>
<if test="dto.deviceId != null and dto.deviceId != ''"> <if test="dto.deviceId != null and dto.deviceId != ''">
AND a.device_id like CONCAT(CONCAT('%',#{dto.deviceId}),'%') AND a.device_id like CONCAT('%',#{dto.deviceId},'%')
</if> </if>
<if test="dto.elevatorAddress != null and dto.elevatorAddress != ''"> <if test="dto.elevatorAddress != null and dto.elevatorAddress != ''">
AND ibjui.ADDRESS like AND ibjui.ADDRESS like
CONCAT(CONCAT('%',#{dto.elevatorAddress}),'%') CONCAT('%',#{dto.elevatorAddress},'%')
</if> </if>
<if test="dto.district != null and dto.district != ''"> <if test="dto.district != null and dto.district != ''">
AND a.district like AND a.district like
CONCAT(CONCAT('%',#{dto.district}),'%') CONCAT('%',#{dto.district},'%')
</if> </if>
<if test="dto.alertType != null and dto.alertType != ''"> <if test="dto.alertType != null and dto.alertType != ''">
AND a.alarm_type_code = #{dto.alertType} AND a.alarm_type_code = #{dto.alertType}
......
...@@ -28,8 +28,16 @@ ...@@ -28,8 +28,16 @@
) AS distance ) AS distance
from tz_dispatch_task ta from tz_dispatch_task ta
left JOIN tz_alert_called al on al.sequence_nbr = ta.alert_id left JOIN tz_alert_called al on al.sequence_nbr = ta.alert_id
left JOIN tcb_elevator el on el.sequence_nbr = al.equipment_id left JOIN (SELECT
jui.RECORD AS sequenceNbr,
ifnull ( jui."LONGITUDE_LATITUDE"::json->> 'latitude', null ) AS latitude,
ifnull ( jui."LONGITUDE_LATITUDE"::json->> 'longitude', null ) AS longitude
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
WHERE
jri.EQU_LIST = '3000') el on el.sequenceNbr = al.equipment_id
where ta.sequence_nbr = #{taskId} where ta.sequence_nbr = #{taskId}
</select> </select>
...@@ -83,7 +91,16 @@ ...@@ -83,7 +91,16 @@
p.feedback_finish_time as finishTime p.feedback_finish_time as finishTime
from tz_dispatch_task t from tz_dispatch_task t
LEFT JOIN tz_alert_called a on a.sequence_nbr = t.alert_id LEFT JOIN tz_alert_called a on a.sequence_nbr = t.alert_id
LEFT JOIN tcb_elevator e on e.sequence_nbr = a.equipment_id LEFT JOIN
(SELECT
jui.RECORD AS sequenceNbr,
ifnull ( jui.ADDRESS, null ) AS address
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
WHERE
jri.EQU_LIST = '3000') e on e.sequenceNbr = a.equipment_id
LEFT JOIN tz_dispatch_paper p on p.sequence_nbr = t.paper_id LEFT JOIN tz_dispatch_paper p on p.sequence_nbr = t.paper_id
where t.response_user_tel =#{phone} where t.response_user_tel =#{phone}
and a.alarm_type_code = #{typeCode} and a.alarm_type_code = #{typeCode}
......
...@@ -310,16 +310,16 @@ ...@@ -310,16 +310,16 @@
1) as maintainPeriodName, 1) as maintainPeriodName,
(SELECT ME_UNIT_NAME FROM idx_biz_jg_maintenance_record_info WHERE RECORD = jui.RECORD ORDER BY REC_DATE DESC (SELECT ME_UNIT_NAME FROM idx_biz_jg_maintenance_record_info WHERE RECORD = jui.RECORD ORDER BY REC_DATE DESC
limit 1) as maintainUnit, limit 1) as maintainUnit,
(SELECT ME_MASTER FROM idx_biz_jg_maintenance_record_info WHERE RECORD = jui.RECORD ORDER BY REC_DATE DESC limit (SELECT ME_MASTER FROM idx_biz_jg_maintenance_record_info WHERE RECORD = jui.RECORD ORDER BY REC_DATE DESC limit
1) as maintainLeader, 1) as maintainLeader,
tbei.contact_phone as contactPhone,
jui.RECORD AS sequenceNbr jui.RECORD AS sequenceNbr
FROM idx_biz_jg_use_info jui 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_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_register_info jri ON jri.RECORD = jui.RECORD
LEFT JOIN idx_biz_jg_factory_info jfi ON jui.RECORD = jfi.RECORD LEFT JOIN idx_biz_jg_factory_info jfi ON jui.RECORD = jfi.RECORD
LEFT JOIN idx_biz_jg_tech_params_elevator tpe ON tpe.RECORD = jui.RECORD LEFT JOIN idx_biz_jg_tech_params_elevator tpe ON tpe.RECORD = jui.RECORD
LEFT JOIN tz_base_enterprise_info tbei ON jui.USE_UNIT_CREDIT_CODE = tbei.use_code
WHERE jui.RECORD = #{record} WHERE jui.RECORD = #{record}
</select> </select>
<select id="selectFiles" resultType="java.util.Map"> <select id="selectFiles" resultType="java.util.Map">
...@@ -517,20 +517,22 @@ ...@@ -517,20 +517,22 @@
<select id="selectMtByAlertId" resultType="java.util.Map"> <select id="selectMtByAlertId" resultType="java.util.Map">
SELECT SELECT
SEQUENCE_NBR AS sequenceNbr, ibjmri.SEQUENCE_NBR AS sequenceNbr,
ME_MASTER AS userName1, ME_MASTER AS userName1,
ME_MASTER_PHONE AS phone1, ME_MASTER_PHONE AS phone1,
ME_MASTER1 AS userName2, ME_MASTER1 AS userName2,
ME_MASTER1_PHONE AS phone2, ME_MASTER1_PHONE AS phone2,
'' AS address,
ME_UNIT_NAME AS unitName, ME_UNIT_NAME AS unitName,
ME_UNIT_CREDIT_CODE AS useCode ME_UNIT_CREDIT_CODE AS useCode,
tbei.address,
tbei.contact_phone as dutyPhone
FROM FROM
idx_biz_jg_maintenance_record_info ibjmri idx_biz_jg_maintenance_record_info ibjmri
left join tz_base_enterprise_info tbei ON ibjmri.ME_UNIT_CREDIT_CODE = tbei.use_code
where where
ibjmri.RECORD = #{sequenceNbr} ibjmri.RECORD = #{sequenceNbr}
order by ibjmri.INFORM_START desc order by ibjmri.INFORM_START desc
limit 1 limit 1
</select> </select>
<select id="selectUseUnitByAlertId" resultType="java.util.Map"> <select id="selectUseUnitByAlertId" resultType="java.util.Map">
...@@ -539,10 +541,14 @@ ...@@ -539,10 +541,14 @@
ibjui.PHONE AS managerPhone, ibjui.PHONE AS managerPhone,
ibjui.USE_UNIT_NAME as useUnitName, ibjui.USE_UNIT_NAME as useUnitName,
tbei.address AS address, tbei.address AS address,
tbei.sequence_nbr AS unitId tbei.sequence_nbr AS unitId,
tbei.contact_phone as dutyPhone,
u."name" as mainChargePersonName,
u.phone as mainChargePhone
FROM FROM
idx_biz_jg_use_info ibjui idx_biz_jg_use_info ibjui
LEFT JOIN tz_base_enterprise_info tbei ON ibjui.USE_UNIT_CREDIT_CODE = tbei.use_code LEFT JOIN tz_base_enterprise_info tbei ON ibjui.USE_UNIT_CREDIT_CODE = tbei.use_code
LEFT JOIN (SELECT name, phone, unit_code FROM "amos_tzs_biz"."tzs_user_info" WHERE "post" LIKE '%6548%' AND "is_delete" = 'f' ORDER BY "rec_date"DESC LIMIT 1 ) u on u.unit_code = ibjui.USE_UNIT_CREDIT_CODE
WHERE WHERE
RECORD = #{sequenceNbr} RECORD = #{sequenceNbr}
</select> </select>
......
...@@ -399,6 +399,7 @@ public class MaintenanceUnitController extends BaseController { ...@@ -399,6 +399,7 @@ public class MaintenanceUnitController extends BaseController {
maintenanceUnitVo.setAddress(ObjectUtils.isEmpty(list.get(0).get("address")) ? null : String.valueOf(list.get(0).get("address"))); maintenanceUnitVo.setAddress(ObjectUtils.isEmpty(list.get(0).get("address")) ? null : String.valueOf(list.get(0).get("address")));
maintenanceUnitVo.setId(ObjectUtils.isEmpty(list.get(0).get("sequenceNbr")) ? null : String.valueOf(list.get(0).get("sequenceNbr"))); maintenanceUnitVo.setId(ObjectUtils.isEmpty(list.get(0).get("sequenceNbr")) ? null : String.valueOf(list.get(0).get("sequenceNbr")));
maintenanceUnitVo.setSocialCreditCode(ObjectUtils.isEmpty(list.get(0).get("useCode")) ? null : String.valueOf(list.get(0).get("useCode"))); maintenanceUnitVo.setSocialCreditCode(ObjectUtils.isEmpty(list.get(0).get("useCode")) ? null : String.valueOf(list.get(0).get("useCode")));
maintenanceUnitVo.setDutyPhone(ObjectUtils.isEmpty(list.get(0).get("dutyPhone")) ? null : String.valueOf(list.get(0).get("dutyPhone")));
List<DutyPersonDto> dutyPersonList = new ArrayList<DutyPersonDto>(); List<DutyPersonDto> dutyPersonList = new ArrayList<DutyPersonDto>();
DutyPersonDto principal = new DutyPersonDto(); DutyPersonDto principal = new DutyPersonDto();
principal.setDeptName("主要负责人1"); principal.setDeptName("主要负责人1");
......
...@@ -230,6 +230,7 @@ public class UseUnitController extends BaseController { ...@@ -230,6 +230,7 @@ public class UseUnitController extends BaseController {
throw new BadRequest("使用单位未找到"); throw new BadRequest("使用单位未找到");
} }
UseUnitDto useUnitVo = new UseUnitDto(); UseUnitDto useUnitVo = new UseUnitDto();
useUnitVo.setDutyPhone(ObjectUtils.isEmpty(useUnitMap.get("dutyPhone")) ? null : String.valueOf(useUnitMap.get("dutyPhone")));
useUnitVo.setUseUnitName(ObjectUtils.isEmpty(useUnitMap.get("useUnitName")) ? null : String.valueOf(useUnitMap.get("useUnitName"))); useUnitVo.setUseUnitName(ObjectUtils.isEmpty(useUnitMap.get("useUnitName")) ? null : String.valueOf(useUnitMap.get("useUnitName")));
useUnitVo.setAddress(ObjectUtils.isEmpty(useUnitMap.get("address")) ? null : String.valueOf(useUnitMap.get("address"))); useUnitVo.setAddress(ObjectUtils.isEmpty(useUnitMap.get("address")) ? null : String.valueOf(useUnitMap.get("address")));
useUnitVo.setSequenceNbr(ObjectUtils.isEmpty(useUnitMap.get("unitId")) ? null : Long.valueOf(useUnitMap.get( useUnitVo.setSequenceNbr(ObjectUtils.isEmpty(useUnitMap.get("unitId")) ? null : Long.valueOf(useUnitMap.get(
...@@ -237,10 +238,8 @@ public class UseUnitController extends BaseController { ...@@ -237,10 +238,8 @@ public class UseUnitController extends BaseController {
List<DutyPersonDto> dutyPersonList = new ArrayList<DutyPersonDto>(); List<DutyPersonDto> dutyPersonList = new ArrayList<DutyPersonDto>();
DutyPersonDto principal = new DutyPersonDto(); DutyPersonDto principal = new DutyPersonDto();
principal.setDeptName("主要负责人"); principal.setDeptName("主要负责人");
// todo 暂时置空 principal.setPhone(ObjectUtils.isEmpty(useUnitMap.get("mainChargePhone")) ? null : String.valueOf(useUnitMap.get("mainChargePhone")));
principal.setPhone(null); principal.setUserName(ObjectUtils.isEmpty(useUnitMap.get("mainChargePersonName")) ? null : String.valueOf(useUnitMap.get("mainChargePersonName")));
principal.setUserId(null);
principal.setUserName(null);
dutyPersonList.add(principal); dutyPersonList.add(principal);
DutyPersonDto manager = new DutyPersonDto(); DutyPersonDto manager = new DutyPersonDto();
manager.setDeptName("电梯安全管理员"); manager.setDeptName("电梯安全管理员");
......
...@@ -127,4 +127,7 @@ public class JgUseRegistrationManageDto extends BaseDto { ...@@ -127,4 +127,7 @@ public class JgUseRegistrationManageDto extends BaseDto {
@ApiModelProperty("补证日期") @ApiModelProperty("补证日期")
private Date reissueDate; private Date reissueDate;
@ApiModelProperty("是否在流程中,值:true / false ")
private String certInBusinessFlag;
} }
...@@ -141,6 +141,9 @@ ...@@ -141,6 +141,9 @@
<if test="dto.carNumber != null and dto.carNumber != ''"> <if test="dto.carNumber != null and dto.carNumber != ''">
and tjurm.car_number LIKE CONCAT('%', #{dto.carNumber}, '%') and tjurm.car_number LIKE CONCAT('%', #{dto.carNumber}, '%')
</if> </if>
<if test="dto.certInBusinessFlag != null and dto.certInBusinessFlag != '' and dto.certInBusinessFlag == 'false'">
and NOT EXISTS ( <include refid="useRegCertInBusiness"/> )
</if>
ORDER BY ORDER BY
<if test="sort != null"> <if test="sort != null">
tjurm.${sort.field} ${sort.sortType}, tjurm.${sort.field} ${sort.sortType},
...@@ -148,6 +151,52 @@ ...@@ -148,6 +151,52 @@
tjurm.rec_date DESC tjurm.rec_date DESC
</where> </where>
</select> </select>
<sql id="useRegCertInBusiness">
SELECT 1
FROM (SELECT use_registration_code
FROM tzs_jg_certificate_replenish
WHERE is_delete = 0
AND apply_status NOT IN ('6610', '6614', '6615', '6617', '6616')
UNION ALL
SELECT use_registration_code
FROM tzs_jg_change_registration_reform
WHERE is_delete = 0
AND status NOT IN ('使用单位待提交', '一级受理已驳回', '使用单位已撤回', '已作废', '已完成')
UNION ALL
SELECT use_registration_code
FROM tzs_jg_change_registration_transfer
WHERE is_delete = 0
AND audit_status NOT IN ('使用单位待提交', '一级受理已驳回', '使用单位已撤回', '已作废', '已完成')
UNION ALL
SELECT use_registration_code
FROM tzs_jg_enable_disable
WHERE is_delete = 0
AND audit_status NOT IN ('待提交', '已驳回', '已撤回', '已作废', '已完成')
UNION ALL
SELECT use_registration_code
FROM tzs_jg_over_design_service_life
WHERE is_delete = 0
AND status NOT IN ('使用单位待提交', '一级受理已驳回', '使用单位已撤回', '已作废', '已完成')
UNION ALL
SELECT use_registration_code
FROM tzs_jg_scrap_cancel
WHERE is_delete = 0
AND audit_status NOT IN ('使用单位待提交', '一级受理已驳回', '使用单位已撤回', '已作废', '已完成')
UNION ALL
SELECT use_registration_code
FROM tzs_jg_use_registration
WHERE is_delete = 0
AND status NOT IN ('使用单位待提交', '一级受理已驳回', '使用单位已撤回', '已作废', '已完成')
UNION ALL
SELECT use_registration_code
FROM tzs_jg_vehicle_information
WHERE is_delete = 0
AND status NOT IN ('使用单位待提交', '一级受理已驳回', '使用单位已撤回', '已作废', '已完成')) A
WHERE tjurm.use_registration_code = A.use_registration_code
</sql>
<select id="countCertificateByReginCode" resultType="java.lang.Long"> <select id="countCertificateByReginCode" resultType="java.lang.Long">
select select
count(1) count(1)
......
...@@ -204,8 +204,8 @@ public class SafetyProblemTracingGenServiceImpl{ ...@@ -204,8 +204,8 @@ public class SafetyProblemTracingGenServiceImpl{
} }
} }
@Scheduled(cron = "0 0 1 * * ?") // @Scheduled(cron = "0 0 1 * * ?")
@SchedulerLock(name = "executeOverDesignLifeCheck", lockAtMostFor = "PT5H", lockAtLeastFor = "PT10M") // @SchedulerLock(name = "executeOverDesignLifeCheck", lockAtMostFor = "PT5H", lockAtLeastFor = "PT10M")
public void executeOverDesignLife() { public void executeOverDesignLife() {
executeOverDesignLifeCheck(); executeOverDesignLifeCheck();
} }
......
...@@ -41,11 +41,6 @@ ...@@ -41,11 +41,6 @@
"image": "upload/tzs/common/image/使用登记.png" "image": "upload/tzs/common/image/使用登记.png"
}, },
{ {
"name": "补证登记",
"code": "DJ_BZ",
"image": "upload/tzs/common/image/补证登记.png"
},
{
"name": "改造变更登记", "name": "改造变更登记",
"code": "DJ_GZ", "code": "DJ_GZ",
"image": "upload/tzs/common/image/改造变更登记.png" "image": "upload/tzs/common/image/改造变更登记.png"
...@@ -67,9 +62,9 @@ ...@@ -67,9 +62,9 @@
"image": "upload/tzs/common/image/更名变更登记.png" "image": "upload/tzs/common/image/更名变更登记.png"
}, },
{ {
"name": "超设计使用年限变更", "name": "补证登记",
"code": "DJ_CSJ", "code": "DJ_BZ",
"image": "upload/tzs/common/image/超设计使用年限.png" "image": "upload/tzs/common/image/补证登记.png"
} }
], ],
"WBBA": [ "WBBA": [
......
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