This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license | |
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Main.java to edit this template | |
*/ | |
package appestadistica; | |
import appestadistica.clases.Trabajador; | |
import java.util.ArrayList; | |
import java.util.Scanner; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license | |
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Main.java to edit this template | |
*/ | |
package appconsola; | |
import java.sql.Connection; | |
import java.sql.DriverManager; | |
import java.sql.ResultSet; | |
import java.sql.SQLException; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 1) IMPORTAR LISTADO DE RUTS | |
-- 2) SACAR LISTADO EN BRUTO. POR EJEMPLO, TODAS LAS ATENCIONES DE PSICÓLOGOS | |
select s.rut, aten.FECHA_HORA_INICIO | |
from sename_1 as s | |
left join (select max(fecha_inscripcion) as t, RUT, ID, APELLIDO_PATERNO, APELLIDO_MATERNO, NOMBRES from USP_USUARIO_APS group by RUT, ID, APELLIDO_PATERNO, APELLIDO_MATERNO, NOMBRES) as usp on usp.rut Collate Modern_Spanish_CI_AS = s.rut1 | |
left join ATEN_ATENCION as aten on (aten.USP_ID = usp.ID and aten.OBSERVACION != 'Inasistencia Registrada' and aten.INS_ID = 15) | |
order by s.rut, aten.FECHA_HORA_INICIO DESC | |
-- 3) DESPUÉS, EN EXCEL ELIMINAR DUPLICADOS (BASADOS EN EL RUT) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.getElementsByName('#AlgoQueDispare').addEventListener('evento', function(){ | |
la_funcion_promesa().then(function(algun_valor){ | |
// hago algo con 'serie' que es el valor que me respondió el servidor en la OTRA función | |
console.log(algun_valor); | |
}); | |
}); | |
var la_funcion_promesa = function() { | |
return new Promise(function(resolve, reject) { | |
var xhttp = new XMLHttpRequest(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public JsonResult ObtenerUsuario() | |
{ | |
var usuario = new Usuario { NombreUsuario = "MarioCares", Edad = 28, | |
Email = "[email protected]", Contrasegna = "123456"}; | |
var usuario2 = new Usuario(); | |
usuario2.NombreUsuario = "Juanito"; | |
usuario2.Contrasegna = "JuanitoRulz"; | |
usuario2.Email = "[email protected]"; | |
usuario2.Edad = 50; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- CANTIDAD MIGRANTES | |
select nac.NOMBRE, count(*) as 'Cantidad Migrantes' | |
from USP_USUARIO_APS as usp | |
inner join NAC_NACIONALIDAD as nac on nac.id = usp.NAC_ID | |
where NAC_ID > 1 and usp.NOD_ID in (225, 226, 227, 2957) and year(usp.FECHA_INSCRIPCION) = 2018 | |
group by nac.nombre | |
order by count(*) desc; | |
-- CANTIDAD ATENCIONES A MIGRANTES | |
select nac.nombre, count(*) as 'Cantidad Atenciones' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
insert into rrhh_licencia2 | |
select id, licencia, fecha_emision, ingreso_at, inicio_at, termino_at, tipo_licencia, | |
COALESCE(tipo_reposo, 1) AS tipo_reposo, 1 AS reposo_lugar, | |
(CASE WHEN jornada = 0 THEN 1 WHEN jornada = 1 THEN 1 WHEN jornada = 2 THEN 2 WHEN jornada is null THEN 1 END) as jornada, | |
COALESCE(id_ocupacion, 19) AS id_ocupacion, | |
COALESCE(id_actividad, 9) AS id_actividad, | |
(CASE WHEN subsidio = 'A' THEN 1 WHEN subsidio = 'E' THEN 1 WHEN subsidio = 'B' THEN 2 WHEN subsidio = 'C' THEN 3 | |
WHEN subsidio = 'D' THEN 4 WHEN subsidio = 'H' THEN 4 WHEN subsidio = 'F' THEN 5 WHEN subsidio = 'G' THEN 6 ELSE '7' END) AS subsidio, | |
usuario_id, usuario_ingresa, | |
(CASE WHEN estado = 1 THEN 1 ELSE 2 END) AS estado, medico, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INSERT INTO rrhh_accidente_trabajo | |
select id, tipo, (CASE WHEN estado = 0 THEN 2 WHEN estado = 1 THEN 1 END) AS estado, usuario, '17432116', | |
num_resolucion, fecha_ingreso, fecha_accidente, fecha_inicio_reposo, fecha_fin_reposo, '.', null, null | |
from rrhh_licencia_accidente WHERE usuario != 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- PRIMERO, ELIMINAR POSIBLES DUPLICADOS | |
select * | |
into dbo.temporal_filtro | |
from USP_USUARIO_APS | |
where FECHA_INSCRIPCION in ( SELECT MAX(FECHA_INSCRIPCION) from USP_USUARIO_APS group by RUT); | |
-- EXTRAER DATOS NECESARIOS DESDE PERCAPITA. CAMBIAR CÓDIGO CENTRO FONASA POR RAYEN | |
select concat(run, dv) as run, | |
case cod_centro when 102300 then 225 when 102301 then 227 when 102302 then 226 | |
when 102306 then 2957 when 102412 then 226 when 102413 then 226 when 102701 then 3003 end as cod_centro, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT l.rut, l.dv, l.nombres, l.tipo_calculo AS calidad, l.centro_costo, l.cargo, l.docente, l.lugar_desempenio | |
FROM rrhh_licencia AS rl | |
INNER JOIN liquidaciones AS l ON l.rut = rl.usuario_id | |
WHERE rl.estado != 'ELIMINADO' AND DATE_FORMAT(rl.inicio_at, '%Y-%m') = '2017-09' AND l.area = 'EDUCACION' AND l.aniomes = 201709 |
NewerOlder