Commit 647dec31 by liuyang

设备驾驶舱查询设备状态逻辑调整

parent 00b26146
...@@ -6,6 +6,7 @@ import com.baosight.hggp.aspect.annotation.OperationLogAnnotation; ...@@ -6,6 +6,7 @@ import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.core.dao.DaoBase; import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.core.dao.DaoUtils; import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.extapp.decheng.api.SbOpenApi; import com.baosight.hggp.core.extapp.decheng.api.SbOpenApi;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.pz.domain.HGPZ009; import com.baosight.hggp.hg.pz.domain.HGPZ009;
import com.baosight.hggp.hg.sb.domain.HGSB010; import com.baosight.hggp.hg.sb.domain.HGSB010;
import com.baosight.hggp.hg.xs.domain.User; import com.baosight.hggp.hg.xs.domain.User;
...@@ -220,8 +221,9 @@ public class ServiceHGSB010 extends ServiceEPBase { ...@@ -220,8 +221,9 @@ public class ServiceHGSB010 extends ServiceEPBase {
List<HGSB010> resultRows = MapUtils.toDaoEPBases(inInfo, HGSB010.class); List<HGSB010> resultRows = MapUtils.toDaoEPBases(inInfo, HGSB010.class);
for (HGSB010 hgsb010: resultRows) { for (HGSB010 hgsb010: resultRows) {
hgsb010.setEquipmentType("STARUS_TYPE"); hgsb010.setEquipmentType("STARUS_TYPE");
hgsb010.setCompanyCode(UserSessionUtils.getAccountCode());
DaoUtils.insert(HGSB010.INSERT, hgsb010); DaoUtils.insert(HGSB010.INSERT, hgsb010);
} }
return super.insert(inInfo); return inInfo;
} }
} }
...@@ -185,9 +185,11 @@ ...@@ -185,9 +185,11 @@
</isNotEmpty> </isNotEmpty>
left join ( left join (
select EQUIPMENT_CODE, LOG_VALUE select EQUIPMENT_CODE, LOG_VALUE
from ${hggpSchema}.HGSB010 where EQUIPMENT_TYPE = 'STARUS_TYPE' from ${hggpSchema}.HGSB010
and CREATED_TIME =( where EQUIPMENT_TYPE = 'STARUS_TYPE'
select MAX(CREATED_TIME) from ${hggpSchema}.HGSB010 and (EQUIPMENT_CODE,CREATED_TIME) IN (
select EQUIPMENT_CODE, MAX(CREATED_TIME)
from ${hggpSchema}.HGSB010
where EQUIPMENT_TYPE = 'STARUS_TYPE' where EQUIPMENT_TYPE = 'STARUS_TYPE'
<isNotEmpty prepend=" AND " property="accountCode"> <isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode# ACCOUNT_CODE = #accountCode#
...@@ -195,6 +197,7 @@ ...@@ -195,6 +197,7 @@
<isNotEmpty prepend=" AND " property="date"> <isNotEmpty prepend=" AND " property="date">
left(CREATED_TIME,8) = #date# left(CREATED_TIME,8) = #date#
</isNotEmpty> </isNotEmpty>
group by EQUIPMENT_CODE
) )
<isNotEmpty prepend=" AND " property="accountCode"> <isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode# ACCOUNT_CODE = #accountCode#
......
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