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
836260c6
Commit
836260c6
authored
Apr 28, 2023
by
wilse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
周转表查询优化
parent
dde3b10e
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
8 deletions
+15
-8
dc_auto_turnover.cs
AutoTurnOver.DB/dc_auto_turnover.cs
+8
-4
SkuAutoTurnServices.cs
AutoTurnOver.Services/SkuAutoTurnServices.cs
+2
-2
SkuAutoTurnController.cs
AutoTurnOver/Controllers/SkuAutoTurnController.cs
+5
-2
No files found.
AutoTurnOver.DB/dc_auto_turnover.cs
View file @
836260c6
...
@@ -32,7 +32,7 @@ namespace AutoTurnOver.DB
...
@@ -32,7 +32,7 @@ namespace AutoTurnOver.DB
/// <param name="order">排序类型</param>
/// <param name="order">排序类型</param>
/// <param name="sort">排序字段</param>
/// <param name="sort">排序字段</param>
/// <returns></returns>
/// <returns></returns>
public
static
List
<
Models
.
dc_auto_turnover_list_dto
>
List
(
Condition_AutoTurnOver
m
,
int
offset
,
int
limit
,
ref
int
total
,
string
order
=
""
,
string
sort
=
""
,
bool
isSum
=
false
)
public
static
List
<
Models
.
dc_auto_turnover_list_dto
>
List
(
Condition_AutoTurnOver
m
,
int
offset
,
int
limit
,
ref
int
total
,
string
order
=
""
,
string
sort
=
""
,
bool
isSum
=
false
,
bool
isSumAndData
=
false
)
{
{
try
try
{
{
...
@@ -397,12 +397,16 @@ from dc_auto_turnover as dat
...
@@ -397,12 +397,16 @@ from dc_auto_turnover as dat
var
limit_sql
=
""
;
var
limit_sql
=
""
;
if
(
isSum
)
if
(
isSum
)
{
{
total
=
0
;
total
=
_connection
.
QuerySingleOrDefault
<
int
>(
sqlCount
,
parameters
,
commandTimeout
:
0
);
return
null
;
}
}
else
else
{
{
total
=
0
;
// _connection.QuerySingleOrDefault<int>(sqlCount, parameters, commandTimeout: 0);
total
=
_connection
.
QuerySingleOrDefault
<
int
>(
sqlCount
,
parameters
,
commandTimeout
:
0
);
if
(
isSumAndData
)
{
_connection
.
QuerySingleOrDefault
<
int
>(
sqlCount
,
parameters
,
commandTimeout
:
0
);
}
//Console.WriteLine(sqlCount);
//Console.WriteLine(sqlCount);
//设置默认排序字段
//设置默认排序字段
if
(
string
.
IsNullOrWhiteSpace
(
sort
))
sort
=
"dat.id"
;
if
(
string
.
IsNullOrWhiteSpace
(
sort
))
sort
=
"dat.id"
;
...
...
AutoTurnOver.Services/SkuAutoTurnServices.cs
View file @
836260c6
...
@@ -27,13 +27,13 @@ namespace AutoTurnOver.Services
...
@@ -27,13 +27,13 @@ namespace AutoTurnOver.Services
/// <param name = "order" > 排序类型 </ param >
/// <param name = "order" > 排序类型 </ param >
/// <param name="sort">排序字段</param>
/// <param name="sort">排序字段</param>
/// <returns></returns>
/// <returns></returns>
public
List
<
dc_auto_turnover_list_dto
>
List
(
Condition_AutoTurnOver
m
,
int
offset
,
int
limit
,
ref
int
total
,
string
order
=
""
,
string
sort
=
""
,
bool
isSum
=
false
)
public
List
<
dc_auto_turnover_list_dto
>
List
(
Condition_AutoTurnOver
m
,
int
offset
,
int
limit
,
ref
int
total
,
string
order
=
""
,
string
sort
=
""
,
bool
isSum
=
false
,
bool
isSumAndData
=
false
)
{
{
if
(!
string
.
IsNullOrWhiteSpace
(
m
.
categoryIds
))
if
(!
string
.
IsNullOrWhiteSpace
(
m
.
categoryIds
))
{
{
m
.
categoryModels
=
ApiServices
.
GetNewClientNodesByIds
(
m
.
categoryIds
.
Split
(
','
).
Select
(
s
=>
int
.
Parse
(
s
)).
ToList
());
m
.
categoryModels
=
ApiServices
.
GetNewClientNodesByIds
(
m
.
categoryIds
.
Split
(
','
).
Select
(
s
=>
int
.
Parse
(
s
)).
ToList
());
}
}
return
DB
.
dc_auto_turnover
.
List
(
m
,
offset
,
limit
,
ref
total
,
order
,
sort
,
isSum
);
return
DB
.
dc_auto_turnover
.
List
(
m
,
offset
,
limit
,
ref
total
,
order
,
sort
,
isSum
,
isSumAndData
);
}
}
public
List
<
dc_base_order_data_source_dto
>
GetOrderDataSource
(
dc_base_order_data_source_search_dto
m
,
int
offset
,
int
limit
,
ref
int
total
)
public
List
<
dc_base_order_data_source_dto
>
GetOrderDataSource
(
dc_base_order_data_source_search_dto
m
,
int
offset
,
int
limit
,
ref
int
total
)
...
...
AutoTurnOver/Controllers/SkuAutoTurnController.cs
View file @
836260c6
...
@@ -196,7 +196,10 @@ namespace AutoTurnOver.Controllers
...
@@ -196,7 +196,10 @@ namespace AutoTurnOver.Controllers
var
service
=
new
Services
.
SkuAutoTurnServices
();
var
service
=
new
Services
.
SkuAutoTurnServices
();
var
list
=
service
.
List
(
m
,
offset
,
limit
,
ref
total
,
order
,
sort
,
true
);
var
list
=
service
.
List
(
m
,
offset
,
limit
,
ref
total
,
order
,
sort
,
true
);
return
new
JsonResult
(
list
==
null
||
list
.
Count
<=
0
?
new
dc_auto_turnover_list_dto
()
:
list
[
0
]);
return
new
JsonResult
(
new
{
total
=
total
});
}
}
/// <summary>
/// <summary>
...
@@ -390,7 +393,7 @@ namespace AutoTurnOver.Controllers
...
@@ -390,7 +393,7 @@ namespace AutoTurnOver.Controllers
var
total
=
0
;
var
total
=
0
;
var
service
=
new
Services
.
SkuAutoTurnServices
();
var
service
=
new
Services
.
SkuAutoTurnServices
();
var
list
=
service
.
List
(
m
,
offset
,
limit
,
ref
total
,
""
,
"short_supply_time"
).
Select
(
p
=>
new
var
list
=
service
.
List
(
m
,
offset
,
limit
,
ref
total
,
""
,
"short_supply_time"
,
false
,
true
).
Select
(
p
=>
new
{
{
gmt_modified
=
p
.
gmt_modified
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
),
gmt_modified
=
p
.
gmt_modified
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
),
p
.
bailun_sku
,
p
.
bailun_sku
,
...
...
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