Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
data-center-auto
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bltdc
data-center-auto
Commits
88eba714
Commit
88eba714
authored
Aug 05, 2019
by
lizefeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化周转表查询
parent
42bb61a8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
13 deletions
+21
-13
dc_auto_turnover.cs
AutoTurnOver.DB/dc_auto_turnover.cs
+21
-13
No files found.
AutoTurnOver.DB/dc_auto_turnover.cs
View file @
88eba714
...
...
@@ -69,18 +69,23 @@ where 1=1 ";
string
sqlCount
=
@"select count(1)
from dc_auto_turnover as dat
left join dc_base_warehouse as t3 on dat.warehouse_code = t3.warehouse_code
left join dc_base_tort as t8 on dat.bailun_sku = t8.bailun_sku
"
;
DynamicParameters
parameters
=
new
DynamicParameters
();
if
((!
string
.
IsNullOrWhiteSpace
(
m
.
warehousetype
))
||
m
.
warehousearea
>
0
||
(!
string
.
IsNullOrEmpty
(
m
.
warehouse_code
)))
{
sqlCount
+=
" left join dc_base_warehouse as t3 on dat.warehouse_code = t3.warehouse_code "
;
}
if
(
m
.
monitor_status
!=
null
)
{
sqlCount
+=
" left join dc_auto_config_sku_warehouse as t5 on dat.bailun_sku = t5.bailun_sku and dat.warehouse_code = t5.warehouse_code "
;
}
if
(
m
.
has_tort
!=
null
)
{
sqlCount
+=
" left join dc_base_tort as t8 on dat.bailun_sku = t8.bailun_sku "
;
}
sqlCount
+=
" where 1=1 "
;
if
(
m
.
has_tort
!=
null
)
...
...
@@ -177,21 +182,24 @@ left join dc_base_tort as t8 on dat.bailun_sku = t8.bailun_sku
sql
+=
" and ( dat.abroad_inbound_delivery >0 and dat.transfer_bale_delivery >0 and dat.transfer_delivery >0 ) "
;
sqlCount
+=
" and ( dat.abroad_inbound_delivery >0 and dat.transfer_bale_delivery >0 and dat.transfer_delivery >0 ) "
;
}
if
(!
string
.
IsNullOrWhiteSpace
(
m
.
warehousetype
))
{
sql
+=
" and t3.hq_type="
+
$"'
{
m
.
warehousetype
}
'"
;
sqlCount
+=
" and t3.hq_type="
+
$"'
{
m
.
warehousetype
}
'"
;
}
if
(
m
.
warehousearea
>
0
)
{
sql
+=
" and t3.area_id="
+
m
.
warehousearea
;
sqlCount
+=
" and t3.area_id="
+
m
.
warehousearea
;
}
if
(!
string
.
IsNullOrEmpty
(
m
.
warehouse_code
))
{
sql
+=
" and dat.warehouse_code='"
+
m
.
warehouse_code
+
"'"
;
sqlCount
+=
" and dat.warehouse_code='"
+
m
.
warehouse_code
+
"'"
;
}
else
{
if
(!
string
.
IsNullOrWhiteSpace
(
m
.
warehousetype
))
{
sql
+=
" and t3.hq_type="
+
$"'
{
m
.
warehousetype
}
'"
;
sqlCount
+=
" and t3.hq_type="
+
$"'
{
m
.
warehousetype
}
'"
;
}
if
(
m
.
warehousearea
>
0
)
{
sql
+=
" and t3.area_id="
+
m
.
warehousearea
;
sqlCount
+=
" and t3.area_id="
+
m
.
warehousearea
;
}
}
if
(
m
.
out_of_stock
.
HasValue
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment