Interface VentaLineaRepository
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<VentaLinea,,Long> org.springframework.data.jpa.repository.JpaRepository<VentaLinea,,Long> org.springframework.data.repository.ListCrudRepository<VentaLinea,,Long> org.springframework.data.repository.ListPagingAndSortingRepository<VentaLinea,,Long> org.springframework.data.repository.PagingAndSortingRepository<VentaLinea,,Long> org.springframework.data.repository.query.QueryByExampleExecutor<VentaLinea>,org.springframework.data.repository.Repository<VentaLinea,Long>
public interface VentaLineaRepository
extends org.springframework.data.jpa.repository.JpaRepository<VentaLinea,Long>
-
Method Summary
Modifier and TypeMethodDescriptionfindByVentaId(Long ventaId) Devuelve todas las líneas pertenecientes a una venta concreta.Genera el reporte de ventas agregadas por día y por producto.Methods inherited from interface org.springframework.data.repository.CrudRepository
count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findById, saveMethods inherited from interface org.springframework.data.jpa.repository.JpaRepository
deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, flush, getById, getOne, getReferenceById, saveAllAndFlush, saveAndFlushMethods inherited from interface org.springframework.data.repository.ListCrudRepository
findAll, findAllById, saveAllMethods inherited from interface org.springframework.data.repository.ListPagingAndSortingRepository
findAllMethods inherited from interface org.springframework.data.repository.PagingAndSortingRepository
findAllMethods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor
count, exists, findAll, findBy, findOne
-
Method Details
-
findByVentaId
Devuelve todas las líneas pertenecientes a una venta concreta. -
getReporteVentasDiarias
@Query("SELECT new com.deusto.coffeestack.dto.ReporteVentasDTO(cast(v.fechaHora as date), i.name, SUM(vl.cantidadUnidades)) FROM VentaLinea vl JOIN vl.venta v JOIN vl.item i GROUP BY cast(v.fechaHora as date), i.name ORDER BY cast(v.fechaHora as date) DESC, i.name ASC") List<ReporteVentasDTO> getReporteVentasDiarias()Genera el reporte de ventas agregadas por día y por producto.
-