using System;
|
using System.Collections.Generic;
|
using System.Data;
|
using System.Linq;
|
using System.Text;
|
using System.Threading.Tasks;
|
using SqlSugar;
|
using IStation.Untity;
|
|
|
namespace IStation.DAL
|
{
|
/// <summary>
|
/// SIM缴费记录
|
/// </summary>
|
public partial class SimPaymentRecord : CorpDAL<Entity.SimPaymentRecord>
|
{
|
/// <summary>
|
///
|
/// </summary>
|
public override ConnectionConfig ConnectionConfig
|
{
|
get { return ConfigHelper.DefaultConnectionConfig; }
|
}
|
|
/// <summary>
|
/// 通过 CardID 获取
|
/// </summary>
|
public List<Entity.SimPaymentRecord> GetByCardID(long CorpID, long CardID)
|
{
|
using (var db = new SqlSugarClient(ConnectionConfig))
|
{
|
return db.Queryable<Entity.SimPaymentRecord>().Where(x => x.CorpID == CorpID && x.CardID == CardID).ToList();
|
}
|
}
|
|
/// <summary>
|
/// 通过 CardIds 获取
|
/// </summary>
|
public List<Entity.SimPaymentRecord> GetByCardIds(long CorpID, List<long> CardIds)
|
{
|
if (CardIds == null || CardIds.Count < 1)
|
return default;
|
using (var db = new SqlSugarClient(ConnectionConfig))
|
{
|
return db.Queryable<Entity.SimPaymentRecord>().Where(x => x.CorpID == CorpID && CardIds.Contains(x.CardID)).ToList();
|
}
|
}
|
|
/// <summary>
|
/// 通过 BelongType 和 BelongID 获取
|
/// </summary>
|
public List<Entity.SimPaymentRecord> GetByBelongTypeAndBelongID(long CorpID, string BelongType, long BelongID)
|
{
|
using (var db = new SqlSugarClient(ConnectionConfig))
|
{
|
return db.Queryable<Entity.SimPaymentRecord, Entity.Product>((x, y) => x.CardID == y.ID)
|
.Where((x, y) => y.CorpID == CorpID && y.BelongType == BelongType && y.BelongID == BelongID)
|
.Select(x => x).ToList();
|
}
|
}
|
|
|
|
|
|
}
|
}
|