Commit 1dc7bdf0 by 杨林龙

优化设备首页统计展示

1 parent 2e96a809
...@@ -111,7 +111,7 @@ public interface VehicleMapper extends CommonBaseMapper<Vehicle> { ...@@ -111,7 +111,7 @@ public interface VehicleMapper extends CommonBaseMapper<Vehicle> {
* *
* @return * @return
*/ */
@DataPerm(showSql = true) @DataPerm(permTable = "temp", showSql = true)
Map<String, Long> getVehicleBindNumWithAuth(); Map<String, Long> getVehicleBindNumWithAuth();
/** /**
......
...@@ -19,8 +19,8 @@ ...@@ -19,8 +19,8 @@
</resultMap> </resultMap>
<resultMap id="activeNumberMap" type="HashMap"> <resultMap id="activeNumberMap" type="HashMap">
<result property="allActiveNumber" column="allActiveNumber"/> <result property="allActiveNumber" jdbcType="INTEGER" column="allActiveNumber"/>
<result property="activeNumForToday" column="activeNumForToday"/> <result property="activeNumForToday" jdbcType="VARCHAR" column="activeNumForToday"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
...@@ -78,9 +78,8 @@ ...@@ -78,9 +78,8 @@
<select id="getActiveNumberWithAuth" resultMap="activeNumberMap"> <select id="getActiveNumberWithAuth" resultMap="activeNumberMap">
select count(tvd.id) as allActiveNumber, select count(tvd.id) as allActiveNumber,
count(case when TO_DAYS(tvd.created_date) = TO_DAYS(NOW()) then 1 end) as activeNumForToday count(case when TO_DAYS(tvd.created_date) = TO_DAYS(NOW()) then 1 end) as activeNumForToday
from t_vehicle_device tvd from t_vehicle tv
left join t_vehicle tv left join t_vehicle_device tvd on tvd.vehicle_id = tv.id
on tv.id = tvd.vehicle_id
where tvd.bind_status = 1 where tvd.bind_status = 1
and tvd.del_flag = 0 and tvd.del_flag = 0
and tv.del_flag = 0; and tv.del_flag = 0;
......
...@@ -91,8 +91,8 @@ ...@@ -91,8 +91,8 @@
</resultMap> </resultMap>
<resultMap id="bindNumberMap" type="hashmap"> <resultMap id="bindNumberMap" type="hashmap">
<result property="allBindNumber" column="allBindNumber"/> <result property="allBindNumber" jdbcType="INTEGER" column="allBindNumber"/>
<result property="bindNumForToday" column="bindNumForToday"/> <result property="bindNumForToday" jdbcType="VARCHAR" column="bindNumForToday"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
...@@ -474,7 +474,8 @@ ...@@ -474,7 +474,8 @@
select count(temp.id) as allBindNumber, select count(temp.id) as allBindNumber,
count(case when TO_DAYS(temp.created_date) = TO_DAYS(NOW()) then 1 end) as bindNumForToday count(case when TO_DAYS(temp.created_date) = TO_DAYS(NOW()) then 1 end) as bindNumForToday
from (select tv.id, from (select tv.id,
max(tvd.created_date) as created_date max(tvd.created_date) as created_date,
tv.created_by
from t_vehicle tv from t_vehicle tv
left join t_vehicle_device tvd left join t_vehicle_device tvd
on tv.id = tvd.vehicle_id on tv.id = tvd.vehicle_id
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!