Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Started GET "/api/v1/declarations" for ::1 at 2024-02-02 11:07:20 +0200
- -- Processing by Api::V1::DeclarationsController#index as HTML
- SELECT "dbo"."LegalEntities".* FROM "dbo"."LegalEntities" WHERE "dbo"."LegalEntities"."Id" = $1 LIMIT $2 [["Id", 3228], ["LIMIT", 1]]
- SELECT mv_stat_employees_parties."Id",
- mv_stat_employees_parties. "FullName",
- mv_stat_employees_parties."PositionRefId",
- COUNT(mv_stat_declarations.id) AS total_counter,
- COUNT(mv_stat_declarations.id) filter (WHERE extract(year FROM age(cast(mv_stat_declarations."birth_date" AS DATE))) <= 5) AS age_0_5_counter,
- COUNT(mv_stat_declarations.id) filter (WHERE extract(year FROM age(cast(mv_stat_declarations."birth_date" AS DATE))) BETWEEN 6 AND 17) AS age_6_17_counter,
- COUNT(mv_stat_declarations.id) filter (WHERE extract(year FROM age(cast(mv_stat_declarations."birth_date" AS DATE))) BETWEEN 18 AND 39) AS age_18_39_counter,
- COUNT(mv_stat_declarations.id) filter (WHERE extract(year FROM age(cast(mv_stat_declarations."birth_date" AS DATE))) BETWEEN 40 AND 64) AS age_40_64_counter,
- COUNT(mv_stat_declarations.id) filter (WHERE extract(year FROM age(cast(mv_stat_declarations."birth_date" AS DATE))) >= 65) AS age_65_final_counter FROM "mv_stat_employees_parties" LEFT OUTER JOIN "mv_stat_declarations" ON "mv_stat_declarations"."declaration_status_code" = $1 AND "mv_stat_declarations"."employee_id" = "mv_stat_employees_parties"."Id" WHERE ("mv_stat_employees_parties"."LegalEntityId" = 3228) AND ("mv_stat_employees_parties"."EmployeeTypeRefValue" = 'DOCTOR') AND ("mv_stat_employees_parties"."EmployeeStatusRefValue" = 'APPROVED') GROUP BY "Id", "FullName", "PositionRefId" [["declaration_status_code", "ACTIVE"]]
- SELECT "dbo"."PositionRefs".* FROM "dbo"."PositionRefs" WHERE "dbo"."PositionRefs"."Id" = $1 [["Id", 3]]
- SELECT COUNT(DISTINCT mv_stat_employees_parties."Id") AS total_employee_counter,
- COUNT(DISTINCT mv_stat_employees_parties."Id") filter ( WHERE mv_stat_employees_parties."PositionRefValue" = 'P7' ) AS p7_position_counter,
- COUNT(DISTINCT mv_stat_employees_parties."Id") filter ( WHERE mv_stat_employees_parties."PositionRefValue" = 'P8' ) AS p8_position_counter,
- COUNT(DISTINCT mv_stat_employees_parties."Id") filter ( WHERE mv_stat_employees_parties."PositionRefValue" = 'P9' ) AS p9_position_counter,
- COUNT(DISTINCT mv_stat_employees_parties."Id") filter ( WHERE mv_stat_employees_parties."PositionRefValue" = 'P10' ) AS p10_position_counter,
- COUNT(DISTINCT mv_stat_employees_parties."Id") filter ( WHERE mv_stat_employees_parties."PositionRefValue" = 'P11' ) AS p11_position_counter,
- COUNT(DISTINCT mv_stat_declarations.id) AS total_counter,
- COUNT(DISTINCT mv_stat_declarations.id) filter (WHERE extract(year FROM age(cast(mv_stat_declarations."birth_date" AS DATE))) <= 5) AS age_0_5_counter,
- COUNT(DISTINCT mv_stat_declarations.id) filter (WHERE extract(year FROM age(cast(mv_stat_declarations."birth_date" AS DATE))) BETWEEN 6 AND 17) AS age_6_17_counter,
- COUNT(DISTINCT mv_stat_declarations.id) filter (WHERE extract(year FROM age(cast(mv_stat_declarations."birth_date" AS DATE))) BETWEEN 18 AND 39) AS age_18_39_counter,
- COUNT(DISTINCT mv_stat_declarations.id) filter (WHERE extract(year FROM age(cast(mv_stat_declarations."birth_date" AS DATE))) BETWEEN 40 AND 64) AS age_40_64_counter,
- COUNT(DISTINCT mv_stat_declarations.id) filter (WHERE extract(year FROM age(cast(mv_stat_declarations."birth_date" AS DATE))) >= 65) AS age_65_final_counter FROM "mv_stat_employees_parties" LEFT OUTER JOIN "mv_stat_declarations" ON "mv_stat_declarations"."declaration_status_code" = $1 AND "mv_stat_declarations"."employee_id" = "mv_stat_employees_parties"."Id" WHERE ("mv_stat_employees_parties"."LegalEntityId" = 3228) AND ("mv_stat_employees_parties"."EmployeeTypeRefValue" = 'DOCTOR') AND ("mv_stat_employees_parties"."EmployeeStatusRefValue" = 'APPROVED') GROUP BY "LegalEntityId" LIMIT $2 [["declaration_status_code", "ACTIVE"], ["LIMIT", 1]]
- SELECT mv_stat_employees_parties."Id",
- mv_stat_employees_parties. "FullName",
- mv_stat_employees_parties."PositionRefId",
- COUNT(mv_stat_declarations.id) AS total_counter,
- COUNT(mv_stat_declarations.id) filter (WHERE extract(year FROM age(cast(mv_stat_declarations."birth_date" AS DATE))) <= 5) AS age_0_5_counter,
- COUNT(mv_stat_declarations.id) filter (WHERE extract(year FROM age(cast(mv_stat_declarations."birth_date" AS DATE))) BETWEEN 6 AND 17) AS age_6_17_counter,
- COUNT(mv_stat_declarations.id) filter (WHERE extract(year FROM age(cast(mv_stat_declarations."birth_date" AS DATE))) BETWEEN 18 AND 39) AS age_18_39_counter,
- COUNT(mv_stat_declarations.id) filter (WHERE extract(year FROM age(cast(mv_stat_declarations."birth_date" AS DATE))) BETWEEN 40 AND 64) AS age_40_64_counter,
- COUNT(mv_stat_declarations.id) filter (WHERE extract(year FROM age(cast(mv_stat_declarations."birth_date" AS DATE))) >= 65) AS age_65_final_counter FROM "mv_stat_employees_parties" LEFT OUTER JOIN "mv_stat_declarations" ON "mv_stat_declarations"."declaration_status_code" = $1 AND "mv_stat_declarations"."employee_id" = "mv_stat_employees_parties"."Id" WHERE ("mv_stat_employees_parties"."LegalEntityId" = 3228) AND ("mv_stat_employees_parties"."EmployeeTypeRefValue" = 'DOCTOR') AND ("mv_stat_employees_parties"."EmployeeStatusRefValue" = 'APPROVED') GROUP BY "Id", "FullName", "PositionRefId" LIMIT $2 OFFSET $3 [["declaration_status_code", "ACTIVE"], ["LIMIT", 15], ["OFFSET", 0]]
- SELECT "dbo"."PositionRefs".* FROM "dbo"."PositionRefs" WHERE "dbo"."PositionRefs"."Id" = $1 [["Id", 3]]
- SELECT COUNT(DISTINCT mv_stat_employees_parties."Id") AS total_employee_counter,
- COUNT(DISTINCT mv_stat_employees_parties."Id") filter ( WHERE mv_stat_employees_parties."PositionRefValue" = 'P7' ) AS p7_position_counter,
- COUNT(DISTINCT mv_stat_employees_parties."Id") filter ( WHERE mv_stat_employees_parties."PositionRefValue" = 'P8' ) AS p8_position_counter,
- COUNT(DISTINCT mv_stat_employees_parties."Id") filter ( WHERE mv_stat_employees_parties."PositionRefValue" = 'P9' ) AS p9_position_counter,
- COUNT(DISTINCT mv_stat_employees_parties."Id") filter ( WHERE mv_stat_employees_parties."PositionRefValue" = 'P10' ) AS p10_position_counter,
- COUNT(DISTINCT mv_stat_employees_parties."Id") filter ( WHERE mv_stat_employees_parties."PositionRefValue" = 'P11' ) AS p11_position_counter,
- COUNT(DISTINCT mv_stat_declarations.id) AS total_counter,
- COUNT(DISTINCT mv_stat_declarations.id) filter (WHERE extract(year FROM age(cast(mv_stat_declarations."birth_date" AS DATE))) <= 5) AS age_0_5_counter,
- COUNT(DISTINCT mv_stat_declarations.id) filter (WHERE extract(year FROM age(cast(mv_stat_declarations."birth_date" AS DATE))) BETWEEN 6 AND 17) AS age_6_17_counter,
- COUNT(DISTINCT mv_stat_declarations.id) filter (WHERE extract(year FROM age(cast(mv_stat_declarations."birth_date" AS DATE))) BETWEEN 18 AND 39) AS age_18_39_counter,
- COUNT(DISTINCT mv_stat_declarations.id) filter (WHERE extract(year FROM age(cast(mv_stat_declarations."birth_date" AS DATE))) BETWEEN 40 AND 64) AS age_40_64_counter,
- COUNT(DISTINCT mv_stat_declarations.id) filter (WHERE extract(year FROM age(cast(mv_stat_declarations."birth_date" AS DATE))) >= 65) AS age_65_final_counter FROM "mv_stat_employees_parties" LEFT OUTER JOIN "mv_stat_declarations" ON "mv_stat_declarations"."declaration_status_code" = $1 AND "mv_stat_declarations"."employee_id" = "mv_stat_employees_parties"."Id" WHERE ("mv_stat_employees_parties"."LegalEntityId" = 3228) AND ("mv_stat_employees_parties"."EmployeeTypeRefValue" = 'DOCTOR') AND ("mv_stat_employees_parties"."EmployeeStatusRefValue" = 'APPROVED') GROUP BY "LegalEntityId" [["declaration_status_code", "ACTIVE"]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement