Commit 1a17a5b1 by TEEMO\xzh64

修改设备日志记录

parent 9ee9530d
......@@ -75,5 +75,9 @@ public class HPConstants {
/** 设备状态 */
public static final String STARUS_TYPE = "STARUS_TYPE";
public static final String TIME_TYPE = "TIME_TYPE";
public static final String WARNING_TYPE = "WARNING_TYPE";
}
......@@ -3,6 +3,7 @@ package com.baosight.hpjx.controller;
import com.baosight.hpjx.common.HPConstants;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.equipment.hp.domain.CutterbarStatus;
import com.baosight.hpjx.equipment.hp.domain.CutterbarTime;
import com.baosight.hpjx.equipment.hp.domain.CutterbarWarning;
import com.baosight.hpjx.equipment.hp.domain.CutterbarWarningBase;
import com.baosight.hpjx.hp.sb.domain.HPSB001;
......@@ -28,45 +29,42 @@ public class LogInformationController extends ServiceBase {
@RequestMapping({"/analysis"})
public String logAnalysis(@PathVariable HPSB00A hpsb00A) {
HPSB002 hpsb002 = new HPSB002();
HPSB001 hpsb001 = new HPSB001();
//TODO 根据TYPE来判断内容属于哪一种,然后再进行解析
//TODO TYPE = STARUS_TYPE --- 设备状态
//TODO TYPE = TIME_TYPE --- 开机时间
//TODO TYPE = WARNING_TYPE --- 报警内容
String equipmentType = hpsb00A.getEquipmentType();
if (StringUtils.isEmpty(equipmentType)) {
if (equipmentType.equals(HPConstants.STARUS_TYPE)){
if (equipmentType.equals(HPConstants.STARUS_TYPE)) {
//解析设备状态
List<CutterbarStatus> cutterbarStatusList = XmlUtils.readXml(hpsb00A.getDataContent(), CutterbarStatus.class);
hpsb002.setId(StringUtils.uuid());
hpsb002.setEquipmentCode(hpsb00A.getEquipmentCode());
hpsb002.setEquipmentType(hpsb00A.getEquipmentType());
hpsb002.setLogValue(cutterbarStatusList.get(0).getStatus().toString());
DaoUtils.insert("HPSB002.insert", hpsb002);
return "设备日志记录成功";
}
} else {
}
HPSB002 hpsb002 = new HPSB002();
HPSB001 hpsb001 = new HPSB001();
//解析设备状态
List<CutterbarStatus> cutterbarStatusList = XmlUtils.readXml(hpsb00A.getEquipmentType(), CutterbarStatus.class);
String value = "";
if (cutterbarStatusList.get(0).getStatus() == 1){
value = "默认状态";
} else if (cutterbarStatusList.get(0).getStatus() == 2){
value = "运行状态";
} else if (cutterbarStatusList.get(0).getStatus() == 3){
value = "暂停状态";
} else if (cutterbarStatusList.get(0).getStatus() == 4){
value = "复位状态";
} else if (cutterbarStatusList.get(0).getStatus() == 5){
value = "一级报警状态";
} else if (cutterbarStatusList.get(0).getStatus() == 6){
value = "二级报警状态";
if (equipmentType.equals(HPConstants.TIME_TYPE)) {
//解析开机时间
List<CutterbarTime> cutterbarTimeList = XmlUtils.readXml(hpsb00A.getDataContent(), CutterbarTime.class);
hpsb002.setId(StringUtils.uuid());
hpsb002.setEquipmentCode(hpsb00A.getEquipmentCode());
hpsb002.setEquipmentType(hpsb00A.getEquipmentType());
hpsb002.setLogValue(cutterbarTimeList.get(0).getTime());
DaoUtils.insert("HPSB002.insert", hpsb002);
return "设备日志记录成功";
}
//解析数据内容
if (equipmentType.equals(HPConstants.WARNING_TYPE)) {
//解析报警内容
List<CutterbarWarningBase> cutterbarWarningBaseList = XmlUtils.readXml(hpsb00A.getDataContent(), CutterbarWarningBase.class);
CutterbarWarning cutterbarWarning = new CutterbarWarning();
if (CollectionUtils.isNotEmpty(cutterbarWarningBaseList)) {
cutterbarWarning = CutterbarWarning.convertBase(cutterbarWarningBaseList.get(0));
}
if (cutterbarStatusList.get(0).getStatus() > 2) {
hpsb001.setId(StringUtils.uuid());
hpsb001.setErrorCode(cutterbarWarning.getErrorCode());
hpsb001.setPrio(cutterbarWarning.getPrio());
......@@ -75,24 +73,11 @@ public class LogInformationController extends ServiceBase {
hpsb001.setGotoRowNone(cutterbarWarning.getGotoRowNone());
hpsb001.setFileName(cutterbarWarning.getFileName());
hpsb001.setEquipmentCode(hpsb00A.getEquipmentCode());
hpsb001.setEquipmentType(value);
hpsb001.setEquipmentType(hpsb00A.getEquipmentType());
DaoUtils.insert("HPSB001.insert", hpsb001);
return "设备异常日志记录成功";
}
hpsb002.setId(StringUtils.uuid());
hpsb002.setProgramNo(cutterbarWarning.getProgramNo());
hpsb002.setErrorCode(cutterbarWarning.getErrorCode());
hpsb002.setPrio(cutterbarWarning.getPrio());
hpsb002.setRowno(cutterbarWarning.getRowNo());
hpsb002.setGotoRowNone(cutterbarWarning.getGotoRowNone());
hpsb002.setFileName(cutterbarWarning.getFileName());
hpsb002.setEquipmentCode(hpsb00A.getEquipmentCode());
hpsb002.setEquipmentType(value);
DaoUtils.insert("HPSB002.insert", hpsb002);
return "设备日志记录成功";
}
return "未解析到日志类型";
}
}
package com.baosight.hpjx.equipment.hp.domain;
import com.baosight.hpjx.xml.IXml;
import com.baosight.hpjx.xml.XmlUtils;
import lombok.Data;
import java.util.List;
/**
* @Author xzh
* @Date 2024/4/17 9:22
*/
@Data
public class CutterbarTime {
@IXml(nodeName = "tm")
private String time;
public static void main(String[] args) {
List<CutterbarTime> list = XmlUtils.readXml("<startTime><tm>2020-7-29 14:30:25</tm></startTime>", CutterbarTime.class);
System.out.println(list.get(0).getTime());
}
}
/**
* Generate time : 2024-04-12 16:36:57
* Version : 1.0
*/
package com.baosight.hpjx.hp.sb.domain;
import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.data.DaoEPBase;
import java.util.HashMap;
import java.util.Map;
import com.baosight.iplat4j.core.util.StringUtils;
/**
* THpsb002
*
*/
public class HPSB002 extends DaoEPBase {
private String id = " "; /* ID*/
private String programNo = " "; /* 程序号*/
private String rowno = " "; /* 行号*/
private String gotoRowNone = " "; /* 不存在跳转行*/
private String fileName = " "; /* 文件名*/
private String equipmentType = " "; /* 设备状态*/
private String equipmentCode = " "; /* 设备编码*/
private String createdBy = " "; /* 创建人*/
private String createdName = " "; /* 创建人名称*/
private String createdTime = " "; /* 创建时间*/
private String updatedBy = " "; /* 更新人*/
private String updatedName = " "; /* 更新人名称*/
private String updatedTime = " "; /* 更新时间*/
private Integer deleteFlag = Integer.valueOf(0); /* 是否删除0.否1.是*/
private String errorCode = " "; /* 异常编码*/
private String prio = " "; /* 异常登记*/
/**
* initialize the metadata
*/
public void initMetaData() {
EiColumn eiColumn;
eiColumn = new EiColumn("id");
eiColumn.setPrimaryKey(true);
eiColumn.setDescName("ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("programNo");
eiColumn.setDescName("程序号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("rowno");
eiColumn.setDescName("行号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("gotoRowNone");
eiColumn.setDescName("不存在跳转行");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("fileName");
eiColumn.setDescName("文件名");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("equipmentType");
eiColumn.setDescName("设备状态");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("equipmentCode");
eiColumn.setDescName("设备编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("createdBy");
eiColumn.setDescName("创建人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("createdName");
eiColumn.setDescName("创建人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("createdTime");
eiColumn.setDescName("创建时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("updatedBy");
eiColumn.setDescName("更新人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("updatedName");
eiColumn.setDescName("更新人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("updatedTime");
eiColumn.setDescName("更新时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("deleteFlag");
eiColumn.setDescName("是否删除0.否1.是");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("errorCode");
eiColumn.setDescName("异常编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("prio");
eiColumn.setDescName("异常登记");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor
*/
public HPSB002() {
initMetaData();
}
/**
* get the id - ID
* @return the id
*/
public String getId() {
return this.id;
}
/**
* set the id - ID
*/
public void setId(String id) {
this.id = id;
}
/**
* get the programNo - 程序号
* @return the programNo
*/
public String getProgramNo() {
return this.programNo;
}
/**
* set the programNo - 程序号
*/
public void setProgramNo(String programNo) {
this.programNo = programNo;
}
/**
* get the rowno - 行号
* @return the rowno
*/
public String getRowno() {
return this.rowno;
}
/**
* set the rowno - 行号
*/
public void setRowno(String rowno) {
this.rowno = rowno;
}
/**
* get the gotoRowNone - 不存在跳转行
* @return the gotoRowNone
*/
public String getGotoRowNone() {
return this.gotoRowNone;
}
/**
* set the gotoRowNone - 不存在跳转行
*/
public void setGotoRowNone(String gotoRowNone) {
this.gotoRowNone = gotoRowNone;
}
/**
* get the fileName - 文件名
* @return the fileName
*/
public String getFileName() {
return this.fileName;
}
/**
* set the fileName - 文件名
*/
public void setFileName(String fileName) {
this.fileName = fileName;
}
/**
* get the equipmentType - 设备状态
* @return the equipmentType
*/
public String getEquipmentType() {
return this.equipmentType;
}
/**
* set the equipmentType - 设备状态
*/
public void setEquipmentType(String equipmentType) {
this.equipmentType = equipmentType;
}
/**
* get the equipmentCode - 设备编码
* @return the equipmentCode
*/
public String getEquipmentCode() {
return this.equipmentCode;
}
/**
* set the equipmentCode - 设备编码
*/
public void setEquipmentCode(String equipmentCode) {
this.equipmentCode = equipmentCode;
}
/**
* get the createdBy - 创建人
* @return the createdBy
*/
public String getCreatedBy() {
return this.createdBy;
}
/**
* set the createdBy - 创建人
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
/**
* get the createdName - 创建人名称
* @return the createdName
*/
public String getCreatedName() {
return this.createdName;
}
/**
* set the createdName - 创建人名称
*/
public void setCreatedName(String createdName) {
this.createdName = createdName;
}
/**
* get the createdTime - 创建时间
* @return the createdTime
*/
public String getCreatedTime() {
return this.createdTime;
}
/**
* set the createdTime - 创建时间
*/
public void setCreatedTime(String createdTime) {
this.createdTime = createdTime;
}
/**
* get the updatedBy - 更新人
* @return the updatedBy
*/
public String getUpdatedBy() {
return this.updatedBy;
}
/**
* set the updatedBy - 更新人
*/
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy;
}
/**
* get the updatedName - 更新人名称
* @return the updatedName
*/
public String getUpdatedName() {
return this.updatedName;
}
/**
* set the updatedName - 更新人名称
*/
public void setUpdatedName(String updatedName) {
this.updatedName = updatedName;
}
/**
* get the updatedTime - 更新时间
* @return the updatedTime
*/
public String getUpdatedTime() {
return this.updatedTime;
}
/**
* set the updatedTime - 更新时间
*/
public void setUpdatedTime(String updatedTime) {
this.updatedTime = updatedTime;
}
/**
* get the deleteFlag - 是否删除0.否1.是
* @return the deleteFlag
*/
public Integer getDeleteFlag() {
return this.deleteFlag;
}
/**
* set the deleteFlag - 是否删除0.否1.是
*/
public void setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
}
/**
* get the errorCode - 异常编码
* @return the errorCode
*/
public String getErrorCode() {
return this.errorCode;
}
/**
* set the errorCode - 异常编码
*/
public void setErrorCode(String errorCode) {
this.errorCode = errorCode;
}
/**
* get the prio - 异常登记
* @return the prio
*/
public String getPrio() {
return this.prio;
}
/**
* set the prio - 异常登记
*/
public void setPrio(String prio) {
this.prio = prio;
}
/**
* get the value from Map
*/
public void fromMap(Map map) {
setId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("id")), id));
setProgramNo(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("programNo")), programNo));
setRowno(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("rowno")), rowno));
setGotoRowNone(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("gotoRowNone")), gotoRowNone));
setFileName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fileName")), fileName));
setEquipmentType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("equipmentType")), equipmentType));
setEquipmentCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("equipmentCode")), equipmentCode));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("createdBy")), createdBy));
setCreatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("createdName")), createdName));
setCreatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("createdTime")), createdTime));
setUpdatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("updatedBy")), updatedBy));
setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("updatedName")), updatedName));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("updatedTime")), updatedTime));
setDeleteFlag(NumberUtils.toInteger(StringUtils.toString(map.get("deleteFlag")), deleteFlag));
setErrorCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("errorCode")), errorCode));
setPrio(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("prio")), prio));
}
/**
* set the value to Map
*/
public Map toMap() {
Map map = new HashMap();
map.put("id",StringUtils.toString(id, eiMetadata.getMeta("id")));
map.put("programNo",StringUtils.toString(programNo, eiMetadata.getMeta("programNo")));
map.put("rowno",StringUtils.toString(rowno, eiMetadata.getMeta("rowno")));
map.put("gotoRowNone",StringUtils.toString(gotoRowNone, eiMetadata.getMeta("gotoRowNone")));
map.put("fileName",StringUtils.toString(fileName, eiMetadata.getMeta("fileName")));
map.put("equipmentType",StringUtils.toString(equipmentType, eiMetadata.getMeta("equipmentType")));
map.put("equipmentCode",StringUtils.toString(equipmentCode, eiMetadata.getMeta("equipmentCode")));
map.put("createdBy",StringUtils.toString(createdBy, eiMetadata.getMeta("createdBy")));
map.put("createdName",StringUtils.toString(createdName, eiMetadata.getMeta("createdName")));
map.put("createdTime",StringUtils.toString(createdTime, eiMetadata.getMeta("createdTime")));
map.put("updatedBy",StringUtils.toString(updatedBy, eiMetadata.getMeta("updatedBy")));
map.put("updatedName",StringUtils.toString(updatedName, eiMetadata.getMeta("updatedName")));
map.put("updatedTime",StringUtils.toString(updatedTime, eiMetadata.getMeta("updatedTime")));
map.put("deleteFlag",StringUtils.toString(deleteFlag, eiMetadata.getMeta("deleteFlag")));
map.put("errorCode",StringUtils.toString(errorCode, eiMetadata.getMeta("errorCode")));
map.put("prio",StringUtils.toString(prio, eiMetadata.getMeta("prio")));
return map;
}
}
\ No newline at end of file
package com.baosight.hpjx.hp.sb.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.sb.domain.HPSB001;
import com.baosight.hpjx.hp.sc.domain.HPSC001;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
......@@ -10,7 +16,9 @@ import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.core.web.threadlocal.UserSession;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
/**
......@@ -61,7 +69,7 @@ public class ServiceHPSB001 extends ServiceBase {
hpsb001.setCreatedTime(sdf.format(new Date()));
hpsb001.setUpdatedBy(null);
hpsb001.setUpdatedTime(null);
this.dao.insert("HPSB001.insert", hpsb001.toMap());
DaoUtils.insert("HPSB001.insert", hpsb001.toMap());
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("新增成功!");
......@@ -91,7 +99,7 @@ public class ServiceHPSB001 extends ServiceBase {
hpsb001.fromMap(map);
hpsb001.setUpdatedBy(UserSession.getUserId());
hpsb001.setUpdatedTime(sdf.format(new Date()));
this.dao.update("HPSB001.update", hpsb001.toMap());
DaoUtils.update("HPSB001.update", hpsb001.toMap());
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("修改成功!");
......@@ -107,7 +115,7 @@ public class ServiceHPSB001 extends ServiceBase {
/**
* 删除操作.
*/
*
@OperationLogAnnotation(operModul = "设备异常日志",operType = "删除",operDesc = "删除")
public EiInfo delete(EiInfo eiInfo) {
HPSB001 hpsb001 = new HPSB001();
......@@ -130,7 +138,7 @@ public class ServiceHPSB001 extends ServiceBase {
eiInfo.setStatus(EiConstant.STATUS_SUCCESS);
eiInfo.setMsg("删除成功!");
return eiInfo;
}
}*/
/**
* 定时删除操作.
......
package com.baosight.hpjx.hp.sb.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.sb.domain.HPSB002;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
......@@ -61,7 +62,7 @@ public class ServiceHPSB002 extends ServiceBase {
hpsb002.setCreatedTime(sdf.format(new Date()));
hpsb002.setUpdatedBy(null);
hpsb002.setUpdatedTime(null);
this.dao.insert("HPSB002.insert", hpsb002.toMap());
DaoUtils.insert("HPSB002.insert", hpsb002.toMap());
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("新增成功!");
......@@ -91,7 +92,7 @@ public class ServiceHPSB002 extends ServiceBase {
hpsb002.fromMap(map);
hpsb002.setUpdatedBy(UserSession.getUserId());
hpsb002.setUpdatedTime(sdf.format(new Date()));
this.dao.update("HPSB002.update", hpsb002.toMap());
DaoUtils.update("HPSB002.update", hpsb002.toMap());
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("修改成功!");
......@@ -107,7 +108,7 @@ public class ServiceHPSB002 extends ServiceBase {
/**
* 删除操作.
*/
*
@OperationLogAnnotation(operModul = "设备日志",operType = "删除",operDesc = "删除")
public EiInfo delete(EiInfo eiInfo) {
HPSB002 hpsb002 = new HPSB002();
......@@ -131,6 +132,7 @@ public class ServiceHPSB002 extends ServiceBase {
eiInfo.setMsg("删除成功!");
return eiInfo;
}
*/
/**
* 定时删除操作.
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<!-- table information
Generate time : 2024-04-12 16:36:57
Version : 1.0
tableName :hpjx.t_hpsb002
ID VARCHAR NOT NULL primarykey,
PROGRAM_NO VARCHAR,
ROWNO VARCHAR,
GOTO_ROW_NONE VARCHAR,
FILE_NAME VARCHAR,
EQUIPMENT_TYPE VARCHAR,
EQUIPMENT_CODE VARCHAR,
CREATED_BY VARCHAR,
CREATED_NAME VARCHAR,
CREATED_TIME VARCHAR,
UPDATED_BY VARCHAR,
UPDATED_NAME VARCHAR,
UPDATED_TIME VARCHAR,
DELETE_FLAG TINYINT,
ERROR_CODE VARCHAR,
PRIO VARCHAR
-->
<sqlMap namespace="HPSB002">
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.sb.domain.HPSB002">
SELECT
ID as "id", <!-- ID -->
PROGRAM_NO as "programNo", <!-- 程序号 -->
ROWNO as "rowno", <!-- 行号 -->
GOTO_ROW_NONE as "gotoRowNone", <!-- 不存在跳转行 -->
FILE_NAME as "fileName", <!-- 文件名 -->
EQUIPMENT_TYPE as "equipmentType", <!-- 设备状态 -->
EQUIPMENT_CODE as "equipmentCode", <!-- 设备编码 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建人名称 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 更新人 -->
UPDATED_NAME as "updatedName", <!-- 更新人名称 -->
UPDATED_TIME as "updatedTime", <!-- 更新时间 -->
DELETE_FLAG as "deleteFlag", <!-- 是否删除0.否1.是 -->
ERROR_CODE as "errorCode", <!-- 异常编码 -->
PRIO as "prio" <!-- 异常登记 -->
FROM hpjx.t_hpsb002 WHERE 1=1
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID asc
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM hpjx.t_hpsb002 WHERE 1=1
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
</select>
<!--
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="programNo">
PROGRAM_NO = #programNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="rowno">
ROWNO = #rowno#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="gotoRowNone">
GOTO_ROW_NONE = #gotoRowNone#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="fileName">
FILE_NAME = #fileName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="equipmentType">
EQUIPMENT_TYPE = #equipmentType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="equipmentCode">
EQUIPMENT_CODE = #equipmentCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="errorCode">
ERROR_CODE = #errorCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prio">
PRIO = #prio#
</isNotEmpty>
-->
<insert id="insert">
INSERT INTO hpjx.t_hpsb002 (ID, <!-- ID -->
PROGRAM_NO, <!-- 程序号 -->
ROWNO, <!-- 行号 -->
GOTO_ROW_NONE, <!-- 不存在跳转行 -->
FILE_NAME, <!-- 文件名 -->
EQUIPMENT_TYPE, <!-- 设备状态 -->
EQUIPMENT_CODE, <!-- 设备编码 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 更新人 -->
UPDATED_NAME, <!-- 更新人名称 -->
UPDATED_TIME, <!-- 更新时间 -->
DELETE_FLAG, <!-- 是否删除0.否1.是 -->
ERROR_CODE, <!-- 异常编码 -->
PRIO <!-- 异常登记 -->
)
VALUES (#id#, #programNo#, #rowno#, #gotoRowNone#, #fileName#, #equipmentType#, #equipmentCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #errorCode#, #prio#)
</insert>
<delete id="delete">
DELETE FROM hpjx.t_hpsb002 WHERE
ID = #id#
</delete>
<delete id="deleteByCreatedTime">
DELETE FROM hpjx.t_hpsb002 WHERE
SUBSTR(CREATED_TIME,1,8) &lt; DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 30 day),'%Y%m%d')
</delete>
<update id="update">
UPDATE hpjx.t_hpsb002
SET
PROGRAM_NO = #programNo#, <!-- 程序号 -->
ROWNO = #rowno#, <!-- 行号 -->
GOTO_ROW_NONE = #gotoRowNone#, <!-- 不存在跳转行 -->
FILE_NAME = #fileName#, <!-- 文件名 -->
EQUIPMENT_TYPE = #equipmentType#, <!-- 设备状态 -->
EQUIPMENT_CODE = #equipmentCode#, <!-- 设备编码 -->
CREATED_BY = #createdBy#, <!-- 创建人 -->
CREATED_NAME = #createdName#, <!-- 创建人名称 -->
CREATED_TIME = #createdTime#, <!-- 创建时间 -->
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_NAME = #updatedName#, <!-- 更新人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
DELETE_FLAG = #deleteFlag#, <!-- 是否删除0.否1.是 -->
ERROR_CODE = #errorCode#, <!-- 异常编码 -->
PRIO = #prio# <!-- 异常登记 -->
WHERE
ID = #id#
</update>
</sqlMap>
\ No newline at end of file
......@@ -10,7 +10,7 @@
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFInput cname="操作人" ename="inqu_status-0-createdName" colWidth="3"/>
<EF:EFInput cname="程序号" ename="inqu_status-0-programNo" colWidth="3"/>
<EF:EFInput cname="异常编码" ename="inqu_status-0-errorCode" colWidth="3"/>
</div>
</EF:EFRegion>
......@@ -22,7 +22,10 @@
<EF:EFColumn ename="programNo" cname="程序号" enable="false" readonly="true" width="80" align="center"/>
<EF:EFColumn ename="equipmentType" cname="设备状态" enable="false" readonly="true" width="100" align="center"/>
<EF:EFColumn ename="equipmentCode" cname="设备编码" enable="false" readonly="true" width="100" align="center"/>
<EF:EFColumn ename="dataContent" cname="数据内容" enable="false" readonly="true" width="100" align="center"/>
<EF:EFColumn ename="prio" cname="数据内容" enable="false" readonly="true" width="100" align="center"/>
<EF:EFColumn ename="rowno" cname="行号" enable="false" readonly="true" width="100" align="center"/>
<EF:EFColumn ename="gotoRowNone" cname="不存在跳转行" enable="false" readonly="true" width="100" align="center"/>
<EF:EFColumn ename="fileName" cname="文件名" enable="false" readonly="true" width="100" align="center"/>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" readonly="true" width="120" align="center"
parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss"/>
</EF:EFGrid>
......
......@@ -10,7 +10,6 @@
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFInput cname="操作人" ename="inqu_status-0-createdName" colWidth="3"/>
<EF:EFInput cname="程序号" ename="inqu_status-0-programNo" colWidth="3"/>
</div>
</EF:EFRegion>
......@@ -18,10 +17,9 @@
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="主键id" hidden="true"/>
<EF:EFColumn ename="createdName" cname="操作人" enable="false" readonly="true" width="150" align="center"/>
<EF:EFColumn ename="programNo" cname="程序号" enable="false" readonly="true" width="80" align="center"/>
<EF:EFColumn ename="equipmentType" cname="设备状态" enable="false" readonly="true" width="100" align="center"/>
<EF:EFColumn ename="equipmentCode" cname="设备编码" enable="false" readonly="true" width="100" align="center"/>
<EF:EFColumn ename="dataContent" cname="数据内容" enable="false" readonly="true" width="100" align="center"/>
<EF:EFColumn ename="logValue" cname="数据内容" enable="false" readonly="true" width="100" align="center"/>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" readonly="true" width="120" align="center"
parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss"/>
</EF:EFGrid>
......
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