package com.huimv.produce.produce.repo;

import com.huimv.produce.produce.entity.ProdWeightDetailsEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface ProdWeightDetailsRepo extends JpaRepository<ProdWeightDetailsEntity, Integer>, JpaSpecificationExecutor<ProdWeightDetailsEntity> {

    @Query(nativeQuery = true,value = "SELECT * FROM prod_weight_details WHERE DATE_FORMAT(weighing_time,'%Y-%m-%d')=DATE_FORMAT(?1,'%Y-%m-%d')")
    List<ProdWeightDetailsEntity> getWeightDetails(String todayDate);
}