Quando gerava o relatorio com alias, ele gerava duas colunas ambiguas :

origem e destino.
Então foi criado uma condição, para um ou outro
master
wallace.henrique 2022-12-29 11:20:40 -03:00
parent eda134453b
commit 80bc714e87
2 changed files with 6 additions and 4 deletions

View File

@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>br.com.rjconsultores</groupId> <groupId>br.com.rjconsultores</groupId>
<artifactId>ventaboletosadm</artifactId> <artifactId>ventaboletosadm</artifactId>
<version>1.0.23</version> <version>1.0.24</version>
<packaging>war</packaging> <packaging>war</packaging>
<distributionManagement> <distributionManagement>

View File

@ -212,11 +212,13 @@ public class RelatorioBPe extends Relatorio {
if(alias != null && alias.equals("S")) {// ALIAS Origem/Destino dos bilhetes if(alias != null && alias.equals("S")) {// ALIAS Origem/Destino dos bilhetes
sql.append(" COALESCE(oriA.DESCPARADA, ori.DESCPARADA) as origem, "); sql.append(" COALESCE(oriA.DESCPARADA, ori.DESCPARADA) as origem, ");
sql.append(" COALESCE(destA.DESCPARADA, dest.DESCPARADA) as destino,"); sql.append(" COALESCE(destA.DESCPARADA, dest.DESCPARADA) as destino,");
}else {
sql.append(" ori.DESCPARADA as origem, ");
sql.append(" dest.DESCPARADA as destino,");
} }
sql.append(" locpv.DESCPARADA as locpuntoventa, "); sql.append(" locpv.DESCPARADA as locpuntoventa, ");
sql.append(" pv.NUMPUNTOVENTA as numPuntoVenta, "); sql.append(" pv.NUMPUNTOVENTA as numPuntoVenta, ");
sql.append(" ori.DESCPARADA as origem, ");
sql.append(" dest.DESCPARADA as destino,");
sql.append(" TO_CHAR(bol.FECHORVIAJE,'dd/mm/yyyy HH24:MI') as dtviagem, "); sql.append(" TO_CHAR(bol.FECHORVIAJE,'dd/mm/yyyy HH24:MI') as dtviagem, ");
@ -238,7 +240,7 @@ public class RelatorioBPe extends Relatorio {
sql.append(" case "); sql.append(" case ");
sql.append(" when bpe.tiposubstituicao is null and bpeSub.bpe_id is null and bpe.indcontingencia = 0 then 'Autorizado' "); sql.append(" when bpe.tiposubstituicao is null and bpeSub.bpe_id is null and bpe.indcontingencia = 0 then 'Autorizado' ");
sql.append(" when bpe.tiposubstituicao is null and bpeSub.bpe_id is null and bpe.indcontingencia = 1 then 'Aut.Conting.' "); sql.append(" when bpe.tiposubstituicao is null and bpeSub.bpe_id is null and bpe.indcontingencia = 1 then 'Aut.Conting.' ");
sql.append(" when bpe.tiposubstituicao is not null then 'Autorizado/Substituição' "); sql.append(" when bpe.tiposubstituicao is not null then 'Autorizado/Substituio' ");
sql.append(" when bpeSub.bpe_id is not null then 'Autorizado/Substituído' "); sql.append(" when bpeSub.bpe_id is not null then 'Autorizado/Substituído' ");
sql.append(" else 'Autorizado' "); sql.append(" else 'Autorizado' ");
sql.append(" end "); sql.append(" end ");