Relacionamento de Marca com Empresa - Copia tarifas por marca
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@21331 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
4d916f7ce6
commit
b00d5bd911
|
@ -66,6 +66,8 @@ public class SQLBuilderOracle implements SQLBuilder {
|
||||||
sb.append("from ");
|
sb.append("from ");
|
||||||
sb.append(" ruta_combinacion rc ");
|
sb.append(" ruta_combinacion rc ");
|
||||||
sb.append(" inner join ruta r on r.ruta_id = rc.ruta_id ");
|
sb.append(" inner join ruta r on r.ruta_id = rc.ruta_id ");
|
||||||
|
//sb.append(" inner join ruta_empresa re on r.ruta_id = re.ruta_id ");
|
||||||
|
//sb.append(" inner join marca on marca.empresa_id = re.empresa_id ");
|
||||||
sb.append(" inner join orgao_tramo tc on tc.tramo_id = rc.tramo_id and tc.CLASESERVICIO_ID = r.CLASESERVICIO_ID and tc.activo =1 ");
|
sb.append(" inner join orgao_tramo tc on tc.tramo_id = rc.tramo_id and tc.CLASESERVICIO_ID = r.CLASESERVICIO_ID and tc.activo =1 ");
|
||||||
sb.append(" inner join orgao_concedente oc on oc.orgaoconcedente_id = tc.orgaoconcedente_id and oc.orgaoconcedente_id =r.orgaoconcedente_id ");
|
sb.append(" inner join orgao_concedente oc on oc.orgaoconcedente_id = tc.orgaoconcedente_id and oc.orgaoconcedente_id =r.orgaoconcedente_id ");
|
||||||
sb.append(" inner join coeficiente_tarifa ct1 on ct1.coeficientetarifa_id = tc.coeficientetarifa1_id ");
|
sb.append(" inner join coeficiente_tarifa ct1 on ct1.coeficientetarifa_id = tc.coeficientetarifa1_id ");
|
||||||
|
@ -83,10 +85,13 @@ public class SQLBuilderOracle implements SQLBuilder {
|
||||||
sb.append(" rc.activo = 1 ");
|
sb.append(" rc.activo = 1 ");
|
||||||
if (codRuta != null) {
|
if (codRuta != null) {
|
||||||
sb.append(" and r.ruta_id = ").append(codRuta);
|
sb.append(" and r.ruta_id = ").append(codRuta);
|
||||||
|
sb.append(" and mc.marca_id in (select marca_id from marca m inner join ruta_empresa re on re.empresa_id = m.empresa_id where re.activo = 1 and m.activo = 1 and re.ruta_id = ").append(codRuta).append(" )");
|
||||||
}
|
}
|
||||||
sb.append(" and r.activo = 1 ");
|
sb.append(" and r.activo = 1 ");
|
||||||
sb.append(" and tc.activo = 1 ");
|
sb.append(" and tc.activo = 1 ");
|
||||||
sb.append(" and mc.marca_id <> -1 ");
|
sb.append(" and mc.marca_id <> -1 ");
|
||||||
|
sb.append(" and mc.activo = 1 ");
|
||||||
|
//sb.append(" and re.activo = 1 ");
|
||||||
sb.append(" and m.moneda_id = 1 ");
|
sb.append(" and m.moneda_id = 1 ");
|
||||||
if (orgaoConcedenteId != null) {
|
if (orgaoConcedenteId != null) {
|
||||||
sb.append(" and oc.orgaoconcedente_id = ").append(orgaoConcedenteId);
|
sb.append(" and oc.orgaoconcedente_id = ").append(orgaoConcedenteId);
|
||||||
|
@ -99,6 +104,7 @@ public class SQLBuilderOracle implements SQLBuilder {
|
||||||
sb.append(" oc.orgaoconcedente_id, ");
|
sb.append(" oc.orgaoconcedente_id, ");
|
||||||
sb.append(" r.ruta_id) not in (select tao.tramo_id,tao.marca_id,tao.CLASESERVICIO_ID,tao.moneda_id,tao.orgaoconcedente_id, tao.ruta_id from tarifa_oficial tao where tao.activo = 1) ");
|
sb.append(" r.ruta_id) not in (select tao.tramo_id,tao.marca_id,tao.CLASESERVICIO_ID,tao.moneda_id,tao.orgaoconcedente_id, tao.ruta_id from tarifa_oficial tao where tao.activo = 1) ");
|
||||||
|
|
||||||
|
//System.out.println(sb.toString());
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,8 +15,10 @@ import javax.persistence.Entity;
|
||||||
import javax.persistence.GeneratedValue;
|
import javax.persistence.GeneratedValue;
|
||||||
import javax.persistence.GenerationType;
|
import javax.persistence.GenerationType;
|
||||||
import javax.persistence.Id;
|
import javax.persistence.Id;
|
||||||
|
import javax.persistence.JoinColumn;
|
||||||
import javax.persistence.Lob;
|
import javax.persistence.Lob;
|
||||||
import javax.persistence.OneToMany;
|
import javax.persistence.OneToMany;
|
||||||
|
import javax.persistence.OneToOne;
|
||||||
import javax.persistence.SequenceGenerator;
|
import javax.persistence.SequenceGenerator;
|
||||||
import javax.persistence.Table;
|
import javax.persistence.Table;
|
||||||
import javax.persistence.Temporal;
|
import javax.persistence.Temporal;
|
||||||
|
@ -31,9 +33,7 @@ import javax.persistence.TemporalType;
|
||||||
@Table(name = "MARCA")
|
@Table(name = "MARCA")
|
||||||
public class Marca implements Serializable {
|
public class Marca implements Serializable {
|
||||||
|
|
||||||
public final static short TODOS = -1;
|
public final static short TODOS = -1;
|
||||||
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
@Id
|
@Id
|
||||||
@Basic(optional = false)
|
@Basic(optional = false)
|
||||||
|
@ -42,6 +42,9 @@ public class Marca implements Serializable {
|
||||||
private Short marcaId;
|
private Short marcaId;
|
||||||
@Column(name = "DESCMARCA")
|
@Column(name = "DESCMARCA")
|
||||||
private String descmarca;
|
private String descmarca;
|
||||||
|
@OneToOne
|
||||||
|
@JoinColumn(name = "EMPRESA_ID")
|
||||||
|
private Empresa empresa;
|
||||||
@Lob
|
@Lob
|
||||||
@Column(name = "LOGOTIPOMARCA")
|
@Column(name = "LOGOTIPOMARCA")
|
||||||
private byte[] logotipomarca;
|
private byte[] logotipomarca;
|
||||||
|
@ -66,7 +69,15 @@ public class Marca implements Serializable {
|
||||||
@OneToMany(mappedBy = "marca")
|
@OneToMany(mappedBy = "marca")
|
||||||
private List<Corrida> corridaList;
|
private List<Corrida> corridaList;
|
||||||
|
|
||||||
public Marca() {
|
public Marca() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public Empresa getEmpresa() {
|
||||||
|
return empresa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEmpresa(Empresa empresa) {
|
||||||
|
this.empresa = empresa;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Marca(Short marcaId) {
|
public Marca(Short marcaId) {
|
||||||
|
|
Loading…
Reference in New Issue