Commit e38697c3 by liuyang

2024-10-27 驾驶舱数据同步

parent 7f70d060
...@@ -191,7 +191,7 @@ ...@@ -191,7 +191,7 @@
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="date"> <isNotEmpty prepend=" AND " property="date">
left(REGISTER_DATE, 4) = left(#date#, 4) left(REGISTER_DATE, 4) = left(#date#, 4)
and REGISTER_DATE &lt;= #data# and REGISTER_DATE &lt;= #date#
</isNotEmpty> </isNotEmpty>
) as YGL, ) as YGL,
0 as JHCL, 0 as JHCL,
......
...@@ -2,10 +2,12 @@ package com.baosight.hpjx.hp.sb.service; ...@@ -2,10 +2,12 @@ package com.baosight.hpjx.hp.sb.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation; import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.common.DdynamicEnum; import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.dao.DaoBase;
import com.baosight.hpjx.core.dao.DaoUtils; import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.sb.domain.HPSB002; import com.baosight.hpjx.hp.sb.domain.HPSB002;
import com.baosight.hpjx.hp.sb.domain.HPSB003; import com.baosight.hpjx.hp.sb.domain.HPSB003;
import com.baosight.hpjx.util.CommonMethod; import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.DateUtils;
import com.baosight.hpjx.util.ErrorCodeUtils; import com.baosight.hpjx.util.ErrorCodeUtils;
import com.baosight.iplat4j.core.ei.EiBlock; import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant; import com.baosight.iplat4j.core.ei.EiConstant;
...@@ -14,6 +16,7 @@ import com.baosight.iplat4j.core.exception.PlatException; ...@@ -14,6 +16,7 @@ import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.resource.I18nMessages; import com.baosight.iplat4j.core.resource.I18nMessages;
import com.baosight.iplat4j.core.service.impl.ServiceBase; import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.core.web.threadlocal.UserSession; import com.baosight.iplat4j.core.web.threadlocal.UserSession;
import org.apache.commons.collections.CollectionUtils;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
...@@ -91,6 +94,7 @@ public class ServiceHPSB002 extends ServiceBase { ...@@ -91,6 +94,7 @@ public class ServiceHPSB002 extends ServiceBase {
* 修改操作. * 修改操作.
*/ */
@OperationLogAnnotation(operModul = "设备日志",operType = "修改",operDesc = "修改") @OperationLogAnnotation(operModul = "设备日志",operType = "修改",operDesc = "修改")
@Override
public EiInfo update(EiInfo inInfo) { public EiInfo update(EiInfo inInfo) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try { try {
...@@ -161,4 +165,16 @@ public class ServiceHPSB002 extends ServiceBase { ...@@ -161,4 +165,16 @@ public class ServiceHPSB002 extends ServiceBase {
return inInfo; return inInfo;
} }
public EiInfo insertHgSb010(EiInfo inInfo) {
Map map = new HashMap<>();
map.put("maxDate", DateUtils.formatShort(DateUtils.shortDate()));
List<HPSB002> hpsb002s = DaoBase.getInstance().query("HPSB002.queryMaxDate", map);
if (CollectionUtils.isNotEmpty(hpsb002s)) {
for (HPSB002 hpsb002: hpsb002s) {
DaoUtils.insert("HPSB002.insertHgSb010", hpsb002);
}
}
return inInfo;
}
} }
...@@ -193,5 +193,37 @@ ...@@ -193,5 +193,37 @@
SUBSTR(CREATED_TIME,1,8) &lt; DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 30 day),'%Y%m%d') SUBSTR(CREATED_TIME,1,8) &lt; DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 30 day),'%Y%m%d')
</delete> </delete>
<select id="queryMaxDate" parameterClass="java.util.HashMap" resultClass="com.baosight.hpjx.hp.sb.domain.HPSB002">
SELECT
FILE_NAME as "fileName", <!-- 文件名 -->
EQUIPMENT_TYPE as "equipmentType", <!-- 设备状态 -->
EQUIPMENT_CODE as "equipmentCode", <!-- 设备编码 -->
LOG_INIVALUE as "logInivalue", <!-- 初始类容 -->
LOG_VALUE as "logValue", <!-- 日志类容 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建人名称 -->
CREATED_TIME as "createdTime" <!-- 创建时间 -->
FROM ${hpjxSchema}.T_HPSB002 WHERE 1=1
<isNotEmpty prepend=" AND " property="maxDate">
CREATED_TIME in (select max(CREATED_TIME) from ${hpjxSchema}.T_HPSB002 where 1=1 and left(CREATED_TIME,8) = #maxDate#)
</isNotEmpty>
</select>
<insert id="insertHgSb010">
INSERT INTO hggp.HGSB010 (
ACCOUNT_CODE,
FILE_NAME, <!-- 文件名 -->
EQUIPMENT_TYPE, <!-- 设备状态 -->
EQUIPMENT_CODE, <!-- 设备编码 -->
LOG_INIVALUE, <!-- 初始类容 -->
LOG_VALUE, <!-- 日志类容 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME <!-- 创建时间 -->
)
VALUES (#accountCode#, #fileName#, #equipmentType#, #equipmentCode#, #logInivalue#, #logValue#
, #createdBy#, #createdName#, #createdTime#)
</insert>
</sqlMap> </sqlMap>
\ No newline at end of file
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