Esempio n. 1
0
 /// <summary>
 /// 列值递减
 /// </summary>
 /// <param name="col">列名</param>
 /// <param name="val">递减值(缺省为1)</param>
 /// <returns></returns>
 public Sql Decr(string col, int val = 1)
 {
     _SetColumns.Add(string.Concat(DB.GetName(col), "=", DB.GetName(col), "-", val));
     return(this);
 }
Esempio n. 2
0
 /// <summary>
 /// 将列更新为计算值
 /// </summary>
 /// <param name="col">列名</param>
 /// <param name="formula">计算公式</param>
 /// <returns></returns>
 public Sql SetFunc(string col, string formula)
 {
     _SetColumns.Add(DB.SetColumnFunc(col, formula));
     return(this);
 }
Esempio n. 3
0
 /// <summary>
 /// 将列更新为指定值
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="col"></param>
 /// <param name="val"></param>
 /// <returns></returns>
 public Sql Set <T>(string col, T val)
 {
     _SetColumns.Add(DB.GetCondition(col));
     Params.Add(DB.GetParam(col, val));
     return(this);
 }