Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
eshiled-new
/
ne-shield-trialdrive-admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit db3b7742
authored
Aug 24, 2021
by
刘宇峰
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
试驾报表统计
1 parent
0937d884
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
8 deletions
src/main/resources/mapper/TrialDriveReportMapper.xml
src/main/resources/mapper/TrialDriveReportMapper.xml
View file @
db3b774
...
@@ -31,13 +31,15 @@
...
@@ -31,13 +31,15 @@
tu.username shopName,
tu.username shopName,
tefs.sn,
tefs.sn,
tefs.vin,
tefs.vin,
tv.model_name
vehicleTypeName
case when tv.type_id is null then tv.model_name else concat(tv.sub_brand_name, '/', series_name) end
vehicleTypeName
from t_vehicle tv
from t_vehicle tv
inner join t_electric_fence_sns tefs on tv.vin = tefs.vin
inner join t_electric_fence_sns tefs on tv.vin = tefs.vin
inner join t_electric_fence tef on tef.id = tefs.fence_id
inner join t_electric_fence tef on tef.id = tefs.fence_id
left join t_user tu on tu.id = tef.created_by
left join t_user tu on tu.id = tef.created_by
where tefs.fence_id = tef.id
where tefs.fence_id = tef.id
and tef.biz_fence_type = 12 and tu.del_flag = 0
and tef.del_flag = 0
and tef.biz_fence_type = 12
and tu.del_flag = 0
<if
test=
"keywords != null and keywords!='' "
>
<if
test=
"keywords != null and keywords!='' "
>
and (
and (
tu.account like '%${keywords}%'
tu.account like '%${keywords}%'
...
@@ -51,11 +53,14 @@
...
@@ -51,11 +53,14 @@
parameterType=
"cn.com.glsx.admin.modules.model.param.TrialDriveReportSearch"
parameterType=
"cn.com.glsx.admin.modules.model.param.TrialDriveReportSearch"
resultMap=
"BaseResultMap"
>
resultMap=
"BaseResultMap"
>
SELECT tall.shopCode, tall.shopName, tall.vehicleTypeName, tall.sn, tall.vin, left(tall.statDate,7)
SELECT tall.shopCode, tall.shopName, tall.vehicleTypeName, tall.sn, tall.vin, left(tall.statDate,7)
statDate, tall.cnt, day(tall.statDate) dayCount , sum(cnt) cnttotal FROM
statDate, tall.cnt, day(tall.statDate) dayCount , sum(cnt) cnttotal FROM (select tu.account shopCode,
(select tu.account shopCode, tu.username shopName, tv.model_name vehicleTypeName,
tu.username shopName,
tefdd.sn, tv.vin, DATE_FORMAT(tefdd.journey_time,'%Y-%m-%d') statDate, sum(case when tefdd.percent >= 80
case when tv.type_id is null then tv.model_name else concat(tv.sub_brand_name, '/', series_name) end
then 1 else 0
vehicleTypeName,
end) cnt
tefdd.sn,
tv.vin,
DATE_FORMAT(tefdd.journey_time,'%Y-%m-%d') statDate,
sum(case when tefdd.percent >= 80 then 1 else 0 end) cnt
from t_electric_fence_drive tefdd
from t_electric_fence_drive tefdd
left join t_electric_fence tef on tef.id = tefdd.fence_id
left join t_electric_fence tef on tef.id = tefdd.fence_id
left join t_vehicle_device tvv on tvv.sn = tefdd.sn and tvv.bind_status = 1 and tvv.del_flag = 0
left join t_vehicle_device tvv on tvv.sn = tefdd.sn and tvv.bind_status = 1 and tvv.del_flag = 0
...
@@ -85,13 +90,15 @@
...
@@ -85,13 +90,15 @@
<if
test=
"sn !=null and sn != ''"
>
<if
test=
"sn !=null and sn != ''"
>
and tefdd.sn = #{sn,jdbcType=VARCHAR}
and tefdd.sn = #{sn,jdbcType=VARCHAR}
</if>
</if>
and tef.del_flag = 0
</where>
</where>
GROUP BY tefdd.sn,tefdd.fence_id,statDate order by tu.account) tall GROUP BY tall.shopCode, tall.sn,
GROUP BY tefdd.sn,tefdd.fence_id,statDate order by tu.account) tall GROUP BY tall.shopCode, tall.sn,
tall.statDate ORDER BY tall.shopCode
tall.statDate ORDER BY tall.shopCode
</select>
</select>
<select
id=
"getYearWithData"
resultType=
"java.lang.String"
>
<select
id=
"getYearWithData"
resultType=
"java.lang.String"
>
select distinct left(journey_time,4) from t_electric_fence_drive
select distinct left (journey_time, 4)
from t_electric_fence_drive
</select>
</select>
</mapper>
</mapper>
Write
Preview
Markdown
is supported
Attach a file
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 post a comment