样式统一
This commit is contained in:
@@ -16,6 +16,7 @@ public interface ITransactionRecordRepository : IBaseRepository<TransactionRecor
|
||||
/// <param name="type">筛选交易类型</param>
|
||||
/// <param name="year">筛选年份</param>
|
||||
/// <param name="month">筛选月份</param>
|
||||
/// <param name="reason">筛选交易摘要</param>
|
||||
/// <param name="sortByAmount">是否按金额降序排列,默认为false按时间降序</param>
|
||||
/// <returns>交易记录列表</returns>
|
||||
Task<List<TransactionRecord>> GetPagedListAsync(
|
||||
@@ -26,6 +27,7 @@ public interface ITransactionRecordRepository : IBaseRepository<TransactionRecor
|
||||
TransactionType? type = null,
|
||||
int? year = null,
|
||||
int? month = null,
|
||||
string? reason = null,
|
||||
bool sortByAmount = false);
|
||||
|
||||
/// <summary>
|
||||
@@ -36,7 +38,8 @@ public interface ITransactionRecordRepository : IBaseRepository<TransactionRecor
|
||||
string? classify = null,
|
||||
TransactionType? type = null,
|
||||
int? year = null,
|
||||
int? month = null);
|
||||
int? month = null,
|
||||
string? reason = null);
|
||||
|
||||
/// <summary>
|
||||
/// 获取所有不同的交易分类
|
||||
@@ -192,6 +195,7 @@ public class TransactionRecordRepository(IFreeSql freeSql) : BaseRepository<Tran
|
||||
TransactionType? type = null,
|
||||
int? year = null,
|
||||
int? month = null,
|
||||
string? reason = null,
|
||||
bool sortByAmount = false)
|
||||
{
|
||||
var query = FreeSql.Select<TransactionRecord>();
|
||||
@@ -201,7 +205,9 @@ public class TransactionRecordRepository(IFreeSql freeSql) : BaseRepository<Tran
|
||||
t => t.Reason.Contains(searchKeyword!) ||
|
||||
t.Classify.Contains(searchKeyword!) ||
|
||||
t.Card.Contains(searchKeyword!) ||
|
||||
t.ImportFrom.Contains(searchKeyword!));
|
||||
t.ImportFrom.Contains(searchKeyword!))
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(reason),
|
||||
t => t.Reason == reason);
|
||||
|
||||
// 按分类筛选
|
||||
if (!string.IsNullOrWhiteSpace(classify))
|
||||
@@ -250,7 +256,8 @@ public class TransactionRecordRepository(IFreeSql freeSql) : BaseRepository<Tran
|
||||
string? classify = null,
|
||||
TransactionType? type = null,
|
||||
int? year = null,
|
||||
int? month = null)
|
||||
int? month = null,
|
||||
string? reason = null)
|
||||
{
|
||||
var query = FreeSql.Select<TransactionRecord>();
|
||||
|
||||
@@ -259,7 +266,9 @@ public class TransactionRecordRepository(IFreeSql freeSql) : BaseRepository<Tran
|
||||
t => t.Reason.Contains(searchKeyword!) ||
|
||||
t.Classify.Contains(searchKeyword!) ||
|
||||
t.Card.Contains(searchKeyword!) ||
|
||||
t.ImportFrom.Contains(searchKeyword!));
|
||||
t.ImportFrom.Contains(searchKeyword!))
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(reason),
|
||||
t => t.Reason == reason);
|
||||
|
||||
// 按分类筛选
|
||||
if (!string.IsNullOrWhiteSpace(classify))
|
||||
|
||||
Reference in New Issue
Block a user