Commit 1dc7bdf0 by 杨林龙

优化设备首页统计展示

1 parent 2e96a809
......@@ -111,7 +111,7 @@ public interface VehicleMapper extends CommonBaseMapper<Vehicle> {
*
* @return
*/
@DataPerm(showSql = true)
@DataPerm(permTable = "temp", showSql = true)
Map<String, Long> getVehicleBindNumWithAuth();
/**
......
......@@ -19,8 +19,8 @@
</resultMap>
<resultMap id="activeNumberMap" type="HashMap">
<result property="allActiveNumber" column="allActiveNumber"/>
<result property="activeNumForToday" column="activeNumForToday"/>
<result property="allActiveNumber" jdbcType="INTEGER" column="allActiveNumber"/>
<result property="activeNumForToday" jdbcType="VARCHAR" column="activeNumForToday"/>
</resultMap>
<sql id="Base_Column_List">
......@@ -78,9 +78,8 @@
<select id="getActiveNumberWithAuth" resultMap="activeNumberMap">
select count(tvd.id) as allActiveNumber,
count(case when TO_DAYS(tvd.created_date) = TO_DAYS(NOW()) then 1 end) as activeNumForToday
from t_vehicle_device tvd
left join t_vehicle tv
on tv.id = tvd.vehicle_id
from t_vehicle tv
left join t_vehicle_device tvd on tvd.vehicle_id = tv.id
where tvd.bind_status = 1
and tvd.del_flag = 0
and tv.del_flag = 0;
......
......@@ -91,8 +91,8 @@
</resultMap>
<resultMap id="bindNumberMap" type="hashmap">
<result property="allBindNumber" column="allBindNumber"/>
<result property="bindNumForToday" column="bindNumForToday"/>
<result property="allBindNumber" jdbcType="INTEGER" column="allBindNumber"/>
<result property="bindNumForToday" jdbcType="VARCHAR" column="bindNumForToday"/>
</resultMap>
<sql id="Base_Column_List">
......@@ -474,7 +474,8 @@
select count(temp.id) as allBindNumber,
count(case when TO_DAYS(temp.created_date) = TO_DAYS(NOW()) then 1 end) as bindNumForToday
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
left join t_vehicle_device tvd
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!