|
This was the type of queries I used in Java. I had some conditions in
the WHERE clause that were used in several filters. I currently need something similar. Correct me if I'm wrong but doesn't extend just append the text of the child statement to the text of the parent statement? Regards, Bruno <select id="Filtros.Encomendas.Select" resultMap="Encomenda.Select.Map" cacheModel="filtros-encomendas-cache"> SELECT distinct enc.*, c.nome as nome_cliente, cond.descricao as desc_cond, date_part('year', enc.data_enc) * 10000 + enc.idano as numero_identificacao, c.distancia_km
FROM encomendas enc INNER JOIN itemsencomendas i ON enc.id = i.id_encomenda INNER JOIN artigos a ON i.id_artigo = a.id INNER JOIN qualidades q ON a.id_qualidade = q.id INNER JOIN formas f ON q.id_forma = f.id INNER JOIN especies e ON a.id_especie = e.id INNER JOIN clientes c ON c.id = enc.id_cliente INNER JOIN condicoespagamento cond ON cond.id = enc.id_condicao_pagamento WHERE (anulado IS NULL or anulado = false) <dynamic prepend="AND"> <include refid="Filtros.Vendas.Fragment"/> <include refid="Filtros.Cliente.Fragment"/> <include refid="Filtros.Especie.Fragment"/> <include refid="Filtros.Forma.Fragment"/> <include refid="Filtros.Confirmado.Fragment"/> <include refid="Filtros.Artigos.Fragment"/> </dynamic> ORDER BY a.id
LIMIT 100
</select> Gilles Bayon wrote:
-- Cool Advance - Information Systems www.cooladvance.com |
- Perofrmance problem Ibatis 1.2/.NET 2.0/SQL SER... Prosper
- Re: Perofrmance problem Ibatis 1.2/.NET 2.... Prosper
- Re: Perofrmance problem Ibatis 1.2/.NE... Prosper
- Re: Perofrmance problem Ibatis 1.2... Prosper
- SQL Fragments in iBATIS.NET Bruno Silva (Cool Advance)
- Re: SQL Fragments in iBAT... Gilles Bayon
- Re: SQL Fragments in ... Bruno Silva (Cool Advance)
- Re: SQL Fragments... Gilles Bayon
- Re: SQL Fragments... Bruno Silva (Cool Advance)
- Re: SQL Fragments... Gilles Bayon
- Re: SQL Fragments... Gilles Bayon
- Re: SQL Fragments... Bruno Silva (Cool Advance)
- Re: Perofrmance problem Ibatis... Gilles Bayon
- Re: Perofrmance problem I... Prosper

