Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
data-acquisition
Project
Project
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
竹天卫
data-acquisition
Commits
39aab3f4
Commit
39aab3f4
authored
May 12, 2021
by
竹天卫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
统计报表 筛选条件优化 日期优化
parent
6c5f0023
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
11 deletions
+17
-11
DataStatisticsMapper.xml
.../acquisition/business/mapper/xml/DataStatisticsMapper.xml
+17
-11
No files found.
acquisition-business/src/main/java/cn/wise/sc/acquisition/business/mapper/xml/DataStatisticsMapper.xml
View file @
39aab3f4
...
@@ -3,9 +3,12 @@
...
@@ -3,9 +3,12 @@
<mapper
namespace=
"cn.wise.sc.acquisition.business.mapper.DataStatisticsMapper"
>
<mapper
namespace=
"cn.wise.sc.acquisition.business.mapper.DataStatisticsMapper"
>
<select
id=
"countByPhoto"
resultType=
"cn.wise.sc.acquisition.business.model.vo.DataStatisticsVo"
>
<select
id=
"countByPhoto"
resultType=
"cn.wise.sc.acquisition.business.model.vo.DataStatisticsVo"
>
SELECT
tw.Rq
as name, SUM(tw.Jz) as value
SELECT
Convert(varchar(10),tw.Rq,120)
as name, SUM(tw.Jz) as value
FROM T_Weight tw
FROM T_Weight tw
where 1=1
where 1=1
<if
test=
"params.TruckID != null and params.TruckID != ''"
>
and tw.TruckID = #{params.TruckID}
</if>
<if
test=
"params.cycle == 1 "
>
<if
test=
"params.cycle == 1 "
>
and datediff(week, tw.Rq,getdate())=0
and datediff(week, tw.Rq,getdate())=0
</if>
</if>
...
@@ -19,23 +22,26 @@
...
@@ -19,23 +22,26 @@
and datediff(year, tw.Rq,getdate())=0
and datediff(year, tw.Rq,getdate())=0
</if>
</if>
<if
test=
"params.startDate != null and params.startDate != ''"
>
<if
test=
"params.startDate != null and params.startDate != ''"
>
and
tw.Rq >
>
=
#{params.startDate}
and
Convert(varchar(10),tw.Rq,120)
<![CDATA[ >= ]]>
#{params.startDate}
</if>
</if>
<if
test=
"params.endDate != null and params.endDate != ''"
>
<if
test=
"params.endDate != null and params.endDate != ''"
>
and
tw.Rq >
<
=
#{params.endDate}
and
Convert(varchar(10),tw.Rq,120)
<![CDATA[ <= ]]>
#{params.endDate}
</if>
</if>
<
!--<
if test="params.startDate == null and params.endDate == null">
<if
test=
"params.startDate == null and params.endDate == null"
>
and datediff(week, tw.Rq,getdate())=0
and datediff(week, tw.Rq,getdate())=0
</if>
-->
</if>
group by
tw.Rq
group by
Convert(varchar(10),tw.Rq,120)
</select>
</select>
<select
id=
"countByTable"
resultType=
"cn.wise.sc.acquisition.business.model.vo.DataStatisticsTableVo"
>
<select
id=
"countByTable"
resultType=
"cn.wise.sc.acquisition.business.model.vo.DataStatisticsTableVo"
>
SELECT tw.Uid,
tw.
Rq,tw.TruckID,'发货单位' as clientName,tpt.WorkType,tw.Mz,tw.Pz,tw.Jz
SELECT tw.Uid,
Convert(varchar(19),tw.Rq,120)as
Rq,tw.TruckID,'发货单位' as clientName,tpt.WorkType,tw.Mz,tw.Pz,tw.Jz
FROM T_Weight tw
FROM T_Weight tw
left join T_Processes_Truck tpt on tpt.TruckID = tw.TruckID
left join T_Processes_Truck tpt on tpt.TruckID = tw.TruckID
where 1=1
where 1=1
<if
test=
"params.TruckID != null and params.TruckID != ''"
>
and tw.TruckID = #{params.TruckID}
</if>
<if
test=
"params.cycle == 1 "
>
<if
test=
"params.cycle == 1 "
>
and datediff(week, tw.Rq,getdate())=0
and datediff(week, tw.Rq,getdate())=0
</if>
</if>
...
@@ -49,14 +55,14 @@
...
@@ -49,14 +55,14 @@
and datediff(year, tw.Rq,getdate())=0
and datediff(year, tw.Rq,getdate())=0
</if>
</if>
<if
test=
"params.startDate != null and params.startDate != ''"
>
<if
test=
"params.startDate != null and params.startDate != ''"
>
and
tw.Rq >
>
=
#{params.startDate}
and
Convert(varchar(10),tw.Rq,120)
<![CDATA[ >= ]]>
#{params.startDate}
</if>
</if>
<if
test=
"params.endDate != null and params.endDate != ''"
>
<if
test=
"params.endDate != null and params.endDate != ''"
>
and
tw.Rq >
<
=
#{params.endDate}
and
Convert(varchar(10),tw.Rq,120)
<![CDATA[ <= ]]>
#{params.endDate}
</if>
</if>
<
!--<
if test="params.startDate == null and params.endDate == null">
<if
test=
"params.startDate == null and params.endDate == null"
>
and datediff(week, tw.Rq,getdate())=0
and datediff(week, tw.Rq,getdate())=0
</if>
-->
</if>
</select>
</select>
...
...
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