|
@@ -68,28 +68,29 @@
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
- <select id="getResource" parameterType="String" resultMap="LargePlatPublicCarResult">
|
|
|
+ <select id="getResourceNumber" parameterType="String" resultMap="LargePlatPublicCarResult">
|
|
|
SELECT
|
|
|
- total_car_num,
|
|
|
- car_num_one,
|
|
|
- car_num_two,
|
|
|
- car_num_three,
|
|
|
- car_num_four,
|
|
|
- car_num_five,
|
|
|
- enterprise_car_num,
|
|
|
- head_car_num,
|
|
|
- oil_car_num,
|
|
|
- new_power_car_num,
|
|
|
- lack_rate,
|
|
|
- posses_rate,
|
|
|
- establishments_car_num,
|
|
|
- year_add_num,
|
|
|
- year_reduce_num
|
|
|
+ SUM(total_car_num) AS total_car_num,
|
|
|
+ SUM(car_num_one) AS car_num_one,
|
|
|
+ SUM(car_num_two) AS car_num_two,
|
|
|
+ SUM(car_num_three) AS car_num_three,
|
|
|
+ SUM(car_num_four) AS car_num_four,
|
|
|
+ SUM(car_num_five) AS car_num_five,
|
|
|
+ SUM(enterprise_car_num) AS enterprise_car_num,
|
|
|
+ SUM(head_car_num) AS head_car_num,
|
|
|
+ SUM(oil_car_num) AS oil_car_num,
|
|
|
+ SUM(new_power_car_num) AS new_power_car_num,
|
|
|
+ SUM(lack_car_num) AS lack_car_num,
|
|
|
+ SUM(establishments_car_num) AS establishments_car_num,
|
|
|
+ SUM(year_add_num) AS year_add_num,
|
|
|
+ SUM(year_reduce_num) AS year_reduce_num
|
|
|
FROM
|
|
|
large_plat_public_car a
|
|
|
LEFT JOIN large_plat_app_org b ON a.app_encode = b.app_encode
|
|
|
+ <if test="appOrg != '10001'">
|
|
|
WHERE
|
|
|
- b.app_org = #{appOrg}
|
|
|
+ b.app_org = #{appOrg} OR b.app_parent_org = #{appOrg}
|
|
|
+ </if>
|
|
|
</select>
|
|
|
|
|
|
<select id="getCarDetail" resultMap="LargePlatPublicCarChangeDetailResult">
|
|
@@ -108,19 +109,22 @@
|
|
|
b.app_org = #{arg0} AND flag = #{arg1}
|
|
|
</select>
|
|
|
|
|
|
- <select id="getMonitor" parameterType="String" resultMap="LargePlatPublicCarResult">
|
|
|
+ <select id="getMonitorNumber" parameterType="String" resultMap="LargePlatPublicCarResult">
|
|
|
SELECT
|
|
|
- terminal_install_rate,
|
|
|
- terminal_online_rate,
|
|
|
- not_archived_num,
|
|
|
- no_pid_num,
|
|
|
- over_speed_num,
|
|
|
- holiday_num
|
|
|
+ SUM(not_archived_num) AS not_archived_num,
|
|
|
+ SUM(no_pid_num) AS no_pid_num,
|
|
|
+ SUM(over_speed_num) AS over_speed_num,
|
|
|
+ SUM(holiday_num) AS holiday_num,
|
|
|
+ SUM(terminal_total) AS terminal_total,
|
|
|
+ SUM(terminal_install) AS terminal_install,
|
|
|
+ SUM(terminal_online) AS terminal_online
|
|
|
FROM
|
|
|
large_plat_public_car a
|
|
|
LEFT JOIN large_plat_app_org b ON a.app_encode = b.app_encode
|
|
|
+ <if test="appOrg != '10001'">
|
|
|
WHERE
|
|
|
- b.app_org = #{appOrg}
|
|
|
+ b.app_org = #{appOrg} OR b.app_parent_org = #{appOrg}
|
|
|
+ </if>
|
|
|
</select>
|
|
|
|
|
|
<select id="getWarnDetail" parameterType="String" resultMap="LargePlatPublicCarWarnDetailResult">
|
|
@@ -139,18 +143,20 @@
|
|
|
|
|
|
<select id="getOperationManageTopHalf" parameterType="String" resultMap="LargePlatPublicCarResult">
|
|
|
SELECT
|
|
|
- avg_mile,
|
|
|
- mile_count,
|
|
|
- avg_pcd_num,
|
|
|
- pcd_num
|
|
|
+ AVG(avg_mile) AS avg_mile,
|
|
|
+ SUM(mile_count) AS mile_count,
|
|
|
+ AVG(avg_pcd_num) AS avg_pcd_num,
|
|
|
+ SUM(pcd_num) AS pcd_num
|
|
|
FROM
|
|
|
large_plat_public_car a
|
|
|
LEFT JOIN large_plat_app_org b ON a.app_encode = b.app_encode
|
|
|
+ <if test="appOrg != '10001'">
|
|
|
WHERE
|
|
|
- b.app_org = #{appOrg}
|
|
|
+ b.app_org = #{appOrg} OR b.app_parent_org = #{appOrg}
|
|
|
+ </if>
|
|
|
</select>
|
|
|
|
|
|
- <select id="getUnitRankTop" parameterType="String" resultMap="LargeUnitRankResult">
|
|
|
+ <select id="getUnitRankTop" resultMap="LargeUnitRankResult">
|
|
|
SELECT
|
|
|
app_name,
|
|
|
gwc_pcd,
|
|
@@ -158,14 +164,12 @@
|
|
|
FROM
|
|
|
large_plat_public_car_rank_unit a
|
|
|
LEFT JOIN large_plat_app_org b ON a.app_encode = b.app_encode
|
|
|
- WHERE
|
|
|
- b.app_org = #{appOrg}
|
|
|
ORDER BY
|
|
|
a.id
|
|
|
LIMIT 3
|
|
|
</select>
|
|
|
|
|
|
- <select id="getUnitRankLast" parameterType="String" resultMap="LargeUnitRankResult">
|
|
|
+ <select id="getUnitRankLast" resultMap="LargeUnitRankResult">
|
|
|
SELECT
|
|
|
app_name,
|
|
|
gwc_pcd,
|
|
@@ -173,14 +177,12 @@
|
|
|
FROM
|
|
|
large_plat_public_car_rank_unit a
|
|
|
LEFT JOIN large_plat_app_org b ON a.app_encode = b.app_encode
|
|
|
- WHERE
|
|
|
- b.app_org = #{appOrg}
|
|
|
ORDER BY
|
|
|
a.id DESC
|
|
|
LIMIT 3
|
|
|
</select>
|
|
|
|
|
|
- <select id="getCarRank" parameterType="String" resultMap="LargeCarRankResult">
|
|
|
+ <select id="getCarRank" resultMap="LargeCarRankResult">
|
|
|
SELECT
|
|
|
app_name,
|
|
|
vechile_num,
|
|
@@ -188,8 +190,6 @@
|
|
|
FROM
|
|
|
large_plat_public_car_rank_person a
|
|
|
LEFT JOIN large_plat_app_org b ON a.app_encode = b.app_encode
|
|
|
- WHERE
|
|
|
- b.app_org = #{appOrg}
|
|
|
ORDER BY
|
|
|
pcd_count
|
|
|
LIMIT 10
|