Commit 8cb51d15 authored by 李松's avatar 李松

添加查询字典值方法

parent f35806a1
......@@ -96,6 +96,12 @@ public interface AlertCalledMapper extends BaseMapper<AlertCalled> {
@Param("sortRule") String sortRule,
@Param("groupCode") String groupCode,
@Param("ids") List<String> ids);
/**
* 根据查询条件返回警情记录(大屏应急处理使用)
* @param
* @return
*/
Page<List<AlertCalledQueryDto>> getAlertCalledRecords(IPage<AlertCalledQueryDto> page, @Param("dto")AlertCalledQueryDto dto);
Map<String, Integer> getTodayEmergencyCount(String regionCode);
......@@ -138,4 +144,6 @@ public interface AlertCalledMapper extends BaseMapper<AlertCalled> {
Integer getCountNum(String userName, Date startTime, Date endTime, String groupCode);
Map<String, Long> getMyBacklog(String groupCode);
String getDictName(@Param("id") String id);
}
......@@ -645,6 +645,93 @@
WHERE alert_status = false
AND skill_group = #{groupCode}
</select>
<select id="getDictName" resultType="java.lang.String">
SELECT name from cb_data_dictionary where sequence_nbr = #{id} limit 1
</select>
<select id="getAlertCalledRecords" resultType="java.util.List">
SELECT
a.sequence_nbr AS sequenceNbr,
a.work_order_number AS workOrderNumber,
a.rec_user_name AS creator,
a.emergency_person AS emergency,
a.call_time AS callTime,
a.emergency_call AS emergencyCall,
a.device_id AS deviceId,
ibjui.ADDRESS AS elevatorAddress,
CONCAT(a.city,a.district) AS address,
a.alarm_type AS alertType,
a.alert_source AS alertSource,
a.alert_stage AS alertStage,
CASE
a.alert_status
WHEN 0 THEN
'未完成'
WHEN 1 THEN
'完成'
ELSE
''
END AS alertStatus
FROM
tz_alert_called a
LEFT JOIN idx_biz_jg_other_info ibjoi ON ibjoi.CODE96333 = a.device_id
LEFT JOIN idx_biz_jg_use_info ibjui ON ibjoi.RECORD = ibjui.RECORD
WHERE a.is_delete = 0 and a.father_alert is null
and a.skill_group = #{groupCode}
<if test="workOrderNumber != null and workOrderNumber != ''">
AND a.work_order_number like
CONCAT(CONCAT('%',#{workOrderNumber}),'%')
</if>
<if test="creator != null and creator != ''">
AND a.rec_user_name like
CONCAT(CONCAT('%',#{creator}),'%')
</if>
<if test="emergency != null and emergency != ''">
AND a.emergency_person like
CONCAT(CONCAT('%',#{emergency}),'%')
</if>
<if test="emergencyTimeStart != null ">
and #{emergencyTimeStart} <![CDATA[ <= ]]>
a.call_time
</if>
<if test="emergencyTimeEnd != null ">
and a.call_time <![CDATA[ <= ]]>
#{emergencyTimeEnd}
</if>
<if test="emergencyCall != null and emergencyCall != ''">
AND a.emergency_call like
CONCAT(CONCAT('%',#{emergencyCall}),'%')
</if>
<if test="deviceId != null and deviceId != ''">
AND a.device_id like CONCAT(CONCAT('%',#{deviceId}),'%')
</if>
<if test="elevatorAddress != null and elevatorAddress != ''">
AND ibjui.ADDRESS like
CONCAT(CONCAT('%',#{elevatorAddress}),'%')
</if>
<if test="district != null and district != ''">
AND a.district like
CONCAT(CONCAT('%',#{district}),'%')
</if>
<if test="alertType != null and alertType != ''">
AND a.alarm_type_code = #{alertType}
</if>
<if test="alertSource != null and alertSource != ''">
AND a.alert_source_code = #{alertSource}
</if>
<if test="alertStage != null and alertStage != ''">
AND a.alert_stage_code = #{alertStage}
</if>
<if test="alertStatus != null and alertStatus != ''">
AND a.alert_status = #{alertStatus}
</if>
<if test="ids != null and ids.size>0">
AND a.sequence_nbr in
<foreach collection="ids" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
</if>
ORDER BY
</select>
</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