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 java.util.List; /** * @Description: 采集设备表 * @Author: liuS * @Date: 2023-03-23 * @Version: V1.0 */ public interface EquipmentMapper extends BaseMapper { @Select(" SELECT name FROM SysObjects Where XType='U' AND 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(" SELECT * INTO [${tableName}] FROM [${lastTableName}] WHERE CollectTime < '${date}' ") void insertNoTableData(@Param("tableName") String tableName, @Param("lastTableName") String lastTableName, @Param("date") String date); List listByProds(@Param("proIds") List proIds); Equipment findByEquId(@Param("equipmentId") String equipmentId); }