Commit ddd1def1 by wancheng

设备报屏更新

parent 2d9d1643
...@@ -36,9 +36,11 @@ public class ServiceHPBI003 extends ServiceBase { ...@@ -36,9 +36,11 @@ public class ServiceHPBI003 extends ServiceBase {
public EiInfo querySbStatus(EiInfo inInfo) { public EiInfo querySbStatus(EiInfo inInfo) {
String companyCode = UserSessionUtils.getCompanyCode(); String companyCode = UserSessionUtils.getCompanyCode();
String factoryCode = (String) inInfo.get("factoryCode"); String factoryCode = (String) inInfo.get("factoryCode");
String deviceCode = (String) inInfo.get("deviceCode");
Map sqlMap = new HashMap(); Map sqlMap = new HashMap();
sqlMap.put("companyCode", companyCode); sqlMap.put("companyCode", companyCode);
sqlMap.put("factoryCode", factoryCode); sqlMap.put("factoryCode", factoryCode);
sqlMap.put("deviceCode", deviceCode);
List<Map> result = this.dao.query("HPBI003.querySbStatus", sqlMap); List<Map> result = this.dao.query("HPBI003.querySbStatus", sqlMap);
inInfo.set("result",result); inInfo.set("result",result);
inInfo.setStatus(EiConstant.STATUS_DEFAULT); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
......
...@@ -9,17 +9,29 @@ ...@@ -9,17 +9,29 @@
<select id="querySbStatus" parameterClass="java.util.HashMap" <select id="querySbStatus" parameterClass="java.util.HashMap"
resultClass="java.util.HashMap"> resultClass="java.util.HashMap">
select select
DEVICE_CODE,DEVICE_STATUS,ORG_CNAME,DEVICE_NAME,DEVICE_MODEL, a.DEVICE_CODE,b.ORG_CNAME,a.DEVICE_NAME,a.DEVICE_MODEL,
case when DEVICE_STATUS = 0 then '停机' else '开机' end as STATUS_DESC case when c.LOG_VALUE = 2 then 1 else 0 end as DEVICE_STATUS,
case when c.LOG_VALUE = 2 then '运行状态'
when c.LOG_VALUE = 1 then '默认状态'
when c.LOG_VALUE = 3 then '暂停状态'
when c.LOG_VALUE = 4 then '复位状态'
when c.LOG_VALUE = 5 then '一级报警状态'
when c.LOG_VALUE = 6 then '二级报警状态'
else '异常状态' end as STATUS_DESC
from hpjx.t_hpsb003 a from hpjx.t_hpsb003 a
join iplat.TXSOG01 b on a.GROUP_CODE = b.ORG_ID and b.IS_DELETED = 0 join iplat.TXSOG01 b on a.GROUP_CODE = b.ORG_ID and b.IS_DELETED = 0
where DELETE_FLAG = 0 join hpjx.t_hpsb002 c on a.DEVICE_CODE=c.EQUIPMENT_CODE
where a.DELETE_FLAG = 0 and DEVICE_STATUS = 1 and c.EQUIPMENT_TYPE = 'STARUS_TYPE'
<isNotEmpty prepend=" AND " property="companyCode"> <isNotEmpty prepend=" AND " property="companyCode">
A.COMPANY_CODE = #companyCode# a.COMPANY_CODE = #companyCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode"> <isNotEmpty prepend=" AND " property="factoryCode">
A.FACTORY_CODE = #factoryCode# a.FACTORY_CODE = #factoryCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="deviceCode">
a.DEVICE_CODE = #deviceCode#
</isNotEmpty>
order by c.CREATED_TIME desc
limit 1 limit 1
</select> </select>
</sqlMap> </sqlMap>
\ No newline at end of file
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
$orderBy$ $orderBy$
</isNotEmpty> </isNotEmpty>
<isEmpty property="orderBy"> <isEmpty property="orderBy">
CREATED_TIME asc CREATED_TIME desc
</isEmpty> </isEmpty>
</dynamic> </dynamic>
......
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
$orderBy$ $orderBy$
</isNotEmpty> </isNotEmpty>
<isEmpty property="orderBy"> <isEmpty property="orderBy">
ID asc CREATED_TIME desc
</isEmpty> </isEmpty>
</dynamic> </dynamic>
......
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