#
Junjie
6 天以前 82c36e2b434fa7a1c16b0448aa4cf1483107f79c
src/main/java/com/zy/asrs/mapper/DeviceDataLogMapper.java
@@ -4,13 +4,17 @@
import com.baomidou.mybatisplus.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
@Mapper
@Repository
public interface DeviceDataLogMapper extends BaseMapper<DeviceDataLog> {
    @Delete("delete from wcs_device_data_log where create_time < DATEADD(HOUR, -24, GETDATE())")
    int clearLog();
    @Delete("delete from wcs_device_data_log where create_time < FROM_UNIXTIME(UNIX_TIMESTAMP() - (#{days} * 24 * 60 * 60)) limit 50000")
    int clearLog(@Param("days") int days);
    int insertBatch(@Param("list") List<DeviceDataLog> list);
}