Правки по блокам Присвоение идентификатора + сеты для добавления колонки и пересчета вью

This commit is contained in:
Foat Saliakhov 2025-11-19 15:32:50 +03:00
parent 7c0afdaf05
commit 2a69a134f4
7 changed files with 2713 additions and 1827 deletions

View file

@ -107,6 +107,13 @@ public class RecordsInfoIdUkIdErn extends TableImpl<RecordsInfoIdUkIdErnRecord>
*/ */
public final TableField<RecordsInfoIdUkIdErnRecord, Long> RECORDS_WITHOUT_ID_UK = createField(DSL.name("records_without_id_uk"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, ""); public final TableField<RecordsInfoIdUkIdErnRecord, Long> RECORDS_WITHOUT_ID_UK = createField(DSL.name("records_without_id_uk"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("0"), SQLDataType.BIGINT)), this, "");
/**
* The column
* <code>init_registration_info.records_info_id_uk_id_ern.records_load</code>.
* Количество выгуженных записей присвоения ИДУК
*/
public final TableField<RecordsInfoIdUkIdErnRecord, Integer> RECORDS_LOAD = createField(DSL.name("records_load"), SQLDataType.INTEGER.defaultValue(DSL.field(DSL.raw("0"), SQLDataType.INTEGER)), this, "Количество выгуженных записей присвоения ИДУК");
private RecordsInfoIdUkIdErn(Name alias, Table<RecordsInfoIdUkIdErnRecord> aliased) { private RecordsInfoIdUkIdErn(Name alias, Table<RecordsInfoIdUkIdErnRecord> aliased) {
this(alias, aliased, (Field<?>[]) null, null); this(alias, aliased, (Field<?>[]) null, null);
} }

View file

@ -73,6 +73,12 @@ public class ViewRecordsInfoIdUkIdErn extends TableImpl<ViewRecordsInfoIdUkIdErn
*/ */
public final TableField<ViewRecordsInfoIdUkIdErnRecord, BigDecimal> PERCENT_WITHOUT_ID_UK = createField(DSL.name("percent_without_id_uk"), SQLDataType.NUMERIC, this, ""); public final TableField<ViewRecordsInfoIdUkIdErnRecord, BigDecimal> PERCENT_WITHOUT_ID_UK = createField(DSL.name("percent_without_id_uk"), SQLDataType.NUMERIC, this, "");
/**
* The column
* <code>init_registration_info.view_records_info_id_uk_id_ern.percent_records_load</code>.
*/
public final TableField<ViewRecordsInfoIdUkIdErnRecord, BigDecimal> PERCENT_RECORDS_LOAD = createField(DSL.name("percent_records_load"), SQLDataType.NUMERIC, this, "");
private ViewRecordsInfoIdUkIdErn(Name alias, Table<ViewRecordsInfoIdUkIdErnRecord> aliased) { private ViewRecordsInfoIdUkIdErn(Name alias, Table<ViewRecordsInfoIdUkIdErnRecord> aliased) {
this(alias, aliased, (Field<?>[]) null, null); this(alias, aliased, (Field<?>[]) null, null);
} }
@ -82,7 +88,8 @@ public class ViewRecordsInfoIdUkIdErn extends TableImpl<ViewRecordsInfoIdUkIdErn
create view "view_records_info_id_uk_id_ern" as SELECT records_info_id_uk_id_ern.records_info_id_uk_id_ern_id, create view "view_records_info_id_uk_id_ern" as SELECT records_info_id_uk_id_ern.records_info_id_uk_id_ern_id,
(records_info_id_uk_id_ern.records_with_id_uk + records_info_id_uk_id_ern.records_without_id_uk) AS count_all, (records_info_id_uk_id_ern.records_with_id_uk + records_info_id_uk_id_ern.records_without_id_uk) AS count_all,
COALESCE(round((((records_info_id_uk_id_ern.records_with_id_uk)::numeric * (100)::numeric) / NULLIF(((records_info_id_uk_id_ern.records_with_id_uk + records_info_id_uk_id_ern.records_without_id_uk))::numeric, (0)::numeric))), (0)::numeric) AS percent_with_id_uk, COALESCE(round((((records_info_id_uk_id_ern.records_with_id_uk)::numeric * (100)::numeric) / NULLIF(((records_info_id_uk_id_ern.records_with_id_uk + records_info_id_uk_id_ern.records_without_id_uk))::numeric, (0)::numeric))), (0)::numeric) AS percent_with_id_uk,
COALESCE(round((((records_info_id_uk_id_ern.records_without_id_uk)::numeric * (100)::numeric) / NULLIF(((records_info_id_uk_id_ern.records_with_id_uk + records_info_id_uk_id_ern.records_without_id_uk))::numeric, (0)::numeric))), (0)::numeric) AS percent_without_id_uk COALESCE(round((((records_info_id_uk_id_ern.records_without_id_uk)::numeric * (100)::numeric) / NULLIF(((records_info_id_uk_id_ern.records_with_id_uk + records_info_id_uk_id_ern.records_without_id_uk))::numeric, (0)::numeric))), (0)::numeric) AS percent_without_id_uk,
COALESCE(round((((records_info_id_uk_id_ern.records_load)::numeric * (100)::numeric) / NULLIF(((records_info_id_uk_id_ern.records_with_id_uk + records_info_id_uk_id_ern.records_without_id_uk))::numeric, (0)::numeric))), (0)::numeric) AS percent_records_load
FROM init_registration_info.records_info_id_uk_id_ern; FROM init_registration_info.records_info_id_uk_id_ern;
"""), where); """), where);
} }

View file

@ -153,6 +153,24 @@ public class RecordsInfoIdUkIdErnRecord extends UpdatableRecordImpl<RecordsInfoI
return (Long) get(7); return (Long) get(7);
} }
/**
* Setter for
* <code>init_registration_info.records_info_id_uk_id_ern.records_load</code>.
* Количество выгуженных записей присвоения ИДУК
*/
public void setRecordsLoad(Integer value) {
set(8, value);
}
/**
* Getter for
* <code>init_registration_info.records_info_id_uk_id_ern.records_load</code>.
* Количество выгуженных записей присвоения ИДУК
*/
public Integer getRecordsLoad() {
return (Integer) get(8);
}
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
// Primary key information // Primary key information
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
@ -176,7 +194,7 @@ public class RecordsInfoIdUkIdErnRecord extends UpdatableRecordImpl<RecordsInfoI
/** /**
* Create a detached, initialised RecordsInfoIdUkIdErnRecord * Create a detached, initialised RecordsInfoIdUkIdErnRecord
*/ */
public RecordsInfoIdUkIdErnRecord(Long recordsInfoIdUkIdErnId, String recruitmentId, Timestamp updateDate, Date infoDate, String infoSource, String infoAge, Long recordsWithIdUk, Long recordsWithoutIdUk) { public RecordsInfoIdUkIdErnRecord(Long recordsInfoIdUkIdErnId, String recruitmentId, Timestamp updateDate, Date infoDate, String infoSource, String infoAge, Long recordsWithIdUk, Long recordsWithoutIdUk, Integer recordsLoad) {
super(RecordsInfoIdUkIdErn.RECORDS_INFO_ID_UK_ID_ERN); super(RecordsInfoIdUkIdErn.RECORDS_INFO_ID_UK_ID_ERN);
setRecordsInfoIdUkIdErnId(recordsInfoIdUkIdErnId); setRecordsInfoIdUkIdErnId(recordsInfoIdUkIdErnId);
@ -187,6 +205,7 @@ public class RecordsInfoIdUkIdErnRecord extends UpdatableRecordImpl<RecordsInfoI
setInfoAge(infoAge); setInfoAge(infoAge);
setRecordsWithIdUk(recordsWithIdUk); setRecordsWithIdUk(recordsWithIdUk);
setRecordsWithoutIdUk(recordsWithoutIdUk); setRecordsWithoutIdUk(recordsWithoutIdUk);
setRecordsLoad(recordsLoad);
resetChangedOnNotNull(); resetChangedOnNotNull();
} }
} }

View file

@ -83,6 +83,22 @@ public class ViewRecordsInfoIdUkIdErnRecord extends TableRecordImpl<ViewRecordsI
return (BigDecimal) get(3); return (BigDecimal) get(3);
} }
/**
* Setter for
* <code>init_registration_info.view_records_info_id_uk_id_ern.percent_records_load</code>.
*/
public void setPercentRecordsLoad(BigDecimal value) {
set(4, value);
}
/**
* Getter for
* <code>init_registration_info.view_records_info_id_uk_id_ern.percent_records_load</code>.
*/
public BigDecimal getPercentRecordsLoad() {
return (BigDecimal) get(4);
}
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
// Constructors // Constructors
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
@ -97,13 +113,14 @@ public class ViewRecordsInfoIdUkIdErnRecord extends TableRecordImpl<ViewRecordsI
/** /**
* Create a detached, initialised ViewRecordsInfoIdUkIdErnRecord * Create a detached, initialised ViewRecordsInfoIdUkIdErnRecord
*/ */
public ViewRecordsInfoIdUkIdErnRecord(Long recordsInfoIdUkIdErnId, Long countAll, BigDecimal percentWithIdUk, BigDecimal percentWithoutIdUk) { public ViewRecordsInfoIdUkIdErnRecord(Long recordsInfoIdUkIdErnId, Long countAll, BigDecimal percentWithIdUk, BigDecimal percentWithoutIdUk, BigDecimal percentRecordsLoad) {
super(ViewRecordsInfoIdUkIdErn.VIEW_RECORDS_INFO_ID_UK_ID_ERN); super(ViewRecordsInfoIdUkIdErn.VIEW_RECORDS_INFO_ID_UK_ID_ERN);
setRecordsInfoIdUkIdErnId(recordsInfoIdUkIdErnId); setRecordsInfoIdUkIdErnId(recordsInfoIdUkIdErnId);
setCountAll(countAll); setCountAll(countAll);
setPercentWithIdUk(percentWithIdUk); setPercentWithIdUk(percentWithIdUk);
setPercentWithoutIdUk(percentWithoutIdUk); setPercentWithoutIdUk(percentWithoutIdUk);
setPercentRecordsLoad(percentRecordsLoad);
resetChangedOnNotNull(); resetChangedOnNotNull();
} }
} }

View file

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog/1.9"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog/1.9
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-1.9.xsd">
<changeSet id="0001" author="saliakhov">
<comment>ALTER TABLE init_registration_info.records_info_id_uk_id_ern</comment>
<sql>
ALTER TABLE IF EXISTS init_registration_info.records_info_id_uk_id_ern
ADD COLUMN IF NOT EXISTS records_load INT DEFAULT 0;
COMMENT ON COLUMN init_registration_info.records_info_id_uk_id_ern.records_load
IS 'Количество выгуженных записей присвоения ИДУК';
</sql>
</changeSet>
<changeSet id="0002" author="saliakhov">
<comment>CREATE VIEW</comment>
<sql>
DROP VIEW init_registration_info.view_records_info_id_uk_id_ern;
CREATE OR REPLACE VIEW init_registration_info.view_records_info_id_uk_id_ern
AS SELECT records_info_id_uk_id_ern.records_info_id_uk_id_ern_id,
records_info_id_uk_id_ern.records_with_id_uk + records_info_id_uk_id_ern.records_without_id_uk AS count_all,
COALESCE(round(records_info_id_uk_id_ern.records_with_id_uk::numeric * 100::numeric / NULLIF((records_info_id_uk_id_ern.records_with_id_uk + records_info_id_uk_id_ern.records_without_id_uk)::numeric, 0::numeric)), 0::numeric) AS percent_with_id_uk,
COALESCE(round(records_info_id_uk_id_ern.records_without_id_uk::numeric * 100::numeric / NULLIF((records_info_id_uk_id_ern.records_with_id_uk + records_info_id_uk_id_ern.records_without_id_uk)::numeric, 0::numeric)), 0::numeric) AS percent_without_id_uk,
COALESCE(round(records_info_id_uk_id_ern.records_load::numeric * 100::numeric / NULLIF((records_info_id_uk_id_ern.records_with_id_uk + records_info_id_uk_id_ern.records_without_id_uk)::numeric, 0::numeric)), 0::numeric) AS percent_records_load
FROM init_registration_info.records_info_id_uk_id_ern;
ALTER TABLE init_registration_info.view_records_info_id_uk_id_ern OWNER TO ervu_business_metrics;
</sql>
</changeSet>
</databaseChangeLog>

View file

@ -41,4 +41,5 @@
<include file="20250821-last_recording_date.xml" relativeToChangelogFile="true"/> <include file="20250821-last_recording_date.xml" relativeToChangelogFile="true"/>
<include file="20251111-create_tables_for_summons_list.xml" relativeToChangelogFile="true"/> <include file="20251111-create_tables_for_summons_list.xml" relativeToChangelogFile="true"/>
<include file="20251114-view.xml" relativeToChangelogFile="true"/> <include file="20251114-view.xml" relativeToChangelogFile="true"/>
<include file="20251119-db_changes.xml" relativeToChangelogFile="true"/>
</databaseChangeLog> </databaseChangeLog>

File diff suppressed because one or more lines are too long