Cat.Business/Cat.Service/OAManage/OaApplyService.cs
(开头部分) 3KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Linq;
using System.Text;
using System.Data.Common;
using System.Linq.Expressions;
using System.Collections.Generic;
using System.Threading.Tasks;
using Cat.Util;
using Cat.Util.Extension;
using Cat.Util.Model;
using Cat.Data;
using Cat.Data.Repository;
using Cat.Entity.OAManage;
using Cat.Model.Param.OAManage;
namespace Cat.Service.OAManage
{
/// <summary>
/// 创 建:admin
/// 日 期:2022-01-26 14:47
/// 描 述:通用申请服务类
/// </summary>
public class OaApplyService : BaseModifyService<OaApplyEntity> //根据实体继承的基类选择相应的Service
{
#region 获取数据
public async Task<List<OaApplyEntity>> GetList(OaApplyListParam param)
{
var expression = ListFilter(param);
var list = await this.BaseRepository().FindList(expression);
return list.ToList();
}
public async Task<List<OaApplyEntity>> GetPageList(OaApplyListParam param, Pagination pagination)
{
string strSql = @"select a.* ,u.RealName as UserName,d.DepartmentName as DeptName
,case a.TypeId when 1 then '普通' when 2 then '中级' when 3 then '高级' else '无' end as TypeName
from OaApply a
left join SysUser u on a.UserId=u.Id
left join SysDepartment d on d.Id=a.DeptId
where 1=1 ";
if(param.UserId>0)
{
strSql += $"and a.UserId='{param.UserId}' ";
}
if(param.DeptId>0)
{
strSql += $"and a.DeptId='{param.DeptId}' ";
}
if(param.Code.IsNotNullOrEmpty())
{
strSql += $"and a.Code like '%{param.Code}%' ";
}
if(param.StartDate.HasValue)
{
strSql += $"and a.BeginDate>='{param.StartDate.Value}' ";
}
if(param.EndDate.HasValue)
{
strSql += $"and a.EndDate<='{param.EndDate.Value.AddDays(1)}' ";
}
后面还有 33 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。