From 62c528747eeaf394196d729a84be71ea8d35b889 Mon Sep 17 00:00:00 2001 From: Lucas Date: Wed, 21 Aug 2024 20:35:12 -0300 Subject: [PATCH] AL-4824 --- .../ventaboletos/dao/FormaPagoDAO.java | 4 ++++ .../dao/hibernate/FormaPagoHibernateDAO.java | 20 +++++++++++++++++++ .../service/FormaPagoService.java | 4 ++++ .../service/impl/FormaPagoServiceImpl.java | 8 ++++++++ 4 files changed, 36 insertions(+) diff --git a/src/com/rjconsultores/ventaboletos/dao/FormaPagoDAO.java b/src/com/rjconsultores/ventaboletos/dao/FormaPagoDAO.java index 5958f90c0..75d31c220 100644 --- a/src/com/rjconsultores/ventaboletos/dao/FormaPagoDAO.java +++ b/src/com/rjconsultores/ventaboletos/dao/FormaPagoDAO.java @@ -16,4 +16,8 @@ public interface FormaPagoDAO extends GenericDAO { public List buscarPorDescricao(String descpago); public List buscarTodosExceto(Integer... idFormaPago); + + public List buscarNotIn(Short... idsFormaPago); + + public List buscarIn(Short... idsFormaPago); } diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/FormaPagoHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/FormaPagoHibernateDAO.java index 765c3d602..cf171cfef 100644 --- a/src/com/rjconsultores/ventaboletos/dao/hibernate/FormaPagoHibernateDAO.java +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/FormaPagoHibernateDAO.java @@ -55,4 +55,24 @@ public class FormaPagoHibernateDAO extends GenericHibernateDAO return c.list(); } + + public List buscarNotIn(Short... idsFormaPago) { + Criteria c = this.makeCriteria(); + for (Short id : idsFormaPago) { + c.add(Restrictions.ne("formapagoId", id)); + } + c.add(Restrictions.eq(ACTIVO, Boolean.TRUE)); + c.addOrder(Order.asc("descpago")); + return c.list(); + + } + + public List buscarIn(Short... idFormaPago) { + Criteria c = this.makeCriteria(); + c.add(Restrictions.in("formapagoId", idFormaPago)); + c.add(Restrictions.eq(ACTIVO, Boolean.TRUE)); + c.addOrder(Order.asc("descpago")); + return c.list(); + + } } diff --git a/src/com/rjconsultores/ventaboletos/service/FormaPagoService.java b/src/com/rjconsultores/ventaboletos/service/FormaPagoService.java index 7370f8790..253648101 100644 --- a/src/com/rjconsultores/ventaboletos/service/FormaPagoService.java +++ b/src/com/rjconsultores/ventaboletos/service/FormaPagoService.java @@ -22,4 +22,8 @@ public interface FormaPagoService extends GenericService { * @return */ public List buscarFormasPagoExceptoEspeciales(); + + public List buscarNotIn(Short... idFormaPago); + + public List buscarIn(Short... idFormaPago); } diff --git a/src/com/rjconsultores/ventaboletos/service/impl/FormaPagoServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/FormaPagoServiceImpl.java index 55c862d3b..8059afc61 100644 --- a/src/com/rjconsultores/ventaboletos/service/impl/FormaPagoServiceImpl.java +++ b/src/com/rjconsultores/ventaboletos/service/impl/FormaPagoServiceImpl.java @@ -103,4 +103,12 @@ public class FormaPagoServiceImpl implements FormaPagoService { public List buscarFormasPagoExceptoEspeciales() { return formaPagoDAO.buscarTodosExceto(formasPagoEspeciales); } + + public List buscarNotIn(Short... idFormaPago) { + return formaPagoDAO.buscarNotIn(idFormaPago); + } + + public List buscarIn(Short... idFormaPago) { + return formaPagoDAO.buscarIn(idFormaPago); + } }