64 lines
2.8 KiB
C#
64 lines
2.8 KiB
C#
|
|
using System;
|
|||
|
|
using System.Collections.Generic;
|
|||
|
|
using System.Linq;
|
|||
|
|
using System.Text;
|
|||
|
|
using WMS.Model.Report;
|
|||
|
|
using System.Data;
|
|||
|
|
using WMS.IData.IReport;
|
|||
|
|
using WMS.IData;using Oracle.ManagedDataAccess.Client;
|
|||
|
|
|
|||
|
|
namespace WMS.SqlServerData.ReportData
|
|||
|
|
{
|
|||
|
|
public class CKReportData : ICKReport
|
|||
|
|
{
|
|||
|
|
public DataTable GetReport(CKReportModel model)
|
|||
|
|
{
|
|||
|
|
string strSql =@"select * from
|
|||
|
|
view_ckreport where 1=1 and ";
|
|||
|
|
if (model != null)
|
|||
|
|
{
|
|||
|
|
//if (model.Create_date != null)
|
|||
|
|
//{
|
|||
|
|
// if (model.Create_date.ToString() != "0001/1/1 0:00:00")
|
|||
|
|
// {
|
|||
|
|
strSql += " ware_date between to_date('" + model.StartDateTime.ToString("yyyy-MM-dd HH:mm:ss") + "', 'yyyy-MM-dd HH24:mi:ss') and to_date('" + model.EndDateTime.ToString("yyyy-MM-dd HH:mm:ss") + "', 'yyyy-MM-dd HH24:mi:ss')";
|
|||
|
|
// strSql += " and to_char(ware_date,'yyyy-MM-dd') >='" + model.StartDateTime.ToString("yyyy-MM-dd")+"'";
|
|||
|
|
// and to_char(DateTime,'yyyy-MM-dd') >= '" + model.StartDateTime.ToString("yyyy-MM-dd") + "'";
|
|||
|
|
//strSql += " and to_char(ware_date,'yyyy-MM-dd') <= '" + model.EndDateTime.ToString("yyyy-MM-dd") + "'";
|
|||
|
|
// }
|
|||
|
|
// }
|
|||
|
|
if (!string.IsNullOrEmpty(model.GOOD_ID))
|
|||
|
|
{
|
|||
|
|
strSql += " and goods_id = '" + model.GOOD_ID + "'";
|
|||
|
|
}
|
|||
|
|
if (!string.IsNullOrEmpty(model.Storage_id))
|
|||
|
|
{
|
|||
|
|
strSql += " and storage_id = '" + model.Storage_id + "'";
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
strSql += " ORDER BY ware_DATE DESC ";
|
|||
|
|
}
|
|||
|
|
DataTable dt = SystemDataObject.Instance.GetDataTable(strSql);
|
|||
|
|
return dt;
|
|||
|
|
}
|
|||
|
|
public DataTable GetReport2(string date1,string date2)
|
|||
|
|
{
|
|||
|
|
string strSql = @"select * from
|
|||
|
|
view_ckreport where 1=1 and ";
|
|||
|
|
|
|||
|
|
strSql += " ware_date between to_date('" + date1 + "', 'yyyy-MM-dd HH24:mi:ss') and to_date('" + date2 + "', 'yyyy-MM-dd HH24:mi:ss')";
|
|||
|
|
// strSql += " and to_char(ware_date,'yyyy-MM-dd') >='" + model.StartDateTime.ToString("yyyy-MM-dd")+"'";
|
|||
|
|
// and to_char(DateTime,'yyyy-MM-dd') >= '" + model.StartDateTime.ToString("yyyy-MM-dd") + "'";
|
|||
|
|
//strSql += " and to_char(ware_date,'yyyy-MM-dd') <= '" + model.EndDateTime.ToString("yyyy-MM-dd") + "'";
|
|||
|
|
// }
|
|||
|
|
// }
|
|||
|
|
|
|||
|
|
|
|||
|
|
strSql += " ORDER BY WARE_DATE DESC ";
|
|||
|
|
|
|||
|
|
DataTable dt = SystemDataObject.Instance.GetDataTable(strSql);
|
|||
|
|
return dt;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|