20260831功能同步:
1. 不同车间区分料框查询、料框解绑接口 2. 注释电池型号逻辑 3. 打开电池状况界面
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace JinYuan.DAL.Service
|
||||
{
|
||||
public class BaseService<T> : IBaseService<T> where T : class, new()
|
||||
{
|
||||
protected readonly ISqlSugarClient _db;
|
||||
public BaseService(ISqlSugarClient db) { _db = db; }
|
||||
|
||||
public virtual bool Add(T model)
|
||||
{
|
||||
return _db.Insertable(model).ExecuteCommand() > 0;
|
||||
}
|
||||
|
||||
public virtual DataTable GetDataTable()
|
||||
{
|
||||
return _db.Queryable<T>().ToDataTable();
|
||||
}
|
||||
|
||||
public virtual List<T> GetList()
|
||||
{
|
||||
return _db.Queryable<T>().ToList();
|
||||
}
|
||||
|
||||
public virtual bool SoftDelete(int id)
|
||||
{
|
||||
return _db.Deleteable<T>().In(id).ExecuteCommand() > 0;
|
||||
}
|
||||
|
||||
public virtual bool Update(T model)
|
||||
{
|
||||
return _db.Updateable(model).ExecuteCommand() > 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user