public void recordOrder(OrderLogPojo orderLog) {
if (null != orderLog) {
this.getSqlMapClientTemplate().insert("CBSInterfaceConfigBusinessDaoImpl.insertInterfaceExcuteLog", orderLog);
updateColunmClob(orderLog);
}
}
/**
* 更新clob字段
* @param orderLog
*/
public void updateColunmClob(OrderLogPojo orderLog){
//入参clob
Map<String,String> inMap = new HashMap<String,String>();
String inmsg = orderLog.getInmsg();
if (null != inmsg && !("".equals(inmsg))) {
while (inmsg.length() > 500) {
String temp = inmsg.substring(0, 500);
inMap.put("inmsg", temp);
inMap.put("logId", orderLog.getLogId());
this.getSqlMapClientTemplate().update("CBSInterfaceConfigBusinessDaoImpl.updateInmsgClob", inMap);
inmsg = inmsg.substring(500);
}
inMap.put("inmsg", inmsg);
inMap.put("logId", orderLog.getLogId());
this.getSqlMapClientTemplate().update("CBSInterfaceConfigBusinessDaoImpl.updateInmsgClob", inMap);
}
//出参clob
Map<String, String> outMap = new HashMap<String, String>();
String outmsg = orderLog.getOutmsg();
if (null != outmsg && !("".equals(outmsg))) {
while (outmsg.length() > 500) {
String temp = outmsg.substring(0, 500);
outMap.put("outmsg", temp);
outMap.put("logId", orderLog.getLogId());
this.getSqlMapClientTemplate().update("CBSInterfaceConfigBusinessDaoImpl.updateOutmsgClob", outMap);
outmsg = outmsg.substring(500);
}
outMap.put("outmsg", outmsg);
outMap.put("logId", orderLog.getLogId());
this.getSqlMapClientTemplate().update("CBSInterfaceConfigBusinessDaoImpl.updateOutmsgClob", outMap);
}
//异常提示clob
Map<String, String> errMap = new HashMap<String, String>();
String errmsg = orderLog.getErrmsg();
if (null != errmsg && !("".equals(errmsg))) {
while (errmsg.length() > 500) {
String temp = errmsg.substring(0, 500);
errMap.put("errmsg", temp);
errMap.put("logId", orderLog.getLogId());
this.getSqlMapClientTemplate().update("CBSInterfaceConfigBusinessDaoImpl.updatErrClob", errMap);
errmsg = errmsg.substring(500);
}
errMap.put("errmsg", errmsg);
errMap.put("logId", orderLog.getLogId());
this.getSqlMapClientTemplate().update("CBSInterfaceConfigBusinessDaoImpl.updatErrClob", errMap);
}
}
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" " http://ibatis.apache.org/dtd/sql-map-2.dtd" >
<sqlMap namespace="CBSInterfaceConfigBusinessDaoImpl">
<typeAlias alias="OrderLogPojo" type="com.timesontransfar.cbsintf.pojo.OrderLogPojo" />
<typeAlias alias="hashMap" type="java.util.HashMap" />
<typeAlias alias="string" type="java.lang.String" />
<typeAlias alias="int" type="java.lang.Integer" />
<insert id="insertInterfaceExcuteLog" parameterClass="OrderLogPojo">
insert into TB_ORD_INTERFACE_LOG
(LOG_ID,
INTERFACE_NAME,
METHOD_NAME,
EXCUTETIME,
COMPLETETIME,
RETFLAG,
PROD_ORDER_ID,
APP_NO,
INMSG,
OUTMSG,
ERRMSG,
TIME_LONG,
RECALL_FLAG,
REGION_ID)
VALUES
(#logId:VARCHAR#,
#interfaceName:VARCHAR#,
#methodName:VARCHAR#,
SYSDATE,
SYSDATE,
#retFlag:VARCHAR#,
#prodOrderId:VARCHAR#,
#appNo:VARCHAR#,
empty_clob(),
empty_clob(),
empty_clob(),
#longTime:VARCHAR#,
#recallFlag:VARCHAR#,
#regionId:VARCHAR#)
</insert>
<update id="updateInmsgClob" parameterClass="hashMap">
UPDATE TB_ORD_INTERFACE_LOG
SET INMSG = INMSG|| #inmsg:CLOB#
where LOG_ID = #logId:VARCHAR#
</update>
<update id="updateOutmsgClob" parameterClass="hashMap">
UPDATE TB_ORD_INTERFACE_LOG
SET OUTMSG = OUTMSG|| #outmsg:CLOB#
where LOG_ID = #logId:VARCHAR#
</update>
<update id="updatErrClob" parameterClass="hashMap">
UPDATE TB_ORD_INTERFACE_LOG
SET ERRMSG = ERRMSG|| #errmsg:CLOB#
where LOG_ID = #logId:VARCHAR#
</update>
</sqlMap>