Skip to content

Commit

Permalink
Merge pull request #69 from MobralBroker/hotfix_filtros
Browse files Browse the repository at this point in the history
correção agrupamento listar itens carteira
  • Loading branch information
mcesar29 authored Jan 31, 2024
2 parents 4402b7a + dd9a3c2 commit 3afe5f3
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public interface CarteiraRepository extends JpaRepository<CarteiraModel, Long>{
List<CarteiraModel> findByClienteId(@Param("idCliente") Long idCliente);

@Query(value="SELECT ca.id_cliente, ca.id_ativo, SUM(ca.quantidade) as quantidade, at.sigla " +
"FROM carteira ca JOIN ativo at ON ca.id_ativo = at.id WHERE ca.id_cliente = :idCliente GROUP BY ca.id_cliente, ca.id_ativo, ca.quantidade, at.sigla order by at.sigla ASC", nativeQuery = true)
"FROM carteira ca JOIN ativo at ON ca.id_ativo = at.id WHERE ca.id_cliente = :idCliente GROUP BY ca.id_cliente, ca.id_ativo, at.sigla order by at.sigla ASC", nativeQuery = true)
List<Object[]> listarItensCarteira(@Param("idCliente") Long idCliente);

@Query(value = "select sum(quantidade) from carteira where id_cliente = ?1 and id_ativo = ?2", nativeQuery = true)
Expand Down

0 comments on commit 3afe5f3

Please sign in to comment.