change nominatim original function

This commit is contained in:
2024-02-19 10:15:00 +00:00
parent 8176faf117
commit 1074a2dc79
88 changed files with 2334847 additions and 27475 deletions

View File

@@ -74,10 +74,10 @@ class CompareProgramAndFunction implements FromView, ShouldAutoSize, WithEvents,
WHEN operation_type_id3 = 101 THEN operation_type_amount3
WHEN operation_type_id4 = 101 THEN operation_type_amount4
END)) AS AsphaltGarmDoing,
ROUND(SUM(CASE WHEN operation_type_id1 = 101 THEN (cast(operation_type_amount1 as int) * cast(operation_type_progress1 as int))/100
WHEN operation_type_id2 = 101 THEN (cast(operation_type_amount2 as int) * cast(operation_type_progress2 as int))/100
WHEN operation_type_id3 = 101 THEN (cast(operation_type_amount3 as int) * cast(operation_type_progress3 as int))/100
WHEN operation_type_id4 = 101 THEN (cast(operation_type_amount4 as int) * cast(operation_type_progress4 as int))/100
ROUND(SUM(CASE WHEN operation_type_id1 = 101 THEN (CAST(operation_type_amount1 AS signed) * CAST(operation_type_progress1 AS signed))/100
WHEN operation_type_id2 = 101 THEN (CAST(operation_type_amount2 AS signed) * CAST(operation_type_progress2 AS signed))/100
WHEN operation_type_id3 = 101 THEN (CAST(operation_type_amount3 AS signed) * CAST(operation_type_progress3 AS signed))/100
WHEN operation_type_id4 = 101 THEN (CAST(operation_type_amount4 AS signed) * CAST(operation_type_progress4 AS signed))/100
END)) AS AsphaltGarmDone,
ROUND(SUM(CASE WHEN operation_type_id1 = 102 THEN operation_type_amount1
@@ -85,10 +85,10 @@ class CompareProgramAndFunction implements FromView, ShouldAutoSize, WithEvents,
WHEN operation_type_id3 = 102 THEN operation_type_amount3
WHEN operation_type_id4 = 102 THEN operation_type_amount4
END)) AS MaseAsphaltDoing,
ROUND(SUM(CASE WHEN operation_type_id1 = 102 THEN (cast(operation_type_amount1 as int) * cast(operation_type_progress1 as int))/100
WHEN operation_type_id2 = 102 THEN (cast(operation_type_amount2 as int) * cast(operation_type_progress2 as int))/100
WHEN operation_type_id3 = 102 THEN (cast(operation_type_amount3 as int) * cast(operation_type_progress3 as int))/100
WHEN operation_type_id4 = 102 THEN (cast(operation_type_amount4 as int) * cast(operation_type_progress4 as int))/100
ROUND(SUM(CASE WHEN operation_type_id1 = 102 THEN (CAST(operation_type_amount1 AS signed) * CAST(operation_type_progress1 AS signed))/100
WHEN operation_type_id2 = 102 THEN (CAST(operation_type_amount2 AS signed) * CAST(operation_type_progress2 AS signed))/100
WHEN operation_type_id3 = 102 THEN (CAST(operation_type_amount3 AS signed) * CAST(operation_type_progress3 AS signed))/100
WHEN operation_type_id4 = 102 THEN (CAST(operation_type_amount4 AS signed) * CAST(operation_type_progress4 AS signed))/100
END)) AS MaseAsphaltDone,
ROUND(SUM(CASE WHEN operation_type_id1 = 103 THEN operation_type_amount1
@@ -96,10 +96,10 @@ class CompareProgramAndFunction implements FromView, ShouldAutoSize, WithEvents,
WHEN operation_type_id3 = 103 THEN operation_type_amount3
WHEN operation_type_id4 = 103 THEN operation_type_amount4
END)) AS BazyaftSardGarmDoing,
ROUND(SUM(CASE WHEN operation_type_id1 = 103 THEN (cast(operation_type_amount1 as int) * cast(operation_type_progress1 as int))/100
WHEN operation_type_id2 = 103 THEN (cast(operation_type_amount2 as int) * cast(operation_type_progress2 as int))/100
WHEN operation_type_id3 = 103 THEN (cast(operation_type_amount3 as int) * cast(operation_type_progress3 as int))/100
WHEN operation_type_id4 = 103 THEN (cast(operation_type_amount4 as int) * cast(operation_type_progress4 as int))/100
ROUND(SUM(CASE WHEN operation_type_id1 = 103 THEN (CAST(operation_type_amount1 AS signed) * CAST(operation_type_progress1 AS signed))/100
WHEN operation_type_id2 = 103 THEN (CAST(operation_type_amount2 AS signed) * CAST(operation_type_progress2 AS signed))/100
WHEN operation_type_id3 = 103 THEN (CAST(operation_type_amount3 AS signed) * CAST(operation_type_progress3 AS signed))/100
WHEN operation_type_id4 = 103 THEN (CAST(operation_type_amount4 AS signed) * CAST(operation_type_progress4 AS signed))/100
END)) AS BazyaftSardGarmDone,
ROUND(SUM(CASE WHEN operation_type_id1 = 104 THEN operation_type_amount1
@@ -107,10 +107,10 @@ class CompareProgramAndFunction implements FromView, ShouldAutoSize, WithEvents,
WHEN operation_type_id3 = 104 THEN operation_type_amount3
WHEN operation_type_id4 = 104 THEN operation_type_amount4
END)) AS mirosurfacingDoing,
ROUND(SUM(CASE WHEN operation_type_id1 = 104 THEN (cast(operation_type_amount1 as int) * cast(operation_type_progress1 as int))/100
WHEN operation_type_id2 = 104 THEN (cast(operation_type_amount2 as int) * cast(operation_type_progress2 as int))/100
WHEN operation_type_id3 = 104 THEN (cast(operation_type_amount3 as int) * cast(operation_type_progress3 as int))/100
WHEN operation_type_id4 = 104 THEN (cast(operation_type_amount4 as int) * cast(operation_type_progress4 as int))/100
ROUND(SUM(CASE WHEN operation_type_id1 = 104 THEN (CAST(operation_type_amount1 AS signed) * CAST(operation_type_progress1 AS signed))/100
WHEN operation_type_id2 = 104 THEN (CAST(operation_type_amount2 AS signed) * CAST(operation_type_progress2 AS signed))/100
WHEN operation_type_id3 = 104 THEN (CAST(operation_type_amount3 AS signed) * CAST(operation_type_progress3 AS signed))/100
WHEN operation_type_id4 = 104 THEN (CAST(operation_type_amount4 AS signed) * CAST(operation_type_progress4 AS signed))/100
END)) AS mirosurfacingDone,
ROUND(SUM(CASE WHEN operation_type_id1 = 105 THEN operation_type_amount1
@@ -118,10 +118,10 @@ class CompareProgramAndFunction implements FromView, ShouldAutoSize, WithEvents,
WHEN operation_type_id3 = 105 THEN operation_type_amount3
WHEN operation_type_id4 = 105 THEN operation_type_amount4
END)) AS ChipSailDoing,
ROUND(SUM(CASE WHEN operation_type_id1 = 105 THEN (cast(operation_type_amount1 as int) * cast(operation_type_progress1 as int))/100
WHEN operation_type_id2 = 105 THEN (cast(operation_type_amount2 as int) * cast(operation_type_progress2 as int))/100
WHEN operation_type_id3 = 105 THEN (cast(operation_type_amount3 as int) * cast(operation_type_progress3 as int))/100
WHEN operation_type_id4 = 105 THEN (cast(operation_type_amount4 as int) * cast(operation_type_progress4 as int))/100
ROUND(SUM(CASE WHEN operation_type_id1 = 105 THEN (CAST(operation_type_amount1 AS signed) * CAST(operation_type_progress1 AS signed))/100
WHEN operation_type_id2 = 105 THEN (CAST(operation_type_amount2 AS signed) * CAST(operation_type_progress2 AS signed))/100
WHEN operation_type_id3 = 105 THEN (CAST(operation_type_amount3 AS signed) * CAST(operation_type_progress3 AS signed))/100
WHEN operation_type_id4 = 105 THEN (CAST(operation_type_amount4 AS signed) * CAST(operation_type_progress4 AS signed))/100
END)) AS ChipSailDone,
ROUND(SUM(CASE WHEN operation_type_id1 = 106 THEN operation_type_amount1
@@ -129,10 +129,10 @@ class CompareProgramAndFunction implements FromView, ShouldAutoSize, WithEvents,
WHEN operation_type_id3 = 106 THEN operation_type_amount3
WHEN operation_type_id4 = 106 THEN operation_type_amount4
END)) AS SlarySaildDoing,
ROUND(SUM(CASE WHEN operation_type_id1 = 106 THEN (cast(operation_type_amount1 as int) * cast(operation_type_progress1 as int))/100
WHEN operation_type_id2 = 106 THEN (cast(operation_type_amount2 as int) * cast(operation_type_progress2 as int))/100
WHEN operation_type_id3 = 106 THEN (cast(operation_type_amount3 as int) * cast(operation_type_progress3 as int))/100
WHEN operation_type_id4 = 106 THEN (cast(operation_type_amount4 as int) * cast(operation_type_progress4 as int))/100
ROUND(SUM(CASE WHEN operation_type_id1 = 106 THEN (CAST(operation_type_amount1 AS signed) * CAST(operation_type_progress1 AS signed))/100
WHEN operation_type_id2 = 106 THEN (CAST(operation_type_amount2 AS signed) * CAST(operation_type_progress2 AS signed))/100
WHEN operation_type_id3 = 106 THEN (CAST(operation_type_amount3 AS signed) * CAST(operation_type_progress3 AS signed))/100
WHEN operation_type_id4 = 106 THEN (CAST(operation_type_amount4 AS signed) * CAST(operation_type_progress4 AS signed))/100
END)) AS SlarySaildDone,
ROUND(SUM(CASE WHEN operation_type_id1 = 107 THEN operation_type_amount1
@@ -140,10 +140,10 @@ class CompareProgramAndFunction implements FromView, ShouldAutoSize, WithEvents,
WHEN operation_type_id3 = 107 THEN operation_type_amount3
WHEN operation_type_id4 = 107 THEN operation_type_amount4
END)) AS ScrubSailDoing,
ROUND(SUM(CASE WHEN operation_type_id1 = 107 THEN (cast(operation_type_amount1 as int) * cast(operation_type_progress1 as int))/100
WHEN operation_type_id2 = 107 THEN (cast(operation_type_amount2 as int) * cast(operation_type_progress2 as int))/100
WHEN operation_type_id3 = 107 THEN (cast(operation_type_amount3 as int) * cast(operation_type_progress3 as int))/100
WHEN operation_type_id4 = 107 THEN (cast(operation_type_amount4 as int) * cast(operation_type_progress4 as int))/100
ROUND(SUM(CASE WHEN operation_type_id1 = 107 THEN (CAST(operation_type_amount1 AS signed) * CAST(operation_type_progress1 AS signed))/100
WHEN operation_type_id2 = 107 THEN (CAST(operation_type_amount2 AS signed) * CAST(operation_type_progress2 AS signed))/100
WHEN operation_type_id3 = 107 THEN (CAST(operation_type_amount3 AS signed) * CAST(operation_type_progress3 AS signed))/100
WHEN operation_type_id4 = 107 THEN (CAST(operation_type_amount4 AS signed) * CAST(operation_type_progress4 AS signed))/100
END)) AS ScrubSailDone,
ROUND(SUM(CASE WHEN operation_type_id1 = 108 THEN operation_type_amount1
@@ -151,10 +151,10 @@ class CompareProgramAndFunction implements FromView, ShouldAutoSize, WithEvents,
WHEN operation_type_id3 = 108 THEN operation_type_amount3
WHEN operation_type_id4 = 108 THEN operation_type_amount4
END)) AS FogSailDoing,
ROUND(SUM(CASE WHEN operation_type_id1 = 108 THEN (cast(operation_type_amount1 as int) * cast(operation_type_progress1 as int))/100
WHEN operation_type_id2 = 108 THEN (cast(operation_type_amount2 as int) * cast(operation_type_progress2 as int))/100
WHEN operation_type_id3 = 108 THEN (cast(operation_type_amount3 as int) * cast(operation_type_progress3 as int))/100
WHEN operation_type_id4 = 108 THEN (cast(operation_type_amount4 as int) * cast(operation_type_progress4 as int))/100
ROUND(SUM(CASE WHEN operation_type_id1 = 108 THEN (CAST(operation_type_amount1 AS signed) * CAST(operation_type_progress1 AS signed))/100
WHEN operation_type_id2 = 108 THEN (CAST(operation_type_amount2 AS signed) * CAST(operation_type_progress2 AS signed))/100
WHEN operation_type_id3 = 108 THEN (CAST(operation_type_amount3 AS signed) * CAST(operation_type_progress3 AS signed))/100
WHEN operation_type_id4 = 108 THEN (CAST(operation_type_amount4 AS signed) * CAST(operation_type_progress4 AS signed))/100
END)) AS FogSailDone,
ROUND(SUM(CASE WHEN operation_type_id1 = 109 THEN operation_type_amount1
@@ -162,10 +162,10 @@ class CompareProgramAndFunction implements FromView, ShouldAutoSize, WithEvents,
WHEN operation_type_id3 = 109 THEN operation_type_amount3
WHEN operation_type_id4 = 109 THEN operation_type_amount4
END)) AS SailKatDoing,
ROUND(SUM(CASE WHEN operation_type_id1 = 109 THEN (cast(operation_type_amount1 as int) * cast(operation_type_progress1 as int))/100
WHEN operation_type_id2 = 109 THEN (cast(operation_type_amount2 as int) * cast(operation_type_progress2 as int))/100
WHEN operation_type_id3 = 109 THEN (cast(operation_type_amount3 as int) * cast(operation_type_progress3 as int))/100
WHEN operation_type_id4 = 109 THEN (cast(operation_type_amount4 as int) * cast(operation_type_progress4 as int))/100
ROUND(SUM(CASE WHEN operation_type_id1 = 109 THEN (CAST(operation_type_amount1 AS signed) * CAST(operation_type_progress1 AS signed))/100
WHEN operation_type_id2 = 109 THEN (CAST(operation_type_amount2 AS signed) * CAST(operation_type_progress2 AS signed))/100
WHEN operation_type_id3 = 109 THEN (CAST(operation_type_amount3 AS signed) * CAST(operation_type_progress3 AS signed))/100
WHEN operation_type_id4 = 109 THEN (CAST(operation_type_amount4 AS signed) * CAST(operation_type_progress4 AS signed))/100
END)) AS SailKatDone,
ROUND(SUM(CASE WHEN operation_type_id1 = 110 THEN operation_type_amount1
@@ -173,10 +173,10 @@ class CompareProgramAndFunction implements FromView, ShouldAutoSize, WithEvents,
WHEN operation_type_id3 = 110 THEN operation_type_amount3
WHEN operation_type_id4 = 110 THEN operation_type_amount4
END)) AS KipSailDoing,
ROUND(SUM(CASE WHEN operation_type_id1 = 110 THEN (cast(operation_type_amount1 as int) * cast(operation_type_progress1 as int))/100
WHEN operation_type_id2 = 110 THEN (cast(operation_type_amount2 as int) * cast(operation_type_progress2 as int))/100
WHEN operation_type_id3 = 110 THEN (cast(operation_type_amount3 as int) * cast(operation_type_progress3 as int))/100
WHEN operation_type_id4 = 110 THEN (cast(operation_type_amount4 as int) * cast(operation_type_progress4 as int))/100
ROUND(SUM(CASE WHEN operation_type_id1 = 110 THEN (CAST(operation_type_amount1 AS signed) * CAST(operation_type_progress1 AS signed))/100
WHEN operation_type_id2 = 110 THEN (CAST(operation_type_amount2 AS signed) * CAST(operation_type_progress2 AS signed))/100
WHEN operation_type_id3 = 110 THEN (CAST(operation_type_amount3 AS signed) * CAST(operation_type_progress3 AS signed))/100
WHEN operation_type_id4 = 110 THEN (CAST(operation_type_amount4 AS signed) * CAST(operation_type_progress4 AS signed))/100
END)) AS KipSailDone,
ROUND(SUM(CASE WHEN operation_type_id1 = 111 THEN operation_type_amount1
@@ -184,10 +184,10 @@ class CompareProgramAndFunction implements FromView, ShouldAutoSize, WithEvents,
WHEN operation_type_id3 = 111 THEN operation_type_amount3
WHEN operation_type_id4 = 111 THEN operation_type_amount4
END)) AS AsphaltRedmixDoing,
ROUND(SUM(CASE WHEN operation_type_id1 = 111 THEN (cast(operation_type_amount1 as int) * cast(operation_type_progress1 as int))/100
WHEN operation_type_id2 = 111 THEN (cast(operation_type_amount2 as int) * cast(operation_type_progress2 as int))/100
WHEN operation_type_id3 = 111 THEN (cast(operation_type_amount3 as int) * cast(operation_type_progress3 as int))/100
WHEN operation_type_id4 = 111 THEN (cast(operation_type_amount4 as int) * cast(operation_type_progress4 as int))/100
ROUND(SUM(CASE WHEN operation_type_id1 = 111 THEN (CAST(operation_type_amount1 AS signed) * CAST(operation_type_progress1 AS signed))/100
WHEN operation_type_id2 = 111 THEN (CAST(operation_type_amount2 AS signed) * CAST(operation_type_progress2 AS signed))/100
WHEN operation_type_id3 = 111 THEN (CAST(operation_type_amount3 AS signed) * CAST(operation_type_progress3 AS signed))/100
WHEN operation_type_id4 = 111 THEN (CAST(operation_type_amount4 AS signed) * CAST(operation_type_progress4 AS signed))/100
END)) AS AsphaltRedmixDone,
ROUND(SUM(CASE WHEN operation_type_id1 = 112 THEN operation_type_amount1
@@ -195,10 +195,10 @@ class CompareProgramAndFunction implements FromView, ShouldAutoSize, WithEvents,
WHEN operation_type_id3 = 112 THEN operation_type_amount3
WHEN operation_type_id4 = 112 THEN operation_type_amount4
END)) AS LakegiriDoing,
ROUND(SUM(CASE WHEN operation_type_id1 = 112 THEN (cast(operation_type_amount1 as int) * cast(operation_type_progress1 as int))/100
WHEN operation_type_id2 = 112 THEN (cast(operation_type_amount2 as int) * cast(operation_type_progress2 as int))/100
WHEN operation_type_id3 = 112 THEN (cast(operation_type_amount3 as int) * cast(operation_type_progress3 as int))/100
WHEN operation_type_id4 = 112 THEN (cast(operation_type_amount4 as int) * cast(operation_type_progress4 as int))/100
ROUND(SUM(CASE WHEN operation_type_id1 = 112 THEN (CAST(operation_type_amount1 AS signed) * CAST(operation_type_progress1 AS signed))/100
WHEN operation_type_id2 = 112 THEN (CAST(operation_type_amount2 AS signed) * CAST(operation_type_progress2 AS signed))/100
WHEN operation_type_id3 = 112 THEN (CAST(operation_type_amount3 AS signed) * CAST(operation_type_progress3 AS signed))/100
WHEN operation_type_id4 = 112 THEN (CAST(operation_type_amount4 AS signed) * CAST(operation_type_progress4 AS signed))/100
END)) AS LakegiriDone,
ROUND(SUM(CASE WHEN operation_type_id1 = 113 THEN operation_type_amount1
@@ -206,10 +206,10 @@ class CompareProgramAndFunction implements FromView, ShouldAutoSize, WithEvents,
WHEN operation_type_id3 = 113 THEN operation_type_amount3
WHEN operation_type_id4 = 113 THEN operation_type_amount4
END)) AS DarzgiriDoing,
ROUND(SUM(CASE WHEN operation_type_id1 = 113 THEN (cast(operation_type_amount1 as int) * cast(operation_type_progress1 as int))/100
WHEN operation_type_id2 = 113 THEN (cast(operation_type_amount2 as int) * cast(operation_type_progress2 as int))/100
WHEN operation_type_id3 = 113 THEN (cast(operation_type_amount3 as int) * cast(operation_type_progress3 as int))/100
WHEN operation_type_id4 = 113 THEN (cast(operation_type_amount4 as int) * cast(operation_type_progress4 as int))/100
ROUND(SUM(CASE WHEN operation_type_id1 = 113 THEN (CAST(operation_type_amount1 AS signed) * CAST(operation_type_progress1 AS signed))/100
WHEN operation_type_id2 = 113 THEN (CAST(operation_type_amount2 AS signed) * CAST(operation_type_progress2 AS signed))/100
WHEN operation_type_id3 = 113 THEN (CAST(operation_type_amount3 AS signed) * CAST(operation_type_progress3 AS signed))/100
WHEN operation_type_id4 = 113 THEN (CAST(operation_type_amount4 AS signed) * CAST(operation_type_progress4 AS signed))/100
END)) AS DarzgiriDone,
COUNT(*) AS countAll
FROM contract_subitems
@@ -223,7 +223,7 @@ class CompareProgramAndFunction implements FromView, ShouldAutoSize, WithEvents,
$query .= " GROUP BY province_id
ORDER BY province_id ASC;";
$data = DB::select(DB::raw($query));
$data = DB::select($query);
$sum = [
'AsphaltGarmDoingSum' => 0,