| | |
| | | using System; |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEAWCS_Core; |
| | | using WIDESEAWCS_Core.BaseRepository; |
| | | using WIDESEAWCS_Core.BaseServices; |
| | | using WIDESEAWCS_DTO.Telescopic; |
| | |
| | | public class MaintenanceTeamService : ServiceBase<Dt_MaintenanceTeam, IRepository<Dt_MaintenanceTeam>>, IMaintenanceTeamService |
| | | { |
| | | public IRepository<Dt_MaintenanceTeam> Repository => BaseDal; |
| | | private readonly IRepository<Sys_User> _user; |
| | | |
| | | public MaintenanceTeamService(IRepository<Dt_MaintenanceTeam> BaseDal) : base(BaseDal) |
| | | public MaintenanceTeamService(IRepository<Dt_MaintenanceTeam> BaseDal,IRepository<Sys_User> user) : base(BaseDal) |
| | | { |
| | | |
| | | _user = user; |
| | | } |
| | | |
| | | |
| | | <<<<<<< Updated upstream |
| | | ======= |
| | | /// <summary> |
| | | /// æ£ä¿®è®¾ç½®è®°å½ |
| | | /// </summary> |
| | |
| | | var sys = _user.Db.Queryable<Sys_User>(); |
| | | var main = Db.Queryable<Dt_MaintenanceTeam>(); |
| | | |
| | | |
| | | //æ¨¡ç³æ¥è¯¢ |
| | | var query = sys.InnerJoin<Dt_MaintenanceTeam>((a, b) => a.UserTrueName == b.OperatorName); |
| | | if (!string .IsNullOrEmpty(pagination.searchKeyword)) |
| | | { |
| | |
| | | b.Modifier.Contains(pagination.searchKeyword) |
| | | ); |
| | | } |
| | | //æ¶é´æ¥è¯¢ |
| | | if (pagination.startDate.HasValue&&pagination.endDate.HasValue) |
| | | { |
| | | query = query.Where((a, b) => b.DistributionTime >= pagination.startDate && b.DistributionTime <= pagination.endDate); |
| | | } |
| | | //æåº |
| | | if (!string.IsNullOrEmpty(pagination.sortField)) |
| | | { |
| | | var isAsc = pagination.sortOrder?.ToLower() == "asc"; |
| | | query = pagination.sortField.ToLower() switch |
| | | { |
| | | //"OperatorName" => isAsc ? query.OrderBy((a, b) => b.OperatorName) : query.OrderByDescending((a, b) => b.OperatorName), |
| | | |
| | | //"TeamName" => isAsc ? query.OrderBy((a, b) => b.TeamName) : query.OrderByDescending((a, b) => b.TeamName), |
| | | |
| | | "distributiontime" => isAsc ? query.OrderBy((a, b) => b.DistributionTime) : query.OrderByDescending((a, b) => b.DistributionTime), |
| | | |
| | | //"Modifier" => isAsc ? query.OrderBy((a, b) => b.Modifier) : query.OrderByDescending((a, b) => b.Modifier), |
| | | |
| | | _ => query.OrderByDescending((a, b) => b.Creater), // é»è®¤æå建æ¶é´éåº |
| | | }; |
| | | |
| | | } |
| | | else |
| | | { |
| | | //é»è®¤æå建æ¶é´éåºæåº |
| | | query = query.OrderByDescending((a, b) => b.Creater); |
| | | } |
| | | |
| | | //è¿åç»æ |
| | | var result=query |
| | | .Select((a, b) => new |
| | | { |
| | |
| | | |
| | | } |
| | | |
| | | >>>>>>> Stashed changes |
| | | } |
| | | } |