diff --git a/ProjectRepairWork/Entities/BuildingMaterials.cs b/ProjectRepairWork/Entities/BuildingMaterials.cs index 413466e..7038441 100644 --- a/ProjectRepairWork/Entities/BuildingMaterials.cs +++ b/ProjectRepairWork/Entities/BuildingMaterials.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -9,8 +10,8 @@ namespace ProjectRepairWork.Entities; public class BuildingMaterials { public int Id { get; private set; } + [DisplayName("Название материала")] public string MaterialsType { get; private set; } = string.Empty; - public static BuildingMaterials CreatEntity(int id, string materialType) { return new BuildingMaterials diff --git a/ProjectRepairWork/Entities/Contractors.cs b/ProjectRepairWork/Entities/Contractors.cs index 32b229b..2bc6a88 100644 --- a/ProjectRepairWork/Entities/Contractors.cs +++ b/ProjectRepairWork/Entities/Contractors.cs @@ -1,6 +1,7 @@ using ProjectRepairWork.Entities.Enums; using System; using System.Collections.Generic; +using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -10,7 +11,10 @@ namespace ProjectRepairWork.Entities; public class Contractors { public int Id { get; private set; } + + [DisplayName("Название компании")] public string CompanyName { get; private set; } = string.Empty; + [DisplayName("Контакты")] public string Contacts { get; private set; } = string.Empty; public static Contractors CreatEntity(int id, string companyName, string contants) { diff --git a/ProjectRepairWork/Entities/Cost.cs b/ProjectRepairWork/Entities/Cost.cs index 563c4e2..2f95b27 100644 --- a/ProjectRepairWork/Entities/Cost.cs +++ b/ProjectRepairWork/Entities/Cost.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -8,6 +9,7 @@ namespace ProjectRepairWork.Entities; public class Cost { public int Id { get; private set; } + [DisplayName("Цена")] public int Price { get; private set; } public static Cost CreatEntity(int id, int price) { diff --git a/ProjectRepairWork/Entities/MaterialProcurement.cs b/ProjectRepairWork/Entities/MaterialProcurement.cs index aee19ca..c9c97f1 100644 --- a/ProjectRepairWork/Entities/MaterialProcurement.cs +++ b/ProjectRepairWork/Entities/MaterialProcurement.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -9,17 +10,20 @@ namespace ProjectRepairWork.Entities; public class MaterialProcurement { public int Id { get; private set; } + [Browsable(false)] public int MaterialsId { get; private set; } + [DisplayName("Дата закупки")] public DateTime ProcurmentDate { get; private set; } + [DisplayName("Сумма закупки")] public int MaterialsPrice { get; private set; } - public static MaterialProcurement CreatOpertions(int id, int materialsId, int materialsPrice) + public static MaterialProcurement CreatOpertions(int id, DateTime procurmentDate, int materialsId, int materialsPrice) { return new MaterialProcurement { Id = id, MaterialsId = materialsId, - ProcurmentDate = DateTime.Now, + ProcurmentDate = procurmentDate, MaterialsPrice = materialsPrice, }; } diff --git a/ProjectRepairWork/Entities/Premises.cs b/ProjectRepairWork/Entities/Premises.cs index 53c4ad9..6bc0b54 100644 --- a/ProjectRepairWork/Entities/Premises.cs +++ b/ProjectRepairWork/Entities/Premises.cs @@ -1,6 +1,7 @@ using ProjectRepairWork.Entities.Enums; using System; using System.Collections.Generic; +using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -9,11 +10,17 @@ namespace ProjectRepairWork.Entities; public class Premises { public int Id { get; private set; } + [DisplayName("Клиент")] public string ClientName { get; private set; } = string.Empty; + [DisplayName("Адрес")] public string Address { get; private set; } = string.Empty; + [DisplayName("Площадь")] public int Area { get; private set; } + [DisplayName("Тип помещения")] public PremisesType PremisesType { get; private set; } + [DisplayName("Дата начала")] public DateTime DateStart { get; private set; } + [DisplayName("Дата конца")] public DateTime DateEnd { get; private set; } public static Premises CreatEntity(int id, string clientName, string address, int area, DateTime dateStart, DateTime dateEnd, PremisesType premisesType) { diff --git a/ProjectRepairWork/Entities/Repair.cs b/ProjectRepairWork/Entities/Repair.cs index 5371b42..faf3fa2 100644 --- a/ProjectRepairWork/Entities/Repair.cs +++ b/ProjectRepairWork/Entities/Repair.cs @@ -1,5 +1,7 @@ -using System; +using ProjectRepairWork.Entities.Enums; +using System; using System.Collections.Generic; +using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -9,12 +11,26 @@ namespace ProjectRepairWork.Entities; public class Repair { public int Id { get; private set; } + [Browsable(false)] public int ContractorsId { get; private set; } + [Browsable(false)] public int PremisesId { get; private set; } + [DisplayName("Подрядчик")] + public string CompanyName { get; private set; } = string.Empty; + [Browsable(false)] + public int PremisesType { get; private set; } + [DisplayName("Помещение")] + public string PremisesName => $"{(PremisesType)PremisesType}"; + [DisplayName("Дата ремонта")] public DateTime DateRepair { get; private set; } - public IEnumerable RepairRepair { get; private set; } = []; + public string RepairRepair => RepairRepairList != null ? + string.Join(" ,", RepairRepairList.Select(x => $"{x.WorkName} {x.Count}")) + : string.Empty; + [Browsable(false)] + public List RepairRepairList { get; private set; } = new List(); + public static Repair CreatOpertions(int id, int contractorsId, DateTime dateRepair, int premisesId, IEnumerable repairRepair) @@ -25,9 +41,16 @@ public class Repair ContractorsId = contractorsId, PremisesId = premisesId, DateRepair = dateRepair, - RepairRepair = repairRepair, + RepairRepairList = repairRepair.ToList(), }; } + public void SetRepairRepairList(IEnumerable repairRepair) + { + if (repairRepair != null && repairRepair.Any()) + { + RepairRepairList = repairRepair.ToList(); + } + } } diff --git a/ProjectRepairWork/Entities/RepairRepair.cs b/ProjectRepairWork/Entities/RepairRepair.cs index f346605..6ecffef 100644 --- a/ProjectRepairWork/Entities/RepairRepair.cs +++ b/ProjectRepairWork/Entities/RepairRepair.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -10,6 +11,9 @@ public class RepairRepair { public int Id { get; private set; } public int WorkId { get; private set; } + [DisplayName("Работы")] + public string WorkName { get; private set; } = string.Empty; + [DisplayName("Количество")] public int Count { get; set; } diff --git a/ProjectRepairWork/Entities/TempRepairRepair.cs b/ProjectRepairWork/Entities/TempRepairRepair.cs deleted file mode 100644 index a0fa4f3..0000000 --- a/ProjectRepairWork/Entities/TempRepairRepair.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace ProjectRepairWork.Entities; - -public class TempRepairRepair -{ - public int Id { get; private set; } - public int ContractorsId { get; private set; } - public int PremisesId { get; private set; } - public DateTime DateRepair { get; private set; } - public int Count { get; private set; } -} diff --git a/ProjectRepairWork/Entities/Works.cs b/ProjectRepairWork/Entities/Works.cs index 4022b67..b226910 100644 --- a/ProjectRepairWork/Entities/Works.cs +++ b/ProjectRepairWork/Entities/Works.cs @@ -1,6 +1,7 @@ using ProjectRepairWork.Entities.Enums; using System; using System.Collections.Generic; +using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -10,7 +11,9 @@ namespace ProjectRepairWork.Entities; public class Works { public int Id { get; private set; } + [DisplayName("Вид работ")] public string WorkName { get; private set; } = string.Empty; + [DisplayName("Название материалов")] public MaterialsName MaterialsName { get; private set; } public static Works CreatEntity(int id, string workName, MaterialsName materialsName) { diff --git a/ProjectRepairWork/FormRepairWork.Designer.cs b/ProjectRepairWork/FormRepairWork.Designer.cs index 47337e8..6ae130e 100644 --- a/ProjectRepairWork/FormRepairWork.Designer.cs +++ b/ProjectRepairWork/FormRepairWork.Designer.cs @@ -132,7 +132,7 @@ directoryReportToolStripMenuItem.ShortcutKeys = Keys.Control | Keys.W; directoryReportToolStripMenuItem.Size = new Size(346, 26); directoryReportToolStripMenuItem.Text = "Документ со справочником "; - directoryReportToolStripMenuItem.Click += directoryReportToolStripMenuItem_Click; + directoryReportToolStripMenuItem.Click += DirectoryReportToolStripMenuItem_Click; // // ContractorReportToolStripMenuItem // diff --git a/ProjectRepairWork/FormRepairWork.cs b/ProjectRepairWork/FormRepairWork.cs index 57d560d..c0c4088 100644 --- a/ProjectRepairWork/FormRepairWork.cs +++ b/ProjectRepairWork/FormRepairWork.cs @@ -73,7 +73,7 @@ namespace ProjectRepairWork } } - private void directoryReportToolStripMenuItem_Click(object sender, EventArgs e) + private void DirectoryReportToolStripMenuItem_Click(object sender, EventArgs e) { try { diff --git a/ProjectRepairWork/Forms/FormBuildingMaterials.cs b/ProjectRepairWork/Forms/FormBuildingMaterials.cs index c99e2d5..bbac8c7 100644 --- a/ProjectRepairWork/Forms/FormBuildingMaterials.cs +++ b/ProjectRepairWork/Forms/FormBuildingMaterials.cs @@ -80,7 +80,11 @@ namespace ProjectRepairWork.Forms } } - private void LoadList() => dataGridView.DataSource = _buildingMaterialsRepository.ReadBuildingMaterials(); + private void LoadList() + { + dataGridView.DataSource = _buildingMaterialsRepository.ReadBuildingMaterials(); + dataGridView.Columns["Id"].Visible = false; + } private bool TryGetIdentifierFromSelectedRow(out int id) { id = 0; diff --git a/ProjectRepairWork/Forms/FormContractors.cs b/ProjectRepairWork/Forms/FormContractors.cs index c19f219..24862c9 100644 --- a/ProjectRepairWork/Forms/FormContractors.cs +++ b/ProjectRepairWork/Forms/FormContractors.cs @@ -91,7 +91,11 @@ namespace ProjectRepairWork.Forms } } - private void LoadList() => dataGridView.DataSource = _contractorsRepository.ReadContractors(); + private void LoadList() + { + dataGridView.DataSource = _contractorsRepository.ReadContractors(); + dataGridView.Columns["Id"].Visible = false; + } private bool TryGetIdentifierFromSelectedRow(out int id) { id = 0; diff --git a/ProjectRepairWork/Forms/FormCosts.cs b/ProjectRepairWork/Forms/FormCosts.cs index 770dc14..3671791 100644 --- a/ProjectRepairWork/Forms/FormCosts.cs +++ b/ProjectRepairWork/Forms/FormCosts.cs @@ -79,7 +79,10 @@ namespace ProjectRepairWork.Forms } } - private void LoadList() => dataGridView.DataSource = _costRepository.ReadCost(); + private void LoadList() { + dataGridView.DataSource = _costRepository.ReadCost(); + dataGridView.Columns["Id"].Visible = false; + } private bool TryGetIdentifierFromSelectedRow(out int id) { id = 0; diff --git a/ProjectRepairWork/Forms/FormMaterialProcurement.cs b/ProjectRepairWork/Forms/FormMaterialProcurement.cs index c3c484a..cf27a20 100644 --- a/ProjectRepairWork/Forms/FormMaterialProcurement.cs +++ b/ProjectRepairWork/Forms/FormMaterialProcurement.cs @@ -38,7 +38,7 @@ public partial class FormMaterialProcurement : Form throw new Exception("Имеются незаполненные поля"); } - _materialProcurementRepository.CreateMaterialProcurement(MaterialProcurement.CreatOpertions(0, + _materialProcurementRepository.CreateMaterialProcurement(MaterialProcurement.CreatOpertions(0,dateTimePickerMaterialRrocurement.Value, (int)comboBoxMaterialRrocurement.SelectedValue!, (int)numericUpDownMaterialRrocurement.Value!)); Close(); diff --git a/ProjectRepairWork/Forms/FormPremises.cs b/ProjectRepairWork/Forms/FormPremises.cs index b663ec9..0e03532 100644 --- a/ProjectRepairWork/Forms/FormPremises.cs +++ b/ProjectRepairWork/Forms/FormPremises.cs @@ -80,7 +80,10 @@ namespace ProjectRepairWork.Forms } } - private void LoadList() => dataGridView.DataSource = _premisesRepository.ReadPremises(); + private void LoadList() { + dataGridView.DataSource = _premisesRepository.ReadPremises(); + dataGridView.Columns["Id"].Visible = false; + } private bool TryGetIdentifierFromSelectedRow(out int id) { id = 0; diff --git a/ProjectRepairWork/Forms/FormRepairs.cs b/ProjectRepairWork/Forms/FormRepairs.cs index 5b9fca8..9174e10 100644 --- a/ProjectRepairWork/Forms/FormRepairs.cs +++ b/ProjectRepairWork/Forms/FormRepairs.cs @@ -34,7 +34,13 @@ namespace ProjectRepairWork.Forms } } - private void LoadList() => dataGridView.DataSource = _repairRepository.ReadRepair(); + private void LoadList() + { + dataGridView.DataSource = _repairRepository.ReadRepair(); + dataGridView.Columns["Id"].Visible = false; + dataGridView.Columns["RepairRepair"].Visible = false; + dataGridView.Columns["DateRepair"].DefaultCellStyle.Format = "dd MMMM yyyy hh:mm"; + } private void ButtonAdd_Click(object sender, EventArgs e) { diff --git a/ProjectRepairWork/Forms/FormWorks.cs b/ProjectRepairWork/Forms/FormWorks.cs index a079259..dc003ab 100644 --- a/ProjectRepairWork/Forms/FormWorks.cs +++ b/ProjectRepairWork/Forms/FormWorks.cs @@ -92,7 +92,10 @@ namespace ProjectRepairWork.Forms } } - private void LoadList() => dataGridView.DataSource = _worksRepository.ReadWorks(); + private void LoadList() { + dataGridView.DataSource = _worksRepository.ReadWorks(); + dataGridView.Columns["Id"].Visible = false; + } private bool TryGetIdentifierFromSelectedRow(out int id) { id = 0; diff --git a/ProjectRepairWork/Reports/ChartReport.cs b/ProjectRepairWork/Reports/ChartReport.cs index 3f3423d..bc0fc42 100644 --- a/ProjectRepairWork/Reports/ChartReport.cs +++ b/ProjectRepairWork/Reports/ChartReport.cs @@ -28,7 +28,7 @@ public class ChartReport { new PdfBuilder(filePath) .AddHeader("Поступление материалов") - .AddPieChart("Виды материала", GetData(dateTime)) + .AddPieChart($"Виды материалов на {dateTime: dd MMMM yyyy}", GetData(dateTime)) .Build(); return true; } diff --git a/ProjectRepairWork/Reports/TableReport.cs b/ProjectRepairWork/Reports/TableReport.cs index ba01109..1471b29 100644 --- a/ProjectRepairWork/Reports/TableReport.cs +++ b/ProjectRepairWork/Reports/TableReport.cs @@ -10,7 +10,7 @@ using ProjectRepairWork.Entities; namespace ProjectRepairWork.Reports; -internal class TableReport +public class TableReport { private readonly IRepairRepository _repairRepository; private readonly IWorksRepository _worksRepository; @@ -32,7 +32,7 @@ internal class TableReport var data = GetData(contractorsId, startDate, endDate); new ExcelBuilder(filePath) .AddHeader("Сводка по подрядчикам", 0, 3) - .AddParagraph("за период", 0) + .AddParagraph($"за период, c {startDate: dd.MM.yyyy} по {endDate: dd.MM.yyyy} ", 0) .AddTable(new int[] { 10, 15, 15 }, data) .Build(); return true; @@ -81,7 +81,7 @@ internal class TableReport .Union( groupedData .Select(x => new string[] { - x.WorksName.ToString(), x.Date.ToString(), x.Quantity.ToString() + x.WorksName.ToString(), x.Date.ToString() ?? string.Empty, x.Quantity.ToString()?? string.Empty })) .Union( new List() { new string[] { "Всего", "", totalQuantity.ToString() } }) diff --git a/ProjectRepairWork/Repositories/IMaterialProcurementRepository.cs b/ProjectRepairWork/Repositories/IMaterialProcurementRepository.cs index c44ba19..03c8ed8 100644 --- a/ProjectRepairWork/Repositories/IMaterialProcurementRepository.cs +++ b/ProjectRepairWork/Repositories/IMaterialProcurementRepository.cs @@ -9,7 +9,8 @@ namespace ProjectRepairWork.Repositories; public interface IMaterialProcurementRepository { - IEnumerable ReadMaterialProcurement(); + IEnumerable ReadMaterialProcurement(DateTime? dateForm = null, + DateTime? dateTo = null, int? materialsId = null); MaterialProcurement ReadMaterialProcurementById(int id); void CreateMaterialProcurement(MaterialProcurement materialProcurement); } diff --git a/ProjectRepairWork/Repositories/IRepairRepository.cs b/ProjectRepairWork/Repositories/IRepairRepository.cs index 2ab91fc..fa532f8 100644 --- a/ProjectRepairWork/Repositories/IRepairRepository.cs +++ b/ProjectRepairWork/Repositories/IRepairRepository.cs @@ -9,7 +9,7 @@ namespace ProjectRepairWork.Repositories; public interface IRepairRepository { - IEnumerable ReadRepair(int? contractorsId = null, int? costId = null, int? worksId = null, int? premisesId = null); + IEnumerable ReadRepair(DateTime? dateForm = null, DateTime? dateTo = null, int? contractorsId = null, int? costId = null, int? worksId = null, int? premisesId = null); IEnumerable ReadRepairRepair(); void CraeteRepair(Repair repair); } diff --git a/ProjectRepairWork/Repositories/Implementation/MaterialProcurementRepository.cs b/ProjectRepairWork/Repositories/Implementation/MaterialProcurementRepository.cs index 8f900ae..36ecce0 100644 --- a/ProjectRepairWork/Repositories/Implementation/MaterialProcurementRepository.cs +++ b/ProjectRepairWork/Repositories/Implementation/MaterialProcurementRepository.cs @@ -8,6 +8,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using System.Windows.Forms; namespace ProjectRepairWork.Repositories.Implementation; @@ -65,15 +66,37 @@ public class MaterialProcurementRepository : IMaterialProcurementRepository throw; } } - public IEnumerable ReadMaterialProcurement() + public IEnumerable ReadMaterialProcurement(DateTime? dateForm = null, + DateTime? dateTo = null, int? materialsId = null) { _logger.LogInformation("Получение всех объектов"); try { + var builder = new QueryBuilder(); + if (dateForm.HasValue) + { + builder.AddCondition("mp.ProcurmentDate >= @dateForm"); + } + if (dateTo.HasValue) + { + builder.AddCondition("mp.ProcurmentDate <= @dateTo"); + } + if (materialsId.HasValue) + { + builder.AddCondition("mp.MaterialsId = @materialsId"); + } + using var connection = new NpgsqlConnection(_connectionString.ConnectionString); - var querySelect = "SELECT * FROM MaterialProcurement"; - var materialProcurement = connection.Query(querySelect); + var querySelect = $@" + SELECT + mp.*, + bm.MaterialsType as MaterialsName + FROM MaterialProcurement mp + LEFT JOIN BuildingMaterials bm on bm.Id = mp.MaterialsId + {builder.Build()}"; + + var materialProcurement = connection.Query(querySelect, new { dateForm, dateTo, materialsId }); _logger.LogDebug("Полученные объекты: {json}", JsonConvert.SerializeObject(materialProcurement)); return materialProcurement; diff --git a/ProjectRepairWork/Repositories/Implementation/QueryBuilder.cs b/ProjectRepairWork/Repositories/Implementation/QueryBuilder.cs new file mode 100644 index 0000000..fa7407f --- /dev/null +++ b/ProjectRepairWork/Repositories/Implementation/QueryBuilder.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProjectRepairWork.Repositories.Implementation; + +public class QueryBuilder +{ + private readonly StringBuilder _builder; + + public QueryBuilder() + { + _builder = new(); + } + + public QueryBuilder AddCondition(string condition) + { + if (_builder.Length > 0) + { + _builder.Append(" AND "); + } + + _builder.Append(condition); + + return this; + } + + public string Build() + { + if (_builder.Length == 0) + { + return string.Empty; + } + + return $"WHERE {_builder}"; + } +} diff --git a/ProjectRepairWork/Repositories/Implementation/RepairRepository.cs b/ProjectRepairWork/Repositories/Implementation/RepairRepository.cs index abdf7c0..2086ae3 100644 --- a/ProjectRepairWork/Repositories/Implementation/RepairRepository.cs +++ b/ProjectRepairWork/Repositories/Implementation/RepairRepository.cs @@ -8,6 +8,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using static System.Runtime.InteropServices.JavaScript.JSType; namespace ProjectRepairWork.Repositories.Implementation; @@ -34,18 +35,18 @@ public class RepairRepository : IRepairRepository using var transaction = connection.BeginTransaction(); var queryInsert = @" INSERT INTO Repair (ContractorsId, PremisesId, DateRepair) - VALUES (@ContractorsId, @PremisesId, @DateRepair); - SELECT MAX(Id) FROM Repair"; + VALUES (@ContractorsId, @PremisesId, @DateRepair) + RETURNING Id;"; var repairId = connection.QueryFirst(queryInsert, repair, transaction); var querySubInsert = @" INSERT INTO RepairRepair (RepairId, WorkId, Count) VALUES (@RepairId, @WorkId, @Count)"; - foreach (var elem in repair.RepairRepair) + foreach (var elem in repair.RepairRepairList) { connection.Execute(querySubInsert, new { - repairId, + RepairId = repairId, elem.WorkId, elem.Count }, transaction); @@ -59,14 +60,52 @@ public class RepairRepository : IRepairRepository } } - public IEnumerable ReadRepair(int? contractorsId = null, int? costId = null, int? worksId = null, int? premisesId = null) + public IEnumerable ReadRepair(DateTime? dateForm = null, DateTime? dateTo = null, int? contractorsId = null, int? costId = null, int? worksId = null, int? premisesId = null) { _logger.LogInformation("Получение всех объектов"); try { + var builder = new QueryBuilder(); + if (dateForm.HasValue) + { + builder.AddCondition("r.DateRepair >= @dateForm"); + } + if (dateTo.HasValue) + { + builder.AddCondition("r.DateRepair <= @dateTo"); + } + if (contractorsId.HasValue) + { + builder.AddCondition("r.ContractorsId = @contractorsId"); + } + if (costId.HasValue) + { + builder.AddCondition("r.Cost = @costId"); + } + if (worksId.HasValue) + { + builder.AddCondition("r.WorkId = @worksId"); + } + if (premisesId.HasValue) + { + builder.AddCondition("r.PremisesId = @premisesId"); + } + + using var connection = new NpgsqlConnection(_connectionString.ConnectionString); - var querySelect = "SELECT * FROM Repair"; - var repair = connection.Query(querySelect); + var querySelect = $@" + SELECT + r.*, + c.CompanyName as CompanyName, + p.PremisesType as PremisesType + + FROM Repair r + LEFT JOIN Contractors c on c.Id = r.ContractorsId + LEFT JOIN RepairRepair rr on rr.Id = r.Id + + LEFT JOIN Premises p on p.Id = r.PremisesId + {builder.Build()}"; + var repair = connection.Query(querySelect, new { dateForm, dateTo }); _logger.LogDebug("Полученные объекты: {json}", JsonConvert.SerializeObject(repair)); return repair;