修改
This commit is contained in:
@@ -10,40 +10,40 @@ using LeadDataBaseUtility;
|
||||
|
||||
namespace CleanMachine.DAL.SYS
|
||||
{
|
||||
/// <summary>
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class ParameterDAL
|
||||
{
|
||||
|
||||
|
||||
|
||||
public ParameterDAL()
|
||||
{
|
||||
|
||||
}
|
||||
#region 一般方法
|
||||
/// <summary>
|
||||
public class ParameterDAL
|
||||
{
|
||||
|
||||
|
||||
|
||||
public ParameterDAL()
|
||||
{
|
||||
|
||||
}
|
||||
#region 一般方法
|
||||
/// <summary>
|
||||
/// 存在
|
||||
/// </summary>
|
||||
public bool Exists(int ParameterId)
|
||||
public bool Exists(int ParameterId)
|
||||
{
|
||||
string strSql = @"SELECT count(1) from SYS_PARAMETER WHERE PARAMETER_ID=@ParameterId ";
|
||||
return LeadDbHelperSQLite.ExecuteScalar<int>(strSql, new { ParameterId }) > 0;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 添加一个数据
|
||||
/// </summary>
|
||||
public bool Add(CleanMachine.Model.SYS.Parameter model)
|
||||
{
|
||||
string strSql = $@"INSERT INTO SYS_PARAMETER
|
||||
string strSql = $@"INSERT INTO SYS_PARAMETER
|
||||
(PARAMETER_ID,PARAMETER_CODE,PARAMETER_NAME,PARAMETER_VALUE,PARAMETER_TYPE,USED_FLAG,DEL_FLAG,CREATE_BY,CREATE_TIME,UPDATE_BY,UPDATE_TIME,DATA_VERSION,REMARKS1,REMARKS2,REMARKS3,REMARKS4,REMARKS5)
|
||||
values
|
||||
(@ParameterId,@ParameterCode,@ParameterName,@ParameterValue,@ParameterType,@UsedFlag,@DelFlag,@CreateBy,@CreateTime,@UpdateBy,@UpdateTime,@DataVersion,@Remarks1,@Remarks2,@Remarks3,@Remarks4,@Remarks5) ";
|
||||
return LeadDbHelperSQLite.Execute(strSql, model) > 0;
|
||||
return LeadDbHelperSQLite.Execute(strSql, model) > 0;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 更新一个数据
|
||||
/// </summary>
|
||||
@@ -54,29 +54,44 @@ namespace CleanMachine.DAL.SYS
|
||||
WHERE PARAMETER_ID=@ParameterId ";
|
||||
return LeadDbHelperSQLite.Execute(strSql, model) > 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public bool Update(string ParameterCode, string Value)
|
||||
{
|
||||
string strSql = $@"UPDATE SYS_PARAMETER SET
|
||||
PARAMETER_VALUE=@ParameterValue
|
||||
WHERE PARAMETER_CODE=@ParameterCode ";
|
||||
return LeadDbHelperSQLite.Execute(strSql, new
|
||||
{
|
||||
ParameterCode = ParameterCode,
|
||||
ParameterValue = Value
|
||||
}) > 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 删除一个数据
|
||||
/// </summary>
|
||||
public bool Delete(string strWhere, object Params = null)
|
||||
public bool Delete(string strWhere, object Params = null)
|
||||
{
|
||||
string strSql = $@"DELETE FROM SYS_PARAMETER ";
|
||||
if (strWhere.Trim() != "")
|
||||
if (strWhere.Trim() != "")
|
||||
{
|
||||
strSql += $" WHERE {strWhere}";
|
||||
}
|
||||
return LeadDbHelperSQLite.Execute(strSql, Params) > 0;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 删除一个数据
|
||||
/// </summary>
|
||||
public bool Delete(int ParameterId)
|
||||
public bool Delete(int ParameterId)
|
||||
{
|
||||
return this.Delete("PARAMETER_ID=@ParameterId ", new { ParameterId }) ;
|
||||
return this.Delete("PARAMETER_ID=@ParameterId ", new { ParameterId });
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获得数据列表
|
||||
/// </summary>
|
||||
@@ -89,24 +104,24 @@ namespace CleanMachine.DAL.SYS
|
||||
}
|
||||
return LeadDbHelperSQLite.Query<CleanMachine.Model.SYS.Parameter>(strSql, Params);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取一个对象
|
||||
/// </summary>
|
||||
public CleanMachine.Model.SYS.Parameter GetModel(int ParameterId)
|
||||
|
||||
/// <summary>
|
||||
/// 获取一个对象
|
||||
/// </summary>
|
||||
public CleanMachine.Model.SYS.Parameter GetModel(int ParameterId)
|
||||
{
|
||||
return this.GetList("PARAMETER_ID=@ParameterId", new { ParameterId }).FirstOrDefault();
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询数据
|
||||
/// </summary>
|
||||
// public IEnumerable<CleanMachine.Model.SYS.Parameter> GetModelList(RuleGroup rule)
|
||||
// {
|
||||
// var tuper = _dbhelper.BuildRuleGroupStr(rule);
|
||||
// return this.GetList(tuper.where, tuper.Param);
|
||||
// }
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询数据
|
||||
/// </summary>
|
||||
// public IEnumerable<CleanMachine.Model.SYS.Parameter> GetModelList(RuleGroup rule)
|
||||
// {
|
||||
// var tuper = _dbhelper.BuildRuleGroupStr(rule);
|
||||
// return this.GetList(tuper.where, tuper.Param);
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user