mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-19 18:22:23 +08:00
-
This commit is contained in:
@@ -21,6 +21,11 @@ namespace OrmTest.BugTest
|
||||
DbType = DbType.SqlServer,
|
||||
IsAutoCloseConnection = true
|
||||
});
|
||||
db.Aop.OnLogExecuting = (sql, pars) =>
|
||||
{
|
||||
Console.WriteLine(sql + "\r\n" + db.Utilities.SerializeObject(pars.ToDictionary(it => it.ParameterName, it => it.Value)));
|
||||
Console.WriteLine();
|
||||
};
|
||||
return db;
|
||||
}
|
||||
}
|
||||
@@ -108,7 +113,7 @@ namespace OrmTest.BugTest
|
||||
|
||||
Guid newCarTypePictureId = Guid.Empty;
|
||||
Guid carTypePictureId = Guid.Empty;
|
||||
DB.CodeFirst.InitTables(typeof(Picture));
|
||||
DB.CodeFirst.InitTables(typeof(Picture),typeof(JobPlan));
|
||||
DB.Updateable<Picture>()
|
||||
.UpdateColumns(p => p.Value == SqlFunc.Subqueryable<Picture>()
|
||||
.Where(pp => pp.ID == newCarTypePictureId)
|
||||
@@ -120,8 +125,40 @@ namespace OrmTest.BugTest
|
||||
.Select(pp => pp.Value))
|
||||
|
||||
.Where(p => p.ID == carTypePictureId).ExecuteCommand();
|
||||
var list = new List<JobPlan>()
|
||||
{
|
||||
new JobPlan() { },
|
||||
new JobPlan() { }
|
||||
};
|
||||
DB.Updateable(new JobPlan() { })
|
||||
.WhereColumns(s => new { s.CmdNo })
|
||||
.UpdateColumns(s => new
|
||||
{
|
||||
s.HeatNo,
|
||||
s.CmdNo
|
||||
}).ExecuteCommand();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 表示作业计划表,保存用户确认的作业计划。
|
||||
/// </summary>
|
||||
[SugarTable("PL_JOB_PLAN")]
|
||||
public class JobPlan
|
||||
{
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置炉次号。
|
||||
/// </summary>
|
||||
public string HeatNo { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置制造命令号。
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "PONO")]
|
||||
public string CmdNo { get; set; }
|
||||
}
|
||||
public partial class Picture
|
||||
{
|
||||
public Picture()
|
||||
|
Reference in New Issue
Block a user