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
fb226201
Commit
fb226201
authored
Nov 13, 2020
by
泽锋 李
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化count 查询
parent
ced1d713
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
31 additions
and
31 deletions
+31
-31
db_config.cs
AutoTurnOver.DB/db_config.cs
+14
-14
dc_auto_forecast_fluctuation.cs
AutoTurnOver.DB/dc_auto_forecast_fluctuation.cs
+1
-1
dc_auto_jit_tag.cs
AutoTurnOver.DB/dc_auto_jit_tag.cs
+2
-2
dc_auto_pick_up_goods_order_dao.cs
AutoTurnOver.DB/dc_auto_pick_up_goods_order_dao.cs
+1
-1
dc_auto_return_goods_config_dao.cs
AutoTurnOver.DB/dc_auto_return_goods_config_dao.cs
+1
-1
dc_auto_turnover.cs
AutoTurnOver.DB/dc_auto_turnover.cs
+3
-3
dc_not_stock.cs
AutoTurnOver.DB/dc_not_stock.cs
+1
-1
purchase_advise.cs
AutoTurnOver.DB/purchase_advise.cs
+2
-2
report.cs
AutoTurnOver.DB/report.cs
+5
-5
report_cash_flow_forecast_dao.cs
AutoTurnOver.DB/report_cash_flow_forecast_dao.cs
+1
-1
No files found.
AutoTurnOver.DB/db_config.cs
View file @
fb226201
...
@@ -53,7 +53,7 @@ left join dc_base_warehouse as dbw on dacp.warehouse_code = dbw.warehouse_code w
...
@@ -53,7 +53,7 @@ left join dc_base_warehouse as dbw on dacp.warehouse_code = dbw.warehouse_code w
sql
+=
" and dacp.warehouse_code='"
+
m
.
warehousecode
+
"'"
;
sql
+=
" and dacp.warehouse_code='"
+
m
.
warehousecode
+
"'"
;
}
}
total
=
_connection
.
ExecuteScalar
<
int
>(
"select count(0) from ("
+
sql
+
") tb1"
);
total
=
_connection
.
QuerySingleOrDefault
<
int
>(
"select count(0) from ("
+
sql
+
") tb1"
);
var
obj
=
_connection
.
Query
<
dc_auto_config_safe_inventoryDto
>(
sql
+
" limit "
+
offset
+
","
+
limit
);
var
obj
=
_connection
.
Query
<
dc_auto_config_safe_inventoryDto
>(
sql
+
" limit "
+
offset
+
","
+
limit
);
...
@@ -179,7 +179,7 @@ left join dc_base_warehouse as dbw on dacp.warehouse_code = dbw.warehouse_code w
...
@@ -179,7 +179,7 @@ left join dc_base_warehouse as dbw on dacp.warehouse_code = dbw.warehouse_code w
sql
+=
" and dacp.warehouse_code='"
+
m
.
warehousecode
+
"'"
;
sql
+=
" and dacp.warehouse_code='"
+
m
.
warehousecode
+
"'"
;
}
}
total
=
_connection
.
ExecuteScalar
<
int
>(
"select count(0) from ("
+
sql
+
") tb1"
);
total
=
_connection
.
QuerySingleOrDefault
<
int
>(
"select count(0) from ("
+
sql
+
") tb1"
);
var
obj
=
_connection
.
Query
<
dc_auto_config_sales_upper_limitDto
>(
sql
+
" limit "
+
offset
+
","
+
limit
);
var
obj
=
_connection
.
Query
<
dc_auto_config_sales_upper_limitDto
>(
sql
+
" limit "
+
offset
+
","
+
limit
);
...
@@ -306,7 +306,7 @@ where 1 = 1 ";
...
@@ -306,7 +306,7 @@ where 1 = 1 ";
sql
+=
" and ( dbw.warehouse_code='"
+
m
.
warehousecode
+
"' or ( dacp.type=3 and dacp.variable_code='"
+
m
.
warehousecode
+
"' ) ) "
;
sql
+=
" and ( dbw.warehouse_code='"
+
m
.
warehousecode
+
"' or ( dacp.type=3 and dacp.variable_code='"
+
m
.
warehousecode
+
"' ) ) "
;
}
}
total
=
_connection
.
ExecuteScalar
<
int
>(
"select count(0) from ("
+
sql
+
") tb1"
);
total
=
_connection
.
QuerySingleOrDefault
<
int
>(
"select count(0) from ("
+
sql
+
") tb1"
);
var
obj
=
_connection
.
Query
<
dc_auto_config_delivery_dto
>(
sql
+
" limit "
+
offset
+
","
+
limit
);
var
obj
=
_connection
.
Query
<
dc_auto_config_delivery_dto
>(
sql
+
" limit "
+
offset
+
","
+
limit
);
...
@@ -422,7 +422,7 @@ left join dc_base_warehouse as dbw on dacp.warehouse_code = dbw.warehouse_code w
...
@@ -422,7 +422,7 @@ left join dc_base_warehouse as dbw on dacp.warehouse_code = dbw.warehouse_code w
sql
+=
" and dacp.warehouse_code='"
+
m
.
warehousecode
+
"'"
;
sql
+=
" and dacp.warehouse_code='"
+
m
.
warehousecode
+
"'"
;
}
}
total
=
_connection
.
ExecuteScalar
<
int
>(
"select count(0) from ("
+
sql
+
") tb1"
);
total
=
_connection
.
QuerySingleOrDefault
<
int
>(
"select count(0) from ("
+
sql
+
") tb1"
);
var
obj
=
_connection
.
Query
<
dc_auto_config_stock_up_days
>(
sql
+
" limit "
+
offset
+
","
+
limit
);
var
obj
=
_connection
.
Query
<
dc_auto_config_stock_up_days
>(
sql
+
" limit "
+
offset
+
","
+
limit
);
...
@@ -861,7 +861,7 @@ left join dc_base_warehouse as dbw on dacp.warehouse_code = dbw.warehouse_code w
...
@@ -861,7 +861,7 @@ left join dc_base_warehouse as dbw on dacp.warehouse_code = dbw.warehouse_code w
sql
+=
" and dacp.warehouse_code='"
+
m
.
warehousecode
+
"'"
;
sql
+=
" and dacp.warehouse_code='"
+
m
.
warehousecode
+
"'"
;
}
}
total
=
_connection
.
ExecuteScalar
<
int
>(
"select count(0) from ("
+
sql
+
") tb1"
);
total
=
_connection
.
QuerySingleOrDefault
<
int
>(
"select count(0) from ("
+
sql
+
") tb1"
);
var
obj
=
_connection
.
Query
<
dc_base_stock_config_fba
>(
sql
+
" limit "
+
offset
+
","
+
limit
);
var
obj
=
_connection
.
Query
<
dc_base_stock_config_fba
>(
sql
+
" limit "
+
offset
+
","
+
limit
);
...
@@ -893,7 +893,7 @@ left join dc_base_warehouse as dbw on dacp.warehouse_code = dbw.warehouse_code w
...
@@ -893,7 +893,7 @@ left join dc_base_warehouse as dbw on dacp.warehouse_code = dbw.warehouse_code w
{
{
sql
+=
" and dacp.platform_sku like '%"
+
m
.
platform_sku
+
"%'"
;
sql
+=
" and dacp.platform_sku like '%"
+
m
.
platform_sku
+
"%'"
;
}
}
total
=
_connection
.
ExecuteScalar
<
int
>(
"select count(0) from ("
+
sql
+
") tb1"
);
total
=
_connection
.
QuerySingleOrDefault
<
int
>(
"select count(0) from ("
+
sql
+
") tb1"
);
var
obj
=
_connection
.
Query
<
dc_base_stock_config_fba_lose
>(
sql
+
" limit "
+
offset
+
","
+
limit
);
var
obj
=
_connection
.
Query
<
dc_base_stock_config_fba_lose
>(
sql
+
" limit "
+
offset
+
","
+
limit
);
...
@@ -1022,7 +1022,7 @@ left join dc_base_warehouse as dbw on dacp.warehouse_code = dbw.warehouse_code w
...
@@ -1022,7 +1022,7 @@ left join dc_base_warehouse as dbw on dacp.warehouse_code = dbw.warehouse_code w
sql
+=
" and t1.end_date>="
+
$"'
{
m
.
end_date
.
Value
}
'"
;
sql
+=
" and t1.end_date>="
+
$"'
{
m
.
end_date
.
Value
}
'"
;
}
}
total
=
_connection
.
ExecuteScalar
<
int
>(
"select count(0) from ("
+
sql
+
") tb1"
);
total
=
_connection
.
QuerySingleOrDefault
<
int
>(
"select count(0) from ("
+
sql
+
") tb1"
);
var
obj
=
_connection
.
Query
<
dc_auto_sales_config
>(
sql
+
" limit "
+
offset
+
","
+
limit
);
var
obj
=
_connection
.
Query
<
dc_auto_sales_config
>(
sql
+
" limit "
+
offset
+
","
+
limit
);
...
@@ -1151,7 +1151,7 @@ where 1 = 1 ";
...
@@ -1151,7 +1151,7 @@ where 1 = 1 ";
sql
+=
" and dacp.warehouse_code='"
+
m
.
warehousecode
+
"'"
;
sql
+=
" and dacp.warehouse_code='"
+
m
.
warehousecode
+
"'"
;
}
}
total
=
_connection
.
ExecuteScalar
<
int
>(
"select count(0) from ("
+
sql
+
") tb1"
);
total
=
_connection
.
QuerySingleOrDefault
<
int
>(
"select count(0) from ("
+
sql
+
") tb1"
);
var
obj
=
_connection
.
Query
<
dc_auto_stock_up_range_dto
>(
sql
+
" limit "
+
offset
+
","
+
limit
);
var
obj
=
_connection
.
Query
<
dc_auto_stock_up_range_dto
>(
sql
+
" limit "
+
offset
+
","
+
limit
);
...
@@ -1247,7 +1247,7 @@ where 1 = 1 ";
...
@@ -1247,7 +1247,7 @@ where 1 = 1 ";
total
=
_connection
.
ExecuteScalar
<
int
>(
"select count(0) from ("
+
sql
+
") tb1"
);
total
=
_connection
.
QuerySingleOrDefault
<
int
>(
"select count(0) from ("
+
sql
+
") tb1"
);
var
obj
=
_connection
.
Query
<
dc_auto_jit_tag_group
>(
sql
+
" limit "
+
offset
+
","
+
limit
);
var
obj
=
_connection
.
Query
<
dc_auto_jit_tag_group
>(
sql
+
" limit "
+
offset
+
","
+
limit
);
...
@@ -1389,7 +1389,7 @@ where 1 = 1 ";
...
@@ -1389,7 +1389,7 @@ where 1 = 1 ";
sql
+=
" and dacp.warehouse_code='"
+
m
.
warehousecode
+
"'"
;
sql
+=
" and dacp.warehouse_code='"
+
m
.
warehousecode
+
"'"
;
}
}
total
=
_connection
.
ExecuteScalar
<
int
>(
"select count(0) from ("
+
sql
+
") tb1"
);
total
=
_connection
.
QuerySingleOrDefault
<
int
>(
"select count(0) from ("
+
sql
+
") tb1"
);
var
obj
=
_connection
.
Query
<
dc_config_forecast_sales
>(
sql
+
" limit "
+
offset
+
","
+
limit
);
var
obj
=
_connection
.
Query
<
dc_config_forecast_sales
>(
sql
+
" limit "
+
offset
+
","
+
limit
);
...
@@ -1490,7 +1490,7 @@ and start_date<=@end_date and end_date>=@start_date
...
@@ -1490,7 +1490,7 @@ and start_date<=@end_date and end_date>=@start_date
}
}
}
}
total
=
_connection
.
ExecuteScalar
<
int
>(
"select count(0) from ("
+
sql
+
") tb1"
);
total
=
_connection
.
QuerySingleOrDefault
<
int
>(
"select count(0) from ("
+
sql
+
") tb1"
);
var
obj
=
_connection
.
Query
<
dc_auto_uprush_config_dto
>(
sql
+
" limit "
+
offset
+
","
+
limit
);
var
obj
=
_connection
.
Query
<
dc_auto_uprush_config_dto
>(
sql
+
" limit "
+
offset
+
","
+
limit
);
...
@@ -1711,7 +1711,7 @@ and start_date<=@end_date and end_date>=@start_date
...
@@ -1711,7 +1711,7 @@ and start_date<=@end_date and end_date>=@start_date
}
}
total
=
_connection
.
ExecuteScalar
<
int
>(
"select count(0) from ("
+
sql
+
") tb1"
);
total
=
_connection
.
QuerySingleOrDefault
<
int
>(
"select count(0) from ("
+
sql
+
") tb1"
);
var
obj
=
_connection
.
Query
<
dc_report_cash_flow_config_dto
>(
sql
+
" limit "
+
offset
+
","
+
limit
);
var
obj
=
_connection
.
Query
<
dc_report_cash_flow_config_dto
>(
sql
+
" limit "
+
offset
+
","
+
limit
);
...
@@ -1775,7 +1775,7 @@ and start_date<=@end_date and end_date>=@start_date
...
@@ -1775,7 +1775,7 @@ and start_date<=@end_date and end_date>=@start_date
}
}
total
=
_connection
.
ExecuteScalar
<
int
>(
"select count(0) from ("
+
sql
+
") tb1"
);
total
=
_connection
.
QuerySingleOrDefault
<
int
>(
"select count(0) from ("
+
sql
+
") tb1"
);
var
obj
=
_connection
.
Query
<
dc_report_logistics_company_config_dto
>(
sql
+
" limit "
+
offset
+
","
+
limit
);
var
obj
=
_connection
.
Query
<
dc_report_logistics_company_config_dto
>(
sql
+
" limit "
+
offset
+
","
+
limit
);
...
@@ -1877,7 +1877,7 @@ where 1 = 1 ";
...
@@ -1877,7 +1877,7 @@ where 1 = 1 ";
sql
+=
" and t1.status="
+
m
.
status
;
sql
+=
" and t1.status="
+
m
.
status
;
}
}
total
=
_connection
.
ExecuteScalar
<
int
>(
"select count(0) from ("
+
sql
+
") tb1"
,
parameters
);
total
=
_connection
.
QuerySingleOrDefault
<
int
>(
"select count(0) from ("
+
sql
+
") tb1"
,
parameters
);
var
obj
=
_connection
.
Query
<
dc_auto_return_goods_config_dto
>(
sql
+
" limit "
+
offset
+
","
+
limit
,
parameters
);
var
obj
=
_connection
.
Query
<
dc_auto_return_goods_config_dto
>(
sql
+
" limit "
+
offset
+
","
+
limit
,
parameters
);
...
...
AutoTurnOver.DB/dc_auto_forecast_fluctuation.cs
View file @
fb226201
...
@@ -129,7 +129,7 @@ where 1 = 1
...
@@ -129,7 +129,7 @@ where 1 = 1
if
(
limit
<
10000
)
if
(
limit
<
10000
)
{
{
total
=
_connection
.
ExecuteScalar
<
int
>(
"select count(0) from ("
+
sql
+
") tb1"
,
parameters
,
commandTimeout
:
0
);
total
=
_connection
.
QuerySingleOrDefault
<
int
>(
"select count(0) from ("
+
sql
+
") tb1"
,
parameters
,
commandTimeout
:
0
);
}
}
else
else
{
{
...
...
AutoTurnOver.DB/dc_auto_jit_tag.cs
View file @
fb226201
...
@@ -35,7 +35,7 @@ where 1 = 1 ";
...
@@ -35,7 +35,7 @@ where 1 = 1 ";
}
}
sql
+=
" order by t1.level asc "
;
sql
+=
" order by t1.level asc "
;
total
=
_connection
.
ExecuteScalar
<
int
>(
"select count(0) from ("
+
sql
+
") tb1"
);
total
=
_connection
.
QuerySingleOrDefault
<
int
>(
"select count(0) from ("
+
sql
+
") tb1"
);
var
obj
=
_connection
.
Query
<
dc_auto_jit_tag_dto
>(
sql
+
" limit "
+
offset
+
","
+
limit
);
var
obj
=
_connection
.
Query
<
dc_auto_jit_tag_dto
>(
sql
+
" limit "
+
offset
+
","
+
limit
);
...
@@ -80,7 +80,7 @@ where 1 = 1 ";
...
@@ -80,7 +80,7 @@ where 1 = 1 ";
}
}
sql
+=
" order by t1.date desc "
;
sql
+=
" order by t1.date desc "
;
total
=
_connection
.
ExecuteScalar
<
int
>(
"select count(0) from ("
+
sql
+
") tb1"
,
parameters
);
total
=
_connection
.
QuerySingleOrDefault
<
int
>(
"select count(0) from ("
+
sql
+
") tb1"
,
parameters
);
var
obj
=
_connection
.
Query
<
dc_auto_jit_tag_log_dto
>(
sql
+
" limit "
+
offset
+
","
+
limit
,
parameters
);
var
obj
=
_connection
.
Query
<
dc_auto_jit_tag_log_dto
>(
sql
+
" limit "
+
offset
+
","
+
limit
,
parameters
);
...
...
AutoTurnOver.DB/dc_auto_pick_up_goods_order_dao.cs
View file @
fb226201
...
@@ -156,7 +156,7 @@ where 1 = 1 ";
...
@@ -156,7 +156,7 @@ where 1 = 1 ";
}
}
total
=
_connection
.
ExecuteScalar
<
int
>(
"select count(0) from ("
+
sql
+
") tb1"
,
parameters
);
total
=
_connection
.
QuerySingleOrDefault
<
int
>(
"select count(0) from ("
+
sql
+
") tb1"
,
parameters
);
var
obj
=
_connection
.
Query
<
dc_auto_pick_up_goods_order_view_dto
>(
sql
+
" limit "
+
offset
+
","
+
limit
,
parameters
);
var
obj
=
_connection
.
Query
<
dc_auto_pick_up_goods_order_view_dto
>(
sql
+
" limit "
+
offset
+
","
+
limit
,
parameters
);
...
...
AutoTurnOver.DB/dc_auto_return_goods_config_dao.cs
View file @
fb226201
...
@@ -239,7 +239,7 @@ where 1 = 1 ";
...
@@ -239,7 +239,7 @@ where 1 = 1 ";
sql
+=
" and t1.no_library_sys_push_status="
+
m
.
no_library_sys_push_status
;
sql
+=
" and t1.no_library_sys_push_status="
+
m
.
no_library_sys_push_status
;
}
}
total
=
_connection
.
ExecuteScalar
<
int
>(
"select count(0) from ("
+
sql
+
") tb1"
,
parameters
);
total
=
_connection
.
QuerySingleOrDefault
<
int
>(
"select count(0) from ("
+
sql
+
") tb1"
,
parameters
);
var
obj
=
_connection
.
Query
<
dc_auto_return_goods_sku_dto
>(
sql
+
" limit "
+
offset
+
","
+
limit
,
parameters
);
var
obj
=
_connection
.
Query
<
dc_auto_return_goods_sku_dto
>(
sql
+
" limit "
+
offset
+
","
+
limit
,
parameters
);
...
...
AutoTurnOver.DB/dc_auto_turnover.cs
View file @
fb226201
...
@@ -271,7 +271,7 @@ from dc_auto_turnover as dat
...
@@ -271,7 +271,7 @@ from dc_auto_turnover as dat
}
}
else
else
{
{
total
=
_connection
.
ExecuteScalar
<
int
>(
sqlCount
,
parameters
,
commandTimeout
:
0
);
total
=
_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"
;
...
@@ -359,7 +359,7 @@ from dc_auto_turnover as dat
...
@@ -359,7 +359,7 @@ from dc_auto_turnover as dat
sql
+=
" dacp.and status="
+
m
.
status
.
Value
;
sql
+=
" dacp.and status="
+
m
.
status
.
Value
;
}
}
total
=
_connection
.
ExecuteScalar
<
int
>(
"select count(0) from ("
+
sql
+
") tb1"
);
total
=
_connection
.
QuerySingleOrDefault
<
int
>(
"select count(0) from ("
+
sql
+
") tb1"
);
var
obj
=
_connection
.
Query
<
dc_auto_config_promotion
>(
sql
+
" limit "
+
offset
+
","
+
limit
);
var
obj
=
_connection
.
Query
<
dc_auto_config_promotion
>(
sql
+
" limit "
+
offset
+
","
+
limit
);
...
@@ -624,7 +624,7 @@ from dc_auto_turnover as dat
...
@@ -624,7 +624,7 @@ from dc_auto_turnover as dat
sql
+=
" and dacp.warehouse_code='"
+
m
.
warehousecode
+
"'"
;
sql
+=
" and dacp.warehouse_code='"
+
m
.
warehousecode
+
"'"
;
}
}
total
=
_connection
.
ExecuteScalar
<
int
>(
"select count(0) from ("
+
sql
+
") tb1"
);
total
=
_connection
.
QuerySingleOrDefault
<
int
>(
"select count(0) from ("
+
sql
+
") tb1"
);
var
obj
=
_connection
.
Query
<
dc_auto_config_correction
>(
sql
+
" limit "
+
offset
+
","
+
limit
);
var
obj
=
_connection
.
Query
<
dc_auto_config_correction
>(
sql
+
" limit "
+
offset
+
","
+
limit
);
...
...
AutoTurnOver.DB/dc_not_stock.cs
View file @
fb226201
...
@@ -147,7 +147,7 @@ where 1=1
...
@@ -147,7 +147,7 @@ where 1=1
}
}
else
else
{
{
total
=
_connection
.
ExecuteScalar
<
int
>(
sqlCount
,
parameters
);
total
=
_connection
.
QuerySingleOrDefault
<
int
>(
sqlCount
,
parameters
);
//设置默认排序字段
//设置默认排序字段
if
(
string
.
IsNullOrWhiteSpace
(
sort
))
sort
=
"t_not_stock.id"
;
if
(
string
.
IsNullOrWhiteSpace
(
sort
))
sort
=
"t_not_stock.id"
;
...
...
AutoTurnOver.DB/purchase_advise.cs
View file @
fb226201
...
@@ -973,7 +973,7 @@ and platform_type in @platform_types
...
@@ -973,7 +973,7 @@ and platform_type in @platform_types
sql
+=
" order by id desc "
;
sql
+=
" order by id desc "
;
total
=
_connection
.
ExecuteScalar
<
int
>(
"select count(0) from ("
+
sql
+
") tb1"
,
parameters
);
total
=
_connection
.
QuerySingleOrDefault
<
int
>(
"select count(0) from ("
+
sql
+
") tb1"
,
parameters
);
var
obj
=
_connection
.
Query
<
dc_auto_purchase_advise
>(
sql
+
" limit "
+
offset
+
","
+
limit
,
parameters
);
var
obj
=
_connection
.
Query
<
dc_auto_purchase_advise
>(
sql
+
" limit "
+
offset
+
","
+
limit
,
parameters
);
...
@@ -1166,7 +1166,7 @@ and EXISTS (
...
@@ -1166,7 +1166,7 @@ and EXISTS (
}
}
else
else
{
{
total
=
_connection
.
ExecuteScalar
<
int
>(
"select count(0) from ("
+
sql
+
") tb1"
,
parameters
);
total
=
_connection
.
QuerySingleOrDefault
<
int
>(
"select count(0) from ("
+
sql
+
") tb1"
,
parameters
);
//设置默认排序字段
//设置默认排序字段
if
(
string
.
IsNullOrWhiteSpace
(
sort
))
sort
=
"t1.quantity_final_advise"
;
if
(
string
.
IsNullOrWhiteSpace
(
sort
))
sort
=
"t1.quantity_final_advise"
;
...
...
AutoTurnOver.DB/report.cs
View file @
fb226201
...
@@ -96,7 +96,7 @@ where t1.quantity_out_stock>0 and ( t3.buyer_name in ('张莹霞','张莹霞1','
...
@@ -96,7 +96,7 @@ where t1.quantity_out_stock>0 and ( t3.buyer_name in ('张莹霞','张莹霞1','
}
}
else
else
{
{
total
=
_connection
.
ExecuteScalar
<
int
>(
"select count(0) from ("
+
sql
+
") tb1"
,
parameters
);
total
=
_connection
.
QuerySingleOrDefault
<
int
>(
"select count(0) from ("
+
sql
+
") tb1"
,
parameters
);
//设置默认排序字段
//设置默认排序字段
if
(
string
.
IsNullOrWhiteSpace
(
sort
))
sort
=
"t1.quantity_out_stock"
;
if
(
string
.
IsNullOrWhiteSpace
(
sort
))
sort
=
"t1.quantity_out_stock"
;
...
@@ -296,7 +296,7 @@ where 1=1
...
@@ -296,7 +296,7 @@ where 1=1
}
}
else
else
{
{
total
=
_connection
.
ExecuteScalar
<
int
>(
countSql
,
parameters
,
commandTimeout
:
0
);
total
=
_connection
.
QuerySingleOrDefault
<
int
>(
countSql
,
parameters
,
commandTimeout
:
0
);
//设置默认排序字段
//设置默认排序字段
if
(!
string
.
IsNullOrEmpty
(
sort
)
&&
!
string
.
IsNullOrEmpty
(
order
))
if
(!
string
.
IsNullOrEmpty
(
sort
)
&&
!
string
.
IsNullOrEmpty
(
order
))
...
@@ -424,7 +424,7 @@ where ( t_db.hq_type!='国内仓' or t2.buyer_name not in ('张莹霞','张莹
...
@@ -424,7 +424,7 @@ where ( t_db.hq_type!='国内仓' or t2.buyer_name not in ('张莹霞','张莹
}
}
else
else
{
{
total
=
_connection
.
ExecuteScalar
<
int
>(
countSql
,
parameters
,
commandTimeout
:
0
);
total
=
_connection
.
QuerySingleOrDefault
<
int
>(
countSql
,
parameters
,
commandTimeout
:
0
);
//设置默认排序字段
//设置默认排序字段
if
(!
string
.
IsNullOrEmpty
(
sort
)
&&
!
string
.
IsNullOrEmpty
(
order
))
if
(!
string
.
IsNullOrEmpty
(
sort
)
&&
!
string
.
IsNullOrEmpty
(
order
))
...
@@ -994,7 +994,7 @@ end
...
@@ -994,7 +994,7 @@ end
}
}
else
else
{
{
total
=
_connection
.
ExecuteScalar
<
int
>(
countSql
,
parameters
,
commandTimeout
:
0
);
total
=
_connection
.
QuerySingleOrDefault
<
int
>(
countSql
,
parameters
,
commandTimeout
:
0
);
//设置默认排序字段
//设置默认排序字段
if
(!
string
.
IsNullOrEmpty
(
sort
)
&&
!
string
.
IsNullOrEmpty
(
order
))
if
(!
string
.
IsNullOrEmpty
(
sort
)
&&
!
string
.
IsNullOrEmpty
(
order
))
...
@@ -2846,7 +2846,7 @@ where t2.buyer_name = '赵美聪'
...
@@ -2846,7 +2846,7 @@ where t2.buyer_name = '赵美聪'
{
{
sql
+=
" GROUP BY t2.suppliers_id "
;
sql
+=
" GROUP BY t2.suppliers_id "
;
count_sql
+=
" GROUP BY t2.suppliers_id "
;
count_sql
+=
" GROUP BY t2.suppliers_id "
;
total
=
_connection
.
ExecuteScalar
<
int
>(
count_sql
,
parameters
);
total
=
_connection
.
QuerySingleOrDefault
<
int
>(
count_sql
,
parameters
);
//设置默认排序字段
//设置默认排序字段
if
(
string
.
IsNullOrWhiteSpace
(
sort
))
sort
=
"yesterday_sales_count"
;
if
(
string
.
IsNullOrWhiteSpace
(
sort
))
sort
=
"yesterday_sales_count"
;
...
...
AutoTurnOver.DB/report_cash_flow_forecast_dao.cs
View file @
fb226201
...
@@ -592,7 +592,7 @@ namespace AutoTurnOver.DB
...
@@ -592,7 +592,7 @@ namespace AutoTurnOver.DB
}
}
total
=
_connection
.
ExecuteScalar
<
int
>(
"select count(0) from ("
+
sql
+
") tb1"
);
total
=
_connection
.
QuerySingleOrDefault
<
int
>(
"select count(0) from ("
+
sql
+
") tb1"
);
var
obj
=
_connection
.
Query
<
dc_report_cash_flow_forecast_task_dto
>(
sql
+
" limit "
+
offset
+
","
+
limit
);
var
obj
=
_connection
.
Query
<
dc_report_cash_flow_forecast_task_dto
>(
sql
+
" limit "
+
offset
+
","
+
limit
);
...
...
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