package org.example.background.dao;


import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.UpdateProvider;
import org.example.background.condition.EnergyDataCondition;
import org.example.background.entity.EnergyDataEntity;

public interface EnergyDataDao {

    @InsertProvider(type = EnergyDataCondition.class, method = "insert")
    Integer insert(EnergyDataEntity data);

    @Select("SELECT * FROM energy_data WHERE device_Id = #{deviceId} AND acquisition_time = #{acquisitionTime}")
    EnergyDataEntity select(EnergyDataEntity data);

    @UpdateProvider(type = EnergyDataCondition.class, method = "updateByPrimaryKey")
    Integer updateByPrimaryKey(EnergyDataEntity data);
}
