Hello:
ibatis am with my sql and mysql and is
my XML MAP
<select id="getScannerOficina" resultMap="resultScannerOficina"
parameterMap="parametrosScanner" >
<![CDATA[
SELECT DISTINCT
scan.idScanner,scan.area_digitalizacion,
scan.resolucion_optica_maxima,scan.resolucion_interpolada,
scan.alimentador_hojas_automatico_SN,scan.formato_documento,
disp.non,disp.num_serie,disp.marca,
disp.modelo,disp.tipo,disp.year_fabricacion,
disp.tipo_dispositivo,disp.hora_ingreso,
disp.fecha_ingreso,disp.inalambrico_SN,
disp.interno_SN,disp.portatil_SN,
per.id as idPersona,per.rut,
per.nombre,per.ap_paterno,
per.ap_materno,emp.id as idEmpleado,
emp.cargo,emp.mail,emp.foto as fotoEmpleado,
ofi.id as idOficina,ofi.nombre as nomOficina,ofi.telefono
FROM dispositivo as disp
INNER JOIN scanner as scan ON disp.id=scan.idscanner
INNER JOIN oficina as ofi ON ofi.id=disp.idoficina
LEFT JOIN empleado as emp ON disp.idempleado=emp.id
LEFT JOIN persona as per ON per.id=emp.id
WHERE ofi.id=? ORDER BY disp.non LIMIT ?,?
]]>
</select>
and DAO
public List<Scanner> findAllByOficina(Oficina oficina,int limtInferior,int limtSuperior) throws ExcepcionDao {
try {
templateSpring=this.getSqlMapClientTemplate();
@SuppressWarnings("rawtypes")
Map map = new HashMap();
map.put("id", oficina.getIdOficina());
map.put("inferior",limtInferior);
map.put("superior",limtSuperior);
List<Scanner> listScanneres = templateSpring.queryForList("getScannerOficina",map);
return listScanneres;
} catch (Exception e) {
logger.error(e.getMessage());
e.printStackTrace();
throw new ExcepcionDao(e.getMessage());
}
}
MyService
public List<Scanner> listaScannerOficina(Oficina oficina,int limtInferior,int limtSuperior)
throws ExcepcionDao {
List<Scanner> returnList = oficina != null ? ScannerDAO.findAllByOficina(oficina, limtInferior, limtSuperior) : null;
return returnList;
}
now
as I can go spend this list and use container Lazy ibatis query and mysql or
complemented with data paging???