yang_shj
5 months ago
16 changed files with 330 additions and 6 deletions
@ -0,0 +1,16 @@
|
||||
package com.hnac.hzims.scheduled.mapper.alarm; |
||||
|
||||
import com.hnac.hzims.alarm.config.entity.AlarmHandleEntity; |
||||
import org.apache.ibatis.annotations.Param; |
||||
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @author ysj |
||||
* @date 2023/03/09 09:19:13 |
||||
* @version 4.0.0 |
||||
*/ |
||||
public interface HandleMapper extends UserDataScopeBaseMapper<AlarmHandleEntity> { |
||||
List<String> handles(@Param("start") String start,@Param("end") String end); |
||||
} |
@ -0,0 +1,22 @@
|
||||
package com.hnac.hzims.scheduled.service.alarm; |
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.hnac.hzims.alarm.config.entity.AlarmHandleEntity; |
||||
import com.hnac.hzims.alarm.config.entity.AlarmHandleFlowEntity; |
||||
import com.hnac.hzims.alarm.config.vo.AlarmHandleVo; |
||||
import com.hnac.hzims.alarm.show.vo.HandleQueryVo; |
||||
import org.springblade.core.mp.base.BaseService; |
||||
import org.springblade.core.mp.support.Query; |
||||
import org.springblade.system.user.entity.User; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @author ysj |
||||
* @date 2023/03/09 09:19:13 |
||||
* @version 4.0.0 |
||||
*/ |
||||
public interface HandleService extends BaseService<AlarmHandleEntity> { |
||||
|
||||
List<String> handles(); |
||||
} |
@ -0,0 +1,39 @@
|
||||
package com.hnac.hzims.scheduled.service.alarm.impl; |
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS; |
||||
import com.hnac.hzims.alarm.config.entity.AlarmHandleEntity; |
||||
import com.hnac.hzims.scheduled.mapper.alarm.HandleMapper; |
||||
import com.hnac.hzims.scheduled.service.alarm.HandleService; |
||||
import lombok.RequiredArgsConstructor; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.springblade.core.mp.base.BaseServiceImpl; |
||||
import org.springblade.core.tool.utils.DateUtil; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import java.util.Date; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @author ysj |
||||
* @version 4.0.0 |
||||
* @date 2023/03/09 09:29:34 |
||||
*/ |
||||
@Slf4j |
||||
@Service |
||||
@RequiredArgsConstructor |
||||
@DS("alarm") |
||||
public class HandleServiceImpl extends BaseServiceImpl<HandleMapper, AlarmHandleEntity> implements HandleService { |
||||
|
||||
|
||||
/** |
||||
* 查询处理告警记录 |
||||
* |
||||
* @return |
||||
*/ |
||||
@Override |
||||
public List<String> handles() { |
||||
String start = DateUtil.format(new Date(), DateUtil.PATTERN_DATE) + " 00:00:00"; |
||||
String end = DateUtil.format(new Date(), DateUtil.PATTERN_DATETIME); |
||||
return this.baseMapper.handles(start, end); |
||||
} |
||||
} |
@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
<mapper namespace="com.hnac.hzims.scheduled.mapper.alarm.HandleMapper"> |
||||
|
||||
<select id="handles" resultType="java.lang.String"> |
||||
SELECT HANDLER.ALARM_ID |
||||
FROM HZIMS_ALARM_HANDLE HANDLER |
||||
<where> |
||||
HANDLER.IS_DELETED = 0 |
||||
<if test="start != null and end != null"> |
||||
AND HANDLER.CREATE_TIME BETWEEN #{start} AND #{end} |
||||
</if> |
||||
AND (HANDLER.DELAY_TIME > #{end} OR HANDLER.DELAY_TIME IS NULL) |
||||
</where> |
||||
</select> |
||||
|
||||
</mapper> |
Loading…
Reference in new issue