Commit be2e2e2e1f6ecd4584daeba64c2899a91153ce76
Exists in
master
Merge branch 'master' of http://ferramentasgo.centralit.com.br:8080/scm/git/cit-grp-adm-materiais
Showing
1 changed file
with
29 additions
and
14 deletions
Show diff stats
cit-adm-materiais-api/src/main/resources/scripts-bd/Migracao_MPOG/04-Patrimonio.sql
... | ... | @@ -2352,7 +2352,8 @@ BEGIN; -- #INI :: GERACAO DO HISTORICO DOS BENS PATRIMONIAIS >> HISTORICOBEMPAT |
2352 | 2352 | dominiotipohistorico_id, |
2353 | 2353 | dominiotipomotivoalteracao_id, |
2354 | 2354 | dominioclassereferencia_id, |
2355 | - idClasseReferencia | |
2355 | + idClasseReferencia, | |
2356 | + codigooperacao | |
2356 | 2357 | ) |
2357 | 2358 | SELECT |
2358 | 2359 | NEXTVAL('hibernate_sequence'), |
... | ... | @@ -2369,7 +2370,8 @@ BEGIN; -- #INI :: GERACAO DO HISTORICO DOS BENS PATRIMONIAIS >> HISTORICOBEMPAT |
2369 | 2370 | hist_entrada, |
2370 | 2371 | mot_incorporacao, |
2371 | 2372 | classeId, |
2372 | - E.ID | |
2373 | + E.ID, | |
2374 | + E.CODIGO | |
2373 | 2375 | FROM ENTRADA E |
2374 | 2376 | INNER JOIN ENTRADAPATRIMONIO EP ON (EP.ID = E.ID) |
2375 | 2377 | INNER JOIN ENTRADAPATRIMONIOITEM I ON (I.ENTRADA_ID = E.ID) |
... | ... | @@ -2394,7 +2396,8 @@ BEGIN; -- #INI :: GERACAO DO HISTORICO DOS BENS PATRIMONIAIS >> HISTORICOBEMPAT |
2394 | 2396 | dominiotipohistorico_id, |
2395 | 2397 | dominiotipomotivoalteracao_id, |
2396 | 2398 | dominioclassereferencia_id, |
2397 | - idClasseReferencia | |
2399 | + idClasseReferencia, | |
2400 | + codigooperacao | |
2398 | 2401 | ) |
2399 | 2402 | SELECT |
2400 | 2403 | NEXTVAL('hibernate_sequence'), |
... | ... | @@ -2411,7 +2414,8 @@ BEGIN; -- #INI :: GERACAO DO HISTORICO DOS BENS PATRIMONIAIS >> HISTORICOBEMPAT |
2411 | 2414 | hist_entrada, |
2412 | 2415 | mot_contabilizacao, |
2413 | 2416 | classeId, |
2414 | - E.ID | |
2417 | + E.ID, | |
2418 | + E.CODIGO | |
2415 | 2419 | FROM ENTRADA E |
2416 | 2420 | INNER JOIN ENTRADAPATRIMONIOITEM I ON (I.ENTRADA_ID = E.ID) |
2417 | 2421 | INNER JOIN BEMPATRIMONIAL B ON (B.ENTRADAITEM_ID = I.ID) |
... | ... | @@ -2435,7 +2439,8 @@ BEGIN; -- #INI :: GERACAO DO HISTORICO DOS BENS PATRIMONIAIS >> HISTORICOBEMPAT |
2435 | 2439 | dominiotipohistorico_id, |
2436 | 2440 | dominiotipomotivoalteracao_id, |
2437 | 2441 | dominioclassereferencia_id, |
2438 | - idClasseReferencia | |
2442 | + idClasseReferencia, | |
2443 | + codigooperacao | |
2439 | 2444 | ) |
2440 | 2445 | SELECT |
2441 | 2446 | NEXTVAL('hibernate_sequence'), |
... | ... | @@ -2452,7 +2457,8 @@ BEGIN; -- #INI :: GERACAO DO HISTORICO DOS BENS PATRIMONIAIS >> HISTORICOBEMPAT |
2452 | 2457 | hist_baixa, |
2453 | 2458 | mot_baixa, |
2454 | 2459 | classeId, |
2455 | - B.ID | |
2460 | + B.ID, | |
2461 | + BP.CODIGO | |
2456 | 2462 | FROM BAIXA B |
2457 | 2463 | INNER JOIN BAIXAPATRIMONIO BP ON (BP.ID = B.ID) |
2458 | 2464 | INNER JOIN BAIXAPATRIMONIOITEM I ON (I.BAIXA_ID = BP.ID) |
... | ... | @@ -2476,7 +2482,8 @@ BEGIN; -- #INI :: GERACAO DO HISTORICO DOS BENS PATRIMONIAIS >> HISTORICOBEMPAT |
2476 | 2482 | dominiotipohistorico_id, |
2477 | 2483 | dominiotipomotivoalteracao_id, |
2478 | 2484 | dominioclassereferencia_id, |
2479 | - idClasseReferencia | |
2485 | + idClasseReferencia, | |
2486 | + codigooperacao | |
2480 | 2487 | ) |
2481 | 2488 | select |
2482 | 2489 | NEXTVAL('hibernate_sequence'), |
... | ... | @@ -2494,7 +2501,8 @@ BEGIN; -- #INI :: GERACAO DO HISTORICO DOS BENS PATRIMONIAIS >> HISTORICOBEMPAT |
2494 | 2501 | hist_transf_interna, |
2495 | 2502 | mot_transf_interna, |
2496 | 2503 | classeId, |
2497 | - t.id | |
2504 | + t.id, | |
2505 | + t.codigo | |
2498 | 2506 | from transferencia t |
2499 | 2507 | inner join transferenciaitem i on (i.transferencia_id = t.id) |
2500 | 2508 | inner join estruturaorganizacional ed on (ed.id = t.unidadedestino_id) |
... | ... | @@ -2517,7 +2525,8 @@ BEGIN; -- #INI :: GERACAO DO HISTORICO DOS BENS PATRIMONIAIS >> HISTORICOBEMPAT |
2517 | 2525 | dominiotipohistorico_id, |
2518 | 2526 | dominiotipomotivoalteracao_id, |
2519 | 2527 | dominioclassereferencia_id, |
2520 | - idClasseReferencia | |
2528 | + idClasseReferencia, | |
2529 | + codigooperacao | |
2521 | 2530 | ) |
2522 | 2531 | select |
2523 | 2532 | NEXTVAL('hibernate_sequence'), |
... | ... | @@ -2534,7 +2543,8 @@ BEGIN; -- #INI :: GERACAO DO HISTORICO DOS BENS PATRIMONIAIS >> HISTORICOBEMPAT |
2534 | 2543 | hist_atribuir_detentor, |
2535 | 2544 | mot_definicao_detentor, |
2536 | 2545 | classeId, |
2537 | - d.id | |
2546 | + d.id, | |
2547 | + d.codigo | |
2538 | 2548 | from definicaodetentor d |
2539 | 2549 | inner join definicaodetentoritem di on (di.definicaodetentor_id = d.id) |
2540 | 2550 | inner join parceiro par on (par.id = d.colaborador_id) |
... | ... | @@ -2557,7 +2567,8 @@ BEGIN; -- #INI :: GERACAO DO HISTORICO DOS BENS PATRIMONIAIS >> HISTORICOBEMPAT |
2557 | 2567 | dominiotipohistorico_id, |
2558 | 2568 | dominiotipomotivoalteracao_id, |
2559 | 2569 | dominioclassereferencia_id, |
2560 | - idClasseReferencia | |
2570 | + idClasseReferencia, | |
2571 | + codigooperacao | |
2561 | 2572 | ) |
2562 | 2573 | select |
2563 | 2574 | NEXTVAL('hibernate_sequence'), |
... | ... | @@ -2574,7 +2585,8 @@ BEGIN; -- #INI :: GERACAO DO HISTORICO DOS BENS PATRIMONIAIS >> HISTORICOBEMPAT |
2574 | 2585 | hist_alteracao as tipo_historico, |
2575 | 2586 | mot_saida_temporaria as motivo_historico, |
2576 | 2587 | classeId, |
2577 | - s.id | |
2588 | + s.id, | |
2589 | + s.codigo | |
2578 | 2590 | from saidatemporaria s |
2579 | 2591 | inner join saidatemporariaitem si on (si.saidatemporaria_id = s.id) |
2580 | 2592 | inner join bempatrimonial bem on (bem.id = si.bempatrimonial_id) |
... | ... | @@ -2595,7 +2607,8 @@ BEGIN; -- #INI :: GERACAO DO HISTORICO DOS BENS PATRIMONIAIS >> HISTORICOBEMPAT |
2595 | 2607 | dominiotipohistorico_id, |
2596 | 2608 | dominiotipomotivoalteracao_id, |
2597 | 2609 | dominioclassereferencia_id, |
2598 | - idClasseReferencia | |
2610 | + idClasseReferencia, | |
2611 | + codigooperacao | |
2599 | 2612 | ) |
2600 | 2613 | select |
2601 | 2614 | NEXTVAL('hibernate_sequence'), |
... | ... | @@ -2612,7 +2625,8 @@ BEGIN; -- #INI :: GERACAO DO HISTORICO DOS BENS PATRIMONIAIS >> HISTORICOBEMPAT |
2612 | 2625 | hist_alteracao as tipo_historico, |
2613 | 2626 | mot_retorno_saida as motivo_historico, |
2614 | 2627 | classeId, |
2615 | - s.id | |
2628 | + s.id, | |
2629 | + s.codigo | |
2616 | 2630 | from saidatemporaria s |
2617 | 2631 | inner join saidatemporariaitem si on (si.saidatemporaria_id = s.id) |
2618 | 2632 | inner join bempatrimonial bem on (bem.id = si.bempatrimonial_id) |
... | ... | @@ -2708,6 +2722,7 @@ BEGIN; -- #INI :: GERACAO DO HISTORICO DOS BENS PATRIMONIAIS >> HISTORICOBEMPAT |
2708 | 2722 | --Maquina Ju 1,85 min |
2709 | 2723 | COMMIT; -- #FIM :: GERACAO DO HISTORICO DOS BENS PATRIMONIAIS >> HISTORICOBEMPATRIMONIAL |
2710 | 2724 | |
2725 | + | |
2711 | 2726 | --===========================================================================-- |
2712 | 2727 | -- ##FIM :: IMPORTACAO TABELAS DE MOVIMENTO DE MATERIAS PERMANENTES -- |
2713 | 2728 | --===========================================================================-- |
2714 | 2729 | \ No newline at end of file | ... | ... |