You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
88 lines
3.0 KiB
88 lines
3.0 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Data;
|
|
using System.Linq;
|
|
using System.Web;
|
|
using Dapper;
|
|
|
|
namespace Warehouse.DAL.CloseCondition
|
|
{
|
|
public class CloseConditionSqlDal
|
|
{
|
|
static DbUtility dbhelp = new DbUtility(System.Configuration.ConfigurationManager.ConnectionStrings["mesConn"].ToString(), DbProviderType.SqlServer);
|
|
#region 卡关条件表插入拼柜条件数据
|
|
public DataTable InsertLCLConditionDT(dynamic LCLCondition)
|
|
{
|
|
return dbhelp.ExecuteDataTable(InsertLCLConditionSql(LCLCondition), null);
|
|
}
|
|
|
|
public string InsertLCLConditionSql(dynamic LCLCondition)
|
|
{
|
|
|
|
string strWhere = string.Empty;
|
|
string sql = @"insert into [wh].[dbo].[closeconditions] values ('" + LCLCondition.powerGrade + "','" + LCLCondition.currentGrade + "','" + LCLCondition.color + "','"
|
|
+ LCLCondition.finalGrade + "','" + LCLCondition.cellQty + "','" + LCLCondition.barType + "','" + LCLCondition.moduleSpec + "','" + "拼柜" + "','"
|
|
+ LCLCondition.createtime + "','" + LCLCondition.operatorr +"')";
|
|
return sql;
|
|
}
|
|
#endregion
|
|
|
|
|
|
#region 卡关条件表插入入库条件数据
|
|
public DataTable InsertPUTConditionDT(dynamic PUTCondition)
|
|
{
|
|
return dbhelp.ExecuteDataTable(InsertPUTConditionSql(PUTCondition), null);
|
|
}
|
|
|
|
public string InsertPUTConditionSql(dynamic PUTCondition)
|
|
{
|
|
|
|
string strWhere = string.Empty;
|
|
string sql = @"insert into [wh].[dbo].[closeconditions] values ('" + PUTCondition.powerGrade + "','" + PUTCondition.currentGrade + "','" + PUTCondition.color + "','"
|
|
+ PUTCondition.finalGrade + "','" + PUTCondition.cellQty + "','" + PUTCondition.barType + "','" + PUTCondition.moduleSpec + "','" + "入库" + "','"
|
|
+ PUTCondition.createtime + "','" + PUTCondition.operatorr + "')";
|
|
return sql;
|
|
}
|
|
#endregion
|
|
|
|
#region 查询拼柜卡关条件
|
|
public DataTable SearchLCLInfoDT()
|
|
{
|
|
return dbhelp.ExecuteDataTable(SearchLCLInfoSql(), null);
|
|
}
|
|
|
|
public string SearchLCLInfoSql()
|
|
{
|
|
|
|
string strWhere = string.Empty;
|
|
string sql = @"
|
|
select s.power_grade,s.current_grade,s.color,s.final_grade,s.cellqty,s.bartype,s.module_spec
|
|
from (select v.*,row_number() over(partition by v.category order by v.createtime desc) rw
|
|
from [wh].[dbo].[closeconditions] v) s
|
|
where s.rw = '1' and s.category = '拼柜'
|
|
";
|
|
return sql;
|
|
}
|
|
#endregion
|
|
|
|
#region 查询入库卡关条件
|
|
public DataTable SearchPUTInfoDT()
|
|
{
|
|
return dbhelp.ExecuteDataTable(SearchPUTInfoSql(), null);
|
|
}
|
|
|
|
public string SearchPUTInfoSql()
|
|
{
|
|
|
|
string strWhere = string.Empty;
|
|
string sql = @"
|
|
select s.power_grade,s.current_grade,s.color,s.final_grade,s.cellqty,s.bartype,s.module_spec
|
|
from (select v.*,row_number() over(partition by v.category order by v.createtime desc) rw
|
|
from [wh].[dbo].[closeconditions] v) s
|
|
where s.rw = '1' and s.category = '入库'
|
|
";
|
|
return sql;
|
|
}
|
|
#endregion
|
|
}
|
|
}
|
|
|