状态和绩效时间设置,修改值后清空缓存的key修正,修改位与collect一致
已修改20个文件
144 ■■■■■ 文件已修改
smart-man-boot/src/main/java/com/qianwen/smartman/common/cache/cps/EmployeeCache.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
smart-man-boot/src/main/java/com/qianwen/smartman/common/constant/ChartNameConstant.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smart-man-boot/src/main/java/com/qianwen/smartman/common/constant/ExtCacheConstant.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smart-man-boot/src/main/java/com/qianwen/smartman/modules/mdc/controller/StatusRecordController.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smart-man-boot/src/main/java/com/qianwen/smartman/modules/mdc/mapper/SuperAggregateStateMapper.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smart-man-boot/src/main/java/com/qianwen/smartman/modules/mdc/service/IStatusRecordService.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smart-man-boot/src/main/java/com/qianwen/smartman/modules/mdc/service/ISuperAggregateStateService.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smart-man-boot/src/main/java/com/qianwen/smartman/modules/mdc/service/impl/StatusRecordServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smart-man-boot/src/main/java/com/qianwen/smartman/modules/mdc/service/impl/SuperAggregateStateServiceImpl.java 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smart-man-boot/src/main/java/com/qianwen/smartman/modules/mdc/utils/FilterOffUtils.java 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smart-man-boot/src/main/java/com/qianwen/smartman/modules/smis/service/impl/GlobalWcsServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smart-man-boot/src/main/java/com/qianwen/smartman/modules/smis/service/impl/WorkstationServiceImpl.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smart-man-boot/src/main/java/com/qianwen/smartman/modules/visual/controller/VisualStatusController.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smart-man-boot/src/main/java/com/qianwen/smartman/modules/visual/service/IVisualStatusService.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smart-man-boot/src/main/java/com/qianwen/smartman/modules/visual/service/impl/VisualStatusServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smart-man-boot/src/main/java/com/qianwen/smartman/modules/visual/utils/VisualUtils.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smart-man-boot/src/main/java/com/qianwen/smartman/modules/visual/vo/TimeStatusVO.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smart-man-boot/src/main/java/com/qianwen/smartman/modules/visual/vo/VisualBaseVO.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
smart-man-boot/src/main/resources/application-dev.yml 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smart-man-boot/src/main/resources/com/qianwen/smartman/modules/mdc/mapper/SuperAggregateStateMapper.xml 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smart-man-boot/src/main/java/com/qianwen/smartman/common/cache/cps/EmployeeCache.java
@@ -53,7 +53,7 @@
    public static void clearPerfCache(List<Long> workstationIds) {
        List<String> keys = Lists.newArrayList();
        workstationIds.forEach(wId -> {
            String redisKey = StringUtil.format(ExtCacheConstant.POSTING_WORKSTATION.concat("::").concat(WORK), new Object[]{wId});
            String redisKey = StringUtil.format(ExtCacheConstant.COLLECT_WORKSTATION.concat("::").concat(WORK), new Object[]{wId});
            keys.add(redisKey);
        });
        BLADE_REDIS.del(keys);
smart-man-boot/src/main/java/com/qianwen/smartman/common/constant/ChartNameConstant.java
@@ -1,7 +1,13 @@
package com.qianwen.smartman.common.constant;
/**
 * 图表名称常量
 */
public interface ChartNameConstant {
    public static final String DEVICE_RUN_DURATION = "设备运行时长前";
    /**
     * 特指运行状态
     */
    public static final Integer DEVICE_RUN_STATUS = 2;
    public static final Integer DEVICE_WAIT_STATUS = 3;
    public static final String DEVICE_WAIT_DURATION = "设备等待时长前";
smart-man-boot/src/main/java/com/qianwen/smartman/common/constant/ExtCacheConstant.java
@@ -1,13 +1,19 @@
package com.qianwen.smartman.common.constant;
/**
 * 缓存常量定义
 */
public interface ExtCacheConstant {
    public static final String CPS_CACHE = "blade:cps";
    public static final String I18N_CACHE = "blade:i18n";
    public static final String WORKSTATION_MACHINE = "blade:machine";
    public static final String POSTING_MACHINE = "posting:machine";
    public static final String CODE_RULE_CACHE = "blade:codeRule";
    public static final String POSTING_WORKSTATION = "posting:workstation";
    public static final String POSTING_CALENDAR = "posting:calendar";
    //public static final String POSTING_WORKSTATION = "posting:workstation";
    /**
     * 与采集程序通信的rediskey前缀,必须与采集程序collect取数据定义的一致。改动该值需要两个程序一起改动
     */
    public static final String COLLECT_WORKSTATION = "collect:workstation";
    public static final String EMPLOYEE = "blade:employee";
    public static final String GLOBAL_WCS = "blade:global:wcs";
    public static final String WORK_FEEDBACK = "blade:feedback";
smart-man-boot/src/main/java/com/qianwen/smartman/modules/mdc/controller/StatusRecordController.java
@@ -91,6 +91,11 @@
        return R.data(this.statusRecordService.getTimeDistribution(statusRecordDetailSelectVO));
    }
    /**
     * 工位数据,稼动率,报警率,运行率
     * @param statusRecordDetailSelectVO
     * @return
     */
    @ApiOperationSupport(order = 4)
    @PostResource({"/equipment-efficiency"})
    @ApiOperation(value = "查询设备效率", notes = "传入statusRecordDetailSelectVO")
@@ -122,12 +127,18 @@
        return R.data(this.statusRecordService.exportStatusRecord(vo));
    }
    /**
     * 我们自己前端没有调用yys
     * @param vo
     * @return
     */
    /*
    @ApiOperationSupport(order = 8)
    @PostResource({"/cross-days"})
    @ApiOperation("分割状态数据跨天数据")
    public R<List<List<SuperAggregateStateVO>>> crossDayState(@Valid @RequestBody CrossDayStateVO vo) {
        return R.data(this.statusRecordService.crossDayState(vo));
    }
    }*/
    @ApiOperationSupport(order = 9)
    @PostResource({"/status-record-by-dates"})
smart-man-boot/src/main/java/com/qianwen/smartman/modules/mdc/mapper/SuperAggregateStateMapper.java
@@ -17,7 +17,7 @@
@DS("iotdb")
@InterceptorIgnore(tenantLine = FmsConstant.AUTOMATIC)
public interface SuperAggregateStateMapper {
    void createTable(@Param("workstationId") Long workstationId);
    //void createTable(@Param("workstationId") Long workstationId);
    void insertData(@Param("workstationId") Long workstationId, @Param("sql") String sql);
@@ -128,7 +128,7 @@
    List<SuperAggregateState> listCrossDay(@Param("startTime") String startTime, @Param("endTime") String endTime);
    void saveState(@Param("workstationId") Long workstationId, @Param("list") List<SuperAggregateState> list);
    //void saveState(@Param("workstationId") Long workstationId, @Param("list") List<SuperAggregateState> list);
    List<SuperAggregateState> listInTime(@Param("workstationIds") List<Long> workstationIdList, @Param("startTime") String startTime, @Param("endTime") String endTime);
smart-man-boot/src/main/java/com/qianwen/smartman/modules/mdc/service/IStatusRecordService.java
@@ -41,7 +41,8 @@
    BladeFile exportStatusRecord(StatusRecordExcelVO vo);
    List<List<SuperAggregateStateVO>> crossDayState(CrossDayStateVO vo);
    //分割状态数据跨天数据
    //List<List<SuperAggregateStateVO>> crossDayState(CrossDayStateVO vo);
    IPage<StatusRecordDateVO> getStatusRecordByDates(IPage<StatusRecordDateVO> page, StatusRecordDateTimeSelectVO statusRecordDateTimeSelectVO);
}
smart-man-boot/src/main/java/com/qianwen/smartman/modules/mdc/service/ISuperAggregateStateService.java
@@ -39,6 +39,15 @@
     */
    List<SuperAggregateState> getStatusByTimeSection(List<Long> workstationIds, LocalDateTime startTime, LocalDateTime endTime);
    /**
     * 根据状态,起止时间获取聚合状态数据列表
     * @param workstationIds
     * @param startTime 开始时间
     * @param endTime 结束时间
     * @param status 状态值,查询wcs=status的数据
     * @param top top多少(统计后取出最高的top个数据)
     * @return 数据列表
     */
    List<StatusTimeTopVO> getStatusTimeByWcs(List<Long> workstationIds, LocalDateTime startTime, LocalDateTime endTime, Integer status, Integer top);
    List<SuperAggregateState> getOeeAnalysis(List<Long> workStationIdList, LocalDateTime startTime, LocalDateTime endTime);
@@ -55,7 +64,7 @@
    List<SuperAggregateState> crossDay(LocalDateTime start, LocalDateTime end);
    void saveState(List<SuperAggregateState> collect);
    //void saveState(List<SuperAggregateState> collect);
    List<SuperAggregateState> getStatusDataByTime(List<Long> workstationIdList, LocalDateTime startTime, LocalDateTime endTime);
smart-man-boot/src/main/java/com/qianwen/smartman/modules/mdc/service/impl/StatusRecordServiceImpl.java
@@ -312,7 +312,7 @@
        MultipartFile multipartFile = ExcelUtil.exportToMultipartFile(fileName, ExcelConstant.STATUS_RECORD, exportList, StatusRecordExport.class);
        return this.ossBuilder.tempTemplate().putFile(multipartFile.getOriginalFilename(), multipartFile);
    }
    /*
    @Override
    public List<List<SuperAggregateStateVO>> crossDayState(CrossDayStateVO vo) {
        LocalDate date = vo.getDate();
@@ -331,7 +331,7 @@
        }).collect(Collectors.toList());
        this.superAggregateStateService.saveState(collect);
        return list;
    }
    }*/
    @Override
    public IPage<StatusRecordDateVO> getStatusRecordByDates(IPage<StatusRecordDateVO> page, StatusRecordDateTimeSelectVO statusRecordDateTimeSelectVO) {
smart-man-boot/src/main/java/com/qianwen/smartman/modules/mdc/service/impl/SuperAggregateStateServiceImpl.java
@@ -104,25 +104,19 @@
    @Override
    public List<StatusTimeTopVO> getStatusTimeByWcs(List<Long> workstationIds, LocalDateTime startTime, LocalDateTime endTime, Integer status, Integer top) {
        List<StatusTimeTopVO> voList = new ArrayList<>();
        //查询除所有状态时可用的工位,转换位 工位id -> 工位 的map
        Map<Long, Workstation> workstationMap = this.workstationService.list(Wrappers.<Workstation>lambdaQuery()
                .eq(Workstation::getStatus, CommonConstant.ENABLE)).stream().collect(Collectors.toMap(Workstation::getId, Function.identity()));
        /*
        Map<Long, Workstation> workstationMap = (Map) this.workstationService.list((Wrapper) Wrappers.lambdaQuery().eq((v0) -> {
            return v0.getStatus();
        }, CommonConstant.ENABLE)).stream().collect(Collectors.toMap((v0) -> {
            return v0.getId();
        }, Function.identity()));*/
        //List<SuperAggregateState> equipmentStatusDuration = this.baseMapper.getEquipmentStatusDuration(workstationIds, LocalDateTimeUtil.format(startTime, DateConstant.PATTERN_DATE_TIME), LocalDateTimeUtil.format(endTime, DateConstant.PATTERN_DATE_TIME), status);
       // Date startTimeD = LocalDateUtil.localDateTimeToDate(startTime);
        //startTimeD = new Date(124,8,2);
        //Date endTimeD = LocalDateUtil.localDateTimeToDate(endTime);
        //endTimeD = new Date(124,8,3);
        
        //查询出时间段内wcs=status的所有数据
        List<SuperAggregateState> equipmentStatusDuration = this.baseMapper.getEquipmentStatusDuration(workstationIds, DateTimeUtil.toDate(startTime), DateTimeUtil.toDate(endTime), status);
        
        List<SuperAggregateState> equipmentStatusDuration2 = FilterOffUtils.filterOffDay(equipmentStatusDuration, OpenTypeEnums.TIME_USED_ANALYSIS);
        List<SuperAggregateState> equipmentStatusDuration2 = FilterOffUtils.filterOffDay(equipmentStatusDuration, OpenTypeEnums.TIME_USED_ANALYSIS);//过滤数据,TIME_USED_ANALYSIS open =1则过滤
        Map<Long, Long> timeMap = buildDuration(startTime, equipmentStatusDuration2).stream().collect(Collectors.groupingBy(SuperAggregate::getWorkstationId, Collectors.summingLong(SuperAggregateState::getDurationCollect))).entrySet().stream().sorted(Map.Entry.comparingByValue(Comparator.reverseOrder())).limit(top.intValue()).collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, java.util.LinkedHashMap::new));
        //yangys改了buildDuration,去掉了startTime参数
        //Map<Long, Long> timeMap = buildDuration(equipmentStatusDuration2,ChronoUnit.SECONDS).stream().collect(Collectors.groupingBy(SuperAggregate::getWorkstationId, Collectors.summingLong(SuperAggregateState::getDurationCollect))).entrySet().stream().sorted(Map.Entry.comparingByValue(Comparator.reverseOrder())).limit(top.intValue()).collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, java.util.LinkedHashMap::new));
@@ -195,20 +189,14 @@
        List<SuperAggregateState> res = this.baseMapper.listCrossDay(startTime, endTime);
        return buildDuration(res);
    }
    /*
    @Override
    public void saveState(List<SuperAggregateState> collect) {
        Map<Long, List<SuperAggregateState>> map = collect.stream().collect(Collectors.groupingBy(SuperAggregate::getWorkstationId));
        map.forEach(this.baseMapper::saveState);
        /*
        Map<Long, List<SuperAggregateState>> map = collect.stream().collect(Collectors.groupingBy((v0) -> {
            return v0.getWorkstationId();
        }));
        SuperAggregateStateMapper superAggregateStateMapper = this.baseMapper;
        superAggregateStateMapper.getClass();
        map.forEach(this::saveState);*/
    }
*/
    @Override
    public List<SuperAggregateState> getStatusDataByTime(List<Long> workstationIdList, LocalDateTime start, LocalDateTime end) {
        List<SuperAggregateState> superAggregateStateList = new ArrayList<>();
smart-man-boot/src/main/java/com/qianwen/smartman/modules/mdc/utils/FilterOffUtils.java
@@ -12,7 +12,7 @@
public class FilterOffUtils {
    /**
     * 过滤休息日?
     * 过滤数据
     * @param <R>
     * @param data 聚合状态数据列表
     * @param openTypeEnums RUNNING/ALARM/OEE等
@@ -22,9 +22,9 @@
        if (Func.isEmpty(data)) {
            return data;
        }
        boolean filterType = whetherToFilter(OpenTypeEnums.PARAM_KEY_TYPE, openTypeEnums);//mdc_open_type,是否过滤该类型
        boolean filterShift = whetherToFilter(OpenTypeEnums.PARAM_KEY_SHIFT, openTypeEnums);//mdc_open_shift,是否过滤班制
        //这里简化,不过滤了,数据在win服务器有,blade_boot_blade_param-0418bak.sql有,是个json数组
        //获取"分析设置"界面中的过滤配置,没有设置数据则返回false(不过滤)
        boolean filterType = whetherToFilter(OpenTypeEnums.PARAM_KEY_TYPE, openTypeEnums);//mdc_open_type,是否过滤掉休息时段(shiftTimeType=2)
        boolean filterShift = whetherToFilter(OpenTypeEnums.PARAM_KEY_SHIFT, openTypeEnums);//mdc_open_shift,是否过滤班制(shiftIndex>0的数据保留)
        if (!filterType && !filterShift) {
            return data;
@@ -43,6 +43,12 @@
        return data;
    }
    /**
     * 是否过滤数据(根据系统参数中的json数据,open==1就过滤)
     * @param typeEnums 过滤分类(班制/或类型) mdc_open_shift/mdc_open_type
     * @param enums 过滤的项目TIME_USED_ANALYSIS/ALARM_ANALYSIS ...
     * @return
     */
    public static boolean whetherToFilter(OpenTypeEnums typeEnums, OpenTypeEnums enums) {
        String value = ParamCache.getValue(typeEnums.getMsg());
        if (Func.isNull(value)) {
smart-man-boot/src/main/java/com/qianwen/smartman/modules/smis/service/impl/GlobalWcsServiceImpl.java
@@ -55,7 +55,7 @@
        globalWcsOfRps.setRps(wcsAchievements.getRps());
        globalWcsOfRps.setIsPlan(wcsAchievements.getIsPlan());
        globalWcsOfRps.insertOrUpdate();
        CacheUtil.clear(ExtCacheConstant.POSTING_WORKSTATION, Boolean.FALSE);
        CacheUtil.clear(ExtCacheConstant.COLLECT_WORKSTATION, Boolean.FALSE);
    }
    @Override
@@ -71,7 +71,7 @@
        globalWcsOfRps.setRps(wcsAchievementsUpdateVO.getRps());
        globalWcsOfRps.setIsPlan(wcsAchievementsUpdateVO.getIsPlan());
        globalWcsOfRps.insertOrUpdate();
        CacheUtil.clear(ExtCacheConstant.POSTING_WORKSTATION, Boolean.FALSE);
        CacheUtil.clear(ExtCacheConstant.COLLECT_WORKSTATION, Boolean.FALSE);
        return save(globalWcs);
    }
}
smart-man-boot/src/main/java/com/qianwen/smartman/modules/smis/service/impl/WorkstationServiceImpl.java
@@ -213,7 +213,7 @@
        submitWorkstationWorkbench(workstationSubmitVO, workstation);
        WorkstationCache.clearWorkstationCache();
        WorkstationCache.clearWorkstationRealTime(workstation.getId());
        CacheUtil.clear(ExtCacheConstant.POSTING_WORKSTATION, Boolean.FALSE);
        CacheUtil.clear(ExtCacheConstant.COLLECT_WORKSTATION, Boolean.FALSE);
        CacheUtil.clear(ExtCacheConstant.POSTING_MACHINE, Boolean.FALSE);
        CacheUtil.clear(ExtCacheConstant.WORKSTATION_MACHINE, Boolean.FALSE);
        String redisKey = ExtCacheConstant.CPS_CACHE.concat(":").concat(":").concat(WorkstationCache.CRC);
@@ -364,14 +364,14 @@
                return v0.getItemId();
            }, workstationIds));*/
            WorkstationCache.clearWorkstationCache();
            CacheUtil.clear(ExtCacheConstant.POSTING_WORKSTATION, Boolean.FALSE);
            CacheUtil.clear(ExtCacheConstant.COLLECT_WORKSTATION, Boolean.FALSE);
            CacheUtil.clear(ExtCacheConstant.POSTING_MACHINE, Boolean.FALSE);
            CacheUtil.clear(ExtCacheConstant.WORKSTATION_MACHINE, Boolean.FALSE);
            CacheUtil.clear(redisKey, Boolean.FALSE);
        }
        changeStatus(workstationIds, CommonConstant.DEACTIVATE);
        WorkstationCache.clearWorkstationCache();
        CacheUtil.clear(ExtCacheConstant.POSTING_WORKSTATION, Boolean.FALSE);
        CacheUtil.clear(ExtCacheConstant.COLLECT_WORKSTATION, Boolean.FALSE);
        CacheUtil.clear(ExtCacheConstant.POSTING_MACHINE, Boolean.FALSE);
        CacheUtil.clear(ExtCacheConstant.WORKSTATION_MACHINE, Boolean.FALSE);
        CacheUtil.clear(redisKey, Boolean.FALSE);
smart-man-boot/src/main/java/com/qianwen/smartman/modules/visual/controller/VisualStatusController.java
@@ -40,6 +40,11 @@
        return R.data(this.visualStatusService.getVisualStatusRecord(visualBaseVO));
    }
    /**
     * 首页卡片运行时长排名
     * @param timeStatusVO
     * @return
     */
    @ApiOperationSupport(order = 2)
    @PostResource({"/running-top"})
    @ApiOperation(value = "设备运行时长TOP", notes = "传入timeStatusVO")
smart-man-boot/src/main/java/com/qianwen/smartman/modules/visual/service/IVisualStatusService.java
@@ -15,6 +15,12 @@
public interface IVisualStatusService {
    ChartGanttStatusDataVO getVisualStatusRecord(VisualBaseVO visualBaseVO);
    /**
     * 查询图表
     * @param timeStatusVO
     * @param status 设备状态值
     * @return
     */
    ChartSeriesDataVO getDeviceStatusDuration(TimeStatusVO timeStatusVO, Integer status);
    ChartNameValueDataVO getStatusDistribution(VisualBaseVO vo);
smart-man-boot/src/main/java/com/qianwen/smartman/modules/visual/service/impl/VisualStatusServiceImpl.java
@@ -105,8 +105,8 @@
            return new ChartSeriesDataVO();
        }
        List<Long> workStationIdList = timeStatusVO.getWorkStationIdList();
        String timeLevel = timeStatusVO.getTimeLevel();
        Integer top = timeStatusVO.getTop();
        String timeLevel = timeStatusVO.getTimeLevel();//小时数,如24小时
        Integer top = timeStatusVO.getTop();//查询多少个
        VisualTimeDTO visualTimeDTO = VisualUtils.getTimeSectionByLevel(timeLevel);
        List<StatusTimeTopVO> statusTimeByWcs = this.superAggregateStateService.getStatusTimeByWcs(workStationIdList, visualTimeDTO.getStartTime(), visualTimeDTO.getEndTime(), status, top);
        return this.wrapper.deviceStatusDuration(statusTimeByWcs, status, top);
smart-man-boot/src/main/java/com/qianwen/smartman/modules/visual/utils/VisualUtils.java
@@ -40,6 +40,11 @@
    private static final IOssService ossService = (IOssService) SpringUtil.getBean(IOssService.class);
    /**
     * 根据level(小时数)获取起止时间
     * @param level 小时数
     * @return 包含起止时间对象
     */
    public static VisualTimeDTO getTimeSectionByLevel(String level) {
        LocalDateTime now = LocalDateTime.now();
        LocalDateTime startTime = now.minusHours(Long.parseLong(level));
smart-man-boot/src/main/java/com/qianwen/smartman/modules/visual/vo/TimeStatusVO.java
@@ -4,6 +4,9 @@
public class TimeStatusVO extends VisualBaseVO {
    /**
     * top x,查询最高的几条
     */
    @ApiModelProperty("设备top数据")
    private Integer top;
smart-man-boot/src/main/java/com/qianwen/smartman/modules/visual/vo/VisualBaseVO.java
@@ -12,7 +12,7 @@
    @Size(min = 1, message = "工位ID不能为空")
    private List<Long> workStationIdList;
    @ApiModelProperty("时间等级")
    private String timeLevel;
    private String timeLevel;//running-top中是小时数
    public void setWorkStationIdList(final List<Long> workStationIdList) {
        this.workStationIdList = workStationIdList;
smart-man-boot/src/main/resources/application-dev.yml
@@ -1,16 +1,16 @@
# redis
redis:
  host: localhost
  host: 120.46.212.231
  port: 6379
  password: root
  database: 1
  database: 5
  ssl: false
# database config
datasource:
  type: mysql
  url: 120.46.212.231
  port: 3306
  database: smart_boot
  database: smartman
  username: qwmdc
  password: Kknd_1234
  driver-class-name: com.mysql.cj.jdbc.Driver
smart-man-boot/src/main/resources/com/qianwen/smartman/modules/mdc/mapper/SuperAggregateStateMapper.xml
@@ -6,7 +6,7 @@
        insert into iot_data.aggregate_state_${workstationId}
        values ${sql}
    </insert>
    <!--
    <insert id="saveState">
        insert into iot_data.aggregate_state_${workstationId} USING iot_data.super_aggregate_state
        TAGS(${workstationId}) values
@@ -16,14 +16,14 @@
            #{item.shiftIndex}, #{item.shiftTimeType}, #{item.wcs}, #{item.rps}, #{item.isDeleted},#{item.isPlan})
        </foreach>
    </insert>
    <update id="createTable">
        create table if not exists iot_data.aggregate_state_${workstationId} using super_aggregate_state tags
        (
            #{workstationId}
        )
    </update>
 -->
    <select id="countStatsShiftEndTimeNotNull" resultType="com.qianwen.smartman.modules.mdc.dto.CountResult">
        select sum(duration_collect) as nums, value_collect status
        from iot_data.super_aggregate_state
@@ -484,6 +484,8 @@
        </foreach>
         align by device
    </select>
    <!-- 这个有用吗 -->
    <select id="listCrossDay" resultType="com.qianwen.smartman.modules.mdc.entity.SuperAggregateState">
        select ts              as startTime,
               end_time        as endTime,