hfhf

本篇博客通过一系列特殊字符和表情符号进行内容展示,虽然没有具体的技术信息,但可以通过这种方式来测试系统的兼容性和解析能力。
hfhfhfh :wink: :roll: :twisted: :evil: :!: :?: [quote]hfhfhfhfh[/quote]
/// <summary> /// 条件查询HF /// </summary> /// <param name="HF"></param> /// <returns></returns> public async Task<HFFenYe> hfFenYe(int currentPage, int PageSize, HF hF) { try { // 构建基础查询,排除"档案删除"的记录 //var query = myDbContext.HFs.Where(hf => hf.HumanFileStatus != "档案删除"); IQueryable<HF> query = myDbContext.HF; query = query.Where(hf=>hf.HumanFileStatus!= "档案删除"); // 动态添加筛选条件 if (!string.IsNullOrEmpty(hF.FirstKindName)) { query = query.Where(hf => hf.FirstKindName == hF.FirstKindName); } if (!string.IsNullOrEmpty(hF.SecondKindName)) { query = query.Where(hf => hf.SecondKindName == hF.SecondKindName); } if (!string.IsNullOrEmpty(hF.ThirdKindName)) { query = query.Where(hf => hf.ThirdKindName == hF.ThirdKindName); } if (hF.RegistTime.HasValue) { query = query.Where(hf => hf.RegistTime >= hF.RegistTime); } if (hF.CheckTime.HasValue) { query = query.Where(hf => hf.RegistTime <= hF.CheckTime); } // 获取总记录数 HFFenYe.sumTotal = await query.CountAsync(); // 分页查询并投影到HF对象 HFFenYe.List = await query.Select(h => new HF { FirstKindName = h.FirstKindName ?? string.Empty, SecondKindName = h.SecondKindName ?? string.Empty, ThirdKindName = h.ThirdKindName ?? string.Empty, SalaryStandardName = h.SalaryStandardName ?? string.Empty, HumanName = h.HumanName ?? string.Empty, RegistTime = h.RegistTime, Register = h.Register, HumanId = h.HumanId }).Skip((currentPage - 1) * PageSize).Take(PageSize).ToListAsync(); return HFFenYe; } catch (Exception ex) { // 记录异常日志 Console.WriteLine($"报错了: {ex.Message}"); throw; } } 这是我的代码
03-11
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值