Browse Source

#发电量整改&web/app告警推送修改为站点区域级用户

zhongwei
yang_shj 5 months ago
parent
commit
e9507fe2d6
  1. 2
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/impl/MessageServiceImpl.java
  2. 16
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/alarm/HandleMapper.java
  3. 2
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/equipment/ThirtyGenerateMapper.java
  4. 4
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/equipment/ThreeGenerateMapper.java
  5. 22
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/HandleService.java
  6. 20
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/impl/AlarmQueryServiceImpl.java
  7. 39
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/impl/HandleServiceImpl.java
  8. 1
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/equipment/ThirtyGenerateService.java
  9. 4
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/equipment/ThreeGenerateService.java
  10. 18
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/equipment/impl/ThirtyGenerateServiceImpl.java
  11. 28
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/equipment/impl/ThreeGenerateServiceImpl.java
  12. 141
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/ObtainGenerationServiceImpl.java
  13. 4
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/monitor/impl/MonitorServiceImpl.java
  14. 17
      hzims-service/hzims-scheduled/src/main/resources/mapper/alarm/HandleMapper.xml
  15. 4
      hzims-service/hzims-scheduled/src/main/resources/mapper/equipment/ThirtyGenerateMapper.xml
  16. 14
      hzims-service/hzims-scheduled/src/main/resources/mapper/equipment/ThreeGenerateMapper.xml

2
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/impl/MessageServiceImpl.java

@ -75,7 +75,7 @@ public class MessageServiceImpl implements MessageService {
}
Long dept = stationByCode.getData().getRefDept();
// 获取站点用户
R<List<User>> result = userClient.userListByDeptId(dept);
R<List<User>> result = userClient.userByDeptIdLevel(dept,1);
if (!result.isSuccess() || CollectionUtil.isEmpty(result.getData())) {
log.error("WEB/APP消息发送失败:用户获取失败 : {}",entity);
return;

16
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/alarm/HandleMapper.java

@ -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);
}

2
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/equipment/ThirtyGenerateMapper.java

@ -3,10 +3,12 @@ package com.hnac.hzims.scheduled.mapper.equipment;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hnac.hzims.equipment.entity.ThirtyGenerationEntity;
import org.apache.ibatis.annotations.Param;
/**
* @author ysj
*/
public interface ThirtyGenerateMapper extends BaseMapper<ThirtyGenerationEntity> {
void deleteDayGenerate(@Param("day") String day);
}

4
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/equipment/ThreeGenerateMapper.java

@ -3,10 +3,14 @@ package com.hnac.hzims.scheduled.mapper.equipment;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hnac.hzims.equipment.entity.ThreeGenerationEntity;
import org.apache.ibatis.annotations.Param;
/**
* @author ysj
*/
public interface ThreeGenerateMapper extends BaseMapper<ThreeGenerationEntity> {
void deletemMonthGenerate(@Param("month") String month,@Param("before") String before);
void deleteFillGenerate(@Param("before") String before);
}

22
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/HandleService.java

@ -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();
}

20
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/impl/AlarmQueryServiceImpl.java

@ -2,6 +2,7 @@ package com.hnac.hzims.scheduled.service.alarm.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.hnac.hzims.alarm.config.constants.AlarmConstants;
import com.hnac.hzims.alarm.config.entity.AlarmEntity;
@ -10,6 +11,7 @@ import com.hnac.hzims.operational.main.vo.HydropowerUnitRealVo;
import com.hnac.hzims.operational.station.entity.StationEntity;
import com.hnac.hzims.scheduled.mapper.alarm.AlarmQueryMapper;
import com.hnac.hzims.scheduled.service.alarm.AlarmQueryService;
import com.hnac.hzims.scheduled.service.alarm.HandleService;
import com.hnac.hzims.scheduled.service.operation.station.StationService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@ -33,6 +35,8 @@ import java.util.stream.Collectors;
@DS("alarm")
public class AlarmQueryServiceImpl extends BaseServiceImpl<AlarmQueryMapper, AlarmEntity> implements AlarmQueryService {
private HandleService handleService;
@Override
public void clear(String param) {
@ -46,11 +50,17 @@ public class AlarmQueryServiceImpl extends BaseServiceImpl<AlarmQueryMapper, Ala
*/
@Override
public List<String> bells(List<String> codes) {
List<AlarmEntity> alarms = this.list(Wrappers.<AlarmEntity>lambdaQuery()
.in(AlarmEntity::getStationId,codes)
.eq(AlarmEntity::getIsSmallBell,0)
.like(AlarmEntity::getAlarmTime, DateUtil.format(new Date(),DateUtil.PATTERN_DATE))
);
QueryWrapper wrapper = new QueryWrapper<>();
wrapper.in("STATION_ID",codes);
wrapper.eq("IS_SMALL_BELL",0);
wrapper.like("ALARM_TIME",DateUtil.format(new Date(),DateUtil.PATTERN_DATE));
// 处理告警过滤 :当天处理告警
List<String> handles = handleService.handles();
if(!CollectionUtil.isEmpty(handles)){
wrapper.notIn("ALARM_ID",handles);
}
List<AlarmEntity> alarms = this.list(wrapper);
if(CollectionUtil.isEmpty(alarms)){
return new ArrayList<>();
}

39
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/impl/HandleServiceImpl.java

@ -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);
}
}

1
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/equipment/ThirtyGenerateService.java

@ -8,4 +8,5 @@ import org.springblade.core.mp.base.BaseService;
*/
public interface ThirtyGenerateService extends BaseService<ThirtyGenerationEntity> {
void deleteDayGenerate(String month);
}

4
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/equipment/ThreeGenerateService.java

@ -1,6 +1,7 @@
package com.hnac.hzims.scheduled.service.equipment;
import com.hnac.hzims.equipment.entity.ThreeGenerationEntity;
import org.apache.ibatis.annotations.Param;
import org.springblade.core.mp.base.BaseService;
/**
@ -8,4 +9,7 @@ import org.springblade.core.mp.base.BaseService;
*/
public interface ThreeGenerateService extends BaseService<ThreeGenerationEntity> {
void deletemMonthGenerate(@Param("month") String month);
void deleteFillGenerate();
}

18
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/equipment/impl/ThirtyGenerateServiceImpl.java

@ -7,8 +7,12 @@ import com.hnac.hzims.scheduled.service.equipment.ThirtyGenerateService;
import lombok.AllArgsConstructor;
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.Calendar;
import java.util.Date;
/**
* @author ysj
*/
@ -19,4 +23,18 @@ import org.springframework.stereotype.Service;
public class ThirtyGenerateServiceImpl extends BaseServiceImpl<ThirtyGenerateMapper, ThirtyGenerationEntity> implements ThirtyGenerateService {
/**
* 清除超出30日发电量
* @param month
*/
@Override
public void deleteDayGenerate(String month) {
Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.DAY_OF_MONTH,-30);
calendar.add(Calendar.HOUR_OF_DAY,-calendar.get(Calendar.HOUR_OF_DAY));
calendar.add(Calendar.MINUTE,-calendar.get(Calendar.MINUTE));
calendar.add(Calendar.SECOND,-calendar.get(Calendar.SECOND));
String start = DateUtil.format(calendar.getTime(), DateUtil.PATTERN_DATETIME);
this.baseMapper.deleteDayGenerate(start);
}
}

28
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/equipment/impl/ThreeGenerateServiceImpl.java

@ -1,6 +1,7 @@
package com.hnac.hzims.scheduled.service.equipment.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.hnac.hzims.common.utils.DateUtil;
import com.hnac.hzims.equipment.entity.ThreeGenerationEntity;
import com.hnac.hzims.scheduled.mapper.equipment.ThreeGenerateMapper;
import com.hnac.hzims.scheduled.service.equipment.ThreeGenerateService;
@ -9,6 +10,8 @@ import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
import java.util.Calendar;
/**
* @author ysj
*/
@ -19,4 +22,29 @@ import org.springframework.stereotype.Service;
public class ThreeGenerateServiceImpl extends BaseServiceImpl<ThreeGenerateMapper, ThreeGenerationEntity> implements ThreeGenerateService {
/**
* 删除近3年当月发电量
* @param month
*/
@Override
public void deletemMonthGenerate(String month) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(DateUtil.parse(month, DateUtil.PATTERN_DATE));
calendar.add(Calendar.YEAR,-2);
Integer year = calendar.get(Calendar.YEAR);
this.baseMapper.deletemMonthGenerate(month,year + "-01-01");
}
/**
* 清除填报发电量
*/
@Override
public void deleteFillGenerate() {
Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.DAY_OF_MONTH,-29);
calendar.add(Calendar.HOUR_OF_DAY,-calendar.get(Calendar.HOUR_OF_DAY));
calendar.add(Calendar.MINUTE,-calendar.get(Calendar.MINUTE));
calendar.add(Calendar.SECOND,-calendar.get(Calendar.SECOND));
this.baseMapper.deleteFillGenerate(DateUtil.format(calendar.getTime(), DateUtil.PATTERN_DATETIME));
}
}

141
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/ObtainGenerationServiceImpl.java

@ -99,6 +99,7 @@ public class ObtainGenerationServiceImpl implements ObtainGenerationService {
*/
@Override
public void thisDayPowerGeneration(String param) {
String month = DateUtil.format(new Date(),"yyyy-MM") ;
// 步骤1.水电、光伏站点
List<StationEntity> stations = stationService.list(Wrappers.<StationEntity>lambdaQuery().in(StationEntity::getType, Arrays.asList(HomePageConstant.HYDROPOWER,HomePageConstant.PHOTOVOLTAIC)));
@ -106,9 +107,149 @@ public class ObtainGenerationServiceImpl implements ObtainGenerationService {
List<EminfoAndEmParamVo> devices = JSONObject.parseObject(redisTemplate.opsForValue().get(device_cache_cofig_final).toString(), new TypeReference<List<EminfoAndEmParamVo>>() {});
// 步骤3.站点-设备当日发电量
this.refreshDayGeneration(stations,devices,month + "-01");
// 步骤4.近3年的当月发电量
this.thirtyMonthGenerate(stations,month);
}
/**
* 刷新今日发电量
* @param stations
* @param devices
*/
private void refreshDayGeneration(List<StationEntity> stations, List<EminfoAndEmParamVo> devices,String month) {
String end = month + " 23:59:59";
String start = month + " 00:00:00";
// 查询当日已保存发电量
List<ThirtyGenerationEntity> generations = thirtyGenerateService.list(Wrappers.<ThirtyGenerationEntity>lambdaQuery().eq(ThirtyGenerationEntity::getStrDay,start));
// 将站点切割
int limit = countStep(stations.size());
List<List<StationEntity>> limits = Stream.iterate(0, n -> n + 1).limit(limit).parallel().map(a -> stations.stream().skip((long) a * 3).limit(3).parallel().collect(Collectors.toList())).collect(Collectors.toList());
CountDownLatch countDownLatch = new CountDownLatch(limits.size());
List<ThirtyGenerationEntity> saves = new CopyOnWriteArrayList<>();
for(List<StationEntity> item : limits){
try{
pool.submit(()->{
item.forEach(station->{
// 站点设备集合
List<EminfoAndEmParamVo> eminfos = devices.stream().filter(device -> device.getCreateDept().equals(station.getRefDept())).collect(Collectors.toList());
// 遍历查询发电量
eminfos.forEach(device->{
List<AnalyseDataTaosVO> records = dataService.periodTargetData(start,end,5,3,device.getEmCode(),HomePageConstant.HYDROPOWER_GENERATE_POWER);
if(CollectionUtil.isEmpty(records)){
return;
}
// 是否包含今日累计发电量数据
Optional<ThirtyGenerationEntity> optional = generations.stream().filter(o->o.getStationId().equals(station.getCode()) && o.getDeviceCode().equals(device.getEmCode())).findFirst();
if(optional.isPresent()){
if(StringUtil.isEmpty(records.get(0).getVal())){
optional.get().setGenerate(BigDecimal.ZERO);
}else{
optional.get().setGenerate(BigDecimal.valueOf(Double.parseDouble(records.get(0).getVal()) * device.getRideCount()));
}
saves.add(optional.get());
}else{
ThirtyGenerationEntity generate = new ThirtyGenerationEntity();
generate.setStationId(station.getCode());
generate.setStationName(station.getName());
generate.setDeviceCode(device.getEmCode());
generate.setDeviceName(device.getName());
generate.setTenantId(station.getTenantId());
generate.setCreateDept(station.getRefDept());
generate.setCreateUser(station.getCreateUser());
generate.setUpdateUser(station.getUpdateUser());
Date time = DateUtil.parse(records.get(0).getTs(), "yyyy-MM-dd HH:mm:ss.s");
generate.setStrDay(DateUtil.format(time,DateUtil.PATTERN_DATETIME));
generate.setDay(time.getDate());
if(StringUtil.isEmpty(records.get(0).getVal())){
generate.setGenerate(BigDecimal.ZERO);
}else{
generate.setGenerate(BigDecimal.valueOf(Double.parseDouble(records.get(0).getVal()) * device.getRideCount()));
}
saves.add(generate);
}
});
});
countDownLatch.countDown();
log.error("save_generation_execute_complete: {}" ,item.stream().map(StationEntity::getName).collect(Collectors.toList()));
});
}catch (Exception e){
log.error("save_generation_execute_complete_error : {}" ,e.getMessage());
}
}
// 等待所有线程执行完成
try {
countDownLatch.await();
} catch (InterruptedException e) {
e.printStackTrace();
Thread.currentThread().interrupt();
}
thirtyGenerateService.saveOrUpdateBatch(saves);
}
/**
* 更新近3年的当月发电量
*/
private void thirtyMonthGenerate(List<StationEntity> stations,String month) {
// 步骤1.查询设备当月累计发电量
List<ThirtyGenerationEntity> generations = thirtyGenerateService.list(Wrappers.<ThirtyGenerationEntity>lambdaQuery().like(ThirtyGenerationEntity::getStrDay,month));
// 步骤2.删除近3年当月发电量
threeGenerateService.deletemMonthGenerate(month + "-01");
// 步骤3.将当月累计发电量新增表
this.saveThreeMonthGenerate(generations,month);
// 步骤4.清除填报发电量
threeGenerateService.deleteFillGenerate();
// 步骤5.清除超出30日发电量
thirtyGenerateService.deleteDayGenerate(month);
// 步骤6.重新补充填报发电量
Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.MONTH, -calendar.get(Calendar.MONTH) + 12);
calendar.add(Calendar.DATE, -calendar.get(Calendar.DATE) + 1);
String end = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATE) + " 00:00:00";
// 结束日期
calendar.set(Calendar.YEAR, calendar.get(Calendar.YEAR) - 3);
calendar.add(Calendar.MONTH, -calendar.get(Calendar.MONTH));
String start = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATE) + " 00:00:00";
stations.forEach(station->{
this.threeGenerateService.saveBatch(this.saveFillGenerate(station,start,end));
});
}
/**
* 保存近3年当月发电量
* @param generations
*/
private void saveThreeMonthGenerate(List<ThirtyGenerationEntity> generations,String month) {
if(CollectionUtil.isEmpty(generations)){
return;
}
threeGenerateService.saveBatch(generations.stream().collect(Collectors.groupingBy(ThirtyGenerationEntity::getDeviceCode)).entrySet().stream().map(entry->{
ThreeGenerationEntity generate = new ThreeGenerationEntity();
generate.setStationId(entry.getValue().get(0).getStationId());
generate.setStationName(entry.getValue().get(0).getStationName());
generate.setDeviceCode(entry.getValue().get(0).getDeviceCode());
generate.setDeviceName(entry.getValue().get(0).getDeviceName());
generate.setTenantId(entry.getValue().get(0).getTenantId());
generate.setCreateDept(entry.getValue().get(0).getCreateDept());
generate.setCreateUser(entry.getValue().get(0).getCreateUser());
generate.setUpdateUser(entry.getValue().get(0).getUpdateUser());
String strMonth = month + "-01";
generate.setStrMonth(strMonth);
generate.setMonth(DateUtil.parse(strMonth,DateUtil.PATTERN_DATE).getMonth() + 1);
generate.setGenerate(BigDecimal.valueOf(entry.getValue().stream().mapToDouble(o->o.getGenerate().doubleValue()).sum()).setScale(2, RoundingMode.HALF_UP));
return generate;
}).collect(Collectors.toList()));
}
/**
* 查询发电量
* @param stations

4
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/monitor/impl/MonitorServiceImpl.java

@ -365,6 +365,10 @@ public class MonitorServiceImpl implements MonitorService {
device.setState(-1);
return;
}
if(Double.parseDouble(powers.get(0).getValue()) <= 0){
device.setState(-1);
return;
}
device.setState(1);
}
});

17
hzims-service/hzims-scheduled/src/main/resources/mapper/alarm/HandleMapper.xml

@ -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 &gt; #{end} OR HANDLER.DELAY_TIME IS NULL)
</where>
</select>
</mapper>

4
hzims-service/hzims-scheduled/src/main/resources/mapper/equipment/ThirtyGenerateMapper.xml

@ -2,4 +2,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.equipment.ThirtyGenerateMapper">
<delete id="deleteDayGenerate">
DELETE FROM HZIMS_EM_THIRTY_GENERATE
WHERE STR_DAY &lt; #{day}
</delete>
</mapper>

14
hzims-service/hzims-scheduled/src/main/resources/mapper/equipment/ThreeGenerateMapper.xml

@ -2,4 +2,18 @@
<!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.equipment.ThreeGenerateMapper">
<delete id="deletemMonthGenerate">
DELETE FROM HZIMS_EM_THREE_GENERATE
WHERE STR_MONTH = #{month}
<if test="before != null and before != ''">
OR STR_MONTH &lt; #{before}
</if>
</delete>
<delete id="deleteFillGenerate">
DELETE FROM HZIMS_EM_THREE_GENERATE
WHERE DEVICE_CODE IS NULL
<if test="before != null and before != ''">
OR STR_MONTH &lt; #{before}
</if>
</delete>
</mapper>
Loading…
Cancel
Save