Commit 02fd2c84 by 泽锋 李

fix

parent 2177a9e2
...@@ -11,55 +11,49 @@ namespace AutoTurnOver.DB ...@@ -11,55 +11,49 @@ namespace AutoTurnOver.DB
/// </summary> /// </summary>
public class dc_aims_transfer_warehouse_dao : connectionHelper public class dc_aims_transfer_warehouse_dao : connectionHelper
{ {
public static List<dc_aims_transfer_warehouse_log_dto> LogList(string platform, string bailun_sku, int offset, int limit, ref int total, DateTime? start_date, DateTime? end_date, string warehousecode, string warehousetype, int? warehousearea) public static List<dc_aims_transfer_warehouse_log_dto> LogList(dc_aims_transfer_warehouse_log_search_dto search_data, int offset, int limit, ref int total)
{ {
var sql = @"select t1.* var sql = @"select t1.*
from dc_aims_transfer_warehouse_log as t1 from dc_aims_transfer_warehouse_log as t1
left join dc_base_warehouse as t3 on t1.warehouse_code = t3.warehouse_code left join dc_base_warehouse as t3 on t1.to_warehouse_code = t3.warehouse_code
where 1=1 "; where 1=1 ";
var countSql = " select count(1) from dc_auto_shortage_push as t1 left join dc_base_warehouse as t3 on t1.warehouse_code = t3.warehouse_code where 1=1 "; var countSql = " select count(1) from dc_aims_transfer_warehouse_log as t1 left join dc_base_warehouse as t3 on t1.to_warehouse_code = t3.warehouse_code where 1=1 ";
DynamicParameters parameters = new DynamicParameters(); DynamicParameters parameters = new DynamicParameters();
if (!string.IsNullOrWhiteSpace(warehousecode)) if (!string.IsNullOrWhiteSpace(search_data.warehousecode))
{ {
sql += " and t1.warehouse_code=@warehouse_code "; sql += " and t1.to_warehouse_code=@warehouse_code ";
countSql += " and t1.warehouse_code=@warehouse_code "; countSql += " and t1.to_warehouse_code=@warehouse_code ";
parameters.Add("warehouse_code", warehousecode); parameters.Add("warehouse_code", search_data.warehousecode);
} }
if (!string.IsNullOrWhiteSpace(warehousetype)) if (!string.IsNullOrWhiteSpace(search_data.warehousetype))
{ {
sql += " and t3.hq_type = @hq_type "; sql += " and t3.hq_type = @hq_type ";
countSql += " and t3.hq_type = @hq_type "; countSql += " and t3.hq_type = @hq_type ";
parameters.Add("hq_type", warehousetype); parameters.Add("hq_type", search_data.warehousetype);
} }
if (warehousearea > 0) if (search_data.warehousearea > 0)
{ {
sql += " and t3.area_id = @area_id "; sql += " and t3.area_id = @area_id ";
countSql += " and t3.area_id = @area_id "; countSql += " and t3.area_id = @area_id ";
parameters.Add("area_id", warehousearea); parameters.Add("area_id", search_data.warehousearea);
} }
if (start_date != null) if (search_data.start_date != null)
{ {
sql += " and t1.push_date>=@btime "; sql += " and t1.`date`>=@btime ";
countSql += " and t1.push_date>=@btime "; countSql += " and t1.`date`>=@btime ";
parameters.Add("btime", start_date); parameters.Add("btime", search_data.start_date);
} }
if (end_date != null) if (search_data.end_date != null)
{ {
sql += " and t1.push_date<=@etime "; sql += " and t1.`date`<=@etime ";
countSql += " and t1.push_date<=@etime "; countSql += " and t1.`date`<=@etime ";
parameters.Add("etime", end_date); parameters.Add("etime", search_data.end_date);
} }
if (!string.IsNullOrWhiteSpace(platform)) if (!string.IsNullOrWhiteSpace(search_data.bailun_sku))
{
sql += " and t1.platform=@platform ";
countSql += " and t1.platform=@platform ";
parameters.Add("platform", platform);
}
if (!string.IsNullOrWhiteSpace(bailun_sku))
{ {
sql += " and t1.bailun_sku in @bailun_sku "; sql += " and t1.bailun_sku in @bailun_sku ";
countSql += " and t1.bailun_sku in @bailun_sku "; countSql += " and t1.bailun_sku in @bailun_sku ";
parameters.Add("bailun_sku", bailun_sku.Split(',')); parameters.Add("bailun_sku", search_data.bailun_sku.Split(','));
} }
sql += " order by t1.id desc "; sql += " order by t1.id desc ";
......
...@@ -14,6 +14,7 @@ namespace AutoTurnOver.Models ...@@ -14,6 +14,7 @@ namespace AutoTurnOver.Models
public string from_warehouse_code { get; set; } public string from_warehouse_code { get; set; }
public string from_warehouse_name { get; set; } public string from_warehouse_name { get; set; }
public string to_warehouse_name { get; set; } public string to_warehouse_name { get; set; }
public string to_warehouse_code { get; set; }
public string create_user { get; set; } public string create_user { get; set; }
public DateTime create_date { get; set; } public DateTime create_date { get; set; }
} }
...@@ -22,4 +23,14 @@ namespace AutoTurnOver.Models ...@@ -22,4 +23,14 @@ namespace AutoTurnOver.Models
{ {
} }
public class dc_aims_transfer_warehouse_log_search_dto
{
public string bailun_sku { get; set; }
public DateTime? start_date { get; set; }
public DateTime? end_date { get; set; }
public string warehousecode { get; set; }
public string warehousetype { get; set; }
public int? warehousearea { get; set; }
}
} }
...@@ -64,6 +64,11 @@ namespace AutoTurnOver.Services ...@@ -64,6 +64,11 @@ namespace AutoTurnOver.Services
return DB.daily.ShortagePushList(platform, bailun_sku, offset, limit,ref total, start_date, end_date, warehousecode, warehousetype, warehousearea); return DB.daily.ShortagePushList(platform, bailun_sku, offset, limit,ref total, start_date, end_date, warehousecode, warehousetype, warehousearea);
} }
public List<dc_aims_transfer_warehouse_log_dto> LogList(dc_aims_transfer_warehouse_log_search_dto search_data, int offset, int limit, ref int total )
{
return DB.dc_aims_transfer_warehouse_dao.LogList(search_data, offset, limit,ref total);
}
public List<dc_task_download_dto> TaskDownloadList(string user_name, string task_name, int offset, int limit, ref int total, DateTime? start_date, DateTime? end_date) public List<dc_task_download_dto> TaskDownloadList(string user_name, string task_name, int offset, int limit, ref int total, DateTime? start_date, DateTime? end_date)
{ {
return DB.daily.TaskDownloadList(user_name, task_name, offset, limit,ref total, start_date, end_date); return DB.daily.TaskDownloadList(user_name, task_name, offset, limit,ref total, start_date, end_date);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment