/*
SQLyog Ultimate v11.11 (32 bit)
MySQL - 5.5.5-10.1.31-MariaDB : Database - transporte
*********************************************************************
*/



CREATE DATABASE /*!32312 IF NOT EXISTS*/`transporte` /*!40100 DEFAULT CHARACTER SET utf8 */;

USE `transporte`;

/*Table structure for table `app_lang` */


CREATE TABLE `app_lang` (
  `idlang` int(11) NOT NULL AUTO_INCREMENT,
  `descripcion` varchar(200) NOT NULL,
  `alt` varchar(20) DEFAULT NULL,
  `class` varchar(20) NOT NULL,
  `estado` tinyint(4) NOT NULL,
  PRIMARY KEY (`idlang`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8;

/*Data for the table `app_lang` */

insert  into `app_lang`(`idlang`,`descripcion`,`alt`,`class`,`estado`) values (1,'English (US)','United States','flag-us',1),(2,'Français','France','flag-fr',1),(3,'Español','Spanish','flag-es',1),(4,'Deutsch','German','flag-de',1),(5,'日本語','Japan','flag-jp',1),(6,'中文','China','flag-cn',1),(7,'Italiano','Italy','flag-it',1),(8,'Portugal','Portugal','flag-pt',1),(9,'Русский язык','Russia','flag-ru',1),(10,'한국어','Korea','flag-kp',1);

/*Table structure for table `app_opcion` */


CREATE TABLE `app_opcion` (
  `idopcion` bigint(20) NOT NULL AUTO_INCREMENT,
  `descripcion` varchar(200) NOT NULL,
  `parent` bigint(20) DEFAULT NULL,
  `alias` varchar(100) DEFAULT NULL,
  `url` varchar(200) DEFAULT NULL,
  `icono` varchar(200) DEFAULT NULL,
  `nivel` int(11) NOT NULL,
  `orden` int(11) NOT NULL,
  `estado` int(11) NOT NULL,
  PRIMARY KEY (`idopcion`)
) ENGINE=InnoDB AUTO_INCREMENT=62 DEFAULT CHARSET=utf8;

/*Data for the table `app_opcion` */

insert  into `app_opcion`(`idopcion`,`descripcion`,`parent`,`alias`,`url`,`icono`,`nivel`,`orden`,`estado`) values (1,'Sistema',0,NULL,NULL,'fa fa-gears',1,1,1),(2,'Configuración',1,NULL,NULL,NULL,2,1,1),(3,'Parámetros',2,'PARAMETROS','application/configuracion/parametros','fa fa-cogs',3,1,1),(4,'Rol',2,'ROL','application/configuracion/rol','fa fa-steam',3,1,1),(5,'Asecovi',0,NULL,NULL,'fa fa-eye',1,2,1),(6,'Ingreso',5,NULL,NULL,NULL,2,1,1),(7,'Proceso',5,NULL,NULL,NULL,2,2,1),(8,'Salida',5,NULL,NULL,NULL,2,3,1),(9,'Acta General',7,'ACTAGENERAL','asecovi/proceso/actageneral','fa fa-fax',3,1,1),(10,'Acta Fiscalización',7,'ACTAFISCALIZACION','asecovi/proceso/actafiscalizacion','fa fa-check-square',3,2,1),(11,'Com. Reg. Sanciones',0,NULL,NULL,'fa fa-folder',1,3,1),(12,'Ingreso',11,NULL,NULL,NULL,2,1,1),(13,'Proceso',11,NULL,NULL,NULL,2,2,1),(14,'Salida',11,NULL,NULL,NULL,2,3,1),(15,'Expediente',13,'EXPEDIENTE','coresa/proceso/expediente','fa fa-archive',3,1,1),(16,'Acta Sesión',13,'ACTASESION','coresa/proceso/actasesion','fa fa-comments',3,2,1),(17,'Tipo',20,'TIPORESOLUCION','coresa/ingreso/tiporesolucion','fa fa-bookmark',4,1,1),(18,'Recurso',19,'RECURSONOTIFICACION','coresa/ingreso/recursonotificacion','fa fa-cube',4,2,1),(19,'Notificación',12,NULL,NULL,NULL,3,1,1),(20,'Resolución',12,NULL,NULL,NULL,3,2,1),(21,'Condición',19,'CONDICIONNOTIFICACION','coresa/ingreso/condicionnotificacion','fa fa-ticket',4,2,1),(22,'Motivo Acta',19,'MOTIVOENTREGAACTA','coresa/ingreso/motivoentregaactanotificacion','fa fa-file-text',4,3,1),(23,'Tipo',19,'TIPONOTIFICACION','coresa/ingreso/tiponotificacion','fa fa-th-list',4,4,1),(24,'Recurso Hidrobiológico',6,'RECURSOHIDROBIOLOGICO','asecovi/ingreso/recursohidrobiologico','fa fa-database',3,1,1),(25,'Unidad Fiscalizada',6,'UNIDADFISCALIZADA','asecovi/ingreso/unidadfiscalizada','fa fa-eye',3,2,1),(26,'Tipo Procesamiento',6,'TIPOPROCESAMIENTO','asecovi/ingreso/tipoprocesamiento','fa fa-puzzle-piece',3,3,1),(27,'Actividad',6,'ACTIVIDAD','asecovi/ingreso/actividad','fa fa-random',3,4,1),(28,'Vehículo',6,'VEHICULO','asecovi/ingreso/vehiculo','fa fa-anchor',3,5,1),(29,'Recursos Humanos',0,NULL,NULL,'fa fa-group',1,4,1),(30,'Ingreso',29,NULL,NULL,NULL,2,1,1),(31,'Proceso',29,NULL,NULL,NULL,2,2,1),(32,'Salida',29,NULL,NULL,NULL,2,3,1),(33,'Condicion Cargo',30,'CONDCAG','rrhh/ingreso/condicioncargo','fa fa-fire',3,1,1),(34,'Cargo',30,'CARGO','rrhh/ingreso/cargo','fa fa-th-large',3,2,1),(35,'Cargo Organización',30,'CARGOR','rrhh/ingreso/cargoorganizacion','fa fa-list-alt',3,3,1),(36,'Estado Laboral',30,'ESTLAB','rrhh/ingreso/estadolaboral','fa fa-chain',3,4,1),(37,'Categoria Régimen',30,'CATREF','rrhh/ingreso/categoriaregimen','fa fa-unlink',3,5,1),(38,'Régimen',30,'REGIMEN','rrhh/ingreso/regimen','fa fa-dribbble',3,6,1),(39,'Condición Laboral',30,'CONDLAB','rrhh/ingreso/condicionlaboral','fa fa-bookmark-o',3,7,1),(40,'Modalidad Laboral',30,'MODLAB','rrhh/ingreso/modalidadlaboral','fa fa-asterisk',3,8,1),(41,'Empleados',31,'EMPLEADOS','rrhh/proceso/empleados','fa fa-child',1,1,1),(42,'Mesa de Partes',0,NULL,NULL,'fa fa-bank',1,5,1),(43,'Ingreso',42,NULL,NULL,NULL,2,1,1),(44,'Proceso',42,NULL,NULL,NULL,2,2,1),(45,'Salida',42,NULL,NULL,NULL,2,3,1),(46,'Recepción',44,'RECEPDOC','mesapartes/proceso/recepcion','fa fa-book',3,1,1),(47,'Administración',0,NULL,NULL,'fa fa-cube',1,6,1),(48,'Ingreso',47,NULL,NULL,NULL,2,1,1),(49,'Proceso',47,NULL,NULL,NULL,2,2,1),(50,'Salida',47,NULL,NULL,NULL,2,3,1),(51,'Pagos',49,'PAGOS','administracion/proceso/pagos','fa fa-money',3,1,1),(52,'Comprobantes',49,'COMPROBANTES','administracion/proceso/comprobantes','fa fa-dollar',3,2,1),(53,'Asistencia',0,NULL,NULL,'fa fa-tachometer',1,7,1),(54,'Ingreso',53,NULL,NULL,NULL,2,1,1),(55,'Proceso',53,NULL,NULL,NULL,2,2,1),(56,'Salida',53,NULL,NULL,NULL,2,3,1),(57,'Papeleta',55,'PAPELETA','asistencia/proceso/papeleta','fa fa-share',3,1,1),(58,'Autorización Jefe',55,'AUTORIZARPAPELETA','asistencia/proceso/autorizar','fa fa-check-square-o',3,2,1),(59,'Permiso RRHH',55,'PERMISOPAPELETA','asistencia/proceso/permiso','fa fa-gavel',3,3,1),(60,'Marcación',55,'MARCACIONPAPELETA','asistencia/proceso/marcacion','fa fa-dashboard',3,4,1),(61,'Concepto',48,'CONCEPTO','administracion/ingreso/concepto','fa fa-book',3,1,1);

/*Table structure for table `app_parametros` */


CREATE TABLE `app_parametros` (
  `idparametro` bigint(20) NOT NULL AUTO_INCREMENT,
  `idtipo` int(11) NOT NULL,
  `codigo` char(20) NOT NULL,
  `descripcion` varchar(200) NOT NULL,
  `valor` varchar(200) NOT NULL,
  `consulta` varchar(500) NOT NULL,
  PRIMARY KEY (`idparametro`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8;

/*Data for the table `app_parametros` */

insert  into `app_parametros`(`idparametro`,`idtipo`,`codigo`,`descripcion`,`valor`,`consulta`) values (1,1,'IDIOXDEF','Idioma por Defecto','3','SELECT idlang AS \'option\',descripcion AS \'value\' FROM app_lang WHERE estado=1;'),(2,1,'DOCDNI','Tipo de documento DNI','1','SELECT idtipodocumento AS \'option\',descripcion AS \'value\' FROM mae_tipodocumento WHERE estado=1;');

/*Table structure for table `app_permiso` */


CREATE TABLE `app_permiso` (
  `idpermiso` int(11) NOT NULL AUTO_INCREMENT,
  `alias` varchar(20) NOT NULL,
  `descripcion` varchar(100) NOT NULL,
  `icono` varchar(20) NOT NULL,
  `theme` varchar(50) NOT NULL,
  `estado` tinyint(4) NOT NULL,
  PRIMARY KEY (`idpermiso`)
) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8;

/*Data for the table `app_permiso` */

insert  into `app_permiso`(`idpermiso`,`alias`,`descripcion`,`icono`,`theme`,`estado`) values (1,'SEARCH','Buscar','fa fa-search','btn btn-default',1),(2,'NEW','Nuevo','fa fa-file-o','btn btn-primary',1),(3,'DELETE','Eliminar','fa fa-trash-o','btn btn-danger',1),(4,'EDIT','Editar','fa fa-edit','btn btn-primary',1),(5,'SAVE','Grabar','fa fa-save','btn btn-primary',1),(6,'UPDATE','Actualizar','fa fa-save','btn btn-primary',1),(7,'ADD','Agregar','fa fa-plus','btn btn-default',1),(8,'CONF','Configurar','fa fa-cogs','btn btn-warning',1),(9,'VIEW','Vista Previa','fa fa-search','btn btn-default',1),(10,'UNLOCK','Desbloquear','fa fa-unlock','btn btn-default',1),(11,'UPLOAD','Adjuntar archivo','fa fa-upload','btn btn-danger',1),(12,'FISCAL','Fiscalización','fa fa-check-square','btn btn-warning',1),(13,'VIEWIMG','Ver imagen','fa fa-file-image-o','btn btn-primary',1),(14,'SEND','Enviar','fa fa-send-o','btn btn-warning',1),(15,'NOTIFY','Notificar','fa fa-bullhorn','btn btn-primary',1),(16,'APELAR','Apelar','fa fa-shield','btn btn-warning',1),(17,'RESOL','Resolución','fa fa-institution','btn btn-danger',1),(18,'DICTAMEN','Dictamen','fa fa-legal','btn btn-success',1),(19,'ACTASESION','Acta Sesión','fa fa-comments','btn btn-info',1),(20,'LOCK','Archivar','fa fa-lock','btn bg-color-blueDark txt-color-white',1),(21,'HIST','Historial','fa fa-sitemap','btn bg-color-blueLight txt-color-white',1),(22,'DOC','Documento','fa fa-fax','btn btn-success',1),(23,'APROB','Aprobar','fa fa-thumbs-o-up','btn btn-success',1),(24,'DESAP','Desaprobar','fa fa-thumbs-o-down','btn btn-warning',1),(25,'DECID','Decidir','fa fa-gavel','btn btn-success',1),(26,'MARCAR','Marcar','fa fa-dashboard','btn btn-primary',1),(27,'DOWNLOAD','Descargar','fa fa-download','btn btn-warning',1);

/*Table structure for table `app_rol` */


CREATE TABLE `app_rol` (
  `idrol` int(11) NOT NULL AUTO_INCREMENT,
  `descripcion` varchar(200) NOT NULL,
  `contenido` varchar(200) NOT NULL,
  `estado` tinyint(4) NOT NULL,
  PRIMARY KEY (`idrol`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;

/*Data for the table `app_rol` */

insert  into `app_rol`(`idrol`,`descripcion`,`contenido`,`estado`) values (1,'Administrador','Control total del sistema',1),(2,'Asistente','consultas, reportes y tramites',1);

/*Table structure for table `app_rolopcion` */


CREATE TABLE `app_rolopcion` (
  `idrolopcion` bigint(20) NOT NULL AUTO_INCREMENT,
  `idrol` int(11) NOT NULL,
  `idopcion` bigint(20) NOT NULL,
  PRIMARY KEY (`idrolopcion`),
  KEY `idrol` (`idrol`),
  KEY `idopcion` (`idopcion`),
  CONSTRAINT `app_rolopcion_ibfk_1` FOREIGN KEY (`idrol`) REFERENCES `app_rol` (`idrol`),
  CONSTRAINT `app_rolopcion_ibfk_4` FOREIGN KEY (`idopcion`) REFERENCES `app_opcion` (`idopcion`)
) ENGINE=InnoDB AUTO_INCREMENT=66 DEFAULT CHARSET=utf8;

/*Data for the table `app_rolopcion` */

insert  into `app_rolopcion`(`idrolopcion`,`idrol`,`idopcion`) values (3,1,1),(4,1,2),(5,1,3),(6,1,4),(7,1,5),(8,1,6),(9,1,7),(10,1,8),(11,1,9),(12,1,10),(13,1,11),(14,1,12),(15,1,13),(16,1,14),(17,1,15),(18,1,16),(19,1,17),(20,1,18),(21,1,19),(22,1,20),(23,1,21),(24,1,22),(25,1,23),(26,1,24),(27,1,25),(28,1,26),(29,1,27),(30,1,28),(31,1,29),(32,1,30),(33,1,31),(34,1,32),(36,1,33),(37,1,34),(38,1,35),(39,1,36),(40,1,37),(41,1,38),(42,1,39),(43,1,40),(44,1,41),(45,1,42),(46,1,43),(47,1,44),(48,1,45),(49,1,46),(50,1,47),(51,1,48),(52,1,49),(53,1,50),(55,1,51),(56,1,52),(57,1,53),(58,1,54),(59,1,55),(60,1,56),(61,1,57),(62,1,58),(63,1,59),(64,1,60),(65,1,61);

/*Table structure for table `app_rolopcionpermiso` */


CREATE TABLE `app_rolopcionpermiso` (
  `idrolopcion` bigint(20) NOT NULL,
  `idpermiso` int(11) NOT NULL,
  PRIMARY KEY (`idrolopcion`,`idpermiso`),
  KEY `idpermiso` (`idpermiso`),
  CONSTRAINT `app_rolopcionpermiso_ibfk_1` FOREIGN KEY (`idpermiso`) REFERENCES `app_permiso` (`idpermiso`),
  CONSTRAINT `app_rolopcionpermiso_ibfk_2` FOREIGN KEY (`idrolopcion`) REFERENCES `app_rolopcion` (`idrolopcion`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

/*Data for the table `app_rolopcionpermiso` */

insert  into `app_rolopcionpermiso`(`idrolopcion`,`idpermiso`) values (6,2),(6,3),(6,4),(6,5),(6,6),(6,7),(11,2),(11,5),(11,9),(11,11),(11,13),(12,2),(12,3),(12,5),(12,7),(12,9),(12,11),(12,13),(12,14),(15,2),(15,5),(15,9),(15,11),(17,2),(17,3),(17,5),(17,9),(17,15),(17,16),(17,17),(17,18),(17,19),(17,20),(17,21),(17,22),(17,27),(18,2),(18,3),(18,5),(18,7),(18,9),(19,2),(19,3),(19,4),(19,5),(19,6),(20,2),(20,3),(20,4),(20,5),(20,6),(23,2),(23,3),(23,4),(23,5),(23,6),(24,2),(24,3),(24,4),(24,5),(24,6),(25,2),(25,3),(25,4),(25,5),(25,6),(26,2),(26,3),(26,4),(26,5),(26,6),(27,2),(27,3),(27,4),(27,5),(27,6),(28,2),(28,3),(28,4),(28,5),(28,6),(29,2),(29,3),(29,4),(29,5),(29,6),(30,2),(30,3),(30,4),(30,5),(30,6),(36,2),(36,3),(36,4),(36,5),(36,6),(37,2),(37,3),(37,4),(37,5),(37,6),(38,2),(38,3),(38,4),(38,5),(38,6),(39,2),(39,3),(39,4),(39,5),(39,6),(40,2),(40,3),(40,4),(40,5),(40,6),(41,2),(41,3),(41,4),(41,5),(41,6),(42,2),(42,3),(42,4),(42,5),(42,6),(43,2),(43,3),(43,4),(43,5),(43,6),(44,2),(44,3),(44,4),(44,5),(44,6),(44,7),(44,8),(44,9),(49,2),(49,3),(49,4),(49,5),(49,6),(55,2),(55,5),(56,3),(56,9),(61,2),(61,3),(61,4),(61,5),(61,6),(61,9),(61,11),(62,5),(62,9),(62,25),(63,5),(63,9),(63,25),(64,9),(64,26),(65,2),(65,3),(65,4),(65,5),(65,6);

/*Table structure for table `app_tipoparametro` */


CREATE TABLE `app_tipoparametro` (
  `idtipo` int(11) NOT NULL AUTO_INCREMENT,
  `descripcion` varchar(200) NOT NULL,
  `estado` tinyint(1) NOT NULL,
  PRIMARY KEY (`idtipo`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;

/*Data for the table `app_tipoparametro` */

insert  into `app_tipoparametro`(`idtipo`,`descripcion`,`estado`) values (1,'LIST',1),(2,'TEXT',1),(3,'CHECK',1);

/*Table structure for table `app_usuario` */


CREATE TABLE `app_usuario` (
  `idusuario` bigint(20) NOT NULL AUTO_INCREMENT,
  `idpersona` bigint(20) NOT NULL,
  `usuario` char(10) NOT NULL,
  `clave` varchar(200) NOT NULL,
  PRIMARY KEY (`idusuario`),
  KEY `idpersona` (`idpersona`),
  CONSTRAINT `app_usuario_ibfk_1` FOREIGN KEY (`idpersona`) REFERENCES `mae_persona` (`idpersona`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

/*Data for the table `app_usuario` */

insert  into `app_usuario`(`idusuario`,`idpersona`,`usuario`,`clave`) values (1,2,'admin','e10adc3949ba59abbe56e057f20f883e');

/*Table structure for table `app_usuariorol` */


CREATE TABLE `app_usuariorol` (
  `idusuariorol` bigint(20) NOT NULL AUTO_INCREMENT,
  `idusuario` bigint(20) NOT NULL,
  `idrol` int(11) NOT NULL,
  PRIMARY KEY (`idusuariorol`),
  KEY `idusuario` (`idusuario`),
  KEY `idrol` (`idrol`),
  CONSTRAINT `app_usuariorol_ibfk_1` FOREIGN KEY (`idusuario`) REFERENCES `app_usuario` (`idusuario`),
  CONSTRAINT `app_usuariorol_ibfk_2` FOREIGN KEY (`idrol`) REFERENCES `app_rol` (`idrol`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

/*Data for the table `app_usuariorol` */

insert  into `app_usuariorol`(`idusuariorol`,`idusuario`,`idrol`) values (1,1,1);

/*Table structure for table `aud_historial` */


CREATE TABLE `aud_historial` (
  `idhistorial` bigint(20) NOT NULL AUTO_INCREMENT,
  `tipo` char(1) CHARACTER SET utf8 COLLATE utf8_spanish_ci NOT NULL,
  `tabla` varchar(100) NOT NULL,
  `idregistro` bigint(20) NOT NULL,
  `campos` varchar(200) NOT NULL,
  `anterior` text CHARACTER SET utf8 COLLATE utf8_spanish_ci,
  `actual` text CHARACTER SET utf8 COLLATE utf8_spanish_ci NOT NULL,
  `idusuario` bigint(20) NOT NULL,
  `fecha` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `ip` varchar(50) CHARACTER SET utf8 COLLATE utf8_spanish_ci NOT NULL,
  `navegador` varchar(50) CHARACTER SET utf8 COLLATE utf8_spanish_ci NOT NULL,
  `importante` char(1) CHARACTER SET utf8 COLLATE utf8_spanish_ci NOT NULL DEFAULT '0',
  PRIMARY KEY (`idhistorial`)
) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8;

/*Data for the table `aud_historial` */

insert  into `aud_historial`(`idhistorial`,`tipo`,`tabla`,`idregistro`,`campos`,`anterior`,`actual`,`idusuario`,`fecha`,`ip`,`navegador`,`importante`) values (1,'I','',10,'','','id:\"4\",tipo:\"1\",codigo:\"RES00002\",fecha:\"2018-08-13\",descripcion:\"sdfsdf\",seresuelve:\"\r\n                                Se resuelve                            \r\n                            \",observacion:\"ooo\",multa:\"multa\",decomiso:\"jejejej\",decomisado:\"1\",ruta:\"http://localhost/plantillaproyecto/files/expediente/4/resolucion/ruc.pdf\"',1,'2018-08-13 10:46:18','10.8.0.145','Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (K','1'),(2,'I','',11,'','','id:\"4\",tipo:\"1\",codigo:\"RES00002\",fecha:\"2018-08-13\",descripcion:\"sdfsdf\",seresuelve:\"\r\n                                Se resuelve                            \r\n                            \",observacion:\"ooo\",multa:\"multa\",decomiso:\"jejejej\",decomisado:\"1\",ruta:\"http://localhost/plantillaproyecto/files/expediente/4/resolucion/ruc.pdf\"',1,'2018-08-13 10:48:05','10.8.0.145','Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (K','1'),(3,'U','',11,'','','id:\"11\",estado:\"0\"',1,'2018-08-13 12:49:06','10.8.0.145','Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (K','1'),(4,'U','crs_resolucion',10,'','','id:\"10\",estado:\"0\"',1,'2018-08-13 12:53:57','10.8.0.145','Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (K','1'),(5,'U','crs_resolucion',9,'','','estado:\"0\"',1,'2018-08-13 12:56:39','10.8.0.145','Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (K','1'),(6,'I','crs_resolucion',12,'','','idexpediente:\"4\",tipo:\"1\",codigo:\"res00003\",fecha:\"2018-08-13\",descripcion:\"sdfsdf\",seresuelve:\"\r\n                                Se resuelve                            \r\n                            \",observacion:\"ooo\",multa:\"mmm\",decomiso:\"kkkk\",decomisado:\"1\",ruta:\"http://localhost/plantillaproyecto/files/expediente/4/resolucion/ruc.pdf\"',1,'2018-08-13 13:00:21','10.8.0.145','Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (K','1'),(7,'I','crs_resolucion',13,'expediente,tipo,codigo,fecha,descripcion,seresuelve,observacion,multa,decomiso,decomisado,ruta','','idexpediente:\"5\",tipo:\"1\",codigo:\"RES00005\",fecha:\"2018-08-13\",descripcion:\"sdsdf\",seresuelve:\"\r\n                                Se resuelve                            \r\n                            \",observacion:\"ooo\",multa:\"mul\",decomiso:\"dec\",decomisado:\"1\",ruta:\"http://localhost/plantillaproyecto/files/expediente/5/resolucion/ruc.pdf\"',1,'2018-08-13 14:19:07','192.168.43.221','Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (K','1'),(8,'I','crs_apelacion',12,'idresolucion,correlativo,codigo,fecharecepcionmesapartes,horarecpcionmesapartes,idtipodocumento,numerodocumento,remitente,observacion,estado,ruta,nombrearchivo,tipoarchivo,','','idresolucion:\"12\",correlativo:\"2018000007\",codigo:\"APE0000004\",fecharecepcionmesapartes:\"2018-08-20\",horarecpcionmesapartes:\"09:03:04\",idtipodocumento:\"1\",numerodocumento:\"saassa\",remitente:\"asasd\",observacion:\"asdas\",estado:\"1\",ruta:\"http://localhost/plantillaproyecto/files/expediente/12/apelacion/ruc.pdf\"',1,'2018-08-20 09:03:04','192.168.1.36','Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (K','1'),(9,'U','crs_apelacion',7,'','','estado:\"0\"',1,'2018-08-20 09:03:48','192.168.1.36','Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (K','1'),(10,'I','crs_dictamen',15,'idexpediente,correlativo,codigo,fecha,remitente,destinatario,observacion,estado,ruta','','idexpediente:\"4\",correlativo:\"2018000009\",codigo:\"DIC0000009\",fecha:\"2018-08-20\",remitente:\"asdas\",destinatario:\"asdsad\",observacion:\"sadsad\",estado:\"1\",ruta:\"http://localhost/plantillaproyecto/files/expediente/4/dictamen/ruc.pdf\"',1,'2018-08-20 09:17:16','192.168.1.36','Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (K','1'),(11,'I','crs_dictamen',16,'idexpediente,correlativo,codigo,fecha,remitente,destinatario,observacion,estado,ruta','','idexpediente:\"4\",correlativo:\"2018000010\",codigo:\"DIC0000010\",fecha:\"2018-08-20\",remitente:\"asdas\",destinatario:\"asdsad\",observacion:\"sadsad\",estado:\"1\",ruta:\"http://localhost/plantillaproyecto/files/expediente/4/dictamen/ruc.pdf\"',1,'2018-08-20 09:17:23','192.168.1.36','Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (K','1'),(12,'U','crs_dictamen',15,'estado','','estado:\"0\"',1,'2018-08-20 09:17:28','192.168.1.36','Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (K','1'),(13,'I','crs_documento',23,'idapelacion,correlativo,codigo,idtipo,fecha,remitente,destinatario,descripcion,observacion,estado,ruta','','idapelacion:\"2\",codigo:\"DOC0000005\",idtipo:\"1\",fecha:\"2018-08-20\",remitente:\"asdasd\",destinatario:\"asdsad\",descripcion:\"assad\",observacion:\"asdasd\",estado:\"1\",ruta:\"http://localhost/plantillaproyecto/files/expediente/2/oficio/ruc.pdf\"',1,'2018-08-20 09:33:38','192.168.1.36','Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (K','1'),(14,'U','crs_resolucion',12,'estado','','estado:\"0\"',1,'2018-08-20 09:34:51','192.168.1.36','Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (K','1'),(15,'U','crs_apelacion',2,'estado','','estado:\"0\"',1,'2018-08-20 09:35:01','192.168.1.36','Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (K','1'),(16,'U','crs_documento',16,'estado','','estado:\"0\"',1,'2018-08-20 09:35:07','192.168.1.36','Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (K','1'),(17,'I','crs_expediente',6,'idfiscalizacion,correlativo,codigo,fechainfraccion,fecharecepcion,observacion,idestado','','idexpediente:\"6\",idfiscalizacion:\"3\",correlativo:\"2018000003\",codigo:\"2018000010\",_fechainfraccion:\"2018-08-20\",fecharecepcion:\"2018-08-20\",observacion:\"sdsd\",idestado:\"1\"',1,'2018-08-20 09:56:42','192.168.1.36','Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (K','1'),(18,'I','crs_notificacion',18,'idexpediente,idtipo,codigo,personadestinatario,fecha,condicionnotificacion,recursosprocedentes,personarecibe,idtipodocumentorecibe,documentorecibe,relacioncondestinatario,fecharecepcion,horarecepcion,','','idexpediente:\"6\",idtipo:\"1\",codigo:\"not000001\",personadestinatario:\"hayd\",fecha:\"2018-08-20\",condicionnotificacion:\"1\",recursosprocedentes:\"1\",personarecibe:\"kklklk\",idtipodocumentorecibe:\"1\",documentorecibe:\"lklk\",relacioncondestinatario:\"lkñl\",fecharecepcion:\"2018-08-20\",horarecepcion:\"11:11:00\",domicilioerrado:\"0\",motivoentregaconacta:\"null\",observaciones:\"\",ruta:\"http://localhost/plantillaproyecto/files/expediente/6/notificacion/ruc.pdf\",idestado:\"1\"',1,'2018-08-20 12:57:43','192.168.1.36','Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (K','1'),(19,'U','crs_notificacion',18,'estado','','estado:\"0\"',1,'2018-08-20 16:39:46','192.168.1.36','Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (K','1'),(20,'I','crs_expediente',7,'idfiscalizacion,codigo,fechainfraccion,fecharecepcion,observacion,idestado','','idexpediente:\"7\",idfiscalizacion:\"11\",codigo:\"EXP00003\",fechainfraccion:\"2018-09-05\",fecharecepcion:\"2018-09-05\",observacion:\"sdfsdf\",idestado:\"1\"',1,'2018-09-05 09:28:00','192.168.1.52','Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (K','1'),(21,'I','crs_apelacion',8,'idresolucion,codigo,fecharecepcionmesapartes,horarecpcionmesapartes,idtipodocumento,numerodocumento,remitente,observacion,estado,ruta,nombrearchivo,tipoarchivo,','','idresolucion:\"6\",codigo:\"APE000011\",fecharecepcionmesapartes:\"2018-09-05\",horarecpcionmesapartes:\"12:11:24\",idtipodocumento:\"1\",numerodocumento:\"kjhkjh\",remitente:\"kjhkjhk\",observacion:\"jhkjh\",estado:\"1\",ruta:\"http://localhost/drp/files/expediente/6/apelacion/ruc.pdf\"',1,'2018-09-05 12:11:24','192.168.1.52','Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (K','1'),(22,'I','crs_notificacion',19,'idexpediente,idtipo,codigo,personadestinatario,fecha,condicionnotificacion,recursosprocedentes,personarecibe,idtipodocumentorecibe,documentorecibe,relacioncondestinatario,fecharecepcion,horarecepcion,','','idexpediente:\"4\",idtipo:\"1\",codigo:\"jejeje\",personadestinatario:\"asdads\",fecha:\"2018-10-09\",condicionnotificacion:\"1\",recursosprocedentes:\"1\",personarecibe:\"asdasd\",idtipodocumentorecibe:\"1\",documentorecibe:\"333333\",relacioncondestinatario:\"asdasd\",fecharecepcion:\"2018-10-09\",horarecepcion:\"00:00:00\",domicilioerrado:\"0\",motivoentregaconacta:\"1\",observaciones:\"asdsa\",ruta:\"http://localhost/direpro/files/expediente/4/notificacion/ojs.pdf\",idestado:\"1\"',1,'2018-10-09 09:28:54','192.168.1.60','Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (K','1'),(23,'I','crs_apelacion',9,'idresolucion,codigo,fecharecepcionmesapartes,horarecpcionmesapartes,idtipodocumento,numerodocumento,remitente,observacion,estado,ruta,nombrearchivo,tipoarchivo,','','idresolucion:\"4\",codigo:\"APE-00001\",fecharecepcionmesapartes:\"2018-10-09\",horarecpcionmesapartes:\"09:37:31\",idtipodocumento:\"1\",numerodocumento:\"qwdqwe\",remitente:\"qwe\",observacion:\"qwe\",estado:\"1\",ruta:\"http://localhost/direpro/files/expediente/4/apelacion/ojs.pdf\"',1,'2018-10-09 09:37:31','192.168.1.60','Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (K','1'),(24,'I','crs_expediente',8,'idfiscalizacion,codigo,fechainfraccion,fecharecepcion,observacion,idestado','','idexpediente:\"8\",idfiscalizacion:\"10\",codigo:\"EXP000004\",fechainfraccion:\"2018-10-09\",fecharecepcion:\"2018-10-09\",observacion:\"sd\",idestado:\"1\"',1,'2018-10-09 10:52:32','192.168.1.60','Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (K','1'),(25,'I','crs_expediente',9,'idfiscalizacion,codigo,fechainfraccion,fecharecepcion,observacion,idestado','','idexpediente:\"9\",idfiscalizacion:\"5\",codigo:\"EXP000005\",fechainfraccion:\"2018-10-09\",fecharecepcion:\"2018-10-09\",observacion:\"sdsdf\",idestado:\"1\"',1,'2018-10-09 11:16:19','192.168.1.60','Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (K','1'),(26,'I','crs_dictamen',17,'idexpediente,codigo,fecha,remitente,destinatario,observacion,estado,ruta','','idexpediente:\"4\",codigo:\"DIC00000011\",fecha:\"2018-10-09\",remitente:\"dsafsdf\",destinatario:\"lkjlkj\",observacion:\"lkjlkj\",estado:\"1\",ruta:\"http://localhost/direpro/files/expediente/4/dictamen/ruc.pdf\"',1,'2018-10-09 12:43:06','192.168.1.60','Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (K','1');

/*Table structure for table `mae_cliente` */


CREATE TABLE `mae_cliente` (
  `idcliente` bigint(20) NOT NULL AUTO_INCREMENT,
  `idpersona` bigint(20) NOT NULL,
  `estado` tinyint(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`idcliente`),
  KEY `idpersona` (`idpersona`),
  CONSTRAINT `mae_cliente_ibfk_1` FOREIGN KEY (`idpersona`) REFERENCES `mae_persona` (`idpersona`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

/*Data for the table `mae_cliente` */

/*Table structure for table `mae_empresa` */


CREATE TABLE `mae_empresa` (
  `idempresa` int(11) NOT NULL AUTO_INCREMENT,
  `ruc` varchar(11) NOT NULL,
  `razonsocial` varchar(150) NOT NULL,
  `razoncomercial` varchar(150) NOT NULL,
  `idubigeo` int(11) NOT NULL,
  `estado` tinyint(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`idempresa`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

/*Data for the table `mae_empresa` */

/*Table structure for table `mae_lugar` */


CREATE TABLE `mae_lugar` (
  `idlugar` int(11) NOT NULL AUTO_INCREMENT,
  `descripcion` varchar(100) NOT NULL,
  `estado` tinyint(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`idlugar`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

/*Data for the table `mae_lugar` */

/*Table structure for table `mae_persona` */


CREATE TABLE `mae_persona` (
  `idpersona` bigint(20) NOT NULL AUTO_INCREMENT,
  `apellidopaterno` varchar(30) NOT NULL,
  `apellidomaterno` varchar(30) DEFAULT NULL,
  `nombres` varchar(50) NOT NULL,
  `nombrecompleto` varchar(110) NOT NULL,
  `fechanacimiento` date NOT NULL,
  `sexo` char(1) NOT NULL,
  `idtipodocumento` int(11) NOT NULL,
  `numerodocumento` varchar(15) NOT NULL,
  PRIMARY KEY (`idpersona`),
  KEY `idtipodocumento` (`idtipodocumento`),
  CONSTRAINT `mae_persona_ibfk_1` FOREIGN KEY (`idtipodocumento`) REFERENCES `mae_tipodocumento` (`idtipodocumento`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;

/*Data for the table `mae_persona` */

insert  into `mae_persona`(`idpersona`,`apellidopaterno`,`apellidomaterno`,`nombres`,`nombrecompleto`,`fechanacimiento`,`sexo`,`idtipodocumento`,`numerodocumento`) values (2,'Carranza','Machado','David','Carranza Machado David','1989-07-06','1',1,'45810952');

/*Table structure for table `mae_tipodocumento` */


CREATE TABLE `mae_tipodocumento` (
  `idtipodocumento` int(11) NOT NULL AUTO_INCREMENT,
  `descripcion` varchar(100) NOT NULL,
  `estado` tinyint(1) NOT NULL,
  PRIMARY KEY (`idtipodocumento`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

/*Data for the table `mae_tipodocumento` */

insert  into `mae_tipodocumento`(`idtipodocumento`,`descripcion`,`estado`) values (1,'DNI',1);

/*Table structure for table `mae_ubigeo` */


CREATE TABLE `mae_ubigeo` (
  `idubigeo` bigint(11) NOT NULL AUTO_INCREMENT,
  `descripcion` varchar(100) NOT NULL,
  `idpais` int(11) DEFAULT '9589',
  `idparent` bigint(11) DEFAULT NULL,
  PRIMARY KEY (`idubigeo`),
  KEY `idpais` (`idpais`),
  CONSTRAINT `mae_ubigeo_ibfk_1` FOREIGN KEY (`idpais`) REFERENCES `mae_pais` (`idpais`)
) ENGINE=InnoDB AUTO_INCREMENT=2089 DEFAULT CHARSET=utf8;

/*Data for the table `mae_ubigeo` */

insert  into `mae_ubigeo`(`idubigeo`,`descripcion`,`idpais`,`idparent`) values (1,'Amazonas',9589,0),(2,'Chachapoyas',9589,1),(3,'Chachapoyas',9589,2),(4,'Asunción',9589,2),(5,'Balsas',9589,2),(6,'Cheto',9589,2),(7,'Chiliquin',9589,2),(8,'Chuquibamba',9589,2),(9,'Granada',9589,2),(10,'Huancas',9589,2),(11,'La Jalca',9589,2),(12,'Leimebamba',9589,2),(13,'Levanto',9589,2),(14,'Magdalena',9589,2),(15,'Mariscal Castilla',9589,2),(16,'Molinopampa',9589,2),(17,'Montevideo',9589,2),(18,'Olleros',9589,2),(19,'Quinjalca',9589,2),(20,'San Francisco de Daguas',9589,2),(21,'San Isidro de Maino',9589,2),(22,'Soloco',9589,2),(23,'Sonche',9589,2),(24,'Bagua',9589,1),(25,'Bagua',9589,24),(26,'Aramango',9589,24),(27,'Copallin',9589,24),(28,'El Parco',9589,24),(29,'Imaza',9589,24),(30,'La Peca',9589,24),(31,'Bongará',9589,1),(32,'Jumbilla',9589,31),(33,'Chisquilla',9589,31),(34,'Churuja',9589,31),(35,'Corosha',9589,31),(36,'Cuispes',9589,31),(37,'Florida',9589,31),(38,'Jazan',9589,31),(39,'Recta',9589,31),(40,'San Carlos',9589,31),(41,'Shipasbamba',9589,31),(42,'Valera',9589,31),(43,'Yambrasbamba',9589,31),(44,'Condorcanqui',9589,1),(45,'Nieva',9589,44),(46,'El Cenepa',9589,44),(47,'Río Santiago',9589,44),(48,'Luya',9589,1),(49,'Lamud',9589,48),(50,'Camporredondo',9589,48),(51,'Cocabamba',9589,48),(52,'Colcamar',9589,48),(53,'Conila',9589,48),(54,'Inguilpata',9589,48),(55,'Longuita',9589,48),(56,'Lonya Chico',9589,48),(57,'Luya',9589,48),(58,'Luya Viejo',9589,48),(59,'María',9589,48),(60,'Ocalli',9589,48),(61,'Ocumal',9589,48),(62,'Pisuquia',9589,48),(63,'Providencia',9589,48),(64,'San Cristóbal',9589,48),(65,'San Francisco de Yeso',9589,48),(66,'San Jerónimo',9589,48),(67,'San Juan de Lopecancha',9589,48),(68,'Santa Catalina',9589,48),(69,'Santo Tomas',9589,48),(70,'Tingo',9589,48),(71,'Trita',9589,48),(72,'Rodríguez de Mendoza',9589,1),(73,'San Nicolás',9589,72),(74,'Chirimoto',9589,72),(75,'Cochamal',9589,72),(76,'Huambo',9589,72),(77,'Limabamba',9589,72),(78,'Longar',9589,72),(79,'Mariscal Benavides',9589,72),(80,'Milpuc',9589,72),(81,'Omia',9589,72),(82,'Santa Rosa',9589,72),(83,'Totora',9589,72),(84,'Vista Alegre',9589,72),(85,'Utcubamba',9589,1),(86,'Bagua Grande',9589,85),(87,'Cajaruro',9589,85),(88,'Cumba',9589,85),(89,'El Milagro',9589,85),(90,'Jamalca',9589,85),(91,'Lonya Grande',9589,85),(92,'Yamon',9589,85),(93,'Áncash',9589,0),(94,'Huaraz',9589,93),(95,'Huaraz',9589,94),(96,'Cochabamba',9589,94),(97,'Colcabamba',9589,94),(98,'Huanchay',9589,94),(99,'Independencia',9589,94),(100,'Jangas',9589,94),(101,'La Libertad',9589,94),(102,'Olleros',9589,94),(103,'Pampas Grande',9589,94),(104,'Pariacoto',9589,94),(105,'Pira',9589,94),(106,'Tarica',9589,94),(107,'Aija',9589,93),(108,'Aija',9589,107),(109,'Coris',9589,107),(110,'Huacllan',9589,107),(111,'La Merced',9589,107),(112,'Succha',9589,107),(113,'Antonio Raymondi',9589,93),(114,'Llamellin',9589,113),(115,'Aczo',9589,113),(116,'Chaccho',9589,113),(117,'Chingas',9589,113),(118,'Mirgas',9589,113),(119,'San Juan de Rontoy',9589,113),(120,'Asunción',9589,93),(121,'Chacas',9589,120),(122,'Acochaca',9589,120),(123,'Bolognesi',9589,93),(124,'Chiquian',9589,123),(125,'Abelardo Pardo Lezameta',9589,123),(126,'Antonio Raymondi',9589,123),(127,'Aquia',9589,123),(128,'Cajacay',9589,123),(129,'Canis',9589,123),(130,'Colquioc',9589,123),(131,'Huallanca',9589,123),(132,'Huasta',9589,123),(133,'Huayllacayan',9589,123),(134,'La Primavera',9589,123),(135,'Mangas',9589,123),(136,'Pacllon',9589,123),(137,'San Miguel de Corpanqui',9589,123),(138,'Ticllos',9589,123),(139,'Carhuaz',9589,93),(140,'Carhuaz',9589,139),(141,'Acopampa',9589,139),(142,'Amashca',9589,139),(143,'Anta',9589,139),(144,'Ataquero',9589,139),(145,'Marcara',9589,139),(146,'Pariahuanca',9589,139),(147,'San Miguel de Aco',9589,139),(148,'Shilla',9589,139),(149,'Tinco',9589,139),(150,'Yungar',9589,139),(151,'Carlos Fermín Fitzcarrald',9589,93),(152,'San Luis',9589,151),(153,'San Nicolás',9589,151),(154,'Yauya',9589,151),(155,'Casma',9589,93),(156,'Casma',9589,155),(157,'Buena Vista Alta',9589,155),(158,'Comandante Noel',9589,155),(159,'Yautan',9589,155),(160,'Corongo',9589,93),(161,'Corongo',9589,160),(162,'Aco',9589,160),(163,'Bambas',9589,160),(164,'Cusca',9589,160),(165,'La Pampa',9589,160),(166,'Yanac',9589,160),(167,'Yupan',9589,160),(168,'Huari',9589,93),(169,'Huari',9589,168),(170,'Anra',9589,168),(171,'Cajay',9589,168),(172,'Chavin de Huantar',9589,168),(173,'Huacachi',9589,168),(174,'Huacchis',9589,168),(175,'Huachis',9589,168),(176,'Huantar',9589,168),(177,'Masin',9589,168),(178,'Paucas',9589,168),(179,'Ponto',9589,168),(180,'Rahuapampa',9589,168),(181,'Rapayan',9589,168),(182,'San Marcos',9589,168),(183,'San Pedro de Chana',9589,168),(184,'Uco',9589,168),(185,'Huarmey',9589,93),(186,'Huarmey',9589,185),(187,'Cochapeti',9589,185),(188,'Culebras',9589,185),(189,'Huayan',9589,185),(190,'Malvas',9589,185),(191,'Huaylas',9589,93),(192,'Caraz',9589,191),(193,'Huallanca',9589,191),(194,'Huata',9589,191),(195,'Huaylas',9589,191),(196,'Mato',9589,191),(197,'Pamparomas',9589,191),(198,'Pueblo Libre',9589,191),(199,'Santa Cruz',9589,191),(200,'Santo Toribio',9589,191),(201,'Yuracmarca',9589,191),(202,'Mariscal Luzuriaga',9589,93),(203,'Piscobamba',9589,202),(204,'Casca',9589,202),(205,'Eleazar Guzmán Barron',9589,202),(206,'Fidel Olivas Escudero',9589,202),(207,'Llama',9589,202),(208,'Llumpa',9589,202),(209,'Lucma',9589,202),(210,'Musga',9589,202),(211,'Ocros',9589,93),(212,'Ocros',9589,211),(213,'Acas',9589,211),(214,'Cajamarquilla',9589,211),(215,'Carhuapampa',9589,211),(216,'Cochas',9589,211),(217,'Congas',9589,211),(218,'Llipa',9589,211),(219,'San Cristóbal de Rajan',9589,211),(220,'San Pedro',9589,211),(221,'Santiago de Chilcas',9589,211),(222,'Pallasca',9589,93),(223,'Cabana',9589,222),(224,'Bolognesi',9589,222),(225,'Conchucos',9589,222),(226,'Huacaschuque',9589,222),(227,'Huandoval',9589,222),(228,'Lacabamba',9589,222),(229,'Llapo',9589,222),(230,'Pallasca',9589,222),(231,'Pampas',9589,222),(232,'Santa Rosa',9589,222),(233,'Tauca',9589,222),(234,'Pomabamba',9589,93),(235,'Pomabamba',9589,234),(236,'Huayllan',9589,234),(237,'Parobamba',9589,234),(238,'Quinuabamba',9589,234),(239,'Recuay',9589,93),(240,'Recuay',9589,239),(241,'Catac',9589,239),(242,'Cotaparaco',9589,239),(243,'Huayllapampa',9589,239),(244,'Llacllin',9589,239),(245,'Marca',9589,239),(246,'Pampas Chico',9589,239),(247,'Pararin',9589,239),(248,'Tapacocha',9589,239),(249,'Ticapampa',9589,239),(250,'Santa',9589,93),(251,'Chimbote',9589,250),(252,'Cáceres del Perú',9589,250),(253,'Coishco',9589,250),(254,'Macate',9589,250),(255,'Moro',9589,250),(256,'Nepeña',9589,250),(257,'Samanco',9589,250),(258,'Santa',9589,250),(259,'Nuevo Chimbote',9589,250),(260,'Sihuas',9589,93),(261,'Sihuas',9589,260),(262,'Acobamba',9589,260),(263,'Alfonso Ugarte',9589,260),(264,'Cashapampa',9589,260),(265,'Chingalpo',9589,260),(266,'Huayllabamba',9589,260),(267,'Quiches',9589,260),(268,'Ragash',9589,260),(269,'San Juan',9589,260),(270,'Sicsibamba',9589,260),(271,'Yungay',9589,93),(272,'Yungay',9589,271),(273,'Cascapara',9589,271),(274,'Mancos',9589,271),(275,'Matacoto',9589,271),(276,'Quillo',9589,271),(277,'Ranrahirca',9589,271),(278,'Shupluy',9589,271),(279,'Yanama',9589,271),(280,'Apurímac',9589,0),(281,'Abancay',9589,280),(282,'Abancay',9589,281),(283,'Chacoche',9589,281),(284,'Circa',9589,281),(285,'Curahuasi',9589,281),(286,'Huanipaca',9589,281),(287,'Lambrama',9589,281),(288,'Pichirhua',9589,281),(289,'San Pedro de Cachora',9589,281),(290,'Tamburco',9589,281),(291,'Andahuaylas',9589,280),(292,'Andahuaylas',9589,291),(293,'Andarapa',9589,291),(294,'Chiara',9589,291),(295,'Huancarama',9589,291),(296,'Huancaray',9589,291),(297,'Huayana',9589,291),(298,'Kishuara',9589,291),(299,'Pacobamba',9589,291),(300,'Pacucha',9589,291),(301,'Pampachiri',9589,291),(302,'Pomacocha',9589,291),(303,'San Antonio de Cachi',9589,291),(304,'San Jerónimo',9589,291),(305,'San Miguel de Chaccrampa',9589,291),(306,'Santa María de Chicmo',9589,291),(307,'Talavera',9589,291),(308,'Tumay Huaraca',9589,291),(309,'Turpo',9589,291),(310,'Kaquiabamba',9589,291),(311,'José María Arguedas',9589,291),(312,'Antabamba',9589,280),(313,'Antabamba',9589,312),(314,'El Oro',9589,312),(315,'Huaquirca',9589,312),(316,'Juan Espinoza Medrano',9589,312),(317,'Oropesa',9589,312),(318,'Pachaconas',9589,312),(319,'Sabaino',9589,312),(320,'Aymaraes',9589,280),(321,'Chalhuanca',9589,320),(322,'Capaya',9589,320),(323,'Caraybamba',9589,320),(324,'Chapimarca',9589,320),(325,'Colcabamba',9589,320),(326,'Cotaruse',9589,320),(327,'Ihuayllo',9589,320),(328,'Justo Apu Sahuaraura',9589,320),(329,'Lucre',9589,320),(330,'Pocohuanca',9589,320),(331,'San Juan de Chacña',9589,320),(332,'Sañayca',9589,320),(333,'Soraya',9589,320),(334,'Tapairihua',9589,320),(335,'Tintay',9589,320),(336,'Toraya',9589,320),(337,'Yanaca',9589,320),(338,'Cotabambas',9589,280),(339,'Tambobamba',9589,338),(340,'Cotabambas',9589,338),(341,'Coyllurqui',9589,338),(342,'Haquira',9589,338),(343,'Mara',9589,338),(344,'Challhuahuacho',9589,338),(345,'Chincheros',9589,280),(346,'Chincheros',9589,345),(347,'Anco_Huallo',9589,345),(348,'Cocharcas',9589,345),(349,'Huaccana',9589,345),(350,'Ocobamba',9589,345),(351,'Ongoy',9589,345),(352,'Uranmarca',9589,345),(353,'Ranracancha',9589,345),(354,'Rocchacc',9589,345),(355,'El Porvenir',9589,345),(356,'Grau',9589,280),(357,'Chuquibambilla',9589,356),(358,'Curpahuasi',9589,356),(359,'Gamarra',9589,356),(360,'Huayllati',9589,356),(361,'Mamara',9589,356),(362,'Micaela Bastidas',9589,356),(363,'Pataypampa',9589,356),(364,'Progreso',9589,356),(365,'San Antonio',9589,356),(366,'Santa Rosa',9589,356),(367,'Turpay',9589,356),(368,'Vilcabamba',9589,356),(369,'Virundo',9589,356),(370,'Curasco',9589,356),(371,'Arequipa',9589,0),(372,'Arequipa',9589,371),(373,'Arequipa',9589,372),(374,'Alto Selva Alegre',9589,372),(375,'Cayma',9589,372),(376,'Cerro Colorado',9589,372),(377,'Characato',9589,372),(378,'Chiguata',9589,372),(379,'Jacobo Hunter',9589,372),(380,'La Joya',9589,372),(381,'Mariano Melgar',9589,372),(382,'Miraflores',9589,372),(383,'Mollebaya',9589,372),(384,'Paucarpata',9589,372),(385,'Pocsi',9589,372),(386,'Polobaya',9589,372),(387,'Quequeña',9589,372),(388,'Sabandia',9589,372),(389,'Sachaca',9589,372),(390,'San Juan de Siguas',9589,372),(391,'San Juan de Tarucani',9589,372),(392,'Santa Isabel de Siguas',9589,372),(393,'Santa Rita de Siguas',9589,372),(394,'Socabaya',9589,372),(395,'Tiabaya',9589,372),(396,'Uchumayo',9589,372),(397,'Vitor',9589,372),(398,'Yanahuara',9589,372),(399,'Yarabamba',9589,372),(400,'Yura',9589,372),(401,'José Luis Bustamante Y Rivero',9589,372),(402,'Camaná',9589,371),(403,'Camaná',9589,402),(404,'José María Quimper',9589,402),(405,'Mariano Nicolás Valcárcel',9589,402),(406,'Mariscal Cáceres',9589,402),(407,'Nicolás de Pierola',9589,402),(408,'Ocoña',9589,402),(409,'Quilca',9589,402),(410,'Samuel Pastor',9589,402),(411,'Caravelí',9589,371),(412,'Caravelí',9589,411),(413,'Acarí',9589,411),(414,'Atico',9589,411),(415,'Atiquipa',9589,411),(416,'Bella Unión',9589,411),(417,'Cahuacho',9589,411),(418,'Chala',9589,411),(419,'Chaparra',9589,411),(420,'Huanuhuanu',9589,411),(421,'Jaqui',9589,411),(422,'Lomas',9589,411),(423,'Quicacha',9589,411),(424,'Yauca',9589,411),(425,'Castilla',9589,371),(426,'Aplao',9589,425),(427,'Andagua',9589,425),(428,'Ayo',9589,425),(429,'Chachas',9589,425),(430,'Chilcaymarca',9589,425),(431,'Choco',9589,425),(432,'Huancarqui',9589,425),(433,'Machaguay',9589,425),(434,'Orcopampa',9589,425),(435,'Pampacolca',9589,425),(436,'Tipan',9589,425),(437,'Uñon',9589,425),(438,'Uraca',9589,425),(439,'Viraco',9589,425),(440,'Caylloma',9589,371),(441,'Chivay',9589,440),(442,'Achoma',9589,440),(443,'Cabanaconde',9589,440),(444,'Callalli',9589,440),(445,'Caylloma',9589,440),(446,'Coporaque',9589,440),(447,'Huambo',9589,440),(448,'Huanca',9589,440),(449,'Ichupampa',9589,440),(450,'Lari',9589,440),(451,'Lluta',9589,440),(452,'Maca',9589,440),(453,'Madrigal',9589,440),(454,'San Antonio de Chuca',9589,440),(455,'Sibayo',9589,440),(456,'Tapay',9589,440),(457,'Tisco',9589,440),(458,'Tuti',9589,440),(459,'Yanque',9589,440),(460,'Majes',9589,440),(461,'Condesuyos',9589,371),(462,'Chuquibamba',9589,461),(463,'Andaray',9589,461),(464,'Cayarani',9589,461),(465,'Chichas',9589,461),(466,'Iray',9589,461),(467,'Río Grande',9589,461),(468,'Salamanca',9589,461),(469,'Yanaquihua',9589,461),(470,'Islay',9589,371),(471,'Mollendo',9589,470),(472,'Cocachacra',9589,470),(473,'Dean Valdivia',9589,470),(474,'Islay',9589,470),(475,'Mejia',9589,470),(476,'Punta de Bombón',9589,470),(477,'La Uniòn',9589,371),(478,'Cotahuasi',9589,477),(479,'Alca',9589,477),(480,'Charcana',9589,477),(481,'Huaynacotas',9589,477),(482,'Pampamarca',9589,477),(483,'Puyca',9589,477),(484,'Quechualla',9589,477),(485,'Sayla',9589,477),(486,'Tauria',9589,477),(487,'Tomepampa',9589,477),(488,'Toro',9589,477),(489,'Ayacucho',9589,0),(490,'Huamanga',9589,489),(491,'Ayacucho',9589,490),(492,'Acocro',9589,490),(493,'Acos Vinchos',9589,490),(494,'Carmen Alto',9589,490),(495,'Chiara',9589,490),(496,'Ocros',9589,490),(497,'Pacaycasa',9589,490),(498,'Quinua',9589,490),(499,'San José de Ticllas',9589,490),(500,'San Juan Bautista',9589,490),(501,'Santiago de Pischa',9589,490),(502,'Socos',9589,490),(503,'Tambillo',9589,490),(504,'Vinchos',9589,490),(505,'Jesús Nazareno',9589,490),(506,'Andrés Avelino Cáceres Dorregaray',9589,490),(507,'Cangallo',9589,489),(508,'Cangallo',9589,507),(509,'Chuschi',9589,507),(510,'Los Morochucos',9589,507),(511,'María Parado de Bellido',9589,507),(512,'Paras',9589,507),(513,'Totos',9589,507),(514,'Huanca Sancos',9589,489),(515,'Sancos',9589,514),(516,'Carapo',9589,514),(517,'Sacsamarca',9589,514),(518,'Santiago de Lucanamarca',9589,514),(519,'Huanta',9589,489),(520,'Huanta',9589,519),(521,'Ayahuanco',9589,519),(522,'Huamanguilla',9589,519),(523,'Iguain',9589,519),(524,'Luricocha',9589,519),(525,'Santillana',9589,519),(526,'Sivia',9589,519),(527,'Llochegua',9589,519),(528,'Canayre',9589,519),(529,'Uchuraccay',9589,519),(530,'Pucacolpa',9589,519),(531,'Chaca',9589,519),(532,'La Mar',9589,489),(533,'San Miguel',9589,532),(534,'Anco',9589,532),(535,'Ayna',9589,532),(536,'Chilcas',9589,532),(537,'Chungui',9589,532),(538,'Luis Carranza',9589,532),(539,'Santa Rosa',9589,532),(540,'Tambo',9589,532),(541,'Samugari',9589,532),(542,'Anchihuay',9589,532),(543,'Lucanas',9589,489),(544,'Puquio',9589,543),(545,'Aucara',9589,543),(546,'Cabana',9589,543),(547,'Carmen Salcedo',9589,543),(548,'Chaviña',9589,543),(549,'Chipao',9589,543),(550,'Huac-Huas',9589,543),(551,'Laramate',9589,543),(552,'Leoncio Prado',9589,543),(553,'Llauta',9589,543),(554,'Lucanas',9589,543),(555,'Ocaña',9589,543),(556,'Otoca',9589,543),(557,'Saisa',9589,543),(558,'San Cristóbal',9589,543),(559,'San Juan',9589,543),(560,'San Pedro',9589,543),(561,'San Pedro de Palco',9589,543),(562,'Sancos',9589,543),(563,'Santa Ana de Huaycahuacho',9589,543),(564,'Santa Lucia',9589,543),(565,'Parinacochas',9589,489),(566,'Coracora',9589,565),(567,'Chumpi',9589,565),(568,'Coronel Castañeda',9589,565),(569,'Pacapausa',9589,565),(570,'Pullo',9589,565),(571,'Puyusca',9589,565),(572,'San Francisco de Ravacayco',9589,565),(573,'Upahuacho',9589,565),(574,'Pàucar del Sara Sara',9589,489),(575,'Pausa',9589,574),(576,'Colta',9589,574),(577,'Corculla',9589,574),(578,'Lampa',9589,574),(579,'Marcabamba',9589,574),(580,'Oyolo',9589,574),(581,'Pararca',9589,574),(582,'San Javier de Alpabamba',9589,574),(583,'San José de Ushua',9589,574),(584,'Sara Sara',9589,574),(585,'Sucre',9589,489),(586,'Querobamba',9589,585),(587,'Belén',9589,585),(588,'Chalcos',9589,585),(589,'Chilcayoc',9589,585),(590,'Huacaña',9589,585),(591,'Morcolla',9589,585),(592,'Paico',9589,585),(593,'San Pedro de Larcay',9589,585),(594,'San Salvador de Quije',9589,585),(595,'Santiago de Paucaray',9589,585),(596,'Soras',9589,585),(597,'Víctor Fajardo',9589,489),(598,'Huancapi',9589,597),(599,'Alcamenca',9589,597),(600,'Apongo',9589,597),(601,'Asquipata',9589,597),(602,'Canaria',9589,597),(603,'Cayara',9589,597),(604,'Colca',9589,597),(605,'Huamanquiquia',9589,597),(606,'Huancaraylla',9589,597),(607,'Huaya',9589,597),(608,'Sarhua',9589,597),(609,'Vilcanchos',9589,597),(610,'Vilcas Huamán',9589,489),(611,'Vilcas Huaman',9589,610),(612,'Accomarca',9589,610),(613,'Carhuanca',9589,610),(614,'Concepción',9589,610),(615,'Huambalpa',9589,610),(616,'Independencia',9589,610),(617,'Saurama',9589,610),(618,'Vischongo',9589,610),(619,'Cajamarca',9589,0),(620,'Cajamarca',9589,619),(621,'Cajamarca',9589,620),(622,'Asunción',9589,620),(623,'Chetilla',9589,620),(624,'Cospan',9589,620),(625,'Encañada',9589,620),(626,'Jesús',9589,620),(627,'Llacanora',9589,620),(628,'Los Baños del Inca',9589,620),(629,'Magdalena',9589,620),(630,'Matara',9589,620),(631,'Namora',9589,620),(632,'San Juan',9589,620),(633,'Cajabamba',9589,619),(634,'Cajabamba',9589,633),(635,'Cachachi',9589,633),(636,'Condebamba',9589,633),(637,'Sitacocha',9589,633),(638,'Celendín',9589,619),(639,'Celendín',9589,638),(640,'Chumuch',9589,638),(641,'Cortegana',9589,638),(642,'Huasmin',9589,638),(643,'Jorge Chávez',9589,638),(644,'José Gálvez',9589,638),(645,'Miguel Iglesias',9589,638),(646,'Oxamarca',9589,638),(647,'Sorochuco',9589,638),(648,'Sucre',9589,638),(649,'Utco',9589,638),(650,'La Libertad de Pallan',9589,638),(651,'Chota',9589,619),(652,'Chota',9589,651),(653,'Anguia',9589,651),(654,'Chadin',9589,651),(655,'Chiguirip',9589,651),(656,'Chimban',9589,651),(657,'Choropampa',9589,651),(658,'Cochabamba',9589,651),(659,'Conchan',9589,651),(660,'Huambos',9589,651),(661,'Lajas',9589,651),(662,'Llama',9589,651),(663,'Miracosta',9589,651),(664,'Paccha',9589,651),(665,'Pion',9589,651),(666,'Querocoto',9589,651),(667,'San Juan de Licupis',9589,651),(668,'Tacabamba',9589,651),(669,'Tocmoche',9589,651),(670,'Chalamarca',9589,651),(671,'Contumazá',9589,619),(672,'Contumaza',9589,671),(673,'Chilete',9589,671),(674,'Cupisnique',9589,671),(675,'Guzmango',9589,671),(676,'San Benito',9589,671),(677,'Santa Cruz de Toledo',9589,671),(678,'Tantarica',9589,671),(679,'Yonan',9589,671),(680,'Cutervo',9589,619),(681,'Cutervo',9589,680),(682,'Callayuc',9589,680),(683,'Choros',9589,680),(684,'Cujillo',9589,680),(685,'La Ramada',9589,680),(686,'Pimpingos',9589,680),(687,'Querocotillo',9589,680),(688,'San Andrés de Cutervo',9589,680),(689,'San Juan de Cutervo',9589,680),(690,'San Luis de Lucma',9589,680),(691,'Santa Cruz',9589,680),(692,'Santo Domingo de la Capilla',9589,680),(693,'Santo Tomas',9589,680),(694,'Socota',9589,680),(695,'Toribio Casanova',9589,680),(696,'Hualgayoc',9589,619),(697,'Bambamarca',9589,696),(698,'Chugur',9589,696),(699,'Hualgayoc',9589,696),(700,'Jaén',9589,619),(701,'Jaén',9589,700),(702,'Bellavista',9589,700),(703,'Chontali',9589,700),(704,'Colasay',9589,700),(705,'Huabal',9589,700),(706,'Las Pirias',9589,700),(707,'Pomahuaca',9589,700),(708,'Pucara',9589,700),(709,'Sallique',9589,700),(710,'San Felipe',9589,700),(711,'San José del Alto',9589,700),(712,'Santa Rosa',9589,700),(713,'San Ignacio',9589,619),(714,'San Ignacio',9589,713),(715,'Chirinos',9589,713),(716,'Huarango',9589,713),(717,'La Coipa',9589,713),(718,'Namballe',9589,713),(719,'San José de Lourdes',9589,713),(720,'Tabaconas',9589,713),(721,'San Marcos',9589,619),(722,'Pedro Gálvez',9589,721),(723,'Chancay',9589,721),(724,'Eduardo Villanueva',9589,721),(725,'Gregorio Pita',9589,721),(726,'Ichocan',9589,721),(727,'José Manuel Quiroz',9589,721),(728,'José Sabogal',9589,721),(729,'San Miguel',9589,619),(730,'San Miguel',9589,729),(731,'Bolívar',9589,729),(732,'Calquis',9589,729),(733,'Catilluc',9589,729),(734,'El Prado',9589,729),(735,'La Florida',9589,729),(736,'Llapa',9589,729),(737,'Nanchoc',9589,729),(738,'Niepos',9589,729),(739,'San Gregorio',9589,729),(740,'San Silvestre de Cochan',9589,729),(741,'Tongod',9589,729),(742,'Unión Agua Blanca',9589,729),(743,'San Pablo',9589,619),(744,'San Pablo',9589,743),(745,'San Bernardino',9589,743),(746,'San Luis',9589,743),(747,'Tumbaden',9589,743),(748,'Santa Cruz',9589,619),(749,'Santa Cruz',9589,748),(750,'Andabamba',9589,748),(751,'Catache',9589,748),(752,'Chancaybaños',9589,748),(753,'La Esperanza',9589,748),(754,'Ninabamba',9589,748),(755,'Pulan',9589,748),(756,'Saucepampa',9589,748),(757,'Sexi',9589,748),(758,'Uticyacu',9589,748),(759,'Yauyucan',9589,748),(760,'Callao',9589,0),(761,'Prov. Const. del Callao',9589,760),(762,'Callao',9589,761),(763,'Bellavista',9589,761),(764,'Carmen de la Legua Reynoso',9589,761),(765,'La Perla',9589,761),(766,'La Punta',9589,761),(767,'Ventanilla',9589,761),(768,'Mi Perú',9589,761),(769,'Cusco',9589,0),(770,'Cusco',9589,769),(771,'Cusco',9589,770),(772,'Ccorca',9589,770),(773,'Poroy',9589,770),(774,'San Jerónimo',9589,770),(775,'San Sebastian',9589,770),(776,'Santiago',9589,770),(777,'Saylla',9589,770),(778,'Wanchaq',9589,770),(779,'Acomayo',9589,769),(780,'Acomayo',9589,779),(781,'Acopia',9589,779),(782,'Acos',9589,779),(783,'Mosoc Llacta',9589,779),(784,'Pomacanchi',9589,779),(785,'Rondocan',9589,779),(786,'Sangarara',9589,779),(787,'Anta',9589,769),(788,'Anta',9589,787),(789,'Ancahuasi',9589,787),(790,'Cachimayo',9589,787),(791,'Chinchaypujio',9589,787),(792,'Huarocondo',9589,787),(793,'Limatambo',9589,787),(794,'Mollepata',9589,787),(795,'Pucyura',9589,787),(796,'Zurite',9589,787),(797,'Calca',9589,769),(798,'Calca',9589,797),(799,'Coya',9589,797),(800,'Lamay',9589,797),(801,'Lares',9589,797),(802,'Pisac',9589,797),(803,'San Salvador',9589,797),(804,'Taray',9589,797),(805,'Yanatile',9589,797),(806,'Canas',9589,769),(807,'Yanaoca',9589,806),(808,'Checca',9589,806),(809,'Kunturkanki',9589,806),(810,'Langui',9589,806),(811,'Layo',9589,806),(812,'Pampamarca',9589,806),(813,'Quehue',9589,806),(814,'Tupac Amaru',9589,806),(815,'Canchis',9589,769),(816,'Sicuani',9589,815),(817,'Checacupe',9589,815),(818,'Combapata',9589,815),(819,'Marangani',9589,815),(820,'Pitumarca',9589,815),(821,'San Pablo',9589,815),(822,'San Pedro',9589,815),(823,'Tinta',9589,815),(824,'Chumbivilcas',9589,769),(825,'Santo Tomas',9589,824),(826,'Capacmarca',9589,824),(827,'Chamaca',9589,824),(828,'Colquemarca',9589,824),(829,'Livitaca',9589,824),(830,'Llusco',9589,824),(831,'Quiñota',9589,824),(832,'Velille',9589,824),(833,'Espinar',9589,769),(834,'Espinar',9589,833),(835,'Condoroma',9589,833),(836,'Coporaque',9589,833),(837,'Ocoruro',9589,833),(838,'Pallpata',9589,833),(839,'Pichigua',9589,833),(840,'Suyckutambo',9589,833),(841,'Alto Pichigua',9589,833),(842,'La Convención',9589,769),(843,'Santa Ana',9589,842),(844,'Echarate',9589,842),(845,'Huayopata',9589,842),(846,'Maranura',9589,842),(847,'Ocobamba',9589,842),(848,'Quellouno',9589,842),(849,'Kimbiri',9589,842),(850,'Santa Teresa',9589,842),(851,'Vilcabamba',9589,842),(852,'Pichari',9589,842),(853,'Inkawasi',9589,842),(854,'Villa Virgen',9589,842),(855,'Villa Kintiarina',9589,842),(856,'Paruro',9589,769),(857,'Paruro',9589,856),(858,'Accha',9589,856),(859,'Ccapi',9589,856),(860,'Colcha',9589,856),(861,'Huanoquite',9589,856),(862,'Omacha',9589,856),(863,'Paccaritambo',9589,856),(864,'Pillpinto',9589,856),(865,'Yaurisque',9589,856),(866,'Paucartambo',9589,769),(867,'Paucartambo',9589,866),(868,'Caicay',9589,866),(869,'Challabamba',9589,866),(870,'Colquepata',9589,866),(871,'Huancarani',9589,866),(872,'Kosñipata',9589,866),(873,'Quispicanchi',9589,769),(874,'Urcos',9589,873),(875,'Andahuaylillas',9589,873),(876,'Camanti',9589,873),(877,'Ccarhuayo',9589,873),(878,'Ccatca',9589,873),(879,'Cusipata',9589,873),(880,'Huaro',9589,873),(881,'Lucre',9589,873),(882,'Marcapata',9589,873),(883,'Ocongate',9589,873),(884,'Oropesa',9589,873),(885,'Quiquijana',9589,873),(886,'Urubamba',9589,769),(887,'Urubamba',9589,886),(888,'Chinchero',9589,886),(889,'Huayllabamba',9589,886),(890,'Machupicchu',9589,886),(891,'Maras',9589,886),(892,'Ollantaytambo',9589,886),(893,'Yucay',9589,886),(894,'Huancavelica',9589,0),(895,'Huancavelica',9589,894),(896,'Huancavelica',9589,895),(897,'Acobambilla',9589,895),(898,'Acoria',9589,895),(899,'Conayca',9589,895),(900,'Cuenca',9589,895),(901,'Huachocolpa',9589,895),(902,'Huayllahuara',9589,895),(903,'Izcuchaca',9589,895),(904,'Laria',9589,895),(905,'Manta',9589,895),(906,'Mariscal Cáceres',9589,895),(907,'Moya',9589,895),(908,'Nuevo Occoro',9589,895),(909,'Palca',9589,895),(910,'Pilchaca',9589,895),(911,'Vilca',9589,895),(912,'Yauli',9589,895),(913,'Ascensión',9589,895),(914,'Huando',9589,895),(915,'Acobamba',9589,894),(916,'Acobamba',9589,915),(917,'Andabamba',9589,915),(918,'Anta',9589,915),(919,'Caja',9589,915),(920,'Marcas',9589,915),(921,'Paucara',9589,915),(922,'Pomacocha',9589,915),(923,'Rosario',9589,915),(924,'Angaraes',9589,894),(925,'Lircay',9589,924),(926,'Anchonga',9589,924),(927,'Callanmarca',9589,924),(928,'Ccochaccasa',9589,924),(929,'Chincho',9589,924),(930,'Congalla',9589,924),(931,'Huanca-Huanca',9589,924),(932,'Huayllay Grande',9589,924),(933,'Julcamarca',9589,924),(934,'San Antonio de Antaparco',9589,924),(935,'Santo Tomas de Pata',9589,924),(936,'Secclla',9589,924),(937,'Castrovirreyna',9589,894),(938,'Castrovirreyna',9589,937),(939,'Arma',9589,937),(940,'Aurahua',9589,937),(941,'Capillas',9589,937),(942,'Chupamarca',9589,937),(943,'Cocas',9589,937),(944,'Huachos',9589,937),(945,'Huamatambo',9589,937),(946,'Mollepampa',9589,937),(947,'San Juan',9589,937),(948,'Santa Ana',9589,937),(949,'Tantara',9589,937),(950,'Ticrapo',9589,937),(951,'Churcampa',9589,894),(952,'Churcampa',9589,951),(953,'Anco',9589,951),(954,'Chinchihuasi',9589,951),(955,'El Carmen',9589,951),(956,'La Merced',9589,951),(957,'Locroja',9589,951),(958,'Paucarbamba',9589,951),(959,'San Miguel de Mayocc',9589,951),(960,'San Pedro de Coris',9589,951),(961,'Pachamarca',9589,951),(962,'Cosme',9589,951),(963,'Huaytará',9589,894),(964,'Huaytara',9589,963),(965,'Ayavi',9589,963),(966,'Córdova',9589,963),(967,'Huayacundo Arma',9589,963),(968,'Laramarca',9589,963),(969,'Ocoyo',9589,963),(970,'Pilpichaca',9589,963),(971,'Querco',9589,963),(972,'Quito-Arma',9589,963),(973,'San Antonio de Cusicancha',9589,963),(974,'San Francisco de Sangayaico',9589,963),(975,'San Isidro',9589,963),(976,'Santiago de Chocorvos',9589,963),(977,'Santiago de Quirahuara',9589,963),(978,'Santo Domingo de Capillas',9589,963),(979,'Tambo',9589,963),(980,'Tayacaja',9589,894),(981,'Pampas',9589,980),(982,'Acostambo',9589,980),(983,'Acraquia',9589,980),(984,'Ahuaycha',9589,980),(985,'Colcabamba',9589,980),(986,'Daniel Hernández',9589,980),(987,'Huachocolpa',9589,980),(988,'Huaribamba',9589,980),(989,'Ñahuimpuquio',9589,980),(990,'Pazos',9589,980),(991,'Quishuar',9589,980),(992,'Salcabamba',9589,980),(993,'Salcahuasi',9589,980),(994,'San Marcos de Rocchac',9589,980),(995,'Surcubamba',9589,980),(996,'Tintay Puncu',9589,980),(997,'Quichuas',9589,980),(998,'Andaymarca',9589,980),(999,'Roble',9589,980),(1000,'Pichos',9589,980),(1001,'Huánuco',9589,0),(1002,'Huánuco',9589,1001),(1003,'Huanuco',9589,1002),(1004,'Amarilis',9589,1002),(1005,'Chinchao',9589,1002),(1006,'Churubamba',9589,1002),(1007,'Margos',9589,1002),(1008,'Quisqui (Kichki)',9589,1002),(1009,'San Francisco de Cayran',9589,1002),(1010,'San Pedro de Chaulan',9589,1002),(1011,'Santa María del Valle',9589,1002),(1012,'Yarumayo',9589,1002),(1013,'Pillco Marca',9589,1002),(1014,'Yacus',9589,1002),(1015,'San Pablo de Pillao',9589,1002),(1016,'Ambo',9589,1001),(1017,'Ambo',9589,1016),(1018,'Cayna',9589,1016),(1019,'Colpas',9589,1016),(1020,'Conchamarca',9589,1016),(1021,'Huacar',9589,1016),(1022,'San Francisco',9589,1016),(1023,'San Rafael',9589,1016),(1024,'Tomay Kichwa',9589,1016),(1025,'Dos de Mayo',9589,1001),(1026,'La Unión',9589,1025),(1027,'Chuquis',9589,1025),(1028,'Marías',9589,1025),(1029,'Pachas',9589,1025),(1030,'Quivilla',9589,1025),(1031,'Ripan',9589,1025),(1032,'Shunqui',9589,1025),(1033,'Sillapata',9589,1025),(1034,'Yanas',9589,1025),(1035,'Huacaybamba',9589,1001),(1036,'Huacaybamba',9589,1035),(1037,'Canchabamba',9589,1035),(1038,'Cochabamba',9589,1035),(1039,'Pinra',9589,1035),(1040,'Huamalíes',9589,1001),(1041,'Llata',9589,1040),(1042,'Arancay',9589,1040),(1043,'Chavín de Pariarca',9589,1040),(1044,'Jacas Grande',9589,1040),(1045,'Jircan',9589,1040),(1046,'Miraflores',9589,1040),(1047,'Monzón',9589,1040),(1048,'Punchao',9589,1040),(1049,'Puños',9589,1040),(1050,'Singa',9589,1040),(1051,'Tantamayo',9589,1040),(1052,'Leoncio Prado',9589,1001),(1053,'Rupa-Rupa',9589,1052),(1054,'Daniel Alomía Robles',9589,1052),(1055,'Hermílio Valdizan',9589,1052),(1056,'José Crespo y Castillo',9589,1052),(1057,'Luyando',9589,1052),(1058,'Mariano Damaso Beraun',9589,1052),(1059,'Pucayacu',9589,1052),(1060,'Castillo Grande',9589,1052),(1061,'Marañón',9589,1001),(1062,'Huacrachuco',9589,1061),(1063,'Cholon',9589,1061),(1064,'San Buenaventura',9589,1061),(1065,'La Morada',9589,1061),(1066,'Santa Rosa de Alto Yanajanca',9589,1061),(1067,'Pachitea',9589,1001),(1068,'Panao',9589,1067),(1069,'Chaglla',9589,1067),(1070,'Molino',9589,1067),(1071,'Umari',9589,1067),(1072,'Puerto Inca',9589,1001),(1073,'Puerto Inca',9589,1072),(1074,'Codo del Pozuzo',9589,1072),(1075,'Honoria',9589,1072),(1076,'Tournavista',9589,1072),(1077,'Yuyapichis',9589,1072),(1078,'Lauricocha ',9589,1001),(1079,'Jesús',9589,1078),(1080,'Baños',9589,1078),(1081,'Jivia',9589,1078),(1082,'Queropalca',9589,1078),(1083,'Rondos',9589,1078),(1084,'San Francisco de Asís',9589,1078),(1085,'San Miguel de Cauri',9589,1078),(1086,'Yarowilca ',9589,1001),(1087,'Chavinillo',9589,1086),(1088,'Cahuac',9589,1086),(1089,'Chacabamba',9589,1086),(1090,'Aparicio Pomares',9589,1086),(1091,'Jacas Chico',9589,1086),(1092,'Obas',9589,1086),(1093,'Pampamarca',9589,1086),(1094,'Choras',9589,1086),(1095,'Ica',9589,0),(1096,'Ica ',9589,1095),(1097,'Ica',9589,1096),(1098,'La Tinguiña',9589,1096),(1099,'Los Aquijes',9589,1096),(1100,'Ocucaje',9589,1096),(1101,'Pachacutec',9589,1096),(1102,'Parcona',9589,1096),(1103,'Pueblo Nuevo',9589,1096),(1104,'Salas',9589,1096),(1105,'San José de Los Molinos',9589,1096),(1106,'San Juan Bautista',9589,1096),(1107,'Santiago',9589,1096),(1108,'Subtanjalla',9589,1096),(1109,'Tate',9589,1096),(1110,'Yauca del Rosario',9589,1096),(1111,'Chincha ',9589,1095),(1112,'Chincha Alta',9589,1111),(1113,'Alto Laran',9589,1111),(1114,'Chavin',9589,1111),(1115,'Chincha Baja',9589,1111),(1116,'El Carmen',9589,1111),(1117,'Grocio Prado',9589,1111),(1118,'Pueblo Nuevo',9589,1111),(1119,'San Juan de Yanac',9589,1111),(1120,'San Pedro de Huacarpana',9589,1111),(1121,'Sunampe',9589,1111),(1122,'Tambo de Mora',9589,1111),(1123,'Nasca ',9589,1095),(1124,'Nasca',9589,1123),(1125,'Changuillo',9589,1123),(1126,'El Ingenio',9589,1123),(1127,'Marcona',9589,1123),(1128,'Vista Alegre',9589,1123),(1129,'Palpa ',9589,1095),(1130,'Palpa',9589,1129),(1131,'Llipata',9589,1129),(1132,'Río Grande',9589,1129),(1133,'Santa Cruz',9589,1129),(1134,'Tibillo',9589,1129),(1135,'Pisco ',9589,1095),(1136,'Pisco',9589,1135),(1137,'Huancano',9589,1135),(1138,'Humay',9589,1135),(1139,'Independencia',9589,1135),(1140,'Paracas',9589,1135),(1141,'San Andrés',9589,1135),(1142,'San Clemente',9589,1135),(1143,'Tupac Amaru Inca',9589,1135),(1144,'Junín',9589,0),(1145,'Huancayo ',9589,1144),(1146,'Huancayo',9589,1145),(1147,'Carhuacallanga',9589,1145),(1148,'Chacapampa',9589,1145),(1149,'Chicche',9589,1145),(1150,'Chilca',9589,1145),(1151,'Chongos Alto',9589,1145),(1152,'Chupuro',9589,1145),(1153,'Colca',9589,1145),(1154,'Cullhuas',9589,1145),(1155,'El Tambo',9589,1145),(1156,'Huacrapuquio',9589,1145),(1157,'Hualhuas',9589,1145),(1158,'Huancan',9589,1145),(1159,'Huasicancha',9589,1145),(1160,'Huayucachi',9589,1145),(1161,'Ingenio',9589,1145),(1162,'Pariahuanca',9589,1145),(1163,'Pilcomayo',9589,1145),(1164,'Pucara',9589,1145),(1165,'Quichuay',9589,1145),(1166,'Quilcas',9589,1145),(1167,'San Agustín',9589,1145),(1168,'San Jerónimo de Tunan',9589,1145),(1169,'Saño',9589,1145),(1170,'Sapallanga',9589,1145),(1171,'Sicaya',9589,1145),(1172,'Santo Domingo de Acobamba',9589,1145),(1173,'Viques',9589,1145),(1174,'Concepción ',9589,1144),(1175,'Concepción',9589,1174),(1176,'Aco',9589,1174),(1177,'Andamarca',9589,1174),(1178,'Chambara',9589,1174),(1179,'Cochas',9589,1174),(1180,'Comas',9589,1174),(1181,'Heroínas Toledo',9589,1174),(1182,'Manzanares',9589,1174),(1183,'Mariscal Castilla',9589,1174),(1184,'Matahuasi',9589,1174),(1185,'Mito',9589,1174),(1186,'Nueve de Julio',9589,1174),(1187,'Orcotuna',9589,1174),(1188,'San José de Quero',9589,1174),(1189,'Santa Rosa de Ocopa',9589,1174),(1190,'Chanchamayo ',9589,1144),(1191,'Chanchamayo',9589,1190),(1192,'Perene',9589,1190),(1193,'Pichanaqui',9589,1190),(1194,'San Luis de Shuaro',9589,1190),(1195,'San Ramón',9589,1190),(1196,'Vitoc',9589,1190),(1197,'Jauja ',9589,1144),(1198,'Jauja',9589,1197),(1199,'Acolla',9589,1197),(1200,'Apata',9589,1197),(1201,'Ataura',9589,1197),(1202,'Canchayllo',9589,1197),(1203,'Curicaca',9589,1197),(1204,'El Mantaro',9589,1197),(1205,'Huamali',9589,1197),(1206,'Huaripampa',9589,1197),(1207,'Huertas',9589,1197),(1208,'Janjaillo',9589,1197),(1209,'Julcán',9589,1197),(1210,'Leonor Ordóñez',9589,1197),(1211,'Llocllapampa',9589,1197),(1212,'Marco',9589,1197),(1213,'Masma',9589,1197),(1214,'Masma Chicche',9589,1197),(1215,'Molinos',9589,1197),(1216,'Monobamba',9589,1197),(1217,'Muqui',9589,1197),(1218,'Muquiyauyo',9589,1197),(1219,'Paca',9589,1197),(1220,'Paccha',9589,1197),(1221,'Pancan',9589,1197),(1222,'Parco',9589,1197),(1223,'Pomacancha',9589,1197),(1224,'Ricran',9589,1197),(1225,'San Lorenzo',9589,1197),(1226,'San Pedro de Chunan',9589,1197),(1227,'Sausa',9589,1197),(1228,'Sincos',9589,1197),(1229,'Tunan Marca',9589,1197),(1230,'Yauli',9589,1197),(1231,'Yauyos',9589,1197),(1232,'Junín ',9589,1144),(1233,'Junin',9589,1232),(1234,'Carhuamayo',9589,1232),(1235,'Ondores',9589,1232),(1236,'Ulcumayo',9589,1232),(1237,'Satipo ',9589,1144),(1238,'Satipo',9589,1237),(1239,'Coviriali',9589,1237),(1240,'Llaylla',9589,1237),(1241,'Mazamari',9589,1237),(1242,'Pampa Hermosa',9589,1237),(1243,'Pangoa',9589,1237),(1244,'Río Negro',9589,1237),(1245,'Río Tambo',9589,1237),(1246,'Vizcatan del Ene',9589,1237),(1247,'Tarma ',9589,1144),(1248,'Tarma',9589,1247),(1249,'Acobamba',9589,1247),(1250,'Huaricolca',9589,1247),(1251,'Huasahuasi',9589,1247),(1252,'La Unión',9589,1247),(1253,'Palca',9589,1247),(1254,'Palcamayo',9589,1247),(1255,'San Pedro de Cajas',9589,1247),(1256,'Tapo',9589,1247),(1257,'Yauli ',9589,1144),(1258,'La Oroya',9589,1257),(1259,'Chacapalpa',9589,1257),(1260,'Huay-Huay',9589,1257),(1261,'Marcapomacocha',9589,1257),(1262,'Morococha',9589,1257),(1263,'Paccha',9589,1257),(1264,'Santa Bárbara de Carhuacayan',9589,1257),(1265,'Santa Rosa de Sacco',9589,1257),(1266,'Suitucancha',9589,1257),(1267,'Yauli',9589,1257),(1268,'Chupaca ',9589,1144),(1269,'Chupaca',9589,1268),(1270,'Ahuac',9589,1268),(1271,'Chongos Bajo',9589,1268),(1272,'Huachac',9589,1268),(1273,'Huamancaca Chico',9589,1268),(1274,'San Juan de Iscos',9589,1268),(1275,'San Juan de Jarpa',9589,1268),(1276,'Tres de Diciembre',9589,1268),(1277,'Yanacancha',9589,1268),(1278,'La Libertad',9589,0),(1279,'Trujillo ',9589,1278),(1280,'Trujillo',9589,1279),(1281,'El Porvenir',9589,1279),(1282,'Florencia de Mora',9589,1279),(1283,'Huanchaco',9589,1279),(1284,'La Esperanza',9589,1279),(1285,'Laredo',9589,1279),(1286,'Moche',9589,1279),(1287,'Poroto',9589,1279),(1288,'Salaverry',9589,1279),(1289,'Simbal',9589,1279),(1290,'Victor Larco Herrera',9589,1279),(1291,'Ascope ',9589,1278),(1292,'Ascope',9589,1291),(1293,'Chicama',9589,1291),(1294,'Chocope',9589,1291),(1295,'Magdalena de Cao',9589,1291),(1296,'Paijan',9589,1291),(1297,'Rázuri',9589,1291),(1298,'Santiago de Cao',9589,1291),(1299,'Casa Grande',9589,1291),(1300,'Bolívar ',9589,1278),(1301,'Bolívar',9589,1300),(1302,'Bambamarca',9589,1300),(1303,'Condormarca',9589,1300),(1304,'Longotea',9589,1300),(1305,'Uchumarca',9589,1300),(1306,'Ucuncha',9589,1300),(1307,'Chepén ',9589,1278),(1308,'Chepen',9589,1307),(1309,'Pacanga',9589,1307),(1310,'Pueblo Nuevo',9589,1307),(1311,'Julcán ',9589,1278),(1312,'Julcan',9589,1311),(1313,'Calamarca',9589,1311),(1314,'Carabamba',9589,1311),(1315,'Huaso',9589,1311),(1316,'Otuzco ',9589,1278),(1317,'Otuzco',9589,1316),(1318,'Agallpampa',9589,1316),(1319,'Charat',9589,1316),(1320,'Huaranchal',9589,1316),(1321,'La Cuesta',9589,1316),(1322,'Mache',9589,1316),(1323,'Paranday',9589,1316),(1324,'Salpo',9589,1316),(1325,'Sinsicap',9589,1316),(1326,'Usquil',9589,1316),(1327,'Pacasmayo ',9589,1278),(1328,'San Pedro de Lloc',9589,1327),(1329,'Guadalupe',9589,1327),(1330,'Jequetepeque',9589,1327),(1331,'Pacasmayo',9589,1327),(1332,'San José',9589,1327),(1333,'Pataz ',9589,1278),(1334,'Tayabamba',9589,1333),(1335,'Buldibuyo',9589,1333),(1336,'Chillia',9589,1333),(1337,'Huancaspata',9589,1333),(1338,'Huaylillas',9589,1333),(1339,'Huayo',9589,1333),(1340,'Ongon',9589,1333),(1341,'Parcoy',9589,1333),(1342,'Pataz',9589,1333),(1343,'Pias',9589,1333),(1344,'Santiago de Challas',9589,1333),(1345,'Taurija',9589,1333),(1346,'Urpay',9589,1333),(1347,'Sánchez Carrión ',9589,1278),(1348,'Huamachuco',9589,1347),(1349,'Chugay',9589,1347),(1350,'Cochorco',9589,1347),(1351,'Curgos',9589,1347),(1352,'Marcabal',9589,1347),(1353,'Sanagoran',9589,1347),(1354,'Sarin',9589,1347),(1355,'Sartimbamba',9589,1347),(1356,'Santiago de Chuco ',9589,1278),(1357,'Santiago de Chuco',9589,1356),(1358,'Angasmarca',9589,1356),(1359,'Cachicadan',9589,1356),(1360,'Mollebamba',9589,1356),(1361,'Mollepata',9589,1356),(1362,'Quiruvilca',9589,1356),(1363,'Santa Cruz de Chuca',9589,1356),(1364,'Sitabamba',9589,1356),(1365,'Gran Chimú ',9589,1278),(1366,'Cascas',9589,1365),(1367,'Lucma',9589,1365),(1368,'Marmot',9589,1365),(1369,'Sayapullo',9589,1365),(1370,'Virú ',9589,1278),(1371,'Viru',9589,1370),(1372,'Chao',9589,1370),(1373,'Guadalupito',9589,1370),(1374,'Lambayeque',9589,0),(1375,'Chiclayo ',9589,1374),(1376,'Chiclayo',9589,1375),(1377,'Chongoyape',9589,1375),(1378,'Eten',9589,1375),(1379,'Eten Puerto',9589,1375),(1380,'José Leonardo Ortiz',9589,1375),(1381,'La Victoria',9589,1375),(1382,'Lagunas',9589,1375),(1383,'Monsefu',9589,1375),(1384,'Nueva Arica',9589,1375),(1385,'Oyotun',9589,1375),(1386,'Picsi',9589,1375),(1387,'Pimentel',9589,1375),(1388,'Reque',9589,1375),(1389,'Santa Rosa',9589,1375),(1390,'Saña',9589,1375),(1391,'Cayalti',9589,1375),(1392,'Patapo',9589,1375),(1393,'Pomalca',9589,1375),(1394,'Pucala',9589,1375),(1395,'Tuman',9589,1375),(1396,'Ferreñafe ',9589,1374),(1397,'Ferreñafe',9589,1396),(1398,'Cañaris',9589,1396),(1399,'Incahuasi',9589,1396),(1400,'Manuel Antonio Mesones Muro',9589,1396),(1401,'Pitipo',9589,1396),(1402,'Pueblo Nuevo',9589,1396),(1403,'Lambayeque ',9589,1374),(1404,'Lambayeque',9589,1403),(1405,'Chochope',9589,1403),(1406,'Illimo',9589,1403),(1407,'Jayanca',9589,1403),(1408,'Mochumi',9589,1403),(1409,'Morrope',9589,1403),(1410,'Motupe',9589,1403),(1411,'Olmos',9589,1403),(1412,'Pacora',9589,1403),(1413,'Salas',9589,1403),(1414,'San José',9589,1403),(1415,'Tucume',9589,1403),(1416,'Lima',9589,0),(1417,'Lima ',9589,1416),(1418,'Lima',9589,1417),(1419,'Ancón',9589,1417),(1420,'Ate',9589,1417),(1421,'Barranco',9589,1417),(1422,'Breña',9589,1417),(1423,'Carabayllo',9589,1417),(1424,'Chaclacayo',9589,1417),(1425,'Chorrillos',9589,1417),(1426,'Cieneguilla',9589,1417),(1427,'Comas',9589,1417),(1428,'El Agustino',9589,1417),(1429,'Independencia',9589,1417),(1430,'Jesús María',9589,1417),(1431,'La Molina',9589,1417),(1432,'La Victoria',9589,1417),(1433,'Lince',9589,1417),(1434,'Los Olivos',9589,1417),(1435,'Lurigancho',9589,1417),(1436,'Lurin',9589,1417),(1437,'Magdalena del Mar',9589,1417),(1438,'Pueblo Libre',9589,1417),(1439,'Miraflores',9589,1417),(1440,'Pachacamac',9589,1417),(1441,'Pucusana',9589,1417),(1442,'Puente Piedra',9589,1417),(1443,'Punta Hermosa',9589,1417),(1444,'Punta Negra',9589,1417),(1445,'Rímac',9589,1417),(1446,'San Bartolo',9589,1417),(1447,'San Borja',9589,1417),(1448,'San Isidro',9589,1417),(1449,'San Juan de Lurigancho',9589,1417),(1450,'San Juan de Miraflores',9589,1417),(1451,'San Luis',9589,1417),(1452,'San Martín de Porres',9589,1417),(1453,'San Miguel',9589,1417),(1454,'Santa Anita',9589,1417),(1455,'Santa María del Mar',9589,1417),(1456,'Santa Rosa',9589,1417),(1457,'Santiago de Surco',9589,1417),(1458,'Surquillo',9589,1417),(1459,'Villa El Salvador',9589,1417),(1460,'Villa María del Triunfo',9589,1417),(1461,'Barranca ',9589,1416),(1462,'Barranca',9589,1461),(1463,'Paramonga',9589,1461),(1464,'Pativilca',9589,1461),(1465,'Supe',9589,1461),(1466,'Supe Puerto',9589,1461),(1467,'Cajatambo ',9589,1416),(1468,'Cajatambo',9589,1467),(1469,'Copa',9589,1467),(1470,'Gorgor',9589,1467),(1471,'Huancapon',9589,1467),(1472,'Manas',9589,1467),(1473,'Canta ',9589,1416),(1474,'Canta',9589,1473),(1475,'Arahuay',9589,1473),(1476,'Huamantanga',9589,1473),(1477,'Huaros',9589,1473),(1478,'Lachaqui',9589,1473),(1479,'San Buenaventura',9589,1473),(1480,'Santa Rosa de Quives',9589,1473),(1481,'Cañete ',9589,1416),(1482,'San Vicente de Cañete',9589,1481),(1483,'Asia',9589,1481),(1484,'Calango',9589,1481),(1485,'Cerro Azul',9589,1481),(1486,'Chilca',9589,1481),(1487,'Coayllo',9589,1481),(1488,'Imperial',9589,1481),(1489,'Lunahuana',9589,1481),(1490,'Mala',9589,1481),(1491,'Nuevo Imperial',9589,1481),(1492,'Pacaran',9589,1481),(1493,'Quilmana',9589,1481),(1494,'San Antonio',9589,1481),(1495,'San Luis',9589,1481),(1496,'Santa Cruz de Flores',9589,1481),(1497,'Zúñiga',9589,1481),(1498,'Huaral ',9589,1416),(1499,'Huaral',9589,1498),(1500,'Atavillos Alto',9589,1498),(1501,'Atavillos Bajo',9589,1498),(1502,'Aucallama',9589,1498),(1503,'Chancay',9589,1498),(1504,'Ihuari',9589,1498),(1505,'Lampian',9589,1498),(1506,'Pacaraos',9589,1498),(1507,'San Miguel de Acos',9589,1498),(1508,'Santa Cruz de Andamarca',9589,1498),(1509,'Sumbilca',9589,1498),(1510,'Veintisiete de Noviembre',9589,1498),(1511,'Huarochirí ',9589,1416),(1512,'Matucana',9589,1511),(1513,'Antioquia',9589,1511),(1514,'Callahuanca',9589,1511),(1515,'Carampoma',9589,1511),(1516,'Chicla',9589,1511),(1517,'Cuenca',9589,1511),(1518,'Huachupampa',9589,1511),(1519,'Huanza',9589,1511),(1520,'Huarochiri',9589,1511),(1521,'Lahuaytambo',9589,1511),(1522,'Langa',9589,1511),(1523,'Laraos',9589,1511),(1524,'Mariatana',9589,1511),(1525,'Ricardo Palma',9589,1511),(1526,'San Andrés de Tupicocha',9589,1511),(1527,'San Antonio',9589,1511),(1528,'San Bartolomé',9589,1511),(1529,'San Damian',9589,1511),(1530,'San Juan de Iris',9589,1511),(1531,'San Juan de Tantaranche',9589,1511),(1532,'San Lorenzo de Quinti',9589,1511),(1533,'San Mateo',9589,1511),(1534,'San Mateo de Otao',9589,1511),(1535,'San Pedro de Casta',9589,1511),(1536,'San Pedro de Huancayre',9589,1511),(1537,'Sangallaya',9589,1511),(1538,'Santa Cruz de Cocachacra',9589,1511),(1539,'Santa Eulalia',9589,1511),(1540,'Santiago de Anchucaya',9589,1511),(1541,'Santiago de Tuna',9589,1511),(1542,'Santo Domingo de Los Olleros',9589,1511),(1543,'Surco',9589,1511),(1544,'Huaura ',9589,1416),(1545,'Huacho',9589,1544),(1546,'Ambar',9589,1544),(1547,'Caleta de Carquin',9589,1544),(1548,'Checras',9589,1544),(1549,'Hualmay',9589,1544),(1550,'Huaura',9589,1544),(1551,'Leoncio Prado',9589,1544),(1552,'Paccho',9589,1544),(1553,'Santa Leonor',9589,1544),(1554,'Santa María',9589,1544),(1555,'Sayan',9589,1544),(1556,'Vegueta',9589,1544),(1557,'Oyón ',9589,1416),(1558,'Oyon',9589,1557),(1559,'Andajes',9589,1557),(1560,'Caujul',9589,1557),(1561,'Cochamarca',9589,1557),(1562,'Navan',9589,1557),(1563,'Pachangara',9589,1557),(1564,'Yauyos ',9589,1416),(1565,'Yauyos',9589,1564),(1566,'Alis',9589,1564),(1567,'Allauca',9589,1564),(1568,'Ayaviri',9589,1564),(1569,'Azángaro',9589,1564),(1570,'Cacra',9589,1564),(1571,'Carania',9589,1564),(1572,'Catahuasi',9589,1564),(1573,'Chocos',9589,1564),(1574,'Cochas',9589,1564),(1575,'Colonia',9589,1564),(1576,'Hongos',9589,1564),(1577,'Huampara',9589,1564),(1578,'Huancaya',9589,1564),(1579,'Huangascar',9589,1564),(1580,'Huantan',9589,1564),(1581,'Huañec',9589,1564),(1582,'Laraos',9589,1564),(1583,'Lincha',9589,1564),(1584,'Madean',9589,1564),(1585,'Miraflores',9589,1564),(1586,'Omas',9589,1564),(1587,'Putinza',9589,1564),(1588,'Quinches',9589,1564),(1589,'Quinocay',9589,1564),(1590,'San Joaquín',9589,1564),(1591,'San Pedro de Pilas',9589,1564),(1592,'Tanta',9589,1564),(1593,'Tauripampa',9589,1564),(1594,'Tomas',9589,1564),(1595,'Tupe',9589,1564),(1596,'Viñac',9589,1564),(1597,'Vitis',9589,1564),(1598,'Loreto',9589,0),(1599,'Maynas ',9589,1598),(1600,'Iquitos',9589,1599),(1601,'Alto Nanay',9589,1599),(1602,'Fernando Lores',9589,1599),(1603,'Indiana',9589,1599),(1604,'Las Amazonas',9589,1599),(1605,'Mazan',9589,1599),(1606,'Napo',9589,1599),(1607,'Punchana',9589,1599),(1608,'Torres Causana',9589,1599),(1609,'Belén',9589,1599),(1610,'San Juan Bautista',9589,1599),(1611,'Alto Amazonas ',9589,1598),(1612,'Yurimaguas',9589,1611),(1613,'Balsapuerto',9589,1611),(1614,'Jeberos',9589,1611),(1615,'Lagunas',9589,1611),(1616,'Santa Cruz',9589,1611),(1617,'Teniente Cesar López Rojas',9589,1611),(1618,'Loreto ',9589,1598),(1619,'Nauta',9589,1618),(1620,'Parinari',9589,1618),(1621,'Tigre',9589,1618),(1622,'Trompeteros',9589,1618),(1623,'Urarinas',9589,1618),(1624,'Mariscal Ramón Castilla ',9589,1598),(1625,'Ramón Castilla',9589,1624),(1626,'Pebas',9589,1624),(1627,'Yavari',9589,1624),(1628,'San Pablo',9589,1624),(1629,'Requena ',9589,1598),(1630,'Requena',9589,1629),(1631,'Alto Tapiche',9589,1629),(1632,'Capelo',9589,1629),(1633,'Emilio San Martín',9589,1629),(1634,'Maquia',9589,1629),(1635,'Puinahua',9589,1629),(1636,'Saquena',9589,1629),(1637,'Soplin',9589,1629),(1638,'Tapiche',9589,1629),(1639,'Jenaro Herrera',9589,1629),(1640,'Yaquerana',9589,1629),(1641,'Ucayali ',9589,1598),(1642,'Contamana',9589,1641),(1643,'Inahuaya',9589,1641),(1644,'Padre Márquez',9589,1641),(1645,'Pampa Hermosa',9589,1641),(1646,'Sarayacu',9589,1641),(1647,'Vargas Guerra',9589,1641),(1648,'Datem del Marañón ',9589,1598),(1649,'Barranca',9589,1648),(1650,'Cahuapanas',9589,1648),(1651,'Manseriche',9589,1648),(1652,'Morona',9589,1648),(1653,'Pastaza',9589,1648),(1654,'Andoas',9589,1648),(1655,'Putumayo',9589,1598),(1656,'Putumayo',9589,1655),(1657,'Rosa Panduro',9589,1655),(1658,'Teniente Manuel Clavero',9589,1655),(1659,'Yaguas',9589,1655),(1660,'Madre de Dios',9589,0),(1661,'Tambopata ',9589,1660),(1662,'Tambopata',9589,1661),(1663,'Inambari',9589,1661),(1664,'Las Piedras',9589,1661),(1665,'Laberinto',9589,1661),(1666,'Manu ',9589,1660),(1667,'Manu',9589,1666),(1668,'Fitzcarrald',9589,1666),(1669,'Madre de Dios',9589,1666),(1670,'Huepetuhe',9589,1666),(1671,'Tahuamanu ',9589,1660),(1672,'Iñapari',9589,1671),(1673,'Iberia',9589,1671),(1674,'Tahuamanu',9589,1671),(1675,'Moquegua',9589,0),(1676,'Mariscal Nieto ',9589,1675),(1677,'Moquegua',9589,1676),(1678,'Carumas',9589,1676),(1679,'Cuchumbaya',9589,1676),(1680,'Samegua',9589,1676),(1681,'San Cristóbal',9589,1676),(1682,'Torata',9589,1676),(1683,'General Sánchez Cerro ',9589,1675),(1684,'Omate',9589,1683),(1685,'Chojata',9589,1683),(1686,'Coalaque',9589,1683),(1687,'Ichuña',9589,1683),(1688,'La Capilla',9589,1683),(1689,'Lloque',9589,1683),(1690,'Matalaque',9589,1683),(1691,'Puquina',9589,1683),(1692,'Quinistaquillas',9589,1683),(1693,'Ubinas',9589,1683),(1694,'Yunga',9589,1683),(1695,'Ilo ',9589,1675),(1696,'Ilo',9589,1695),(1697,'El Algarrobal',9589,1695),(1698,'Pacocha',9589,1695),(1699,'Pasco',9589,0),(1700,'Pasco ',9589,1699),(1701,'Chaupimarca',9589,1700),(1702,'Huachon',9589,1700),(1703,'Huariaca',9589,1700),(1704,'Huayllay',9589,1700),(1705,'Ninacaca',9589,1700),(1706,'Pallanchacra',9589,1700),(1707,'Paucartambo',9589,1700),(1708,'San Francisco de Asís de Yarusyacan',9589,1700),(1709,'Simon Bolívar',9589,1700),(1710,'Ticlacayan',9589,1700),(1711,'Tinyahuarco',9589,1700),(1712,'Vicco',9589,1700),(1713,'Yanacancha',9589,1700),(1714,'Daniel Alcides Carrión ',9589,1699),(1715,'Yanahuanca',9589,1714),(1716,'Chacayan',9589,1714),(1717,'Goyllarisquizga',9589,1714),(1718,'Paucar',9589,1714),(1719,'San Pedro de Pillao',9589,1714),(1720,'Santa Ana de Tusi',9589,1714),(1721,'Tapuc',9589,1714),(1722,'Vilcabamba',9589,1714),(1723,'Oxapampa ',9589,1699),(1724,'Oxapampa',9589,1723),(1725,'Chontabamba',9589,1723),(1726,'Huancabamba',9589,1723),(1727,'Palcazu',9589,1723),(1728,'Pozuzo',9589,1723),(1729,'Puerto Bermúdez',9589,1723),(1730,'Villa Rica',9589,1723),(1731,'Constitución',9589,1723),(1732,'Piura',9589,0),(1733,'Piura ',9589,1732),(1734,'Piura',9589,1733),(1735,'Castilla',9589,1733),(1736,'Catacaos',9589,1733),(1737,'Cura Mori',9589,1733),(1738,'El Tallan',9589,1733),(1739,'La Arena',9589,1733),(1740,'La Unión',9589,1733),(1741,'Las Lomas',9589,1733),(1742,'Tambo Grande',9589,1733),(1743,'Veintiseis de Octubre',9589,1733),(1744,'Ayabaca ',9589,1732),(1745,'Ayabaca',9589,1744),(1746,'Frias',9589,1744),(1747,'Jilili',9589,1744),(1748,'Lagunas',9589,1744),(1749,'Montero',9589,1744),(1750,'Pacaipampa',9589,1744),(1751,'Paimas',9589,1744),(1752,'Sapillica',9589,1744),(1753,'Sicchez',9589,1744),(1754,'Suyo',9589,1744),(1755,'Huancabamba ',9589,1732),(1756,'Huancabamba',9589,1755),(1757,'Canchaque',9589,1755),(1758,'El Carmen de la Frontera',9589,1755),(1759,'Huarmaca',9589,1755),(1760,'Lalaquiz',9589,1755),(1761,'San Miguel de El Faique',9589,1755),(1762,'Sondor',9589,1755),(1763,'Sondorillo',9589,1755),(1764,'Morropón ',9589,1732),(1765,'Chulucanas',9589,1764),(1766,'Buenos Aires',9589,1764),(1767,'Chalaco',9589,1764),(1768,'La Matanza',9589,1764),(1769,'Morropon',9589,1764),(1770,'Salitral',9589,1764),(1771,'San Juan de Bigote',9589,1764),(1772,'Santa Catalina de Mossa',9589,1764),(1773,'Santo Domingo',9589,1764),(1774,'Yamango',9589,1764),(1775,'Paita ',9589,1732),(1776,'Paita',9589,1775),(1777,'Amotape',9589,1775),(1778,'Arenal',9589,1775),(1779,'Colan',9589,1775),(1780,'La Huaca',9589,1775),(1781,'Tamarindo',9589,1775),(1782,'Vichayal',9589,1775),(1783,'Sullana ',9589,1732),(1784,'Sullana',9589,1783),(1785,'Bellavista',9589,1783),(1786,'Ignacio Escudero',9589,1783),(1787,'Lancones',9589,1783),(1788,'Marcavelica',9589,1783),(1789,'Miguel Checa',9589,1783),(1790,'Querecotillo',9589,1783),(1791,'Salitral',9589,1783),(1792,'Talara ',9589,1732),(1793,'Pariñas',9589,1792),(1794,'El Alto',9589,1792),(1795,'La Brea',9589,1792),(1796,'Lobitos',9589,1792),(1797,'Los Organos',9589,1792),(1798,'Mancora',9589,1792),(1799,'Sechura ',9589,1732),(1800,'Sechura',9589,1799),(1801,'Bellavista de la Unión',9589,1799),(1802,'Bernal',9589,1799),(1803,'Cristo Nos Valga',9589,1799),(1804,'Vice',9589,1799),(1805,'Rinconada Llicuar',9589,1799),(1806,'Puno',9589,0),(1807,'Puno ',9589,1806),(1808,'Puno',9589,1807),(1809,'Acora',9589,1807),(1810,'Amantani',9589,1807),(1811,'Atuncolla',9589,1807),(1812,'Capachica',9589,1807),(1813,'Chucuito',9589,1807),(1814,'Coata',9589,1807),(1815,'Huata',9589,1807),(1816,'Mañazo',9589,1807),(1817,'Paucarcolla',9589,1807),(1818,'Pichacani',9589,1807),(1819,'Plateria',9589,1807),(1820,'San Antonio',9589,1807),(1821,'Tiquillaca',9589,1807),(1822,'Vilque',9589,1807),(1823,'Azángaro ',9589,1806),(1824,'Azángaro',9589,1823),(1825,'Achaya',9589,1823),(1826,'Arapa',9589,1823),(1827,'Asillo',9589,1823),(1828,'Caminaca',9589,1823),(1829,'Chupa',9589,1823),(1830,'José Domingo Choquehuanca',9589,1823),(1831,'Muñani',9589,1823),(1832,'Potoni',9589,1823),(1833,'Saman',9589,1823),(1834,'San Anton',9589,1823),(1835,'San José',9589,1823),(1836,'San Juan de Salinas',9589,1823),(1837,'Santiago de Pupuja',9589,1823),(1838,'Tirapata',9589,1823),(1839,'Carabaya ',9589,1806),(1840,'Macusani',9589,1839),(1841,'Ajoyani',9589,1839),(1842,'Ayapata',9589,1839),(1843,'Coasa',9589,1839),(1844,'Corani',9589,1839),(1845,'Crucero',9589,1839),(1846,'Ituata',9589,1839),(1847,'Ollachea',9589,1839),(1848,'San Gaban',9589,1839),(1849,'Usicayos',9589,1839),(1850,'Chucuito ',9589,1806),(1851,'Juli',9589,1850),(1852,'Desaguadero',9589,1850),(1853,'Huacullani',9589,1850),(1854,'Kelluyo',9589,1850),(1855,'Pisacoma',9589,1850),(1856,'Pomata',9589,1850),(1857,'Zepita',9589,1850),(1858,'El Collao ',9589,1806),(1859,'Ilave',9589,1858),(1860,'Capazo',9589,1858),(1861,'Pilcuyo',9589,1858),(1862,'Santa Rosa',9589,1858),(1863,'Conduriri',9589,1858),(1864,'Huancané ',9589,1806),(1865,'Huancane',9589,1864),(1866,'Cojata',9589,1864),(1867,'Huatasani',9589,1864),(1868,'Inchupalla',9589,1864),(1869,'Pusi',9589,1864),(1870,'Rosaspata',9589,1864),(1871,'Taraco',9589,1864),(1872,'Vilque Chico',9589,1864),(1873,'Lampa ',9589,1806),(1874,'Lampa',9589,1873),(1875,'Cabanilla',9589,1873),(1876,'Calapuja',9589,1873),(1877,'Nicasio',9589,1873),(1878,'Ocuviri',9589,1873),(1879,'Palca',9589,1873),(1880,'Paratia',9589,1873),(1881,'Pucara',9589,1873),(1882,'Santa Lucia',9589,1873),(1883,'Vilavila',9589,1873),(1884,'Melgar ',9589,1806),(1885,'Ayaviri',9589,1884),(1886,'Antauta',9589,1884),(1887,'Cupi',9589,1884),(1888,'Llalli',9589,1884),(1889,'Macari',9589,1884),(1890,'Nuñoa',9589,1884),(1891,'Orurillo',9589,1884),(1892,'Santa Rosa',9589,1884),(1893,'Umachiri',9589,1884),(1894,'Moho ',9589,1806),(1895,'Moho',9589,1894),(1896,'Conima',9589,1894),(1897,'Huayrapata',9589,1894),(1898,'Tilali',9589,1894),(1899,'San Antonio de Putina ',9589,1806),(1900,'Putina',9589,1899),(1901,'Ananea',9589,1899),(1902,'Pedro Vilca Apaza',9589,1899),(1903,'Quilcapuncu',9589,1899),(1904,'Sina',9589,1899),(1905,'San Román ',9589,1806),(1906,'Juliaca',9589,1905),(1907,'Cabana',9589,1905),(1908,'Cabanillas',9589,1905),(1909,'Caracoto',9589,1905),(1910,'Sandia ',9589,1806),(1911,'Sandia',9589,1910),(1912,'Cuyocuyo',9589,1910),(1913,'Limbani',9589,1910),(1914,'Patambuco',9589,1910),(1915,'Phara',9589,1910),(1916,'Quiaca',9589,1910),(1917,'San Juan del Oro',9589,1910),(1918,'Yanahuaya',9589,1910),(1919,'Alto Inambari',9589,1910),(1920,'San Pedro de Putina Punco',9589,1910),(1921,'Yunguyo ',9589,1806),(1922,'Yunguyo',9589,1921),(1923,'Anapia',9589,1921),(1924,'Copani',9589,1921),(1925,'Cuturapi',9589,1921),(1926,'Ollaraya',9589,1921),(1927,'Tinicachi',9589,1921),(1928,'Unicachi',9589,1921),(1929,'San Martín',9589,0),(1930,'Moyobamba ',9589,1929),(1931,'Moyobamba',9589,1930),(1932,'Calzada',9589,1930),(1933,'Habana',9589,1930),(1934,'Jepelacio',9589,1930),(1935,'Soritor',9589,1930),(1936,'Yantalo',9589,1930),(1937,'Bellavista ',9589,1929),(1938,'Bellavista',9589,1937),(1939,'Alto Biavo',9589,1937),(1940,'Bajo Biavo',9589,1937),(1941,'Huallaga',9589,1937),(1942,'San Pablo',9589,1937),(1943,'San Rafael',9589,1937),(1944,'El Dorado ',9589,1929),(1945,'San José de Sisa',9589,1944),(1946,'Agua Blanca',9589,1944),(1947,'San Martín',9589,1944),(1948,'Santa Rosa',9589,1944),(1949,'Shatoja',9589,1944),(1950,'Huallaga ',9589,1929),(1951,'Saposoa',9589,1950),(1952,'Alto Saposoa',9589,1950),(1953,'El Eslabón',9589,1950),(1954,'Piscoyacu',9589,1950),(1955,'Sacanche',9589,1950),(1956,'Tingo de Saposoa',9589,1950),(1957,'Lamas ',9589,1929),(1958,'Lamas',9589,1957),(1959,'Alonso de Alvarado',9589,1957),(1960,'Barranquita',9589,1957),(1961,'Caynarachi',9589,1957),(1962,'Cuñumbuqui',9589,1957),(1963,'Pinto Recodo',9589,1957),(1964,'Rumisapa',9589,1957),(1965,'San Roque de Cumbaza',9589,1957),(1966,'Shanao',9589,1957),(1967,'Tabalosos',9589,1957),(1968,'Zapatero',9589,1957),(1969,'Mariscal Cáceres ',9589,1929),(1970,'Juanjuí',9589,1969),(1971,'Campanilla',9589,1969),(1972,'Huicungo',9589,1969),(1973,'Pachiza',9589,1969),(1974,'Pajarillo',9589,1969),(1975,'Picota ',9589,1929),(1976,'Picota',9589,1975),(1977,'Buenos Aires',9589,1975),(1978,'Caspisapa',9589,1975),(1979,'Pilluana',9589,1975),(1980,'Pucacaca',9589,1975),(1981,'San Cristóbal',9589,1975),(1982,'San Hilarión',9589,1975),(1983,'Shamboyacu',9589,1975),(1984,'Tingo de Ponasa',9589,1975),(1985,'Tres Unidos',9589,1975),(1986,'Rioja ',9589,1929),(1987,'Rioja',9589,1986),(1988,'Awajun',9589,1986),(1989,'Elías Soplin Vargas',9589,1986),(1990,'Nueva Cajamarca',9589,1986),(1991,'Pardo Miguel',9589,1986),(1992,'Posic',9589,1986),(1993,'San Fernando',9589,1986),(1994,'Yorongos',9589,1986),(1995,'Yuracyacu',9589,1986),(1996,'San Martín ',9589,1929),(1997,'Tarapoto',9589,1996),(1998,'Alberto Leveau',9589,1996),(1999,'Cacatachi',9589,1996),(2000,'Chazuta',9589,1996),(2001,'Chipurana',9589,1996),(2002,'El Porvenir',9589,1996),(2003,'Huimbayoc',9589,1996),(2004,'Juan Guerra',9589,1996),(2005,'La Banda de Shilcayo',9589,1996),(2006,'Morales',9589,1996),(2007,'Papaplaya',9589,1996),(2008,'San Antonio',9589,1996),(2009,'Sauce',9589,1996),(2010,'Shapaja',9589,1996),(2011,'Tocache ',9589,1929),(2012,'Tocache',9589,2011),(2013,'Nuevo Progreso',9589,2011),(2014,'Polvora',9589,2011),(2015,'Shunte',9589,2011),(2016,'Uchiza',9589,2011),(2017,'Tacna',9589,0),(2018,'Tacna ',9589,2017),(2019,'Tacna',9589,2018),(2020,'Alto de la Alianza',9589,2018),(2021,'Calana',9589,2018),(2022,'Ciudad Nueva',9589,2018),(2023,'Inclan',9589,2018),(2024,'Pachia',9589,2018),(2025,'Palca',9589,2018),(2026,'Pocollay',9589,2018),(2027,'Sama',9589,2018),(2028,'Coronel Gregorio Albarracín Lanchipa',9589,2018),(2029,'La Yarada los Palos',9589,2018),(2030,'Candarave ',9589,2017),(2031,'Candarave',9589,2030),(2032,'Cairani',9589,2030),(2033,'Camilaca',9589,2030),(2034,'Curibaya',9589,2030),(2035,'Huanuara',9589,2030),(2036,'Quilahuani',9589,2030),(2037,'Jorge Basadre ',9589,2017),(2038,'Locumba',9589,2037),(2039,'Ilabaya',9589,2037),(2040,'Ite',9589,2037),(2041,'Tarata ',9589,2017),(2042,'Tarata',9589,2041),(2043,'Héroes Albarracín',9589,2041),(2044,'Estique',9589,2041),(2045,'Estique-Pampa',9589,2041),(2046,'Sitajara',9589,2041),(2047,'Susapaya',9589,2041),(2048,'Tarucachi',9589,2041),(2049,'Ticaco',9589,2041),(2050,'Tumbes',9589,0),(2051,'Tumbes ',9589,2050),(2052,'Tumbes',9589,2051),(2053,'Corrales',9589,2051),(2054,'La Cruz',9589,2051),(2055,'Pampas de Hospital',9589,2051),(2056,'San Jacinto',9589,2051),(2057,'San Juan de la Virgen',9589,2051),(2058,'Contralmirante Villar ',9589,2050),(2059,'Zorritos',9589,2058),(2060,'Casitas',9589,2058),(2061,'Canoas de Punta Sal',9589,2058),(2062,'Zarumilla ',9589,2050),(2063,'Zarumilla',9589,2062),(2064,'Aguas Verdes',9589,2062),(2065,'Matapalo',9589,2062),(2066,'Papayal',9589,2062),(2067,'Ucayali',9589,0),(2068,'Coronel Portillo ',9589,2067),(2069,'Calleria',9589,2068),(2070,'Campoverde',9589,2068),(2071,'Iparia',9589,2068),(2072,'Masisea',9589,2068),(2073,'Yarinacocha',9589,2068),(2074,'Nueva Requena',9589,2068),(2075,'Manantay',9589,2068),(2076,'Atalaya ',9589,2067),(2077,'Raymondi',9589,2076),(2078,'Sepahua',9589,2076),(2079,'Tahuania',9589,2076),(2080,'Yurua',9589,2076),(2081,'Padre Abad ',9589,2067),(2082,'Padre Abad',9589,2081),(2083,'Irazola',9589,2081),(2084,'Curimana',9589,2081),(2085,'Neshuya',9589,2081),(2086,'Alexander Von Humboldt',9589,2081),(2087,'Purús',9589,2067),(2088,'Purus',9589,2087);

/*Table structure for table `mae_vendedor` */


CREATE TABLE `mae_vendedor` (
  `idvendedor` int(11) NOT NULL AUTO_INCREMENT,
  `idpersona` bigint(20) NOT NULL,
  `estado` tinyint(4) NOT NULL,
  PRIMARY KEY (`idvendedor`),
  KEY `idpersona` (`idpersona`),
  CONSTRAINT `mae_vendedor_ibfk_1` FOREIGN KEY (`idpersona`) REFERENCES `mae_persona` (`idpersona`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

/*Data for the table `mae_vendedor` */

/*Table structure for table `tran_conductor` */


CREATE TABLE `tran_conductor` (
  `idconductor` int(11) NOT NULL AUTO_INCREMENT,
  `idpersona` bigint(20) NOT NULL,
  `licencia` varchar(20) NOT NULL,
  `estado` tinyint(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`idconductor`),
  KEY `idpersona` (`idpersona`),
  CONSTRAINT `tran_conductor_ibfk_1` FOREIGN KEY (`idpersona`) REFERENCES `mae_persona` (`idpersona`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

/*Data for the table `tran_conductor` */

/*Table structure for table `tran_conductorhistorial` */


CREATE TABLE `tran_conductorhistorial` (
  `idconductorhistorial` bigint(20) NOT NULL AUTO_INCREMENT,
  `idconductor` int(11) NOT NULL,
  `fechainicio` date NOT NULL,
  `fechafin` date DEFAULT NULL,
  PRIMARY KEY (`idconductorhistorial`),
  KEY `idconductor` (`idconductor`),
  CONSTRAINT `tran_conductorhistorial_ibfk_1` FOREIGN KEY (`idconductor`) REFERENCES `tran_conductor` (`idconductor`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

/*Data for the table `tran_conductorhistorial` */

/*Table structure for table `tran_estadovehiculo` */


CREATE TABLE `tran_estadovehiculo` (
  `idestado` int(11) NOT NULL AUTO_INCREMENT,
  `descripcion` varchar(100) DEFAULT NULL,
  `estado` tinyint(4) DEFAULT NULL,
  PRIMARY KEY (`idestado`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

/*Data for the table `tran_estadovehiculo` */

/*Table structure for table `tran_marca` */


CREATE TABLE `tran_marca` (
  `idmarca` int(11) NOT NULL AUTO_INCREMENT,
  `parent` int(11) NOT NULL,
  `descripcion` varchar(100) NOT NULL,
  `tipo` char(1) NOT NULL,
  `estado` tinyint(1) NOT NULL,
  PRIMARY KEY (`idmarca`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

/*Data for the table `tran_marca` */

/*Table structure for table `tran_programacion` */


CREATE TABLE `tran_programacion` (
  `idprogramacion` bigint(20) NOT NULL AUTO_INCREMENT,
  `idconductorhistorial` bigint(20) NOT NULL,
  `idconductorhistorial2` bigint(20) DEFAULT NULL,
  `idvehiculo` int(11) NOT NULL,
  `fechainicio` date NOT NULL,
  `fechafin` date NOT NULL,
  `idturno` int(11) NOT NULL,
  `idruta` int(11) NOT NULL,
  `monto` decimal(9,2) NOT NULL DEFAULT '0.00',
  PRIMARY KEY (`idprogramacion`),
  KEY `idturno` (`idturno`),
  KEY `idruta` (`idruta`),
  KEY `idvehiculo` (`idvehiculo`),
  KEY `idconductorhistorial` (`idconductorhistorial`),
  KEY `idconductorhistorial2` (`idconductorhistorial2`),
  CONSTRAINT `tran_programacion_ibfk_1` FOREIGN KEY (`idturno`) REFERENCES `tran_turno` (`idturno`),
  CONSTRAINT `tran_programacion_ibfk_2` FOREIGN KEY (`idruta`) REFERENCES `tran_ruta` (`idruta`),
  CONSTRAINT `tran_programacion_ibfk_3` FOREIGN KEY (`idvehiculo`) REFERENCES `tran_vehiculo` (`idvehiculo`),
  CONSTRAINT `tran_programacion_ibfk_4` FOREIGN KEY (`idconductorhistorial`) REFERENCES `tran_conductorhistorial` (`idconductorhistorial`),
  CONSTRAINT `tran_programacion_ibfk_5` FOREIGN KEY (`idconductorhistorial2`) REFERENCES `tran_conductorhistorial` (`idconductorhistorial`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

/*Data for the table `tran_programacion` */

/*Table structure for table `tran_ruta` */


CREATE TABLE `tran_ruta` (
  `idruta` int(11) NOT NULL AUTO_INCREMENT,
  `idlugarorigen` int(11) NOT NULL,
  `idlugardestino` int(11) DEFAULT NULL,
  `descripcion` varchar(200) NOT NULL,
  `estado` tinyint(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`idruta`),
  KEY `idlugarorigen` (`idlugarorigen`),
  KEY `idlugardestino` (`idlugardestino`),
  CONSTRAINT `tran_ruta_ibfk_1` FOREIGN KEY (`idlugarorigen`) REFERENCES `mae_lugar` (`idlugar`),
  CONSTRAINT `tran_ruta_ibfk_2` FOREIGN KEY (`idlugardestino`) REFERENCES `mae_lugar` (`idlugar`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

/*Data for the table `tran_ruta` */

/*Table structure for table `tran_servicio` */


CREATE TABLE `tran_servicio` (
  `idservicio` int(11) NOT NULL AUTO_INCREMENT,
  `descripcion` varchar(100) NOT NULL,
  `estado` tinyint(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`idservicio`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

/*Data for the table `tran_servicio` */

/*Table structure for table `tran_tipovehiculo` */


CREATE TABLE `tran_tipovehiculo` (
  `idtipo` int(11) NOT NULL AUTO_INCREMENT,
  `descripcion` varchar(100) NOT NULL,
  `estado` tinyint(1) NOT NULL,
  PRIMARY KEY (`idtipo`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

/*Data for the table `tran_tipovehiculo` */

/*Table structure for table `tran_turno` */


CREATE TABLE `tran_turno` (
  `idturno` int(11) NOT NULL AUTO_INCREMENT,
  `descripcion` varchar(100) NOT NULL,
  `estado` tinyint(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`idturno`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

/*Data for the table `tran_turno` */

/*Table structure for table `tran_vehiculo` */


CREATE TABLE `tran_vehiculo` (
  `idvehiculo` int(11) NOT NULL AUTO_INCREMENT,
  `idtipo` int(11) NOT NULL,
  `idmarca` int(11) NOT NULL,
  `idestado` int(11) NOT NULL,
  `descripcion` varchar(100) NOT NULL,
  `asientos` int(11) DEFAULT NULL,
  `color` varchar(7) NOT NULL,
  `numeroplaca` varchar(10) NOT NULL,
  `largo` int(11) NOT NULL,
  `ancho` int(11) NOT NULL,
  `estado` tinyint(1) NOT NULL,
  PRIMARY KEY (`idvehiculo`),
  KEY `idtipovehiculo` (`idtipo`),
  KEY `idmarca` (`idmarca`),
  KEY `idestado` (`idestado`),
  CONSTRAINT `tran_vehiculo_ibfk_1` FOREIGN KEY (`idtipo`) REFERENCES `tran_tipovehiculo` (`idtipo`),
  CONSTRAINT `tran_vehiculo_ibfk_2` FOREIGN KEY (`idmarca`) REFERENCES `tran_marca` (`idmarca`),
  CONSTRAINT `tran_vehiculo_ibfk_3` FOREIGN KEY (`idestado`) REFERENCES `tran_estadovehiculo` (`idestado`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

/*Data for the table `tran_vehiculo` */

/*Table structure for table `tran_vendedorhistorial` */


CREATE TABLE `tran_vendedorhistorial` (
  `idvendedorhistorial` bigint(20) NOT NULL AUTO_INCREMENT,
  `idvendedor` int(11) NOT NULL,
  `fechainicio` date NOT NULL,
  `fechafin` date DEFAULT NULL,
  PRIMARY KEY (`idvendedorhistorial`),
  KEY `idvendedor` (`idvendedor`),
  CONSTRAINT `tran_vendedorhistorial_ibfk_1` FOREIGN KEY (`idvendedor`) REFERENCES `mae_vendedor` (`idvendedor`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

/*Data for the table `tran_vendedorhistorial` */

/*Table structure for table `ven_comprobante` */


CREATE TABLE `ven_comprobante` (
  `idcomprobante` int(11) NOT NULL AUTO_INCREMENT,
  `descripcion` varchar(100) NOT NULL,
  `estado` tinyint(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`idcomprobante`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

/*Data for the table `ven_comprobante` */

/*Table structure for table `ven_venta` */


CREATE TABLE `ven_venta` (
  `idventa` bigint(20) NOT NULL AUTO_INCREMENT,
  `idcomprobante` int(11) NOT NULL,
  `serie` char(4) NOT NULL,
  `correlativo` int(11) NOT NULL,
  `numerooperacion` bigint(20) NOT NULL,
  `idprogramacion` bigint(20) NOT NULL,
  `idvendedorhistorial` int(11) NOT NULL,
  `monto` decimal(9,2) NOT NULL,
  `fecha` date NOT NULL,
  `fechasistema` datetime NOT NULL,
  `idcliente` bigint(20) NOT NULL,
  `idservicio` int(11) NOT NULL,
  `estato` tinyint(4) NOT NULL,
  `idempresa` int(11) DEFAULT NULL,
  `asiento` int(11) NOT NULL,
  PRIMARY KEY (`idventa`),
  KEY `idcliente` (`serie`),
  KEY `idcomprobante` (`idcomprobante`),
  KEY `idprogramacion` (`idprogramacion`),
  KEY `idvendedorhistorial` (`idvendedorhistorial`),
  KEY `idcliente_2` (`idcliente`),
  KEY `idservicio` (`idservicio`),
  KEY `idempresa` (`idempresa`),
  CONSTRAINT `ven_venta_ibfk_1` FOREIGN KEY (`idcomprobante`) REFERENCES `ven_comprobante` (`idcomprobante`),
  CONSTRAINT `ven_venta_ibfk_4` FOREIGN KEY (`idprogramacion`) REFERENCES `tran_programacion` (`idprogramacion`),
  CONSTRAINT `ven_venta_ibfk_5` FOREIGN KEY (`idvendedorhistorial`) REFERENCES `tran_vendedorhistorial` (`idvendedor`),
  CONSTRAINT `ven_venta_ibfk_6` FOREIGN KEY (`idcliente`) REFERENCES `mae_cliente` (`idcliente`),
  CONSTRAINT `ven_venta_ibfk_7` FOREIGN KEY (`idservicio`) REFERENCES `tran_servicio` (`idservicio`),
  CONSTRAINT `ven_venta_ibfk_8` FOREIGN KEY (`idempresa`) REFERENCES `mae_empresa` (`idempresa`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

/*Data for the table `ven_venta` */

/*Table structure for table `ven_ventadetalle` */


CREATE TABLE `ven_ventadetalle` (
  `idventadetalle` bigint(20) NOT NULL AUTO_INCREMENT,
  `idventa` bigint(20) NOT NULL,
  `descripcion` varchar(150) DEFAULT NULL,
  `monto` decimal(9,2) NOT NULL,
  `peso` decimal(9,2) DEFAULT NULL,
  `observacion` varchar(150) DEFAULT NULL,
  `cantidad` int(11) DEFAULT NULL,
  PRIMARY KEY (`idventadetalle`),
  KEY `idventa` (`idventa`),
  CONSTRAINT `ven_ventadetalle_ibfk_1` FOREIGN KEY (`idventa`) REFERENCES `ven_venta` (`idventa`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

/*Data for the table `ven_ventadetalle` */

/* Function  structure for function  `fn_contarocurrencias` */

/*!50003 DROP FUNCTION IF EXISTS `fn_contarocurrencias` */;
DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` FUNCTION `fn_contarocurrencias`(_cadena VARCHAR(500),_ocurrencia char(1)) RETURNS varchar(255) CHARSET utf8 COLLATE utf8_spanish_ci
BEGIN
	declare _result varchar(255);
	
	set _result =LENGTH(_cadena) - LENGTH(REPLACE(_cadena, _ocurrencia, ''));
	
	
	RETURN _result;
    END */$$
DELIMITER ;

/* Function  structure for function  `fn_dateFormatClient` */

/*!50003 DROP FUNCTION IF EXISTS `fn_dateFormatClient` */;
DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` FUNCTION `fn_dateFormatClient`(_criterio VARCHAR(10)) RETURNS varchar(10) CHARSET utf8 COLLATE utf8_spanish_ci
BEGIN
	RETURN CONCAT(RIGHT(_criterio,2),'/',SUBSTR(_criterio,6,2),'/',LEFT(_criterio,4));
    END */$$
DELIMITER ;

/* Function  structure for function  `fn_dateFormatServer` */

/*!50003 DROP FUNCTION IF EXISTS `fn_dateFormatServer` */;
DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` FUNCTION `fn_dateFormatServer`(_criterio VARCHAR(10)) RETURNS date
BEGIN
	RETURN CONCAT(RIGHT(_criterio,4),'-',SUBSTR(_criterio,4,2),'-',LEFT(_criterio,2));
    END */$$
DELIMITER ;

/* Function  structure for function  `fn_depurachar` */

/*!50003 DROP FUNCTION IF EXISTS `fn_depurachar` */;
DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` FUNCTION `fn_depurachar`(str VARCHAR(255)) RETURNS varchar(255) CHARSET utf8 COLLATE utf8_spanish_ci
BEGIN
	declare _result varchar(255);
	
	set _result=REPLACE(str, "á", "a");
	SET _result=REPLACE(_result, "é", "e");	
	SET _result=REPLACE(_result, "í", "i");
	SET _result=REPLACE(_result, "ó", "o");
	SET _result=REPLACE(_result, "ú", "u");
	
	SET _result=REPLACE(_result, "Á", "A");	
	SET _result=REPLACE(_result, "É", "E");	
	SET _result=REPLACE(_result, "Í", "I");
	SET _result=REPLACE(_result, "Ó", "O");
	SET _result=REPLACE(_result, "Ú", "U");
	
	
	RETURN _result;
    END */$$
DELIMITER ;

/* Function  structure for function  `fn_explode` */

/*!50003 DROP FUNCTION IF EXISTS `fn_explode` */;
DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` FUNCTION `fn_explode`(
	_x TEXT,
	_delim VARCHAR(12),
	_pos INT
    ) RETURNS text CHARSET utf8 COLLATE utf8_spanish_ci
    DETERMINISTIC
BEGIN
	RETURN 	REPLACE(SUBSTRING(SUBSTRING_INDEX(_x, _delim, _pos),
		CHAR_LENGTH(SUBSTRING_INDEX(_x, _delim, _pos -1)) + 1),_delim, '');
    END */$$
DELIMITER ;

/* Function  structure for function  `fn_getcadenarecursos` */

/*!50003 DROP FUNCTION IF EXISTS `fn_getcadenarecursos` */;
DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` FUNCTION `fn_getcadenarecursos`(_str VARCHAR(500),_total int) RETURNS varchar(500) CHARSET utf8 COLLATE utf8_spanish_ci
BEGIN
	declare _result varchar(500);
	declare _c int;
	declare _idrecurso int;
	declare _descripcion varchar(100);
	declare _totalcadena int;
	
	set _c=1;
	set _result='';
	
	WHILE _c<=_total DO
		set _idrecurso=fn_explode(_str,',',_c);
		
		select descripcion into _descripcion
		from crs_notificacionrecurso
		where idrecurso=_idrecurso;
		
		set _result=concat(_result,_descripcion,', ');
		
		set _c=_c+1;
	end while;
	select length(_result) into _totalcadena;
	
	set _result=left(_result,(_totalcadena-3));
	
	RETURN _result;
    END */$$
DELIMITER ;

/* Function  structure for function  `fn_getparam` */

/*!50003 DROP FUNCTION IF EXISTS `fn_getparam` */;
DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` FUNCTION `fn_getparam`(_parametro CHAR(20)) RETURNS varchar(200) CHARSET utf8 COLLATE utf8_spanish_ci
BEGIN
	declare _result varchar(255);
	
	select valor into _result
	from app_parametros
	where codigo=_parametro;
		
	RETURN _result;
    END */$$
DELIMITER ;

/* Function  structure for function  `fn_getcadenamotivoentrega` */

/*!50003 DROP FUNCTION IF EXISTS `fn_getcadenamotivoentrega` */;
DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` FUNCTION `fn_getcadenamotivoentrega`(_str VARCHAR(500),_total int) RETURNS varchar(500) CHARSET utf8 COLLATE utf8_spanish_ci
BEGIN
	declare _result varchar(500);
	declare _c int;
	declare _idmotivo int;
	declare _descripcion varchar(100);
	declare _totalcadena int;
	
	set _c=1;
	set _result='';
	
	WHILE _c<=_total DO
		set _idmotivo=fn_explode(_str,',',_c);
		
		select descripcion into _descripcion
		from crs_notificacionmotivoentregaacta
		where idmotivo=_idmotivo;
		
		set _result=concat(_result,_descripcion,', ');
		
		set _c=_c+1;
	end while;
	-- select length(_result) into _totalcadena;
	
	-- set _result=left(_result,(_totalcadena-2));
	
	RETURN _result;
    END */$$
DELIMITER ;

/* Procedure structure for procedure `sp_appParametroMantenimiento` */

/*!50003 DROP PROCEDURE IF EXISTS  `sp_appParametroMantenimiento` */;

DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_appParametroMantenimiento`(
	_flag INT,
	_id BIGINT,
	_valor VARCHAR(200),
	_idusuario BIGINT,
	_ip VARCHAR(50),
	_navegador VARCHAR(100)
)
BEGIN
	DECLARE _result INT;
	IF _flag = 1 THEN
		UPDATE app_parametros
		SET valor=_valor
		WHERE idparametro=_id;
		
		SET _result=1;
	END IF;
	
	SELECT _result AS result;
    END */$$
DELIMITER ;

/* Procedure structure for procedure `sp_appPasswordMantenimiento` */

/*!50003 DROP PROCEDURE IF EXISTS  `sp_appPasswordMantenimiento` */;

DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_appPasswordMantenimiento`(
	_clave varchar(200),
	_clavenew varchar(200),
	_idusuario bigint,
	_ip varchar(50),
	_navegador varchar(100)
    )
BEGIN
	declare _existe int;
	declare _result int;
	
	select count(*) into _existe
	from app_usuario
	where clave=_clave
	and idusuario=_idusuario;
	
	if _existe>0 then
		update app_usuario set clave=_clavenew where idusuario=_idusuario;
		set _result=1;
	else
		set _existe=0;
		
		SELECT COUNT(*) INTO _existe
		FROM app_usuario
		where idusuario=_idusuario;
		
		set _result=2;
	end if;
	select _result as result;
    END */$$
DELIMITER ;

/* Procedure structure for procedure `sp_sisAuditoriaMantenimiento` */

/*!50003 DROP PROCEDURE IF EXISTS  `sp_sisAuditoriaMantenimiento` */;

DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_sisAuditoriaMantenimiento`(
	_tipo char(1),
	_tabla varchar(100),
	_idregistro bigint,
	_campos varchar(200),
	_anterior varchar(500),
	_actual varchar(500),
	_idusuario bigint,
	_ip varchar(50),
	_navegador varchar(50),
	_importante char(1)
    )
BEGIN
	INSERT INTO aud_historial(tipo,tabla,idregistro,campos,anterior,actual,idusuario,ip,navegador,importante)
	VALUES(_tipo,_tabla,_idregistro,_campos,_anterior,_actual,_idusuario,_ip,_navegador,_importante);
    END */$$
DELIMITER ;

/* Procedure structure for procedure `sp_appRolGrid` */

/*!50003 DROP PROCEDURE IF EXISTS  `sp_appRolGrid` */;

DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_appRolGrid`(_pagina INT,_regxpag INT,_filtro VARCHAR(200))
BEGIN
	DECLARE _totalregistros INT;
	DECLARE _paginaactual INT;
	DECLARE _pagorden INT;
	DECLARE _orden INT;
	
	SET _paginaactual=_pagina;
	
	SET _pagina=_pagina-1;
	SET _pagina=_pagina*_regxpag;
	
	SET _pagorden=(_paginaactual*_regxpag);
	-- select _pagorden;
	
	SET _orden=_pagorden-_regxpag;
	
	SELECT _orden INTO @rownum;
	
	SELECT 
		COUNT(*) INTO _totalregistros
	FROM app_rol a
	WHERE a.descripcion LIKE CONCAT('%',_filtro,'%');
	
	SELECT 
		@rownum:=@rownum+1 AS nro,
		a.idrol AS id,
		a.descripcion,
		a.contenido,		
		a.estado,		
		_totalregistros AS totalregistros,		
		_paginaactual AS paginaactual
	FROM app_rol a
	WHERE a.descripcion LIKE CONCAT('%',_filtro,'%')
	LIMIT _pagina,_regxpag;
    END */$$
DELIMITER ;

/* Procedure structure for procedure `sp_appRolMantenimiento` */

/*!50003 DROP PROCEDURE IF EXISTS  `sp_appRolMantenimiento` */;

DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_appRolMantenimiento`(_flag INT,_idrol INT,_fields VARCHAR(500))
BEGIN
	DECLARE _descripcion VARCHAR(200);
	DECLARE _contenido VARCHAR(200);
	DECLARE _estado TINYINT;
	
	set _descripcion=fn_explode(_fields,'^',1);
	set _contenido=fn_explode(_fields,'^',2);
	SELECT fn_explode(fn_depurachar(_fields),'^',3) INTO _estado;
	
	SET @result=1;
	SET @existe=0;
	
	IF _flag = 1 THEN
		SELECT COUNT(*) INTO @existe FROM app_rol WHERE descripcion=_descripcion;
		IF @existe=0 THEN			
			INSERT INTO app_rol(
				descripcion,
				contenido,
				estado)
			SELECT 
				_descripcion,
				_contenido,
				_estado;
		ELSE
			SET @result=2;
		END IF;
		SELECT @result AS result;
	END IF;
	IF _flag = 2 THEN
		SELECT COUNT(*) INTO @existe FROM app_rol WHERE descripcion=_descripcion AND idrol<>_idrol;
		IF @existe=0 THEN
			UPDATE app_rol 
			SET descripcion=_descripcion,
			contenido=_contenido,
			estado=_estado
			WHERE idrol=_idrol;
		ELSE
			SET @result=2;
		END IF;
		SELECT @result AS result;
	END IF;
	IF _flag = 3 THEN
		SELECT COUNT(*) INTO @existe FROM app_rolopcion WHERE idrol=_idrol;
		IF @existe=0 THEN		
			DELETE FROM app_rol WHERE idrol=_idrol;
		ELSE
			SET @result=2;
		END IF;
		SELECT @result AS result;
	END IF;
    END */$$
DELIMITER ;

/* Procedure structure for procedure `sp_sisAppConsultas` */

/*!50003 DROP PROCEDURE IF EXISTS  `sp_sisAppConsultas` */;

DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_sisAppConsultas`(_flag int,_criterio varchar(200))
BEGIN
	if _flag = 1 then
		SELECT 
			a.idopcion,
			a.descripcion,
			a.parent,
			a.alias,
			a.url,
			a.icono,
			a.nivel,
			(SELECT COUNT(*) FROM app_opcion z WHERE a.idopcion=z.parent)AS item
		FROM app_opcion a
		INNER JOIN app_rolopcion b ON a.idopcion=b.idopcion
		WHERE 
			b.idrol=_criterio
			AND a.estado=1
		ORDER BY a.nivel,a.orden;
	end if;
	if _flag = 2 then
		SELECT 
			e.idrol,
			CONCAT(c.descripcion,' - ',e.descripcion)AS descripcion,
			e.contenido
		FROM rh_trabajadorcargo a
		inner join rh_cargoorganizacion b on a.idcargoorganizacion=b.idcargoorganizacion
		INNER JOIN rh_cargo c ON b.idcargo=c.idcargo
		INNER JOIN rh_cargorol d ON c.idcargo=d.idcargo
		INNER JOIN app_rol e ON d.idrol=d.idrol
		WHERE a.idtrabajador=_criterio;
	end if;
	if _flag = 3 then
		select 
			idlang,
			descripcion,
			alt,
			class
		from app_lang
		where estado=1;
	end if;
	if _flag = 4 then
		SELECT 
			CONCAT(c.alias,d.alias)AS opcion,
			d.descripcion AS accion,
			d.icono,
			d.theme,
			1 AS permiso
		FROM app_rolopcionpermiso a INNER JOIN app_rolopcion b ON a.idrolopcion=b.idrolopcion
		INNER JOIN app_opcion c ON b.idopcion=c.idopcion
		INNER JOIN app_permiso d ON a.idpermiso=d.idpermiso
		WHERE b.idrol=_criterio
		AND c.alias IS NOT NULL;
	end if;
	if _flag = 5 then
		select
			descripcion,
			contenido,
			estado
		from app_rol
		where idrol=_criterio;
	end if;
	if _flag = 6 then
		SELECT
			a.idparametro AS id,
			b.descripcion AS tipo,
			a.descripcion,
			a.consulta,
			a.codigo,
			a.valor
		FROM app_parametros a
		INNER JOIN app_tipoparametro b ON a.idtipo=b.idtipo;
	end if;
    END */$$
DELIMITER ;

/* Procedure structure for procedure `sp_sisAppLogin` */

/*!50003 DROP PROCEDURE IF EXISTS  `sp_sisAppLogin` */;

DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_sisAppLogin`(_flag int,_usuario varchar(200),_clave varchar(200))
BEGIN
	SET @result=1;
	SET @existe=0;
	SET @usuario=0;
	SET @rol=0;
	set @nombres='';
	set @trabajador=0;
	set @persona=0;
	set @cargo=0;
	
	if _flag = 1 then
		SELECT 
			COUNT(*),idusuario INTO @existe,@idusuario
		FROM app_usuario 
	        WHERE MD5(usuario)=_usuario AND clave=_clave;		        	          	     
		
		IF @existe=0 THEN			
			SET @result=0;
		ELSE
			select b.nombres,b.idpersona into @nombres,@persona
			from app_usuario a 
			inner join mae_persona b on a.idpersona=b.idpersona
			where a.idusuario=@idusuario;
			
			/*select idtrabajador into @trabajador
			from rh_trabajador
			where idpersona=@persona;
			
			select c.idcargo into @cargo
			from rh_trabajador a 
			inner join rh_trabajadorcargo b on a.idtrabajador=b.idtrabajador and b.principal=1
			inner join rh_cargoorganizacion c on b.idcargoorganizacion=c.idcargoorganizacion
			where a.idpersona=@persona;
			
			select idrol into @rol
			from rh_cargorol
			where idcargo=@cargo
			limit 1;*/
			
			SELECT idrol INTO @rol
 			FROM app_usuariorol
 			WHERE idusuario=@idusuario
 			LIMIT 1;
			SET @result=1;
		END IF;
		
		
		SELECT @result AS result,@idusuario AS usuario,@rol AS rol,@nombres as nombres,@trabajador as trabajador;
	end if;
    END */$$
DELIMITER ;

/* Procedure structure for procedure `sp_sisRhConsultas` */

/*!50003 DROP PROCEDURE IF EXISTS  `sp_sisRhConsultas` */;

DELIMITER $$

/*!50003 CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_sisRhConsultas`(
	_flag int,
	_criterio varchar(200)
    )
BEGIN
	if _flag = 1 then
		select
			descripcion,
			estado
		from rh_condicioncargo
		where idcondicion=_criterio;
	end if;
	IF _flag = 2 THEN
		SELECT
			idcondicion,
			descripcion,
			estado
		FROM rh_cargo
		WHERE idcargo=_criterio;
	END IF;
	if _flag = 3 then
		select
			idcondicion as 'option',
			descripcion as 'value'
		from rh_condicioncargo
		where estado=1;
	end if;
	IF _flag = 4 THEN
		SELECT
			descripcion,
			estado
		FROM rh_estadolaboral
		WHERE idestadolaboral=_criterio;
	END IF;
	IF _flag = 5 THEN
		SELECT
			descripcion,
			estado
		FROM rh_categoriaregimen
		WHERE idcategoria=_criterio;
	END IF;
	IF _flag = 6 THEN
		SELECT
			descripcion,
			estado
		FROM rh_condicionlaboral
		WHERE idcondicion=_criterio;
	END IF;
	IF _flag = 7 THEN
		SELECT
			descripcion,
			estado
		FROM rh_modalidadlaboral
		WHERE idmodalidad=_criterio;
	END IF;
	if _flag = 8 then
		select
			descripcion,
			idcategoria,
			estado
		from rh_regimen
		where idregimen=_criterio;
	end iF;
	if _flag = 9 then
		select
			idcategoria as 'option',
			descripcion as 'value'
		from rh_categoriaregimen
		where estado=1;
	end if;
	if _flag = 10 then
		select
			idcargo as 'option',
			descripcion as 'value'
		from rh_cargo
		where idcondicion=_criterio;
	end if;
	if _flag = 11 then
		select 
			c.idregion,
			c.idlocalidad,
			a.idorganizacion,
			a.idcargo,
			d.idcondicion,
			a.estado
		from rh_cargoorganizacion a
		inner join mae_organizacion b on a.idorganizacion=b.idorganizacion
		inner join mae_localidad c on b.idlocalidad=c.idlocalidad
		inner join rh_cargo d on a.idcargo=d.idcargo
		where idcargoorganizacion=_criterio;
	end if;
	if _flag = 12 then
		select
			a.idpersona,
			c.descripcion as tipodocumento,
			b.numerodocumento,
			b.nombrecompleto,
			b.sexo,
			b.fechanacimiento,
			d.descripcion as ubigeo,
			b.direccion,
			b.contactoemergencia,
			b.comunicacioncontactoemergencia,
			b.ruta
		from rh_trabajador a 
		inner join mae_persona b on a.idpersona=b.idpersona
		inner join mae_tipodocumento c on b.idtipodocumento=c.idtipodocumento
		inner join mae_ubigeo d on b.idubigeo=d.idubigeo
		where a.idtrabajador=_criterio;
	end if;
	if _flag = 13 then
		select 
			idmodalidad as 'option',
			descripcion as 'value'
		from rh_modalidadlaboral
		where estado=1;
	end if;
	if _flag = 14 then
		select
			idcondicion as 'option',
			descripcion as 'value'
		from rh_condicionlaboral
		where estado=1;
	end if;
	IF _flag = 15 THEN
		SELECT
			idcategoria AS 'option',
			descripcion AS 'value'
		FROM rh_categoriaregimen
		WHERE estado=1;
	END IF;
	if _flag = 16 then
		select
			idregimen as 'option',
			descripcion as 'value'
		from rh_regimen
		where idcategoria=_criterio
		and estado=1;
	end if;
	if _flag = 17 then
		select 
			idestadolaboral as 'option',
			descripcion as 'value'
		from rh_estadolaboral
		where estado=1;
	end if;
	if _flag = 18 then
		SELECT 	
			d.idregion,
			i.descripcion AS region,
			d.idlocalidad,
			d.descripcion AS localidad,
			c.idorganizacion,
			c.descripcion AS organizacion,
			e.idcargo,
			e.descripcion AS cargo,
			e.idcondicion AS cargocondicion,
			j.descripcion AS condicioncargo,
			a.idestadolaboral,
			k.descripcion AS estadolaboral,
			f.idcategoria,
			g.descripcion AS categoriaregimen,
			a.idregimen,
			f.descripcion AS regimen,
			a.fechainicio,
			a.fechafin,
			a.idmodalidad,
			h.descripcion AS modalidad,
			a.idcondicion,
			l.descripcion AS condicionlaboral,
			a.horasxsemanamin,
			a.horasxsemanamax,
			a.estado,
			a.principal,
			a.ruta
		FROM rh_trabajadorcargo a
		INNER JOIN rh_cargoorganizacion b ON a.idcargoorganizacion=b.idcargoorganizacion
		INNER JOIN mae_organizacion c ON b.idorganizacion=c.idorganizacion
		INNER JOIN mae_localidad d ON c.idlocalidad=d.idlocalidad
		INNER JOIN rh_cargo e ON b.idcargo=e.idcargo
		INNER JOIN rh_regimen f ON a.idregimen=f.idregimen
		INNER JOIN rh_categoriaregimen g ON f.idcategoria=g.idcategoria
		INNER JOIN rh_modalidadlaboral h ON a.idmodalidad=h.idmodalidad
		INNER JOIN mae_region i ON d.idregion=i.idregion
		INNER JOIN rh_condicioncargo j ON e.idcondicion=j.idcondicion
		INNER JOIN rh_estadolaboral k ON a.idestadolaboral=k.idestadolaboral
		INNER JOIN rh_condicionlaboral l ON a.idcondicion=l.idcondicion		
		where a.idtrabajadorcargo=_criterio;
	end if;	
	if _flag = 19 then
		SELECT 	
			d.idregion,
			i.descripcion as region,
			d.idlocalidad,
			d.descripcion as localidad,
			c.idorganizacion,
			c.descripcion as organizacion,
			e.idcargo,
			e.descripcion as cargo,
			e.idcondicion AS cargocondicion,
			j.descripcion as condicioncargo,
			a.idestadolaboral,
			k.descripcion as estadolaboral,
			f.idcategoria,
			g.descripcion as categoriaregimen,
			a.idregimen,
			f.descripcion as regimen,
			a.fechainicio,
			a.fechafin,
			a.idmodalidad,
			h.descripcion as modalidad,
			a.idcondicion,
			l.descripcion as condicionlaboral,
			a.horasxsemanamin,
			a.horasxsemanamax,
			a.estado,
			a.principal,
			a.ruta
		FROM rh_trabajadorcargo a
		INNER JOIN rh_cargoorganizacion b ON a.idcargoorganizacion=b.idcargoorganizacion
		INNER JOIN mae_organizacion c ON b.idorganizacion=c.idorganizacion
		INNER JOIN mae_localidad d ON c.idlocalidad=d.idlocalidad
		INNER JOIN rh_cargo e ON b.idcargo=e.idcargo
		INNER JOIN rh_regimen f ON a.idregimen=f.idregimen
		inner join rh_categoriaregimen g on f.idcategoria=g.idcategoria
		inner join rh_modalidadlaboral h on a.idmodalidad=h.idmodalidad
		inner join mae_region i on d.idregion=i.idregion
		inner join rh_condicioncargo j on e.idcondicion=j.idcondicion
		inner join rh_estadolaboral k on a.idestadolaboral=k.idestadolaboral
		inner join rh_condicionlaboral l on a.idcondicion=l.idcondicion
		WHERE a.idtrabajador=_criterio;
	end if;
	if _flag = 20 then
		SELECT
			a.idpersona,
			c.descripcion AS tipodocumento,
			b.numerodocumento,
			b.nombrecompleto,
			b.sexo,
			b.fechanacimiento,
			d.descripcion AS ubigeo,
			b.direccion,
			b.contactoemergencia,
			b.comunicacioncontactoemergencia,
			b.ruta
		FROM rh_trabajador a 
		INNER JOIN mae_persona b ON a.idpersona=b.idpersona
		INNER JOIN mae_tipodocumento c ON b.idtipodocumento=c.idtipodocumento
		INNER JOIN mae_ubigeo d ON b.idubigeo=d.idubigeo
		inner join rh_trabajadorcargo e on a.idtrabajador=e.idtrabajador
		WHERE e.idtrabajadorcargo=_criterio;
	end if;
    END */$$
DELIMITER ;

