12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Linq.Expressions;
- using System.Text;
- using System.Threading.Tasks;
- using YiSha.Data.Repository;
- using YiSha.Entity.OrganizationManage;
- using YiSha.Enum;
- using YiSha.Model.Param.OrganizationManage;
- using YiSha.Util.Extension;
- using YiSha.Util.Model;
- namespace YiSha.Service.OrganizationManage
- {
- public partial class UserBelongService
- {
- private IRepositoryFactory _baseRepository;
- public UserBelongService(IRepositoryFactory baseRepository)
- {
- _baseRepository = baseRepository;
- }
- #region 获取数据
- public async Task<List<UserBelongEntity>> GetListPartial(UserBelongEntity entity)
- {
- var expression = LinqExtensions.True<UserBelongEntity>();
- expression = expression.And(t => t.BaseIsDelete == (int)IsDeleteEnum.No);
- if (entity != null)
- {
- if (entity.BelongType != null)
- {
- expression = expression.And(t => t.BelongType == entity.BelongType);
- }
- if (entity.UserId != null)
- {
- expression = expression.And(t => t.UserId == entity.UserId);
- }
- }
- var list = await _baseRepository.BaseRepository(dbConnectType).FindList(expression);
- return list.ToList();
- }
- #endregion
- #region 提交数据
- #endregion
- #region 私有方法
- /// <summary>
- /// 列表条件过滤
- /// 建议该方法放在Partial部分类中,因为代码生成时当前类会被覆盖(该方法在生成时将会被注释)
- /// </summary>
- /// <param name="param"></param>
- /// <returns></returns>
- private Expression<Func<UserBelongEntity, bool>> ListFilterPartial(UserBelongListParam param)
- {
- var expression = LinqExtensions.True<UserBelongEntity>();
- expression = expression.And(t => t.BaseIsDelete == (int)IsDeleteEnum.No);
- if (param != null)
- {
- }
- return expression;
- }
- #endregion
- }
- }
|