2024-10-07 09:51:55 +08:00
|
|
|
|
using WcsMain.Common;
|
|
|
|
|
|
using WcsMain.DataBase.TableEntity;
|
2024-11-15 11:37:55 +08:00
|
|
|
|
using WcsMain.Constant.WcsAttribute.AutoFacAttribute;
|
2024-10-07 09:51:55 +08:00
|
|
|
|
|
|
|
|
|
|
namespace WcsMain.DataBase.Dao;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// tbl_app_stocker 操作类
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[Component]
|
|
|
|
|
|
public class AppStackerDao
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 插入数据
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="data"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public int? Insert(params AppStacker[] data)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
return CommonTool.DbServe.Insertable(data).ExecuteCommand();
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
_ = ex;
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 删除一条数据,根据主键
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="appStacker"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public int? Delete(AppStacker appStacker)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
return CommonTool.DbServe.Deleteable(appStacker).ExecuteCommand();
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
_ = ex;
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 修改一条数据
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="appStacker"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public int? Update(AppStacker appStacker)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
return CommonTool.DbServe.Updateable(appStacker).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
_ = ex;
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 根据条件查询 ---- 不包括站台
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="appStacker"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public List<AppStacker>? Select(AppStacker appStacker)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
var sqlFuc = CommonTool.DbServe.Queryable<AppStacker>()
|
|
|
|
|
|
.WhereIF(appStacker.StackerId != default, w => w.StackerId == appStacker.StackerId)
|
|
|
|
|
|
.WhereIF(appStacker.StackerName != default, w => w.StackerName == appStacker.StackerName)
|
|
|
|
|
|
.WhereIF(appStacker.StackerStatus != default, w => w.StackerStatus == appStacker.StackerStatus)
|
|
|
|
|
|
.WhereIF(appStacker.ForkStatus != default, w => w.ForkStatus == appStacker.ForkStatus)
|
|
|
|
|
|
.WhereIF(appStacker.ActionPlc != default, w => w.ActionPlc == appStacker.ActionPlc)
|
|
|
|
|
|
.WhereIF(appStacker.InStand != default, w => w.InStand == appStacker.InStand)
|
|
|
|
|
|
.WhereIF(appStacker.OutStand != default, w => w.OutStand == appStacker.OutStand)
|
|
|
|
|
|
.WhereIF(appStacker.Remark != default, w => w.Remark == appStacker.Remark);
|
|
|
|
|
|
return sqlFuc.ToList();
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
_ = ex;
|
|
|
|
|
|
return default;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 查询所有的数据
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public List<AppStacker>? Select() => Select(new AppStacker());
|
|
|
|
|
|
|
|
|
|
|
|
}
|