Commit f82fb03e by liuyang

修复设备驾驶舱状态逻辑

parent 8a208d1e
...@@ -386,7 +386,7 @@ public class ServiceHPBI003 extends ServiceBase { ...@@ -386,7 +386,7 @@ public class ServiceHPBI003 extends ServiceBase {
if (params.containsKey("date")){ if (params.containsKey("date")){
params.put("date", DateUtils.formatShort(params.get("date"))); params.put("date", DateUtils.formatShort(params.get("date")));
} }
params.put("logValues", Arrays.asList("1", "2", "4")); params.put("logValues", Arrays.asList("1", "2", '3',"4"));
List<Map> result = new ArrayList<>(); List<Map> result = new ArrayList<>();
List<Map> listMap = DaoBase.getInstance().query("HPBI003.queryBySbYes", params, 0,100); List<Map> listMap = DaoBase.getInstance().query("HPBI003.queryBySbYes", params, 0,100);
List listMap2 = listMap.stream().map(map -> map.get("date")).sorted().distinct().collect(Collectors.toList()); List listMap2 = listMap.stream().map(map -> map.get("date")).sorted().distinct().collect(Collectors.toList());
...@@ -419,7 +419,7 @@ public class ServiceHPBI003 extends ServiceBase { ...@@ -419,7 +419,7 @@ public class ServiceHPBI003 extends ServiceBase {
if (params.containsKey("date")){ if (params.containsKey("date")){
params.put("date", DateUtils.formatShort(params.get("date"))); params.put("date", DateUtils.formatShort(params.get("date")));
} }
params.put("logValues", Arrays.asList("3", "5", "6")); params.put("logValues", Arrays.asList("5", "6"));
List<Map> result = new ArrayList<>(); List<Map> result = new ArrayList<>();
List<Map> listMap = DaoBase.getInstance().query("HPBI003.queryBySbYes", params, 0,100); List<Map> listMap = DaoBase.getInstance().query("HPBI003.queryBySbYes", params, 0,100);
List listMap2 = listMap.stream().map(map -> map.get("date")).sorted().distinct().collect(Collectors.toList()); List listMap2 = listMap.stream().map(map -> map.get("date")).sorted().distinct().collect(Collectors.toList());
......
...@@ -36,25 +36,24 @@ ...@@ -36,25 +36,24 @@
a.DEVICE_MODEL as "deviceModel", a.DEVICE_MODEL as "deviceModel",
ifnull(c.LOG_VALUE, 0) as "status" ifnull(c.LOG_VALUE, 0) as "status"
from ${hpjxSchema}.t_hpsb003 a from ${hpjxSchema}.t_hpsb003 a
join ( left join (
select EQUIPMENT_CODE, LOG_VALUE select EQUIPMENT_CODE, LOG_VALUE
from ${hpjxSchema}.t_hpsb002 where EQUIPMENT_TYPE = 'STARUS_TYPE' from ${hpjxSchema}.t_hpsb002 where EQUIPMENT_TYPE = 'STARUS_TYPE'
<isNotEmpty prepend=" AND " property="companyCode"> and CREATED_TIME =(
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="date">
CREATED_TIME =(
select MAX(CREATED_TIME) from ${hpjxSchema}.t_hpsb002 select MAX(CREATED_TIME) from ${hpjxSchema}.t_hpsb002
where EQUIPMENT_TYPE = 'STARUS_TYPE' where EQUIPMENT_TYPE = 'STARUS_TYPE'
<isNotEmpty prepend=" AND " property="companyCode"> <isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode# COMPANY_CODE = #companyCode#
</isNotEmpty> </isNotEmpty>
) )
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty> </isNotEmpty>
) c on a.DEVICE_CODE = c.EQUIPMENT_CODE ) c on a.DEVICE_CODE = c.EQUIPMENT_CODE
where where
a.DELETE_FLAG = 0 a.DELETE_FLAG = 0
and DEVICE_STATUS = 1 and DEVICE_STATUS = 1
and a.REVEAL = 1
<isNotEmpty prepend=" AND " property="companyCode"> <isNotEmpty prepend=" AND " property="companyCode">
a.COMPANY_CODE = #companyCode# a.COMPANY_CODE = #companyCode#
</isNotEmpty> </isNotEmpty>
...@@ -772,7 +771,7 @@ ...@@ -772,7 +771,7 @@
</isNotEmpty> </isNotEmpty>
group by EQUIPMENT_CODE group by EQUIPMENT_CODE
) c on a.DEVICE_CODE = c.EQUIPMENT_CODE ) c on a.DEVICE_CODE = c.EQUIPMENT_CODE
where a.DELETE_FLAG = 0 and DEVICE_STATUS = 1 where a.DELETE_FLAG = 0 and DEVICE_STATUS = 1 and a.REVEAL = 1
<isNotEmpty prepend=" AND " property="companyCode"> <isNotEmpty prepend=" AND " property="companyCode">
a.COMPANY_CODE = #companyCode# a.COMPANY_CODE = #companyCode#
</isNotEmpty> </isNotEmpty>
...@@ -806,7 +805,7 @@ ...@@ -806,7 +805,7 @@
</isNotEmpty> </isNotEmpty>
group by EQUIPMENT_CODE group by EQUIPMENT_CODE
) c on a.DEVICE_CODE = c.EQUIPMENT_CODE ) c on a.DEVICE_CODE = c.EQUIPMENT_CODE
where a.DELETE_FLAG = 0 and DEVICE_STATUS = 1 where a.DELETE_FLAG = 0 and DEVICE_STATUS = 1 and a.REVEAL = 1
<isNotEmpty prepend=" AND " property="companyCode"> <isNotEmpty prepend=" AND " property="companyCode">
a.COMPANY_CODE = #companyCode# a.COMPANY_CODE = #companyCode#
</isNotEmpty> </isNotEmpty>
...@@ -840,7 +839,7 @@ ...@@ -840,7 +839,7 @@
</isNotEmpty> </isNotEmpty>
group by EQUIPMENT_CODE group by EQUIPMENT_CODE
) c on a.DEVICE_CODE = c.EQUIPMENT_CODE ) c on a.DEVICE_CODE = c.EQUIPMENT_CODE
where a.DELETE_FLAG = 0 and DEVICE_STATUS = 1 where a.DELETE_FLAG = 0 and DEVICE_STATUS = 1 and a.REVEAL = 1
<isNotEmpty prepend=" AND " property="companyCode"> <isNotEmpty prepend=" AND " property="companyCode">
a.COMPANY_CODE = #companyCode# a.COMPANY_CODE = #companyCode#
</isNotEmpty> </isNotEmpty>
...@@ -874,7 +873,7 @@ ...@@ -874,7 +873,7 @@
</isNotEmpty> </isNotEmpty>
group by EQUIPMENT_CODE group by EQUIPMENT_CODE
) c on a.DEVICE_CODE = c.EQUIPMENT_CODE ) c on a.DEVICE_CODE = c.EQUIPMENT_CODE
where a.DELETE_FLAG = 0 and DEVICE_STATUS = 1 where a.DELETE_FLAG = 0 and DEVICE_STATUS = 1 and a.REVEAL = 1
<isNotEmpty prepend=" AND " property="companyCode"> <isNotEmpty prepend=" AND " property="companyCode">
a.COMPANY_CODE = #companyCode# a.COMPANY_CODE = #companyCode#
</isNotEmpty> </isNotEmpty>
...@@ -908,7 +907,7 @@ ...@@ -908,7 +907,7 @@
</isNotEmpty> </isNotEmpty>
group by EQUIPMENT_CODE group by EQUIPMENT_CODE
) c on a.DEVICE_CODE = c.EQUIPMENT_CODE ) c on a.DEVICE_CODE = c.EQUIPMENT_CODE
where a.DELETE_FLAG = 0 and DEVICE_STATUS = 1 where a.DELETE_FLAG = 0 and DEVICE_STATUS = 1 and a.REVEAL = 1
<isNotEmpty prepend=" AND " property="companyCode"> <isNotEmpty prepend=" AND " property="companyCode">
a.COMPANY_CODE = #companyCode# a.COMPANY_CODE = #companyCode#
</isNotEmpty> </isNotEmpty>
...@@ -942,7 +941,7 @@ ...@@ -942,7 +941,7 @@
</isNotEmpty> </isNotEmpty>
group by EQUIPMENT_CODE group by EQUIPMENT_CODE
) c on a.DEVICE_CODE = c.EQUIPMENT_CODE ) c on a.DEVICE_CODE = c.EQUIPMENT_CODE
where a.DELETE_FLAG = 0 and DEVICE_STATUS = 1 where a.DELETE_FLAG = 0 and DEVICE_STATUS = 1 and a.REVEAL = 1
<isNotEmpty prepend=" AND " property="companyCode"> <isNotEmpty prepend=" AND " property="companyCode">
a.COMPANY_CODE = #companyCode# a.COMPANY_CODE = #companyCode#
</isNotEmpty> </isNotEmpty>
...@@ -978,7 +977,7 @@ ...@@ -978,7 +977,7 @@
) c on a.DEVICE_CODE = c.EQUIPMENT_CODE ) c on a.DEVICE_CODE = c.EQUIPMENT_CODE
where where
a.DELETE_FLAG = 0 a.DELETE_FLAG = 0
and DEVICE_STATUS = 1 and DEVICE_STATUS = 1 and a.REVEAL = 1
<isNotEmpty prepend=" AND " property="companyCode"> <isNotEmpty prepend=" AND " property="companyCode">
a.COMPANY_CODE = #companyCode# a.COMPANY_CODE = #companyCode#
</isNotEmpty> </isNotEmpty>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment