This commit is contained in:
@ -9,13 +9,13 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace Epost.DAL
|
||||
{
|
||||
public class AddressstorageDAL
|
||||
public class AddressstorageDAL
|
||||
{
|
||||
//DB db = new DB();
|
||||
DataBaseOpration.OprationSqlDAL db = DB_DLL.GetInstance();
|
||||
|
||||
#region 查询设备所在区
|
||||
public DataTable getBlock(string address,string type,string controlip)
|
||||
public DataTable getBlock(string address, string type, string controlip)
|
||||
{
|
||||
string sql = "";
|
||||
if (string.IsNullOrEmpty(type))
|
||||
@ -40,13 +40,13 @@ namespace Epost.DAL
|
||||
#endregion
|
||||
|
||||
#region 根据地址查询货位信息
|
||||
public DataTable getLocationList(string address,string controlIP)
|
||||
public DataTable getLocationList(string address, string controlIP)
|
||||
{
|
||||
string sql = string.Format(" select * from addressstorage as addr left join controller as con on con.ID=addr.controlid where type=4 and address = '{0}' and ControlIP='{1}'",
|
||||
address,
|
||||
controlIP
|
||||
);
|
||||
// LogHelper.WriteLogInfo("根据地址查询货位信息" + sql);
|
||||
// LogHelper.WriteLogInfo("根据地址查询货位信息" + sql);
|
||||
return db.GetsqlForDT(sql);
|
||||
}
|
||||
|
||||
@ -71,9 +71,9 @@ namespace Epost.DAL
|
||||
{
|
||||
string sql = string.Format(" select * from v_address where location = '{0}'",
|
||||
location
|
||||
|
||||
|
||||
);
|
||||
// LogHelper.WriteLogInfo("根据货位号查询标签地址" + sql);
|
||||
// LogHelper.WriteLogInfo("根据货位号查询标签地址" + sql);
|
||||
return db.GetsqlForDT(sql);
|
||||
}
|
||||
|
||||
@ -92,16 +92,16 @@ namespace Epost.DAL
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region 根据地址、通道查询信息
|
||||
public DataTable getAddressListByway(string location, string block, string area,string way)
|
||||
public DataTable getAddressListByway(string location, string block, string area, string way)
|
||||
{
|
||||
string sql = string.Format(" select * from addressstorage where location = '{0}' and block='{1}' and area='{2}' and way='{3}'",
|
||||
location,
|
||||
block,
|
||||
area,way
|
||||
area, way
|
||||
);
|
||||
// LogHelper.WriteLogInfo("根据地址、通道查询信息:" + sql);
|
||||
// LogHelper.WriteLogInfo("根据地址、通道查询信息:" + sql);
|
||||
return db.GetsqlForDT(sql);
|
||||
}
|
||||
|
||||
@ -111,7 +111,7 @@ namespace Epost.DAL
|
||||
public DataTable getControlList()
|
||||
{
|
||||
string sql = string.Format("select * from Controller");
|
||||
// LogHelper.WriteLogInfo("获取控制器列表" + sql);
|
||||
// LogHelper.WriteLogInfo("获取控制器列表" + sql);
|
||||
return db.GetsqlForDT(sql);
|
||||
}
|
||||
#endregion
|
||||
@ -158,32 +158,36 @@ namespace Epost.DAL
|
||||
|
||||
|
||||
#region 根据区域 查询显示箱号地址
|
||||
public DataTable GetBoxAddress(string block,string area,int type)
|
||||
public DataTable GetBoxAddress(string block, string area, int type)
|
||||
{
|
||||
string strwhere = string.Empty;
|
||||
if (!string.IsNullOrEmpty(area))
|
||||
{
|
||||
strwhere = " and area='"+area+"'";
|
||||
strwhere += " and area='" + area + "'";
|
||||
}
|
||||
string sql = string.Format("select address,bkaddress,state,type,area,way,shelfid,ControlID,location,layer,slist,block,addresstype,ControlIP,ControlType,info from V_address where type='{1}' and block='{0}' " + strwhere,
|
||||
if (!string.IsNullOrEmpty(block))
|
||||
{
|
||||
strwhere += " and block='" + block + "'";
|
||||
}
|
||||
string sql = string.Format("select address,bkaddress,state,type,area,way,shelfid,ControlID,location,layer,slist,block,addresstype,ControlIP,ControlType,info from V_address where type='{1}' " + strwhere,
|
||||
block,
|
||||
|
||||
|
||||
type);
|
||||
LogHelper.WriteLogInfo("根据区域 查询显示地址"+sql);
|
||||
LogHelper.WriteLogInfo("根据区域 查询显示地址---通道灯" + sql);
|
||||
return db.GetsqlForDT(sql);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region 根据区域 查询显示箱号地址
|
||||
public DataTable getAddresslist(string block, string area,string type)
|
||||
public DataTable getAddresslist(string block, string area, string type)
|
||||
{
|
||||
|
||||
|
||||
string sql = string.Format(" select * from V_Address where location in (select min(location) from V_Address group by address) and block = '{0}' and area = '{1}' and type ='{2}'",
|
||||
block,
|
||||
area,type);
|
||||
|
||||
// LogHelper.WriteLogInfo("根据区域 查询显示箱号地址" + sql);
|
||||
area, type);
|
||||
|
||||
// LogHelper.WriteLogInfo("根据区域 查询显示箱号地址" + sql);
|
||||
return db.GetsqlForDT(sql);
|
||||
}
|
||||
|
||||
@ -195,7 +199,7 @@ namespace Epost.DAL
|
||||
string sql = string.Format("select * from V_Address where block='{0}' and area='{1}' and type in(2,4)",
|
||||
block,
|
||||
area);
|
||||
// LogHelper.WriteLogInfo("根据区域 查询显示箱号地址" + sql);
|
||||
// LogHelper.WriteLogInfo("根据区域 查询显示箱号地址" + sql);
|
||||
return db.GetsqlForDT(sql);
|
||||
}
|
||||
|
||||
@ -206,7 +210,7 @@ namespace Epost.DAL
|
||||
public DataTable GetScanList()
|
||||
{
|
||||
string sql = string.Format("select * from V_Address where type =6");
|
||||
|
||||
|
||||
return db.GetsqlForDT(sql);
|
||||
}
|
||||
|
||||
@ -223,9 +227,9 @@ namespace Epost.DAL
|
||||
#endregion
|
||||
|
||||
#region 根据区域获取扫描枪地址
|
||||
public DataTable GetScanListByArea(string block,string area)
|
||||
public DataTable GetScanListByArea(string block, string area)
|
||||
{
|
||||
string sql = string.Format("select * from V_Address where type =6 and block='"+block+"' and area = '"+area+"'");
|
||||
string sql = string.Format("select * from V_Address where type =6 and block='" + block + "' and area = '" + area + "'");
|
||||
|
||||
return db.GetsqlForDT(sql);
|
||||
}
|
||||
@ -253,7 +257,7 @@ namespace Epost.DAL
|
||||
#region 获取所有小区
|
||||
public DataTable GetAreaList()
|
||||
{
|
||||
string sql = string.Format("select area,block from Addressstorage where type=1 group by area,block");
|
||||
string sql = string.Format("select area,block from Addressstorage where type=1 group by area,block");
|
||||
return db.GetsqlForDT(sql);
|
||||
}
|
||||
#endregion
|
||||
@ -274,13 +278,13 @@ namespace Epost.DAL
|
||||
#region 获取所有通道
|
||||
public DataTable GetWayList()
|
||||
{
|
||||
string sql = string.Format("select way from Addressstorage group by way");
|
||||
string sql = string.Format("select way from Addressstorage group by way");
|
||||
return db.GetsqlForDT(sql);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 分页获取数据列表
|
||||
|
||||
|
||||
public List<AddressstorageModel> GetCityListByPage(string strWhere, string orderby, int startIndex, int endIndex, out int recordCount)
|
||||
{
|
||||
|
||||
@ -304,7 +308,7 @@ namespace Epost.DAL
|
||||
}
|
||||
strSql.Append(" ) TT");
|
||||
strSql.AppendFormat(" WHERE TT.Row between {0} and {1}", startIndex, endIndex);
|
||||
List<AddressstorageModel> list = ModelConvertHelper<AddressstorageModel>.ConvertToList(db.GetsqlForDT(strSql.ToString()));
|
||||
List<AddressstorageModel> list = ModelConvertHelper<AddressstorageModel>.ConvertToList(db.GetsqlForDT(strSql.ToString()));
|
||||
|
||||
strSql.Remove(0, strSql.Length);
|
||||
strSql.Append("SELECT COUNT(*) FROM Addressstorage AS T ");
|
||||
@ -333,12 +337,12 @@ namespace Epost.DAL
|
||||
|
||||
//---
|
||||
#region 获取每个小区对应的每个大区(根据小区从小到大排序对应的大区)
|
||||
public List<AddressstorageModel> GetBlockByAreaList()
|
||||
public List<AddressstorageModel> GetBlockByAreaList()
|
||||
{
|
||||
//string sql = string.Format("select cast(area as Int) as 'Area_area',block from Addressstorage group by block,area order by 'Area_area',block");
|
||||
string sql = string.Format("select cast(way as Int) as 'Area_area',area from Addressstorage where type in(1,2) group by way,area order by Area_area,area");
|
||||
List<AddressstorageModel> list = ModelConvertHelper<AddressstorageModel>.ConvertToList(db.GetsqlForDT(sql));
|
||||
|
||||
|
||||
return list;
|
||||
}
|
||||
#endregion
|
||||
@ -428,7 +432,7 @@ namespace Epost.DAL
|
||||
#region 根据条件删除货位
|
||||
public bool Locational_Binding_Save(string one, string two, string three, string four, string five, string six)
|
||||
{
|
||||
|
||||
|
||||
#region one
|
||||
string sql1 = "update Addressstorage ";
|
||||
try
|
||||
@ -576,7 +580,7 @@ namespace Epost.DAL
|
||||
//}
|
||||
strSql.Append(" ) TT");
|
||||
string sq = strSql.Append(" WHERE TT.Row between {0} and {1}").ToString();
|
||||
string sq1= string.Format(sq, startIndex, endIndex);
|
||||
string sq1 = string.Format(sq, startIndex, endIndex);
|
||||
string sq3 = string.Format(sq, 0, 100000);
|
||||
|
||||
List<AddressstorageModel> list = ModelConvertHelper<AddressstorageModel>.ConvertToList(db.GetsqlForDT(sq1.ToString()));
|
||||
@ -639,7 +643,7 @@ namespace Epost.DAL
|
||||
);
|
||||
// LogHelper.WriteLogInfo("根据地址查询货位信息" + sql);
|
||||
return db.GetsqlForDT(sql);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
@ -662,7 +666,7 @@ namespace Epost.DAL
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 设置所有的设备都为1
|
||||
@ -812,7 +816,7 @@ namespace Epost.DAL
|
||||
#region 根据订单获取要熄灭的标签
|
||||
public DataTable GetForcedendAddress(string orderid)
|
||||
{
|
||||
string sql = string.Format("select * from v_orders where orderid='20416' and oprationstate!=3");
|
||||
string sql = string.Format("select distinct ControlIP,address from v_orders where orderid='" + orderid + "' and oprationstate!=3");
|
||||
DataTable dt = db.GetsqlForDT(sql);
|
||||
return dt;
|
||||
}
|
||||
|
Reference in New Issue
Block a user