LEIYI 3 months ago
parent
commit
80c905eb34

+ 9 - 21
OASystem/OASystem.Api/Controllers/ResourceController.cs

@@ -654,19 +654,19 @@ namespace OASystem.API.Controllers
             string sqlWhere = string.Empty;
             if (!string.IsNullOrWhiteSpace(dto.Name))
             {
-                sqlWhere += string.Format(@" And hd.Name like '%{0}%'", dto.Name);
+                sqlWhere += string.Format(@" And hd.Name like '%{0}%'", AesEncryptionHelper.Encrypt(dto.Name));
             }
             if (!string.IsNullOrWhiteSpace(dto.City) && dto.City != "全部")
             {
-                sqlWhere += string.Format(@" And hd.City like '%{0}%'", dto.City);
+                sqlWhere += string.Format(@" And hd.City like '%{0}%'", AesEncryptionHelper.Encrypt(dto.City));
             }
             if (!string.IsNullOrWhiteSpace(dto.Contact))
             {
-                sqlWhere += string.Format(@" And hd.Contact like '%{0}%'", dto.Contact);
+                sqlWhere += string.Format(@" And hd.Contact like '%{0}%'", AesEncryptionHelper.Encrypt(dto.Contact));
             }
             if (!string.IsNullOrWhiteSpace(dto.ContactPhone))
             {
-                sqlWhere += string.Format(@" And hd.ContactPhone like '%{0}%'", dto.ContactPhone);
+                sqlWhere += string.Format(@" And hd.ContactPhone like '%{0}%'", AesEncryptionHelper.Encrypt(dto.ContactPhone));
             }
             sqlWhere += string.Format(@" And hd.IsDel={0}", 0);
             if (!string.IsNullOrEmpty(sqlWhere.Trim()))
@@ -705,20 +705,7 @@ namespace OASystem.API.Controllers
 
             if (dto.PortType == 1)
             {
-                var HotelDataData = await _sqlSugar.SqlQueryable<HotelDataItemView>(sql)
-                    //.Select(x => new {
-                    //    x.Row_Number,
-                    //    x.Id,
-                    //    City = AesEncryptionHelper.Decrypt(x.City),
-                    //    Name = AesEncryptionHelper.Decrypt(x.Name),
-                    //    Tel = AesEncryptionHelper.Decrypt(x.Tel),
-                    //    Fax = AesEncryptionHelper.Decrypt(x.Fax),
-                    //    Contact = AesEncryptionHelper.Decrypt(x.Contact),
-                    //    x.CreateUserName,
-                    //    ContactPhone = AesEncryptionHelper.Decrypt(x.ContactPhone),
-                    //    x.CreateTime
-                    //})
-                    .ToListAsync();
+                var HotelDataData = await _sqlSugar.SqlQueryable<HotelDataItemView>(sql).ToListAsync();
 
                 if (HotelDataData.Count == 0)
                 {
@@ -4177,14 +4164,15 @@ WHERE
             if (dto.Id < 1) return Ok(JsonView(false, MsgTips.Port));
 
             var id = dto.Id;
-            var info = await _insuranceCostRep.Query(x => x.Id == id)
+            var info = await _sqlSugar.Queryable<Res_BasicInsuranceCost>()
+                .Where(x => x.Id == id && x.IsDel == 0)
                 .Select(x => new {
                     x.Id,
                     x.IsSchengen,
                     x.CountryName,
                     x.Cost,
                     x.Remark,
-                    CreateUserName = SqlFunc.Subqueryable<Sys_Users>().Where(s => s.Id == x.CreateUserId).Select(s => s.CnName).FirstOrDefault(),
+                    CreateUserName = SqlFunc.Subqueryable<Sys_Users>().Where(s => s.Id == x.CreateUserId).Select(s => s.CnName),
                     x.CreateTime
                 })
                 .FirstAsync();
@@ -4211,7 +4199,7 @@ WHERE
                 .LeftJoin<Sys_Users>((bic,u) => bic.CreateUserId == u.Id)
                 .Where((bic, u) => bic.IsDel == 0)
                 .WhereIF(!string.IsNullOrEmpty(dto.Search), (bic, u) => bic.CountryName.Contains(dto.Search))
-                .OrderBy((bic, u) => bic.Id)
+                .OrderByDescending((bic, u) => bic.Id)
                 .Select((bic, u) => new {
                     bic.Id,
                     bic.IsSchengen,

+ 4 - 0
OASystem/OASystem.Api/Controllers/SystemController.cs

@@ -2312,6 +2312,8 @@ And u.UId = {0} And u.FId = 1 ", dto.UserId);
                             lgd.CreateTime,
                         })
                         .ToListAsync();
+
+                    foreach (var item in opTourGuideData) EncryptionProcessor.DecryptProperties(item);
                     var opTourGuideDataGroups = opTourGuideData.GroupBy(x => x.CreateUserId)
                         .Select(g => new {
                             uId = g.Key,
@@ -2961,6 +2963,8 @@ And u.UId = {0} And u.FId = 1 ", dto.UserId);
                                 lgd.CreateTime,
                             })
                             .ToListAsync();
+                        foreach (var item in opTourGuideData) EncryptionProcessor.DecryptProperties(item);
+
                         var opTourGuideDataGroups = opTourGuideData.GroupBy(x => x.CreateUserId)
                             .Select(g => new {
                                 uId = g.Key,

+ 58 - 43
OASystem/OASystem.Infrastructure/Repositories/Groups/CarTouristGuideGroundRepository.cs

@@ -4,6 +4,7 @@ using NPOI.SS.Formula.Functions;
 using NPOI.SS.UserModel;
 using NPOI.Util;
 using OASystem.Domain;
+using OASystem.Domain.AesEncryption;
 using OASystem.Domain.Dtos.Financial;
 using OASystem.Domain.Dtos.Groups;
 using OASystem.Domain.Dtos.QiYeWeChat;
@@ -53,13 +54,13 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 if (dto.Status == 1)//添加
                 {
                     var grp_CarTouristGuideGround = _sqlSugar.Queryable<Grp_CarTouristGuideGroundReservations>()
-                                                             .First(a => a.IsDel == 0 && 
-                                                                         a.Area == dto.Area && 
-                                                                         a.BusName == dto.BusName && 
-                                                                         a.ServiceGuide == dto.ServiceGuide && 
-                                                                         a.DiId == dto.DiId && 
-                                                                         a.BusTel == dto.BusTel && 
-                                                                         a.ServiceTel == dto.ServiceTel && 
+                                                             .First(a => a.IsDel == 0 &&
+                                                                         a.Area == dto.Area &&
+                                                                         a.BusName == dto.BusName &&
+                                                                         a.ServiceGuide == dto.ServiceGuide &&
+                                                                         a.DiId == dto.DiId &&
+                                                                         a.BusTel == dto.BusTel &&
+                                                                         a.ServiceTel == dto.ServiceTel &&
                                                                          a.PriceName == dto.PriceName
                                                              );
                     if (grp_CarTouristGuideGround != null)
@@ -115,16 +116,28 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 }
                 if (id != 0)
                 {
-                    Res_LocalGuideData _LocalGuideDataCar = _sqlSugar.Queryable<Res_LocalGuideData>().First(a => a.UnitName == dto.BusName && a.ContactTel == dto.BusTel && a.IsDel == 0);
+                    var _LocalGuideDataCar = _sqlSugar.Queryable<Res_LocalGuideData>()
+                        .First(a =>
+                            a.UnitName == AesEncryptionHelper.Encrypt(dto.BusName) &&
+                            a.ContactTel == AesEncryptionHelper.Encrypt(dto.BusTel) &&
+                            a.IsDel == 0
+                            );
                     if (_LocalGuideDataCar == null)
                     {
-                        Res_LocalGuideData res_LocalGuideCar = new Res_LocalGuideData();
+                        var res_LocalGuideCar = new Res_LocalGuideData();
                         res_LocalGuideCar.UnitName = dto.BusName;
                         res_LocalGuideCar.ContactTel = dto.BusTel;
                         res_LocalGuideCar.CreateUserId = dto.CreateUserId;
+
+                        EncryptionProcessor.EncryptProperties(res_LocalGuideCar);
                         int cId = await _sqlSugar.Insertable(res_LocalGuideCar).ExecuteReturnIdentityAsync();
                     }
-                    Res_LocalGuideData _LocalGuideDataService = _sqlSugar.Queryable<Res_LocalGuideData>().First(a => a.UnitName == dto.ServiceCompany && a.ContactTel == dto.ServiceTel && a.IsDel == 0);
+                    var _LocalGuideDataService = _sqlSugar.Queryable<Res_LocalGuideData>()
+                        .First(a => 
+                        a.UnitName == AesEncryptionHelper.Encrypt(dto.ServiceCompany) && 
+                        a.ContactTel == AesEncryptionHelper.Encrypt(dto.ServiceTel) && 
+                        a.IsDel == 0
+                        );
                     if (_LocalGuideDataService == null)
                     {
                         Res_LocalGuideData res_LocalGuideService = new Res_LocalGuideData();
@@ -133,6 +146,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                         res_LocalGuideService.ContactTel = dto.ServiceTel;
                         res_LocalGuideService.Contact = dto.ServiceTel;
                         res_LocalGuideService.CreateUserId = dto.CreateUserId;
+                        EncryptionProcessor.EncryptProperties(res_LocalGuideService);
                         int cId = await _sqlSugar.Insertable(res_LocalGuideService).ExecuteReturnIdentityAsync();
                     }
                 }
@@ -179,14 +193,14 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 int day = ts.Days;
 
                 var diid = Query<Grp_GroupsTaskAssignment>(a => a.IsDel == 0 && a.UId == dto.UserId && a.CTId == 79)
-                    .Select(x=>x.DIId)
+                    .Select(x => x.DIId)
                     .Distinct()
                     .ToList();
 
                 //团组下拉框
-                List<Grp_DelegationInfo> _Delegations = diid.Any() 
+                List<Grp_DelegationInfo> _Delegations = diid.Any()
                     ? _sqlSugar.Queryable<Grp_DelegationInfo>()
-                        .Where(x => x.IsDel == 0 && diid.Contains(x.Id)).ToList() 
+                        .Where(x => x.IsDel == 0 && diid.Contains(x.Id)).ToList()
                     : new List<Grp_DelegationInfo>();
                 List<ShareGroupInfoIIView> grp_Delegations = _mapper.Map<List<ShareGroupInfoIIView>>(_Delegations);
 
@@ -203,9 +217,10 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 List<SetDataInfoView> ssdv = _mapper.Map<List<Sys_SetData>, List<SetDataInfoView>>(ssd);
 
                 var carTouristGuides = _sqlSugar.Queryable<Grp_CarTouristGuideGroundReservationsContent>()
-                                             .LeftJoin<Sys_SetData>((a,b) => b.IsDel == 0 && a.SId == b.Id)
+                                             .LeftJoin<Sys_SetData>((a, b) => b.IsDel == 0 && a.SId == b.Id)
                                              .Where(a => a.IsDel == 0 && a.CTGGRId == dto.Id)
-                                             .Select((a, b) => new CarTouristGuideGroundReservationsContentView {
+                                             .Select((a, b) => new CarTouristGuideGroundReservationsContentView
+                                             {
                                                  SId = a.SId,
                                                  Id = a.Id,
                                                  Count = a.Count,
@@ -217,9 +232,9 @@ namespace OASystem.Infrastructure.Repositories.Groups
                                              })
                                              .ToList();
 
-                var weikuanSign = new int[] { 1070, 1071,};
+                var weikuanSign = new int[] { 1070, 1071, };
                 TableInitialization.RemoveAll(x => weikuanSign.Contains(x.Id));
-                var weiKuanArr = _TableInitialization.Where(x => weikuanSign.Contains(x.Id) ).ToList();
+                var weiKuanArr = _TableInitialization.Where(x => weikuanSign.Contains(x.Id)).ToList();
                 var weiKuanResultArr = carTouristGuides.Where(x => weikuanSign.Contains(x.SId)).ToList();
                 carTouristGuides.RemoveAll(x => weikuanSign.Contains(x.SId));
 
@@ -301,7 +316,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 carTouristGuides = groupResult.Values.SelectMany(sublist => sublist).OrderBy(x => x.SId).ThenBy(x => x.DatePrice).ToList();
 
                 var _CreditCardPayment = _sqlSugar.Queryable<Grp_CreditCardPayment, Sys_SetData, Sys_SetData>(
-                    (g, s1, s2) => new JoinQueryInfos (
+                    (g, s1, s2) => new JoinQueryInfos(
                         JoinType.Left, g.PayDId == s1.Id,
                         JoinType.Left, g.PaymentCurrency == s2.Id
                     ))
@@ -464,7 +479,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 //三公费用金额以及币种
                 var boolParse = int.TryParse(grpCarOp.Area, out int natiId);
                 var NationalTravelFee = _sqlSugar.Queryable<Grp_NationalTravelFee>()
-                    .LeftJoin<Sys_SetData>((a, b) => a.Currency == b.Id )
+                    .LeftJoin<Sys_SetData>((a, b) => a.Currency == b.Id)
                     .Where((a, b) => a.IsDel == 0 && b.IsDel == 0)
                     .Select((a, b) => new
                     {
@@ -484,12 +499,12 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 };
 
                 var bankCard = _sqlSugar.Queryable<Sys_SetData>().Where(x => x.IsDel == 0 && x.STid == 15)
-                    .Select(x=> new
-                            {
-                                x.Id,
-                                x.Name
-                            })
-                    .OrderByDescending(x=>x.Id)
+                    .Select(x => new
+                    {
+                        x.Id,
+                        x.Name
+                    })
+                    .OrderByDescending(x => x.Id)
                     .ToList();
 
                 if (dto.PortType == 1)
@@ -806,7 +821,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 #region 旧数据处理
                 string time = DateTime.Now.ToString("yyyy-MM-dd HH:mm ss");
                 var ids = carTouristList.Select(x1 => x1.Id);
-                _ = _sqlSugar.Updateable<Grp_CarTouristGuideGroundReservationsContent>().Where(x => x.DiId == dto.DiId && x.CTGGRId == dto.CTGGRId  && !ids.Contains(x.Id) && x.IsDel == 0).SetColumns(x => new Grp_CarTouristGuideGroundReservationsContent
+                _ = _sqlSugar.Updateable<Grp_CarTouristGuideGroundReservationsContent>().Where(x => x.DiId == dto.DiId && x.CTGGRId == dto.CTGGRId && !ids.Contains(x.Id) && x.IsDel == 0).SetColumns(x => new Grp_CarTouristGuideGroundReservationsContent
                 {
                     IsDel = 1,
                     DeleteTime = time,
@@ -854,9 +869,9 @@ namespace OASystem.Infrastructure.Repositories.Groups
                     };
 
                     List<Tuple<int, string, int, decimal>> arr = new List<Tuple<int, string, int, decimal>>();
-                    arr.Add(new Tuple<int, string, int,decimal>(1074, "早餐超支费用", 1077, 1M));  // sid name setdataid 系数
-                    arr.Add(new Tuple<int, string, int,decimal>(1075, "午餐超支费用", 1078, 1M));
-                    arr.Add(new Tuple<int, string, int,decimal>(1076, "晚餐超支费用", 1079, 1M));
+                    arr.Add(new Tuple<int, string, int, decimal>(1074, "早餐超支费用", 1077, 1M));  // sid name setdataid 系数
+                    arr.Add(new Tuple<int, string, int, decimal>(1075, "午餐超支费用", 1078, 1M));
+                    arr.Add(new Tuple<int, string, int, decimal>(1076, "晚餐超支费用", 1079, 1M));
                     arr.Add(new Tuple<int, string, int, decimal>(982, "车超时费用", 1050, 2.4M));
                     arr.Add(new Tuple<int, string, int, decimal>(1059, "导游超时费用", 1072, 1M));
                     arr.Add(new Tuple<int, string, int, decimal>(1085, "景点门票超支费用", 1086, 1.2M));
@@ -890,7 +905,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                             PriceDetailType = item.Item3,
                             Remark = x.PriceContent,
                             Area = opSingleCityId
-                        
+
                         }).ToList();
 
                         if (a.Count > 0)
@@ -945,26 +960,26 @@ namespace OASystem.Infrastructure.Repositories.Groups
                         {
                             remake += $"{start.ToString("M/d")}午餐和晚餐,";
                             exitMealCount += 2;
-                            price += (aMeal * 2  * di.VisitPNumber) - (mealPriceWu * dto.Rate) - (mealPriceWan * dto.Rate);
+                            price += (aMeal * 2 * di.VisitPNumber) - (mealPriceWu * dto.Rate) - (mealPriceWan * dto.Rate);
                         }
                         else if (isExistsWu)
                         {
                             remake += $"{start.ToString("M/d")}午餐,";
                             exitMealCount += 1;
-                            price += (aMeal  * di.VisitPNumber) - (mealPriceWu * dto.Rate);
+                            price += (aMeal * di.VisitPNumber) - (mealPriceWu * dto.Rate);
                         }
                         else if (isExistsWan)
                         {
                             remake += $"{start.ToString("M/d")}晚餐,";
                             exitMealCount += 1;
-                            price += (aMeal * di.VisitPNumber)  - (mealPriceWan * dto.Rate);
+                            price += (aMeal * di.VisitPNumber) - (mealPriceWan * dto.Rate);
                         }
 
                         start = start.AddDays(1);
                         //day++;
                     }
 
-                    var priceTypeArr = new int[] { 1061 , 1069 };
+                    var priceTypeArr = new int[] { 1061, 1069 };
 
                     if (exitMealCount > 0 && priceTypeArr.Contains(opSingle.PriceType))
                     {
@@ -981,10 +996,10 @@ namespace OASystem.Infrastructure.Repositories.Groups
                             DiId = dto.DiId,
                             FilePath = string.Empty,
                             IsDel = 0,
-                            PriceCount = di.VisitPNumber * exitMealCount * -1 ,
+                            PriceCount = di.VisitPNumber * exitMealCount * -1,
                             Price = priceInt,
                             PriceDt = opSingle.ServiceStartTime.ObjToDate(),
-                            PriceCurrency = findSetDataCurr == null ? dto.toCurr: findSetDataCurr.Id ,
+                            PriceCurrency = findSetDataCurr == null ? dto.toCurr : findSetDataCurr.Id,
                             PriceSum = (di.VisitPNumber * exitMealCount * -1) * priceInt,
                             PriceName = di.TeamName + "-" + priceCity + "-" + $"退餐费(地接导入)",
                             PriceType = 1028,
@@ -994,7 +1009,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                         });
                     }
 
-                    var needToConfirm = new int[] { 1088, 1050 }; 
+                    var needToConfirm = new int[] { 1088, 1050 };
 
                     if (groupExtraCostsArr.Count > 0)
                     {
@@ -1071,8 +1086,8 @@ namespace OASystem.Infrastructure.Repositories.Groups
 
                         _foreignReceivablesRepository.OverSpSeteceivables(new OverSpSeteceivablesDto
                         {
-                             CreateUserId = dto.CreateUserId,
-                             DiId = dto.DiId,
+                            CreateUserId = dto.CreateUserId,
+                            DiId = dto.DiId,
                         });
                     }
 
@@ -1133,7 +1148,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 Regex regex = new Regex("^[\u4e00-\u9fa5]{0,}$");
 
                 #region 修改C表数据
-                
+
                 Grp_CreditCardPayment c = new Grp_CreditCardPayment();
                 c.PaymentCurrency = dto.Currency;
                 for (int i = 0; i < dto.SelectCheck.Count; i++)
@@ -1282,7 +1297,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
             catch (Exception ex)
             {
                 RollbackTran();
-                result = new Result() { Code = -2, Msg = $"接口异常!({ex.Message})"};
+                result = new Result() { Code = -2, Msg = $"接口异常!({ex.Message})" };
             }
             return result;
         }
@@ -1405,7 +1420,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
             if (costDto.costSign != 3)
             {
                 //获取新汇率  int diId,int CId, int currencyId
-                Result rate =  await _setDataRep.PostCurrencyByDiid(costDto.diId, 1015, costDto.currency);
+                Result rate = await _setDataRep.PostCurrencyByDiid(costDto.diId, 1015, costDto.currency);
 
                 if (rate.Code == 0)
                 {
@@ -1524,7 +1539,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
             Result rt = new Result();
             foreach (var item in dto)
             {
-                await  _daiRep.UpdateAsync<Fin_GroupExtraCost>(s => s.PriceName == item.priceName && s.DiId == item.diId, 
+                await _daiRep.UpdateAsync<Fin_GroupExtraCost>(s => s.PriceName == item.priceName && s.DiId == item.diId,
                     s => new Fin_GroupExtraCost
                     {
                         IsDel = 1,

+ 4 - 4
OASystem/OASystem.Infrastructure/Repositories/Resource/CarDataRepository.cs

@@ -24,10 +24,10 @@ namespace OASystem.Infrastructure.Repositories.Resource
         public async Task<Result> QueryCarData(QueryCarDataDto dto)
         {
             string sqlWhere = string.Empty;
-            if (!string.IsNullOrWhiteSpace(dto.UnitName)) sqlWhere += string.Format(@" And UnitName like '%{0}%'", dto.UnitName);
-            if (!string.IsNullOrWhiteSpace(dto.UnitArea) && dto.UnitArea != "全部") sqlWhere += string.Format(@" And UnitArea like '%{0}%'", dto.UnitArea);
-            if (!string.IsNullOrWhiteSpace(dto.Contact)) sqlWhere += string.Format(@" And Contact like '%{0}%'", dto.Contact);
-            if (!string.IsNullOrWhiteSpace(dto.ContactTel)) sqlWhere += string.Format(@" And ContactTel like '%{0}%'", dto.ContactTel);
+            if (!string.IsNullOrWhiteSpace(dto.UnitName)) sqlWhere += string.Format(@" And UnitName like '%{0}%'", AesEncryptionHelper.Encrypt(dto.UnitName));
+            if (!string.IsNullOrWhiteSpace(dto.UnitArea) && dto.UnitArea != "全部") sqlWhere += string.Format(@" And UnitArea like '%{0}%'", AesEncryptionHelper.Encrypt(dto.UnitArea));
+            if (!string.IsNullOrWhiteSpace(dto.Contact)) sqlWhere += string.Format(@" And Contact like '%{0}%'", AesEncryptionHelper.Encrypt(dto.Contact));
+            if (!string.IsNullOrWhiteSpace(dto.ContactTel)) sqlWhere += string.Format(@" And ContactTel like '%{0}%'", AesEncryptionHelper.Encrypt(dto.ContactTel));
 
             sqlWhere += string.Format(@" And IsDel={0}", 0);
             if (!string.IsNullOrEmpty(sqlWhere.Trim()))

+ 1 - 1
OASystem/OASystem.Infrastructure/Repositories/Resource/HotelDataRepository.cs

@@ -71,7 +71,7 @@ WHERE
             {
                 string selectSql = string.Format(@"select * from Res_HotelData where Name='{0}' and IsDel='{1}'"
                                                    , dto.Name, 0);
-                var HotelData = await _sqlSugar.Queryable<Res_HotelData>().Where(x => x.IsDel == 0 && x.Name.Contains(dto.Name)).FirstAsync();//查询是否存在
+                var HotelData = await _sqlSugar.Queryable<Res_HotelData>().Where(x => x.IsDel == 0 && x.Name.Contains(AesEncryptionHelper.Encrypt(dto.Name))).FirstAsync();//查询是否存在
                 if (HotelData != null)
                 {
                     return result = new Result() { Code = -1, Msg = "该信息已存在,请勿重复添加!" };

+ 4 - 4
OASystem/OASystem.Infrastructure/Repositories/Resource/LocalGuideDataRepository.cs

@@ -61,10 +61,10 @@ namespace OASystem.Infrastructure.Repositories.Resource
         {
             Result result = new Result() { Code = -2, Msg = "未知错误" };
             string sqlWhere = string.Empty;
-            if (!string.IsNullOrWhiteSpace(dto.UnitName)) sqlWhere += string.Format(@" And UnitName like '%{0}%'", dto.UnitName);
-            if (!string.IsNullOrWhiteSpace(dto.UnitArea) && dto.UnitArea != "全部") sqlWhere += string.Format(@" And UnitArea like '%{0}%'", dto.UnitArea);
-            if (!string.IsNullOrWhiteSpace(dto.Contact)) sqlWhere += string.Format(@" And Contact like '%{0}%'", dto.Contact);
-            if (!string.IsNullOrWhiteSpace(dto.ContactTel)) sqlWhere += string.Format(@" And ContactTel like '%{0}%'", dto.ContactTel);
+            if (!string.IsNullOrWhiteSpace(dto.UnitName)) sqlWhere += string.Format(@" And UnitName like '%{0}%'", AesEncryptionHelper.Encrypt(dto.UnitName));
+            if (!string.IsNullOrWhiteSpace(dto.UnitArea) && dto.UnitArea != "全部") sqlWhere += string.Format(@" And UnitArea like '%{0}%'", AesEncryptionHelper.Encrypt(dto.UnitArea));
+            if (!string.IsNullOrWhiteSpace(dto.Contact)) sqlWhere += string.Format(@" And Contact like '%{0}%'", AesEncryptionHelper.Encrypt(dto.Contact));
+            if (!string.IsNullOrWhiteSpace(dto.ContactTel)) sqlWhere += string.Format(@" And ContactTel like '%{0}%'", AesEncryptionHelper.Encrypt(dto.ContactTel));
             sqlWhere += string.Format(@" And IsDel={0}", 0);
             if (!string.IsNullOrEmpty(sqlWhere.Trim()))
             {