Merge remote-tracking branch 'origin/master'
commit
e4b71c31fb
@ -0,0 +1,6 @@
|
||||
package com.foreverwin.mesnac.common.constant;
|
||||
|
||||
public class IntegrationTypeConstant {
|
||||
|
||||
public static final String ITEM = "ITEM";
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.foreverwin.mesnac.integration.controller;
|
||||
|
||||
|
||||
import com.foreverwin.mesnac.integration.service.IntegrationLogService;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Leon.L
|
||||
* @since 2021-06-16
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/Z-INTEGRATION-LOG")
|
||||
public class IntegrationLogController {
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.foreverwin.mesnac.integration.mapper;
|
||||
|
||||
import com.foreverwin.mesnac.integration.model.IntegrationLog;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author Leon.L
|
||||
* @since 2021-06-16
|
||||
*/
|
||||
@Repository
|
||||
public interface IntegrationLogMapper extends BaseMapper<IntegrationLog> {
|
||||
|
||||
}
|
@ -0,0 +1,63 @@
|
||||
package com.foreverwin.mesnac.integration.model;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
|
||||
public class WebServiceDto {
|
||||
|
||||
@JSONField(name="HANDLE")
|
||||
private String HANDLE;
|
||||
@JSONField(name="STATUS")
|
||||
private String STATUS;
|
||||
@JSONField(name="MESSAGE")
|
||||
private String MESSAGE;
|
||||
|
||||
public static WebServiceDto success(String message) {
|
||||
WebServiceDto webServiceDto = new WebServiceDto();
|
||||
webServiceDto.setSTATUS("S");
|
||||
webServiceDto.setMESSAGE(message);
|
||||
|
||||
return webServiceDto;
|
||||
}
|
||||
|
||||
public static WebServiceDto success(String handle, String message) {
|
||||
WebServiceDto webServiceDto = new WebServiceDto();
|
||||
webServiceDto.setHANDLE(handle);
|
||||
webServiceDto.setSTATUS("S");
|
||||
webServiceDto.setMESSAGE(message);
|
||||
|
||||
return webServiceDto;
|
||||
}
|
||||
|
||||
public static WebServiceDto fail(String handle, String message) {
|
||||
WebServiceDto webServiceDto = new WebServiceDto();
|
||||
webServiceDto.setHANDLE(handle);
|
||||
webServiceDto.setSTATUS("E");
|
||||
webServiceDto.setMESSAGE(message);
|
||||
|
||||
return webServiceDto;
|
||||
}
|
||||
|
||||
public String getHANDLE() {
|
||||
return HANDLE;
|
||||
}
|
||||
|
||||
public void setHANDLE(String HANDLE) {
|
||||
this.HANDLE = HANDLE;
|
||||
}
|
||||
|
||||
public String getSTATUS() {
|
||||
return STATUS;
|
||||
}
|
||||
|
||||
public void setSTATUS(String STATUS) {
|
||||
this.STATUS = STATUS;
|
||||
}
|
||||
|
||||
public String getMESSAGE() {
|
||||
return MESSAGE;
|
||||
}
|
||||
|
||||
public void setMESSAGE(String MESSAGE) {
|
||||
this.MESSAGE = MESSAGE;
|
||||
}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package com.foreverwin.mesnac.integration.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.foreverwin.mesnac.integration.model.IntegrationLog;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author Leon.L
|
||||
* @since 2021-06-16
|
||||
*/
|
||||
public interface IntegrationLogService extends IService<IntegrationLog> {
|
||||
|
||||
void saveIntegrationLog(IntegrationLog integrationLog);
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package com.foreverwin.mesnac.integration.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
public interface InterfaceService {
|
||||
|
||||
/**
|
||||
* 物料创建或者更新
|
||||
*
|
||||
* @param jsonObject
|
||||
*/
|
||||
void createOrUpdateItem(JSONObject jsonObject) throws Exception;
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package com.foreverwin.mesnac.integration.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.foreverwin.mesnac.integration.model.IntegrationLog;
|
||||
import com.foreverwin.mesnac.integration.mapper.IntegrationLogMapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.foreverwin.mesnac.integration.service.IntegrationLogService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author Leon.L
|
||||
* @since 2021-06-16
|
||||
*/
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class IntegrationLogServiceImpl extends ServiceImpl<IntegrationLogMapper, IntegrationLog> implements IntegrationLogService {
|
||||
|
||||
|
||||
@Autowired
|
||||
private IntegrationLogMapper integrationLogMapper;
|
||||
|
||||
@Override
|
||||
@Transactional(propagation = Propagation.REQUIRES_NEW)
|
||||
public void saveIntegrationLog(IntegrationLog integrationLog) {
|
||||
integrationLogMapper.insert(integrationLog);
|
||||
}
|
||||
}
|
@ -0,0 +1,127 @@
|
||||
package com.foreverwin.mesnac.integration.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.foreverwin.mesnac.common.enums.HandleEnum;
|
||||
import com.foreverwin.mesnac.common.util.StringUtil;
|
||||
import com.foreverwin.mesnac.integration.service.InterfaceService;
|
||||
import com.foreverwin.mesnac.meapi.model.Item;
|
||||
import com.foreverwin.mesnac.meapi.service.ItemService;
|
||||
import com.foreverwin.modular.core.meext.MEServices;
|
||||
import com.sap.me.common.CustomValue;
|
||||
import com.sap.me.common.MaterialType;
|
||||
import com.sap.me.common.ObjectReference;
|
||||
import com.sap.me.common.ProcurementType;
|
||||
import com.sap.me.productdefinition.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.i18n.LocaleContextHolder;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Leon
|
||||
* @date 2021-06-16
|
||||
*
|
||||
* 接口服务类
|
||||
*
|
||||
*/
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class InterfaceServiceImpl implements InterfaceService {
|
||||
|
||||
@Autowired
|
||||
private ItemService itemService;
|
||||
|
||||
|
||||
@Override
|
||||
public void createOrUpdateItem(JSONObject jsonObject) throws Exception{
|
||||
//数据主键
|
||||
String site = jsonObject.getString("SITE");
|
||||
//物料
|
||||
String item = jsonObject.getString("ITEM");
|
||||
//版本:默认值A
|
||||
String revision = jsonObject.getString("REVISION");
|
||||
revision = StringUtil.notBlank(revision) ? revision : "A";
|
||||
//物料描述
|
||||
String itemDescription = jsonObject.getString("MAKTX");
|
||||
//状态
|
||||
String status = jsonObject.getString("STATUS");
|
||||
String statusBo = HandleEnum.STATUS.getHandle(site, status);
|
||||
//物料类型(FERT(已完成)/ROH(原始)/HALB(半成品)/KMAT(可配置)/INST(安装)/VERP(包装)/FHMI(生产资源/工具)/CSTM(自定义))
|
||||
String itemType = jsonObject.getString("ITEM_TYPE");
|
||||
//采购类型(M(制造)/P(采购)/B(制造/采购))
|
||||
String procurementType = jsonObject.getString("PROCUREMENT_TYPE");
|
||||
//批次大小
|
||||
String lotSize = jsonObject.getString("LOT_SIZE");
|
||||
lotSize = StringUtil.notBlank(lotSize) ? lotSize : "999999";
|
||||
//装配时要收集的数据
|
||||
String assyDataType = jsonObject.getString(" ASSY_DATA_TYPE");
|
||||
//库存接收数据类型
|
||||
String invAssyDataType = jsonObject.getString("INV_ASSY_DATA_TYPE");
|
||||
//计量单位
|
||||
String unitOfMeasure = jsonObject.getString("UNIT_OF_MEASURE");
|
||||
|
||||
//物料标准API
|
||||
ItemConfigurationServiceInterface itemServiceInterFace = MEServices.create("com.sap.me.productdefinition", "ItemConfigurationService", site);
|
||||
|
||||
|
||||
//物料是否存在
|
||||
String itemBo = HandleEnum.ITEM.getHandle(site, item, revision);
|
||||
Item itemModel = itemService.getById(itemBo);
|
||||
if (itemModel == null){
|
||||
//创建物料
|
||||
ItemConfiguration itemConfiguration = new ItemConfiguration();
|
||||
itemConfiguration.setItem(item);
|
||||
itemConfiguration.setRevision(revision);
|
||||
itemConfiguration.setProcurementType(ProcurementType.fromValue(procurementType));
|
||||
itemConfiguration.setLotSize(new BigDecimal(lotSize));
|
||||
itemConfiguration.setRef(itemBo);
|
||||
itemConfiguration.setCurrentRevision(true);
|
||||
itemConfiguration.setUnitOfMeasurement(unitOfMeasure);
|
||||
itemConfiguration.setMaterialType(MaterialType.fromValue(itemType));
|
||||
|
||||
//物料描述赋值
|
||||
List<ItemTranslation> itemTranslationList = new ArrayList<>();
|
||||
ItemTranslation itemTranslation = new ItemTranslation();
|
||||
itemTranslation.setLocale("zh");
|
||||
itemTranslation.setDescription(itemDescription);
|
||||
itemTranslationList.add(itemTranslation);
|
||||
itemConfiguration.setItemTranslationList(itemTranslationList);
|
||||
itemConfiguration.setStatusRef(statusBo);
|
||||
|
||||
//数量限制为任意整数
|
||||
itemConfiguration.setQuantityRestriction(QuantityRestriction.ANY_NUMBER);
|
||||
|
||||
//创建物料
|
||||
itemServiceInterFace.createItem(itemConfiguration);
|
||||
} else {
|
||||
//更新物料
|
||||
ObjectReference itemReference = new ObjectReference();
|
||||
itemReference.setRef(itemBo);
|
||||
ItemFullConfiguration itemFullConfiguration = itemServiceInterFace.readItem(itemReference);
|
||||
|
||||
|
||||
//物料描述赋值
|
||||
ItemFullConfiguration updateItem = itemFullConfiguration;
|
||||
updateItem.setUnitOfMeasurement(unitOfMeasure);
|
||||
updateItem.setMaterialType(MaterialType.fromValue(itemType));
|
||||
updateItem.setProcurementType(ProcurementType.fromValue(procurementType));
|
||||
updateItem.setLotSize(new BigDecimal(lotSize));
|
||||
updateItem.setStatusRef(statusBo);
|
||||
|
||||
List<ItemTranslation> itemTranslationList = new ArrayList<>();
|
||||
ItemTranslation itemTranslation = new ItemTranslation();
|
||||
Locale locale = LocaleContextHolder.getLocale();
|
||||
itemTranslation.setLocale(locale.getLanguage());
|
||||
itemTranslation.setDescription(itemDescription);
|
||||
itemTranslationList.add(itemTranslation);
|
||||
updateItem.setItemTranslationList(itemTranslationList);
|
||||
|
||||
//更新物料
|
||||
itemServiceInterFace.updateItem(updateItem);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,466 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.foreverwin.mesnac.integration.mapper.IntegrationLogMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.foreverwin.mesnac.integration.model.IntegrationLog">
|
||||
<id column="HANDLE" property="handle" />
|
||||
<result column="SITE" property="site" />
|
||||
<result column="INTEGRATION_TYPE" property="integrationType" />
|
||||
<result column="CATEGORY" property="category" />
|
||||
<result column="INTEGRATION_WAY" property="integrationWay" />
|
||||
<result column="INTEGRATION_METHOD" property="integrationMethod" />
|
||||
<result column="HANDLE_OBJ" property="handleObj" />
|
||||
<result column="SFC_BO" property="sfcBo" />
|
||||
<result column="PARAM" property="param" />
|
||||
<result column="STATUS" property="status" />
|
||||
<result column="RESULT_MESSAGE" property="resultMessage" />
|
||||
<result column="TRANSACTION_ID" property="transactionId" />
|
||||
<result column="REQUEST_DATE_TIME" property="requestDateTime" />
|
||||
<result column="CREATED_DATE_TIME" property="createdDateTime" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
HANDLE, SITE, INTEGRATION_TYPE, CATEGORY, INTEGRATION_WAY, INTEGRATION_METHOD, HANDLE_OBJ, SFC_BO, PARAM, STATUS, RESULT_MESSAGE, TRANSACTION_ID, REQUEST_DATE_TIME, CREATED_DATE_TIME
|
||||
</sql>
|
||||
|
||||
<!-- BaseMapper标准查询/修改/删除 -->
|
||||
<select id="selectById" resultMap="BaseResultMap">
|
||||
SELECT <include refid="Base_Column_List"></include> FROM Z_INTEGRATION_LOG WHERE HANDLE=#{handle}
|
||||
</select>
|
||||
|
||||
<select id="selectByMap" resultMap="BaseResultMap">
|
||||
SELECT <include refid="Base_Column_List"></include>
|
||||
FROM Z_INTEGRATION_LOG
|
||||
<if test="cm!=null and !cm.isEmpty">
|
||||
<where>
|
||||
<foreach collection="cm.keys" item="k" separator="AND">
|
||||
<if test="cm[k] != null">
|
||||
${k} = #{cm[${k}]}
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectBatchIds" resultMap="BaseResultMap">
|
||||
SELECT <include refid="Base_Column_List"></include>
|
||||
FROM Z_INTEGRATION_LOG WHERE HANDLE IN (
|
||||
<foreach item="item" index="index" collection="coll" separator=",">#{item}
|
||||
</foreach>)
|
||||
</select>
|
||||
|
||||
<select id="selectOne" resultMap="BaseResultMap">
|
||||
SELECT <include refid="Base_Column_List"></include> FROM Z_INTEGRATION_LOG
|
||||
<where>
|
||||
<if test="ew.entity.handle!=null">
|
||||
HANDLE=#{ew.handle}
|
||||
</if>
|
||||
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
|
||||
<if test="ew.entity.integrationType!=null"> AND INTEGRATION_TYPE=#{ew.entity.integrationType}</if>
|
||||
<if test="ew.entity.category!=null"> AND CATEGORY=#{ew.entity.category}</if>
|
||||
<if test="ew.entity.integrationWay!=null"> AND INTEGRATION_WAY=#{ew.entity.integrationWay}</if>
|
||||
<if test="ew.entity.integrationMethod!=null"> AND INTEGRATION_METHOD=#{ew.entity.integrationMethod}</if>
|
||||
<if test="ew.entity.handleObj!=null"> AND HANDLE_OBJ=#{ew.entity.handleObj}</if>
|
||||
<if test="ew.entity.sfcBo!=null"> AND SFC_BO=#{ew.entity.sfcBo}</if>
|
||||
<if test="ew.entity.param!=null"> AND PARAM=#{ew.entity.param}</if>
|
||||
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
|
||||
<if test="ew.entity.resultMessage!=null"> AND RESULT_MESSAGE=#{ew.entity.resultMessage}</if>
|
||||
<if test="ew.entity.transactionId!=null"> AND TRANSACTION_ID=#{ew.entity.transactionId}</if>
|
||||
<if test="ew.entity.requestDateTime!=null"> AND REQUEST_DATE_TIME=#{ew.entity.requestDateTime}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectCount" resultType="Integer">
|
||||
SELECT COUNT(1) FROM Z_INTEGRATION_LOG
|
||||
<where>
|
||||
<if test="ew!=null">
|
||||
<if test="ew.entity!=null">
|
||||
<if test="ew.entity.handle!=null">
|
||||
HANDLE=#{ew.entity.handle}
|
||||
</if>
|
||||
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
|
||||
<if test="ew.entity.integrationType!=null"> AND INTEGRATION_TYPE=#{ew.entity.integrationType}</if>
|
||||
<if test="ew.entity.category!=null"> AND CATEGORY=#{ew.entity.category}</if>
|
||||
<if test="ew.entity.integrationWay!=null"> AND INTEGRATION_WAY=#{ew.entity.integrationWay}</if>
|
||||
<if test="ew.entity.integrationMethod!=null"> AND INTEGRATION_METHOD=#{ew.entity.integrationMethod}</if>
|
||||
<if test="ew.entity.handleObj!=null"> AND HANDLE_OBJ=#{ew.entity.handleObj}</if>
|
||||
<if test="ew.entity.sfcBo!=null"> AND SFC_BO=#{ew.entity.sfcBo}</if>
|
||||
<if test="ew.entity.param!=null"> AND PARAM=#{ew.entity.param}</if>
|
||||
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
|
||||
<if test="ew.entity.resultMessage!=null"> AND RESULT_MESSAGE=#{ew.entity.resultMessage}</if>
|
||||
<if test="ew.entity.transactionId!=null"> AND TRANSACTION_ID=#{ew.entity.transactionId}</if>
|
||||
<if test="ew.entity.requestDateTime!=null"> AND REQUEST_DATE_TIME=#{ew.entity.requestDateTime}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
</if>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectList" resultMap="BaseResultMap">
|
||||
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_INTEGRATION_LOG
|
||||
<where>
|
||||
<if test="ew!=null">
|
||||
<if test="ew.entity!=null">
|
||||
<if test="ew.entity.handle!=null">
|
||||
HANDLE=#{ew.entity.handle}
|
||||
</if>
|
||||
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
|
||||
<if test="ew.entity.integrationType!=null"> AND INTEGRATION_TYPE=#{ew.entity.integrationType}</if>
|
||||
<if test="ew.entity.category!=null"> AND CATEGORY=#{ew.entity.category}</if>
|
||||
<if test="ew.entity.integrationWay!=null"> AND INTEGRATION_WAY=#{ew.entity.integrationWay}</if>
|
||||
<if test="ew.entity.integrationMethod!=null"> AND INTEGRATION_METHOD=#{ew.entity.integrationMethod}</if>
|
||||
<if test="ew.entity.handleObj!=null"> AND HANDLE_OBJ=#{ew.entity.handleObj}</if>
|
||||
<if test="ew.entity.sfcBo!=null"> AND SFC_BO=#{ew.entity.sfcBo}</if>
|
||||
<if test="ew.entity.param!=null"> AND PARAM=#{ew.entity.param}</if>
|
||||
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
|
||||
<if test="ew.entity.resultMessage!=null"> AND RESULT_MESSAGE=#{ew.entity.resultMessage}</if>
|
||||
<if test="ew.entity.transactionId!=null"> AND TRANSACTION_ID=#{ew.entity.transactionId}</if>
|
||||
<if test="ew.entity.requestDateTime!=null"> AND REQUEST_DATE_TIME=#{ew.entity.requestDateTime}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
</if>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectMaps" resultType="HashMap">
|
||||
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_INTEGRATION_LOG
|
||||
<where>
|
||||
<if test="ew!=null">
|
||||
<if test="ew.entity!=null">
|
||||
<if test="ew.entity.handle!=null">
|
||||
HANDLE=#{ew.entity.handle}
|
||||
</if>
|
||||
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
|
||||
<if test="ew.entity.integrationType!=null"> AND INTEGRATION_TYPE=#{ew.entity.integrationType}</if>
|
||||
<if test="ew.entity.category!=null"> AND CATEGORY=#{ew.entity.category}</if>
|
||||
<if test="ew.entity.integrationWay!=null"> AND INTEGRATION_WAY=#{ew.entity.integrationWay}</if>
|
||||
<if test="ew.entity.integrationMethod!=null"> AND INTEGRATION_METHOD=#{ew.entity.integrationMethod}</if>
|
||||
<if test="ew.entity.handleObj!=null"> AND HANDLE_OBJ=#{ew.entity.handleObj}</if>
|
||||
<if test="ew.entity.sfcBo!=null"> AND SFC_BO=#{ew.entity.sfcBo}</if>
|
||||
<if test="ew.entity.param!=null"> AND PARAM=#{ew.entity.param}</if>
|
||||
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
|
||||
<if test="ew.entity.resultMessage!=null"> AND RESULT_MESSAGE=#{ew.entity.resultMessage}</if>
|
||||
<if test="ew.entity.transactionId!=null"> AND TRANSACTION_ID=#{ew.entity.transactionId}</if>
|
||||
<if test="ew.entity.requestDateTime!=null"> AND REQUEST_DATE_TIME=#{ew.entity.requestDateTime}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
</if>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectObjs" resultType="Object">
|
||||
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_INTEGRATION_LOG
|
||||
<where>
|
||||
<if test="ew!=null">
|
||||
<if test="ew.entity!=null">
|
||||
<if test="ew.entity.handle!=null">
|
||||
HANDLE=#{ew.entity.handle}
|
||||
</if>
|
||||
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
|
||||
<if test="ew.entity.integrationType!=null"> AND INTEGRATION_TYPE=#{ew.entity.integrationType}</if>
|
||||
<if test="ew.entity.category!=null"> AND CATEGORY=#{ew.entity.category}</if>
|
||||
<if test="ew.entity.integrationWay!=null"> AND INTEGRATION_WAY=#{ew.entity.integrationWay}</if>
|
||||
<if test="ew.entity.integrationMethod!=null"> AND INTEGRATION_METHOD=#{ew.entity.integrationMethod}</if>
|
||||
<if test="ew.entity.handleObj!=null"> AND HANDLE_OBJ=#{ew.entity.handleObj}</if>
|
||||
<if test="ew.entity.sfcBo!=null"> AND SFC_BO=#{ew.entity.sfcBo}</if>
|
||||
<if test="ew.entity.param!=null"> AND PARAM=#{ew.entity.param}</if>
|
||||
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
|
||||
<if test="ew.entity.resultMessage!=null"> AND RESULT_MESSAGE=#{ew.entity.resultMessage}</if>
|
||||
<if test="ew.entity.transactionId!=null"> AND TRANSACTION_ID=#{ew.entity.transactionId}</if>
|
||||
<if test="ew.entity.requestDateTime!=null"> AND REQUEST_DATE_TIME=#{ew.entity.requestDateTime}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
</if>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectPage" resultMap="BaseResultMap">
|
||||
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_INTEGRATION_LOG
|
||||
<where>
|
||||
<if test="ew!=null">
|
||||
<if test="ew.entity!=null">
|
||||
<if test="ew.entity.handle!=null">
|
||||
HANDLE=#{ew.entity.handle}
|
||||
</if>
|
||||
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
|
||||
<if test="ew.entity.integrationType!=null"> AND INTEGRATION_TYPE=#{ew.entity.integrationType}</if>
|
||||
<if test="ew.entity.category!=null"> AND CATEGORY=#{ew.entity.category}</if>
|
||||
<if test="ew.entity.integrationWay!=null"> AND INTEGRATION_WAY=#{ew.entity.integrationWay}</if>
|
||||
<if test="ew.entity.integrationMethod!=null"> AND INTEGRATION_METHOD=#{ew.entity.integrationMethod}</if>
|
||||
<if test="ew.entity.handleObj!=null"> AND HANDLE_OBJ=#{ew.entity.handleObj}</if>
|
||||
<if test="ew.entity.sfcBo!=null"> AND SFC_BO=#{ew.entity.sfcBo}</if>
|
||||
<if test="ew.entity.param!=null"> AND PARAM=#{ew.entity.param}</if>
|
||||
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
|
||||
<if test="ew.entity.resultMessage!=null"> AND RESULT_MESSAGE=#{ew.entity.resultMessage}</if>
|
||||
<if test="ew.entity.transactionId!=null"> AND TRANSACTION_ID=#{ew.entity.transactionId}</if>
|
||||
<if test="ew.entity.requestDateTime!=null"> AND REQUEST_DATE_TIME=#{ew.entity.requestDateTime}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
</if>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectMapsPage" resultType="HashMap">
|
||||
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_INTEGRATION_LOG
|
||||
<where>
|
||||
<if test="ew!=null">
|
||||
<if test="ew.entity!=null">
|
||||
<if test="ew.entity.handle!=null">
|
||||
HANDLE=#{ew.entity.handle}
|
||||
</if>
|
||||
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
|
||||
<if test="ew.entity.integrationType!=null"> AND INTEGRATION_TYPE=#{ew.entity.integrationType}</if>
|
||||
<if test="ew.entity.category!=null"> AND CATEGORY=#{ew.entity.category}</if>
|
||||
<if test="ew.entity.integrationWay!=null"> AND INTEGRATION_WAY=#{ew.entity.integrationWay}</if>
|
||||
<if test="ew.entity.integrationMethod!=null"> AND INTEGRATION_METHOD=#{ew.entity.integrationMethod}</if>
|
||||
<if test="ew.entity.handleObj!=null"> AND HANDLE_OBJ=#{ew.entity.handleObj}</if>
|
||||
<if test="ew.entity.sfcBo!=null"> AND SFC_BO=#{ew.entity.sfcBo}</if>
|
||||
<if test="ew.entity.param!=null"> AND PARAM=#{ew.entity.param}</if>
|
||||
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
|
||||
<if test="ew.entity.resultMessage!=null"> AND RESULT_MESSAGE=#{ew.entity.resultMessage}</if>
|
||||
<if test="ew.entity.transactionId!=null"> AND TRANSACTION_ID=#{ew.entity.transactionId}</if>
|
||||
<if test="ew.entity.requestDateTime!=null"> AND REQUEST_DATE_TIME=#{ew.entity.requestDateTime}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
</if>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<insert id="insert" parameterType="com.foreverwin.mesnac.integration.model.IntegrationLog">
|
||||
INSERT INTO Z_INTEGRATION_LOG
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
HANDLE,
|
||||
<if test="site!=null">SITE,</if>
|
||||
<if test="integrationType!=null">INTEGRATION_TYPE,</if>
|
||||
<if test="category!=null">CATEGORY,</if>
|
||||
<if test="integrationWay!=null">INTEGRATION_WAY,</if>
|
||||
<if test="integrationMethod!=null">INTEGRATION_METHOD,</if>
|
||||
<if test="handleObj!=null">HANDLE_OBJ,</if>
|
||||
<if test="sfcBo!=null">SFC_BO,</if>
|
||||
<if test="param!=null">PARAM,</if>
|
||||
<if test="status!=null">STATUS,</if>
|
||||
<if test="resultMessage!=null">RESULT_MESSAGE,</if>
|
||||
<if test="transactionId!=null">TRANSACTION_ID,</if>
|
||||
<if test="requestDateTime!=null">REQUEST_DATE_TIME,</if>
|
||||
<if test="createdDateTime!=null">CREATED_DATE_TIME,</if>
|
||||
</trim> VALUES
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
#{handle},
|
||||
<if test="site!=null">#{site},</if>
|
||||
<if test="integrationType!=null">#{integrationType},</if>
|
||||
<if test="category!=null">#{category},</if>
|
||||
<if test="integrationWay!=null">#{integrationWay},</if>
|
||||
<if test="integrationMethod!=null">#{integrationMethod},</if>
|
||||
<if test="handleObj!=null">#{handleObj},</if>
|
||||
<if test="sfcBo!=null">#{sfcBo},</if>
|
||||
<if test="param!=null">#{param},</if>
|
||||
<if test="status!=null">#{status},</if>
|
||||
<if test="resultMessage!=null">#{resultMessage},</if>
|
||||
<if test="transactionId!=null">#{transactionId},</if>
|
||||
<if test="requestDateTime!=null">#{requestDateTime},</if>
|
||||
<if test="createdDateTime!=null">#{createdDateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<insert id="insertAllColumn" parameterType="com.foreverwin.mesnac.integration.model.IntegrationLog">
|
||||
INSERT INTO Z_INTEGRATION_LOG
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<include refid="Base_Column_List"></include>
|
||||
</trim> VALUES
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
#{handle},
|
||||
#{site},
|
||||
#{integrationType},
|
||||
#{category},
|
||||
#{integrationWay},
|
||||
#{integrationMethod},
|
||||
#{handleObj},
|
||||
#{sfcBo},
|
||||
#{param},
|
||||
#{status},
|
||||
#{resultMessage},
|
||||
#{transactionId},
|
||||
#{requestDateTime},
|
||||
#{createdDateTime},
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
||||
<update id="updateById">
|
||||
UPDATE Z_INTEGRATION_LOG <trim prefix="SET" suffixOverrides=",">
|
||||
<if test="et.site!=null">SITE=#{et.site},</if>
|
||||
<if test="et.integrationType!=null">INTEGRATION_TYPE=#{et.integrationType},</if>
|
||||
<if test="et.category!=null">CATEGORY=#{et.category},</if>
|
||||
<if test="et.integrationWay!=null">INTEGRATION_WAY=#{et.integrationWay},</if>
|
||||
<if test="et.integrationMethod!=null">INTEGRATION_METHOD=#{et.integrationMethod},</if>
|
||||
<if test="et.handleObj!=null">HANDLE_OBJ=#{et.handleObj},</if>
|
||||
<if test="et.sfcBo!=null">SFC_BO=#{et.sfcBo},</if>
|
||||
<if test="et.param!=null">PARAM=#{et.param},</if>
|
||||
<if test="et.status!=null">STATUS=#{et.status},</if>
|
||||
<if test="et.resultMessage!=null">RESULT_MESSAGE=#{et.resultMessage},</if>
|
||||
<if test="et.transactionId!=null">TRANSACTION_ID=#{et.transactionId},</if>
|
||||
<if test="et.requestDateTime!=null">REQUEST_DATE_TIME=#{et.requestDateTime},</if>
|
||||
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
|
||||
</trim> WHERE HANDLE=#{et.handle} <if test="et instanceof java.util.Map"><if test="et.MP_OPTLOCK_VERSION_ORIGINAL!=null">and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL}</if></if>
|
||||
</update>
|
||||
|
||||
|
||||
<update id="updateAllColumnById">
|
||||
UPDATE Z_INTEGRATION_LOG <trim prefix="SET" suffixOverrides=",">
|
||||
SITE=#{et.site},
|
||||
INTEGRATION_TYPE=#{et.integrationType},
|
||||
CATEGORY=#{et.category},
|
||||
INTEGRATION_WAY=#{et.integrationWay},
|
||||
INTEGRATION_METHOD=#{et.integrationMethod},
|
||||
HANDLE_OBJ=#{et.handleObj},
|
||||
SFC_BO=#{et.sfcBo},
|
||||
PARAM=#{et.param},
|
||||
STATUS=#{et.status},
|
||||
RESULT_MESSAGE=#{et.resultMessage},
|
||||
TRANSACTION_ID=#{et.transactionId},
|
||||
REQUEST_DATE_TIME=#{et.requestDateTime},
|
||||
CREATED_DATE_TIME=#{et.createdDateTime},
|
||||
</trim> WHERE HANDLE=#{et.handle} <if test="et instanceof java.util.Map"><if test="et.MP_OPTLOCK_VERSION_ORIGINAL!=null">and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL}</if></if>
|
||||
</update>
|
||||
|
||||
|
||||
<update id="update">
|
||||
UPDATE Z_INTEGRATION_LOG <trim prefix="SET" suffixOverrides=",">
|
||||
<if test="et.site!=null">SITE=#{et.site},</if>
|
||||
<if test="et.integrationType!=null">INTEGRATION_TYPE=#{et.integrationType},</if>
|
||||
<if test="et.category!=null">CATEGORY=#{et.category},</if>
|
||||
<if test="et.integrationWay!=null">INTEGRATION_WAY=#{et.integrationWay},</if>
|
||||
<if test="et.integrationMethod!=null">INTEGRATION_METHOD=#{et.integrationMethod},</if>
|
||||
<if test="et.handleObj!=null">HANDLE_OBJ=#{et.handleObj},</if>
|
||||
<if test="et.sfcBo!=null">SFC_BO=#{et.sfcBo},</if>
|
||||
<if test="et.param!=null">PARAM=#{et.param},</if>
|
||||
<if test="et.status!=null">STATUS=#{et.status},</if>
|
||||
<if test="et.resultMessage!=null">RESULT_MESSAGE=#{et.resultMessage},</if>
|
||||
<if test="et.transactionId!=null">TRANSACTION_ID=#{et.transactionId},</if>
|
||||
<if test="et.requestDateTime!=null">REQUEST_DATE_TIME=#{et.requestDateTime},</if>
|
||||
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
|
||||
</trim>
|
||||
<where>
|
||||
<if test="ew!=null">
|
||||
<if test="ew.entity!=null">
|
||||
HANDLE=#{ew.entity.handle}
|
||||
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
|
||||
<if test="ew.entity.integrationType!=null"> AND INTEGRATION_TYPE=#{ew.entity.integrationType}</if>
|
||||
<if test="ew.entity.category!=null"> AND CATEGORY=#{ew.entity.category}</if>
|
||||
<if test="ew.entity.integrationWay!=null"> AND INTEGRATION_WAY=#{ew.entity.integrationWay}</if>
|
||||
<if test="ew.entity.integrationMethod!=null"> AND INTEGRATION_METHOD=#{ew.entity.integrationMethod}</if>
|
||||
<if test="ew.entity.handleObj!=null"> AND HANDLE_OBJ=#{ew.entity.handleObj}</if>
|
||||
<if test="ew.entity.sfcBo!=null"> AND SFC_BO=#{ew.entity.sfcBo}</if>
|
||||
<if test="ew.entity.param!=null"> AND PARAM=#{ew.entity.param}</if>
|
||||
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
|
||||
<if test="ew.entity.resultMessage!=null"> AND RESULT_MESSAGE=#{ew.entity.resultMessage}</if>
|
||||
<if test="ew.entity.transactionId!=null"> AND TRANSACTION_ID=#{ew.entity.transactionId}</if>
|
||||
<if test="ew.entity.requestDateTime!=null"> AND REQUEST_DATE_TIME=#{ew.entity.requestDateTime}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
</if>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</update>
|
||||
|
||||
<delete id="deleteById">
|
||||
DELETE FROM Z_INTEGRATION_LOG WHERE HANDLE=#{handle}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteByMap">
|
||||
DELETE FROM Z_INTEGRATION_LOG
|
||||
<if test="cm!=null and !cm.isEmpty">
|
||||
<where>
|
||||
<foreach collection="cm.keys" item="k" separator="AND">
|
||||
<if test="cm[k] != null">
|
||||
${k} = #{cm[${k}]}
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</if>
|
||||
</delete>
|
||||
|
||||
<delete id="delete">
|
||||
DELETE FROM Z_INTEGRATION_LOG
|
||||
<where>
|
||||
<if test="ew!=null">
|
||||
<if test="ew.entity!=null">
|
||||
<if test="ew.entity.handle!=null">
|
||||
HANDLE=#{ew.entity.handle}
|
||||
</if>
|
||||
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
|
||||
<if test="ew.entity.integrationType!=null"> AND INTEGRATION_TYPE=#{ew.entity.integrationType}</if>
|
||||
<if test="ew.entity.category!=null"> AND CATEGORY=#{ew.entity.category}</if>
|
||||
<if test="ew.entity.integrationWay!=null"> AND INTEGRATION_WAY=#{ew.entity.integrationWay}</if>
|
||||
<if test="ew.entity.integrationMethod!=null"> AND INTEGRATION_METHOD=#{ew.entity.integrationMethod}</if>
|
||||
<if test="ew.entity.handleObj!=null"> AND HANDLE_OBJ=#{ew.entity.handleObj}</if>
|
||||
<if test="ew.entity.sfcBo!=null"> AND SFC_BO=#{ew.entity.sfcBo}</if>
|
||||
<if test="ew.entity.param!=null"> AND PARAM=#{ew.entity.param}</if>
|
||||
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
|
||||
<if test="ew.entity.resultMessage!=null"> AND RESULT_MESSAGE=#{ew.entity.resultMessage}</if>
|
||||
<if test="ew.entity.transactionId!=null"> AND TRANSACTION_ID=#{ew.entity.transactionId}</if>
|
||||
<if test="ew.entity.requestDateTime!=null"> AND REQUEST_DATE_TIME=#{ew.entity.requestDateTime}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
</if>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBatchIds">
|
||||
DELETE FROM Z_INTEGRATION_LOG WHERE HANDLE IN (
|
||||
<foreach item="item" index="index" collection="coll" separator=",">#{item}
|
||||
</foreach>)
|
||||
</delete>
|
||||
<!-- BaseMapper标准查询/修改/删除 -->
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue