init commit
This commit is contained in:
47
20220330_Vote/Ewide.RoadFlow/Data/FlowComment/FlowComment.cs
Normal file
47
20220330_Vote/Ewide.RoadFlow/Data/FlowComment/FlowComment.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
using Furion.DependencyInjection;
|
||||
using RoadFlow.Utility;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RoadFlow.Data
|
||||
{
|
||||
public class FlowComment:RoadFlowRepository<RoadFlow.Model.rf_flowcomment>,IFlowComment, ITransient
|
||||
{
|
||||
/// <summary>
|
||||
/// 得到一个用户可以使用的意见
|
||||
/// </summary>
|
||||
/// <param name="userId"></param>
|
||||
/// <returns></returns>
|
||||
public List<Model.rf_flowcomment> GetListByUserId(string userId)
|
||||
{
|
||||
var all = GetAll();
|
||||
return all.FindAll(p => p.UserId == string.Empty || p.UserId == userId).Distinct(new Model.rf_flowcomment()).OrderBy(p => p.AddType).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询一页数据
|
||||
/// </summary>
|
||||
/// <param name="count"></param>
|
||||
/// <param name="size"></param>
|
||||
/// <param name="number"></param>
|
||||
/// <param name="comment"></param>
|
||||
/// <param name="userId"></param>
|
||||
/// <param name="order"></param>
|
||||
/// <returns></returns>
|
||||
public List<Model.rf_flowcomment> GetPagerList(out int count, int size, int number, string comment, string userId, string order)
|
||||
{
|
||||
int total = 0;
|
||||
var rtn =db.Queryable<Model.rf_flowcomment>()
|
||||
.WhereIF(!comment.IsNullOrWhiteSpace(), x => x.Comments.Contains(comment))
|
||||
.WhereIF(userId.IsGuid(), x => x.UserId == userId)
|
||||
.OrderByIF(!order.IsNullOrWhiteSpace(), order)
|
||||
.ToPageList(number, size, ref total);
|
||||
count = total;
|
||||
return rtn;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user