package org.jeecg.modules.mdc.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Delete; import org.apache.ibatis.annotations.Insert; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; import org.jeecg.modules.mdc.entity.Equipment; import org.jeecg.modules.mdc.vo.WsEquipmentStatus; import org.jeecg.modules.mdc.vo.WsEquipmentUtilizationRate; import java.util.List; /** * @Description: 采集设备表 * @Author: liuS * @Date: 2023-03-23 * @Version: V1.0 */ public interface EquipmentMapper extends BaseMapper { @Select(" SELECT name FROM SysObjects WHERE name = '${saveTableName}' ") String checkTableExists(@Param("saveTableName") String saveTableName); @Select(" SELECT COUNT(CollectTime) num FROM ${saveTableName} WHERE CollectTime < '${day}' ") Integer checkTableDataNum(@Param("saveTableName") String saveTableName, @Param("day") String day); @Insert(" INSERT INTO ${tableName} SELECT * FROM ${lastTableName} WHERE CollectTime < '${date}' ") void insertTableData(@Param("tableName") String tableName, @Param("lastTableName") String lastTableName, @Param("date") String date); @Delete(" delete from ${tableName} where CollectTime < '${day}' ") void deleteTableData(@Param("tableName") String saveTableName, @Param("day") String day); @Insert(" CREATE TABLE ${tableName} AS SELECT * FROM ${lastTableName} WHERE CollectTime < '${date}' ") void insertNoTableData(@Param("tableName") String tableName, @Param("lastTableName") String lastTableName, @Param("date") String date); List selectEquipmentStatus(); List selectEquipmentRate(@Param("date") String date); String selectOee(@Param("equipmentId") String equipmentId, @Param("date") String date); }