diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/dao/ITocofsReturngoodsDao.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/dao/ITocofsReturngoodsDao.java
index 6a9a65e4..6c5a321c 100644
--- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/dao/ITocofsReturngoodsDao.java
+++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/dao/ITocofsReturngoodsDao.java
@@ -9,14 +9,14 @@ import java.util.List;
  * OFS售后入库单(tocofs_returngoods: table)表数据库访问层
  *
  * @author makejava
- * @since 2024-08-09 11:08:40
+ * @since 2024-09-13 11:58:10
  */
 public interface ITocofsReturngoodsDao extends IBaseDao<TocofsReturngoodsEntity, String> {
 
     /**
-     * 批量插入
+     * 批量保存或者更新数据行底表
      *
      * @author liuyang
      */
-    void entityInsertBatchV2(List<TocofsReturngoodsEntity> tocofsReturngoodsEntityList) throws Exception;
+    void entityInsertOrUpdateBatch(List<TocofsReturngoodsEntity> tocofsReturngoodsEntityList) throws Exception;
 }
\ No newline at end of file
diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/dao/ITocofsReturngoodsDetailedDao.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/dao/ITocofsReturngoodsDetailedDao.java
index 9275a893..f28e0527 100644
--- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/dao/ITocofsReturngoodsDetailedDao.java
+++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/dao/ITocofsReturngoodsDetailedDao.java
@@ -2,7 +2,6 @@ package com.hzya.frame.plugin.lets.ofs.dao;
 
 import com.hzya.frame.plugin.lets.ofs.entity.TocofsReturngoodsDetailedEntity;
 import com.hzya.frame.basedao.dao.IBaseDao;
-import com.hzya.frame.plugin.lets.ofs.entity.TocofsReturngoodsEntity;
 
 import java.util.List;
 
@@ -10,13 +9,41 @@ import java.util.List;
  * root(tocofs_returngoods_detailed: table)表数据库访问层
  *
  * @author makejava
- * @since 2024-08-09 13:45:47
+ * @since 2024-09-13 11:58:26
  */
 public interface ITocofsReturngoodsDetailedDao extends IBaseDao<TocofsReturngoodsDetailedEntity, String> {
     /**
-     * 批量插入
+     * 批量插入或更新到底表
      *
      * @author liuyang
      */
-    void entityInsertBatchV2(List<TocofsReturngoodsDetailedEntity> tocofsReturngoodsEntityList) throws Exception;
+    void entityInsertOrUpdateBatch(List<TocofsReturngoodsDetailedEntity> tocofsReturngoodsDetailedEntityList) throws Exception;
+
+    /**
+     * 批量新增或者修改,TOC退货-库存
+     *
+     * @author liuyang
+     */
+    void entityInsertOrUpdateBatchByTocRerturnStock(List<TocofsReturngoodsDetailedEntity> tocofsReturngoodsDetailedEntityList) throws Exception;
+
+    /**
+     * 批量新增或者修改,TOC退货-确认收入
+     *
+     * @author liuyang
+     */
+    void entityInsertOrUpdateBatchByTocRerturnTran(List<TocofsReturngoodsDetailedEntity> tocofsReturngoodsDetailedEntityList) throws Exception;
+
+    /**
+     * 批量新增或者修改,TOB退货-库存
+     *
+     * @author liuyang
+     */
+    void entityInsertOrUpdateBatchByTobRerturnStock(List<TocofsReturngoodsDetailedEntity> tocofsReturngoodsDetailedEntityList) throws Exception;
+
+    /**
+     * 批量新增或者修改,TOB退货-确认收入
+     *
+     * @author liuyang
+     */
+    void entityInsertOrUpdateBatchByTobRerturnTran(List<TocofsReturngoodsDetailedEntity> tocofsReturngoodsDetailedEntityList) throws Exception;
 }
\ No newline at end of file
diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/dao/impl/TocofsReturngoodsDaoImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/dao/impl/TocofsReturngoodsDaoImpl.java
index c5829a8f..55ab8454 100644
--- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/dao/impl/TocofsReturngoodsDaoImpl.java
+++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/dao/impl/TocofsReturngoodsDaoImpl.java
@@ -11,12 +11,11 @@ import java.util.List;
  * OFS售后入库单(TocofsReturngoods)表数据库访问层
  *
  * @author makejava
- * @since 2024-08-09 11:08:40
+ * @since 2024-09-13 11:58:10
  */
 public class TocofsReturngoodsDaoImpl extends MybatisGenericDao<TocofsReturngoodsEntity, String> implements ITocofsReturngoodsDao {
-
     @Override
-    public void entityInsertBatchV2(List<TocofsReturngoodsEntity> tocofsReturngoodsEntityList) throws Exception {
-        this.insert("com.hzya.frame.plugin.lets.ofs.dao.impl.TocofsReturngoodsDaoImpl.entityInsertBatchV2", tocofsReturngoodsEntityList);
+    public void entityInsertOrUpdateBatch(List<TocofsReturngoodsEntity> tocofsReturngoodsEntityList) throws Exception {
+        insert("com.hzya.frame.plugin.lets.ofs.dao.impl.TocofsReturngoodsDaoImpl.entityInsertOrUpdateBatch", tocofsReturngoodsEntityList);
     }
-}
+}
\ No newline at end of file
diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/dao/impl/TocofsReturngoodsDetailedDaoImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/dao/impl/TocofsReturngoodsDetailedDaoImpl.java
index e87fd8d9..f1f49e16 100644
--- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/dao/impl/TocofsReturngoodsDetailedDaoImpl.java
+++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/dao/impl/TocofsReturngoodsDetailedDaoImpl.java
@@ -2,7 +2,6 @@ package com.hzya.frame.plugin.lets.ofs.dao.impl;
 
 import com.hzya.frame.plugin.lets.ofs.entity.TocofsReturngoodsDetailedEntity;
 import com.hzya.frame.plugin.lets.ofs.dao.ITocofsReturngoodsDetailedDao;
-import com.hzya.frame.plugin.lets.ofs.entity.TocofsReturngoodsEntity;
 import org.springframework.stereotype.Repository;
 import com.hzya.frame.basedao.dao.MybatisGenericDao;
 
@@ -12,11 +11,33 @@ import java.util.List;
  * root(TocofsReturngoodsDetailed)表数据库访问层
  *
  * @author makejava
- * @since 2024-08-09 13:45:47
+ * @since 2024-09-13 11:58:26
  */
 public class TocofsReturngoodsDetailedDaoImpl extends MybatisGenericDao<TocofsReturngoodsDetailedEntity, String> implements ITocofsReturngoodsDetailedDao {
+
     @Override
-    public void entityInsertBatchV2(List<TocofsReturngoodsDetailedEntity> tocofsReturngoodsDetailedEntityList) throws Exception {
-        this.insert("com.hzya.frame.plugin.lets.ofs.dao.impl.TocofsReturngoodsDetailedDaoImpl.entityInsertBatchV2", tocofsReturngoodsDetailedEntityList);
+    public void entityInsertOrUpdateBatch(List<TocofsReturngoodsDetailedEntity> tocofsReturngoodsDetailedEntityList) throws Exception {
+        insert("com.hzya.frame.plugin.lets.ofs.dao.impl.TocofsReturngoodsDetailedDaoImpl.entityInsertOrUpdateBatch", tocofsReturngoodsDetailedEntityList);
     }
-}
\ No newline at end of file
+    
+    @Override
+    public void entityInsertOrUpdateBatchByTocRerturnStock(List<TocofsReturngoodsDetailedEntity> tocofsReturngoodsDetailedEntityList) throws Exception {
+        insert("com.hzya.frame.plugin.lets.ofs.dao.impl.TocofsReturngoodsDetailedDaoImpl.entityInsertOrUpdateBatchByTocRerturnStock", tocofsReturngoodsDetailedEntityList);
+    }
+
+    @Override
+    public void entityInsertOrUpdateBatchByTocRerturnTran(List<TocofsReturngoodsDetailedEntity> tocofsReturngoodsDetailedEntityList) throws Exception {
+        insert("com.hzya.frame.plugin.lets.ofs.dao.impl.TocofsReturngoodsDetailedDaoImpl.entityInsertOrUpdateBatchByTocRerturnTran", tocofsReturngoodsDetailedEntityList);
+    }
+
+    @Override
+    public void entityInsertOrUpdateBatchByTobRerturnStock(List<TocofsReturngoodsDetailedEntity> tocofsReturngoodsDetailedEntityList) throws Exception {
+        insert("com.hzya.frame.plugin.lets.ofs.dao.impl.TocofsReturngoodsDetailedDaoImpl.entityInsertOrUpdateBatchByTobRerturnStock", tocofsReturngoodsDetailedEntityList);
+    }
+
+    @Override
+    public void entityInsertOrUpdateBatchByTobRerturnTran(List<TocofsReturngoodsDetailedEntity> tocofsReturngoodsDetailedEntityList) throws Exception {
+        insert("com.hzya.frame.plugin.lets.ofs.dao.impl.TocofsReturngoodsDetailedDaoImpl.entityInsertOrUpdateBatchByTobRerturnTran", tocofsReturngoodsDetailedEntityList);
+    }
+}
+
diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/entity/TocofsReturngoodsDetailedEntity.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/entity/TocofsReturngoodsDetailedEntity.java
index 3ca7cfa2..3e42b584 100644
--- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/entity/TocofsReturngoodsDetailedEntity.java
+++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/entity/TocofsReturngoodsDetailedEntity.java
@@ -1,6 +1,5 @@
 package com.hzya.frame.plugin.lets.ofs.entity;
 
-import com.hzya.frame.ttxofs.dto.returngoodsearch.ReturnGoodSearchHeaderDto;
 import com.hzya.frame.web.entity.BaseEntity;
 import lombok.Data;
 
@@ -8,98 +7,100 @@ import lombok.Data;
  * root(TocofsReturngoodsDetailed)实体类
  *
  * @author makejava
- * @since 2024-08-09 13:45:47
+ * @since 2024-09-13 11:58:26
  */
 @Data
 public class TocofsReturngoodsDetailedEntity extends BaseEntity {
+
     /**
      * 81159
      */
-    private String receiptId;
+    private String receiptid;
     /**
      * LETS-RE2024071600000001
      */
-    private String receiptCode;
+    private String receiptcode;
     /**
      * 128
      */
-    private String refOrderId;
+    private String reforderid;
     /**
      * 299
      */
-    private String refOrderDetailId;
+    private String reforderdetailid;
     /**
      * LETS-SO2024070500000001
      */
-    private String sourceOrderCode;
+    private String sourceordercode;
+    private String sourcelinenum;
     /**
      * LETS
      */
-    private String clientCode;
+    private String clientcode;
     /**
      * SHLZ
      */
-    private String companyCode;
+    private String companycode;
     /**
      * intoyou-tmxs
      */
-    private String facilityCode;
+    private String facilitycode;
     /**
      * 6973391730617
      */
-    private String skuCode;
+    private String skucode;
     /**
      * INTOYOU心慕与你水感裸雾唇釉W01
      */
-    private String skuName;
+    private String skuname;
     /**
      * 2
      */
-    private String requestQty;
+    private String requestqty;
     /**
      * 2
      */
-    private String receivedQty;
+    private String receivedqty;
     /**
      * 0
      */
-    private String openQty;
+    private String openqty;
     /**
      * EA
      */
-    private String quantityUM;
+    private String quantityum;
     /**
      * 0
      */
-    private String totalWeight;
+    private String totalweight;
     /**
      * 0
      */
-    private String totalVolume;
+    private String totalvolume;
     /**
      * 0
      */
-    private String totalVolumeWeight;
+    private String totalvolumeweight;
     /**
      * 118
      */
-    private String totalAmount;
+    private String totalamount;
     /**
      * G
      */
-    private String weightUM;
+    private String weightum;
     /**
      * CM3
      */
-    private String volumeUM;
+    private String volumeum;
     /**
      * AVAILABLE
      */
-    private String inventorySts;
+    private String inventorysts;
     /**
      * 30796
      */
-    private String inTransInvId;
+    private String intransinvid;
     /**
      * 0
      */
@@ -111,52 +112,278 @@ public class TocofsReturngoodsDetailedEntity extends BaseEntity {
     /**
      * admin
      */
-    private String createdBy;
+    private String createdby;
     /**
      * 2024-07-16 16:44:01
      */
-    private String lastUpdated;
+    private String lastupdated;
     /**
      * api
      */
-    private String lastUpdatedBy;
+    private String lastupdatedby;
     /**
      * 59
      */
-    private String discountPrice;
+    private String discountprice;
+    /**
+     * 主表主键
+     */
+    private String maintableid;
     /**
      * 报错内容
      */
-    private String newTransmitinfo;
+    private String newtransmitinfo;
     /**
      * 推送时间
      */
-    private String newPushdate;
+    private String newpushdate;
     /**
      * 是否成功
      */
-    private String newState;
+    private String newstate;
     /**
      * 下游系统编码
      */
-    private String newSystemNumber;
+    private String newsystemnumber;
     /**
      * 下游系统主键
      */
-    private String newSystemPrimary;
+    private String newsystemprimary;
     /**
-     * 主表主键
+     * 报错内容
      */
-    private String primaryKey;
+    private String newtransmitinfo2;
     /**
-     * 业务日期
+     * 推送时间
      */
-    private String businessDate;
+    private String newpushdate2;
+    /**
+     * 是否成功
+     */
+    private String newstate2;
+    /**
+     * 下游系统编码
+     */
+    private String newsystemnumber2;
+    /**
+     * 下游系统主键
+     */
+    private String newsystemprimary2;
+    /**
+     * 报错内容
+     */
+    private String newtransmitinfo3;
+    /**
+     * 推送时间
+     */
+    private String newpushdate3;
+    /**
+     * 是否成功
+     */
+    private String newstate3;
+    /**
+     * 下游系统编码
+     */
+    private String newsystemnumber3;
+    /**
+     * 下游系统主键
+     */
+    private String newsystemprimary3;
+    /**
+     * 报错内容
+     */
+    private String newtransmitinfo4;
+    /**
+     * 推送时间
+     */
+    private String newpushdate4;
+    /**
+     * 是否成功
+     */
+    private String newstate4;
+    /**
+     * 下游系统编码
+     */
+    private String newsystemnumber4;
+    /**
+     * 下游系统主键
+     */
+    private String newsystemprimary4;
+    /**
+     * 业务日期-入库时间
+     */
+    private String businessdate;
+    /**
+     * 业务日期-退款完成时间
+     */
+    private String refundedat;
+    /**
+     * 业务类型(TOC退货orTOB退货)
+     */
+    private String businesstype;
+    /**
+     * 自定义项
+     */
+    private String def1;
+    /**
+     * 自定义项
+     */
+    private String def2;
+    /**
+     * 自定义项
+     */
+    private String def3;
+    /**
+     * 自定义项
+     */
+    private String def4;
+    /**
+     * 自定义项
+     */
+    private String def5;
+    /**
+     * 自定义项
+     */
+    private String def6;
+    /**
+     * 自定义项
+     */
+    private String def7;
+    /**
+     * 自定义项
+     */
+    private String def8;
+    /**
+     * 自定义项
+     */
+    private String def9;
+    /**
+     * 自定义项
+     */
+    private String def10;
+    /**
+     * 自定义项
+     */
+    private String def11;
+    /**
+     * 自定义项
+     */
+    private String def12;
+    /**
+     * 自定义项
+     */
+    private String def13;
+    /**
+     * 自定义项
+     */
+    private String def14;
+    /**
+     * 自定义项
+     */
+    private String def15;
+    /**
+     * 自定义项
+     */
+    private String def16;
+    /**
+     * 自定义项
+     */
+    private String def17;
+    /**
+     * 自定义项
+     */
+    private String def18;
+    /**
+     * 自定义项
+     */
+    private String def19;
+    /**
+     * 自定义项
+     */
+    private String def20;
+    /**
+     * 自定义项
+     */
+    private String def21;
+    /**
+     * 自定义项
+     */
+    private String def22;
+    /**
+     * 自定义项
+     */
+    private String def23;
+    /**
+     * 自定义项
+     */
+    private String def24;
+    /**
+     * 自定义项
+     */
+    private String def25;
+    /**
+     * 自定义项
+     */
+    private String def26;
+    /**
+     * 自定义项
+     */
+    private String def27;
+    /**
+     * 自定义项
+     */
+    private String def28;
+    /**
+     * 自定义项
+     */
+    private String def29;
+    /**
+     * 自定义项
+     */
+    private String def30;
+    /**
+     * 自定义项
+     */
+    private String def31;
+    /**
+     * 自定义项
+     */
+    private String def32;
+    /**
+     * 自定义项
+     */
+    private String def33;
+    /**
+     * 自定义项
+     */
+    private String def34;
+    /**
+     * 自定义项
+     */
+    private String def35;
+    /**
+     * 自定义项
+     */
+    private String def36;
+    /**
+     * 自定义项
+     */
+    private String def37;
+    /**
+     * 自定义项
+     */
+    private String def38;
+    /**
+     * 自定义项
+     */
+    private String def39;
+    /**
+     * 自定义项
+     */
+    private String def40;
+    /**
+     * 补充的查询条件
+     */
+    private String ids;
+}
 
-    /**
-     * 主表主键
-     */
-//    private String returngoodsId;
-
-    private String businessType;
-}
\ No newline at end of file
diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/entity/TocofsReturngoodsDetailedEntity.xml b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/entity/TocofsReturngoodsDetailedEntity.xml
index dfd0b4cd..b0cb98c8 100644
--- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/entity/TocofsReturngoodsDetailedEntity.xml
+++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/entity/TocofsReturngoodsDetailedEntity.xml
@@ -4,83 +4,196 @@
 
     <resultMap id="get-TocofsReturngoodsDetailedEntity-result" type="com.hzya.frame.plugin.lets.ofs.entity.TocofsReturngoodsDetailedEntity" >
        <result property="id" column="id" jdbcType="VARCHAR"/>
-           <result property="receiptId" column="receipt_id" jdbcType="VARCHAR"/>
-           <result property="receiptCode" column="receipt_code" jdbcType="VARCHAR"/>
-           <result property="refOrderId" column="ref_order_id" jdbcType="VARCHAR"/>
-           <result property="refOrderDetailId" column="ref_order_detail_id" jdbcType="VARCHAR"/>
-           <result property="sourceOrderCode" column="source_order_code" jdbcType="VARCHAR"/>
-           <result property="clientCode" column="client_code" jdbcType="VARCHAR"/>
-           <result property="companyCode" column="company_code" jdbcType="VARCHAR"/>
-           <result property="facilityCode" column="facility_code" jdbcType="VARCHAR"/>
-           <result property="skuCode" column="sku_code" jdbcType="VARCHAR"/>
-           <result property="skuName" column="sku_name" jdbcType="VARCHAR"/>
-           <result property="requestQty" column="request_qty" jdbcType="VARCHAR"/>
-           <result property="receivedQty" column="received_qty" jdbcType="VARCHAR"/>
-           <result property="openQty" column="open_qty" jdbcType="VARCHAR"/>
-           <result property="quantityUM" column="quantity_u_m" jdbcType="VARCHAR"/>
-           <result property="totalWeight" column="total_weight" jdbcType="VARCHAR"/>
-           <result property="totalVolume" column="total_volume" jdbcType="VARCHAR"/>
-           <result property="totalVolumeWeight" column="total_volume_weight" jdbcType="VARCHAR"/>
-           <result property="totalAmount" column="total_amount" jdbcType="VARCHAR"/>
-           <result property="weightUM" column="weight_u_m" jdbcType="VARCHAR"/>
-           <result property="volumeUM" column="volume_u_m" jdbcType="VARCHAR"/>
-           <result property="inventorySts" column="inventory_sts" jdbcType="VARCHAR"/>
-           <result property="inTransInvId" column="in_trans_inv_id" jdbcType="VARCHAR"/>
+           <result property="receiptid" column="receiptId" jdbcType="VARCHAR"/>
+           <result property="receiptcode" column="receiptCode" jdbcType="VARCHAR"/>
+           <result property="reforderid" column="refOrderId" jdbcType="VARCHAR"/>
+           <result property="reforderdetailid" column="refOrderDetailId" jdbcType="VARCHAR"/>
+           <result property="sourceordercode" column="sourceOrderCode" jdbcType="VARCHAR"/>
+           <result property="sourcelinenum" column="sourceLineNum" jdbcType="VARCHAR"/>
+           <result property="clientcode" column="clientCode" jdbcType="VARCHAR"/>
+           <result property="companycode" column="companyCode" jdbcType="VARCHAR"/>
+           <result property="facilitycode" column="facilityCode" jdbcType="VARCHAR"/>
+           <result property="skucode" column="skuCode" jdbcType="VARCHAR"/>
+           <result property="skuname" column="skuName" jdbcType="VARCHAR"/>
+           <result property="requestqty" column="requestQty" jdbcType="VARCHAR"/>
+           <result property="receivedqty" column="receivedQty" jdbcType="VARCHAR"/>
+           <result property="openqty" column="openQty" jdbcType="VARCHAR"/>
+           <result property="quantityum" column="quantityUM" jdbcType="VARCHAR"/>
+           <result property="totalweight" column="totalWeight" jdbcType="VARCHAR"/>
+           <result property="totalvolume" column="totalVolume" jdbcType="VARCHAR"/>
+           <result property="totalvolumeweight" column="totalVolumeWeight" jdbcType="VARCHAR"/>
+           <result property="totalamount" column="totalAmount" jdbcType="VARCHAR"/>
+           <result property="weightum" column="weightUM" jdbcType="VARCHAR"/>
+           <result property="volumeum" column="volumeUM" jdbcType="VARCHAR"/>
+           <result property="inventorysts" column="inventorySts" jdbcType="VARCHAR"/>
+           <result property="intransinvid" column="inTransInvId" jdbcType="VARCHAR"/>
            <result property="closed" column="closed" jdbcType="VARCHAR"/>
            <result property="created" column="created" jdbcType="VARCHAR"/>
-           <result property="createdBy" column="created_by" jdbcType="VARCHAR"/>
-           <result property="lastUpdated" column="last_updated" jdbcType="VARCHAR"/>
-           <result property="lastUpdatedBy" column="last_updated_by" jdbcType="VARCHAR"/>
-           <result property="discountPrice" column="discount_price" jdbcType="VARCHAR"/>
-           <result property="newTransmitinfo" column="new_transmitInfo" jdbcType="VARCHAR"/>
-           <result property="newPushdate" column="new_pushDate" jdbcType="VARCHAR"/>
-           <result property="newState" column="new_state" jdbcType="VARCHAR"/>
-           <result property="newSystemNumber" column="new_system_number" jdbcType="VARCHAR"/>
-           <result property="newSystemPrimary" column="new_system_primary" jdbcType="VARCHAR"/>
-           <result property="primaryKey" column="primary_key" jdbcType="VARCHAR"/>
-           <result property="businessDate" column="business_date" jdbcType="VARCHAR"/>
-           <result property="businessType" column="business_type" jdbcType="VARCHAR"/>
+           <result property="createdby" column="createdBy" jdbcType="VARCHAR"/>
+           <result property="lastupdated" column="lastUpdated" jdbcType="VARCHAR"/>
+           <result property="lastupdatedby" column="lastUpdatedBy" jdbcType="VARCHAR"/>
+           <result property="discountprice" column="discountPrice" jdbcType="VARCHAR"/>
+           <result property="maintableid" column="mainTableId" jdbcType="VARCHAR"/>
+           <result property="newtransmitinfo" column="newTransmitInfo" jdbcType="VARCHAR"/>
+           <result property="newpushdate" column="newPushDate" jdbcType="VARCHAR"/>
+           <result property="newstate" column="newState" jdbcType="VARCHAR"/>
+           <result property="newsystemnumber" column="newSystemNumber" jdbcType="VARCHAR"/>
+           <result property="newsystemprimary" column="newSystemPrimary" jdbcType="VARCHAR"/>
+           <result property="newtransmitinfo2" column="newTransmitInfo2" jdbcType="VARCHAR"/>
+           <result property="newpushdate2" column="newPushDate2" jdbcType="VARCHAR"/>
+           <result property="newstate2" column="newState2" jdbcType="VARCHAR"/>
+           <result property="newsystemnumber2" column="newSystemNumber2" jdbcType="VARCHAR"/>
+           <result property="newsystemprimary2" column="newSystemPrimary2" jdbcType="VARCHAR"/>
+           <result property="newtransmitinfo3" column="newTransmitInfo3" jdbcType="VARCHAR"/>
+           <result property="newpushdate3" column="newPushDate3" jdbcType="VARCHAR"/>
+           <result property="newstate3" column="newState3" jdbcType="VARCHAR"/>
+           <result property="newsystemnumber3" column="newSystemNumber3" jdbcType="VARCHAR"/>
+           <result property="newsystemprimary3" column="newSystemPrimary3" jdbcType="VARCHAR"/>
+           <result property="newtransmitinfo4" column="newTransmitInfo4" jdbcType="VARCHAR"/>
+           <result property="newpushdate4" column="newPushDate4" jdbcType="VARCHAR"/>
+           <result property="newstate4" column="newState4" jdbcType="VARCHAR"/>
+           <result property="newsystemnumber4" column="newSystemNumber4" jdbcType="VARCHAR"/>
+           <result property="newsystemprimary4" column="newSystemPrimary4" jdbcType="VARCHAR"/>
+           <result property="businessdate" column="businessDate" jdbcType="VARCHAR"/>
+           <result property="refundedat" column="refundedAt" jdbcType="VARCHAR"/>
+           <result property="businesstype" column="businessType" jdbcType="VARCHAR"/>
+           <result property="def1" column="def1" jdbcType="VARCHAR"/>
+           <result property="def2" column="def2" jdbcType="VARCHAR"/>
+           <result property="def3" column="def3" jdbcType="VARCHAR"/>
+           <result property="def4" column="def4" jdbcType="VARCHAR"/>
+           <result property="def5" column="def5" jdbcType="VARCHAR"/>
+           <result property="def6" column="def6" jdbcType="VARCHAR"/>
+           <result property="def7" column="def7" jdbcType="VARCHAR"/>
+           <result property="def8" column="def8" jdbcType="VARCHAR"/>
+           <result property="def9" column="def9" jdbcType="VARCHAR"/>
+           <result property="def10" column="def10" jdbcType="VARCHAR"/>
+           <result property="def11" column="def11" jdbcType="VARCHAR"/>
+           <result property="def12" column="def12" jdbcType="VARCHAR"/>
+           <result property="def13" column="def13" jdbcType="VARCHAR"/>
+           <result property="def14" column="def14" jdbcType="VARCHAR"/>
+           <result property="def15" column="def15" jdbcType="VARCHAR"/>
+           <result property="def16" column="def16" jdbcType="VARCHAR"/>
+           <result property="def17" column="def17" jdbcType="VARCHAR"/>
+           <result property="def18" column="def18" jdbcType="VARCHAR"/>
+           <result property="def19" column="def19" jdbcType="VARCHAR"/>
+           <result property="def20" column="def20" jdbcType="VARCHAR"/>
+           <result property="def21" column="def21" jdbcType="VARCHAR"/>
+           <result property="def22" column="def22" jdbcType="VARCHAR"/>
+           <result property="def23" column="def23" jdbcType="VARCHAR"/>
+           <result property="def24" column="def24" jdbcType="VARCHAR"/>
+           <result property="def25" column="def25" jdbcType="VARCHAR"/>
+           <result property="def26" column="def26" jdbcType="VARCHAR"/>
+           <result property="def27" column="def27" jdbcType="VARCHAR"/>
+           <result property="def28" column="def28" jdbcType="VARCHAR"/>
+           <result property="def29" column="def29" jdbcType="VARCHAR"/>
+           <result property="def30" column="def30" jdbcType="VARCHAR"/>
+           <result property="def31" column="def31" jdbcType="VARCHAR"/>
+           <result property="def32" column="def32" jdbcType="VARCHAR"/>
+           <result property="def33" column="def33" jdbcType="VARCHAR"/>
+           <result property="def34" column="def34" jdbcType="VARCHAR"/>
+           <result property="def35" column="def35" jdbcType="VARCHAR"/>
+           <result property="def36" column="def36" jdbcType="VARCHAR"/>
+           <result property="def37" column="def37" jdbcType="VARCHAR"/>
+           <result property="def38" column="def38" jdbcType="VARCHAR"/>
+           <result property="def39" column="def39" jdbcType="VARCHAR"/>
+           <result property="def40" column="def40" jdbcType="VARCHAR"/>
         </resultMap>
-
     <!-- 查询的字段-->
     <sql id = "TocofsReturngoodsDetailedEntity_Base_Column_List">
         id
-       ,receipt_id 
-        ,receipt_code 
-        ,ref_order_id 
-        ,ref_order_detail_id 
-        ,source_order_code 
-        ,client_code 
-        ,company_code 
-        ,facility_code 
-        ,sku_code 
-        ,sku_name 
-        ,request_qty 
-        ,received_qty 
-        ,open_qty 
-        ,quantity_u_m 
-        ,total_weight 
-        ,total_volume 
-        ,total_volume_weight 
-        ,total_amount 
-        ,weight_u_m 
-        ,volume_u_m 
-        ,inventory_sts 
-        ,in_trans_inv_id 
+       ,receiptId 
+        ,receiptCode 
+        ,refOrderId 
+        ,refOrderDetailId 
+        ,sourceOrderCode 
+        ,sourceLineNum 
+        ,clientCode 
+        ,companyCode 
+        ,facilityCode 
+        ,skuCode 
+        ,skuName 
+        ,requestQty 
+        ,receivedQty 
+        ,openQty 
+        ,quantityUM 
+        ,totalWeight 
+        ,totalVolume 
+        ,totalVolumeWeight 
+        ,totalAmount 
+        ,weightUM 
+        ,volumeUM 
+        ,inventorySts 
+        ,inTransInvId 
         ,closed 
         ,created 
-        ,created_by 
-        ,last_updated 
-        ,last_updated_by 
-        ,discount_price 
-        ,new_transmitInfo 
-        ,new_pushDate 
-        ,new_state 
-        ,new_system_number 
-        ,new_system_primary 
-        ,primary_key 
-        ,business_date
-        ,business_type
+        ,createdBy 
+        ,lastUpdated 
+        ,lastUpdatedBy 
+        ,discountPrice 
+        ,mainTableId 
+        ,newTransmitInfo 
+        ,newPushDate 
+        ,newState 
+        ,newSystemNumber 
+        ,newSystemPrimary 
+        ,newTransmitInfo2 
+        ,newPushDate2 
+        ,newState2 
+        ,newSystemNumber2 
+        ,newSystemPrimary2 
+        ,newTransmitInfo3 
+        ,newPushDate3 
+        ,newState3 
+        ,newSystemNumber3 
+        ,newSystemPrimary3 
+        ,newTransmitInfo4 
+        ,newPushDate4 
+        ,newState4 
+        ,newSystemNumber4 
+        ,newSystemPrimary4 
+        ,businessDate 
+        ,refundedAt 
+        ,businessType 
+        ,def1 
+        ,def2 
+        ,def3 
+        ,def4 
+        ,def5 
+        ,def6 
+        ,def7 
+        ,def8 
+        ,def9 
+        ,def10 
+        ,def11 
+        ,def12 
+        ,def13 
+        ,def14 
+        ,def15 
+        ,def16 
+        ,def17 
+        ,def18 
+        ,def19 
+        ,def20 
+        ,def21 
+        ,def22 
+        ,def23 
+        ,def24 
+        ,def25 
+        ,def26 
+        ,def27 
+        ,def28 
+        ,def29 
+        ,def30 
+        ,def31 
+        ,def32 
+        ,def33 
+        ,def34 
+        ,def35 
+        ,def36 
+        ,def37 
+        ,def38 
+        ,def39 
+        ,def40 
      </sql>
 
  <!-- 查询 采用==查询 -->
@@ -90,46 +203,106 @@
     from tocofs_returngoods_detailed
     <trim prefix="where" prefixOverrides="and"> 
         <if test="id != null and id != ''"> and id = #{id} </if>
-            <if test="receiptId != null and receiptId != ''"> and receipt_id = #{receiptId} </if>
-            <if test="receiptCode != null and receiptCode != ''"> and receipt_code = #{receiptCode} </if>
-            <if test="refOrderId != null and refOrderId != ''"> and ref_order_id = #{refOrderId} </if>
-            <if test="refOrderDetailId != null and refOrderDetailId != ''"> and ref_order_detail_id = #{refOrderDetailId} </if>
-            <if test="sourceOrderCode != null and sourceOrderCode != ''"> and source_order_code = #{sourceOrderCode} </if>
-            <if test="clientCode != null and clientCode != ''"> and client_code = #{clientCode} </if>
-            <if test="companyCode != null and companyCode != ''"> and company_code = #{companyCode} </if>
-            <if test="facilityCode != null and facilityCode != ''"> and facility_code = #{facilityCode} </if>
-            <if test="skuCode != null and skuCode != ''"> and sku_code = #{skuCode} </if>
-            <if test="skuName != null and skuName != ''"> and sku_name = #{skuName} </if>
-            <if test="requestQty != null and requestQty != ''"> and request_qty = #{requestQty} </if>
-            <if test="receivedQty != null and receivedQty != ''"> and received_qty = #{receivedQty} </if>
-            <if test="openQty != null and openQty != ''"> and open_qty = #{openQty} </if>
-            <if test="quantityUM != null and quantityUM != ''"> and quantity_u_m = #{quantityUM} </if>
-            <if test="totalWeight != null and totalWeight != ''"> and total_weight = #{totalWeight} </if>
-            <if test="totalVolume != null and totalVolume != ''"> and total_volume = #{totalVolume} </if>
-            <if test="totalVolumeWeight != null and totalVolumeWeight != ''"> and total_volume_weight = #{totalVolumeWeight} </if>
-            <if test="totalAmount != null and totalAmount != ''"> and total_amount = #{totalAmount} </if>
-            <if test="weightUM != null and weightUM != ''"> and weight_u_m = #{weightUM} </if>
-            <if test="volumeUM != null and volumeUM != ''"> and volume_u_m = #{volumeUM} </if>
-            <if test="inventorySts != null and inventorySts != ''"> and inventory_sts = #{inventorySts} </if>
-            <if test="inTransInvId != null and inTransInvId != ''"> and in_trans_inv_id = #{inTransInvId} </if>
+            <if test="receiptid != null and receiptid != ''"> and receiptId = #{receiptid} </if>
+            <if test="receiptcode != null and receiptcode != ''"> and receiptCode = #{receiptcode} </if>
+            <if test="reforderid != null and reforderid != ''"> and refOrderId = #{reforderid} </if>
+            <if test="reforderdetailid != null and reforderdetailid != ''"> and refOrderDetailId = #{reforderdetailid} </if>
+            <if test="sourceordercode != null and sourceordercode != ''"> and sourceOrderCode = #{sourceordercode} </if>
+            <if test="sourcelinenum != null and sourcelinenum != ''"> and sourceLineNum = #{sourcelinenum} </if>
+            <if test="clientcode != null and clientcode != ''"> and clientCode = #{clientcode} </if>
+            <if test="companycode != null and companycode != ''"> and companyCode = #{companycode} </if>
+            <if test="facilitycode != null and facilitycode != ''"> and facilityCode = #{facilitycode} </if>
+            <if test="skucode != null and skucode != ''"> and skuCode = #{skucode} </if>
+            <if test="skuname != null and skuname != ''"> and skuName = #{skuname} </if>
+            <if test="requestqty != null and requestqty != ''"> and requestQty = #{requestqty} </if>
+            <if test="receivedqty != null and receivedqty != ''"> and receivedQty = #{receivedqty} </if>
+            <if test="openqty != null and openqty != ''"> and openQty = #{openqty} </if>
+            <if test="quantityum != null and quantityum != ''"> and quantityUM = #{quantityum} </if>
+            <if test="totalweight != null and totalweight != ''"> and totalWeight = #{totalweight} </if>
+            <if test="totalvolume != null and totalvolume != ''"> and totalVolume = #{totalvolume} </if>
+            <if test="totalvolumeweight != null and totalvolumeweight != ''"> and totalVolumeWeight = #{totalvolumeweight} </if>
+            <if test="totalamount != null and totalamount != ''"> and totalAmount = #{totalamount} </if>
+            <if test="weightum != null and weightum != ''"> and weightUM = #{weightum} </if>
+            <if test="volumeum != null and volumeum != ''"> and volumeUM = #{volumeum} </if>
+            <if test="inventorysts != null and inventorysts != ''"> and inventorySts = #{inventorysts} </if>
+            <if test="intransinvid != null and intransinvid != ''"> and inTransInvId = #{intransinvid} </if>
             <if test="closed != null and closed != ''"> and closed = #{closed} </if>
             <if test="created != null and created != ''"> and created = #{created} </if>
-            <if test="createdBy != null and createdBy != ''"> and created_by = #{createdBy} </if>
-            <if test="lastUpdated != null and lastUpdated != ''"> and last_updated = #{lastUpdated} </if>
-            <if test="lastUpdatedBy != null and lastUpdatedBy != ''"> and last_updated_by = #{lastUpdatedBy} </if>
-            <if test="discountPrice != null and discountPrice != ''"> and discount_price = #{discountPrice} </if>
-            <if test="newTransmitinfo != null and newTransmitinfo != ''"> and new_transmitInfo = #{newTransmitinfo} </if>
-            <if test="newPushdate != null and newPushdate != ''"> and new_pushDate = #{newPushdate} </if>
-            <if test="newState != null and newState != ''"> and new_state = #{newState} </if>
-            <if test="newSystemNumber != null and newSystemNumber != ''"> and new_system_number = #{newSystemNumber} </if>
-            <if test="newSystemPrimary != null and newSystemPrimary != ''"> and new_system_primary = #{newSystemPrimary} </if>
-            <if test="primaryKey != null and primaryKey != ''"> and primary_key = #{primaryKey} </if>
-            <if test="businessDate != null and businessDate != ''"> and business_date = #{businessDate} </if>
-            <if test="businessType != null and businessType != ''"> and business_type = #{businessType} </if>
-            and sts='Y'
+            <if test="createdby != null and createdby != ''"> and createdBy = #{createdby} </if>
+            <if test="lastupdated != null and lastupdated != ''"> and lastUpdated = #{lastupdated} </if>
+            <if test="lastupdatedby != null and lastupdatedby != ''"> and lastUpdatedBy = #{lastupdatedby} </if>
+            <if test="discountprice != null and discountprice != ''"> and discountPrice = #{discountprice} </if>
+            <if test="maintableid != null and maintableid != ''"> and mainTableId = #{maintableid} </if>
+            <if test="newtransmitinfo != null and newtransmitinfo != ''"> and newTransmitInfo = #{newtransmitinfo} </if>
+            <if test="newpushdate != null and newpushdate != ''"> and newPushDate = #{newpushdate} </if>
+            <if test="newstate != null and newstate != ''"> and newState = #{newstate} </if>
+            <if test="newsystemnumber != null and newsystemnumber != ''"> and newSystemNumber = #{newsystemnumber} </if>
+            <if test="newsystemprimary != null and newsystemprimary != ''"> and newSystemPrimary = #{newsystemprimary} </if>
+            <if test="newtransmitinfo2 != null and newtransmitinfo2 != ''"> and newTransmitInfo2 = #{newtransmitinfo2} </if>
+            <if test="newpushdate2 != null and newpushdate2 != ''"> and newPushDate2 = #{newpushdate2} </if>
+            <if test="newstate2 != null and newstate2 != ''"> and newState2 = #{newstate2} </if>
+            <if test="newsystemnumber2 != null and newsystemnumber2 != ''"> and newSystemNumber2 = #{newsystemnumber2} </if>
+            <if test="newsystemprimary2 != null and newsystemprimary2 != ''"> and newSystemPrimary2 = #{newsystemprimary2} </if>
+            <if test="newtransmitinfo3 != null and newtransmitinfo3 != ''"> and newTransmitInfo3 = #{newtransmitinfo3} </if>
+            <if test="newpushdate3 != null and newpushdate3 != ''"> and newPushDate3 = #{newpushdate3} </if>
+            <if test="newstate3 != null and newstate3 != ''"> and newState3 = #{newstate3} </if>
+            <if test="newsystemnumber3 != null and newsystemnumber3 != ''"> and newSystemNumber3 = #{newsystemnumber3} </if>
+            <if test="newsystemprimary3 != null and newsystemprimary3 != ''"> and newSystemPrimary3 = #{newsystemprimary3} </if>
+            <if test="newtransmitinfo4 != null and newtransmitinfo4 != ''"> and newTransmitInfo4 = #{newtransmitinfo4} </if>
+            <if test="newpushdate4 != null and newpushdate4 != ''"> and newPushDate4 = #{newpushdate4} </if>
+            <if test="newstate4 != null and newstate4 != ''"> and newState4 = #{newstate4} </if>
+            <if test="newsystemnumber4 != null and newsystemnumber4 != ''"> and newSystemNumber4 = #{newsystemnumber4} </if>
+            <if test="newsystemprimary4 != null and newsystemprimary4 != ''"> and newSystemPrimary4 = #{newsystemprimary4} </if>
+            <if test="businessdate != null and businessdate != ''"> and businessDate = #{businessdate} </if>
+            <if test="refundedat != null and refundedat != ''"> and refundedAt = #{refundedat} </if>
+            <if test="businesstype != null and businesstype != ''"> and businessType = #{businesstype} </if>
+            <if test="def1 != null and def1 != ''"> and def1 = #{def1} </if>
+            <if test="def2 != null and def2 != ''"> and def2 = #{def2} </if>
+            <if test="def3 != null and def3 != ''"> and def3 = #{def3} </if>
+            <if test="def4 != null and def4 != ''"> and def4 = #{def4} </if>
+            <if test="def5 != null and def5 != ''"> and def5 = #{def5} </if>
+            <if test="def6 != null and def6 != ''"> and def6 = #{def6} </if>
+            <if test="def7 != null and def7 != ''"> and def7 = #{def7} </if>
+            <if test="def8 != null and def8 != ''"> and def8 = #{def8} </if>
+            <if test="def9 != null and def9 != ''"> and def9 = #{def9} </if>
+            <if test="def10 != null and def10 != ''"> and def10 = #{def10} </if>
+            <if test="def11 != null and def11 != ''"> and def11 = #{def11} </if>
+            <if test="def12 != null and def12 != ''"> and def12 = #{def12} </if>
+            <if test="def13 != null and def13 != ''"> and def13 = #{def13} </if>
+            <if test="def14 != null and def14 != ''"> and def14 = #{def14} </if>
+            <if test="def15 != null and def15 != ''"> and def15 = #{def15} </if>
+            <if test="def16 != null and def16 != ''"> and def16 = #{def16} </if>
+            <if test="def17 != null and def17 != ''"> and def17 = #{def17} </if>
+            <if test="def18 != null and def18 != ''"> and def18 = #{def18} </if>
+            <if test="def19 != null and def19 != ''"> and def19 = #{def19} </if>
+            <if test="def20 != null and def20 != ''"> and def20 = #{def20} </if>
+            <if test="def21 != null and def21 != ''"> and def21 = #{def21} </if>
+            <if test="def22 != null and def22 != ''"> and def22 = #{def22} </if>
+            <if test="def23 != null and def23 != ''"> and def23 = #{def23} </if>
+            <if test="def24 != null and def24 != ''"> and def24 = #{def24} </if>
+            <if test="def25 != null and def25 != ''"> and def25 = #{def25} </if>
+            <if test="def26 != null and def26 != ''"> and def26 = #{def26} </if>
+            <if test="def27 != null and def27 != ''"> and def27 = #{def27} </if>
+            <if test="def28 != null and def28 != ''"> and def28 = #{def28} </if>
+            <if test="def29 != null and def29 != ''"> and def29 = #{def29} </if>
+            <if test="def30 != null and def30 != ''"> and def30 = #{def30} </if>
+            <if test="def31 != null and def31 != ''"> and def31 = #{def31} </if>
+            <if test="def32 != null and def32 != ''"> and def32 = #{def32} </if>
+            <if test="def33 != null and def33 != ''"> and def33 = #{def33} </if>
+            <if test="def34 != null and def34 != ''"> and def34 = #{def34} </if>
+            <if test="def35 != null and def35 != ''"> and def35 = #{def35} </if>
+            <if test="def36 != null and def36 != ''"> and def36 = #{def36} </if>
+            <if test="def37 != null and def37 != ''"> and def37 = #{def37} </if>
+            <if test="def38 != null and def38 != ''"> and def38 = #{def38} </if>
+            <if test="def39 != null and def39 != ''"> and def39 = #{def39} </if>
+            <if test="def40 != null and def40 != ''"> and def40 = #{def40} </if>
+            <if test="ids!=null and ids!=''">
+                and id in (${ids})
+            </if>
+--             and sts='Y'
     </trim>
-    <if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
-    <if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
+<!--    <if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>-->
+<!--    <if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>-->
 </select>
     
 <!-- 查询符合条件的数量 -->
@@ -137,42 +310,99 @@
         select  count(1)   from tocofs_returngoods_detailed
     <trim prefix="where" prefixOverrides="and"> 
         <if test="id != null and id != ''"> and id = #{id} </if>
-            <if test="receiptId != null and receiptId != ''"> and receipt_id = #{receiptId} </if>
-            <if test="receiptCode != null and receiptCode != ''"> and receipt_code = #{receiptCode} </if>
-            <if test="refOrderId != null and refOrderId != ''"> and ref_order_id = #{refOrderId} </if>
-            <if test="refOrderDetailId != null and refOrderDetailId != ''"> and ref_order_detail_id = #{refOrderDetailId} </if>
-            <if test="sourceOrderCode != null and sourceOrderCode != ''"> and source_order_code = #{sourceOrderCode} </if>
-            <if test="clientCode != null and clientCode != ''"> and client_code = #{clientCode} </if>
-            <if test="companyCode != null and companyCode != ''"> and company_code = #{companyCode} </if>
-            <if test="facilityCode != null and facilityCode != ''"> and facility_code = #{facilityCode} </if>
-            <if test="skuCode != null and skuCode != ''"> and sku_code = #{skuCode} </if>
-            <if test="skuName != null and skuName != ''"> and sku_name = #{skuName} </if>
-            <if test="requestQty != null and requestQty != ''"> and request_qty = #{requestQty} </if>
-            <if test="receivedQty != null and receivedQty != ''"> and received_qty = #{receivedQty} </if>
-            <if test="openQty != null and openQty != ''"> and open_qty = #{openQty} </if>
-            <if test="quantityUM != null and quantityUM != ''"> and quantity_u_m = #{quantityUM} </if>
-            <if test="totalWeight != null and totalWeight != ''"> and total_weight = #{totalWeight} </if>
-            <if test="totalVolume != null and totalVolume != ''"> and total_volume = #{totalVolume} </if>
-            <if test="totalVolumeWeight != null and totalVolumeWeight != ''"> and total_volume_weight = #{totalVolumeWeight} </if>
-            <if test="totalAmount != null and totalAmount != ''"> and total_amount = #{totalAmount} </if>
-            <if test="weightUM != null and weightUM != ''"> and weight_u_m = #{weightUM} </if>
-            <if test="volumeUM != null and volumeUM != ''"> and volume_u_m = #{volumeUM} </if>
-            <if test="inventorySts != null and inventorySts != ''"> and inventory_sts = #{inventorySts} </if>
-            <if test="inTransInvId != null and inTransInvId != ''"> and in_trans_inv_id = #{inTransInvId} </if>
+            <if test="receiptid != null and receiptid != ''"> and receiptId = #{receiptid} </if>
+            <if test="receiptcode != null and receiptcode != ''"> and receiptCode = #{receiptcode} </if>
+            <if test="reforderid != null and reforderid != ''"> and refOrderId = #{reforderid} </if>
+            <if test="reforderdetailid != null and reforderdetailid != ''"> and refOrderDetailId = #{reforderdetailid} </if>
+            <if test="sourceordercode != null and sourceordercode != ''"> and sourceOrderCode = #{sourceordercode} </if>
+            <if test="sourcelinenum != null and sourcelinenum != ''"> and sourceLineNum = #{sourcelinenum} </if>
+            <if test="clientcode != null and clientcode != ''"> and clientCode = #{clientcode} </if>
+            <if test="companycode != null and companycode != ''"> and companyCode = #{companycode} </if>
+            <if test="facilitycode != null and facilitycode != ''"> and facilityCode = #{facilitycode} </if>
+            <if test="skucode != null and skucode != ''"> and skuCode = #{skucode} </if>
+            <if test="skuname != null and skuname != ''"> and skuName = #{skuname} </if>
+            <if test="requestqty != null and requestqty != ''"> and requestQty = #{requestqty} </if>
+            <if test="receivedqty != null and receivedqty != ''"> and receivedQty = #{receivedqty} </if>
+            <if test="openqty != null and openqty != ''"> and openQty = #{openqty} </if>
+            <if test="quantityum != null and quantityum != ''"> and quantityUM = #{quantityum} </if>
+            <if test="totalweight != null and totalweight != ''"> and totalWeight = #{totalweight} </if>
+            <if test="totalvolume != null and totalvolume != ''"> and totalVolume = #{totalvolume} </if>
+            <if test="totalvolumeweight != null and totalvolumeweight != ''"> and totalVolumeWeight = #{totalvolumeweight} </if>
+            <if test="totalamount != null and totalamount != ''"> and totalAmount = #{totalamount} </if>
+            <if test="weightum != null and weightum != ''"> and weightUM = #{weightum} </if>
+            <if test="volumeum != null and volumeum != ''"> and volumeUM = #{volumeum} </if>
+            <if test="inventorysts != null and inventorysts != ''"> and inventorySts = #{inventorysts} </if>
+            <if test="intransinvid != null and intransinvid != ''"> and inTransInvId = #{intransinvid} </if>
             <if test="closed != null and closed != ''"> and closed = #{closed} </if>
             <if test="created != null and created != ''"> and created = #{created} </if>
-            <if test="createdBy != null and createdBy != ''"> and created_by = #{createdBy} </if>
-            <if test="lastUpdated != null and lastUpdated != ''"> and last_updated = #{lastUpdated} </if>
-            <if test="lastUpdatedBy != null and lastUpdatedBy != ''"> and last_updated_by = #{lastUpdatedBy} </if>
-            <if test="discountPrice != null and discountPrice != ''"> and discount_price = #{discountPrice} </if>
-            <if test="newTransmitinfo != null and newTransmitinfo != ''"> and new_transmitInfo = #{newTransmitinfo} </if>
-            <if test="newPushdate != null and newPushdate != ''"> and new_pushDate = #{newPushdate} </if>
-            <if test="newState != null and newState != ''"> and new_state = #{newState} </if>
-            <if test="newSystemNumber != null and newSystemNumber != ''"> and new_system_number = #{newSystemNumber} </if>
-            <if test="newSystemPrimary != null and newSystemPrimary != ''"> and new_system_primary = #{newSystemPrimary} </if>
-            <if test="primaryKey != null and primaryKey != ''"> and primary_key = #{primaryKey} </if>
-            <if test="businessDate != null and businessDate != ''"> and business_date = #{businessDate} </if>
-            <if test="businessType != null and businessType != ''"> and business_type = #{businessType} </if>
+            <if test="createdby != null and createdby != ''"> and createdBy = #{createdby} </if>
+            <if test="lastupdated != null and lastupdated != ''"> and lastUpdated = #{lastupdated} </if>
+            <if test="lastupdatedby != null and lastupdatedby != ''"> and lastUpdatedBy = #{lastupdatedby} </if>
+            <if test="discountprice != null and discountprice != ''"> and discountPrice = #{discountprice} </if>
+            <if test="maintableid != null and maintableid != ''"> and mainTableId = #{maintableid} </if>
+            <if test="newtransmitinfo != null and newtransmitinfo != ''"> and newTransmitInfo = #{newtransmitinfo} </if>
+            <if test="newpushdate != null and newpushdate != ''"> and newPushDate = #{newpushdate} </if>
+            <if test="newstate != null and newstate != ''"> and newState = #{newstate} </if>
+            <if test="newsystemnumber != null and newsystemnumber != ''"> and newSystemNumber = #{newsystemnumber} </if>
+            <if test="newsystemprimary != null and newsystemprimary != ''"> and newSystemPrimary = #{newsystemprimary} </if>
+            <if test="newtransmitinfo2 != null and newtransmitinfo2 != ''"> and newTransmitInfo2 = #{newtransmitinfo2} </if>
+            <if test="newpushdate2 != null and newpushdate2 != ''"> and newPushDate2 = #{newpushdate2} </if>
+            <if test="newstate2 != null and newstate2 != ''"> and newState2 = #{newstate2} </if>
+            <if test="newsystemnumber2 != null and newsystemnumber2 != ''"> and newSystemNumber2 = #{newsystemnumber2} </if>
+            <if test="newsystemprimary2 != null and newsystemprimary2 != ''"> and newSystemPrimary2 = #{newsystemprimary2} </if>
+            <if test="newtransmitinfo3 != null and newtransmitinfo3 != ''"> and newTransmitInfo3 = #{newtransmitinfo3} </if>
+            <if test="newpushdate3 != null and newpushdate3 != ''"> and newPushDate3 = #{newpushdate3} </if>
+            <if test="newstate3 != null and newstate3 != ''"> and newState3 = #{newstate3} </if>
+            <if test="newsystemnumber3 != null and newsystemnumber3 != ''"> and newSystemNumber3 = #{newsystemnumber3} </if>
+            <if test="newsystemprimary3 != null and newsystemprimary3 != ''"> and newSystemPrimary3 = #{newsystemprimary3} </if>
+            <if test="newtransmitinfo4 != null and newtransmitinfo4 != ''"> and newTransmitInfo4 = #{newtransmitinfo4} </if>
+            <if test="newpushdate4 != null and newpushdate4 != ''"> and newPushDate4 = #{newpushdate4} </if>
+            <if test="newstate4 != null and newstate4 != ''"> and newState4 = #{newstate4} </if>
+            <if test="newsystemnumber4 != null and newsystemnumber4 != ''"> and newSystemNumber4 = #{newsystemnumber4} </if>
+            <if test="newsystemprimary4 != null and newsystemprimary4 != ''"> and newSystemPrimary4 = #{newsystemprimary4} </if>
+            <if test="businessdate != null and businessdate != ''"> and businessDate = #{businessdate} </if>
+            <if test="refundedat != null and refundedat != ''"> and refundedAt = #{refundedat} </if>
+            <if test="businesstype != null and businesstype != ''"> and businessType = #{businesstype} </if>
+            <if test="def1 != null and def1 != ''"> and def1 = #{def1} </if>
+            <if test="def2 != null and def2 != ''"> and def2 = #{def2} </if>
+            <if test="def3 != null and def3 != ''"> and def3 = #{def3} </if>
+            <if test="def4 != null and def4 != ''"> and def4 = #{def4} </if>
+            <if test="def5 != null and def5 != ''"> and def5 = #{def5} </if>
+            <if test="def6 != null and def6 != ''"> and def6 = #{def6} </if>
+            <if test="def7 != null and def7 != ''"> and def7 = #{def7} </if>
+            <if test="def8 != null and def8 != ''"> and def8 = #{def8} </if>
+            <if test="def9 != null and def9 != ''"> and def9 = #{def9} </if>
+            <if test="def10 != null and def10 != ''"> and def10 = #{def10} </if>
+            <if test="def11 != null and def11 != ''"> and def11 = #{def11} </if>
+            <if test="def12 != null and def12 != ''"> and def12 = #{def12} </if>
+            <if test="def13 != null and def13 != ''"> and def13 = #{def13} </if>
+            <if test="def14 != null and def14 != ''"> and def14 = #{def14} </if>
+            <if test="def15 != null and def15 != ''"> and def15 = #{def15} </if>
+            <if test="def16 != null and def16 != ''"> and def16 = #{def16} </if>
+            <if test="def17 != null and def17 != ''"> and def17 = #{def17} </if>
+            <if test="def18 != null and def18 != ''"> and def18 = #{def18} </if>
+            <if test="def19 != null and def19 != ''"> and def19 = #{def19} </if>
+            <if test="def20 != null and def20 != ''"> and def20 = #{def20} </if>
+            <if test="def21 != null and def21 != ''"> and def21 = #{def21} </if>
+            <if test="def22 != null and def22 != ''"> and def22 = #{def22} </if>
+            <if test="def23 != null and def23 != ''"> and def23 = #{def23} </if>
+            <if test="def24 != null and def24 != ''"> and def24 = #{def24} </if>
+            <if test="def25 != null and def25 != ''"> and def25 = #{def25} </if>
+            <if test="def26 != null and def26 != ''"> and def26 = #{def26} </if>
+            <if test="def27 != null and def27 != ''"> and def27 = #{def27} </if>
+            <if test="def28 != null and def28 != ''"> and def28 = #{def28} </if>
+            <if test="def29 != null and def29 != ''"> and def29 = #{def29} </if>
+            <if test="def30 != null and def30 != ''"> and def30 = #{def30} </if>
+            <if test="def31 != null and def31 != ''"> and def31 = #{def31} </if>
+            <if test="def32 != null and def32 != ''"> and def32 = #{def32} </if>
+            <if test="def33 != null and def33 != ''"> and def33 = #{def33} </if>
+            <if test="def34 != null and def34 != ''"> and def34 = #{def34} </if>
+            <if test="def35 != null and def35 != ''"> and def35 = #{def35} </if>
+            <if test="def36 != null and def36 != ''"> and def36 = #{def36} </if>
+            <if test="def37 != null and def37 != ''"> and def37 = #{def37} </if>
+            <if test="def38 != null and def38 != ''"> and def38 = #{def38} </if>
+            <if test="def39 != null and def39 != ''"> and def39 = #{def39} </if>
+            <if test="def40 != null and def40 != ''"> and def40 = #{def40} </if>
             and sts='Y'
     </trim>
     <if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
@@ -186,42 +416,99 @@
     from tocofs_returngoods_detailed
     <trim prefix="where" prefixOverrides="and"> 
         <if test="id != null and id != ''"> and id like concat('%',#{id},'%') </if>
-            <if test="receiptId != null and receiptId != ''"> and receipt_id like concat('%',#{receiptId},'%') </if>
-            <if test="receiptCode != null and receiptCode != ''"> and receipt_code like concat('%',#{receiptCode},'%') </if>
-            <if test="refOrderId != null and refOrderId != ''"> and ref_order_id like concat('%',#{refOrderId},'%') </if>
-            <if test="refOrderDetailId != null and refOrderDetailId != ''"> and ref_order_detail_id like concat('%',#{refOrderDetailId},'%') </if>
-            <if test="sourceOrderCode != null and sourceOrderCode != ''"> and source_order_code like concat('%',#{sourceOrderCode},'%') </if>
-            <if test="clientCode != null and clientCode != ''"> and client_code like concat('%',#{clientCode},'%') </if>
-            <if test="companyCode != null and companyCode != ''"> and company_code like concat('%',#{companyCode},'%') </if>
-            <if test="facilityCode != null and facilityCode != ''"> and facility_code like concat('%',#{facilityCode},'%') </if>
-            <if test="skuCode != null and skuCode != ''"> and sku_code like concat('%',#{skuCode},'%') </if>
-            <if test="skuName != null and skuName != ''"> and sku_name like concat('%',#{skuName},'%') </if>
-            <if test="requestQty != null and requestQty != ''"> and request_qty like concat('%',#{requestQty},'%') </if>
-            <if test="receivedQty != null and receivedQty != ''"> and received_qty like concat('%',#{receivedQty},'%') </if>
-            <if test="openQty != null and openQty != ''"> and open_qty like concat('%',#{openQty},'%') </if>
-            <if test="quantityUM != null and quantityUM != ''"> and quantity_u_m like concat('%',#{quantityUM},'%') </if>
-            <if test="totalWeight != null and totalWeight != ''"> and total_weight like concat('%',#{totalWeight},'%') </if>
-            <if test="totalVolume != null and totalVolume != ''"> and total_volume like concat('%',#{totalVolume},'%') </if>
-            <if test="totalVolumeWeight != null and totalVolumeWeight != ''"> and total_volume_weight like concat('%',#{totalVolumeWeight},'%') </if>
-            <if test="totalAmount != null and totalAmount != ''"> and total_amount like concat('%',#{totalAmount},'%') </if>
-            <if test="weightUM != null and weightUM != ''"> and weight_u_m like concat('%',#{weightUM},'%') </if>
-            <if test="volumeUM != null and volumeUM != ''"> and volume_u_m like concat('%',#{volumeUM},'%') </if>
-            <if test="inventorySts != null and inventorySts != ''"> and inventory_sts like concat('%',#{inventorySts},'%') </if>
-            <if test="inTransInvId != null and inTransInvId != ''"> and in_trans_inv_id like concat('%',#{inTransInvId},'%') </if>
+            <if test="receiptid != null and receiptid != ''"> and receiptId like concat('%',#{receiptid},'%') </if>
+            <if test="receiptcode != null and receiptcode != ''"> and receiptCode like concat('%',#{receiptcode},'%') </if>
+            <if test="reforderid != null and reforderid != ''"> and refOrderId like concat('%',#{reforderid},'%') </if>
+            <if test="reforderdetailid != null and reforderdetailid != ''"> and refOrderDetailId like concat('%',#{reforderdetailid},'%') </if>
+            <if test="sourceordercode != null and sourceordercode != ''"> and sourceOrderCode like concat('%',#{sourceordercode},'%') </if>
+            <if test="sourcelinenum != null and sourcelinenum != ''"> and sourceLineNum like concat('%',#{sourcelinenum},'%') </if>
+            <if test="clientcode != null and clientcode != ''"> and clientCode like concat('%',#{clientcode},'%') </if>
+            <if test="companycode != null and companycode != ''"> and companyCode like concat('%',#{companycode},'%') </if>
+            <if test="facilitycode != null and facilitycode != ''"> and facilityCode like concat('%',#{facilitycode},'%') </if>
+            <if test="skucode != null and skucode != ''"> and skuCode like concat('%',#{skucode},'%') </if>
+            <if test="skuname != null and skuname != ''"> and skuName like concat('%',#{skuname},'%') </if>
+            <if test="requestqty != null and requestqty != ''"> and requestQty like concat('%',#{requestqty},'%') </if>
+            <if test="receivedqty != null and receivedqty != ''"> and receivedQty like concat('%',#{receivedqty},'%') </if>
+            <if test="openqty != null and openqty != ''"> and openQty like concat('%',#{openqty},'%') </if>
+            <if test="quantityum != null and quantityum != ''"> and quantityUM like concat('%',#{quantityum},'%') </if>
+            <if test="totalweight != null and totalweight != ''"> and totalWeight like concat('%',#{totalweight},'%') </if>
+            <if test="totalvolume != null and totalvolume != ''"> and totalVolume like concat('%',#{totalvolume},'%') </if>
+            <if test="totalvolumeweight != null and totalvolumeweight != ''"> and totalVolumeWeight like concat('%',#{totalvolumeweight},'%') </if>
+            <if test="totalamount != null and totalamount != ''"> and totalAmount like concat('%',#{totalamount},'%') </if>
+            <if test="weightum != null and weightum != ''"> and weightUM like concat('%',#{weightum},'%') </if>
+            <if test="volumeum != null and volumeum != ''"> and volumeUM like concat('%',#{volumeum},'%') </if>
+            <if test="inventorysts != null and inventorysts != ''"> and inventorySts like concat('%',#{inventorysts},'%') </if>
+            <if test="intransinvid != null and intransinvid != ''"> and inTransInvId like concat('%',#{intransinvid},'%') </if>
             <if test="closed != null and closed != ''"> and closed like concat('%',#{closed},'%') </if>
             <if test="created != null and created != ''"> and created like concat('%',#{created},'%') </if>
-            <if test="createdBy != null and createdBy != ''"> and created_by like concat('%',#{createdBy},'%') </if>
-            <if test="lastUpdated != null and lastUpdated != ''"> and last_updated like concat('%',#{lastUpdated},'%') </if>
-            <if test="lastUpdatedBy != null and lastUpdatedBy != ''"> and last_updated_by like concat('%',#{lastUpdatedBy},'%') </if>
-            <if test="discountPrice != null and discountPrice != ''"> and discount_price like concat('%',#{discountPrice},'%') </if>
-            <if test="newTransmitinfo != null and newTransmitinfo != ''"> and new_transmitInfo like concat('%',#{newTransmitinfo},'%') </if>
-            <if test="newPushdate != null and newPushdate != ''"> and new_pushDate like concat('%',#{newPushdate},'%') </if>
-            <if test="newState != null and newState != ''"> and new_state like concat('%',#{newState},'%') </if>
-            <if test="newSystemNumber != null and newSystemNumber != ''"> and new_system_number like concat('%',#{newSystemNumber},'%') </if>
-            <if test="newSystemPrimary != null and newSystemPrimary != ''"> and new_system_primary like concat('%',#{newSystemPrimary},'%') </if>
-            <if test="primaryKey != null and primaryKey != ''"> and primary_key like concat('%',#{primaryKey},'%') </if>
-            <if test="businessDate != null and businessDate != ''"> and business_date like concat('%',#{businessDate},'%') </if>
-            <if test="businessType != null and businessType != ''"> and business_type like concat('%',#{businessType},'%') </if>
+            <if test="createdby != null and createdby != ''"> and createdBy like concat('%',#{createdby},'%') </if>
+            <if test="lastupdated != null and lastupdated != ''"> and lastUpdated like concat('%',#{lastupdated},'%') </if>
+            <if test="lastupdatedby != null and lastupdatedby != ''"> and lastUpdatedBy like concat('%',#{lastupdatedby},'%') </if>
+            <if test="discountprice != null and discountprice != ''"> and discountPrice like concat('%',#{discountprice},'%') </if>
+            <if test="maintableid != null and maintableid != ''"> and mainTableId like concat('%',#{maintableid},'%') </if>
+            <if test="newtransmitinfo != null and newtransmitinfo != ''"> and newTransmitInfo like concat('%',#{newtransmitinfo},'%') </if>
+            <if test="newpushdate != null and newpushdate != ''"> and newPushDate like concat('%',#{newpushdate},'%') </if>
+            <if test="newstate != null and newstate != ''"> and newState like concat('%',#{newstate},'%') </if>
+            <if test="newsystemnumber != null and newsystemnumber != ''"> and newSystemNumber like concat('%',#{newsystemnumber},'%') </if>
+            <if test="newsystemprimary != null and newsystemprimary != ''"> and newSystemPrimary like concat('%',#{newsystemprimary},'%') </if>
+            <if test="newtransmitinfo2 != null and newtransmitinfo2 != ''"> and newTransmitInfo2 like concat('%',#{newtransmitinfo2},'%') </if>
+            <if test="newpushdate2 != null and newpushdate2 != ''"> and newPushDate2 like concat('%',#{newpushdate2},'%') </if>
+            <if test="newstate2 != null and newstate2 != ''"> and newState2 like concat('%',#{newstate2},'%') </if>
+            <if test="newsystemnumber2 != null and newsystemnumber2 != ''"> and newSystemNumber2 like concat('%',#{newsystemnumber2},'%') </if>
+            <if test="newsystemprimary2 != null and newsystemprimary2 != ''"> and newSystemPrimary2 like concat('%',#{newsystemprimary2},'%') </if>
+            <if test="newtransmitinfo3 != null and newtransmitinfo3 != ''"> and newTransmitInfo3 like concat('%',#{newtransmitinfo3},'%') </if>
+            <if test="newpushdate3 != null and newpushdate3 != ''"> and newPushDate3 like concat('%',#{newpushdate3},'%') </if>
+            <if test="newstate3 != null and newstate3 != ''"> and newState3 like concat('%',#{newstate3},'%') </if>
+            <if test="newsystemnumber3 != null and newsystemnumber3 != ''"> and newSystemNumber3 like concat('%',#{newsystemnumber3},'%') </if>
+            <if test="newsystemprimary3 != null and newsystemprimary3 != ''"> and newSystemPrimary3 like concat('%',#{newsystemprimary3},'%') </if>
+            <if test="newtransmitinfo4 != null and newtransmitinfo4 != ''"> and newTransmitInfo4 like concat('%',#{newtransmitinfo4},'%') </if>
+            <if test="newpushdate4 != null and newpushdate4 != ''"> and newPushDate4 like concat('%',#{newpushdate4},'%') </if>
+            <if test="newstate4 != null and newstate4 != ''"> and newState4 like concat('%',#{newstate4},'%') </if>
+            <if test="newsystemnumber4 != null and newsystemnumber4 != ''"> and newSystemNumber4 like concat('%',#{newsystemnumber4},'%') </if>
+            <if test="newsystemprimary4 != null and newsystemprimary4 != ''"> and newSystemPrimary4 like concat('%',#{newsystemprimary4},'%') </if>
+            <if test="businessdate != null and businessdate != ''"> and businessDate like concat('%',#{businessdate},'%') </if>
+            <if test="refundedat != null and refundedat != ''"> and refundedAt like concat('%',#{refundedat},'%') </if>
+            <if test="businesstype != null and businesstype != ''"> and businessType like concat('%',#{businesstype},'%') </if>
+            <if test="def1 != null and def1 != ''"> and def1 like concat('%',#{def1},'%') </if>
+            <if test="def2 != null and def2 != ''"> and def2 like concat('%',#{def2},'%') </if>
+            <if test="def3 != null and def3 != ''"> and def3 like concat('%',#{def3},'%') </if>
+            <if test="def4 != null and def4 != ''"> and def4 like concat('%',#{def4},'%') </if>
+            <if test="def5 != null and def5 != ''"> and def5 like concat('%',#{def5},'%') </if>
+            <if test="def6 != null and def6 != ''"> and def6 like concat('%',#{def6},'%') </if>
+            <if test="def7 != null and def7 != ''"> and def7 like concat('%',#{def7},'%') </if>
+            <if test="def8 != null and def8 != ''"> and def8 like concat('%',#{def8},'%') </if>
+            <if test="def9 != null and def9 != ''"> and def9 like concat('%',#{def9},'%') </if>
+            <if test="def10 != null and def10 != ''"> and def10 like concat('%',#{def10},'%') </if>
+            <if test="def11 != null and def11 != ''"> and def11 like concat('%',#{def11},'%') </if>
+            <if test="def12 != null and def12 != ''"> and def12 like concat('%',#{def12},'%') </if>
+            <if test="def13 != null and def13 != ''"> and def13 like concat('%',#{def13},'%') </if>
+            <if test="def14 != null and def14 != ''"> and def14 like concat('%',#{def14},'%') </if>
+            <if test="def15 != null and def15 != ''"> and def15 like concat('%',#{def15},'%') </if>
+            <if test="def16 != null and def16 != ''"> and def16 like concat('%',#{def16},'%') </if>
+            <if test="def17 != null and def17 != ''"> and def17 like concat('%',#{def17},'%') </if>
+            <if test="def18 != null and def18 != ''"> and def18 like concat('%',#{def18},'%') </if>
+            <if test="def19 != null and def19 != ''"> and def19 like concat('%',#{def19},'%') </if>
+            <if test="def20 != null and def20 != ''"> and def20 like concat('%',#{def20},'%') </if>
+            <if test="def21 != null and def21 != ''"> and def21 like concat('%',#{def21},'%') </if>
+            <if test="def22 != null and def22 != ''"> and def22 like concat('%',#{def22},'%') </if>
+            <if test="def23 != null and def23 != ''"> and def23 like concat('%',#{def23},'%') </if>
+            <if test="def24 != null and def24 != ''"> and def24 like concat('%',#{def24},'%') </if>
+            <if test="def25 != null and def25 != ''"> and def25 like concat('%',#{def25},'%') </if>
+            <if test="def26 != null and def26 != ''"> and def26 like concat('%',#{def26},'%') </if>
+            <if test="def27 != null and def27 != ''"> and def27 like concat('%',#{def27},'%') </if>
+            <if test="def28 != null and def28 != ''"> and def28 like concat('%',#{def28},'%') </if>
+            <if test="def29 != null and def29 != ''"> and def29 like concat('%',#{def29},'%') </if>
+            <if test="def30 != null and def30 != ''"> and def30 like concat('%',#{def30},'%') </if>
+            <if test="def31 != null and def31 != ''"> and def31 like concat('%',#{def31},'%') </if>
+            <if test="def32 != null and def32 != ''"> and def32 like concat('%',#{def32},'%') </if>
+            <if test="def33 != null and def33 != ''"> and def33 like concat('%',#{def33},'%') </if>
+            <if test="def34 != null and def34 != ''"> and def34 like concat('%',#{def34},'%') </if>
+            <if test="def35 != null and def35 != ''"> and def35 like concat('%',#{def35},'%') </if>
+            <if test="def36 != null and def36 != ''"> and def36 like concat('%',#{def36},'%') </if>
+            <if test="def37 != null and def37 != ''"> and def37 like concat('%',#{def37},'%') </if>
+            <if test="def38 != null and def38 != ''"> and def38 like concat('%',#{def38},'%') </if>
+            <if test="def39 != null and def39 != ''"> and def39 like concat('%',#{def39},'%') </if>
+            <if test="def40 != null and def40 != ''"> and def40 like concat('%',#{def40},'%') </if>
             and sts='Y'
     </trim>
     <if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
@@ -235,42 +522,99 @@
     from tocofs_returngoods_detailed
     <trim prefix="where" prefixOverrides="and"> 
          <if test="id != null and id != ''"> or id = #{id} </if>
-             <if test="receiptId != null and receiptId != ''"> or receipt_id = #{receiptId} </if>
-             <if test="receiptCode != null and receiptCode != ''"> or receipt_code = #{receiptCode} </if>
-             <if test="refOrderId != null and refOrderId != ''"> or ref_order_id = #{refOrderId} </if>
-             <if test="refOrderDetailId != null and refOrderDetailId != ''"> or ref_order_detail_id = #{refOrderDetailId} </if>
-             <if test="sourceOrderCode != null and sourceOrderCode != ''"> or source_order_code = #{sourceOrderCode} </if>
-             <if test="clientCode != null and clientCode != ''"> or client_code = #{clientCode} </if>
-             <if test="companyCode != null and companyCode != ''"> or company_code = #{companyCode} </if>
-             <if test="facilityCode != null and facilityCode != ''"> or facility_code = #{facilityCode} </if>
-             <if test="skuCode != null and skuCode != ''"> or sku_code = #{skuCode} </if>
-             <if test="skuName != null and skuName != ''"> or sku_name = #{skuName} </if>
-             <if test="requestQty != null and requestQty != ''"> or request_qty = #{requestQty} </if>
-             <if test="receivedQty != null and receivedQty != ''"> or received_qty = #{receivedQty} </if>
-             <if test="openQty != null and openQty != ''"> or open_qty = #{openQty} </if>
-             <if test="quantityUM != null and quantityUM != ''"> or quantity_u_m = #{quantityUM} </if>
-             <if test="totalWeight != null and totalWeight != ''"> or total_weight = #{totalWeight} </if>
-             <if test="totalVolume != null and totalVolume != ''"> or total_volume = #{totalVolume} </if>
-             <if test="totalVolumeWeight != null and totalVolumeWeight != ''"> or total_volume_weight = #{totalVolumeWeight} </if>
-             <if test="totalAmount != null and totalAmount != ''"> or total_amount = #{totalAmount} </if>
-             <if test="weightUM != null and weightUM != ''"> or weight_u_m = #{weightUM} </if>
-             <if test="volumeUM != null and volumeUM != ''"> or volume_u_m = #{volumeUM} </if>
-             <if test="inventorySts != null and inventorySts != ''"> or inventory_sts = #{inventorySts} </if>
-             <if test="inTransInvId != null and inTransInvId != ''"> or in_trans_inv_id = #{inTransInvId} </if>
+             <if test="receiptid != null and receiptid != ''"> or receiptId = #{receiptid} </if>
+             <if test="receiptcode != null and receiptcode != ''"> or receiptCode = #{receiptcode} </if>
+             <if test="reforderid != null and reforderid != ''"> or refOrderId = #{reforderid} </if>
+             <if test="reforderdetailid != null and reforderdetailid != ''"> or refOrderDetailId = #{reforderdetailid} </if>
+             <if test="sourceordercode != null and sourceordercode != ''"> or sourceOrderCode = #{sourceordercode} </if>
+             <if test="sourcelinenum != null and sourcelinenum != ''"> or sourceLineNum = #{sourcelinenum} </if>
+             <if test="clientcode != null and clientcode != ''"> or clientCode = #{clientcode} </if>
+             <if test="companycode != null and companycode != ''"> or companyCode = #{companycode} </if>
+             <if test="facilitycode != null and facilitycode != ''"> or facilityCode = #{facilitycode} </if>
+             <if test="skucode != null and skucode != ''"> or skuCode = #{skucode} </if>
+             <if test="skuname != null and skuname != ''"> or skuName = #{skuname} </if>
+             <if test="requestqty != null and requestqty != ''"> or requestQty = #{requestqty} </if>
+             <if test="receivedqty != null and receivedqty != ''"> or receivedQty = #{receivedqty} </if>
+             <if test="openqty != null and openqty != ''"> or openQty = #{openqty} </if>
+             <if test="quantityum != null and quantityum != ''"> or quantityUM = #{quantityum} </if>
+             <if test="totalweight != null and totalweight != ''"> or totalWeight = #{totalweight} </if>
+             <if test="totalvolume != null and totalvolume != ''"> or totalVolume = #{totalvolume} </if>
+             <if test="totalvolumeweight != null and totalvolumeweight != ''"> or totalVolumeWeight = #{totalvolumeweight} </if>
+             <if test="totalamount != null and totalamount != ''"> or totalAmount = #{totalamount} </if>
+             <if test="weightum != null and weightum != ''"> or weightUM = #{weightum} </if>
+             <if test="volumeum != null and volumeum != ''"> or volumeUM = #{volumeum} </if>
+             <if test="inventorysts != null and inventorysts != ''"> or inventorySts = #{inventorysts} </if>
+             <if test="intransinvid != null and intransinvid != ''"> or inTransInvId = #{intransinvid} </if>
              <if test="closed != null and closed != ''"> or closed = #{closed} </if>
              <if test="created != null and created != ''"> or created = #{created} </if>
-             <if test="createdBy != null and createdBy != ''"> or created_by = #{createdBy} </if>
-             <if test="lastUpdated != null and lastUpdated != ''"> or last_updated = #{lastUpdated} </if>
-             <if test="lastUpdatedBy != null and lastUpdatedBy != ''"> or last_updated_by = #{lastUpdatedBy} </if>
-             <if test="discountPrice != null and discountPrice != ''"> or discount_price = #{discountPrice} </if>
-             <if test="newTransmitinfo != null and newTransmitinfo != ''"> or new_transmitInfo = #{newTransmitinfo} </if>
-             <if test="newPushdate != null and newPushdate != ''"> or new_pushDate = #{newPushdate} </if>
-             <if test="newState != null and newState != ''"> or new_state = #{newState} </if>
-             <if test="newSystemNumber != null and newSystemNumber != ''"> or new_system_number = #{newSystemNumber} </if>
-             <if test="newSystemPrimary != null and newSystemPrimary != ''"> or new_system_primary = #{newSystemPrimary} </if>
-             <if test="primaryKey != null and primaryKey != ''"> or primary_key = #{primaryKey} </if>
-             <if test="businessDate != null and businessDate != ''"> or business_date = #{businessDate} </if>
-             <if test="businessType != null and businessType != ''"> or business_type = #{businessType} </if>
+             <if test="createdby != null and createdby != ''"> or createdBy = #{createdby} </if>
+             <if test="lastupdated != null and lastupdated != ''"> or lastUpdated = #{lastupdated} </if>
+             <if test="lastupdatedby != null and lastupdatedby != ''"> or lastUpdatedBy = #{lastupdatedby} </if>
+             <if test="discountprice != null and discountprice != ''"> or discountPrice = #{discountprice} </if>
+             <if test="maintableid != null and maintableid != ''"> or mainTableId = #{maintableid} </if>
+             <if test="newtransmitinfo != null and newtransmitinfo != ''"> or newTransmitInfo = #{newtransmitinfo} </if>
+             <if test="newpushdate != null and newpushdate != ''"> or newPushDate = #{newpushdate} </if>
+             <if test="newstate != null and newstate != ''"> or newState = #{newstate} </if>
+             <if test="newsystemnumber != null and newsystemnumber != ''"> or newSystemNumber = #{newsystemnumber} </if>
+             <if test="newsystemprimary != null and newsystemprimary != ''"> or newSystemPrimary = #{newsystemprimary} </if>
+             <if test="newtransmitinfo2 != null and newtransmitinfo2 != ''"> or newTransmitInfo2 = #{newtransmitinfo2} </if>
+             <if test="newpushdate2 != null and newpushdate2 != ''"> or newPushDate2 = #{newpushdate2} </if>
+             <if test="newstate2 != null and newstate2 != ''"> or newState2 = #{newstate2} </if>
+             <if test="newsystemnumber2 != null and newsystemnumber2 != ''"> or newSystemNumber2 = #{newsystemnumber2} </if>
+             <if test="newsystemprimary2 != null and newsystemprimary2 != ''"> or newSystemPrimary2 = #{newsystemprimary2} </if>
+             <if test="newtransmitinfo3 != null and newtransmitinfo3 != ''"> or newTransmitInfo3 = #{newtransmitinfo3} </if>
+             <if test="newpushdate3 != null and newpushdate3 != ''"> or newPushDate3 = #{newpushdate3} </if>
+             <if test="newstate3 != null and newstate3 != ''"> or newState3 = #{newstate3} </if>
+             <if test="newsystemnumber3 != null and newsystemnumber3 != ''"> or newSystemNumber3 = #{newsystemnumber3} </if>
+             <if test="newsystemprimary3 != null and newsystemprimary3 != ''"> or newSystemPrimary3 = #{newsystemprimary3} </if>
+             <if test="newtransmitinfo4 != null and newtransmitinfo4 != ''"> or newTransmitInfo4 = #{newtransmitinfo4} </if>
+             <if test="newpushdate4 != null and newpushdate4 != ''"> or newPushDate4 = #{newpushdate4} </if>
+             <if test="newstate4 != null and newstate4 != ''"> or newState4 = #{newstate4} </if>
+             <if test="newsystemnumber4 != null and newsystemnumber4 != ''"> or newSystemNumber4 = #{newsystemnumber4} </if>
+             <if test="newsystemprimary4 != null and newsystemprimary4 != ''"> or newSystemPrimary4 = #{newsystemprimary4} </if>
+             <if test="businessdate != null and businessdate != ''"> or businessDate = #{businessdate} </if>
+             <if test="refundedat != null and refundedat != ''"> or refundedAt = #{refundedat} </if>
+             <if test="businesstype != null and businesstype != ''"> or businessType = #{businesstype} </if>
+             <if test="def1 != null and def1 != ''"> or def1 = #{def1} </if>
+             <if test="def2 != null and def2 != ''"> or def2 = #{def2} </if>
+             <if test="def3 != null and def3 != ''"> or def3 = #{def3} </if>
+             <if test="def4 != null and def4 != ''"> or def4 = #{def4} </if>
+             <if test="def5 != null and def5 != ''"> or def5 = #{def5} </if>
+             <if test="def6 != null and def6 != ''"> or def6 = #{def6} </if>
+             <if test="def7 != null and def7 != ''"> or def7 = #{def7} </if>
+             <if test="def8 != null and def8 != ''"> or def8 = #{def8} </if>
+             <if test="def9 != null and def9 != ''"> or def9 = #{def9} </if>
+             <if test="def10 != null and def10 != ''"> or def10 = #{def10} </if>
+             <if test="def11 != null and def11 != ''"> or def11 = #{def11} </if>
+             <if test="def12 != null and def12 != ''"> or def12 = #{def12} </if>
+             <if test="def13 != null and def13 != ''"> or def13 = #{def13} </if>
+             <if test="def14 != null and def14 != ''"> or def14 = #{def14} </if>
+             <if test="def15 != null and def15 != ''"> or def15 = #{def15} </if>
+             <if test="def16 != null and def16 != ''"> or def16 = #{def16} </if>
+             <if test="def17 != null and def17 != ''"> or def17 = #{def17} </if>
+             <if test="def18 != null and def18 != ''"> or def18 = #{def18} </if>
+             <if test="def19 != null and def19 != ''"> or def19 = #{def19} </if>
+             <if test="def20 != null and def20 != ''"> or def20 = #{def20} </if>
+             <if test="def21 != null and def21 != ''"> or def21 = #{def21} </if>
+             <if test="def22 != null and def22 != ''"> or def22 = #{def22} </if>
+             <if test="def23 != null and def23 != ''"> or def23 = #{def23} </if>
+             <if test="def24 != null and def24 != ''"> or def24 = #{def24} </if>
+             <if test="def25 != null and def25 != ''"> or def25 = #{def25} </if>
+             <if test="def26 != null and def26 != ''"> or def26 = #{def26} </if>
+             <if test="def27 != null and def27 != ''"> or def27 = #{def27} </if>
+             <if test="def28 != null and def28 != ''"> or def28 = #{def28} </if>
+             <if test="def29 != null and def29 != ''"> or def29 = #{def29} </if>
+             <if test="def30 != null and def30 != ''"> or def30 = #{def30} </if>
+             <if test="def31 != null and def31 != ''"> or def31 = #{def31} </if>
+             <if test="def32 != null and def32 != ''"> or def32 = #{def32} </if>
+             <if test="def33 != null and def33 != ''"> or def33 = #{def33} </if>
+             <if test="def34 != null and def34 != ''"> or def34 = #{def34} </if>
+             <if test="def35 != null and def35 != ''"> or def35 = #{def35} </if>
+             <if test="def36 != null and def36 != ''"> or def36 = #{def36} </if>
+             <if test="def37 != null and def37 != ''"> or def37 = #{def37} </if>
+             <if test="def38 != null and def38 != ''"> or def38 = #{def38} </if>
+             <if test="def39 != null and def39 != ''"> or def39 = #{def39} </if>
+             <if test="def40 != null and def40 != ''"> or def40 = #{def40} </if>
             and sts='Y'
     </trim>
     <if test=" sort == null or sort == ''.toString()  "> order by sorts asc</if>
@@ -282,248 +626,529 @@
     insert into tocofs_returngoods_detailed(
   <trim suffix="" suffixOverrides=",">
        <if test="id != null and id != ''"> id , </if>
-            <if test="receiptId != null and receiptId != ''"> receipt_id , </if>
-            <if test="receiptCode != null and receiptCode != ''"> receipt_code , </if>
-            <if test="refOrderId != null and refOrderId != ''"> ref_order_id , </if>
-            <if test="refOrderDetailId != null and refOrderDetailId != ''"> ref_order_detail_id , </if>
-            <if test="sourceOrderCode != null and sourceOrderCode != ''"> source_order_code , </if>
-            <if test="clientCode != null and clientCode != ''"> client_code , </if>
-            <if test="companyCode != null and companyCode != ''"> company_code , </if>
-            <if test="facilityCode != null and facilityCode != ''"> facility_code , </if>
-            <if test="skuCode != null and skuCode != ''"> sku_code , </if>
-            <if test="skuName != null and skuName != ''"> sku_name , </if>
-            <if test="requestQty != null and requestQty != ''"> request_qty , </if>
-            <if test="receivedQty != null and receivedQty != ''"> received_qty , </if>
-            <if test="openQty != null and openQty != ''"> open_qty , </if>
-            <if test="quantityUM != null and quantityUM != ''"> quantity_u_m , </if>
-            <if test="totalWeight != null and totalWeight != ''"> total_weight , </if>
-            <if test="totalVolume != null and totalVolume != ''"> total_volume , </if>
-            <if test="totalVolumeWeight != null and totalVolumeWeight != ''"> total_volume_weight , </if>
-            <if test="totalAmount != null and totalAmount != ''"> total_amount , </if>
-            <if test="weightUM != null and weightUM != ''"> weight_u_m , </if>
-            <if test="volumeUM != null and volumeUM != ''"> volume_u_m , </if>
-            <if test="inventorySts != null and inventorySts != ''"> inventory_sts , </if>
-            <if test="inTransInvId != null and inTransInvId != ''"> in_trans_inv_id , </if>
+            <if test="receiptid != null and receiptid != ''"> receiptId , </if>
+            <if test="receiptcode != null and receiptcode != ''"> receiptCode , </if>
+            <if test="reforderid != null and reforderid != ''"> refOrderId , </if>
+            <if test="reforderdetailid != null and reforderdetailid != ''"> refOrderDetailId , </if>
+            <if test="sourceordercode != null and sourceordercode != ''"> sourceOrderCode , </if>
+            <if test="sourcelinenum != null and sourcelinenum != ''"> sourceLineNum , </if>
+            <if test="clientcode != null and clientcode != ''"> clientCode , </if>
+            <if test="companycode != null and companycode != ''"> companyCode , </if>
+            <if test="facilitycode != null and facilitycode != ''"> facilityCode , </if>
+            <if test="skucode != null and skucode != ''"> skuCode , </if>
+            <if test="skuname != null and skuname != ''"> skuName , </if>
+            <if test="requestqty != null and requestqty != ''"> requestQty , </if>
+            <if test="receivedqty != null and receivedqty != ''"> receivedQty , </if>
+            <if test="openqty != null and openqty != ''"> openQty , </if>
+            <if test="quantityum != null and quantityum != ''"> quantityUM , </if>
+            <if test="totalweight != null and totalweight != ''"> totalWeight , </if>
+            <if test="totalvolume != null and totalvolume != ''"> totalVolume , </if>
+            <if test="totalvolumeweight != null and totalvolumeweight != ''"> totalVolumeWeight , </if>
+            <if test="totalamount != null and totalamount != ''"> totalAmount , </if>
+            <if test="weightum != null and weightum != ''"> weightUM , </if>
+            <if test="volumeum != null and volumeum != ''"> volumeUM , </if>
+            <if test="inventorysts != null and inventorysts != ''"> inventorySts , </if>
+            <if test="intransinvid != null and intransinvid != ''"> inTransInvId , </if>
             <if test="closed != null and closed != ''"> closed , </if>
             <if test="created != null and created != ''"> created , </if>
-            <if test="createdBy != null and createdBy != ''"> created_by , </if>
-            <if test="lastUpdated != null and lastUpdated != ''"> last_updated , </if>
-            <if test="lastUpdatedBy != null and lastUpdatedBy != ''"> last_updated_by , </if>
-            <if test="discountPrice != null and discountPrice != ''"> discount_price , </if>
-            <if test="newTransmitinfo != null and newTransmitinfo != ''"> new_transmitInfo , </if>
-            <if test="newPushdate != null and newPushdate != ''"> new_pushDate , </if>
-            <if test="newState != null and newState != ''"> new_state , </if>
-            <if test="newSystemNumber != null and newSystemNumber != ''"> new_system_number , </if>
-            <if test="newSystemPrimary != null and newSystemPrimary != ''"> new_system_primary , </if>
-            <if test="primaryKey != null and primaryKey != ''"> primary_key , </if>
-            <if test="businessDate != null and businessDate != ''"> business_date , </if>
-            <if test="businessType != null and businessType != ''"> business_type , </if>
+            <if test="createdby != null and createdby != ''"> createdBy , </if>
+            <if test="lastupdated != null and lastupdated != ''"> lastUpdated , </if>
+            <if test="lastupdatedby != null and lastupdatedby != ''"> lastUpdatedBy , </if>
+            <if test="discountprice != null and discountprice != ''"> discountPrice , </if>
+            <if test="maintableid != null and maintableid != ''"> mainTableId , </if>
+            <if test="newtransmitinfo != null and newtransmitinfo != ''"> newTransmitInfo , </if>
+            <if test="newpushdate != null and newpushdate != ''"> newPushDate , </if>
+            <if test="newstate != null and newstate != ''"> newState , </if>
+            <if test="newsystemnumber != null and newsystemnumber != ''"> newSystemNumber , </if>
+            <if test="newsystemprimary != null and newsystemprimary != ''"> newSystemPrimary , </if>
+            <if test="newtransmitinfo2 != null and newtransmitinfo2 != ''"> newTransmitInfo2 , </if>
+            <if test="newpushdate2 != null and newpushdate2 != ''"> newPushDate2 , </if>
+            <if test="newstate2 != null and newstate2 != ''"> newState2 , </if>
+            <if test="newsystemnumber2 != null and newsystemnumber2 != ''"> newSystemNumber2 , </if>
+            <if test="newsystemprimary2 != null and newsystemprimary2 != ''"> newSystemPrimary2 , </if>
+            <if test="newtransmitinfo3 != null and newtransmitinfo3 != ''"> newTransmitInfo3 , </if>
+            <if test="newpushdate3 != null and newpushdate3 != ''"> newPushDate3 , </if>
+            <if test="newstate3 != null and newstate3 != ''"> newState3 , </if>
+            <if test="newsystemnumber3 != null and newsystemnumber3 != ''"> newSystemNumber3 , </if>
+            <if test="newsystemprimary3 != null and newsystemprimary3 != ''"> newSystemPrimary3 , </if>
+            <if test="newtransmitinfo4 != null and newtransmitinfo4 != ''"> newTransmitInfo4 , </if>
+            <if test="newpushdate4 != null and newpushdate4 != ''"> newPushDate4 , </if>
+            <if test="newstate4 != null and newstate4 != ''"> newState4 , </if>
+            <if test="newsystemnumber4 != null and newsystemnumber4 != ''"> newSystemNumber4 , </if>
+            <if test="newsystemprimary4 != null and newsystemprimary4 != ''"> newSystemPrimary4 , </if>
+            <if test="businessdate != null and businessdate != ''"> businessDate , </if>
+            <if test="refundedat != null and refundedat != ''"> refundedAt , </if>
+            <if test="businesstype != null and businesstype != ''"> businessType , </if>
+            <if test="def1 != null and def1 != ''"> def1 , </if>
+            <if test="def2 != null and def2 != ''"> def2 , </if>
+            <if test="def3 != null and def3 != ''"> def3 , </if>
+            <if test="def4 != null and def4 != ''"> def4 , </if>
+            <if test="def5 != null and def5 != ''"> def5 , </if>
+            <if test="def6 != null and def6 != ''"> def6 , </if>
+            <if test="def7 != null and def7 != ''"> def7 , </if>
+            <if test="def8 != null and def8 != ''"> def8 , </if>
+            <if test="def9 != null and def9 != ''"> def9 , </if>
+            <if test="def10 != null and def10 != ''"> def10 , </if>
+            <if test="def11 != null and def11 != ''"> def11 , </if>
+            <if test="def12 != null and def12 != ''"> def12 , </if>
+            <if test="def13 != null and def13 != ''"> def13 , </if>
+            <if test="def14 != null and def14 != ''"> def14 , </if>
+            <if test="def15 != null and def15 != ''"> def15 , </if>
+            <if test="def16 != null and def16 != ''"> def16 , </if>
+            <if test="def17 != null and def17 != ''"> def17 , </if>
+            <if test="def18 != null and def18 != ''"> def18 , </if>
+            <if test="def19 != null and def19 != ''"> def19 , </if>
+            <if test="def20 != null and def20 != ''"> def20 , </if>
+            <if test="def21 != null and def21 != ''"> def21 , </if>
+            <if test="def22 != null and def22 != ''"> def22 , </if>
+            <if test="def23 != null and def23 != ''"> def23 , </if>
+            <if test="def24 != null and def24 != ''"> def24 , </if>
+            <if test="def25 != null and def25 != ''"> def25 , </if>
+            <if test="def26 != null and def26 != ''"> def26 , </if>
+            <if test="def27 != null and def27 != ''"> def27 , </if>
+            <if test="def28 != null and def28 != ''"> def28 , </if>
+            <if test="def29 != null and def29 != ''"> def29 , </if>
+            <if test="def30 != null and def30 != ''"> def30 , </if>
+            <if test="def31 != null and def31 != ''"> def31 , </if>
+            <if test="def32 != null and def32 != ''"> def32 , </if>
+            <if test="def33 != null and def33 != ''"> def33 , </if>
+            <if test="def34 != null and def34 != ''"> def34 , </if>
+            <if test="def35 != null and def35 != ''"> def35 , </if>
+            <if test="def36 != null and def36 != ''"> def36 , </if>
+            <if test="def37 != null and def37 != ''"> def37 , </if>
+            <if test="def38 != null and def38 != ''"> def38 , </if>
+            <if test="def39 != null and def39 != ''"> def39 , </if>
+            <if test="def40 != null and def40 != ''"> def40 , </if>
             <if test="sorts == null ">sorts,</if>
     <if test="sts == null ">sts,</if>
   </trim>
   )values(
  <trim suffix="" suffixOverrides=",">
        <if test="id != null and id != ''"> #{id} ,</if>
-            <if test="receiptId != null and receiptId != ''"> #{receiptId} ,</if>
-            <if test="receiptCode != null and receiptCode != ''"> #{receiptCode} ,</if>
-            <if test="refOrderId != null and refOrderId != ''"> #{refOrderId} ,</if>
-            <if test="refOrderDetailId != null and refOrderDetailId != ''"> #{refOrderDetailId} ,</if>
-            <if test="sourceOrderCode != null and sourceOrderCode != ''"> #{sourceOrderCode} ,</if>
-            <if test="clientCode != null and clientCode != ''"> #{clientCode} ,</if>
-            <if test="companyCode != null and companyCode != ''"> #{companyCode} ,</if>
-            <if test="facilityCode != null and facilityCode != ''"> #{facilityCode} ,</if>
-            <if test="skuCode != null and skuCode != ''"> #{skuCode} ,</if>
-            <if test="skuName != null and skuName != ''"> #{skuName} ,</if>
-            <if test="requestQty != null and requestQty != ''"> #{requestQty} ,</if>
-            <if test="receivedQty != null and receivedQty != ''"> #{receivedQty} ,</if>
-            <if test="openQty != null and openQty != ''"> #{openQty} ,</if>
-            <if test="quantityUM != null and quantityUM != ''"> #{quantityUM} ,</if>
-            <if test="totalWeight != null and totalWeight != ''"> #{totalWeight} ,</if>
-            <if test="totalVolume != null and totalVolume != ''"> #{totalVolume} ,</if>
-            <if test="totalVolumeWeight != null and totalVolumeWeight != ''"> #{totalVolumeWeight} ,</if>
-            <if test="totalAmount != null and totalAmount != ''"> #{totalAmount} ,</if>
-            <if test="weightUM != null and weightUM != ''"> #{weightUM} ,</if>
-            <if test="volumeUM != null and volumeUM != ''"> #{volumeUM} ,</if>
-            <if test="inventorySts != null and inventorySts != ''"> #{inventorySts} ,</if>
-            <if test="inTransInvId != null and inTransInvId != ''"> #{inTransInvId} ,</if>
+            <if test="receiptid != null and receiptid != ''"> #{receiptid} ,</if>
+            <if test="receiptcode != null and receiptcode != ''"> #{receiptcode} ,</if>
+            <if test="reforderid != null and reforderid != ''"> #{reforderid} ,</if>
+            <if test="reforderdetailid != null and reforderdetailid != ''"> #{reforderdetailid} ,</if>
+            <if test="sourceordercode != null and sourceordercode != ''"> #{sourceordercode} ,</if>
+            <if test="sourcelinenum != null and sourcelinenum != ''"> #{sourcelinenum} ,</if>
+            <if test="clientcode != null and clientcode != ''"> #{clientcode} ,</if>
+            <if test="companycode != null and companycode != ''"> #{companycode} ,</if>
+            <if test="facilitycode != null and facilitycode != ''"> #{facilitycode} ,</if>
+            <if test="skucode != null and skucode != ''"> #{skucode} ,</if>
+            <if test="skuname != null and skuname != ''"> #{skuname} ,</if>
+            <if test="requestqty != null and requestqty != ''"> #{requestqty} ,</if>
+            <if test="receivedqty != null and receivedqty != ''"> #{receivedqty} ,</if>
+            <if test="openqty != null and openqty != ''"> #{openqty} ,</if>
+            <if test="quantityum != null and quantityum != ''"> #{quantityum} ,</if>
+            <if test="totalweight != null and totalweight != ''"> #{totalweight} ,</if>
+            <if test="totalvolume != null and totalvolume != ''"> #{totalvolume} ,</if>
+            <if test="totalvolumeweight != null and totalvolumeweight != ''"> #{totalvolumeweight} ,</if>
+            <if test="totalamount != null and totalamount != ''"> #{totalamount} ,</if>
+            <if test="weightum != null and weightum != ''"> #{weightum} ,</if>
+            <if test="volumeum != null and volumeum != ''"> #{volumeum} ,</if>
+            <if test="inventorysts != null and inventorysts != ''"> #{inventorysts} ,</if>
+            <if test="intransinvid != null and intransinvid != ''"> #{intransinvid} ,</if>
             <if test="closed != null and closed != ''"> #{closed} ,</if>
             <if test="created != null and created != ''"> #{created} ,</if>
-            <if test="createdBy != null and createdBy != ''"> #{createdBy} ,</if>
-            <if test="lastUpdated != null and lastUpdated != ''"> #{lastUpdated} ,</if>
-            <if test="lastUpdatedBy != null and lastUpdatedBy != ''"> #{lastUpdatedBy} ,</if>
-            <if test="discountPrice != null and discountPrice != ''"> #{discountPrice} ,</if>
-            <if test="newTransmitinfo != null and newTransmitinfo != ''"> #{newTransmitinfo} ,</if>
-            <if test="newPushdate != null and newPushdate != ''"> #{newPushdate} ,</if>
-            <if test="newState != null and newState != ''"> #{newState} ,</if>
-            <if test="newSystemNumber != null and newSystemNumber != ''"> #{newSystemNumber} ,</if>
-            <if test="newSystemPrimary != null and newSystemPrimary != ''"> #{newSystemPrimary} ,</if>
-            <if test="primaryKey != null and primaryKey != ''"> #{primaryKey} ,</if>
-            <if test="businessDate != null and businessDate != ''"> #{businessDate} ,</if>
-            <if test="businessType != null and businessType != ''"> #{businessType} ,</if>
+            <if test="createdby != null and createdby != ''"> #{createdby} ,</if>
+            <if test="lastupdated != null and lastupdated != ''"> #{lastupdated} ,</if>
+            <if test="lastupdatedby != null and lastupdatedby != ''"> #{lastupdatedby} ,</if>
+            <if test="discountprice != null and discountprice != ''"> #{discountprice} ,</if>
+            <if test="maintableid != null and maintableid != ''"> #{maintableid} ,</if>
+            <if test="newtransmitinfo != null and newtransmitinfo != ''"> #{newtransmitinfo} ,</if>
+            <if test="newpushdate != null and newpushdate != ''"> #{newpushdate} ,</if>
+            <if test="newstate != null and newstate != ''"> #{newstate} ,</if>
+            <if test="newsystemnumber != null and newsystemnumber != ''"> #{newsystemnumber} ,</if>
+            <if test="newsystemprimary != null and newsystemprimary != ''"> #{newsystemprimary} ,</if>
+            <if test="newtransmitinfo2 != null and newtransmitinfo2 != ''"> #{newtransmitinfo2} ,</if>
+            <if test="newpushdate2 != null and newpushdate2 != ''"> #{newpushdate2} ,</if>
+            <if test="newstate2 != null and newstate2 != ''"> #{newstate2} ,</if>
+            <if test="newsystemnumber2 != null and newsystemnumber2 != ''"> #{newsystemnumber2} ,</if>
+            <if test="newsystemprimary2 != null and newsystemprimary2 != ''"> #{newsystemprimary2} ,</if>
+            <if test="newtransmitinfo3 != null and newtransmitinfo3 != ''"> #{newtransmitinfo3} ,</if>
+            <if test="newpushdate3 != null and newpushdate3 != ''"> #{newpushdate3} ,</if>
+            <if test="newstate3 != null and newstate3 != ''"> #{newstate3} ,</if>
+            <if test="newsystemnumber3 != null and newsystemnumber3 != ''"> #{newsystemnumber3} ,</if>
+            <if test="newsystemprimary3 != null and newsystemprimary3 != ''"> #{newsystemprimary3} ,</if>
+            <if test="newtransmitinfo4 != null and newtransmitinfo4 != ''"> #{newtransmitinfo4} ,</if>
+            <if test="newpushdate4 != null and newpushdate4 != ''"> #{newpushdate4} ,</if>
+            <if test="newstate4 != null and newstate4 != ''"> #{newstate4} ,</if>
+            <if test="newsystemnumber4 != null and newsystemnumber4 != ''"> #{newsystemnumber4} ,</if>
+            <if test="newsystemprimary4 != null and newsystemprimary4 != ''"> #{newsystemprimary4} ,</if>
+            <if test="businessdate != null and businessdate != ''"> #{businessdate} ,</if>
+            <if test="refundedat != null and refundedat != ''"> #{refundedat} ,</if>
+            <if test="businesstype != null and businesstype != ''"> #{businesstype} ,</if>
+            <if test="def1 != null and def1 != ''"> #{def1} ,</if>
+            <if test="def2 != null and def2 != ''"> #{def2} ,</if>
+            <if test="def3 != null and def3 != ''"> #{def3} ,</if>
+            <if test="def4 != null and def4 != ''"> #{def4} ,</if>
+            <if test="def5 != null and def5 != ''"> #{def5} ,</if>
+            <if test="def6 != null and def6 != ''"> #{def6} ,</if>
+            <if test="def7 != null and def7 != ''"> #{def7} ,</if>
+            <if test="def8 != null and def8 != ''"> #{def8} ,</if>
+            <if test="def9 != null and def9 != ''"> #{def9} ,</if>
+            <if test="def10 != null and def10 != ''"> #{def10} ,</if>
+            <if test="def11 != null and def11 != ''"> #{def11} ,</if>
+            <if test="def12 != null and def12 != ''"> #{def12} ,</if>
+            <if test="def13 != null and def13 != ''"> #{def13} ,</if>
+            <if test="def14 != null and def14 != ''"> #{def14} ,</if>
+            <if test="def15 != null and def15 != ''"> #{def15} ,</if>
+            <if test="def16 != null and def16 != ''"> #{def16} ,</if>
+            <if test="def17 != null and def17 != ''"> #{def17} ,</if>
+            <if test="def18 != null and def18 != ''"> #{def18} ,</if>
+            <if test="def19 != null and def19 != ''"> #{def19} ,</if>
+            <if test="def20 != null and def20 != ''"> #{def20} ,</if>
+            <if test="def21 != null and def21 != ''"> #{def21} ,</if>
+            <if test="def22 != null and def22 != ''"> #{def22} ,</if>
+            <if test="def23 != null and def23 != ''"> #{def23} ,</if>
+            <if test="def24 != null and def24 != ''"> #{def24} ,</if>
+            <if test="def25 != null and def25 != ''"> #{def25} ,</if>
+            <if test="def26 != null and def26 != ''"> #{def26} ,</if>
+            <if test="def27 != null and def27 != ''"> #{def27} ,</if>
+            <if test="def28 != null and def28 != ''"> #{def28} ,</if>
+            <if test="def29 != null and def29 != ''"> #{def29} ,</if>
+            <if test="def30 != null and def30 != ''"> #{def30} ,</if>
+            <if test="def31 != null and def31 != ''"> #{def31} ,</if>
+            <if test="def32 != null and def32 != ''"> #{def32} ,</if>
+            <if test="def33 != null and def33 != ''"> #{def33} ,</if>
+            <if test="def34 != null and def34 != ''"> #{def34} ,</if>
+            <if test="def35 != null and def35 != ''"> #{def35} ,</if>
+            <if test="def36 != null and def36 != ''"> #{def36} ,</if>
+            <if test="def37 != null and def37 != ''"> #{def37} ,</if>
+            <if test="def38 != null and def38 != ''"> #{def38} ,</if>
+            <if test="def39 != null and def39 != ''"> #{def39} ,</if>
+            <if test="def40 != null and def40 != ''"> #{def40} ,</if>
             <if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from tocofs_returngoods_detailed a WHERE a.sts = 'Y' ),</if>
     <if test="sts == null ">'Y',</if>
   </trim>
   )  
 </insert>
-    <!-- 批量新增 -->
-    <insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
-      insert into tocofs_returngoods_detailed(receipt_id, receipt_code, ref_order_id, ref_order_detail_id, source_order_code, client_code, company_code, facility_code, sku_code, sku_name, request_qty, received_qty, open_qty, quantity_u_m, total_weight, total_volume, total_volume_weight, total_amount, weight_u_m, volume_u_m, inventory_sts, in_trans_inv_id, closed, created, created_by, last_updated, last_updated_by, discount_price, new_transmitInfo, new_pushDate, new_state, new_system_number, new_system_primary, primary_key, business_date,business_type)
-        values
-        <foreach collection="entities" item="entity" separator=",">
-        (#{entity.receiptId},#{entity.receiptCode},#{entity.refOrderId},#{entity.refOrderDetailId},#{entity.sourceOrderCode},#{entity.clientCode},#{entity.companyCode},#{entity.facilityCode},#{entity.skuCode},#{entity.skuName},#{entity.requestQty},#{entity.receivedQty},#{entity.openQty},#{entity.quantityUM},#{entity.totalWeight},#{entity.totalVolume},#{entity.totalVolumeWeight},#{entity.totalAmount},#{entity.weightUM},#{entity.volumeUM},#{entity.inventorySts},#{entity.inTransInvId},#{entity.closed},#{entity.created},#{entity.createdBy},#{entity.lastUpdated},#{entity.lastUpdatedBy},#{entity.discountPrice},#{entity.newTransmitinfo},#{entity.newPushdate},#{entity.newState},#{entity.newSystemNumber},#{entity.newSystemPrimary},#{entity.primaryKey},#{entity.businessDate},#{entity.businessType})
-        </foreach>
-    </insert>
 
-    <!-- 批量新增 -->
-    <insert id="entityInsertBatchV2" keyProperty="id" useGeneratedKeys="true">
-        insert IGNORE into tocofs_returngoods_detailed(receipt_id, receipt_code, ref_order_id, ref_order_detail_id, source_order_code, client_code, company_code, facility_code, sku_code, sku_name, request_qty, received_qty, open_qty, quantity_u_m, total_weight, total_volume, total_volume_weight, total_amount, weight_u_m, volume_u_m, inventory_sts, in_trans_inv_id, closed, created, created_by, last_updated, last_updated_by, discount_price, new_transmitInfo, new_pushDate, new_state, new_system_number, new_system_primary, primary_key, business_date,business_type)
-        values
-        <foreach collection="list" item="entity" separator=",">
-            (#{entity.receiptId},#{entity.receiptCode},#{entity.refOrderId},#{entity.refOrderDetailId},#{entity.sourceOrderCode},#{entity.clientCode},#{entity.companyCode},#{entity.facilityCode},#{entity.skuCode},#{entity.skuName},#{entity.requestQty},#{entity.receivedQty},#{entity.openQty},#{entity.quantityUM},#{entity.totalWeight},#{entity.totalVolume},#{entity.totalVolumeWeight},#{entity.totalAmount},#{entity.weightUM},#{entity.volumeUM},#{entity.inventorySts},#{entity.inTransInvId},#{entity.closed},#{entity.created},#{entity.createdBy},#{entity.lastUpdated},#{entity.lastUpdatedBy},#{entity.discountPrice},#{entity.newTransmitinfo},#{entity.newPushdate},#{entity.newState},#{entity.newSystemNumber},#{entity.newSystemPrimary},#{entity.primaryKey},#{entity.businessDate},#{entity.businessType})
-        </foreach>
-    </insert>
-
-<!-- 批量新增或者修改-->
-<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
-    insert into tocofs_returngoods_detailed(receipt_id, receipt_code, ref_order_id, ref_order_detail_id, source_order_code, client_code, company_code, facility_code, sku_code, sku_name, request_qty, received_qty, open_qty, quantity_u_m, total_weight, total_volume, total_volume_weight, total_amount, weight_u_m, volume_u_m, inventory_sts, in_trans_inv_id, closed, created, created_by, last_updated, last_updated_by, discount_price, new_transmitInfo, new_pushDate, new_state, new_system_number, new_system_primary, primary_key, business_date,business_type)
+<!-- 批量新增 -->
+<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
+  insert into tocofs_returngoods_detailed(receiptId, receiptCode, refOrderId, refOrderDetailId, sourceOrderCode, sourceLineNum, clientCode, companyCode, facilityCode, skuCode, skuName, requestQty, receivedQty, openQty, quantityUM, totalWeight, totalVolume, totalVolumeWeight, totalAmount, weightUM, volumeUM, inventorySts, inTransInvId, closed, created, createdBy, lastUpdated, lastUpdatedBy, discountPrice, mainTableId, newTransmitInfo, newPushDate, newState, newSystemNumber, newSystemPrimary, newTransmitInfo2, newPushDate2, newState2, newSystemNumber2, newSystemPrimary2, newTransmitInfo3, newPushDate3, newState3, newSystemNumber3, newSystemPrimary3, newTransmitInfo4, newPushDate4, newState4, newSystemNumber4, newSystemPrimary4, businessDate, refundedAt, businessType, def1, def2, def3, def4, def5, def6, def7, def8, def9, def10, def11, def12, def13, def14, def15, def16, def17, def18, def19, def20, def21, def22, def23, def24, def25, def26, def27, def28, def29, def30, def31, def32, def33, def34, def35, def36, def37, def38, def39, def40)
     values
     <foreach collection="entities" item="entity" separator=",">
-    (#{entity.receiptId},#{entity.receiptCode},#{entity.refOrderId},#{entity.refOrderDetailId},#{entity.sourceOrderCode},#{entity.clientCode},#{entity.companyCode},#{entity.facilityCode},#{entity.skuCode},#{entity.skuName},#{entity.requestQty},#{entity.receivedQty},#{entity.openQty},#{entity.quantityUM},#{entity.totalWeight},#{entity.totalVolume},#{entity.totalVolumeWeight},#{entity.totalAmount},#{entity.weightUM},#{entity.volumeUM},#{entity.inventorySts},#{entity.inTransInvId},#{entity.closed},#{entity.created},#{entity.createdBy},#{entity.lastUpdated},#{entity.lastUpdatedBy},#{entity.discountPrice},#{entity.newTransmitinfo},#{entity.newPushdate},#{entity.newState},#{entity.newSystemNumber},#{entity.newSystemPrimary},#{entity.primaryKey},#{entity.businessDate},#{entity.businessType})
+    (#{entity.receiptid},#{entity.receiptcode},#{entity.reforderid},#{entity.reforderdetailid},#{entity.sourceordercode},#{entity.sourcelinenum},#{entity.clientcode},#{entity.companycode},#{entity.facilitycode},#{entity.skucode},#{entity.skuname},#{entity.requestqty},#{entity.receivedqty},#{entity.openqty},#{entity.quantityum},#{entity.totalweight},#{entity.totalvolume},#{entity.totalvolumeweight},#{entity.totalamount},#{entity.weightum},#{entity.volumeum},#{entity.inventorysts},#{entity.intransinvid},#{entity.closed},#{entity.created},#{entity.createdby},#{entity.lastupdated},#{entity.lastupdatedby},#{entity.discountprice},#{entity.maintableid},#{entity.newtransmitinfo},#{entity.newpushdate},#{entity.newstate},#{entity.newsystemnumber},#{entity.newsystemprimary},#{entity.newtransmitinfo2},#{entity.newpushdate2},#{entity.newstate2},#{entity.newsystemnumber2},#{entity.newsystemprimary2},#{entity.newtransmitinfo3},#{entity.newpushdate3},#{entity.newstate3},#{entity.newsystemnumber3},#{entity.newsystemprimary3},#{entity.newtransmitinfo4},#{entity.newpushdate4},#{entity.newstate4},#{entity.newsystemnumber4},#{entity.newsystemprimary4},#{entity.businessdate},#{entity.refundedat},#{entity.businesstype},#{entity.def1},#{entity.def2},#{entity.def3},#{entity.def4},#{entity.def5},#{entity.def6},#{entity.def7},#{entity.def8},#{entity.def9},#{entity.def10},#{entity.def11},#{entity.def12},#{entity.def13},#{entity.def14},#{entity.def15},#{entity.def16},#{entity.def17},#{entity.def18},#{entity.def19},#{entity.def20},#{entity.def21},#{entity.def22},#{entity.def23},#{entity.def24},#{entity.def25},#{entity.def26},#{entity.def27},#{entity.def28},#{entity.def29},#{entity.def30},#{entity.def31},#{entity.def32},#{entity.def33},#{entity.def34},#{entity.def35},#{entity.def36},#{entity.def37},#{entity.def38},#{entity.def39},#{entity.def40})
     </foreach>
-    on duplicate key update
-    receipt_id = values(receipt_id),
-    receipt_code = values(receipt_code),
-    ref_order_id = values(ref_order_id),
-    ref_order_detail_id = values(ref_order_detail_id),
-    source_order_code = values(source_order_code),
-    client_code = values(client_code),
-    company_code = values(company_code),
-    facility_code = values(facility_code),
-    sku_code = values(sku_code),
-    sku_name = values(sku_name),
-    request_qty = values(request_qty),
-    received_qty = values(received_qty),
-    open_qty = values(open_qty),
-    quantity_u_m = values(quantity_u_m),
-    total_weight = values(total_weight),
-    total_volume = values(total_volume),
-    total_volume_weight = values(total_volume_weight),
-    total_amount = values(total_amount),
-    weight_u_m = values(weight_u_m),
-    volume_u_m = values(volume_u_m),
-    inventory_sts = values(inventory_sts),
-    in_trans_inv_id = values(in_trans_inv_id),
-    closed = values(closed),
-    created = values(created),
-    created_by = values(created_by),
-    last_updated = values(last_updated),
-    last_updated_by = values(last_updated_by),
-    discount_price = values(discount_price),
-    new_transmitInfo = values(new_transmitInfo),
-    new_pushDate = values(new_pushDate),
-    new_state = values(new_state),
-    new_system_number = values(new_system_number),
-    new_system_primary = values(new_system_primary),
-    primary_key = values(primary_key),
-    business_date = values(business_date),
-    business_type = values(business_type)
 </insert>
 
-<!--通过主键修改方法-->
+<!-- 批量新增或者修改,TOC、TOB 退货-同步基本底表数据-->
+<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
+    insert into tocofs_returngoods_detailed(id,receiptId, receiptCode, refOrderId, refOrderDetailId, sourceOrderCode, sourceLineNum, clientCode, companyCode, facilityCode, skuCode, skuName, requestQty, receivedQty, openQty, quantityUM, totalWeight, totalVolume, totalVolumeWeight, totalAmount, weightUM, volumeUM, inventorySts, inTransInvId, closed, created, createdBy, lastUpdated, lastUpdatedBy, discountPrice, mainTableId, businessDate, refundedAt, businessType)
+    values
+    <foreach collection="entities" item="entity" separator=",">
+    (#{entity.id},#{entity.receiptid},#{entity.receiptcode},#{entity.reforderid},#{entity.reforderdetailid},#{entity.sourceordercode},#{entity.sourcelinenum},#{entity.clientcode},#{entity.companycode},#{entity.facilitycode},#{entity.skucode},#{entity.skuname},#{entity.requestqty},#{entity.receivedqty},#{entity.openqty},#{entity.quantityum},#{entity.totalweight},#{entity.totalvolume},#{entity.totalvolumeweight},#{entity.totalamount},#{entity.weightum},#{entity.volumeum},#{entity.inventorysts},#{entity.intransinvid},#{entity.closed},#{entity.created},#{entity.createdby},#{entity.lastupdated},#{entity.lastupdatedby},#{entity.discountprice},#{entity.maintableid},#{entity.businessdate},#{entity.refundedat},#{entity.businesstype})
+    </foreach>
+    on duplicate key update
+    id = values(id),
+    receiptId = values(receiptId),
+    receiptCode = values(receiptCode),
+    refOrderId = values(refOrderId),
+    refOrderDetailId = values(refOrderDetailId),
+    sourceOrderCode = values(sourceOrderCode),
+    sourceLineNum = values(sourceLineNum),
+    clientCode = values(clientCode),
+    companyCode = values(companyCode),
+    facilityCode = values(facilityCode),
+    skuCode = values(skuCode),
+    skuName = values(skuName),
+    requestQty = values(requestQty),
+    receivedQty = values(receivedQty),
+    openQty = values(openQty),
+    quantityUM = values(quantityUM),
+    totalWeight = values(totalWeight),
+    totalVolume = values(totalVolume),
+    totalVolumeWeight = values(totalVolumeWeight),
+    totalAmount = values(totalAmount),
+    weightUM = values(weightUM),
+    volumeUM = values(volumeUM),
+    inventorySts = values(inventorySts),
+    inTransInvId = values(inTransInvId),
+    closed = values(closed),
+    created = values(created),
+    createdBy = values(createdBy),
+    lastUpdated = values(lastUpdated),
+    lastUpdatedBy = values(lastUpdatedBy),
+    discountPrice = values(discountPrice),
+    mainTableId = values(mainTableId),
+    businessDate = values(businessDate),
+    refundedAt = values(refundedAt),
+    businessType = values(businessType)
+</insert>
+
+<!-- 批量新增或者修改,TOC退货-库存-->
+<insert id="entityInsertOrUpdateBatchByTocRerturnStock" keyProperty="id" useGeneratedKeys="true">
+    insert into tocofs_returngoods_detailed(id,newPushDate3,newTransmitInfo3,newState3,newSystemNumber3,newSystemPrimary3)
+    values
+    <foreach collection="entities" item="entity" separator=",">
+        (#{entity.id},#{entity.newpushdate3},#{entity.newtransmitinfo3},#{newstate3},#{newsystemnumber3},#{newSystemPrimary3})
+    </foreach>
+    on duplicate key update
+    id = values(id),
+    newPushDate3 = values(newPushDate3),
+    newTransmitInfo3 = values(newTransmitInfo3),
+    newState3 = values(newState3),
+    newSystemNumber3 = values(newSystemNumber3),
+    newSystemPrimary3 = values(newSystemPrimary3)
+</insert>
+
+<!-- 批量新增或者修改,TOC退货-确认收入-->
+<insert id="entityInsertOrUpdateBatchByTocRerturnTran" keyProperty="id" useGeneratedKeys="true">
+    insert into tocofs_returngoods_detailed(id,newPushDate4,newTransmitInfo4,newState4,newSystemNumber4,newSystemPrimary4)
+    values
+    <foreach collection="entities" item="entity" separator=",">
+        (#{entity.id},#{entity.newpushdate4},#{entity.newtransmitinfo4},#{newstate4},#{newsystemnumber4},#{newsystemprimary4})
+    </foreach>
+    on duplicate key update
+    id = values(id),
+    newPushDate4 = values(newPushDate4),
+    newTransmitInfo4 = values(newTransmitInfo4),
+    newState4 = values(newState4),
+    newSystemNumber4 = values(newSystemNumber4),
+    newSystemPrimary4 = values(newSystemPrimary4)
+</insert>
+
+<!-- 批量新增或者修改,TOB退货-库存-->
+<insert id="entityInsertOrUpdateBatchByTobRerturnStock" keyProperty="id" useGeneratedKeys="true">
+    insert into tocofs_returngoods_detailed(id,newPushDate,newTransmitInfo,newState,newSystemNumber,newSystemPrimary)
+    values
+    <foreach collection="entities" item="entity" separator=",">
+        (#{entity.id},#{entity.newpushdate},#{entity.newtransmitinfo},#{newstate},#{newsystemnumber},#{newSystemPrimary})
+    </foreach>
+    on duplicate key update
+    id = values(id),
+    newPushDate = values(newPushDate),
+    newTransmitInfo = values(newTransmitInfo),
+    newState = values(newState),
+    newSystemNumber = values(newSystemNumber),
+    newSystemPrimary = values(newSystemPrimary)
+</insert>
+
+<!-- 批量新增或者修改,TOB退货-确认收入-->
+<insert id="entityInsertOrUpdateBatchByTobRerturnTran" keyProperty="id" useGeneratedKeys="true">
+    insert into tocofs_returngoods_detailed(id,newPushDate2,newTransmitInfo2,newState2,newSystemNumber2,newSystemPrimary2)
+    values
+    <foreach collection="entities" item="entity" separator=",">
+        (#{entity.id},#{entity.newpushdate2},#{entity.newtransmitinfo2},#{newstate2},#{newsystemnumber2},#{newsystemprimary2})
+    </foreach>
+    on duplicate key update
+    id = values(id),
+    newPushDate2 = values(newPushDate2),
+    newTransmitInfo2 = values(newTransmitInfo2),
+    newState2 = values(newState2),
+    newSystemNumber2 = values(newSystemNumber2),
+    newSystemPrimary2 = values(newSystemPrimary2)
+</insert>
+
+
+
+    <!--通过主键修改方法-->
 <update id="entity_update" parameterType = "com.hzya.frame.plugin.lets.ofs.entity.TocofsReturngoodsDetailedEntity" >
 update tocofs_returngoods_detailed  set
 <trim suffix="" suffixOverrides=",">
-  <if test="receiptId != null and receiptId != ''"> receipt_id = #{receiptId},</if>
-  <if test="receiptCode != null and receiptCode != ''"> receipt_code = #{receiptCode},</if>
-  <if test="refOrderId != null and refOrderId != ''"> ref_order_id = #{refOrderId},</if>
-  <if test="refOrderDetailId != null and refOrderDetailId != ''"> ref_order_detail_id = #{refOrderDetailId},</if>
-  <if test="sourceOrderCode != null and sourceOrderCode != ''"> source_order_code = #{sourceOrderCode},</if>
-  <if test="clientCode != null and clientCode != ''"> client_code = #{clientCode},</if>
-  <if test="companyCode != null and companyCode != ''"> company_code = #{companyCode},</if>
-  <if test="facilityCode != null and facilityCode != ''"> facility_code = #{facilityCode},</if>
-  <if test="skuCode != null and skuCode != ''"> sku_code = #{skuCode},</if>
-  <if test="skuName != null and skuName != ''"> sku_name = #{skuName},</if>
-  <if test="requestQty != null and requestQty != ''"> request_qty = #{requestQty},</if>
-  <if test="receivedQty != null and receivedQty != ''"> received_qty = #{receivedQty},</if>
-  <if test="openQty != null and openQty != ''"> open_qty = #{openQty},</if>
-  <if test="quantityUM != null and quantityUM != ''"> quantity_u_m = #{quantityUM},</if>
-  <if test="totalWeight != null and totalWeight != ''"> total_weight = #{totalWeight},</if>
-  <if test="totalVolume != null and totalVolume != ''"> total_volume = #{totalVolume},</if>
-  <if test="totalVolumeWeight != null and totalVolumeWeight != ''"> total_volume_weight = #{totalVolumeWeight},</if>
-  <if test="totalAmount != null and totalAmount != ''"> total_amount = #{totalAmount},</if>
-  <if test="weightUM != null and weightUM != ''"> weight_u_m = #{weightUM},</if>
-  <if test="volumeUM != null and volumeUM != ''"> volume_u_m = #{volumeUM},</if>
-  <if test="inventorySts != null and inventorySts != ''"> inventory_sts = #{inventorySts},</if>
-  <if test="inTransInvId != null and inTransInvId != ''"> in_trans_inv_id = #{inTransInvId},</if>
+  <if test="receiptid != null and receiptid != ''"> receiptId = #{receiptid},</if>
+  <if test="receiptcode != null and receiptcode != ''"> receiptCode = #{receiptcode},</if>
+  <if test="reforderid != null and reforderid != ''"> refOrderId = #{reforderid},</if>
+  <if test="reforderdetailid != null and reforderdetailid != ''"> refOrderDetailId = #{reforderdetailid},</if>
+  <if test="sourceordercode != null and sourceordercode != ''"> sourceOrderCode = #{sourceordercode},</if>
+  <if test="sourcelinenum != null and sourcelinenum != ''"> sourceLineNum = #{sourcelinenum},</if>
+  <if test="clientcode != null and clientcode != ''"> clientCode = #{clientcode},</if>
+  <if test="companycode != null and companycode != ''"> companyCode = #{companycode},</if>
+  <if test="facilitycode != null and facilitycode != ''"> facilityCode = #{facilitycode},</if>
+  <if test="skucode != null and skucode != ''"> skuCode = #{skucode},</if>
+  <if test="skuname != null and skuname != ''"> skuName = #{skuname},</if>
+  <if test="requestqty != null and requestqty != ''"> requestQty = #{requestqty},</if>
+  <if test="receivedqty != null and receivedqty != ''"> receivedQty = #{receivedqty},</if>
+  <if test="openqty != null and openqty != ''"> openQty = #{openqty},</if>
+  <if test="quantityum != null and quantityum != ''"> quantityUM = #{quantityum},</if>
+  <if test="totalweight != null and totalweight != ''"> totalWeight = #{totalweight},</if>
+  <if test="totalvolume != null and totalvolume != ''"> totalVolume = #{totalvolume},</if>
+  <if test="totalvolumeweight != null and totalvolumeweight != ''"> totalVolumeWeight = #{totalvolumeweight},</if>
+  <if test="totalamount != null and totalamount != ''"> totalAmount = #{totalamount},</if>
+  <if test="weightum != null and weightum != ''"> weightUM = #{weightum},</if>
+  <if test="volumeum != null and volumeum != ''"> volumeUM = #{volumeum},</if>
+  <if test="inventorysts != null and inventorysts != ''"> inventorySts = #{inventorysts},</if>
+  <if test="intransinvid != null and intransinvid != ''"> inTransInvId = #{intransinvid},</if>
   <if test="closed != null and closed != ''"> closed = #{closed},</if>
   <if test="created != null and created != ''"> created = #{created},</if>
-  <if test="createdBy != null and createdBy != ''"> created_by = #{createdBy},</if>
-  <if test="lastUpdated != null and lastUpdated != ''"> last_updated = #{lastUpdated},</if>
-  <if test="lastUpdatedBy != null and lastUpdatedBy != ''"> last_updated_by = #{lastUpdatedBy},</if>
-  <if test="discountPrice != null and discountPrice != ''"> discount_price = #{discountPrice},</if>
-  <if test="newTransmitinfo != null and newTransmitinfo != ''"> new_transmitInfo = #{newTransmitinfo},</if>
-  <if test="newPushdate != null and newPushdate != ''"> new_pushDate = #{newPushdate},</if>
-  <if test="newState != null and newState != ''"> new_state = #{newState},</if>
-  <if test="newSystemNumber != null and newSystemNumber != ''"> new_system_number = #{newSystemNumber},</if>
-  <if test="newSystemPrimary != null and newSystemPrimary != ''"> new_system_primary = #{newSystemPrimary},</if>
-  <if test="primaryKey != null and primaryKey != ''"> primary_key = #{primaryKey},</if>
-  <if test="businessDate != null and businessDate != ''"> business_date = #{businessDate},</if>
-  <if test="businessType != null and businessType != ''"> business_type = #{businessType}</if>
+  <if test="createdby != null and createdby != ''"> createdBy = #{createdby},</if>
+  <if test="lastupdated != null and lastupdated != ''"> lastUpdated = #{lastupdated},</if>
+  <if test="lastupdatedby != null and lastupdatedby != ''"> lastUpdatedBy = #{lastupdatedby},</if>
+  <if test="discountprice != null and discountprice != ''"> discountPrice = #{discountprice},</if>
+  <if test="maintableid != null and maintableid != ''"> mainTableId = #{maintableid},</if>
+  <if test="newtransmitinfo != null and newtransmitinfo != ''"> newTransmitInfo = #{newtransmitinfo},</if>
+  <if test="newpushdate != null and newpushdate != ''"> newPushDate = #{newpushdate},</if>
+  <if test="newstate != null and newstate != ''"> newState = #{newstate},</if>
+  <if test="newsystemnumber != null and newsystemnumber != ''"> newSystemNumber = #{newsystemnumber},</if>
+  <if test="newsystemprimary != null and newsystemprimary != ''"> newSystemPrimary = #{newsystemprimary},</if>
+  <if test="newtransmitinfo2 != null and newtransmitinfo2 != ''"> newTransmitInfo2 = #{newtransmitinfo2},</if>
+  <if test="newpushdate2 != null and newpushdate2 != ''"> newPushDate2 = #{newpushdate2},</if>
+  <if test="newstate2 != null and newstate2 != ''"> newState2 = #{newstate2},</if>
+  <if test="newsystemnumber2 != null and newsystemnumber2 != ''"> newSystemNumber2 = #{newsystemnumber2},</if>
+  <if test="newsystemprimary2 != null and newsystemprimary2 != ''"> newSystemPrimary2 = #{newsystemprimary2},</if>
+  <if test="newtransmitinfo3 != null and newtransmitinfo3 != ''"> newTransmitInfo3 = #{newtransmitinfo3},</if>
+  <if test="newpushdate3 != null and newpushdate3 != ''"> newPushDate3 = #{newpushdate3},</if>
+  <if test="newstate3 != null and newstate3 != ''"> newState3 = #{newstate3},</if>
+  <if test="newsystemnumber3 != null and newsystemnumber3 != ''"> newSystemNumber3 = #{newsystemnumber3},</if>
+  <if test="newsystemprimary3 != null and newsystemprimary3 != ''"> newSystemPrimary3 = #{newsystemprimary3},</if>
+  <if test="newtransmitinfo4 != null and newtransmitinfo4 != ''"> newTransmitInfo4 = #{newtransmitinfo4},</if>
+  <if test="newpushdate4 != null and newpushdate4 != ''"> newPushDate4 = #{newpushdate4},</if>
+  <if test="newstate4 != null and newstate4 != ''"> newState4 = #{newstate4},</if>
+  <if test="newsystemnumber4 != null and newsystemnumber4 != ''"> newSystemNumber4 = #{newsystemnumber4},</if>
+  <if test="newsystemprimary4 != null and newsystemprimary4 != ''"> newSystemPrimary4 = #{newsystemprimary4},</if>
+  <if test="businessdate != null and businessdate != ''"> businessDate = #{businessdate},</if>
+  <if test="refundedat != null and refundedat != ''"> refundedAt = #{refundedat},</if>
+  <if test="businesstype != null and businesstype != ''"> businessType = #{businesstype},</if>
+  <if test="def1 != null and def1 != ''"> def1 = #{def1},</if>
+  <if test="def2 != null and def2 != ''"> def2 = #{def2},</if>
+  <if test="def3 != null and def3 != ''"> def3 = #{def3},</if>
+  <if test="def4 != null and def4 != ''"> def4 = #{def4},</if>
+  <if test="def5 != null and def5 != ''"> def5 = #{def5},</if>
+  <if test="def6 != null and def6 != ''"> def6 = #{def6},</if>
+  <if test="def7 != null and def7 != ''"> def7 = #{def7},</if>
+  <if test="def8 != null and def8 != ''"> def8 = #{def8},</if>
+  <if test="def9 != null and def9 != ''"> def9 = #{def9},</if>
+  <if test="def10 != null and def10 != ''"> def10 = #{def10},</if>
+  <if test="def11 != null and def11 != ''"> def11 = #{def11},</if>
+  <if test="def12 != null and def12 != ''"> def12 = #{def12},</if>
+  <if test="def13 != null and def13 != ''"> def13 = #{def13},</if>
+  <if test="def14 != null and def14 != ''"> def14 = #{def14},</if>
+  <if test="def15 != null and def15 != ''"> def15 = #{def15},</if>
+  <if test="def16 != null and def16 != ''"> def16 = #{def16},</if>
+  <if test="def17 != null and def17 != ''"> def17 = #{def17},</if>
+  <if test="def18 != null and def18 != ''"> def18 = #{def18},</if>
+  <if test="def19 != null and def19 != ''"> def19 = #{def19},</if>
+  <if test="def20 != null and def20 != ''"> def20 = #{def20},</if>
+  <if test="def21 != null and def21 != ''"> def21 = #{def21},</if>
+  <if test="def22 != null and def22 != ''"> def22 = #{def22},</if>
+  <if test="def23 != null and def23 != ''"> def23 = #{def23},</if>
+  <if test="def24 != null and def24 != ''"> def24 = #{def24},</if>
+  <if test="def25 != null and def25 != ''"> def25 = #{def25},</if>
+  <if test="def26 != null and def26 != ''"> def26 = #{def26},</if>
+  <if test="def27 != null and def27 != ''"> def27 = #{def27},</if>
+  <if test="def28 != null and def28 != ''"> def28 = #{def28},</if>
+  <if test="def29 != null and def29 != ''"> def29 = #{def29},</if>
+  <if test="def30 != null and def30 != ''"> def30 = #{def30},</if>
+  <if test="def31 != null and def31 != ''"> def31 = #{def31},</if>
+  <if test="def32 != null and def32 != ''"> def32 = #{def32},</if>
+  <if test="def33 != null and def33 != ''"> def33 = #{def33},</if>
+  <if test="def34 != null and def34 != ''"> def34 = #{def34},</if>
+  <if test="def35 != null and def35 != ''"> def35 = #{def35},</if>
+  <if test="def36 != null and def36 != ''"> def36 = #{def36},</if>
+  <if test="def37 != null and def37 != ''"> def37 = #{def37},</if>
+  <if test="def38 != null and def38 != ''"> def38 = #{def38},</if>
+  <if test="def39 != null and def39 != ''"> def39 = #{def39},</if>
+  <if test="def40 != null and def40 != ''"> def40 = #{def40},</if>
 </trim>
 where id = #{id}
 </update>
-
 <!-- 逻辑删除 -->
 <update id="entity_logicDelete" parameterType = "com.hzya.frame.plugin.lets.ofs.entity.TocofsReturngoodsDetailedEntity" >
 update tocofs_returngoods_detailed  set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
 where id = #{id}
 </update>
-
 <!-- 多条件逻辑删除 -->
 <update id="entity_logicDelete_Multi_Condition" parameterType = "com.hzya.frame.plugin.lets.ofs.entity.TocofsReturngoodsDetailedEntity" >
 update tocofs_returngoods_detailed  set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
  <trim prefix="where" prefixOverrides="and"> 
         <if test="id != null and id != ''"> and id = #{id} </if>
-            <if test="receiptId != null and receiptId != ''"> and receipt_id = #{receiptId} </if>
-            <if test="receiptCode != null and receiptCode != ''"> and receipt_code = #{receiptCode} </if>
-            <if test="refOrderId != null and refOrderId != ''"> and ref_order_id = #{refOrderId} </if>
-            <if test="refOrderDetailId != null and refOrderDetailId != ''"> and ref_order_detail_id = #{refOrderDetailId} </if>
-            <if test="sourceOrderCode != null and sourceOrderCode != ''"> and source_order_code = #{sourceOrderCode} </if>
-            <if test="clientCode != null and clientCode != ''"> and client_code = #{clientCode} </if>
-            <if test="companyCode != null and companyCode != ''"> and company_code = #{companyCode} </if>
-            <if test="facilityCode != null and facilityCode != ''"> and facility_code = #{facilityCode} </if>
-            <if test="skuCode != null and skuCode != ''"> and sku_code = #{skuCode} </if>
-            <if test="skuName != null and skuName != ''"> and sku_name = #{skuName} </if>
-            <if test="requestQty != null and requestQty != ''"> and request_qty = #{requestQty} </if>
-            <if test="receivedQty != null and receivedQty != ''"> and received_qty = #{receivedQty} </if>
-            <if test="openQty != null and openQty != ''"> and open_qty = #{openQty} </if>
-            <if test="quantityUM != null and quantityUM != ''"> and quantity_u_m = #{quantityUM} </if>
-            <if test="totalWeight != null and totalWeight != ''"> and total_weight = #{totalWeight} </if>
-            <if test="totalVolume != null and totalVolume != ''"> and total_volume = #{totalVolume} </if>
-            <if test="totalVolumeWeight != null and totalVolumeWeight != ''"> and total_volume_weight = #{totalVolumeWeight} </if>
-            <if test="totalAmount != null and totalAmount != ''"> and total_amount = #{totalAmount} </if>
-            <if test="weightUM != null and weightUM != ''"> and weight_u_m = #{weightUM} </if>
-            <if test="volumeUM != null and volumeUM != ''"> and volume_u_m = #{volumeUM} </if>
-            <if test="inventorySts != null and inventorySts != ''"> and inventory_sts = #{inventorySts} </if>
-            <if test="inTransInvId != null and inTransInvId != ''"> and in_trans_inv_id = #{inTransInvId} </if>
+            <if test="receiptid != null and receiptid != ''"> and receiptId = #{receiptid} </if>
+            <if test="receiptcode != null and receiptcode != ''"> and receiptCode = #{receiptcode} </if>
+            <if test="reforderid != null and reforderid != ''"> and refOrderId = #{reforderid} </if>
+            <if test="reforderdetailid != null and reforderdetailid != ''"> and refOrderDetailId = #{reforderdetailid} </if>
+            <if test="sourceordercode != null and sourceordercode != ''"> and sourceOrderCode = #{sourceordercode} </if>
+            <if test="sourcelinenum != null and sourcelinenum != ''"> and sourceLineNum = #{sourcelinenum} </if>
+            <if test="clientcode != null and clientcode != ''"> and clientCode = #{clientcode} </if>
+            <if test="companycode != null and companycode != ''"> and companyCode = #{companycode} </if>
+            <if test="facilitycode != null and facilitycode != ''"> and facilityCode = #{facilitycode} </if>
+            <if test="skucode != null and skucode != ''"> and skuCode = #{skucode} </if>
+            <if test="skuname != null and skuname != ''"> and skuName = #{skuname} </if>
+            <if test="requestqty != null and requestqty != ''"> and requestQty = #{requestqty} </if>
+            <if test="receivedqty != null and receivedqty != ''"> and receivedQty = #{receivedqty} </if>
+            <if test="openqty != null and openqty != ''"> and openQty = #{openqty} </if>
+            <if test="quantityum != null and quantityum != ''"> and quantityUM = #{quantityum} </if>
+            <if test="totalweight != null and totalweight != ''"> and totalWeight = #{totalweight} </if>
+            <if test="totalvolume != null and totalvolume != ''"> and totalVolume = #{totalvolume} </if>
+            <if test="totalvolumeweight != null and totalvolumeweight != ''"> and totalVolumeWeight = #{totalvolumeweight} </if>
+            <if test="totalamount != null and totalamount != ''"> and totalAmount = #{totalamount} </if>
+            <if test="weightum != null and weightum != ''"> and weightUM = #{weightum} </if>
+            <if test="volumeum != null and volumeum != ''"> and volumeUM = #{volumeum} </if>
+            <if test="inventorysts != null and inventorysts != ''"> and inventorySts = #{inventorysts} </if>
+            <if test="intransinvid != null and intransinvid != ''"> and inTransInvId = #{intransinvid} </if>
             <if test="closed != null and closed != ''"> and closed = #{closed} </if>
             <if test="created != null and created != ''"> and created = #{created} </if>
-            <if test="createdBy != null and createdBy != ''"> and created_by = #{createdBy} </if>
-            <if test="lastUpdated != null and lastUpdated != ''"> and last_updated = #{lastUpdated} </if>
-            <if test="lastUpdatedBy != null and lastUpdatedBy != ''"> and last_updated_by = #{lastUpdatedBy} </if>
-            <if test="discountPrice != null and discountPrice != ''"> and discount_price = #{discountPrice} </if>
-            <if test="newTransmitinfo != null and newTransmitinfo != ''"> and new_transmitInfo = #{newTransmitinfo} </if>
-            <if test="newPushdate != null and newPushdate != ''"> and new_pushDate = #{newPushdate} </if>
-            <if test="newState != null and newState != ''"> and new_state = #{newState} </if>
-            <if test="newSystemNumber != null and newSystemNumber != ''"> and new_system_number = #{newSystemNumber} </if>
-            <if test="newSystemPrimary != null and newSystemPrimary != ''"> and new_system_primary = #{newSystemPrimary} </if>
-            <if test="primaryKey != null and primaryKey != ''"> and primary_key = #{primaryKey} </if>
-            <if test="businessDate != null and businessDate != ''"> and business_date = #{businessDate} </if>
-            <if test="businessType != null and businessType != ''"> and business_type = #{businessType} </if>
+            <if test="createdby != null and createdby != ''"> and createdBy = #{createdby} </if>
+            <if test="lastupdated != null and lastupdated != ''"> and lastUpdated = #{lastupdated} </if>
+            <if test="lastupdatedby != null and lastupdatedby != ''"> and lastUpdatedBy = #{lastupdatedby} </if>
+            <if test="discountprice != null and discountprice != ''"> and discountPrice = #{discountprice} </if>
+            <if test="maintableid != null and maintableid != ''"> and mainTableId = #{maintableid} </if>
+            <if test="newtransmitinfo != null and newtransmitinfo != ''"> and newTransmitInfo = #{newtransmitinfo} </if>
+            <if test="newpushdate != null and newpushdate != ''"> and newPushDate = #{newpushdate} </if>
+            <if test="newstate != null and newstate != ''"> and newState = #{newstate} </if>
+            <if test="newsystemnumber != null and newsystemnumber != ''"> and newSystemNumber = #{newsystemnumber} </if>
+            <if test="newsystemprimary != null and newsystemprimary != ''"> and newSystemPrimary = #{newsystemprimary} </if>
+            <if test="newtransmitinfo2 != null and newtransmitinfo2 != ''"> and newTransmitInfo2 = #{newtransmitinfo2} </if>
+            <if test="newpushdate2 != null and newpushdate2 != ''"> and newPushDate2 = #{newpushdate2} </if>
+            <if test="newstate2 != null and newstate2 != ''"> and newState2 = #{newstate2} </if>
+            <if test="newsystemnumber2 != null and newsystemnumber2 != ''"> and newSystemNumber2 = #{newsystemnumber2} </if>
+            <if test="newsystemprimary2 != null and newsystemprimary2 != ''"> and newSystemPrimary2 = #{newsystemprimary2} </if>
+            <if test="newtransmitinfo3 != null and newtransmitinfo3 != ''"> and newTransmitInfo3 = #{newtransmitinfo3} </if>
+            <if test="newpushdate3 != null and newpushdate3 != ''"> and newPushDate3 = #{newpushdate3} </if>
+            <if test="newstate3 != null and newstate3 != ''"> and newState3 = #{newstate3} </if>
+            <if test="newsystemnumber3 != null and newsystemnumber3 != ''"> and newSystemNumber3 = #{newsystemnumber3} </if>
+            <if test="newsystemprimary3 != null and newsystemprimary3 != ''"> and newSystemPrimary3 = #{newsystemprimary3} </if>
+            <if test="newtransmitinfo4 != null and newtransmitinfo4 != ''"> and newTransmitInfo4 = #{newtransmitinfo4} </if>
+            <if test="newpushdate4 != null and newpushdate4 != ''"> and newPushDate4 = #{newpushdate4} </if>
+            <if test="newstate4 != null and newstate4 != ''"> and newState4 = #{newstate4} </if>
+            <if test="newsystemnumber4 != null and newsystemnumber4 != ''"> and newSystemNumber4 = #{newsystemnumber4} </if>
+            <if test="newsystemprimary4 != null and newsystemprimary4 != ''"> and newSystemPrimary4 = #{newsystemprimary4} </if>
+            <if test="businessdate != null and businessdate != ''"> and businessDate = #{businessdate} </if>
+            <if test="refundedat != null and refundedat != ''"> and refundedAt = #{refundedat} </if>
+            <if test="businesstype != null and businesstype != ''"> and businessType = #{businesstype} </if>
+            <if test="def1 != null and def1 != ''"> and def1 = #{def1} </if>
+            <if test="def2 != null and def2 != ''"> and def2 = #{def2} </if>
+            <if test="def3 != null and def3 != ''"> and def3 = #{def3} </if>
+            <if test="def4 != null and def4 != ''"> and def4 = #{def4} </if>
+            <if test="def5 != null and def5 != ''"> and def5 = #{def5} </if>
+            <if test="def6 != null and def6 != ''"> and def6 = #{def6} </if>
+            <if test="def7 != null and def7 != ''"> and def7 = #{def7} </if>
+            <if test="def8 != null and def8 != ''"> and def8 = #{def8} </if>
+            <if test="def9 != null and def9 != ''"> and def9 = #{def9} </if>
+            <if test="def10 != null and def10 != ''"> and def10 = #{def10} </if>
+            <if test="def11 != null and def11 != ''"> and def11 = #{def11} </if>
+            <if test="def12 != null and def12 != ''"> and def12 = #{def12} </if>
+            <if test="def13 != null and def13 != ''"> and def13 = #{def13} </if>
+            <if test="def14 != null and def14 != ''"> and def14 = #{def14} </if>
+            <if test="def15 != null and def15 != ''"> and def15 = #{def15} </if>
+            <if test="def16 != null and def16 != ''"> and def16 = #{def16} </if>
+            <if test="def17 != null and def17 != ''"> and def17 = #{def17} </if>
+            <if test="def18 != null and def18 != ''"> and def18 = #{def18} </if>
+            <if test="def19 != null and def19 != ''"> and def19 = #{def19} </if>
+            <if test="def20 != null and def20 != ''"> and def20 = #{def20} </if>
+            <if test="def21 != null and def21 != ''"> and def21 = #{def21} </if>
+            <if test="def22 != null and def22 != ''"> and def22 = #{def22} </if>
+            <if test="def23 != null and def23 != ''"> and def23 = #{def23} </if>
+            <if test="def24 != null and def24 != ''"> and def24 = #{def24} </if>
+            <if test="def25 != null and def25 != ''"> and def25 = #{def25} </if>
+            <if test="def26 != null and def26 != ''"> and def26 = #{def26} </if>
+            <if test="def27 != null and def27 != ''"> and def27 = #{def27} </if>
+            <if test="def28 != null and def28 != ''"> and def28 = #{def28} </if>
+            <if test="def29 != null and def29 != ''"> and def29 = #{def29} </if>
+            <if test="def30 != null and def30 != ''"> and def30 = #{def30} </if>
+            <if test="def31 != null and def31 != ''"> and def31 = #{def31} </if>
+            <if test="def32 != null and def32 != ''"> and def32 = #{def32} </if>
+            <if test="def33 != null and def33 != ''"> and def33 = #{def33} </if>
+            <if test="def34 != null and def34 != ''"> and def34 = #{def34} </if>
+            <if test="def35 != null and def35 != ''"> and def35 = #{def35} </if>
+            <if test="def36 != null and def36 != ''"> and def36 = #{def36} </if>
+            <if test="def37 != null and def37 != ''"> and def37 = #{def37} </if>
+            <if test="def38 != null and def38 != ''"> and def38 = #{def38} </if>
+            <if test="def39 != null and def39 != ''"> and def39 = #{def39} </if>
+            <if test="def40 != null and def40 != ''"> and def40 = #{def40} </if>
             and sts='Y'
     </trim>
 </update>
-
 <!--通过主键删除-->
 <delete id="entity_delete">
     delete from tocofs_returngoods_detailed where id = #{id}
diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/entity/TocofsReturngoodsEntity.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/entity/TocofsReturngoodsEntity.java
index 3931856f..5cbf5d1a 100644
--- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/entity/TocofsReturngoodsEntity.java
+++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/entity/TocofsReturngoodsEntity.java
@@ -1,30 +1,32 @@
 package com.hzya.frame.plugin.lets.ofs.entity;
 
 import com.hzya.frame.web.entity.BaseEntity;
+import lombok.Data;
 
 /**
  * OFS售后入库单(TocofsReturngoods)实体类
  *
  * @author makejava
- * @since 2024-08-09 11:08:40
+ * @since 2024-09-13 11:58:10
  */
+@Data
 public class TocofsReturngoodsEntity extends BaseEntity {
     /**
      * LETS
      */
-    private String clientCode;
+    private String clientcode;
     /**
      * SHLZ
      */
-    private String companyCode;
+    private String companycode;
     /**
      * tm-intoyou
      */
-    private String storeCode;
+    private String storecode;
     /**
      * intoyou-tmxs
      */
-    private String facilityCode;
+    private String facilitycode;
     /**
      * LETS-RE2024071600000001
      */
@@ -32,23 +34,23 @@ public class TocofsReturngoodsEntity extends BaseEntity {
     /**
      * RETURN
      */
-    private String internalInstructionType;
+    private String internalinstructiontype;
     /**
      * B2C
      */
-    private String bizChannel;
+    private String bizchannel;
     /**
      * 128
      */
-    private String refOrderId;
+    private String reforderid;
     /**
      * LETS-RO2024071600000001
      */
-    private String refOrderCode;
+    private String refordercode;
     /**
      * RETURN
      */
-    private String refOrderType;
+    private String refordertype;
     /**
      * 1
      */
@@ -56,7 +58,7 @@ public class TocofsReturngoodsEntity extends BaseEntity {
     /**
      * api
      */
-    private String closedBy;
+    private String closedby;
     /**
      * 900
      */
@@ -64,540 +66,69 @@ public class TocofsReturngoodsEntity extends BaseEntity {
     /**
      * 0
      */
-    private String allowOverReceive;
+    private String allowoverreceive;
     /**
      * 张三
      */
-    private String shipFromAttentionTo;
+    private String shipfromattentionto;
     /**
      * 测试售后流程
      */
-    private String shipFromAddress;
+    private String shipfromaddress;
     /**
      * 中国
      */
-    private String shipFromCountry;
+    private String shipfromcountry;
     /**
      * 上海市
      */
-    private String shipFromState;
+    private String shipfromstate;
     /**
      * 上海市
      */
-    private String shipFromCity;
+    private String shipfromcity;
     /**
      * 金山区
      */
-    private String shipFromDistrict;
+    private String shipfromdistrict;
     /**
      * 17878787878
      */
-    private String shipFromMobile;
-    /**
-     * 2
-     */
-    private String totalLines;
-    /**
-     * 4
-     */
-    private String totalQty;
-    /**
-     * 236
-     */
-    private String totalAmount;
-    /**
-     * 0
-     */
-    private String totalWeight;
-    /**
-     * 0
-     */
-    private String totalVolume;
-    /**
-     * 0
-     */
-    private String totalVolumeWeight;
-    /**
-     * 236
-     */
-    private String totalFulfillAmount;
-    /**
-     * 0
-     */
-    private String totalFulfillWeight;
-    /**
-     * 0
-     */
-    private String totalFulfillVolume;
-    /**
-     * 0
-     */
-    private String totalFulfillVolumeWeight;
-    /**
-     * 4
-     */
-    private String totalFulfillQty;
-    /**
-     * 0
-     */
-    private String totalCases;
-    /**
-     * 0
-     */
-    private String totalContainers;
-    /**
-     * 0
-     */
-    private String closeAtQty;
-    /**
-     * EA
-     */
-    private String quantityUM;
-    /**
-     * G
-     */
-    private String weightUM;
-    /**
-     * CM3
-     */
-    private String volumeUM;
-    /**
-     * 2024-07-16 16:44:00
-     */
-    private String checkInFrom;
-    /**
-     * 2024-07-16 16:44:01
-     */
-    private String checkInTo;
-    /**
-     * 2024-07-16 16:44:01
-     */
-    private String closedAt;
-    /**
-     * OFS
-     */
-    private String sourcePlatformCode;
-    /**
-     * LETS-SO2024070500000001
-     */
-    private String sourceOrderCode;
+    private String shipfrompostalcode;
+    private String shipfrommobile;
+    private String shipfromemail;
+    private String totallines;
+    private String totalqty;
+    private String totalamount;
+    private String totalweight;
+    private String totalvolume;
+    private String totalvolumeweight;
+    private String totalfulfillamount;
+    private String totalfulfillweight;
+    private String totalfulfillvolume;
+    private String totalfulfillvolumeweight;
+    private String totalfulfillqty;
+    private String totalcases;
+    private String totalcontainers;
+    private String closeatqty;
+    private String quantityum;
+    private String weightum;
+    private String volumeum;
+    private String checkinfrom;
+    private String checkinto;
+    private String closedat;
+    private String sourceplatformcode;
+    private String sourceordercode;
     /**
      * 2024-07-16 15:35:36
      */
     private String created;
-    /**
-     * admin
-     */
-    private String createdBy;
-    /**
-     * 2024-07-16 16:44:01
-     */
-    private String lastUpdated;
-    /**
-     * api
-     */
-    private String lastUpdatedBy;
-    /**
-     * YT7478903028607
-     */
-    private String returnWaybillCode;
-    /**
-     * YTO
-     */
-    private String returnCarrier;
-
-
-    public String getClientCode() {
-        return clientCode;
-    }
-
-    public void setClientCode(String clientCode) {
-        this.clientCode = clientCode;
-    }
-
-    public String getCompanyCode() {
-        return companyCode;
-    }
-
-    public void setCompanyCode(String companyCode) {
-        this.companyCode = companyCode;
-    }
-
-    public String getStoreCode() {
-        return storeCode;
-    }
-
-    public void setStoreCode(String storeCode) {
-        this.storeCode = storeCode;
-    }
-
-    public String getFacilityCode() {
-        return facilityCode;
-    }
-
-    public void setFacilityCode(String facilityCode) {
-        this.facilityCode = facilityCode;
-    }
-
-    public String getCode() {
-        return code;
-    }
-
-    public void setCode(String code) {
-        this.code = code;
-    }
-
-    public String getInternalInstructionType() {
-        return internalInstructionType;
-    }
-
-    public void setInternalInstructionType(String internalInstructionType) {
-        this.internalInstructionType = internalInstructionType;
-    }
-
-    public String getBizChannel() {
-        return bizChannel;
-    }
-
-    public void setBizChannel(String bizChannel) {
-        this.bizChannel = bizChannel;
-    }
-
-    public String getRefOrderId() {
-        return refOrderId;
-    }
-
-    public void setRefOrderId(String refOrderId) {
-        this.refOrderId = refOrderId;
-    }
-
-    public String getRefOrderCode() {
-        return refOrderCode;
-    }
-
-    public void setRefOrderCode(String refOrderCode) {
-        this.refOrderCode = refOrderCode;
-    }
-
-    public String getRefOrderType() {
-        return refOrderType;
-    }
-
-    public void setRefOrderType(String refOrderType) {
-        this.refOrderType = refOrderType;
-    }
-
-    public String getClosed() {
-        return closed;
-    }
-
-    public void setClosed(String closed) {
-        this.closed = closed;
-    }
-
-    public String getClosedBy() {
-        return closedBy;
-    }
-
-    public void setClosedBy(String closedBy) {
-        this.closedBy = closedBy;
-    }
-
-    public String getStatus() {
-        return status;
-    }
-
-    public void setStatus(String status) {
-        this.status = status;
-    }
-
-    public String getAllowOverReceive() {
-        return allowOverReceive;
-    }
-
-    public void setAllowOverReceive(String allowOverReceive) {
-        this.allowOverReceive = allowOverReceive;
-    }
-
-    public String getShipFromAttentionTo() {
-        return shipFromAttentionTo;
-    }
-
-    public void setShipFromAttentionTo(String shipFromAttentionTo) {
-        this.shipFromAttentionTo = shipFromAttentionTo;
-    }
-
-    public String getShipFromAddress() {
-        return shipFromAddress;
-    }
-
-    public void setShipFromAddress(String shipFromAddress) {
-        this.shipFromAddress = shipFromAddress;
-    }
-
-    public String getShipFromCountry() {
-        return shipFromCountry;
-    }
-
-    public void setShipFromCountry(String shipFromCountry) {
-        this.shipFromCountry = shipFromCountry;
-    }
-
-    public String getShipFromState() {
-        return shipFromState;
-    }
-
-    public void setShipFromState(String shipFromState) {
-        this.shipFromState = shipFromState;
-    }
-
-    public String getShipFromCity() {
-        return shipFromCity;
-    }
-
-    public void setShipFromCity(String shipFromCity) {
-        this.shipFromCity = shipFromCity;
-    }
-
-    public String getShipFromDistrict() {
-        return shipFromDistrict;
-    }
-
-    public void setShipFromDistrict(String shipFromDistrict) {
-        this.shipFromDistrict = shipFromDistrict;
-    }
-
-    public String getShipFromMobile() {
-        return shipFromMobile;
-    }
-
-    public void setShipFromMobile(String shipFromMobile) {
-        this.shipFromMobile = shipFromMobile;
-    }
-
-    public String getTotalLines() {
-        return totalLines;
-    }
-
-    public void setTotalLines(String totalLines) {
-        this.totalLines = totalLines;
-    }
-
-    public String getTotalQty() {
-        return totalQty;
-    }
-
-    public void setTotalQty(String totalQty) {
-        this.totalQty = totalQty;
-    }
-
-    public String getTotalAmount() {
-        return totalAmount;
-    }
-
-    public void setTotalAmount(String totalAmount) {
-        this.totalAmount = totalAmount;
-    }
-
-    public String getTotalWeight() {
-        return totalWeight;
-    }
-
-    public void setTotalWeight(String totalWeight) {
-        this.totalWeight = totalWeight;
-    }
-
-    public String getTotalVolume() {
-        return totalVolume;
-    }
-
-    public void setTotalVolume(String totalVolume) {
-        this.totalVolume = totalVolume;
-    }
-
-    public String getTotalVolumeWeight() {
-        return totalVolumeWeight;
-    }
-
-    public void setTotalVolumeWeight(String totalVolumeWeight) {
-        this.totalVolumeWeight = totalVolumeWeight;
-    }
-
-    public String getTotalFulfillAmount() {
-        return totalFulfillAmount;
-    }
-
-    public void setTotalFulfillAmount(String totalFulfillAmount) {
-        this.totalFulfillAmount = totalFulfillAmount;
-    }
-
-    public String getTotalFulfillWeight() {
-        return totalFulfillWeight;
-    }
-
-    public void setTotalFulfillWeight(String totalFulfillWeight) {
-        this.totalFulfillWeight = totalFulfillWeight;
-    }
-
-    public String getTotalFulfillVolume() {
-        return totalFulfillVolume;
-    }
-
-    public void setTotalFulfillVolume(String totalFulfillVolume) {
-        this.totalFulfillVolume = totalFulfillVolume;
-    }
-
-    public String getTotalFulfillVolumeWeight() {
-        return totalFulfillVolumeWeight;
-    }
-
-    public void setTotalFulfillVolumeWeight(String totalFulfillVolumeWeight) {
-        this.totalFulfillVolumeWeight = totalFulfillVolumeWeight;
-    }
-
-    public String getTotalFulfillQty() {
-        return totalFulfillQty;
-    }
-
-    public void setTotalFulfillQty(String totalFulfillQty) {
-        this.totalFulfillQty = totalFulfillQty;
-    }
-
-    public String getTotalCases() {
-        return totalCases;
-    }
-
-    public void setTotalCases(String totalCases) {
-        this.totalCases = totalCases;
-    }
-
-    public String getTotalContainers() {
-        return totalContainers;
-    }
-
-    public void setTotalContainers(String totalContainers) {
-        this.totalContainers = totalContainers;
-    }
-
-    public String getCloseAtQty() {
-        return closeAtQty;
-    }
-
-    public void setCloseAtQty(String closeAtQty) {
-        this.closeAtQty = closeAtQty;
-    }
-
-    public String getQuantityUM() {
-        return quantityUM;
-    }
-
-    public void setQuantityUM(String quantityUM) {
-        this.quantityUM = quantityUM;
-    }
-
-    public String getWeightUM() {
-        return weightUM;
-    }
-
-    public void setWeightUM(String weightUM) {
-        this.weightUM = weightUM;
-    }
-
-    public String getVolumeUM() {
-        return volumeUM;
-    }
-
-    public void setVolumeUM(String volumeUM) {
-        this.volumeUM = volumeUM;
-    }
-
-    public String getCheckInFrom() {
-        return checkInFrom;
-    }
-
-    public void setCheckInFrom(String checkInFrom) {
-        this.checkInFrom = checkInFrom;
-    }
-
-    public String getCheckInTo() {
-        return checkInTo;
-    }
-
-    public void setCheckInTo(String checkInTo) {
-        this.checkInTo = checkInTo;
-    }
-
-    public String getClosedAt() {
-        return closedAt;
-    }
-
-    public void setClosedAt(String closedAt) {
-        this.closedAt = closedAt;
-    }
-
-    public String getSourcePlatformCode() {
-        return sourcePlatformCode;
-    }
-
-    public void setSourcePlatformCode(String sourcePlatformCode) {
-        this.sourcePlatformCode = sourcePlatformCode;
-    }
-
-    public String getSourceOrderCode() {
-        return sourceOrderCode;
-    }
-
-    public void setSourceOrderCode(String sourceOrderCode) {
-        this.sourceOrderCode = sourceOrderCode;
-    }
-
-    public String getCreated() {
-        return created;
-    }
-
-    public void setCreated(String created) {
-        this.created = created;
-    }
-
-    public String getCreatedBy() {
-        return createdBy;
-    }
-
-    public void setCreatedBy(String createdBy) {
-        this.createdBy = createdBy;
-    }
-
-    public String getLastUpdated() {
-        return lastUpdated;
-    }
-
-    public void setLastUpdated(String lastUpdated) {
-        this.lastUpdated = lastUpdated;
-    }
-
-    public String getLastUpdatedBy() {
-        return lastUpdatedBy;
-    }
-
-    public void setLastUpdatedBy(String lastUpdatedBy) {
-        this.lastUpdatedBy = lastUpdatedBy;
-    }
-
-    public String getReturnWaybillCode() {
-        return returnWaybillCode;
-    }
-
-    public void setReturnWaybillCode(String returnWaybillCode) {
-        this.returnWaybillCode = returnWaybillCode;
-    }
-
-    public String getReturnCarrier() {
-        return returnCarrier;
-    }
-
-    public void setReturnCarrier(String returnCarrier) {
-        this.returnCarrier = returnCarrier;
-    }
-
+    private String createdby;
+    private String lastupdated;
+    private String lastupdatedby;
+    private String returnwaybillcode;
+    private String returncarrier;
+    private String refundedat;
+    private String refundstatus;
 }
 
diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/entity/TocofsReturngoodsEntity.xml b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/entity/TocofsReturngoodsEntity.xml
index fdb6a6af..fa810a5c 100644
--- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/entity/TocofsReturngoodsEntity.xml
+++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/ofs/entity/TocofsReturngoodsEntity.xml
@@ -4,108 +4,117 @@
 
     <resultMap id="get-TocofsReturngoodsEntity-result" type="com.hzya.frame.plugin.lets.ofs.entity.TocofsReturngoodsEntity" >
        <result property="id" column="id" jdbcType="VARCHAR"/>
-           <result property="clientCode" column="client_code" jdbcType="VARCHAR"/>
-           <result property="companyCode" column="company_code" jdbcType="VARCHAR"/>
-           <result property="storeCode" column="store_code" jdbcType="VARCHAR"/>
-           <result property="facilityCode" column="facility_code" jdbcType="VARCHAR"/>
+           <result property="clientcode" column="clientCode" jdbcType="VARCHAR"/>
+           <result property="companycode" column="companyCode" jdbcType="VARCHAR"/>
+           <result property="storecode" column="storeCode" jdbcType="VARCHAR"/>
+           <result property="facilitycode" column="facilityCode" jdbcType="VARCHAR"/>
            <result property="code" column="code" jdbcType="VARCHAR"/>
-           <result property="internalInstructionType" column="internal_instruction_type" jdbcType="VARCHAR"/>
-           <result property="bizChannel" column="biz_channel" jdbcType="VARCHAR"/>
-           <result property="refOrderId" column="ref_order_id" jdbcType="VARCHAR"/>
-           <result property="refOrderCode" column="ref_order_code" jdbcType="VARCHAR"/>
-           <result property="refOrderType" column="ref_order_type" jdbcType="VARCHAR"/>
+           <result property="internalinstructiontype" column="internalInstructionType" jdbcType="VARCHAR"/>
+           <result property="bizchannel" column="bizChannel" jdbcType="VARCHAR"/>
+           <result property="reforderid" column="refOrderId" jdbcType="VARCHAR"/>
+           <result property="refordercode" column="refOrderCode" jdbcType="VARCHAR"/>
+           <result property="refordertype" column="refOrderType" jdbcType="VARCHAR"/>
            <result property="closed" column="closed" jdbcType="VARCHAR"/>
-           <result property="closedBy" column="closed_by" jdbcType="VARCHAR"/>
+           <result property="closedby" column="closedBy" jdbcType="VARCHAR"/>
            <result property="status" column="status" jdbcType="VARCHAR"/>
-           <result property="allowOverReceive" column="allow_over_receive" jdbcType="VARCHAR"/>
-           <result property="shipFromAttentionTo" column="ship_from_attention_to" jdbcType="VARCHAR"/>
-           <result property="shipFromAddress" column="ship_from_address" jdbcType="VARCHAR"/>
-           <result property="shipFromCountry" column="ship_from_country" jdbcType="VARCHAR"/>
-           <result property="shipFromState" column="ship_from_state" jdbcType="VARCHAR"/>
-           <result property="shipFromCity" column="ship_from_city" jdbcType="VARCHAR"/>
-           <result property="shipFromDistrict" column="ship_from_district" jdbcType="VARCHAR"/>
-           <result property="shipFromMobile" column="ship_from_mobile" jdbcType="VARCHAR"/>
-           <result property="totalLines" column="total_lines" jdbcType="VARCHAR"/>
-           <result property="totalQty" column="total_qty" jdbcType="VARCHAR"/>
-           <result property="totalAmount" column="total_amount" jdbcType="VARCHAR"/>
-           <result property="totalWeight" column="total_weight" jdbcType="VARCHAR"/>
-           <result property="totalVolume" column="total_volume" jdbcType="VARCHAR"/>
-           <result property="totalVolumeWeight" column="total_volume_weight" jdbcType="VARCHAR"/>
-           <result property="totalFulfillAmount" column="total_fulfill_amount" jdbcType="VARCHAR"/>
-           <result property="totalFulfillWeight" column="total_fulfill_weight" jdbcType="VARCHAR"/>
-           <result property="totalFulfillVolume" column="total_fulfill_volume" jdbcType="VARCHAR"/>
-           <result property="totalFulfillVolumeWeight" column="total_fulfill_volume_weight" jdbcType="VARCHAR"/>
-           <result property="totalFulfillQty" column="total_fulfill_qty" jdbcType="VARCHAR"/>
-           <result property="totalCases" column="total_cases" jdbcType="VARCHAR"/>
-           <result property="totalContainers" column="total_containers" jdbcType="VARCHAR"/>
-           <result property="closeAtQty" column="close_at_qty" jdbcType="VARCHAR"/>
-           <result property="quantityUM" column="quantity_u_m" jdbcType="VARCHAR"/>
-           <result property="weightUM" column="weight_u_m" jdbcType="VARCHAR"/>
-           <result property="volumeUM" column="volume_u_m" jdbcType="VARCHAR"/>
-           <result property="checkInFrom" column="check_in_from" jdbcType="VARCHAR"/>
-           <result property="checkInTo" column="check_in_to" jdbcType="VARCHAR"/>
-           <result property="closedAt" column="closed_at" jdbcType="VARCHAR"/>
-           <result property="sourcePlatformCode" column="source_platform_code" jdbcType="VARCHAR"/>
-           <result property="sourceOrderCode" column="source_order_code" jdbcType="VARCHAR"/>
+           <result property="allowoverreceive" column="allowOverReceive" jdbcType="VARCHAR"/>
+           <result property="shipfromattentionto" column="shipFromAttentionTo" jdbcType="VARCHAR"/>
+           <result property="shipfromaddress" column="shipFromAddress" jdbcType="VARCHAR"/>
+           <result property="shipfromcountry" column="shipFromCountry" jdbcType="VARCHAR"/>
+           <result property="shipfromstate" column="shipFromState" jdbcType="VARCHAR"/>
+           <result property="shipfromcity" column="shipFromCity" jdbcType="VARCHAR"/>
+           <result property="shipfromdistrict" column="shipFromDistrict" jdbcType="VARCHAR"/>
+           <result property="shipfrompostalcode" column="shipFromPostalCode" jdbcType="VARCHAR"/>
+           <result property="shipfrommobile" column="shipFromMobile" jdbcType="VARCHAR"/>
+           <result property="shipfromemail" column="shipFromEmail" jdbcType="VARCHAR"/>
+           <result property="totallines" column="totalLines" jdbcType="VARCHAR"/>
+           <result property="totalqty" column="totalQty" jdbcType="VARCHAR"/>
+           <result property="totalamount" column="totalAmount" jdbcType="VARCHAR"/>
+           <result property="totalweight" column="totalWeight" jdbcType="VARCHAR"/>
+           <result property="totalvolume" column="totalVolume" jdbcType="VARCHAR"/>
+           <result property="totalvolumeweight" column="totalVolumeWeight" jdbcType="VARCHAR"/>
+           <result property="totalfulfillamount" column="totalFulfillAmount" jdbcType="VARCHAR"/>
+           <result property="totalfulfillweight" column="totalFulfillWeight" jdbcType="VARCHAR"/>
+           <result property="totalfulfillvolume" column="totalFulfillVolume" jdbcType="VARCHAR"/>
+           <result property="totalfulfillvolumeweight" column="totalFulfillVolumeWeight" jdbcType="VARCHAR"/>
+           <result property="totalfulfillqty" column="totalFulfillQty" jdbcType="VARCHAR"/>
+           <result property="totalcases" column="totalCases" jdbcType="VARCHAR"/>
+           <result property="totalcontainers" column="totalContainers" jdbcType="VARCHAR"/>
+           <result property="closeatqty" column="closeAtQty" jdbcType="VARCHAR"/>
+           <result property="quantityum" column="quantityUM" jdbcType="VARCHAR"/>
+           <result property="weightum" column="weightUM" jdbcType="VARCHAR"/>
+           <result property="volumeum" column="volumeUM" jdbcType="VARCHAR"/>
+           <result property="checkinfrom" column="checkInFrom" jdbcType="VARCHAR"/>
+           <result property="checkinto" column="checkInTo" jdbcType="VARCHAR"/>
+           <result property="closedat" column="closedAt" jdbcType="VARCHAR"/>
+           <result property="sourceplatformcode" column="sourcePlatformCode" jdbcType="VARCHAR"/>
+           <result property="sourceordercode" column="sourceOrderCode" jdbcType="VARCHAR"/>
            <result property="created" column="created" jdbcType="VARCHAR"/>
-           <result property="createdBy" column="created_by" jdbcType="VARCHAR"/>
-           <result property="lastUpdated" column="last_updated" jdbcType="VARCHAR"/>
-           <result property="lastUpdatedBy" column="last_updated_by" jdbcType="VARCHAR"/>
-           <result property="returnWaybillCode" column="return_waybill_code" jdbcType="VARCHAR"/>
-           <result property="returnCarrier" column="return_carrier" jdbcType="VARCHAR"/>
+           <result property="createdby" column="createdBy" jdbcType="VARCHAR"/>
+           <result property="lastupdated" column="lastUpdated" jdbcType="VARCHAR"/>
+           <result property="lastupdatedby" column="lastUpdatedBy" jdbcType="VARCHAR"/>
+           <result property="returnwaybillcode" column="returnWaybillCode" jdbcType="VARCHAR"/>
+           <result property="returncarrier" column="returnCarrier" jdbcType="VARCHAR"/>
+           <result property="refundedat" column="refundedAt" jdbcType="VARCHAR"/>
+           <result property="refundstatus" column="refundStatus" jdbcType="VARCHAR"/>
         </resultMap>
+
     <!-- 查询的字段-->
     <sql id = "TocofsReturngoodsEntity_Base_Column_List">
         id
-       ,client_code 
-        ,company_code 
-        ,store_code 
-        ,facility_code 
+       ,clientCode 
+        ,companyCode 
+        ,storeCode 
+        ,facilityCode 
         ,code 
-        ,internal_instruction_type 
-        ,biz_channel 
-        ,ref_order_id 
-        ,ref_order_code 
-        ,ref_order_type 
+        ,internalInstructionType 
+        ,bizChannel 
+        ,refOrderId 
+        ,refOrderCode 
+        ,refOrderType 
         ,closed 
-        ,closed_by 
+        ,closedBy 
         ,status 
-        ,allow_over_receive 
-        ,ship_from_attention_to 
-        ,ship_from_address 
-        ,ship_from_country 
-        ,ship_from_state 
-        ,ship_from_city 
-        ,ship_from_district 
-        ,ship_from_mobile 
-        ,total_lines 
-        ,total_qty 
-        ,total_amount 
-        ,total_weight 
-        ,total_volume 
-        ,total_volume_weight 
-        ,total_fulfill_amount 
-        ,total_fulfill_weight 
-        ,total_fulfill_volume 
-        ,total_fulfill_volume_weight 
-        ,total_fulfill_qty 
-        ,total_cases 
-        ,total_containers 
-        ,close_at_qty 
-        ,quantity_u_m 
-        ,weight_u_m 
-        ,volume_u_m 
-        ,check_in_from 
-        ,check_in_to 
-        ,closed_at 
-        ,source_platform_code 
-        ,source_order_code 
+        ,allowOverReceive 
+        ,shipFromAttentionTo 
+        ,shipFromAddress 
+        ,shipFromCountry 
+        ,shipFromState 
+        ,shipFromCity 
+        ,shipFromDistrict 
+        ,shipFromPostalCode 
+        ,shipFromMobile 
+        ,shipFromEmail 
+        ,totalLines 
+        ,totalQty 
+        ,totalAmount 
+        ,totalWeight 
+        ,totalVolume 
+        ,totalVolumeWeight 
+        ,totalFulfillAmount 
+        ,totalFulfillWeight 
+        ,totalFulfillVolume 
+        ,totalFulfillVolumeWeight 
+        ,totalFulfillQty 
+        ,totalCases 
+        ,totalContainers 
+        ,closeAtQty 
+        ,quantityUM 
+        ,weightUM 
+        ,volumeUM 
+        ,checkInFrom 
+        ,checkInTo 
+        ,closedAt 
+        ,sourcePlatformCode 
+        ,sourceOrderCode 
         ,created 
-        ,created_by 
-        ,last_updated 
-        ,last_updated_by 
-        ,return_waybill_code 
-        ,return_carrier 
+        ,createdBy 
+        ,lastUpdated 
+        ,lastUpdatedBy 
+        ,returnWaybillCode 
+        ,returnCarrier 
+        ,refundedAt 
+        ,refundStatus 
      </sql>
  <!-- 查询 采用==查询 -->
  <select id="entity_list_base" resultMap="get-TocofsReturngoodsEntity-result" parameterType = "com.hzya.frame.plugin.lets.ofs.entity.TocofsReturngoodsEntity">
@@ -114,55 +123,59 @@
     from tocofs_returngoods
     <trim prefix="where" prefixOverrides="and"> 
         <if test="id != null and id != ''"> and id = #{id} </if>
-            <if test="clientCode != null and clientCode != ''"> and client_code = #{clientCode} </if>
-            <if test="companyCode != null and companyCode != ''"> and company_code = #{companyCode} </if>
-            <if test="storeCode != null and storeCode != ''"> and store_code = #{storeCode} </if>
-            <if test="facilityCode != null and facilityCode != ''"> and facility_code = #{facilityCode} </if>
+            <if test="clientcode != null and clientcode != ''"> and clientCode = #{clientcode} </if>
+            <if test="companycode != null and companycode != ''"> and companyCode = #{companycode} </if>
+            <if test="storecode != null and storecode != ''"> and storeCode = #{storecode} </if>
+            <if test="facilitycode != null and facilitycode != ''"> and facilityCode = #{facilitycode} </if>
             <if test="code != null and code != ''"> and code = #{code} </if>
-            <if test="internalInstructionType != null and internalInstructionType != ''"> and internal_instruction_type = #{internalInstructionType} </if>
-            <if test="bizChannel != null and bizChannel != ''"> and biz_channel = #{bizChannel} </if>
-            <if test="refOrderId != null and refOrderId != ''"> and ref_order_id = #{refOrderId} </if>
-            <if test="refOrderCode != null and refOrderCode != ''"> and ref_order_code = #{refOrderCode} </if>
-            <if test="refOrderType != null and refOrderType != ''"> and ref_order_type = #{refOrderType} </if>
+            <if test="internalinstructiontype != null and internalinstructiontype != ''"> and internalInstructionType = #{internalinstructiontype} </if>
+            <if test="bizchannel != null and bizchannel != ''"> and bizChannel = #{bizchannel} </if>
+            <if test="reforderid != null and reforderid != ''"> and refOrderId = #{reforderid} </if>
+            <if test="refordercode != null and refordercode != ''"> and refOrderCode = #{refordercode} </if>
+            <if test="refordertype != null and refordertype != ''"> and refOrderType = #{refordertype} </if>
             <if test="closed != null and closed != ''"> and closed = #{closed} </if>
-            <if test="closedBy != null and closedBy != ''"> and closed_by = #{closedBy} </if>
+            <if test="closedby != null and closedby != ''"> and closedBy = #{closedby} </if>
             <if test="status != null and status != ''"> and status = #{status} </if>
-            <if test="allowOverReceive != null and allowOverReceive != ''"> and allow_over_receive = #{allowOverReceive} </if>
-            <if test="shipFromAttentionTo != null and shipFromAttentionTo != ''"> and ship_from_attention_to = #{shipFromAttentionTo} </if>
-            <if test="shipFromAddress != null and shipFromAddress != ''"> and ship_from_address = #{shipFromAddress} </if>
-            <if test="shipFromCountry != null and shipFromCountry != ''"> and ship_from_country = #{shipFromCountry} </if>
-            <if test="shipFromState != null and shipFromState != ''"> and ship_from_state = #{shipFromState} </if>
-            <if test="shipFromCity != null and shipFromCity != ''"> and ship_from_city = #{shipFromCity} </if>
-            <if test="shipFromDistrict != null and shipFromDistrict != ''"> and ship_from_district = #{shipFromDistrict} </if>
-            <if test="shipFromMobile != null and shipFromMobile != ''"> and ship_from_mobile = #{shipFromMobile} </if>
-            <if test="totalLines != null and totalLines != ''"> and total_lines = #{totalLines} </if>
-            <if test="totalQty != null and totalQty != ''"> and total_qty = #{totalQty} </if>
-            <if test="totalAmount != null and totalAmount != ''"> and total_amount = #{totalAmount} </if>
-            <if test="totalWeight != null and totalWeight != ''"> and total_weight = #{totalWeight} </if>
-            <if test="totalVolume != null and totalVolume != ''"> and total_volume = #{totalVolume} </if>
-            <if test="totalVolumeWeight != null and totalVolumeWeight != ''"> and total_volume_weight = #{totalVolumeWeight} </if>
-            <if test="totalFulfillAmount != null and totalFulfillAmount != ''"> and total_fulfill_amount = #{totalFulfillAmount} </if>
-            <if test="totalFulfillWeight != null and totalFulfillWeight != ''"> and total_fulfill_weight = #{totalFulfillWeight} </if>
-            <if test="totalFulfillVolume != null and totalFulfillVolume != ''"> and total_fulfill_volume = #{totalFulfillVolume} </if>
-            <if test="totalFulfillVolumeWeight != null and totalFulfillVolumeWeight != ''"> and total_fulfill_volume_weight = #{totalFulfillVolumeWeight} </if>
-            <if test="totalFulfillQty != null and totalFulfillQty != ''"> and total_fulfill_qty = #{totalFulfillQty} </if>
-            <if test="totalCases != null and totalCases != ''"> and total_cases = #{totalCases} </if>
-            <if test="totalContainers != null and totalContainers != ''"> and total_containers = #{totalContainers} </if>
-            <if test="closeAtQty != null and closeAtQty != ''"> and close_at_qty = #{closeAtQty} </if>
-            <if test="quantityUM != null and quantityUM != ''"> and quantity_u_m = #{quantityUM} </if>
-            <if test="weightUM != null and weightUM != ''"> and weight_u_m = #{weightUM} </if>
-            <if test="volumeUM != null and volumeUM != ''"> and volume_u_m = #{volumeUM} </if>
-            <if test="checkInFrom != null and checkInFrom != ''"> and check_in_from = #{checkInFrom} </if>
-            <if test="checkInTo != null and checkInTo != ''"> and check_in_to = #{checkInTo} </if>
-            <if test="closedAt != null and closedAt != ''"> and closed_at = #{closedAt} </if>
-            <if test="sourcePlatformCode != null and sourcePlatformCode != ''"> and source_platform_code = #{sourcePlatformCode} </if>
-            <if test="sourceOrderCode != null and sourceOrderCode != ''"> and source_order_code = #{sourceOrderCode} </if>
+            <if test="allowoverreceive != null and allowoverreceive != ''"> and allowOverReceive = #{allowoverreceive} </if>
+            <if test="shipfromattentionto != null and shipfromattentionto != ''"> and shipFromAttentionTo = #{shipfromattentionto} </if>
+            <if test="shipfromaddress != null and shipfromaddress != ''"> and shipFromAddress = #{shipfromaddress} </if>
+            <if test="shipfromcountry != null and shipfromcountry != ''"> and shipFromCountry = #{shipfromcountry} </if>
+            <if test="shipfromstate != null and shipfromstate != ''"> and shipFromState = #{shipfromstate} </if>
+            <if test="shipfromcity != null and shipfromcity != ''"> and shipFromCity = #{shipfromcity} </if>
+            <if test="shipfromdistrict != null and shipfromdistrict != ''"> and shipFromDistrict = #{shipfromdistrict} </if>
+            <if test="shipfrompostalcode != null and shipfrompostalcode != ''"> and shipFromPostalCode = #{shipfrompostalcode} </if>
+            <if test="shipfrommobile != null and shipfrommobile != ''"> and shipFromMobile = #{shipfrommobile} </if>
+            <if test="shipfromemail != null and shipfromemail != ''"> and shipFromEmail = #{shipfromemail} </if>
+            <if test="totallines != null and totallines != ''"> and totalLines = #{totallines} </if>
+            <if test="totalqty != null and totalqty != ''"> and totalQty = #{totalqty} </if>
+            <if test="totalamount != null and totalamount != ''"> and totalAmount = #{totalamount} </if>
+            <if test="totalweight != null and totalweight != ''"> and totalWeight = #{totalweight} </if>
+            <if test="totalvolume != null and totalvolume != ''"> and totalVolume = #{totalvolume} </if>
+            <if test="totalvolumeweight != null and totalvolumeweight != ''"> and totalVolumeWeight = #{totalvolumeweight} </if>
+            <if test="totalfulfillamount != null and totalfulfillamount != ''"> and totalFulfillAmount = #{totalfulfillamount} </if>
+            <if test="totalfulfillweight != null and totalfulfillweight != ''"> and totalFulfillWeight = #{totalfulfillweight} </if>
+            <if test="totalfulfillvolume != null and totalfulfillvolume != ''"> and totalFulfillVolume = #{totalfulfillvolume} </if>
+            <if test="totalfulfillvolumeweight != null and totalfulfillvolumeweight != ''"> and totalFulfillVolumeWeight = #{totalfulfillvolumeweight} </if>
+            <if test="totalfulfillqty != null and totalfulfillqty != ''"> and totalFulfillQty = #{totalfulfillqty} </if>
+            <if test="totalcases != null and totalcases != ''"> and totalCases = #{totalcases} </if>
+            <if test="totalcontainers != null and totalcontainers != ''"> and totalContainers = #{totalcontainers} </if>
+            <if test="closeatqty != null and closeatqty != ''"> and closeAtQty = #{closeatqty} </if>
+            <if test="quantityum != null and quantityum != ''"> and quantityUM = #{quantityum} </if>
+            <if test="weightum != null and weightum != ''"> and weightUM = #{weightum} </if>
+            <if test="volumeum != null and volumeum != ''"> and volumeUM = #{volumeum} </if>
+            <if test="checkinfrom != null and checkinfrom != ''"> and checkInFrom = #{checkinfrom} </if>
+            <if test="checkinto != null and checkinto != ''"> and checkInTo = #{checkinto} </if>
+            <if test="closedat != null and closedat != ''"> and closedAt = #{closedat} </if>
+            <if test="sourceplatformcode != null and sourceplatformcode != ''"> and sourcePlatformCode = #{sourceplatformcode} </if>
+            <if test="sourceordercode != null and sourceordercode != ''"> and sourceOrderCode = #{sourceordercode} </if>
             <if test="created != null and created != ''"> and created = #{created} </if>
-            <if test="createdBy != null and createdBy != ''"> and created_by = #{createdBy} </if>
-            <if test="lastUpdated != null and lastUpdated != ''"> and last_updated = #{lastUpdated} </if>
-            <if test="lastUpdatedBy != null and lastUpdatedBy != ''"> and last_updated_by = #{lastUpdatedBy} </if>
-            <if test="returnWaybillCode != null and returnWaybillCode != ''"> and return_waybill_code = #{returnWaybillCode} </if>
-            <if test="returnCarrier != null and returnCarrier != ''"> and return_carrier = #{returnCarrier} </if>
+            <if test="createdby != null and createdby != ''"> and createdBy = #{createdby} </if>
+            <if test="lastupdated != null and lastupdated != ''"> and lastUpdated = #{lastupdated} </if>
+            <if test="lastupdatedby != null and lastupdatedby != ''"> and lastUpdatedBy = #{lastupdatedby} </if>
+            <if test="returnwaybillcode != null and returnwaybillcode != ''"> and returnWaybillCode = #{returnwaybillcode} </if>
+            <if test="returncarrier != null and returncarrier != ''"> and returnCarrier = #{returncarrier} </if>
+            <if test="refundedat != null and refundedat != ''"> and refundedAt = #{refundedat} </if>
+            <if test="refundstatus != null and refundstatus != ''"> and refundStatus = #{refundstatus} </if>
             and sts='Y'
     </trim>
     <if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
@@ -174,55 +187,59 @@
         select  count(1)   from tocofs_returngoods
     <trim prefix="where" prefixOverrides="and"> 
         <if test="id != null and id != ''"> and id = #{id} </if>
-            <if test="clientCode != null and clientCode != ''"> and client_code = #{clientCode} </if>
-            <if test="companyCode != null and companyCode != ''"> and company_code = #{companyCode} </if>
-            <if test="storeCode != null and storeCode != ''"> and store_code = #{storeCode} </if>
-            <if test="facilityCode != null and facilityCode != ''"> and facility_code = #{facilityCode} </if>
+            <if test="clientcode != null and clientcode != ''"> and clientCode = #{clientcode} </if>
+            <if test="companycode != null and companycode != ''"> and companyCode = #{companycode} </if>
+            <if test="storecode != null and storecode != ''"> and storeCode = #{storecode} </if>
+            <if test="facilitycode != null and facilitycode != ''"> and facilityCode = #{facilitycode} </if>
             <if test="code != null and code != ''"> and code = #{code} </if>
-            <if test="internalInstructionType != null and internalInstructionType != ''"> and internal_instruction_type = #{internalInstructionType} </if>
-            <if test="bizChannel != null and bizChannel != ''"> and biz_channel = #{bizChannel} </if>
-            <if test="refOrderId != null and refOrderId != ''"> and ref_order_id = #{refOrderId} </if>
-            <if test="refOrderCode != null and refOrderCode != ''"> and ref_order_code = #{refOrderCode} </if>
-            <if test="refOrderType != null and refOrderType != ''"> and ref_order_type = #{refOrderType} </if>
+            <if test="internalinstructiontype != null and internalinstructiontype != ''"> and internalInstructionType = #{internalinstructiontype} </if>
+            <if test="bizchannel != null and bizchannel != ''"> and bizChannel = #{bizchannel} </if>
+            <if test="reforderid != null and reforderid != ''"> and refOrderId = #{reforderid} </if>
+            <if test="refordercode != null and refordercode != ''"> and refOrderCode = #{refordercode} </if>
+            <if test="refordertype != null and refordertype != ''"> and refOrderType = #{refordertype} </if>
             <if test="closed != null and closed != ''"> and closed = #{closed} </if>
-            <if test="closedBy != null and closedBy != ''"> and closed_by = #{closedBy} </if>
+            <if test="closedby != null and closedby != ''"> and closedBy = #{closedby} </if>
             <if test="status != null and status != ''"> and status = #{status} </if>
-            <if test="allowOverReceive != null and allowOverReceive != ''"> and allow_over_receive = #{allowOverReceive} </if>
-            <if test="shipFromAttentionTo != null and shipFromAttentionTo != ''"> and ship_from_attention_to = #{shipFromAttentionTo} </if>
-            <if test="shipFromAddress != null and shipFromAddress != ''"> and ship_from_address = #{shipFromAddress} </if>
-            <if test="shipFromCountry != null and shipFromCountry != ''"> and ship_from_country = #{shipFromCountry} </if>
-            <if test="shipFromState != null and shipFromState != ''"> and ship_from_state = #{shipFromState} </if>
-            <if test="shipFromCity != null and shipFromCity != ''"> and ship_from_city = #{shipFromCity} </if>
-            <if test="shipFromDistrict != null and shipFromDistrict != ''"> and ship_from_district = #{shipFromDistrict} </if>
-            <if test="shipFromMobile != null and shipFromMobile != ''"> and ship_from_mobile = #{shipFromMobile} </if>
-            <if test="totalLines != null and totalLines != ''"> and total_lines = #{totalLines} </if>
-            <if test="totalQty != null and totalQty != ''"> and total_qty = #{totalQty} </if>
-            <if test="totalAmount != null and totalAmount != ''"> and total_amount = #{totalAmount} </if>
-            <if test="totalWeight != null and totalWeight != ''"> and total_weight = #{totalWeight} </if>
-            <if test="totalVolume != null and totalVolume != ''"> and total_volume = #{totalVolume} </if>
-            <if test="totalVolumeWeight != null and totalVolumeWeight != ''"> and total_volume_weight = #{totalVolumeWeight} </if>
-            <if test="totalFulfillAmount != null and totalFulfillAmount != ''"> and total_fulfill_amount = #{totalFulfillAmount} </if>
-            <if test="totalFulfillWeight != null and totalFulfillWeight != ''"> and total_fulfill_weight = #{totalFulfillWeight} </if>
-            <if test="totalFulfillVolume != null and totalFulfillVolume != ''"> and total_fulfill_volume = #{totalFulfillVolume} </if>
-            <if test="totalFulfillVolumeWeight != null and totalFulfillVolumeWeight != ''"> and total_fulfill_volume_weight = #{totalFulfillVolumeWeight} </if>
-            <if test="totalFulfillQty != null and totalFulfillQty != ''"> and total_fulfill_qty = #{totalFulfillQty} </if>
-            <if test="totalCases != null and totalCases != ''"> and total_cases = #{totalCases} </if>
-            <if test="totalContainers != null and totalContainers != ''"> and total_containers = #{totalContainers} </if>
-            <if test="closeAtQty != null and closeAtQty != ''"> and close_at_qty = #{closeAtQty} </if>
-            <if test="quantityUM != null and quantityUM != ''"> and quantity_u_m = #{quantityUM} </if>
-            <if test="weightUM != null and weightUM != ''"> and weight_u_m = #{weightUM} </if>
-            <if test="volumeUM != null and volumeUM != ''"> and volume_u_m = #{volumeUM} </if>
-            <if test="checkInFrom != null and checkInFrom != ''"> and check_in_from = #{checkInFrom} </if>
-            <if test="checkInTo != null and checkInTo != ''"> and check_in_to = #{checkInTo} </if>
-            <if test="closedAt != null and closedAt != ''"> and closed_at = #{closedAt} </if>
-            <if test="sourcePlatformCode != null and sourcePlatformCode != ''"> and source_platform_code = #{sourcePlatformCode} </if>
-            <if test="sourceOrderCode != null and sourceOrderCode != ''"> and source_order_code = #{sourceOrderCode} </if>
+            <if test="allowoverreceive != null and allowoverreceive != ''"> and allowOverReceive = #{allowoverreceive} </if>
+            <if test="shipfromattentionto != null and shipfromattentionto != ''"> and shipFromAttentionTo = #{shipfromattentionto} </if>
+            <if test="shipfromaddress != null and shipfromaddress != ''"> and shipFromAddress = #{shipfromaddress} </if>
+            <if test="shipfromcountry != null and shipfromcountry != ''"> and shipFromCountry = #{shipfromcountry} </if>
+            <if test="shipfromstate != null and shipfromstate != ''"> and shipFromState = #{shipfromstate} </if>
+            <if test="shipfromcity != null and shipfromcity != ''"> and shipFromCity = #{shipfromcity} </if>
+            <if test="shipfromdistrict != null and shipfromdistrict != ''"> and shipFromDistrict = #{shipfromdistrict} </if>
+            <if test="shipfrompostalcode != null and shipfrompostalcode != ''"> and shipFromPostalCode = #{shipfrompostalcode} </if>
+            <if test="shipfrommobile != null and shipfrommobile != ''"> and shipFromMobile = #{shipfrommobile} </if>
+            <if test="shipfromemail != null and shipfromemail != ''"> and shipFromEmail = #{shipfromemail} </if>
+            <if test="totallines != null and totallines != ''"> and totalLines = #{totallines} </if>
+            <if test="totalqty != null and totalqty != ''"> and totalQty = #{totalqty} </if>
+            <if test="totalamount != null and totalamount != ''"> and totalAmount = #{totalamount} </if>
+            <if test="totalweight != null and totalweight != ''"> and totalWeight = #{totalweight} </if>
+            <if test="totalvolume != null and totalvolume != ''"> and totalVolume = #{totalvolume} </if>
+            <if test="totalvolumeweight != null and totalvolumeweight != ''"> and totalVolumeWeight = #{totalvolumeweight} </if>
+            <if test="totalfulfillamount != null and totalfulfillamount != ''"> and totalFulfillAmount = #{totalfulfillamount} </if>
+            <if test="totalfulfillweight != null and totalfulfillweight != ''"> and totalFulfillWeight = #{totalfulfillweight} </if>
+            <if test="totalfulfillvolume != null and totalfulfillvolume != ''"> and totalFulfillVolume = #{totalfulfillvolume} </if>
+            <if test="totalfulfillvolumeweight != null and totalfulfillvolumeweight != ''"> and totalFulfillVolumeWeight = #{totalfulfillvolumeweight} </if>
+            <if test="totalfulfillqty != null and totalfulfillqty != ''"> and totalFulfillQty = #{totalfulfillqty} </if>
+            <if test="totalcases != null and totalcases != ''"> and totalCases = #{totalcases} </if>
+            <if test="totalcontainers != null and totalcontainers != ''"> and totalContainers = #{totalcontainers} </if>
+            <if test="closeatqty != null and closeatqty != ''"> and closeAtQty = #{closeatqty} </if>
+            <if test="quantityum != null and quantityum != ''"> and quantityUM = #{quantityum} </if>
+            <if test="weightum != null and weightum != ''"> and weightUM = #{weightum} </if>
+            <if test="volumeum != null and volumeum != ''"> and volumeUM = #{volumeum} </if>
+            <if test="checkinfrom != null and checkinfrom != ''"> and checkInFrom = #{checkinfrom} </if>
+            <if test="checkinto != null and checkinto != ''"> and checkInTo = #{checkinto} </if>
+            <if test="closedat != null and closedat != ''"> and closedAt = #{closedat} </if>
+            <if test="sourceplatformcode != null and sourceplatformcode != ''"> and sourcePlatformCode = #{sourceplatformcode} </if>
+            <if test="sourceordercode != null and sourceordercode != ''"> and sourceOrderCode = #{sourceordercode} </if>
             <if test="created != null and created != ''"> and created = #{created} </if>
-            <if test="createdBy != null and createdBy != ''"> and created_by = #{createdBy} </if>
-            <if test="lastUpdated != null and lastUpdated != ''"> and last_updated = #{lastUpdated} </if>
-            <if test="lastUpdatedBy != null and lastUpdatedBy != ''"> and last_updated_by = #{lastUpdatedBy} </if>
-            <if test="returnWaybillCode != null and returnWaybillCode != ''"> and return_waybill_code = #{returnWaybillCode} </if>
-            <if test="returnCarrier != null and returnCarrier != ''"> and return_carrier = #{returnCarrier} </if>
+            <if test="createdby != null and createdby != ''"> and createdBy = #{createdby} </if>
+            <if test="lastupdated != null and lastupdated != ''"> and lastUpdated = #{lastupdated} </if>
+            <if test="lastupdatedby != null and lastupdatedby != ''"> and lastUpdatedBy = #{lastupdatedby} </if>
+            <if test="returnwaybillcode != null and returnwaybillcode != ''"> and returnWaybillCode = #{returnwaybillcode} </if>
+            <if test="returncarrier != null and returncarrier != ''"> and returnCarrier = #{returncarrier} </if>
+            <if test="refundedat != null and refundedat != ''"> and refundedAt = #{refundedat} </if>
+            <if test="refundstatus != null and refundstatus != ''"> and refundStatus = #{refundstatus} </if>
             and sts='Y'
     </trim>
     <if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
@@ -236,55 +253,59 @@
     from tocofs_returngoods
     <trim prefix="where" prefixOverrides="and"> 
         <if test="id != null and id != ''"> and id like concat('%',#{id},'%') </if>
-            <if test="clientCode != null and clientCode != ''"> and client_code like concat('%',#{clientCode},'%') </if>
-            <if test="companyCode != null and companyCode != ''"> and company_code like concat('%',#{companyCode},'%') </if>
-            <if test="storeCode != null and storeCode != ''"> and store_code like concat('%',#{storeCode},'%') </if>
-            <if test="facilityCode != null and facilityCode != ''"> and facility_code like concat('%',#{facilityCode},'%') </if>
+            <if test="clientcode != null and clientcode != ''"> and clientCode like concat('%',#{clientcode},'%') </if>
+            <if test="companycode != null and companycode != ''"> and companyCode like concat('%',#{companycode},'%') </if>
+            <if test="storecode != null and storecode != ''"> and storeCode like concat('%',#{storecode},'%') </if>
+            <if test="facilitycode != null and facilitycode != ''"> and facilityCode like concat('%',#{facilitycode},'%') </if>
             <if test="code != null and code != ''"> and code like concat('%',#{code},'%') </if>
-            <if test="internalInstructionType != null and internalInstructionType != ''"> and internal_instruction_type like concat('%',#{internalInstructionType},'%') </if>
-            <if test="bizChannel != null and bizChannel != ''"> and biz_channel like concat('%',#{bizChannel},'%') </if>
-            <if test="refOrderId != null and refOrderId != ''"> and ref_order_id like concat('%',#{refOrderId},'%') </if>
-            <if test="refOrderCode != null and refOrderCode != ''"> and ref_order_code like concat('%',#{refOrderCode},'%') </if>
-            <if test="refOrderType != null and refOrderType != ''"> and ref_order_type like concat('%',#{refOrderType},'%') </if>
+            <if test="internalinstructiontype != null and internalinstructiontype != ''"> and internalInstructionType like concat('%',#{internalinstructiontype},'%') </if>
+            <if test="bizchannel != null and bizchannel != ''"> and bizChannel like concat('%',#{bizchannel},'%') </if>
+            <if test="reforderid != null and reforderid != ''"> and refOrderId like concat('%',#{reforderid},'%') </if>
+            <if test="refordercode != null and refordercode != ''"> and refOrderCode like concat('%',#{refordercode},'%') </if>
+            <if test="refordertype != null and refordertype != ''"> and refOrderType like concat('%',#{refordertype},'%') </if>
             <if test="closed != null and closed != ''"> and closed like concat('%',#{closed},'%') </if>
-            <if test="closedBy != null and closedBy != ''"> and closed_by like concat('%',#{closedBy},'%') </if>
+            <if test="closedby != null and closedby != ''"> and closedBy like concat('%',#{closedby},'%') </if>
             <if test="status != null and status != ''"> and status like concat('%',#{status},'%') </if>
-            <if test="allowOverReceive != null and allowOverReceive != ''"> and allow_over_receive like concat('%',#{allowOverReceive},'%') </if>
-            <if test="shipFromAttentionTo != null and shipFromAttentionTo != ''"> and ship_from_attention_to like concat('%',#{shipFromAttentionTo},'%') </if>
-            <if test="shipFromAddress != null and shipFromAddress != ''"> and ship_from_address like concat('%',#{shipFromAddress},'%') </if>
-            <if test="shipFromCountry != null and shipFromCountry != ''"> and ship_from_country like concat('%',#{shipFromCountry},'%') </if>
-            <if test="shipFromState != null and shipFromState != ''"> and ship_from_state like concat('%',#{shipFromState},'%') </if>
-            <if test="shipFromCity != null and shipFromCity != ''"> and ship_from_city like concat('%',#{shipFromCity},'%') </if>
-            <if test="shipFromDistrict != null and shipFromDistrict != ''"> and ship_from_district like concat('%',#{shipFromDistrict},'%') </if>
-            <if test="shipFromMobile != null and shipFromMobile != ''"> and ship_from_mobile like concat('%',#{shipFromMobile},'%') </if>
-            <if test="totalLines != null and totalLines != ''"> and total_lines like concat('%',#{totalLines},'%') </if>
-            <if test="totalQty != null and totalQty != ''"> and total_qty like concat('%',#{totalQty},'%') </if>
-            <if test="totalAmount != null and totalAmount != ''"> and total_amount like concat('%',#{totalAmount},'%') </if>
-            <if test="totalWeight != null and totalWeight != ''"> and total_weight like concat('%',#{totalWeight},'%') </if>
-            <if test="totalVolume != null and totalVolume != ''"> and total_volume like concat('%',#{totalVolume},'%') </if>
-            <if test="totalVolumeWeight != null and totalVolumeWeight != ''"> and total_volume_weight like concat('%',#{totalVolumeWeight},'%') </if>
-            <if test="totalFulfillAmount != null and totalFulfillAmount != ''"> and total_fulfill_amount like concat('%',#{totalFulfillAmount},'%') </if>
-            <if test="totalFulfillWeight != null and totalFulfillWeight != ''"> and total_fulfill_weight like concat('%',#{totalFulfillWeight},'%') </if>
-            <if test="totalFulfillVolume != null and totalFulfillVolume != ''"> and total_fulfill_volume like concat('%',#{totalFulfillVolume},'%') </if>
-            <if test="totalFulfillVolumeWeight != null and totalFulfillVolumeWeight != ''"> and total_fulfill_volume_weight like concat('%',#{totalFulfillVolumeWeight},'%') </if>
-            <if test="totalFulfillQty != null and totalFulfillQty != ''"> and total_fulfill_qty like concat('%',#{totalFulfillQty},'%') </if>
-            <if test="totalCases != null and totalCases != ''"> and total_cases like concat('%',#{totalCases},'%') </if>
-            <if test="totalContainers != null and totalContainers != ''"> and total_containers like concat('%',#{totalContainers},'%') </if>
-            <if test="closeAtQty != null and closeAtQty != ''"> and close_at_qty like concat('%',#{closeAtQty},'%') </if>
-            <if test="quantityUM != null and quantityUM != ''"> and quantity_u_m like concat('%',#{quantityUM},'%') </if>
-            <if test="weightUM != null and weightUM != ''"> and weight_u_m like concat('%',#{weightUM},'%') </if>
-            <if test="volumeUM != null and volumeUM != ''"> and volume_u_m like concat('%',#{volumeUM},'%') </if>
-            <if test="checkInFrom != null and checkInFrom != ''"> and check_in_from like concat('%',#{checkInFrom},'%') </if>
-            <if test="checkInTo != null and checkInTo != ''"> and check_in_to like concat('%',#{checkInTo},'%') </if>
-            <if test="closedAt != null and closedAt != ''"> and closed_at like concat('%',#{closedAt},'%') </if>
-            <if test="sourcePlatformCode != null and sourcePlatformCode != ''"> and source_platform_code like concat('%',#{sourcePlatformCode},'%') </if>
-            <if test="sourceOrderCode != null and sourceOrderCode != ''"> and source_order_code like concat('%',#{sourceOrderCode},'%') </if>
+            <if test="allowoverreceive != null and allowoverreceive != ''"> and allowOverReceive like concat('%',#{allowoverreceive},'%') </if>
+            <if test="shipfromattentionto != null and shipfromattentionto != ''"> and shipFromAttentionTo like concat('%',#{shipfromattentionto},'%') </if>
+            <if test="shipfromaddress != null and shipfromaddress != ''"> and shipFromAddress like concat('%',#{shipfromaddress},'%') </if>
+            <if test="shipfromcountry != null and shipfromcountry != ''"> and shipFromCountry like concat('%',#{shipfromcountry},'%') </if>
+            <if test="shipfromstate != null and shipfromstate != ''"> and shipFromState like concat('%',#{shipfromstate},'%') </if>
+            <if test="shipfromcity != null and shipfromcity != ''"> and shipFromCity like concat('%',#{shipfromcity},'%') </if>
+            <if test="shipfromdistrict != null and shipfromdistrict != ''"> and shipFromDistrict like concat('%',#{shipfromdistrict},'%') </if>
+            <if test="shipfrompostalcode != null and shipfrompostalcode != ''"> and shipFromPostalCode like concat('%',#{shipfrompostalcode},'%') </if>
+            <if test="shipfrommobile != null and shipfrommobile != ''"> and shipFromMobile like concat('%',#{shipfrommobile},'%') </if>
+            <if test="shipfromemail != null and shipfromemail != ''"> and shipFromEmail like concat('%',#{shipfromemail},'%') </if>
+            <if test="totallines != null and totallines != ''"> and totalLines like concat('%',#{totallines},'%') </if>
+            <if test="totalqty != null and totalqty != ''"> and totalQty like concat('%',#{totalqty},'%') </if>
+            <if test="totalamount != null and totalamount != ''"> and totalAmount like concat('%',#{totalamount},'%') </if>
+            <if test="totalweight != null and totalweight != ''"> and totalWeight like concat('%',#{totalweight},'%') </if>
+            <if test="totalvolume != null and totalvolume != ''"> and totalVolume like concat('%',#{totalvolume},'%') </if>
+            <if test="totalvolumeweight != null and totalvolumeweight != ''"> and totalVolumeWeight like concat('%',#{totalvolumeweight},'%') </if>
+            <if test="totalfulfillamount != null and totalfulfillamount != ''"> and totalFulfillAmount like concat('%',#{totalfulfillamount},'%') </if>
+            <if test="totalfulfillweight != null and totalfulfillweight != ''"> and totalFulfillWeight like concat('%',#{totalfulfillweight},'%') </if>
+            <if test="totalfulfillvolume != null and totalfulfillvolume != ''"> and totalFulfillVolume like concat('%',#{totalfulfillvolume},'%') </if>
+            <if test="totalfulfillvolumeweight != null and totalfulfillvolumeweight != ''"> and totalFulfillVolumeWeight like concat('%',#{totalfulfillvolumeweight},'%') </if>
+            <if test="totalfulfillqty != null and totalfulfillqty != ''"> and totalFulfillQty like concat('%',#{totalfulfillqty},'%') </if>
+            <if test="totalcases != null and totalcases != ''"> and totalCases like concat('%',#{totalcases},'%') </if>
+            <if test="totalcontainers != null and totalcontainers != ''"> and totalContainers like concat('%',#{totalcontainers},'%') </if>
+            <if test="closeatqty != null and closeatqty != ''"> and closeAtQty like concat('%',#{closeatqty},'%') </if>
+            <if test="quantityum != null and quantityum != ''"> and quantityUM like concat('%',#{quantityum},'%') </if>
+            <if test="weightum != null and weightum != ''"> and weightUM like concat('%',#{weightum},'%') </if>
+            <if test="volumeum != null and volumeum != ''"> and volumeUM like concat('%',#{volumeum},'%') </if>
+            <if test="checkinfrom != null and checkinfrom != ''"> and checkInFrom like concat('%',#{checkinfrom},'%') </if>
+            <if test="checkinto != null and checkinto != ''"> and checkInTo like concat('%',#{checkinto},'%') </if>
+            <if test="closedat != null and closedat != ''"> and closedAt like concat('%',#{closedat},'%') </if>
+            <if test="sourceplatformcode != null and sourceplatformcode != ''"> and sourcePlatformCode like concat('%',#{sourceplatformcode},'%') </if>
+            <if test="sourceordercode != null and sourceordercode != ''"> and sourceOrderCode like concat('%',#{sourceordercode},'%') </if>
             <if test="created != null and created != ''"> and created like concat('%',#{created},'%') </if>
-            <if test="createdBy != null and createdBy != ''"> and created_by like concat('%',#{createdBy},'%') </if>
-            <if test="lastUpdated != null and lastUpdated != ''"> and last_updated like concat('%',#{lastUpdated},'%') </if>
-            <if test="lastUpdatedBy != null and lastUpdatedBy != ''"> and last_updated_by like concat('%',#{lastUpdatedBy},'%') </if>
-            <if test="returnWaybillCode != null and returnWaybillCode != ''"> and return_waybill_code like concat('%',#{returnWaybillCode},'%') </if>
-            <if test="returnCarrier != null and returnCarrier != ''"> and return_carrier like concat('%',#{returnCarrier},'%') </if>
+            <if test="createdby != null and createdby != ''"> and createdBy like concat('%',#{createdby},'%') </if>
+            <if test="lastupdated != null and lastupdated != ''"> and lastUpdated like concat('%',#{lastupdated},'%') </if>
+            <if test="lastupdatedby != null and lastupdatedby != ''"> and lastUpdatedBy like concat('%',#{lastupdatedby},'%') </if>
+            <if test="returnwaybillcode != null and returnwaybillcode != ''"> and returnWaybillCode like concat('%',#{returnwaybillcode},'%') </if>
+            <if test="returncarrier != null and returncarrier != ''"> and returnCarrier like concat('%',#{returncarrier},'%') </if>
+            <if test="refundedat != null and refundedat != ''"> and refundedAt like concat('%',#{refundedat},'%') </if>
+            <if test="refundstatus != null and refundstatus != ''"> and refundStatus like concat('%',#{refundstatus},'%') </if>
             and sts='Y'
     </trim>
     <if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
@@ -298,55 +319,59 @@
     from tocofs_returngoods
     <trim prefix="where" prefixOverrides="and"> 
          <if test="id != null and id != ''"> or id = #{id} </if>
-             <if test="clientCode != null and clientCode != ''"> or client_code = #{clientCode} </if>
-             <if test="companyCode != null and companyCode != ''"> or company_code = #{companyCode} </if>
-             <if test="storeCode != null and storeCode != ''"> or store_code = #{storeCode} </if>
-             <if test="facilityCode != null and facilityCode != ''"> or facility_code = #{facilityCode} </if>
+             <if test="clientcode != null and clientcode != ''"> or clientCode = #{clientcode} </if>
+             <if test="companycode != null and companycode != ''"> or companyCode = #{companycode} </if>
+             <if test="storecode != null and storecode != ''"> or storeCode = #{storecode} </if>
+             <if test="facilitycode != null and facilitycode != ''"> or facilityCode = #{facilitycode} </if>
              <if test="code != null and code != ''"> or code = #{code} </if>
-             <if test="internalInstructionType != null and internalInstructionType != ''"> or internal_instruction_type = #{internalInstructionType} </if>
-             <if test="bizChannel != null and bizChannel != ''"> or biz_channel = #{bizChannel} </if>
-             <if test="refOrderId != null and refOrderId != ''"> or ref_order_id = #{refOrderId} </if>
-             <if test="refOrderCode != null and refOrderCode != ''"> or ref_order_code = #{refOrderCode} </if>
-             <if test="refOrderType != null and refOrderType != ''"> or ref_order_type = #{refOrderType} </if>
+             <if test="internalinstructiontype != null and internalinstructiontype != ''"> or internalInstructionType = #{internalinstructiontype} </if>
+             <if test="bizchannel != null and bizchannel != ''"> or bizChannel = #{bizchannel} </if>
+             <if test="reforderid != null and reforderid != ''"> or refOrderId = #{reforderid} </if>
+             <if test="refordercode != null and refordercode != ''"> or refOrderCode = #{refordercode} </if>
+             <if test="refordertype != null and refordertype != ''"> or refOrderType = #{refordertype} </if>
              <if test="closed != null and closed != ''"> or closed = #{closed} </if>
-             <if test="closedBy != null and closedBy != ''"> or closed_by = #{closedBy} </if>
+             <if test="closedby != null and closedby != ''"> or closedBy = #{closedby} </if>
              <if test="status != null and status != ''"> or status = #{status} </if>
-             <if test="allowOverReceive != null and allowOverReceive != ''"> or allow_over_receive = #{allowOverReceive} </if>
-             <if test="shipFromAttentionTo != null and shipFromAttentionTo != ''"> or ship_from_attention_to = #{shipFromAttentionTo} </if>
-             <if test="shipFromAddress != null and shipFromAddress != ''"> or ship_from_address = #{shipFromAddress} </if>
-             <if test="shipFromCountry != null and shipFromCountry != ''"> or ship_from_country = #{shipFromCountry} </if>
-             <if test="shipFromState != null and shipFromState != ''"> or ship_from_state = #{shipFromState} </if>
-             <if test="shipFromCity != null and shipFromCity != ''"> or ship_from_city = #{shipFromCity} </if>
-             <if test="shipFromDistrict != null and shipFromDistrict != ''"> or ship_from_district = #{shipFromDistrict} </if>
-             <if test="shipFromMobile != null and shipFromMobile != ''"> or ship_from_mobile = #{shipFromMobile} </if>
-             <if test="totalLines != null and totalLines != ''"> or total_lines = #{totalLines} </if>
-             <if test="totalQty != null and totalQty != ''"> or total_qty = #{totalQty} </if>
-             <if test="totalAmount != null and totalAmount != ''"> or total_amount = #{totalAmount} </if>
-             <if test="totalWeight != null and totalWeight != ''"> or total_weight = #{totalWeight} </if>
-             <if test="totalVolume != null and totalVolume != ''"> or total_volume = #{totalVolume} </if>
-             <if test="totalVolumeWeight != null and totalVolumeWeight != ''"> or total_volume_weight = #{totalVolumeWeight} </if>
-             <if test="totalFulfillAmount != null and totalFulfillAmount != ''"> or total_fulfill_amount = #{totalFulfillAmount} </if>
-             <if test="totalFulfillWeight != null and totalFulfillWeight != ''"> or total_fulfill_weight = #{totalFulfillWeight} </if>
-             <if test="totalFulfillVolume != null and totalFulfillVolume != ''"> or total_fulfill_volume = #{totalFulfillVolume} </if>
-             <if test="totalFulfillVolumeWeight != null and totalFulfillVolumeWeight != ''"> or total_fulfill_volume_weight = #{totalFulfillVolumeWeight} </if>
-             <if test="totalFulfillQty != null and totalFulfillQty != ''"> or total_fulfill_qty = #{totalFulfillQty} </if>
-             <if test="totalCases != null and totalCases != ''"> or total_cases = #{totalCases} </if>
-             <if test="totalContainers != null and totalContainers != ''"> or total_containers = #{totalContainers} </if>
-             <if test="closeAtQty != null and closeAtQty != ''"> or close_at_qty = #{closeAtQty} </if>
-             <if test="quantityUM != null and quantityUM != ''"> or quantity_u_m = #{quantityUM} </if>
-             <if test="weightUM != null and weightUM != ''"> or weight_u_m = #{weightUM} </if>
-             <if test="volumeUM != null and volumeUM != ''"> or volume_u_m = #{volumeUM} </if>
-             <if test="checkInFrom != null and checkInFrom != ''"> or check_in_from = #{checkInFrom} </if>
-             <if test="checkInTo != null and checkInTo != ''"> or check_in_to = #{checkInTo} </if>
-             <if test="closedAt != null and closedAt != ''"> or closed_at = #{closedAt} </if>
-             <if test="sourcePlatformCode != null and sourcePlatformCode != ''"> or source_platform_code = #{sourcePlatformCode} </if>
-             <if test="sourceOrderCode != null and sourceOrderCode != ''"> or source_order_code = #{sourceOrderCode} </if>
+             <if test="allowoverreceive != null and allowoverreceive != ''"> or allowOverReceive = #{allowoverreceive} </if>
+             <if test="shipfromattentionto != null and shipfromattentionto != ''"> or shipFromAttentionTo = #{shipfromattentionto} </if>
+             <if test="shipfromaddress != null and shipfromaddress != ''"> or shipFromAddress = #{shipfromaddress} </if>
+             <if test="shipfromcountry != null and shipfromcountry != ''"> or shipFromCountry = #{shipfromcountry} </if>
+             <if test="shipfromstate != null and shipfromstate != ''"> or shipFromState = #{shipfromstate} </if>
+             <if test="shipfromcity != null and shipfromcity != ''"> or shipFromCity = #{shipfromcity} </if>
+             <if test="shipfromdistrict != null and shipfromdistrict != ''"> or shipFromDistrict = #{shipfromdistrict} </if>
+             <if test="shipfrompostalcode != null and shipfrompostalcode != ''"> or shipFromPostalCode = #{shipfrompostalcode} </if>
+             <if test="shipfrommobile != null and shipfrommobile != ''"> or shipFromMobile = #{shipfrommobile} </if>
+             <if test="shipfromemail != null and shipfromemail != ''"> or shipFromEmail = #{shipfromemail} </if>
+             <if test="totallines != null and totallines != ''"> or totalLines = #{totallines} </if>
+             <if test="totalqty != null and totalqty != ''"> or totalQty = #{totalqty} </if>
+             <if test="totalamount != null and totalamount != ''"> or totalAmount = #{totalamount} </if>
+             <if test="totalweight != null and totalweight != ''"> or totalWeight = #{totalweight} </if>
+             <if test="totalvolume != null and totalvolume != ''"> or totalVolume = #{totalvolume} </if>
+             <if test="totalvolumeweight != null and totalvolumeweight != ''"> or totalVolumeWeight = #{totalvolumeweight} </if>
+             <if test="totalfulfillamount != null and totalfulfillamount != ''"> or totalFulfillAmount = #{totalfulfillamount} </if>
+             <if test="totalfulfillweight != null and totalfulfillweight != ''"> or totalFulfillWeight = #{totalfulfillweight} </if>
+             <if test="totalfulfillvolume != null and totalfulfillvolume != ''"> or totalFulfillVolume = #{totalfulfillvolume} </if>
+             <if test="totalfulfillvolumeweight != null and totalfulfillvolumeweight != ''"> or totalFulfillVolumeWeight = #{totalfulfillvolumeweight} </if>
+             <if test="totalfulfillqty != null and totalfulfillqty != ''"> or totalFulfillQty = #{totalfulfillqty} </if>
+             <if test="totalcases != null and totalcases != ''"> or totalCases = #{totalcases} </if>
+             <if test="totalcontainers != null and totalcontainers != ''"> or totalContainers = #{totalcontainers} </if>
+             <if test="closeatqty != null and closeatqty != ''"> or closeAtQty = #{closeatqty} </if>
+             <if test="quantityum != null and quantityum != ''"> or quantityUM = #{quantityum} </if>
+             <if test="weightum != null and weightum != ''"> or weightUM = #{weightum} </if>
+             <if test="volumeum != null and volumeum != ''"> or volumeUM = #{volumeum} </if>
+             <if test="checkinfrom != null and checkinfrom != ''"> or checkInFrom = #{checkinfrom} </if>
+             <if test="checkinto != null and checkinto != ''"> or checkInTo = #{checkinto} </if>
+             <if test="closedat != null and closedat != ''"> or closedAt = #{closedat} </if>
+             <if test="sourceplatformcode != null and sourceplatformcode != ''"> or sourcePlatformCode = #{sourceplatformcode} </if>
+             <if test="sourceordercode != null and sourceordercode != ''"> or sourceOrderCode = #{sourceordercode} </if>
              <if test="created != null and created != ''"> or created = #{created} </if>
-             <if test="createdBy != null and createdBy != ''"> or created_by = #{createdBy} </if>
-             <if test="lastUpdated != null and lastUpdated != ''"> or last_updated = #{lastUpdated} </if>
-             <if test="lastUpdatedBy != null and lastUpdatedBy != ''"> or last_updated_by = #{lastUpdatedBy} </if>
-             <if test="returnWaybillCode != null and returnWaybillCode != ''"> or return_waybill_code = #{returnWaybillCode} </if>
-             <if test="returnCarrier != null and returnCarrier != ''"> or return_carrier = #{returnCarrier} </if>
+             <if test="createdby != null and createdby != ''"> or createdBy = #{createdby} </if>
+             <if test="lastupdated != null and lastupdated != ''"> or lastUpdated = #{lastupdated} </if>
+             <if test="lastupdatedby != null and lastupdatedby != ''"> or lastUpdatedBy = #{lastupdatedby} </if>
+             <if test="returnwaybillcode != null and returnwaybillcode != ''"> or returnWaybillCode = #{returnwaybillcode} </if>
+             <if test="returncarrier != null and returncarrier != ''"> or returnCarrier = #{returncarrier} </if>
+             <if test="refundedat != null and refundedat != ''"> or refundedAt = #{refundedat} </if>
+             <if test="refundstatus != null and refundstatus != ''"> or refundStatus = #{refundstatus} </if>
             and sts='Y'
     </trim>
     <if test=" sort == null or sort == ''.toString()  "> order by sorts asc</if>
@@ -358,110 +383,118 @@
     insert into tocofs_returngoods(
   <trim suffix="" suffixOverrides=",">
        <if test="id != null and id != ''"> id , </if>
-            <if test="clientCode != null and clientCode != ''"> client_code , </if>
-            <if test="companyCode != null and companyCode != ''"> company_code , </if>
-            <if test="storeCode != null and storeCode != ''"> store_code , </if>
-            <if test="facilityCode != null and facilityCode != ''"> facility_code , </if>
+            <if test="clientcode != null and clientcode != ''"> clientCode , </if>
+            <if test="companycode != null and companycode != ''"> companyCode , </if>
+            <if test="storecode != null and storecode != ''"> storeCode , </if>
+            <if test="facilitycode != null and facilitycode != ''"> facilityCode , </if>
             <if test="code != null and code != ''"> code , </if>
-            <if test="internalInstructionType != null and internalInstructionType != ''"> internal_instruction_type , </if>
-            <if test="bizChannel != null and bizChannel != ''"> biz_channel , </if>
-            <if test="refOrderId != null and refOrderId != ''"> ref_order_id , </if>
-            <if test="refOrderCode != null and refOrderCode != ''"> ref_order_code , </if>
-            <if test="refOrderType != null and refOrderType != ''"> ref_order_type , </if>
+            <if test="internalinstructiontype != null and internalinstructiontype != ''"> internalInstructionType , </if>
+            <if test="bizchannel != null and bizchannel != ''"> bizChannel , </if>
+            <if test="reforderid != null and reforderid != ''"> refOrderId , </if>
+            <if test="refordercode != null and refordercode != ''"> refOrderCode , </if>
+            <if test="refordertype != null and refordertype != ''"> refOrderType , </if>
             <if test="closed != null and closed != ''"> closed , </if>
-            <if test="closedBy != null and closedBy != ''"> closed_by , </if>
+            <if test="closedby != null and closedby != ''"> closedBy , </if>
             <if test="status != null and status != ''"> status , </if>
-            <if test="allowOverReceive != null and allowOverReceive != ''"> allow_over_receive , </if>
-            <if test="shipFromAttentionTo != null and shipFromAttentionTo != ''"> ship_from_attention_to , </if>
-            <if test="shipFromAddress != null and shipFromAddress != ''"> ship_from_address , </if>
-            <if test="shipFromCountry != null and shipFromCountry != ''"> ship_from_country , </if>
-            <if test="shipFromState != null and shipFromState != ''"> ship_from_state , </if>
-            <if test="shipFromCity != null and shipFromCity != ''"> ship_from_city , </if>
-            <if test="shipFromDistrict != null and shipFromDistrict != ''"> ship_from_district , </if>
-            <if test="shipFromMobile != null and shipFromMobile != ''"> ship_from_mobile , </if>
-            <if test="totalLines != null and totalLines != ''"> total_lines , </if>
-            <if test="totalQty != null and totalQty != ''"> total_qty , </if>
-            <if test="totalAmount != null and totalAmount != ''"> total_amount , </if>
-            <if test="totalWeight != null and totalWeight != ''"> total_weight , </if>
-            <if test="totalVolume != null and totalVolume != ''"> total_volume , </if>
-            <if test="totalVolumeWeight != null and totalVolumeWeight != ''"> total_volume_weight , </if>
-            <if test="totalFulfillAmount != null and totalFulfillAmount != ''"> total_fulfill_amount , </if>
-            <if test="totalFulfillWeight != null and totalFulfillWeight != ''"> total_fulfill_weight , </if>
-            <if test="totalFulfillVolume != null and totalFulfillVolume != ''"> total_fulfill_volume , </if>
-            <if test="totalFulfillVolumeWeight != null and totalFulfillVolumeWeight != ''"> total_fulfill_volume_weight , </if>
-            <if test="totalFulfillQty != null and totalFulfillQty != ''"> total_fulfill_qty , </if>
-            <if test="totalCases != null and totalCases != ''"> total_cases , </if>
-            <if test="totalContainers != null and totalContainers != ''"> total_containers , </if>
-            <if test="closeAtQty != null and closeAtQty != ''"> close_at_qty , </if>
-            <if test="quantityUM != null and quantityUM != ''"> quantity_u_m , </if>
-            <if test="weightUM != null and weightUM != ''"> weight_u_m , </if>
-            <if test="volumeUM != null and volumeUM != ''"> volume_u_m , </if>
-            <if test="checkInFrom != null and checkInFrom != ''"> check_in_from , </if>
-            <if test="checkInTo != null and checkInTo != ''"> check_in_to , </if>
-            <if test="closedAt != null and closedAt != ''"> closed_at , </if>
-            <if test="sourcePlatformCode != null and sourcePlatformCode != ''"> source_platform_code , </if>
-            <if test="sourceOrderCode != null and sourceOrderCode != ''"> source_order_code , </if>
+            <if test="allowoverreceive != null and allowoverreceive != ''"> allowOverReceive , </if>
+            <if test="shipfromattentionto != null and shipfromattentionto != ''"> shipFromAttentionTo , </if>
+            <if test="shipfromaddress != null and shipfromaddress != ''"> shipFromAddress , </if>
+            <if test="shipfromcountry != null and shipfromcountry != ''"> shipFromCountry , </if>
+            <if test="shipfromstate != null and shipfromstate != ''"> shipFromState , </if>
+            <if test="shipfromcity != null and shipfromcity != ''"> shipFromCity , </if>
+            <if test="shipfromdistrict != null and shipfromdistrict != ''"> shipFromDistrict , </if>
+            <if test="shipfrompostalcode != null and shipfrompostalcode != ''"> shipFromPostalCode , </if>
+            <if test="shipfrommobile != null and shipfrommobile != ''"> shipFromMobile , </if>
+            <if test="shipfromemail != null and shipfromemail != ''"> shipFromEmail , </if>
+            <if test="totallines != null and totallines != ''"> totalLines , </if>
+            <if test="totalqty != null and totalqty != ''"> totalQty , </if>
+            <if test="totalamount != null and totalamount != ''"> totalAmount , </if>
+            <if test="totalweight != null and totalweight != ''"> totalWeight , </if>
+            <if test="totalvolume != null and totalvolume != ''"> totalVolume , </if>
+            <if test="totalvolumeweight != null and totalvolumeweight != ''"> totalVolumeWeight , </if>
+            <if test="totalfulfillamount != null and totalfulfillamount != ''"> totalFulfillAmount , </if>
+            <if test="totalfulfillweight != null and totalfulfillweight != ''"> totalFulfillWeight , </if>
+            <if test="totalfulfillvolume != null and totalfulfillvolume != ''"> totalFulfillVolume , </if>
+            <if test="totalfulfillvolumeweight != null and totalfulfillvolumeweight != ''"> totalFulfillVolumeWeight , </if>
+            <if test="totalfulfillqty != null and totalfulfillqty != ''"> totalFulfillQty , </if>
+            <if test="totalcases != null and totalcases != ''"> totalCases , </if>
+            <if test="totalcontainers != null and totalcontainers != ''"> totalContainers , </if>
+            <if test="closeatqty != null and closeatqty != ''"> closeAtQty , </if>
+            <if test="quantityum != null and quantityum != ''"> quantityUM , </if>
+            <if test="weightum != null and weightum != ''"> weightUM , </if>
+            <if test="volumeum != null and volumeum != ''"> volumeUM , </if>
+            <if test="checkinfrom != null and checkinfrom != ''"> checkInFrom , </if>
+            <if test="checkinto != null and checkinto != ''"> checkInTo , </if>
+            <if test="closedat != null and closedat != ''"> closedAt , </if>
+            <if test="sourceplatformcode != null and sourceplatformcode != ''"> sourcePlatformCode , </if>
+            <if test="sourceordercode != null and sourceordercode != ''"> sourceOrderCode , </if>
             <if test="created != null and created != ''"> created , </if>
-            <if test="createdBy != null and createdBy != ''"> created_by , </if>
-            <if test="lastUpdated != null and lastUpdated != ''"> last_updated , </if>
-            <if test="lastUpdatedBy != null and lastUpdatedBy != ''"> last_updated_by , </if>
-            <if test="returnWaybillCode != null and returnWaybillCode != ''"> return_waybill_code , </if>
-            <if test="returnCarrier != null and returnCarrier != ''"> return_carrier , </if>
+            <if test="createdby != null and createdby != ''"> createdBy , </if>
+            <if test="lastupdated != null and lastupdated != ''"> lastUpdated , </if>
+            <if test="lastupdatedby != null and lastupdatedby != ''"> lastUpdatedBy , </if>
+            <if test="returnwaybillcode != null and returnwaybillcode != ''"> returnWaybillCode , </if>
+            <if test="returncarrier != null and returncarrier != ''"> returnCarrier , </if>
+            <if test="refundedat != null and refundedat != ''"> refundedAt , </if>
+            <if test="refundstatus != null and refundstatus != ''"> refundStatus , </if>
             <if test="sorts == null ">sorts,</if>
     <if test="sts == null ">sts,</if>
   </trim>
   )values(
  <trim suffix="" suffixOverrides=",">
        <if test="id != null and id != ''"> #{id} ,</if>
-            <if test="clientCode != null and clientCode != ''"> #{clientCode} ,</if>
-            <if test="companyCode != null and companyCode != ''"> #{companyCode} ,</if>
-            <if test="storeCode != null and storeCode != ''"> #{storeCode} ,</if>
-            <if test="facilityCode != null and facilityCode != ''"> #{facilityCode} ,</if>
+            <if test="clientcode != null and clientcode != ''"> #{clientcode} ,</if>
+            <if test="companycode != null and companycode != ''"> #{companycode} ,</if>
+            <if test="storecode != null and storecode != ''"> #{storecode} ,</if>
+            <if test="facilitycode != null and facilitycode != ''"> #{facilitycode} ,</if>
             <if test="code != null and code != ''"> #{code} ,</if>
-            <if test="internalInstructionType != null and internalInstructionType != ''"> #{internalInstructionType} ,</if>
-            <if test="bizChannel != null and bizChannel != ''"> #{bizChannel} ,</if>
-            <if test="refOrderId != null and refOrderId != ''"> #{refOrderId} ,</if>
-            <if test="refOrderCode != null and refOrderCode != ''"> #{refOrderCode} ,</if>
-            <if test="refOrderType != null and refOrderType != ''"> #{refOrderType} ,</if>
+            <if test="internalinstructiontype != null and internalinstructiontype != ''"> #{internalinstructiontype} ,</if>
+            <if test="bizchannel != null and bizchannel != ''"> #{bizchannel} ,</if>
+            <if test="reforderid != null and reforderid != ''"> #{reforderid} ,</if>
+            <if test="refordercode != null and refordercode != ''"> #{refordercode} ,</if>
+            <if test="refordertype != null and refordertype != ''"> #{refordertype} ,</if>
             <if test="closed != null and closed != ''"> #{closed} ,</if>
-            <if test="closedBy != null and closedBy != ''"> #{closedBy} ,</if>
+            <if test="closedby != null and closedby != ''"> #{closedby} ,</if>
             <if test="status != null and status != ''"> #{status} ,</if>
-            <if test="allowOverReceive != null and allowOverReceive != ''"> #{allowOverReceive} ,</if>
-            <if test="shipFromAttentionTo != null and shipFromAttentionTo != ''"> #{shipFromAttentionTo} ,</if>
-            <if test="shipFromAddress != null and shipFromAddress != ''"> #{shipFromAddress} ,</if>
-            <if test="shipFromCountry != null and shipFromCountry != ''"> #{shipFromCountry} ,</if>
-            <if test="shipFromState != null and shipFromState != ''"> #{shipFromState} ,</if>
-            <if test="shipFromCity != null and shipFromCity != ''"> #{shipFromCity} ,</if>
-            <if test="shipFromDistrict != null and shipFromDistrict != ''"> #{shipFromDistrict} ,</if>
-            <if test="shipFromMobile != null and shipFromMobile != ''"> #{shipFromMobile} ,</if>
-            <if test="totalLines != null and totalLines != ''"> #{totalLines} ,</if>
-            <if test="totalQty != null and totalQty != ''"> #{totalQty} ,</if>
-            <if test="totalAmount != null and totalAmount != ''"> #{totalAmount} ,</if>
-            <if test="totalWeight != null and totalWeight != ''"> #{totalWeight} ,</if>
-            <if test="totalVolume != null and totalVolume != ''"> #{totalVolume} ,</if>
-            <if test="totalVolumeWeight != null and totalVolumeWeight != ''"> #{totalVolumeWeight} ,</if>
-            <if test="totalFulfillAmount != null and totalFulfillAmount != ''"> #{totalFulfillAmount} ,</if>
-            <if test="totalFulfillWeight != null and totalFulfillWeight != ''"> #{totalFulfillWeight} ,</if>
-            <if test="totalFulfillVolume != null and totalFulfillVolume != ''"> #{totalFulfillVolume} ,</if>
-            <if test="totalFulfillVolumeWeight != null and totalFulfillVolumeWeight != ''"> #{totalFulfillVolumeWeight} ,</if>
-            <if test="totalFulfillQty != null and totalFulfillQty != ''"> #{totalFulfillQty} ,</if>
-            <if test="totalCases != null and totalCases != ''"> #{totalCases} ,</if>
-            <if test="totalContainers != null and totalContainers != ''"> #{totalContainers} ,</if>
-            <if test="closeAtQty != null and closeAtQty != ''"> #{closeAtQty} ,</if>
-            <if test="quantityUM != null and quantityUM != ''"> #{quantityUM} ,</if>
-            <if test="weightUM != null and weightUM != ''"> #{weightUM} ,</if>
-            <if test="volumeUM != null and volumeUM != ''"> #{volumeUM} ,</if>
-            <if test="checkInFrom != null and checkInFrom != ''"> #{checkInFrom} ,</if>
-            <if test="checkInTo != null and checkInTo != ''"> #{checkInTo} ,</if>
-            <if test="closedAt != null and closedAt != ''"> #{closedAt} ,</if>
-            <if test="sourcePlatformCode != null and sourcePlatformCode != ''"> #{sourcePlatformCode} ,</if>
-            <if test="sourceOrderCode != null and sourceOrderCode != ''"> #{sourceOrderCode} ,</if>
+            <if test="allowoverreceive != null and allowoverreceive != ''"> #{allowoverreceive} ,</if>
+            <if test="shipfromattentionto != null and shipfromattentionto != ''"> #{shipfromattentionto} ,</if>
+            <if test="shipfromaddress != null and shipfromaddress != ''"> #{shipfromaddress} ,</if>
+            <if test="shipfromcountry != null and shipfromcountry != ''"> #{shipfromcountry} ,</if>
+            <if test="shipfromstate != null and shipfromstate != ''"> #{shipfromstate} ,</if>
+            <if test="shipfromcity != null and shipfromcity != ''"> #{shipfromcity} ,</if>
+            <if test="shipfromdistrict != null and shipfromdistrict != ''"> #{shipfromdistrict} ,</if>
+            <if test="shipfrompostalcode != null and shipfrompostalcode != ''"> #{shipfrompostalcode} ,</if>
+            <if test="shipfrommobile != null and shipfrommobile != ''"> #{shipfrommobile} ,</if>
+            <if test="shipfromemail != null and shipfromemail != ''"> #{shipfromemail} ,</if>
+            <if test="totallines != null and totallines != ''"> #{totallines} ,</if>
+            <if test="totalqty != null and totalqty != ''"> #{totalqty} ,</if>
+            <if test="totalamount != null and totalamount != ''"> #{totalamount} ,</if>
+            <if test="totalweight != null and totalweight != ''"> #{totalweight} ,</if>
+            <if test="totalvolume != null and totalvolume != ''"> #{totalvolume} ,</if>
+            <if test="totalvolumeweight != null and totalvolumeweight != ''"> #{totalvolumeweight} ,</if>
+            <if test="totalfulfillamount != null and totalfulfillamount != ''"> #{totalfulfillamount} ,</if>
+            <if test="totalfulfillweight != null and totalfulfillweight != ''"> #{totalfulfillweight} ,</if>
+            <if test="totalfulfillvolume != null and totalfulfillvolume != ''"> #{totalfulfillvolume} ,</if>
+            <if test="totalfulfillvolumeweight != null and totalfulfillvolumeweight != ''"> #{totalfulfillvolumeweight} ,</if>
+            <if test="totalfulfillqty != null and totalfulfillqty != ''"> #{totalfulfillqty} ,</if>
+            <if test="totalcases != null and totalcases != ''"> #{totalcases} ,</if>
+            <if test="totalcontainers != null and totalcontainers != ''"> #{totalcontainers} ,</if>
+            <if test="closeatqty != null and closeatqty != ''"> #{closeatqty} ,</if>
+            <if test="quantityum != null and quantityum != ''"> #{quantityum} ,</if>
+            <if test="weightum != null and weightum != ''"> #{weightum} ,</if>
+            <if test="volumeum != null and volumeum != ''"> #{volumeum} ,</if>
+            <if test="checkinfrom != null and checkinfrom != ''"> #{checkinfrom} ,</if>
+            <if test="checkinto != null and checkinto != ''"> #{checkinto} ,</if>
+            <if test="closedat != null and closedat != ''"> #{closedat} ,</if>
+            <if test="sourceplatformcode != null and sourceplatformcode != ''"> #{sourceplatformcode} ,</if>
+            <if test="sourceordercode != null and sourceordercode != ''"> #{sourceordercode} ,</if>
             <if test="created != null and created != ''"> #{created} ,</if>
-            <if test="createdBy != null and createdBy != ''"> #{createdBy} ,</if>
-            <if test="lastUpdated != null and lastUpdated != ''"> #{lastUpdated} ,</if>
-            <if test="lastUpdatedBy != null and lastUpdatedBy != ''"> #{lastUpdatedBy} ,</if>
-            <if test="returnWaybillCode != null and returnWaybillCode != ''"> #{returnWaybillCode} ,</if>
-            <if test="returnCarrier != null and returnCarrier != ''"> #{returnCarrier} ,</if>
+            <if test="createdby != null and createdby != ''"> #{createdby} ,</if>
+            <if test="lastupdated != null and lastupdated != ''"> #{lastupdated} ,</if>
+            <if test="lastupdatedby != null and lastupdatedby != ''"> #{lastupdatedby} ,</if>
+            <if test="returnwaybillcode != null and returnwaybillcode != ''"> #{returnwaybillcode} ,</if>
+            <if test="returncarrier != null and returncarrier != ''"> #{returncarrier} ,</if>
+            <if test="refundedat != null and refundedat != ''"> #{refundedat} ,</if>
+            <if test="refundstatus != null and refundstatus != ''"> #{refundstatus} ,</if>
             <if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from tocofs_returngoods a WHERE a.sts = 'Y' ),</if>
     <if test="sts == null ">'Y',</if>
   </trim>
@@ -470,132 +503,134 @@
 
 <!-- 批量新增 -->
 <insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
-  insert into tocofs_returngoods(client_code, company_code, store_code, facility_code, code, internal_instruction_type, biz_channel, ref_order_id, ref_order_code, ref_order_type, closed, closed_by, status, allow_over_receive, ship_from_attention_to, ship_from_address, ship_from_country, ship_from_state, ship_from_city, ship_from_district, ship_from_mobile, total_lines, total_qty, total_amount, total_weight, total_volume, total_volume_weight, total_fulfill_amount, total_fulfill_weight, total_fulfill_volume, total_fulfill_volume_weight, total_fulfill_qty, total_cases, total_containers, close_at_qty, quantity_u_m, weight_u_m, volume_u_m, check_in_from, check_in_to, closed_at, source_platform_code, source_order_code, created, created_by, last_updated, last_updated_by, return_waybill_code, return_carrier,  sts) 
+  insert into tocofs_returngoods(clientCode, companyCode, storeCode, facilityCode, code, internalInstructionType, bizChannel, refOrderId, refOrderCode, refOrderType, closed, closedBy, status, allowOverReceive, shipFromAttentionTo, shipFromAddress, shipFromCountry, shipFromState, shipFromCity, shipFromDistrict, shipFromPostalCode, shipFromMobile, shipFromEmail, totalLines, totalQty, totalAmount, totalWeight, totalVolume, totalVolumeWeight, totalFulfillAmount, totalFulfillWeight, totalFulfillVolume, totalFulfillVolumeWeight, totalFulfillQty, totalCases, totalContainers, closeAtQty, quantityUM, weightUM, volumeUM, checkInFrom, checkInTo, closedAt, sourcePlatformCode, sourceOrderCode, created, createdBy, lastUpdated, lastUpdatedBy, returnWaybillCode, returnCarrier, refundedAt, refundStatus,  sts) 
     values
     <foreach collection="entities" item="entity" separator=",">
-    (#{entity.clientCode},#{entity.companyCode},#{entity.storeCode},#{entity.facilityCode},#{entity.code},#{entity.internalInstructionType},#{entity.bizChannel},#{entity.refOrderId},#{entity.refOrderCode},#{entity.refOrderType},#{entity.closed},#{entity.closedBy},#{entity.status},#{entity.allowOverReceive},#{entity.shipFromAttentionTo},#{entity.shipFromAddress},#{entity.shipFromCountry},#{entity.shipFromState},#{entity.shipFromCity},#{entity.shipFromDistrict},#{entity.shipFromMobile},#{entity.totalLines},#{entity.totalQty},#{entity.totalAmount},#{entity.totalWeight},#{entity.totalVolume},#{entity.totalVolumeWeight},#{entity.totalFulfillAmount},#{entity.totalFulfillWeight},#{entity.totalFulfillVolume},#{entity.totalFulfillVolumeWeight},#{entity.totalFulfillQty},#{entity.totalCases},#{entity.totalContainers},#{entity.closeAtQty},#{entity.quantityUM},#{entity.weightUM},#{entity.volumeUM},#{entity.checkInFrom},#{entity.checkInTo},#{entity.closedAt},#{entity.sourcePlatformCode},#{entity.sourceOrderCode},#{entity.created},#{entity.createdBy},#{entity.lastUpdated},#{entity.lastUpdatedBy},#{entity.returnWaybillCode},#{entity.returnCarrier}, 'Y')
+    (#{entity.clientcode},#{entity.companycode},#{entity.storecode},#{entity.facilitycode},#{entity.code},#{entity.internalinstructiontype},#{entity.bizchannel},#{entity.reforderid},#{entity.refordercode},#{entity.refordertype},#{entity.closed},#{entity.closedby},#{entity.status},#{entity.allowoverreceive},#{entity.shipfromattentionto},#{entity.shipfromaddress},#{entity.shipfromcountry},#{entity.shipfromstate},#{entity.shipfromcity},#{entity.shipfromdistrict},#{entity.shipfrompostalcode},#{entity.shipfrommobile},#{entity.shipfromemail},#{entity.totallines},#{entity.totalqty},#{entity.totalamount},#{entity.totalweight},#{entity.totalvolume},#{entity.totalvolumeweight},#{entity.totalfulfillamount},#{entity.totalfulfillweight},#{entity.totalfulfillvolume},#{entity.totalfulfillvolumeweight},#{entity.totalfulfillqty},#{entity.totalcases},#{entity.totalcontainers},#{entity.closeatqty},#{entity.quantityum},#{entity.weightum},#{entity.volumeum},#{entity.checkinfrom},#{entity.checkinto},#{entity.closedat},#{entity.sourceplatformcode},#{entity.sourceordercode},#{entity.created},#{entity.createdby},#{entity.lastupdated},#{entity.lastupdatedby},#{entity.returnwaybillcode},#{entity.returncarrier},#{entity.refundedat},#{entity.refundstatus}, 'Y')
     </foreach>
 </insert>
 
-    <!-- 批量新增 -->
-    <insert id="entityInsertBatchV2" keyProperty="id" useGeneratedKeys="true">
-        insert IGNORE into tocofs_returngoods(client_code, company_code, store_code, facility_code, code, internal_instruction_type, biz_channel, ref_order_id, ref_order_code, ref_order_type, closed, closed_by, status, allow_over_receive, ship_from_attention_to, ship_from_address, ship_from_country, ship_from_state, ship_from_city, ship_from_district, ship_from_mobile, total_lines, total_qty, total_amount, total_weight, total_volume, total_volume_weight, total_fulfill_amount, total_fulfill_weight, total_fulfill_volume, total_fulfill_volume_weight, total_fulfill_qty, total_cases, total_containers, close_at_qty, quantity_u_m, weight_u_m, volume_u_m, check_in_from, check_in_to, closed_at, source_platform_code, source_order_code, created, created_by, last_updated, last_updated_by, return_waybill_code, return_carrier,id)
-        values
-        <foreach collection="list" item="entity" separator=",">
-            (#{entity.clientCode},#{entity.companyCode},#{entity.storeCode},#{entity.facilityCode},#{entity.code},#{entity.internalInstructionType},#{entity.bizChannel},#{entity.refOrderId},#{entity.refOrderCode},#{entity.refOrderType},#{entity.closed},#{entity.closedBy},#{entity.status},#{entity.allowOverReceive},#{entity.shipFromAttentionTo},#{entity.shipFromAddress},#{entity.shipFromCountry},#{entity.shipFromState},#{entity.shipFromCity},#{entity.shipFromDistrict},#{entity.shipFromMobile},#{entity.totalLines},#{entity.totalQty},#{entity.totalAmount},#{entity.totalWeight},#{entity.totalVolume},#{entity.totalVolumeWeight},#{entity.totalFulfillAmount},#{entity.totalFulfillWeight},#{entity.totalFulfillVolume},#{entity.totalFulfillVolumeWeight},#{entity.totalFulfillQty},#{entity.totalCases},#{entity.totalContainers},#{entity.closeAtQty},#{entity.quantityUM},#{entity.weightUM},#{entity.volumeUM},#{entity.checkInFrom},#{entity.checkInTo},#{entity.closedAt},#{entity.sourcePlatformCode},#{entity.sourceOrderCode},#{entity.created},#{entity.createdBy},#{entity.lastUpdated},#{entity.lastUpdatedBy},#{entity.returnWaybillCode},#{entity.returnCarrier},#{entity.id})
-        </foreach>
-    </insert>
-
 <!-- 批量新增或者修改-->
 <insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
-    insert into tocofs_returngoods(client_code, company_code, store_code, facility_code, code, internal_instruction_type, biz_channel, ref_order_id, ref_order_code, ref_order_type, closed, closed_by, status, allow_over_receive, ship_from_attention_to, ship_from_address, ship_from_country, ship_from_state, ship_from_city, ship_from_district, ship_from_mobile, total_lines, total_qty, total_amount, total_weight, total_volume, total_volume_weight, total_fulfill_amount, total_fulfill_weight, total_fulfill_volume, total_fulfill_volume_weight, total_fulfill_qty, total_cases, total_containers, close_at_qty, quantity_u_m, weight_u_m, volume_u_m, check_in_from, check_in_to, closed_at, source_platform_code, source_order_code, created, created_by, last_updated, last_updated_by, return_waybill_code, return_carrier)
+    insert into tocofs_returngoods(id,clientCode, companyCode, storeCode, facilityCode, code, internalInstructionType, bizChannel, refOrderId, refOrderCode, refOrderType, closed, closedBy, status, allowOverReceive, shipFromAttentionTo, shipFromAddress, shipFromCountry, shipFromState, shipFromCity, shipFromDistrict, shipFromPostalCode, shipFromMobile, shipFromEmail, totalLines, totalQty, totalAmount, totalWeight, totalVolume, totalVolumeWeight, totalFulfillAmount, totalFulfillWeight, totalFulfillVolume, totalFulfillVolumeWeight, totalFulfillQty, totalCases, totalContainers, closeAtQty, quantityUM, weightUM, volumeUM, checkInFrom, checkInTo, closedAt, sourcePlatformCode, sourceOrderCode, created, createdBy, lastUpdated, lastUpdatedBy, returnWaybillCode, returnCarrier, refundedAt, refundStatus)
     values
     <foreach collection="entities" item="entity" separator=",">
-    (#{entity.clientCode},#{entity.companyCode},#{entity.storeCode},#{entity.facilityCode},#{entity.code},#{entity.internalInstructionType},#{entity.bizChannel},#{entity.refOrderId},#{entity.refOrderCode},#{entity.refOrderType},#{entity.closed},#{entity.closedBy},#{entity.status},#{entity.allowOverReceive},#{entity.shipFromAttentionTo},#{entity.shipFromAddress},#{entity.shipFromCountry},#{entity.shipFromState},#{entity.shipFromCity},#{entity.shipFromDistrict},#{entity.shipFromMobile},#{entity.totalLines},#{entity.totalQty},#{entity.totalAmount},#{entity.totalWeight},#{entity.totalVolume},#{entity.totalVolumeWeight},#{entity.totalFulfillAmount},#{entity.totalFulfillWeight},#{entity.totalFulfillVolume},#{entity.totalFulfillVolumeWeight},#{entity.totalFulfillQty},#{entity.totalCases},#{entity.totalContainers},#{entity.closeAtQty},#{entity.quantityUM},#{entity.weightUM},#{entity.volumeUM},#{entity.checkInFrom},#{entity.checkInTo},#{entity.closedAt},#{entity.sourcePlatformCode},#{entity.sourceOrderCode},#{entity.created},#{entity.createdBy},#{entity.lastUpdated},#{entity.lastUpdatedBy},#{entity.returnWaybillCode},#{entity.returnCarrier})
+    (#{entity.id},#{entity.clientcode},#{entity.companycode},#{entity.storecode},#{entity.facilitycode},#{entity.code},#{entity.internalinstructiontype},#{entity.bizchannel},#{entity.reforderid},#{entity.refordercode},#{entity.refordertype},#{entity.closed},#{entity.closedby},#{entity.status},#{entity.allowoverreceive},#{entity.shipfromattentionto},#{entity.shipfromaddress},#{entity.shipfromcountry},#{entity.shipfromstate},#{entity.shipfromcity},#{entity.shipfromdistrict},#{entity.shipfrompostalcode},#{entity.shipfrommobile},#{entity.shipfromemail},#{entity.totallines},#{entity.totalqty},#{entity.totalamount},#{entity.totalweight},#{entity.totalvolume},#{entity.totalvolumeweight},#{entity.totalfulfillamount},#{entity.totalfulfillweight},#{entity.totalfulfillvolume},#{entity.totalfulfillvolumeweight},#{entity.totalfulfillqty},#{entity.totalcases},#{entity.totalcontainers},#{entity.closeatqty},#{entity.quantityum},#{entity.weightum},#{entity.volumeum},#{entity.checkinfrom},#{entity.checkinto},#{entity.closedat},#{entity.sourceplatformcode},#{entity.sourceordercode},#{entity.created},#{entity.createdby},#{entity.lastupdated},#{entity.lastupdatedby},#{entity.returnwaybillcode},#{entity.returncarrier},#{entity.refundedat},#{entity.refundstatus})
     </foreach>
     on duplicate key update
-    client_code = values(client_code),
-    company_code = values(company_code),
-    store_code = values(store_code),
-    facility_code = values(facility_code),
+    id = values(id),
+    clientCode = values(clientCode),
+    companyCode = values(companyCode),
+    storeCode = values(storeCode),
+    facilityCode = values(facilityCode),
     code = values(code),
-    internal_instruction_type = values(internal_instruction_type),
-    biz_channel = values(biz_channel),
-    ref_order_id = values(ref_order_id),
-    ref_order_code = values(ref_order_code),
-    ref_order_type = values(ref_order_type),
+    internalInstructionType = values(internalInstructionType),
+    bizChannel = values(bizChannel),
+    refOrderId = values(refOrderId),
+    refOrderCode = values(refOrderCode),
+    refOrderType = values(refOrderType),
     closed = values(closed),
-    closed_by = values(closed_by),
+    closedBy = values(closedBy),
     status = values(status),
-    allow_over_receive = values(allow_over_receive),
-    ship_from_attention_to = values(ship_from_attention_to),
-    ship_from_address = values(ship_from_address),
-    ship_from_country = values(ship_from_country),
-    ship_from_state = values(ship_from_state),
-    ship_from_city = values(ship_from_city),
-    ship_from_district = values(ship_from_district),
-    ship_from_mobile = values(ship_from_mobile),
-    total_lines = values(total_lines),
-    total_qty = values(total_qty),
-    total_amount = values(total_amount),
-    total_weight = values(total_weight),
-    total_volume = values(total_volume),
-    total_volume_weight = values(total_volume_weight),
-    total_fulfill_amount = values(total_fulfill_amount),
-    total_fulfill_weight = values(total_fulfill_weight),
-    total_fulfill_volume = values(total_fulfill_volume),
-    total_fulfill_volume_weight = values(total_fulfill_volume_weight),
-    total_fulfill_qty = values(total_fulfill_qty),
-    total_cases = values(total_cases),
-    total_containers = values(total_containers),
-    close_at_qty = values(close_at_qty),
-    quantity_u_m = values(quantity_u_m),
-    weight_u_m = values(weight_u_m),
-    volume_u_m = values(volume_u_m),
-    check_in_from = values(check_in_from),
-    check_in_to = values(check_in_to),
-    closed_at = values(closed_at),
-    source_platform_code = values(source_platform_code),
-    source_order_code = values(source_order_code),
+    allowOverReceive = values(allowOverReceive),
+    shipFromAttentionTo = values(shipFromAttentionTo),
+    shipFromAddress = values(shipFromAddress),
+    shipFromCountry = values(shipFromCountry),
+    shipFromState = values(shipFromState),
+    shipFromCity = values(shipFromCity),
+    shipFromDistrict = values(shipFromDistrict),
+    shipFromPostalCode = values(shipFromPostalCode),
+    shipFromMobile = values(shipFromMobile),
+    shipFromEmail = values(shipFromEmail),
+    totalLines = values(totalLines),
+    totalQty = values(totalQty),
+    totalAmount = values(totalAmount),
+    totalWeight = values(totalWeight),
+    totalVolume = values(totalVolume),
+    totalVolumeWeight = values(totalVolumeWeight),
+    totalFulfillAmount = values(totalFulfillAmount),
+    totalFulfillWeight = values(totalFulfillWeight),
+    totalFulfillVolume = values(totalFulfillVolume),
+    totalFulfillVolumeWeight = values(totalFulfillVolumeWeight),
+    totalFulfillQty = values(totalFulfillQty),
+    totalCases = values(totalCases),
+    totalContainers = values(totalContainers),
+    closeAtQty = values(closeAtQty),
+    quantityUM = values(quantityUM),
+    weightUM = values(weightUM),
+    volumeUM = values(volumeUM),
+    checkInFrom = values(checkInFrom),
+    checkInTo = values(checkInTo),
+    closedAt = values(closedAt),
+    sourcePlatformCode = values(sourcePlatformCode),
+    sourceOrderCode = values(sourceOrderCode),
     created = values(created),
-    created_by = values(created_by),
-    last_updated = values(last_updated),
-    last_updated_by = values(last_updated_by),
-    return_waybill_code = values(return_waybill_code),
-    return_carrier = values(return_carrier)</insert>
+    createdBy = values(createdBy),
+    lastUpdated = values(lastUpdated),
+    lastUpdatedBy = values(lastUpdatedBy),
+    returnWaybillCode = values(returnWaybillCode),
+    returnCarrier = values(returnCarrier),
+    refundedAt = values(refundedAt),
+    refundStatus = values(refundStatus)
+</insert>
+
 <!--通过主键修改方法-->
 <update id="entity_update" parameterType = "com.hzya.frame.plugin.lets.ofs.entity.TocofsReturngoodsEntity" >
 update tocofs_returngoods  set
 <trim suffix="" suffixOverrides=",">
-  <if test="clientCode != null and clientCode != ''"> client_code = #{clientCode},</if>
-  <if test="companyCode != null and companyCode != ''"> company_code = #{companyCode},</if>
-  <if test="storeCode != null and storeCode != ''"> store_code = #{storeCode},</if>
-  <if test="facilityCode != null and facilityCode != ''"> facility_code = #{facilityCode},</if>
+  <if test="clientcode != null and clientcode != ''"> clientCode = #{clientcode},</if>
+  <if test="companycode != null and companycode != ''"> companyCode = #{companycode},</if>
+  <if test="storecode != null and storecode != ''"> storeCode = #{storecode},</if>
+  <if test="facilitycode != null and facilitycode != ''"> facilityCode = #{facilitycode},</if>
   <if test="code != null and code != ''"> code = #{code},</if>
-  <if test="internalInstructionType != null and internalInstructionType != ''"> internal_instruction_type = #{internalInstructionType},</if>
-  <if test="bizChannel != null and bizChannel != ''"> biz_channel = #{bizChannel},</if>
-  <if test="refOrderId != null and refOrderId != ''"> ref_order_id = #{refOrderId},</if>
-  <if test="refOrderCode != null and refOrderCode != ''"> ref_order_code = #{refOrderCode},</if>
-  <if test="refOrderType != null and refOrderType != ''"> ref_order_type = #{refOrderType},</if>
+  <if test="internalinstructiontype != null and internalinstructiontype != ''"> internalInstructionType = #{internalinstructiontype},</if>
+  <if test="bizchannel != null and bizchannel != ''"> bizChannel = #{bizchannel},</if>
+  <if test="reforderid != null and reforderid != ''"> refOrderId = #{reforderid},</if>
+  <if test="refordercode != null and refordercode != ''"> refOrderCode = #{refordercode},</if>
+  <if test="refordertype != null and refordertype != ''"> refOrderType = #{refordertype},</if>
   <if test="closed != null and closed != ''"> closed = #{closed},</if>
-  <if test="closedBy != null and closedBy != ''"> closed_by = #{closedBy},</if>
+  <if test="closedby != null and closedby != ''"> closedBy = #{closedby},</if>
   <if test="status != null and status != ''"> status = #{status},</if>
-  <if test="allowOverReceive != null and allowOverReceive != ''"> allow_over_receive = #{allowOverReceive},</if>
-  <if test="shipFromAttentionTo != null and shipFromAttentionTo != ''"> ship_from_attention_to = #{shipFromAttentionTo},</if>
-  <if test="shipFromAddress != null and shipFromAddress != ''"> ship_from_address = #{shipFromAddress},</if>
-  <if test="shipFromCountry != null and shipFromCountry != ''"> ship_from_country = #{shipFromCountry},</if>
-  <if test="shipFromState != null and shipFromState != ''"> ship_from_state = #{shipFromState},</if>
-  <if test="shipFromCity != null and shipFromCity != ''"> ship_from_city = #{shipFromCity},</if>
-  <if test="shipFromDistrict != null and shipFromDistrict != ''"> ship_from_district = #{shipFromDistrict},</if>
-  <if test="shipFromMobile != null and shipFromMobile != ''"> ship_from_mobile = #{shipFromMobile},</if>
-  <if test="totalLines != null and totalLines != ''"> total_lines = #{totalLines},</if>
-  <if test="totalQty != null and totalQty != ''"> total_qty = #{totalQty},</if>
-  <if test="totalAmount != null and totalAmount != ''"> total_amount = #{totalAmount},</if>
-  <if test="totalWeight != null and totalWeight != ''"> total_weight = #{totalWeight},</if>
-  <if test="totalVolume != null and totalVolume != ''"> total_volume = #{totalVolume},</if>
-  <if test="totalVolumeWeight != null and totalVolumeWeight != ''"> total_volume_weight = #{totalVolumeWeight},</if>
-  <if test="totalFulfillAmount != null and totalFulfillAmount != ''"> total_fulfill_amount = #{totalFulfillAmount},</if>
-  <if test="totalFulfillWeight != null and totalFulfillWeight != ''"> total_fulfill_weight = #{totalFulfillWeight},</if>
-  <if test="totalFulfillVolume != null and totalFulfillVolume != ''"> total_fulfill_volume = #{totalFulfillVolume},</if>
-  <if test="totalFulfillVolumeWeight != null and totalFulfillVolumeWeight != ''"> total_fulfill_volume_weight = #{totalFulfillVolumeWeight},</if>
-  <if test="totalFulfillQty != null and totalFulfillQty != ''"> total_fulfill_qty = #{totalFulfillQty},</if>
-  <if test="totalCases != null and totalCases != ''"> total_cases = #{totalCases},</if>
-  <if test="totalContainers != null and totalContainers != ''"> total_containers = #{totalContainers},</if>
-  <if test="closeAtQty != null and closeAtQty != ''"> close_at_qty = #{closeAtQty},</if>
-  <if test="quantityUM != null and quantityUM != ''"> quantity_u_m = #{quantityUM},</if>
-  <if test="weightUM != null and weightUM != ''"> weight_u_m = #{weightUM},</if>
-  <if test="volumeUM != null and volumeUM != ''"> volume_u_m = #{volumeUM},</if>
-  <if test="checkInFrom != null and checkInFrom != ''"> check_in_from = #{checkInFrom},</if>
-  <if test="checkInTo != null and checkInTo != ''"> check_in_to = #{checkInTo},</if>
-  <if test="closedAt != null and closedAt != ''"> closed_at = #{closedAt},</if>
-  <if test="sourcePlatformCode != null and sourcePlatformCode != ''"> source_platform_code = #{sourcePlatformCode},</if>
-  <if test="sourceOrderCode != null and sourceOrderCode != ''"> source_order_code = #{sourceOrderCode},</if>
+  <if test="allowoverreceive != null and allowoverreceive != ''"> allowOverReceive = #{allowoverreceive},</if>
+  <if test="shipfromattentionto != null and shipfromattentionto != ''"> shipFromAttentionTo = #{shipfromattentionto},</if>
+  <if test="shipfromaddress != null and shipfromaddress != ''"> shipFromAddress = #{shipfromaddress},</if>
+  <if test="shipfromcountry != null and shipfromcountry != ''"> shipFromCountry = #{shipfromcountry},</if>
+  <if test="shipfromstate != null and shipfromstate != ''"> shipFromState = #{shipfromstate},</if>
+  <if test="shipfromcity != null and shipfromcity != ''"> shipFromCity = #{shipfromcity},</if>
+  <if test="shipfromdistrict != null and shipfromdistrict != ''"> shipFromDistrict = #{shipfromdistrict},</if>
+  <if test="shipfrompostalcode != null and shipfrompostalcode != ''"> shipFromPostalCode = #{shipfrompostalcode},</if>
+  <if test="shipfrommobile != null and shipfrommobile != ''"> shipFromMobile = #{shipfrommobile},</if>
+  <if test="shipfromemail != null and shipfromemail != ''"> shipFromEmail = #{shipfromemail},</if>
+  <if test="totallines != null and totallines != ''"> totalLines = #{totallines},</if>
+  <if test="totalqty != null and totalqty != ''"> totalQty = #{totalqty},</if>
+  <if test="totalamount != null and totalamount != ''"> totalAmount = #{totalamount},</if>
+  <if test="totalweight != null and totalweight != ''"> totalWeight = #{totalweight},</if>
+  <if test="totalvolume != null and totalvolume != ''"> totalVolume = #{totalvolume},</if>
+  <if test="totalvolumeweight != null and totalvolumeweight != ''"> totalVolumeWeight = #{totalvolumeweight},</if>
+  <if test="totalfulfillamount != null and totalfulfillamount != ''"> totalFulfillAmount = #{totalfulfillamount},</if>
+  <if test="totalfulfillweight != null and totalfulfillweight != ''"> totalFulfillWeight = #{totalfulfillweight},</if>
+  <if test="totalfulfillvolume != null and totalfulfillvolume != ''"> totalFulfillVolume = #{totalfulfillvolume},</if>
+  <if test="totalfulfillvolumeweight != null and totalfulfillvolumeweight != ''"> totalFulfillVolumeWeight = #{totalfulfillvolumeweight},</if>
+  <if test="totalfulfillqty != null and totalfulfillqty != ''"> totalFulfillQty = #{totalfulfillqty},</if>
+  <if test="totalcases != null and totalcases != ''"> totalCases = #{totalcases},</if>
+  <if test="totalcontainers != null and totalcontainers != ''"> totalContainers = #{totalcontainers},</if>
+  <if test="closeatqty != null and closeatqty != ''"> closeAtQty = #{closeatqty},</if>
+  <if test="quantityum != null and quantityum != ''"> quantityUM = #{quantityum},</if>
+  <if test="weightum != null and weightum != ''"> weightUM = #{weightum},</if>
+  <if test="volumeum != null and volumeum != ''"> volumeUM = #{volumeum},</if>
+  <if test="checkinfrom != null and checkinfrom != ''"> checkInFrom = #{checkinfrom},</if>
+  <if test="checkinto != null and checkinto != ''"> checkInTo = #{checkinto},</if>
+  <if test="closedat != null and closedat != ''"> closedAt = #{closedat},</if>
+  <if test="sourceplatformcode != null and sourceplatformcode != ''"> sourcePlatformCode = #{sourceplatformcode},</if>
+  <if test="sourceordercode != null and sourceordercode != ''"> sourceOrderCode = #{sourceordercode},</if>
   <if test="created != null and created != ''"> created = #{created},</if>
-  <if test="createdBy != null and createdBy != ''"> created_by = #{createdBy},</if>
-  <if test="lastUpdated != null and lastUpdated != ''"> last_updated = #{lastUpdated},</if>
-  <if test="lastUpdatedBy != null and lastUpdatedBy != ''"> last_updated_by = #{lastUpdatedBy},</if>
-  <if test="returnWaybillCode != null and returnWaybillCode != ''"> return_waybill_code = #{returnWaybillCode},</if>
-  <if test="returnCarrier != null and returnCarrier != ''"> return_carrier = #{returnCarrier},</if>
+  <if test="createdby != null and createdby != ''"> createdBy = #{createdby},</if>
+  <if test="lastupdated != null and lastupdated != ''"> lastUpdated = #{lastupdated},</if>
+  <if test="lastupdatedby != null and lastupdatedby != ''"> lastUpdatedBy = #{lastupdatedby},</if>
+  <if test="returnwaybillcode != null and returnwaybillcode != ''"> returnWaybillCode = #{returnwaybillcode},</if>
+  <if test="returncarrier != null and returncarrier != ''"> returnCarrier = #{returncarrier},</if>
+  <if test="refundedat != null and refundedat != ''"> refundedAt = #{refundedat},</if>
+  <if test="refundstatus != null and refundstatus != ''"> refundStatus = #{refundstatus},</if>
 </trim>
 where id = #{id}
 </update>
@@ -609,55 +644,59 @@ where id = #{id}
 update tocofs_returngoods  set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
  <trim prefix="where" prefixOverrides="and"> 
         <if test="id != null and id != ''"> and id = #{id} </if>
-            <if test="clientCode != null and clientCode != ''"> and client_code = #{clientCode} </if>
-            <if test="companyCode != null and companyCode != ''"> and company_code = #{companyCode} </if>
-            <if test="storeCode != null and storeCode != ''"> and store_code = #{storeCode} </if>
-            <if test="facilityCode != null and facilityCode != ''"> and facility_code = #{facilityCode} </if>
+            <if test="clientcode != null and clientcode != ''"> and clientCode = #{clientcode} </if>
+            <if test="companycode != null and companycode != ''"> and companyCode = #{companycode} </if>
+            <if test="storecode != null and storecode != ''"> and storeCode = #{storecode} </if>
+            <if test="facilitycode != null and facilitycode != ''"> and facilityCode = #{facilitycode} </if>
             <if test="code != null and code != ''"> and code = #{code} </if>
-            <if test="internalInstructionType != null and internalInstructionType != ''"> and internal_instruction_type = #{internalInstructionType} </if>
-            <if test="bizChannel != null and bizChannel != ''"> and biz_channel = #{bizChannel} </if>
-            <if test="refOrderId != null and refOrderId != ''"> and ref_order_id = #{refOrderId} </if>
-            <if test="refOrderCode != null and refOrderCode != ''"> and ref_order_code = #{refOrderCode} </if>
-            <if test="refOrderType != null and refOrderType != ''"> and ref_order_type = #{refOrderType} </if>
+            <if test="internalinstructiontype != null and internalinstructiontype != ''"> and internalInstructionType = #{internalinstructiontype} </if>
+            <if test="bizchannel != null and bizchannel != ''"> and bizChannel = #{bizchannel} </if>
+            <if test="reforderid != null and reforderid != ''"> and refOrderId = #{reforderid} </if>
+            <if test="refordercode != null and refordercode != ''"> and refOrderCode = #{refordercode} </if>
+            <if test="refordertype != null and refordertype != ''"> and refOrderType = #{refordertype} </if>
             <if test="closed != null and closed != ''"> and closed = #{closed} </if>
-            <if test="closedBy != null and closedBy != ''"> and closed_by = #{closedBy} </if>
+            <if test="closedby != null and closedby != ''"> and closedBy = #{closedby} </if>
             <if test="status != null and status != ''"> and status = #{status} </if>
-            <if test="allowOverReceive != null and allowOverReceive != ''"> and allow_over_receive = #{allowOverReceive} </if>
-            <if test="shipFromAttentionTo != null and shipFromAttentionTo != ''"> and ship_from_attention_to = #{shipFromAttentionTo} </if>
-            <if test="shipFromAddress != null and shipFromAddress != ''"> and ship_from_address = #{shipFromAddress} </if>
-            <if test="shipFromCountry != null and shipFromCountry != ''"> and ship_from_country = #{shipFromCountry} </if>
-            <if test="shipFromState != null and shipFromState != ''"> and ship_from_state = #{shipFromState} </if>
-            <if test="shipFromCity != null and shipFromCity != ''"> and ship_from_city = #{shipFromCity} </if>
-            <if test="shipFromDistrict != null and shipFromDistrict != ''"> and ship_from_district = #{shipFromDistrict} </if>
-            <if test="shipFromMobile != null and shipFromMobile != ''"> and ship_from_mobile = #{shipFromMobile} </if>
-            <if test="totalLines != null and totalLines != ''"> and total_lines = #{totalLines} </if>
-            <if test="totalQty != null and totalQty != ''"> and total_qty = #{totalQty} </if>
-            <if test="totalAmount != null and totalAmount != ''"> and total_amount = #{totalAmount} </if>
-            <if test="totalWeight != null and totalWeight != ''"> and total_weight = #{totalWeight} </if>
-            <if test="totalVolume != null and totalVolume != ''"> and total_volume = #{totalVolume} </if>
-            <if test="totalVolumeWeight != null and totalVolumeWeight != ''"> and total_volume_weight = #{totalVolumeWeight} </if>
-            <if test="totalFulfillAmount != null and totalFulfillAmount != ''"> and total_fulfill_amount = #{totalFulfillAmount} </if>
-            <if test="totalFulfillWeight != null and totalFulfillWeight != ''"> and total_fulfill_weight = #{totalFulfillWeight} </if>
-            <if test="totalFulfillVolume != null and totalFulfillVolume != ''"> and total_fulfill_volume = #{totalFulfillVolume} </if>
-            <if test="totalFulfillVolumeWeight != null and totalFulfillVolumeWeight != ''"> and total_fulfill_volume_weight = #{totalFulfillVolumeWeight} </if>
-            <if test="totalFulfillQty != null and totalFulfillQty != ''"> and total_fulfill_qty = #{totalFulfillQty} </if>
-            <if test="totalCases != null and totalCases != ''"> and total_cases = #{totalCases} </if>
-            <if test="totalContainers != null and totalContainers != ''"> and total_containers = #{totalContainers} </if>
-            <if test="closeAtQty != null and closeAtQty != ''"> and close_at_qty = #{closeAtQty} </if>
-            <if test="quantityUM != null and quantityUM != ''"> and quantity_u_m = #{quantityUM} </if>
-            <if test="weightUM != null and weightUM != ''"> and weight_u_m = #{weightUM} </if>
-            <if test="volumeUM != null and volumeUM != ''"> and volume_u_m = #{volumeUM} </if>
-            <if test="checkInFrom != null and checkInFrom != ''"> and check_in_from = #{checkInFrom} </if>
-            <if test="checkInTo != null and checkInTo != ''"> and check_in_to = #{checkInTo} </if>
-            <if test="closedAt != null and closedAt != ''"> and closed_at = #{closedAt} </if>
-            <if test="sourcePlatformCode != null and sourcePlatformCode != ''"> and source_platform_code = #{sourcePlatformCode} </if>
-            <if test="sourceOrderCode != null and sourceOrderCode != ''"> and source_order_code = #{sourceOrderCode} </if>
+            <if test="allowoverreceive != null and allowoverreceive != ''"> and allowOverReceive = #{allowoverreceive} </if>
+            <if test="shipfromattentionto != null and shipfromattentionto != ''"> and shipFromAttentionTo = #{shipfromattentionto} </if>
+            <if test="shipfromaddress != null and shipfromaddress != ''"> and shipFromAddress = #{shipfromaddress} </if>
+            <if test="shipfromcountry != null and shipfromcountry != ''"> and shipFromCountry = #{shipfromcountry} </if>
+            <if test="shipfromstate != null and shipfromstate != ''"> and shipFromState = #{shipfromstate} </if>
+            <if test="shipfromcity != null and shipfromcity != ''"> and shipFromCity = #{shipfromcity} </if>
+            <if test="shipfromdistrict != null and shipfromdistrict != ''"> and shipFromDistrict = #{shipfromdistrict} </if>
+            <if test="shipfrompostalcode != null and shipfrompostalcode != ''"> and shipFromPostalCode = #{shipfrompostalcode} </if>
+            <if test="shipfrommobile != null and shipfrommobile != ''"> and shipFromMobile = #{shipfrommobile} </if>
+            <if test="shipfromemail != null and shipfromemail != ''"> and shipFromEmail = #{shipfromemail} </if>
+            <if test="totallines != null and totallines != ''"> and totalLines = #{totallines} </if>
+            <if test="totalqty != null and totalqty != ''"> and totalQty = #{totalqty} </if>
+            <if test="totalamount != null and totalamount != ''"> and totalAmount = #{totalamount} </if>
+            <if test="totalweight != null and totalweight != ''"> and totalWeight = #{totalweight} </if>
+            <if test="totalvolume != null and totalvolume != ''"> and totalVolume = #{totalvolume} </if>
+            <if test="totalvolumeweight != null and totalvolumeweight != ''"> and totalVolumeWeight = #{totalvolumeweight} </if>
+            <if test="totalfulfillamount != null and totalfulfillamount != ''"> and totalFulfillAmount = #{totalfulfillamount} </if>
+            <if test="totalfulfillweight != null and totalfulfillweight != ''"> and totalFulfillWeight = #{totalfulfillweight} </if>
+            <if test="totalfulfillvolume != null and totalfulfillvolume != ''"> and totalFulfillVolume = #{totalfulfillvolume} </if>
+            <if test="totalfulfillvolumeweight != null and totalfulfillvolumeweight != ''"> and totalFulfillVolumeWeight = #{totalfulfillvolumeweight} </if>
+            <if test="totalfulfillqty != null and totalfulfillqty != ''"> and totalFulfillQty = #{totalfulfillqty} </if>
+            <if test="totalcases != null and totalcases != ''"> and totalCases = #{totalcases} </if>
+            <if test="totalcontainers != null and totalcontainers != ''"> and totalContainers = #{totalcontainers} </if>
+            <if test="closeatqty != null and closeatqty != ''"> and closeAtQty = #{closeatqty} </if>
+            <if test="quantityum != null and quantityum != ''"> and quantityUM = #{quantityum} </if>
+            <if test="weightum != null and weightum != ''"> and weightUM = #{weightum} </if>
+            <if test="volumeum != null and volumeum != ''"> and volumeUM = #{volumeum} </if>
+            <if test="checkinfrom != null and checkinfrom != ''"> and checkInFrom = #{checkinfrom} </if>
+            <if test="checkinto != null and checkinto != ''"> and checkInTo = #{checkinto} </if>
+            <if test="closedat != null and closedat != ''"> and closedAt = #{closedat} </if>
+            <if test="sourceplatformcode != null and sourceplatformcode != ''"> and sourcePlatformCode = #{sourceplatformcode} </if>
+            <if test="sourceordercode != null and sourceordercode != ''"> and sourceOrderCode = #{sourceordercode} </if>
             <if test="created != null and created != ''"> and created = #{created} </if>
-            <if test="createdBy != null and createdBy != ''"> and created_by = #{createdBy} </if>
-            <if test="lastUpdated != null and lastUpdated != ''"> and last_updated = #{lastUpdated} </if>
-            <if test="lastUpdatedBy != null and lastUpdatedBy != ''"> and last_updated_by = #{lastUpdatedBy} </if>
-            <if test="returnWaybillCode != null and returnWaybillCode != ''"> and return_waybill_code = #{returnWaybillCode} </if>
-            <if test="returnCarrier != null and returnCarrier != ''"> and return_carrier = #{returnCarrier} </if>
+            <if test="createdby != null and createdby != ''"> and createdBy = #{createdby} </if>
+            <if test="lastupdated != null and lastupdated != ''"> and lastUpdated = #{lastupdated} </if>
+            <if test="lastupdatedby != null and lastupdatedby != ''"> and lastUpdatedBy = #{lastupdatedby} </if>
+            <if test="returnwaybillcode != null and returnwaybillcode != ''"> and returnWaybillCode = #{returnwaybillcode} </if>
+            <if test="returncarrier != null and returncarrier != ''"> and returnCarrier = #{returncarrier} </if>
+            <if test="refundedat != null and refundedat != ''"> and refundedAt = #{refundedat} </if>
+            <if test="refundstatus != null and refundstatus != ''"> and refundStatus = #{refundstatus} </if>
             and sts='Y'
     </trim>
 </update>
diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleReturnPluginInitializerToB.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleReturnPluginInitializerToB.java
index c3028643..9c42aa4f 100644
--- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleReturnPluginInitializerToB.java
+++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleReturnPluginInitializerToB.java
@@ -41,6 +41,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 
 import java.math.BigDecimal;
 import java.time.LocalDate;
+import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
 import java.util.*;
 import java.util.stream.Collectors;
@@ -220,6 +221,8 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity {
             @Override
             public void run() {
                 try {
+                    Assert.notNull(startTime, "startTime不能为空");
+                    Assert.notNull(endTime, "endTime不能为空");
                     //生成一个时间范围
 //                    StartAndEndVo startAndEndVo = offsetTimeTime.offsetTime();
                     //2024年8月19日 15:47:51 查询出U8C里标记的店铺TOB属性
@@ -273,7 +276,7 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity {
             public void run() {
                 try {
                     Assert.notNull(startTime, "startTime不能为空");
-                    Assert.notNull(endTime, "end不能为空");
+                    Assert.notNull(endTime, "endTime不能为空");
 
                     //生成一个时间范围
 //                    StartAndEndVo startAndEndVo = offsetTimeTime.offsetTime();
@@ -328,6 +331,7 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity {
             @Override
             public void run() {
                 try {
+                    Assert.notNull(code, "code不能为空");
                     //生成一个时间范围
 //                    StartAndEndVo startAndEndVo = offsetTimeTime.offsetTime();
                     //2024年8月19日 15:47:51 查询出U8C里标记的店铺TOB属性
@@ -375,7 +379,7 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity {
         //保存到mysql
         batchInsert(returnGoodHeaderDetailsDataDtoArrayList);
         //过滤成功的数据
-        List<StockinOrderSearchResponse.StockinOrder> stockinOrderList = filterData(returnGoodHeaderDetailsDataDtoArrayList);
+        List<StockinOrderSearchResponse.StockinOrder> stockinOrderList = filterDataStock(returnGoodHeaderDetailsDataDtoArrayList);
         //执行推送主逻辑
         implementStock(stockinOrderList);
     }
@@ -389,23 +393,147 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity {
         //保存到mysql
         batchInsert(returnGoodHeaderDetailsDataDtoArrayList);
         //过滤成功的数据
-        List<StockinOrderSearchResponse.StockinOrder> stockinOrderList = filterData(returnGoodHeaderDetailsDataDtoArrayList);
+        List<StockinOrderSearchResponse.StockinOrder> stockinOrderList = filterDataTran(returnGoodHeaderDetailsDataDtoArrayList);
         //执行推送主逻辑
         implementSuccessfulTrade(stockinOrderList);
     }
 
     /**
-     * 过滤掉成功的数据
+     * 库存:过滤掉成功的数据
      *
      * @author liuyang
      */
-    private List<StockinOrderSearchResponse.StockinOrder> filterData(List<StockinOrderSearchResponse.StockinOrder> returnGoodHeaderDetailsDataDtoArrayList) {
-        List<StockinOrderSearchResponse.StockinOrder> headerDetailsDtoList1 = new ArrayList<>();
+    private List<StockinOrderSearchResponse.StockinOrder> filterDataStock(List<StockinOrderSearchResponse.StockinOrder> returnGoodHeaderDetailsDataDtoArrayList) throws Exception {
+        //        List<StockinOrderSearchResponse.StockinOrder> headerDetailsDtoList1 = new ArrayList<>();
+        List<TocofsReturngoodsDetailedEntity> tocofsReturngoodsDetailedEntityList = new ArrayList<>();
         if (returnGoodHeaderDetailsDataDtoArrayList != null && returnGoodHeaderDetailsDataDtoArrayList.size() > 0) {
-            //TODO 出库单明细主键,需要O返回,目前没有,已经提需求
-            headerDetailsDtoList1.addAll(returnGoodHeaderDetailsDataDtoArrayList);
+            List<List<StockinOrderSearchResponse.StockinOrder>> splitListByCount = SplitListByCountUtil.splitListByCount(returnGoodHeaderDetailsDataDtoArrayList, 100);
+            for (int i = 0; i < splitListByCount.size(); i++) {
+                List<StockinOrderSearchResponse.StockinOrder> stockinOrderList = splitListByCount.get(i);
+                String idStr = commaConcatenatedPrimaryKeyStock(stockinOrderList);
+                List<TocofsReturngoodsDetailedEntity> tocofsReturngoodsDetailedEntities = queryStockTocOutLog(idStr);
+                tocofsReturngoodsDetailedEntityList.addAll(tocofsReturngoodsDetailedEntities);
+            }
         }
-        return headerDetailsDtoList1;
+        if (tocofsReturngoodsDetailedEntityList.size() > 0) {
+            return filterDataRowsAsPushOrFailedStock(tocofsReturngoodsDetailedEntityList, returnGoodHeaderDetailsDataDtoArrayList);
+        }
+        return null;
+    }
+
+    /**
+     * 筛选出未推送、或者失败的数据行,过滤库存同步业务
+     *
+     * @param tocofsReturngoodsDetailedEntityList     日志行状态
+     * @param returnGoodHeaderDetailsDataDtoArrayList 返回结果
+     * @author liuyang
+     */
+    private List<StockinOrderSearchResponse.StockinOrder> filterDataRowsAsPushOrFailedStock(List<TocofsReturngoodsDetailedEntity> tocofsReturngoodsDetailedEntityList, List<StockinOrderSearchResponse.StockinOrder> returnGoodHeaderDetailsDataDtoArrayList) throws Exception {
+        List<StockinOrderSearchResponse.StockinOrder> targetHeaderDetailsDtoList = new ArrayList<>();
+
+        if (tocofsReturngoodsDetailedEntityList != null && tocofsReturngoodsDetailedEntityList.size() > 0 && returnGoodHeaderDetailsDataDtoArrayList != null && returnGoodHeaderDetailsDataDtoArrayList.size() > 0) {
+            //字段Y(成功)或者为H(待处理)可以视为成功,完成了小段业务闭环的数据行
+            String succeseeY = "Y";
+            String succeseeH = "H";
+            for (int i = 0; i < returnGoodHeaderDetailsDataDtoArrayList.size(); i++) {
+                StockinOrderSearchResponse.StockinOrder stockinOrder = returnGoodHeaderDetailsDataDtoArrayList.get(i);
+                StockinOrderSearchResponse.StockinOrder.StockinH header = stockinOrder.getHeader();
+                List<StockinOrderSearchResponse.StockinOrder.StockinB> details = stockinOrder.getDetails();
+
+                List<StockinOrderSearchResponse.StockinOrder.StockinB> targetDetails = new ArrayList<>();
+                for (int j = 0; j < details.size(); j++) {
+                    StockinOrderSearchResponse.StockinOrder.StockinB stockinB = details.get(j);
+                    Boolean isSuccess = false;
+                    String newstate = null;
+                    for (int k = 0; k < tocofsReturngoodsDetailedEntityList.size(); k++) {
+                        TocofsReturngoodsDetailedEntity tocofsReturngoodsDetailedEntity = tocofsReturngoodsDetailedEntityList.get(k);
+                        if (tocofsReturngoodsDetailedEntity.getId().equals(stockinB.getId())) {
+                            newstate = tocofsReturngoodsDetailedEntity.getNewstate2();
+                            if (succeseeY.equals(newstate) || succeseeH.equals(newstate)) {
+                                isSuccess = true;
+                            }
+                        }
+                    }
+                    if (!isSuccess) {
+                        stockinB.setNewstate(newstate);
+                        targetDetails.add(stockinB);
+                    }
+                }
+                if (targetDetails.size() > 0) {
+                    //如果明细行中,还存在未推送或者失败的数据,则需要更新明细行
+                    stockinOrder.setDetails(targetDetails);
+                    targetHeaderDetailsDtoList.add(stockinOrder);
+                }
+            }
+        }
+        return targetHeaderDetailsDtoList;
+    }
+
+    /**
+     * 批查询toc退货入库日志,查询的量由splitListByCount方法控制
+     *
+     * @author liuyang
+     */
+    private List<TocofsReturngoodsDetailedEntity> queryStockTocOutLog(String idStr) throws Exception {
+        List<TocofsReturngoodsDetailedEntity> tocofsReturngoodsDetailedEntities = null;
+        if (idStr != null && !"".equals(idStr.trim())) {
+            TocofsReturngoodsDetailedEntity tocofsReturngoodsDetailedEntity = new TocofsReturngoodsDetailedEntity();
+            tocofsReturngoodsDetailedEntity.setIds(idStr);
+            tocofsReturngoodsDetailedEntities = iTocofsReturngoodsDetailedDao.query(tocofsReturngoodsDetailedEntity);
+        } else {
+            logger.error("idStr为空,无法查询数据!");
+        }
+        return tocofsReturngoodsDetailedEntities;
+    }
+
+    /**
+     * 逗号拼接字符串主键,作为批处理的一部分,方便下一步的批量查询操作
+     *
+     * @author liuyang
+     */
+    private String commaConcatenatedPrimaryKeyStock(List<StockinOrderSearchResponse.StockinOrder> headerDetailsDtoList2) throws Exception {
+        StringBuffer idStr = new StringBuffer();
+        if (headerDetailsDtoList2 != null && headerDetailsDtoList2.size() > 0) {
+            for (int i = 0; i < headerDetailsDtoList2.size(); i++) {
+                StockinOrderSearchResponse.StockinOrder stockinOrder = headerDetailsDtoList2.get(i);
+                StockinOrderSearchResponse.StockinOrder.StockinH header = stockinOrder.getHeader();
+                List<StockinOrderSearchResponse.StockinOrder.StockinB> details = stockinOrder.getDetails();
+                for (int j = 0; j < details.size(); j++) {
+                    StockinOrderSearchResponse.StockinOrder.StockinB stockinB = details.get(j);
+                    Assert.notNull(stockinB.getId(), "O明细主键不能为空!");
+                    Assert.state(!"".equals(stockinB.getId()), "O明细主键不能为空!");
+                    idStr.append(stockinB.getId());
+                    idStr.append(",");
+                }
+            }
+        }
+        if (idStr.length() > 0) {
+            return idStr.substring(0, idStr.length());
+        }
+        return null;
+    }
+
+    /**
+     * 确认收入:过滤掉成功的数据
+     *
+     * @author liuyang
+     */
+    private List<StockinOrderSearchResponse.StockinOrder> filterDataTran(List<StockinOrderSearchResponse.StockinOrder> returnGoodHeaderDetailsDataDtoArrayList) throws Exception {
+        //        List<StockinOrderSearchResponse.StockinOrder> headerDetailsDtoList1 = new ArrayList<>();
+        List<TocofsReturngoodsDetailedEntity> tocofsReturngoodsDetailedEntityList = new ArrayList<>();
+        if (returnGoodHeaderDetailsDataDtoArrayList != null && returnGoodHeaderDetailsDataDtoArrayList.size() > 0) {
+            List<List<StockinOrderSearchResponse.StockinOrder>> splitListByCount = SplitListByCountUtil.splitListByCount(returnGoodHeaderDetailsDataDtoArrayList, 100);
+            for (int i = 0; i < splitListByCount.size(); i++) {
+                List<StockinOrderSearchResponse.StockinOrder> stockinOrderList = splitListByCount.get(i);
+                String idStr = commaConcatenatedPrimaryKeyStock(stockinOrderList);
+                List<TocofsReturngoodsDetailedEntity> tocofsReturngoodsDetailedEntities = queryStockTocOutLog(idStr);
+                tocofsReturngoodsDetailedEntityList.addAll(tocofsReturngoodsDetailedEntities);
+            }
+        }
+        if (tocofsReturngoodsDetailedEntityList.size() > 0) {
+            return filterDataRowsAsPushOrFailedStock(tocofsReturngoodsDetailedEntityList, returnGoodHeaderDetailsDataDtoArrayList);
+        }
+        return null;
     }
 
     /**
@@ -417,16 +545,13 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity {
         if (returnGoodHeaderDetailsDataDtoArrayList != null && returnGoodHeaderDetailsDataDtoArrayList.size() > 0) {
             List<StockinOrderSearchResponse.StockinOrder.StockinH> headerDetailsDtoList1 = new ArrayList<>();
             List<StockinOrderSearchResponse.StockinOrder.StockinB> headerDetailsDtoList2 = new ArrayList<>();
-
             for (StockinOrderSearchResponse.StockinOrder index : returnGoodHeaderDetailsDataDtoArrayList) {
                 StockinOrderSearchResponse.StockinOrder.StockinH header = index.getHeader();// 主表
                 List<StockinOrderSearchResponse.StockinOrder.StockinB> details = index.getDetails();//明细表
-
                 for (int i = 0; i < details.size(); i++) {
                     StockinOrderSearchResponse.StockinOrder.StockinB stockinB = details.get(i);
                     stockinB.setReturnGoodSearchHeaderDto(header);
                 }
-
                 headerDetailsDtoList1.add(header);
                 headerDetailsDtoList2.addAll(details);
             }
@@ -438,7 +563,7 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity {
                 List<TocofsReturngoodsEntity> tocofsReturngoodsEntities = copyHeaderDto(stockinHS);
                 if (tocofsReturngoodsEntities.size() > 0) {
                     logger.info("TocofsReturngoodsEntity:插入底表{}个对象(表头)", tocofsReturngoodsEntities.size());
-                    iTocofsReturngoodsDao.entityInsertBatchV2(tocofsReturngoodsEntities);
+                    iTocofsReturngoodsDao.entityInsertOrUpdateBatch(tocofsReturngoodsEntities);
                 } else {
                     logger.info("TocofsReturngoodsEntity:没有对象被插入表头底表");
                 }
@@ -451,11 +576,13 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity {
                 List<TocofsReturngoodsDetailedEntity> tocofsReturngoodsDetailedEntities = copyDetailsDto(stockinBS);
                 if (tocofsReturngoodsDetailedEntities.size() > 0) {
                     logger.info("TocofsReturngoodsDetailedEntity:插入底表{}个对象(表体)", tocofsReturngoodsDetailedEntities.size());
-                    iTocofsReturngoodsDetailedDao.entityInsertBatchV2(tocofsReturngoodsDetailedEntities);
+                    iTocofsReturngoodsDetailedDao.entityInsertOrUpdateBatch(tocofsReturngoodsDetailedEntities);
                 } else {
                     logger.info("TocofsReturngoodsDetailedEntity:没有对象被插入表头底表");
                 }
             }
+        } else {
+            logger.info("returnGoodHeaderDetailsDataDtoArrayList为空或者原始为零!");
         }
     }
 
@@ -467,7 +594,7 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity {
      */
     private void implementStock(List<StockinOrderSearchResponse.StockinOrder> returnGoodHeaderDetailsDataDtoList) throws Exception {
         if (returnGoodHeaderDetailsDataDtoList != null) {
-            logger.info("TOB退货业务出库成功:{}行需要进行数据转换", returnGoodHeaderDetailsDataDtoList.size());
+            logger.info("TOB售后入库:{}行需要进行数据转换", returnGoodHeaderDetailsDataDtoList.size());
         }
         if (returnGoodHeaderDetailsDataDtoList != null && returnGoodHeaderDetailsDataDtoList.size() > 0) {
             try {
@@ -478,12 +605,11 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity {
                 // 查询销售收发类别
 //                BdRdclEntity bdRdclEntity = rdclUtil.queryRdClObject("201");
 
-                try {
-                    for (int i = 0; i < orderToBHeaderDtos.size(); i++) {
-                        OrderToBHeaderDto orderOutTobHeaderDto = orderToBHeaderDtos.get(i);
-                        StockinOrderSearchResponse.StockinOrder.StockinH header = orderOutTobHeaderDto.getHeader();
-                        List<StockinOrderSearchResponse.StockinOrder.StockinB> details = orderOutTobHeaderDto.getDetails();
-
+                for (int i = 0; i < orderToBHeaderDtos.size(); i++) {
+                    OrderToBHeaderDto orderOutTobHeaderDto = orderToBHeaderDtos.get(i);
+                    StockinOrderSearchResponse.StockinOrder.StockinH header = orderOutTobHeaderDto.getHeader();
+                    List<StockinOrderSearchResponse.StockinOrder.StockinB> details = orderOutTobHeaderDto.getDetails();
+                    try {
                         //销售公司、发货公司
                         BdCorpEntity bdCorpEntity = orderOutTobHeaderDto.getBdCorpEntity();
                         //发货库存组织
@@ -636,22 +762,34 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity {
                             Map<String, List<SaleorderRequestDto>> stringStringMap = new HashMap<>();
                             stringStringMap.put("saleorder", saleorderRequestDtoList);
                             SoSaleResultRootDto soSaleResultRootDto = sendU8CTOCOrder(JSON.toJSONString(stringStringMap));
+                            String vreceiptcode = null;
+                            String csaleid = null;
+                            String pk_corp = null;
                             if (soSaleResultRootDto != null) {
                                 SoSaleResultHeadDto parentvo = soSaleResultRootDto.getParentvo();
                                 List<SoSaleResultBodyDto> childrenvo = soSaleResultRootDto.getChildrenvo();
-                                logger.info("TOB红字销售订单编号:{} 主键:{} 销售公司:{}", parentvo.getVreceiptcode(), parentvo.getCsaleid(), parentvo.getPk_corp());
+                                vreceiptcode = parentvo.getVreceiptcode();
+                                csaleid = parentvo.getCsaleid();
+                                pk_corp = parentvo.getPk_corp();
                             }
+                            logger.info("TOB红字销售订单编号:{} 销售订单主键:{} 销售公司:{}", vreceiptcode, csaleid, pk_corp);
+                            //记录成功
+                            updateSuccessOrFail1(details, "Y", "success", vreceiptcode, csaleid);
                         } else {
                             logger.error("经过SQL查询判断,在U8C(红字)销售订单存在OFS入库单号为:{} OFS入库主键为:{}的单据,为了避免造成单据重复,不推送到U8C!", header.getCode(), header.getId());
                         }
+                    } catch (Exception e) {
+                        logger.error("TOB售后收入推送U8C失败", e);
+                        //记录失败
+                        String message = e.getMessage();
+                        if (message == null) {
+                            message = "未知错误";
+                        }
+                        updateSuccessOrFail1(details, "N", message, null, null);
                     }
-                } catch (Exception e) {
-                    logger.error("TOB业务转换成U8C对象过程中、或者单据推送到U8C出现异常!", e);
-                    //记录失败
                 }
             } catch (Exception e) {
                 logger.error("TOB外层转换逻辑抛出异常", e);
-                // 记录失败
             }
         }
     }
@@ -1368,9 +1506,20 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity {
      */
     private void createPrimaryKeyAndBusinessDateAndBusinessType(TocofsReturngoodsDetailedEntity tocofsReturngoodsDetailedEntity, StockinOrderSearchResponse.StockinOrder.StockinH returnGoodSearchHeaderDto) {
         if (tocofsReturngoodsDetailedEntity != null && returnGoodSearchHeaderDto != null) {
-            tocofsReturngoodsDetailedEntity.setPrimaryKey(returnGoodSearchHeaderDto.getId());//主表主键
-            tocofsReturngoodsDetailedEntity.setBusinessDate(returnGoodSearchHeaderDto.getCheckInFrom());//业务日期
-            tocofsReturngoodsDetailedEntity.setBusinessType("TOB_RETURN");//业务类型
+            //主表主键
+            if (tocofsReturngoodsDetailedEntity.getId() != null) {
+                tocofsReturngoodsDetailedEntity.setMaintableid(tocofsReturngoodsDetailedEntity.getId());
+            }
+            //业务日期-入库时间
+            if (returnGoodSearchHeaderDto.getCheckInFrom() != null) {
+                tocofsReturngoodsDetailedEntity.setBusinessdate(returnGoodSearchHeaderDto.getCheckInFrom());
+            }
+            //业务日期-退款完成时间
+            if (returnGoodSearchHeaderDto.getRefundedAt() != null) {
+                tocofsReturngoodsDetailedEntity.setRefundedat(returnGoodSearchHeaderDto.getRefundedAt());
+            }
+            //业务类型
+            tocofsReturngoodsDetailedEntity.setBusinesstype("TOB_RETURN");
         }
     }
 
@@ -1382,7 +1531,7 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity {
      */
     private void implementSuccessfulTrade(List<StockinOrderSearchResponse.StockinOrder> returnGoodHeaderDetailsDataDtoList) throws Exception {
         if (returnGoodHeaderDetailsDataDtoList != null) {
-            logger.info("TOB退货业务交易成功:{}行需要进行数据转换", returnGoodHeaderDetailsDataDtoList.size());
+            logger.info("TOB售后入库退货到账完成:{}行需要进行数据转换", returnGoodHeaderDetailsDataDtoList.size());
         }
         if (returnGoodHeaderDetailsDataDtoList != null && returnGoodHeaderDetailsDataDtoList.size() > 0) {
             try {
@@ -1400,146 +1549,163 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity {
                     StockinOrderSearchResponse.StockinOrder.StockinH header = orderOutTobHeaderDto.getHeader();
                     List<StockinOrderSearchResponse.StockinOrder.StockinB> details = orderOutTobHeaderDto.getDetails();
 
-                    //销售公司、发货公司
-                    BdCorpEntity bdCorpEntity = orderOutTobHeaderDto.getBdCorpEntity();
-                    //发货库存组织
-                    BdCalbodyEntity bdCalbodyEntity = orderOutTobHeaderDto.getBdCalbodyEntity();
-                    //入库仓库
-                    BdStordocEntity bdStordocEntity = orderOutTobHeaderDto.getBdStordocEntity();
-                    //销售组织
-                    BdSalestruEntity bdSalestruEntity = orderOutTobHeaderDto.getBdSalestruEntity();
-                    //业务部门
-                    BdDeptdocEntity bdDeptdocEntity = orderOutTobHeaderDto.getBdDeptdocEntity();
-                    //客商基本档案
-                    BdCubasdocEntity bdCubasdocEntity = orderOutTobHeaderDto.getBdCubasdocEntity();
-                    //客商管理档案
-                    BdCumandocEntity bdCumandocEntity = orderOutTobHeaderDto.getBdCumandocEntity();
-                    //发货公司
-                    BdCorpEntity deliverGoodsCorp = orderOutTobHeaderDto.getDeliverGoodsCorp();
-                    //平台档案
-                    BdDefdocEntity platformArchives = orderOutTobHeaderDto.getPlatformArchives();
-                    //生成业务日期
-                    String successfulTradeDate = createSuccessFulTradeDate(orderOutTobHeaderDto);
-                    //店铺
-                    BdDefdocEntity shopArchives = orderOutTobHeaderDto.getShopArchives();
-                    //U8C销售订单
-                    SoSaleEntity soSaleEntity = orderOutTobHeaderDto.getSoSaleEntity();
-                    //U8C销售订单明细行
-                    List<SoSaleorderBEntity> soSaleorderBEntityList = orderOutTobHeaderDto.getSoSaleorderBEntityList();
-                    //U8C销售出库单
-                    IcGeneralHEntity icGeneralHEntity = orderOutTobHeaderDto.getIcGeneralHEntity();
-                    //U8C销售出库单明细行
-                    List<IcGeneralBEntity> icGeneralBEntityList = orderOutTobHeaderDto.getIcGeneralBEntityList();
-                    //U8C销售订单执行情况明细表
-                    List<ExtIntegrationTaskLivingDetailsQueryVo> extIntegrationTaskLivingDetailsQueryVos = orderOutTobHeaderDto.getExtIntegrationTaskLivingDetailsQueryVos();
-                    //OFS销售订单
-                    SaleOrderMessageDto saleOrderMessageDto = orderOutTobHeaderDto.getSaleOrderMessageDto();
-                    //OFS售后订单
-                    RerturnGoodsOrderSearchData ofsRertunOrder = orderOutTobHeaderDto.getOfsRertunOrder();
-                    //OFS收发类别
-                    BdRdclEntity bdRdclEntity = orderOutTobHeaderDto.getBdRdclEntity();
+                    try {
+                        //销售公司、发货公司
+                        BdCorpEntity bdCorpEntity = orderOutTobHeaderDto.getBdCorpEntity();
+                        //发货库存组织
+                        BdCalbodyEntity bdCalbodyEntity = orderOutTobHeaderDto.getBdCalbodyEntity();
+                        //入库仓库
+                        BdStordocEntity bdStordocEntity = orderOutTobHeaderDto.getBdStordocEntity();
+                        //销售组织
+                        BdSalestruEntity bdSalestruEntity = orderOutTobHeaderDto.getBdSalestruEntity();
+                        //业务部门
+                        BdDeptdocEntity bdDeptdocEntity = orderOutTobHeaderDto.getBdDeptdocEntity();
+                        //客商基本档案
+                        BdCubasdocEntity bdCubasdocEntity = orderOutTobHeaderDto.getBdCubasdocEntity();
+                        //客商管理档案
+                        BdCumandocEntity bdCumandocEntity = orderOutTobHeaderDto.getBdCumandocEntity();
+                        //发货公司
+                        BdCorpEntity deliverGoodsCorp = orderOutTobHeaderDto.getDeliverGoodsCorp();
+                        //平台档案
+                        BdDefdocEntity platformArchives = orderOutTobHeaderDto.getPlatformArchives();
+                        //生成业务日期
+                        String successfulTradeDate = createSuccessFulTradeDate(orderOutTobHeaderDto);
+                        //店铺
+                        BdDefdocEntity shopArchives = orderOutTobHeaderDto.getShopArchives();
+                        //U8C销售订单
+                        SoSaleEntity soSaleEntity = orderOutTobHeaderDto.getSoSaleEntity();
+                        //U8C销售订单明细行
+                        List<SoSaleorderBEntity> soSaleorderBEntityList = orderOutTobHeaderDto.getSoSaleorderBEntityList();
+                        //U8C销售出库单
+                        IcGeneralHEntity icGeneralHEntity = orderOutTobHeaderDto.getIcGeneralHEntity();
+                        //U8C销售出库单明细行
+                        List<IcGeneralBEntity> icGeneralBEntityList = orderOutTobHeaderDto.getIcGeneralBEntityList();
+                        //U8C销售订单执行情况明细表
+                        List<ExtIntegrationTaskLivingDetailsQueryVo> extIntegrationTaskLivingDetailsQueryVos = orderOutTobHeaderDto.getExtIntegrationTaskLivingDetailsQueryVos();
+                        //OFS销售订单
+                        SaleOrderMessageDto saleOrderMessageDto = orderOutTobHeaderDto.getSaleOrderMessageDto();
+                        //OFS售后订单
+                        RerturnGoodsOrderSearchData ofsRertunOrder = orderOutTobHeaderDto.getOfsRertunOrder();
+                        //OFS收发类别
+                        BdRdclEntity bdRdclEntity = orderOutTobHeaderDto.getBdRdclEntity();
 
-                    //红字销售发票表头
-                    SalesInvoiceHeadDto salesInvoiceHeadDto = new SalesInvoiceHeadDto();
-                    salesInvoiceHeadDto.setCbiztype(bdBusitypeEntity.getPkBusitype());
-                    salesInvoiceHeadDto.setCcalbodyid(bdCalbodyEntity.getPkCalbody());
-                    salesInvoiceHeadDto.setCoperatorid(OverallConstant.getOverAllValue("u8cApiZdrPK"));//制单人
-                    salesInvoiceHeadDto.setCreceiptcorpid(bdCumandocEntity.getPkCumandoc());
-                    salesInvoiceHeadDto.setCsalecorpid(bdSalestruEntity.getCsalestruid());
-                    salesInvoiceHeadDto.setPk_corp(bdCorpEntity.getPkCorp());
-                    salesInvoiceHeadDto.setDbilldate(successfulTradeDate);
-                    salesInvoiceHeadDto.setFinvoicetype("1");//不传默认为1
-                    salesInvoiceHeadDto.setCdeptid(bdDeptdocEntity.getPkDeptdoc());//部门
-                    salesInvoiceHeadDto.setCwarehouseid(bdStordocEntity.getPkStordoc());//仓库
-                    salesInvoiceHeadDto.setCdispatcherid(bdRdclEntity.getPkRdcl());//收发类别
-                    salesInvoiceHeadDto.setCreceiptcustomerid(bdCumandocEntity.getPkCumandoc());//收货单位
-                    salesInvoiceHeadDto.setCreceipttype("32");//单据类型
-                    salesInvoiceHeadDto.setDmakedate(successfulTradeDate);//制单日期
-                    salesInvoiceHeadDto.setNdiscountrate("100");//整单折扣
-                    salesInvoiceHeadDto.setDapprovedate(successfulTradeDate);//审批日期
-                    salesInvoiceHeadDto.setVnote(VNOTETYPE);
-                    salesInvoiceHeadDto.setVdef17(ProfilesActiveConstant.sourceSystem1);
-                    salesInvoiceHeadDto.setVdef19(header.getCode());
-                    salesInvoiceHeadDto.setVdef20(header.getId());
-                    //平台
-                    salesInvoiceHeadDto.setPk_defdoc2(platformArchives.getPkDefdoc());
-                    salesInvoiceHeadDto.setVdef2(platformArchives.getDocname());
-                    //店铺
-                    salesInvoiceHeadDto.setPk_defdoc1(shopArchives.getPkDefdoc());
-                    salesInvoiceHeadDto.setVdef1(shopArchives.getDocname());
+                        //红字销售发票表头
+                        SalesInvoiceHeadDto salesInvoiceHeadDto = new SalesInvoiceHeadDto();
+                        salesInvoiceHeadDto.setCbiztype(bdBusitypeEntity.getPkBusitype());
+                        salesInvoiceHeadDto.setCcalbodyid(bdCalbodyEntity.getPkCalbody());
+                        salesInvoiceHeadDto.setCoperatorid(OverallConstant.getOverAllValue("u8cApiZdrPK"));//制单人
+                        salesInvoiceHeadDto.setCreceiptcorpid(bdCumandocEntity.getPkCumandoc());
+                        salesInvoiceHeadDto.setCsalecorpid(bdSalestruEntity.getCsalestruid());
+                        salesInvoiceHeadDto.setPk_corp(bdCorpEntity.getPkCorp());
+                        salesInvoiceHeadDto.setDbilldate(successfulTradeDate);
+                        salesInvoiceHeadDto.setFinvoicetype("1");//不传默认为1
+                        salesInvoiceHeadDto.setCdeptid(bdDeptdocEntity.getPkDeptdoc());//部门
+                        salesInvoiceHeadDto.setCwarehouseid(bdStordocEntity.getPkStordoc());//仓库
+                        salesInvoiceHeadDto.setCdispatcherid(bdRdclEntity.getPkRdcl());//收发类别
+                        salesInvoiceHeadDto.setCreceiptcustomerid(bdCumandocEntity.getPkCumandoc());//收货单位
+                        salesInvoiceHeadDto.setCreceipttype("32");//单据类型
+                        salesInvoiceHeadDto.setDmakedate(successfulTradeDate);//制单日期
+                        salesInvoiceHeadDto.setNdiscountrate("100");//整单折扣
+                        salesInvoiceHeadDto.setDapprovedate(successfulTradeDate);//审批日期
+                        salesInvoiceHeadDto.setVnote(VNOTETYPE);
+                        salesInvoiceHeadDto.setVdef17(ProfilesActiveConstant.sourceSystem1);
+                        salesInvoiceHeadDto.setVdef19(header.getCode());
+                        salesInvoiceHeadDto.setVdef20(header.getId());
+                        //平台
+                        salesInvoiceHeadDto.setPk_defdoc2(platformArchives.getPkDefdoc());
+                        salesInvoiceHeadDto.setVdef2(platformArchives.getDocname());
+                        //店铺
+                        salesInvoiceHeadDto.setPk_defdoc1(shopArchives.getPkDefdoc());
+                        salesInvoiceHeadDto.setVdef1(shopArchives.getDocname());
 
-                    List<SalesInvoiceBodyDto> salesInvoiceBodyDtoList = new ArrayList<>();
-                    for (int j = 0; j < details.size(); j++) {
-                        StockinOrderSearchResponse.StockinOrder.StockinB stockinB = details.get(j);
-                        //存货管理档案:取发货公司的存货管理档案
-                        BdInvmandocEntity bdInvmandocEntity = queryInventoryMan(stockinB, bdCalbodyEntity.getPkCorp());
-                        //存货基础档案
-                        BdInvbasdocEntity bdInvbasdocEntity = queryStockBasicArchives(bdInvmandocEntity.getPkInvmandoc(), deliverGoodsCorp.getPkCorp());
-                        //根据存货基础档案编码,查询当前存货的税率
-                        BdTaxitemsEntity bdTaxitemsEntity1 = queryBdTaxitems(bdInvbasdocEntity.getInvcode());
-                        //2024年8月30日 11:20:08 查找对应的售后订单的明细行,主要取价格
-                        RerturnGoodsOrderSearchDetails afterSalesOrder = findAfterSalesOrder(stockinB, ofsRertunOrder);
-                        //查找来源单据,销售发票的来源单据为销售出库单
-                        IcGeneralBEntity sourceDocuments = findSourceDocuments(header, stockinB, soSaleorderBEntityList, icGeneralBEntityList, extIntegrationTaskLivingDetailsQueryVos);
-                        //查找来源销售订单明细行
-                        SoSaleorderBEntity sourceDocumentsV2 = findSourceDocumentsV2(header, stockinB, soSaleorderBEntityList, extIntegrationTaskLivingDetailsQueryVos);
+                        List<SalesInvoiceBodyDto> salesInvoiceBodyDtoList = new ArrayList<>();
+                        for (int j = 0; j < details.size(); j++) {
+                            StockinOrderSearchResponse.StockinOrder.StockinB stockinB = details.get(j);
+                            //存货管理档案:取发货公司的存货管理档案
+                            BdInvmandocEntity bdInvmandocEntity = queryInventoryMan(stockinB, bdCalbodyEntity.getPkCorp());
+                            //存货基础档案
+                            BdInvbasdocEntity bdInvbasdocEntity = queryStockBasicArchives(bdInvmandocEntity.getPkInvmandoc(), deliverGoodsCorp.getPkCorp());
+                            //根据存货基础档案编码,查询当前存货的税率
+                            BdTaxitemsEntity bdTaxitemsEntity1 = queryBdTaxitems(bdInvbasdocEntity.getInvcode());
+                            //2024年8月30日 11:20:08 查找对应的售后订单的明细行,主要取价格
+                            RerturnGoodsOrderSearchDetails afterSalesOrder = findAfterSalesOrder(stockinB, ofsRertunOrder);
+                            //查找来源单据,销售发票的来源单据为销售出库单
+                            IcGeneralBEntity sourceDocuments = findSourceDocuments(header, stockinB, soSaleorderBEntityList, icGeneralBEntityList, extIntegrationTaskLivingDetailsQueryVos);
+                            //查找来源销售订单明细行
+                            SoSaleorderBEntity sourceDocumentsV2 = findSourceDocumentsV2(header, stockinB, soSaleorderBEntityList, extIntegrationTaskLivingDetailsQueryVos);
 
-                        BigDecimal noriginalcurtaxprice = null;//含税单价
-                        try {
-                            noriginalcurtaxprice = new BigDecimal(afterSalesOrder.getTotalAmount()).divide(new BigDecimal(stockinB.getReceivedQty()), 20, BigDecimal.ROUND_HALF_UP).setScale(4, BigDecimal.ROUND_HALF_UP);
-                        } catch (Exception e) {
-                            logger.error("含税单价金额计算失败!", e);
-                            Assert.state(false, "含税单价金额计算失败 原因:{}", e.getMessage());
+                            BigDecimal noriginalcurtaxprice = null;//含税单价
+                            try {
+                                noriginalcurtaxprice = new BigDecimal(afterSalesOrder.getTotalAmount()).divide(new BigDecimal(stockinB.getReceivedQty()), 20, BigDecimal.ROUND_HALF_UP).setScale(4, BigDecimal.ROUND_HALF_UP);
+                            } catch (Exception e) {
+                                logger.error("含税单价金额计算失败!", e);
+                                Assert.state(false, "含税单价金额计算失败 原因:{}", e.getMessage());
+                            }
+
+                            Boolean isblargessflag = false;
+                            if (noriginalcurtaxprice == null) {
+                                isblargessflag = true;
+                            }
+
+                            SalesInvoiceBodyDto salesInvoiceBodyDto = new SalesInvoiceBodyDto();
+                            salesInvoiceBodyDto.setCinventoryid(bdInvmandocEntity.getPkInvmandoc());
+                            salesInvoiceBodyDto.setCupreceipttype("4C");
+                            salesInvoiceBodyDto.setCupsourcebillcode(soSaleEntity.getVreceiptcode());
+                            salesInvoiceBodyDto.setNnumber("-" + stockinB.getReceivedQty());
+                            salesInvoiceBodyDto.setNoriginalcurtaxprice(noriginalcurtaxprice.stripTrailingZeros().toPlainString());//含税单价
+                            salesInvoiceBodyDto.setNtaxrate(new BigDecimal(bdTaxitemsEntity1.getTaxratio()).stripTrailingZeros().toPlainString());//税率
+                            salesInvoiceBodyDto.setBlargessflag(isblargessflag);
+                            salesInvoiceBodyDto.setCoriginalbillcode(soSaleEntity.getVreceiptcode());//源头单据号
+                            salesInvoiceBodyDto.setCsourcebillbodyid(sourceDocumentsV2.getCorderBid());//源头单据明细行主键 (数据字典上是来源单据明细行主键,实际上是源头)
+                            salesInvoiceBodyDto.setCsourcebillid(soSaleEntity.getCsaleid());//源头单据主表主键(数据字典上是来源单据主表主键,实际上是源头)
+                            salesInvoiceBodyDto.setCupsourcebillbodyid(sourceDocuments.getCgeneralbid());//上层来源明细行主键
+                            salesInvoiceBodyDto.setCupsourcebillcode(icGeneralHEntity.getVbillcode());//直接来源单据号
+                            salesInvoiceBodyDto.setCupsourcebillid(icGeneralHEntity.getCgeneralhid());//来源主表主键
+                            salesInvoiceBodyDtoList.add(salesInvoiceBodyDto);
                         }
+                        SalesInvoiceDto salesInvoiceDto = new SalesInvoiceDto();
+                        salesInvoiceDto.setParentvo(salesInvoiceHeadDto);
+                        salesInvoiceDto.setChildrenvo(salesInvoiceBodyDtoList);
 
-                        Boolean isblargessflag = false;
-                        if (noriginalcurtaxprice == null) {
-                            isblargessflag = true;
+                        List<SalesInvoiceDto> salesInvoiceDtoList = new ArrayList<>();
+                        salesInvoiceDtoList.add(salesInvoiceDto);
+
+                        Map<String, List<SalesInvoiceDto>> stringListMap = new HashMap<>();
+                        stringListMap.put("billvos", salesInvoiceDtoList);
+
+                        //推送到U8C生成销售发票
+                        Boolean aBoolean = checkTobSalesInvoice(header.getId(), header.getCode());
+                        if (!aBoolean) {
+                            logger.error("经过SQL查询判断,在U8C红字销售发票中不存在OFS入库单号为:{} OFS入库主键为:{}的单据,将调用U8C接口执行推送!", header.getCode(), header.getId());
+                            SaleinvoiceDto saleinvoiceDto = sendU8CTOCSoSaleinvoiceB(JSON.toJSONString(stringListMap));
+                            String vreceiptcode = null;
+                            String csaleid = null;
+                            String pk_corp = null;
+                            if (saleinvoiceDto != null && saleinvoiceDto.getParentvo() != null && saleinvoiceDto.getChildrenvo() != null) {
+                                SaleinvoiceHeadDto parentvo = saleinvoiceDto.getParentvo();
+                                List<SaleinvoiceBodyDto> childrenvo = saleinvoiceDto.getChildrenvo();
+                                vreceiptcode = parentvo.getVreceiptcode();
+                                csaleid = parentvo.getCsaleid();
+                                pk_corp = parentvo.getPk_corp();
+                            }
+                            logger.info("TOB销售发票(红字)生成成功 编码:{} 主键:{} 发票公司:{}", vreceiptcode, csaleid, pk_corp);
+                            //记录成功
+                            updateSuccessOrFail2(details, "Y", "success", vreceiptcode, csaleid);
+                        } else {
+                            logger.error("经过SQL查询判断,在U8C红字销售发票中已经存在OFS入库单号为:{} OFS入库主键为:{}的单据,为了避免造成单据重复,不推送到U8C!", header.getCode(), header.getId());
                         }
-
-                        SalesInvoiceBodyDto salesInvoiceBodyDto = new SalesInvoiceBodyDto();
-                        salesInvoiceBodyDto.setCinventoryid(bdInvmandocEntity.getPkInvmandoc());
-                        salesInvoiceBodyDto.setCupreceipttype("4C");
-                        salesInvoiceBodyDto.setCupsourcebillcode(soSaleEntity.getVreceiptcode());
-                        salesInvoiceBodyDto.setNnumber("-" + stockinB.getReceivedQty());
-                        salesInvoiceBodyDto.setNoriginalcurtaxprice(noriginalcurtaxprice.stripTrailingZeros().toPlainString());//含税单价
-                        salesInvoiceBodyDto.setNtaxrate(new BigDecimal(bdTaxitemsEntity1.getTaxratio()).stripTrailingZeros().toPlainString());//税率
-                        salesInvoiceBodyDto.setBlargessflag(isblargessflag);
-                        salesInvoiceBodyDto.setCoriginalbillcode(soSaleEntity.getVreceiptcode());//源头单据号
-                        salesInvoiceBodyDto.setCsourcebillbodyid(sourceDocumentsV2.getCorderBid());//源头单据明细行主键 (数据字典上是来源单据明细行主键,实际上是源头)
-                        salesInvoiceBodyDto.setCsourcebillid(soSaleEntity.getCsaleid());//源头单据主表主键(数据字典上是来源单据主表主键,实际上是源头)
-                        salesInvoiceBodyDto.setCupsourcebillbodyid(sourceDocuments.getCgeneralbid());//上层来源明细行主键
-                        salesInvoiceBodyDto.setCupsourcebillcode(icGeneralHEntity.getVbillcode());//直接来源单据号
-                        salesInvoiceBodyDto.setCupsourcebillid(icGeneralHEntity.getCgeneralhid());//来源主表主键
-                        salesInvoiceBodyDtoList.add(salesInvoiceBodyDto);
-                    }
-                    SalesInvoiceDto salesInvoiceDto = new SalesInvoiceDto();
-                    salesInvoiceDto.setParentvo(salesInvoiceHeadDto);
-                    salesInvoiceDto.setChildrenvo(salesInvoiceBodyDtoList);
-
-                    List<SalesInvoiceDto> salesInvoiceDtoList = new ArrayList<>();
-                    salesInvoiceDtoList.add(salesInvoiceDto);
-
-                    Map<String, List<SalesInvoiceDto>> stringListMap = new HashMap<>();
-                    stringListMap.put("billvos", salesInvoiceDtoList);
-
-                    //推送到U8C生成销售发票
-                    Boolean aBoolean = checkTobSalesInvoice(header.getId(), header.getCode());
-                    if (!aBoolean) {
-                        logger.error("经过SQL查询判断,在U8C红字销售发票中不存在OFS入库单号为:{} OFS入库主键为:{}的单据,将调用U8C接口执行推送!", header.getCode(), header.getId());
-                        SaleinvoiceDto saleinvoiceDto = sendU8CTOCSoSaleinvoiceB(JSON.toJSONString(stringListMap));
-                        if (saleinvoiceDto != null && saleinvoiceDto.getParentvo() != null && saleinvoiceDto.getChildrenvo() != null) {
-                            SaleinvoiceHeadDto parentvo = saleinvoiceDto.getParentvo();
-                            List<SaleinvoiceBodyDto> childrenvo = saleinvoiceDto.getChildrenvo();
-                            logger.info("TOB销售发票(红字)生成成功 编码:{} 主键:{} 发票公司:{}", parentvo.getVreceiptcode(), parentvo.getCsaleid(), parentvo.getPk_corp());
+                    } catch (Exception e) {
+                        logger.error("TOB售后到账完成推送U8C抛出异常", e);
+                        // 记录失败
+                        String message = e.getMessage();
+                        if (message == null) {
+                            message = "未知错误";
                         }
-                    } else {
-                        logger.error("经过SQL查询判断,在U8C红字销售发票中已经存在OFS入库单号为:{} OFS入库主键为:{}的单据,为了避免造成单据重复,不推送到U8C!", header.getCode(), header.getId());
+                        updateSuccessOrFail2(details, "N", message, null, null);
                     }
                 }
             } catch (Exception e) {
                 logger.error("TOB外层转换逻辑抛出异常", e);
-                // 记录失败
             }
         }
     }
@@ -1869,4 +2035,125 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity {
             logger.error("记录splitDateAndPush方法抛出的异常", e);
         }
     }
+
+    /**
+     * 处理TOC-库存同步的成功、失败错误逻辑
+     *
+     * @author liuyang
+     */
+    private void updateSuccessOrFail1(List<StockinOrderSearchResponse.StockinOrder.StockinB> sonDetailsDtoList, String newstate, String newTransmitInfo, String newsystemnumber, String newsystemprimary) {
+        if (newTransmitInfo != null && !"".equals(newTransmitInfo.trim()) && newTransmitInfo.length() >= 400) {
+            newTransmitInfo = newTransmitInfo.substring(0, 400);
+        }
+
+        String finalNewTransmitInfo = newTransmitInfo;
+        Thread thread = new Thread(new Runnable() {
+            @Override
+            public void run() {
+                try {
+                    String successY = "Y";
+                    if (sonDetailsDtoList != null && sonDetailsDtoList.size() > 0) {
+                        List<TocofsReturngoodsDetailedEntity> tocofsReturngoodsDetailedEntityArrayList = new ArrayList<>();
+                        for (int i = 0; i < sonDetailsDtoList.size(); i++) {
+                            StockinOrderSearchResponse.StockinOrder.StockinB stockinB = sonDetailsDtoList.get(i);
+
+                            TocofsReturngoodsDetailedEntity tocofsReturngoodsDetailedEntity = new TocofsReturngoodsDetailedEntity();
+                            tocofsReturngoodsDetailedEntity.setId(stockinB.getId());
+                            tocofsReturngoodsDetailedEntity.setNewpushdate(getNewDateStr());
+                            tocofsReturngoodsDetailedEntity.setNewtransmitinfo(finalNewTransmitInfo);
+                            tocofsReturngoodsDetailedEntity.setNewstate(newstate);
+                            if (successY.equals(newstate)) {
+                                tocofsReturngoodsDetailedEntity.setNewsystemnumber(newsystemnumber);
+                                tocofsReturngoodsDetailedEntity.setNewsystemprimary(newsystemprimary);
+                            }
+                            tocofsReturngoodsDetailedEntityArrayList.add(tocofsReturngoodsDetailedEntity);
+                        }
+
+                        //以50行为一个批次,推送到Mysql
+                        if (tocofsReturngoodsDetailedEntityArrayList.size() > 0) {
+                            List<List<TocofsReturngoodsDetailedEntity>> splitListByCount = SplitListByCountUtil.splitListByCount(tocofsReturngoodsDetailedEntityArrayList, 50);
+                            for (int i = 0; i < splitListByCount.size(); i++) {
+                                List<TocofsReturngoodsDetailedEntity> tocofsReturngoodsDetailedEntities = splitListByCount.get(i);
+                                iTocofsReturngoodsDetailedDao.entityInsertOrUpdateBatchByTobRerturnStock(tocofsReturngoodsDetailedEntities);
+                            }
+                        }
+                    }
+                } catch (Exception e) {
+                    logger.error("TOC库存同步日志,抛出异常", e);
+                }
+            }
+        });
+        thread.start();
+        try {
+            thread.join();
+        } catch (Exception e) {
+            logger.error("updateSuccessOrFail1方法现场抛出异常", e);
+        }
+    }
+
+    /**
+     * 生成当前日期
+     *
+     * @author liuyang
+     */
+    private String getNewDateStr() {
+        LocalDateTime now = LocalDateTime.now();
+        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+        return now.format(formatter);
+    }
+
+    /**
+     * 处理TOC-库存同步的成功、失败错误逻辑
+     *
+     * @author liuyang
+     */
+    private void updateSuccessOrFail2(List<StockinOrderSearchResponse.StockinOrder.StockinB> sonDetailsDtoList, String newstate, String newTransmitInfo, String newsystemnumber, String newsystemprimary) {
+        if (newTransmitInfo != null && !"".equals(newTransmitInfo.trim()) && newTransmitInfo.length() >= 400) {
+            newTransmitInfo = newTransmitInfo.substring(0, 400);
+        }
+
+        String finalNewTransmitInfo = newTransmitInfo;
+        Thread thread = new Thread(new Runnable() {
+            @Override
+            public void run() {
+                try {
+                    String successY = "Y";
+                    if (sonDetailsDtoList != null && sonDetailsDtoList.size() > 0) {
+                        List<TocofsReturngoodsDetailedEntity> tocofsReturngoodsDetailedEntityArrayList = new ArrayList<>();
+                        for (int i = 0; i < sonDetailsDtoList.size(); i++) {
+                            StockinOrderSearchResponse.StockinOrder.StockinB stockinB = sonDetailsDtoList.get(i);
+
+                            TocofsReturngoodsDetailedEntity tocofsReturngoodsDetailedEntity = new TocofsReturngoodsDetailedEntity();
+                            tocofsReturngoodsDetailedEntity.setId(stockinB.getId());
+                            tocofsReturngoodsDetailedEntity.setNewpushdate2(getNewDateStr());
+                            tocofsReturngoodsDetailedEntity.setNewtransmitinfo2(finalNewTransmitInfo);
+                            tocofsReturngoodsDetailedEntity.setNewstate2(newstate);
+                            if (successY.equals(newstate)) {
+                                tocofsReturngoodsDetailedEntity.setNewsystemnumber2(newsystemnumber);
+                                tocofsReturngoodsDetailedEntity.setNewsystemprimary2(newsystemprimary);
+                            }
+                            tocofsReturngoodsDetailedEntityArrayList.add(tocofsReturngoodsDetailedEntity);
+                        }
+
+                        //以50行为一个批次,推送到Mysql
+                        if (tocofsReturngoodsDetailedEntityArrayList.size() > 0) {
+                            List<List<TocofsReturngoodsDetailedEntity>> splitListByCount = SplitListByCountUtil.splitListByCount(tocofsReturngoodsDetailedEntityArrayList, 50);
+                            for (int i = 0; i < splitListByCount.size(); i++) {
+                                List<TocofsReturngoodsDetailedEntity> tocofsReturngoodsDetailedEntities = splitListByCount.get(i);
+                                iTocofsReturngoodsDetailedDao.entityInsertOrUpdateBatchByTobRerturnTran(tocofsReturngoodsDetailedEntities);
+                            }
+                        }
+                    }
+                } catch (Exception e) {
+                    logger.error("TOC库存同步日志,抛出异常", e);
+                }
+            }
+        });
+        thread.start();
+        try {
+            thread.join();
+        } catch (Exception e) {
+            logger.error("updateSuccessOrFail2方法现场抛出异常", e);
+        }
+    }
 }
\ No newline at end of file
diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleReturnPluginInitializerToC.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleReturnPluginInitializerToC.java
index ae03d59e..a79b7017 100644
--- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleReturnPluginInitializerToC.java
+++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleReturnPluginInitializerToC.java
@@ -1,5 +1,6 @@
 package com.hzya.frame.plugin.lets.plugin.sales;
 
+import cn.hutool.core.date.DateTime;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.lang.Assert;
 import cn.hutool.core.util.StrUtil;
@@ -17,6 +18,7 @@ import com.hzya.frame.plugin.lets.ofs.entity.TocofsReturngoodsDetailedEntity;
 import com.hzya.frame.plugin.lets.ofs.entity.TocofsReturngoodsEntity;
 import com.hzya.frame.plugin.lets.ofs.entity.TocofsSaleoutDetailedEntity;
 import com.hzya.frame.plugin.lets.ofsvo.QueryOfsSoSaleOutVo;
+import com.hzya.frame.plugin.lets.queryvo.StartAndEndVo;
 import com.hzya.frame.plugin.lets.resultvo.CacheTocMapVoV2;
 import com.hzya.frame.plugin.lets.resultvo.CalculateDateVo;
 import com.hzya.frame.plugin.lets.u8cdto.*;
@@ -37,6 +39,9 @@ import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 
 import java.math.BigDecimal;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
 import java.util.*;
 import java.util.concurrent.locks.ReentrantLock;
 import java.util.stream.Collectors;
@@ -53,6 +58,12 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
 
     private static final ReentrantLock LOCK = new ReentrantLock(true);
 
+    private static final String STOCK = "stock";
+
+    private static final String TRAN = "tran";
+
+    private static final String PROD_FILED = "prod";
+
     @Override
     public void initialize() {
         logger.info(getPluginLabel() + "執行初始化方法initialize()");
@@ -85,6 +96,37 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
 
     @Override
     public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
+        long startMillis = System.currentTimeMillis();
+        logger.info("executeBusiness方法调用开始:" + getPluginName() + "-插件");
+
+        try {
+            String param = String.valueOf(requestJson.get("param"));
+            String sceneType = String.valueOf(requestJson.get("sceneType"));//sceneType:stock、tran
+            if (ProfilesActiveConstant.TYPE_VBILLCODE.equals(requestJson.get("type"))) {
+                //按单号
+                if (param != null && !"".equals(param)) {
+                    startImplementByCode(param, sceneType);
+                }
+            } else if (ProfilesActiveConstant.TYPE_TIME_FRAME.equals(requestJson.get("type"))) {
+                //前台页面功能日期推送,或者接口调用也行
+                String craeteDateStr = computingTime(param);
+                if (craeteDateStr != null && !"".equals(craeteDateStr)) {
+                    splitDateAndPush(craeteDateStr, sceneType);
+                }
+            } else {
+                if (ProfilesActiveConstant.LETS_PROFILES_ACTIVE.equals(PROD_FILED)) {
+                    //默认被定时器执行,每天晚上凌晨0点5分
+                    //暂定先同步TOC销售库存、再推送TOC销售确认收入
+                    List<StartAndEndVo> startAndEndVos = calculateCalculateEntireDayPeriod(null);
+                    startImplementStockByTime(startAndEndVos.get(0).getStart_time(), startAndEndVos.get(0).getEnd_time());
+                    startImplementByTradeTime(startAndEndVos.get(0).getStart_time(), startAndEndVos.get(0).getEnd_time());
+                }
+            }
+        } catch (Exception e) {
+            logger.error("executeBusiness方法异常", e);
+        }
+        long endMillis = System.currentTimeMillis();
+        logger.info("executeBusiness方法调用结束:" + getPluginName() + "-插件 执行耗时:{}", (endMillis - startMillis));
         return null;
     }
 
@@ -120,7 +162,7 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
     private RdclUtil rdclUtil;
 
     /**
-     * 根据指定时间范围拉群
+     * 库存同步,根据时间范围拉取
      *
      * @author liuyang
      */
@@ -185,21 +227,25 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
     }
 
     /**
-     * 按指定时间拉取
+     * 根据编码、场景类型拉取
      *
      * @param code      编码
      * @param sceneType 场景类型
      * @author liuyang
      */
     public void startImplementByCode(String code, String sceneType) {
-        String threadNameStr = StrUtil.format("OFS销售出库(TOC)同步U8C销售订单 同步单据号:{}", code);
-        logger.info(threadNameStr);
+        long startMillis = System.currentTimeMillis();
+        String threadNameStrStart = StrUtil.format("开始-OFS销售出库(TOC)同步U8C销售订单 同步单据号:{} 业务场景:{}", code, sceneType);
+        logger.info(threadNameStrStart);
 
         Thread thread = new Thread(new Runnable() {
             @Override
             public void run() {
                 LOCK.lock();
                 try {
+                    Assert.notNull(code, "code不能为空");
+                    Assert.notNull(sceneType, "sceneType不能为空");
+
                     String tocShop = shopTobOrToCUtil.getCommaShop("TOC");
 
                     List<StockinOrderSearchResponse.StockinOrder> returnGoodHeaderDetailsDataDtoList = new ArrayList<>();
@@ -215,7 +261,11 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
                     ofsStandardUtil.queryOfsReturnGoods(queryOfsSoSaleOutVo, returnGoodHeaderDetailsDataDtoList, 1L, "ofs.receipt.search");
                     logger.info("数据返回行数:{}", returnGoodHeaderDetailsDataDtoList.size());
                     if (returnGoodHeaderDetailsDataDtoList.size() > 0) {
-                        getSetStock(returnGoodHeaderDetailsDataDtoList);
+                        if (sceneType.equals("stock")) {
+                            getSetStock(returnGoodHeaderDetailsDataDtoList);
+                        } else if (sceneType.equals("tran")) {
+                            getSetTran(returnGoodHeaderDetailsDataDtoList);
+                        }
                     } else {
                         logger.info("没有查询到任何数据!不需要同步");
                     }
@@ -230,17 +280,20 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
                     LOCK.unlock();
                 }
             }
-        }, threadNameStr);
+        }, threadNameStrStart);
         thread.start();
         try {
             thread.join();
         } catch (Exception e) {
             logger.error("thread.join()异常", e);
         }
+        long endMillis = System.currentTimeMillis();
+        String threadNameStrEnd = StrUtil.format("结束-OFS销售出库(TOC)同步U8C销售订单 同步单据号:{} 业务场景:{} 耗时:{}", code, sceneType, (endMillis - startMillis));
+        logger.info(threadNameStrEnd);
     }
 
     /**
-     * 库存同步,按指定时间拉取
+     * 交易采购,按指定时间拉取
      *
      * @author liuyang
      */
@@ -295,7 +348,7 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
     }
 
     /**
-     * 预备执行逻辑
+     * 库存同步,预备执行逻辑
      *
      * @author liuyang
      */
@@ -309,7 +362,7 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
     }
 
     /**
-     * 预备执行逻辑
+     * 确认收入:预备执行逻辑
      *
      * @author liuyang
      */
@@ -317,23 +370,98 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
         //保存到mysql
         batchInsert(returnGoodHeaderDetailsDataDtoArrayList);
         //过滤成功的数据
-        List<StockinOrderSearchResponse.StockinOrder> stockinOrderList = filterDataStock(returnGoodHeaderDetailsDataDtoArrayList);
+        List<StockinOrderSearchResponse.StockinOrder> stockinOrderList = filterDataTran(returnGoodHeaderDetailsDataDtoArrayList);
         //执行推送主逻辑
         implementTran(stockinOrderList);
     }
 
     /**
-     * 过滤掉成功的数据
+     * 库存同步,过滤掉成功的数据
      *
      * @author liuyang
      */
-    private List<StockinOrderSearchResponse.StockinOrder> filterDataStock(List<StockinOrderSearchResponse.StockinOrder> returnGoodHeaderDetailsDataDtoArrayList) {
-        List<StockinOrderSearchResponse.StockinOrder> headerDetailsDtoList1 = new ArrayList<>();
+    private List<StockinOrderSearchResponse.StockinOrder> filterDataStock(List<StockinOrderSearchResponse.StockinOrder> returnGoodHeaderDetailsDataDtoArrayList) throws Exception {
+//        List<StockinOrderSearchResponse.StockinOrder> headerDetailsDtoList1 = new ArrayList<>();
+        List<TocofsReturngoodsDetailedEntity> tocofsReturngoodsDetailedEntityList = new ArrayList<>();
         if (returnGoodHeaderDetailsDataDtoArrayList != null && returnGoodHeaderDetailsDataDtoArrayList.size() > 0) {
-            //TODO 出库单明细主键,需要O返回,目前没有,已经提需求
-            headerDetailsDtoList1.addAll(returnGoodHeaderDetailsDataDtoArrayList);
+            List<List<StockinOrderSearchResponse.StockinOrder>> splitListByCount = SplitListByCountUtil.splitListByCount(returnGoodHeaderDetailsDataDtoArrayList, 100);
+            for (int i = 0; i < splitListByCount.size(); i++) {
+                List<StockinOrderSearchResponse.StockinOrder> stockinOrderList = splitListByCount.get(i);
+                String idStr = commaConcatenatedPrimaryKeyStock(stockinOrderList);
+                List<TocofsReturngoodsDetailedEntity> tocofsReturngoodsDetailedEntities = queryStockTocOutLog(idStr);
+                tocofsReturngoodsDetailedEntityList.addAll(tocofsReturngoodsDetailedEntities);
+            }
         }
-        return headerDetailsDtoList1;
+        if (tocofsReturngoodsDetailedEntityList.size() > 0) {
+            return filterDataRowsAsPushOrFailedStock(tocofsReturngoodsDetailedEntityList, returnGoodHeaderDetailsDataDtoArrayList);
+        }
+        return null;
+    }
+
+    /**
+     * 确认收入,过滤掉成功的数据
+     *
+     * @author liuyang
+     */
+    private List<StockinOrderSearchResponse.StockinOrder> filterDataTran(List<StockinOrderSearchResponse.StockinOrder> returnGoodHeaderDetailsDataDtoArrayList) throws Exception {
+        List<TocofsReturngoodsDetailedEntity> tocofsReturngoodsDetailedEntityList = new ArrayList<>();
+        if (returnGoodHeaderDetailsDataDtoArrayList != null && returnGoodHeaderDetailsDataDtoArrayList.size() > 0) {
+            List<List<StockinOrderSearchResponse.StockinOrder>> splitListByCount = SplitListByCountUtil.splitListByCount(returnGoodHeaderDetailsDataDtoArrayList, 100);
+            for (int i = 0; i < splitListByCount.size(); i++) {
+                List<StockinOrderSearchResponse.StockinOrder> stockinOrderList = splitListByCount.get(i);
+                String idStr = commaConcatenatedPrimaryKeyStock(stockinOrderList);
+                List<TocofsReturngoodsDetailedEntity> tocofsReturngoodsDetailedEntities = queryStockTocOutLog(idStr);
+                tocofsReturngoodsDetailedEntityList.addAll(tocofsReturngoodsDetailedEntities);
+            }
+        }
+        if (tocofsReturngoodsDetailedEntityList.size() > 0) {
+            return filterDataRowsAsPushOrFailedTran(tocofsReturngoodsDetailedEntityList, returnGoodHeaderDetailsDataDtoArrayList);
+        }
+        return null;
+    }
+
+    /**
+     * 逗号拼接字符串主键,作为批处理的一部分,方便下一步的批量查询操作
+     *
+     * @author liuyang
+     */
+    private String commaConcatenatedPrimaryKeyStock(List<StockinOrderSearchResponse.StockinOrder> headerDetailsDtoList2) throws Exception {
+        StringBuffer idStr = new StringBuffer();
+        if (headerDetailsDtoList2 != null && headerDetailsDtoList2.size() > 0) {
+            for (int i = 0; i < headerDetailsDtoList2.size(); i++) {
+                StockinOrderSearchResponse.StockinOrder stockinOrder = headerDetailsDtoList2.get(i);
+                StockinOrderSearchResponse.StockinOrder.StockinH header = stockinOrder.getHeader();
+                List<StockinOrderSearchResponse.StockinOrder.StockinB> details = stockinOrder.getDetails();
+                for (int j = 0; j < details.size(); j++) {
+                    StockinOrderSearchResponse.StockinOrder.StockinB stockinB = details.get(j);
+                    Assert.notNull(stockinB.getId(), "O明细主键不能为空!");
+                    Assert.state(!"".equals(stockinB.getId()), "O明细主键不能为空!");
+                    idStr.append(stockinB.getId());
+                    idStr.append(",");
+                }
+            }
+        }
+        if (idStr.length() > 0) {
+            return idStr.substring(0, idStr.length());
+        }
+        return null;
+    }
+
+    /**
+     * 批查询toc退货入库日志,查询的量由splitListByCount方法控制
+     *
+     * @author liuyang
+     */
+    private List<TocofsReturngoodsDetailedEntity> queryStockTocOutLog(String idStr) throws Exception {
+        List<TocofsReturngoodsDetailedEntity> tocofsReturngoodsDetailedEntities = null;
+        if (idStr != null && !"".equals(idStr.trim())) {
+            TocofsReturngoodsDetailedEntity tocofsReturngoodsDetailedEntity = new TocofsReturngoodsDetailedEntity();
+            tocofsReturngoodsDetailedEntity.setIds(idStr);
+            tocofsReturngoodsDetailedEntities = iTocofsReturngoodsDetailedDao.query(tocofsReturngoodsDetailedEntity);
+        } else {
+            logger.error("idStr为空,无法查询数据!");
+        }
+        return tocofsReturngoodsDetailedEntities;
     }
 
     /**
@@ -366,7 +494,7 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
                 List<TocofsReturngoodsEntity> tocofsReturngoodsEntities = copyHeaderDto(stockinHS);
                 if (tocofsReturngoodsEntities.size() > 0) {
                     logger.info("插入底表{}个对象(表头)", tocofsReturngoodsEntities.size());
-                    iTocofsReturngoodsDao.entityInsertBatchV2(tocofsReturngoodsEntities);
+                    iTocofsReturngoodsDao.entityInsertOrUpdateBatch(tocofsReturngoodsEntities);
                 } else {
                     logger.info("tocofsReturngoodsEntities:没有对象被插入表头底表");
                 }
@@ -379,7 +507,7 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
                 List<TocofsReturngoodsDetailedEntity> tocofsReturngoodsDetailedEntities = copyDetailsDto(stockinBS);
                 if (tocofsReturngoodsDetailedEntities.size() > 0) {
                     logger.info("插入底表{}个对象(表体)", tocofsReturngoodsDetailedEntities.size());
-                    iTocofsReturngoodsDetailedDao.entityInsertBatchV2(tocofsReturngoodsDetailedEntities);
+                    iTocofsReturngoodsDetailedDao.entityInsertOrUpdateBatch(tocofsReturngoodsDetailedEntities);
                 } else {
                     logger.info("tocofsReturngoodsDetailedEntities:没有对象被插入表头底表");
                 }
@@ -410,7 +538,7 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
 //                if (returnGoodHeaderDetailsDataDtoList != null && returnGoodHeaderDetailsDataDtoList.size() > 0) {
 //                    headerDetailsDtoList.addAll(returnGoodHeaderDetailsDataDtoList);
 //
-//                    //TODO OFS没有提供分页字段,等待开发
+//                    //OFS没有提供分页字段,等待开发
 //                }
 //            } else {
 //                logger.error("查询失败,失败原因:{}", JSON.toJSON(interfaceParamDto));
@@ -446,11 +574,14 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
      * @author liuyang
      */
     private void implementStock(List<StockinOrderSearchResponse.StockinOrder> returnGoodHeaderDetailsDataDtoList1) throws Exception {
-        logger.info("TOC退货业务:{}行需要进行数据转换", returnGoodHeaderDetailsDataDtoList1.size());
+        if (returnGoodHeaderDetailsDataDtoList1 != null) {
+            logger.info("TOC退货业务:{}行需要进行数据转换", returnGoodHeaderDetailsDataDtoList1.size());
+        }
         if (returnGoodHeaderDetailsDataDtoList1 != null && returnGoodHeaderDetailsDataDtoList1.size() > 0) {
             try {
                 // 查询基本档案
-                List<GoodsRertunSonDetailsDto> goodsRertunSonDetailsDtos = queryBasicArchivesStock(returnGoodHeaderDetailsDataDtoList1);
+                String sceneType = "stock";
+                List<GoodsRertunSonDetailsDto> goodsRertunSonDetailsDtos = queryBasicArchivesStock(returnGoodHeaderDetailsDataDtoList1, sceneType);
                 // 分组汇总
                 Map<String, List<GoodsRertunSonDetailsDto>> summaryDimensionMap = groupSummary(goodsRertunSonDetailsDtos);
                 // 查询U8C业务流程
@@ -585,11 +716,25 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
                             Map<String, List<SaleorderRequestDto>> stringStringMap = new HashMap<>();
                             stringStringMap.put("saleorder", saleorderRequestDtoList);
                             SoSaleResultRootDto soSaleResultRootDto = sendU8CTOCOrder(JSON.toJSONString(stringStringMap));
-                            logger.info("TOC销售订单编号:{} 销售公司:{}", soSaleResultRootDto.getParentvo().getVreceiptcode(), soSaleResultRootDto.getParentvo().getPk_corp());
+                            String vreceiptcode = null;
+                            String pk_corp = null;
+                            String csaleid = null;
+                            if (soSaleResultRootDto != null && soSaleResultRootDto.getParentvo() != null) {
+                                vreceiptcode = soSaleResultRootDto.getParentvo().getVreceiptcode();
+                                pk_corp = soSaleResultRootDto.getParentvo().getPk_corp();
+                                csaleid = soSaleResultRootDto.getParentvo().getCsaleid();
+                            }
+                            logger.info("TOC销售订单编号:{} 主键:{} 销售公司:{}", vreceiptcode, csaleid, pk_corp);
                             //记录成功
+                            updateSuccessOrFail1(oldValue, "Y", "success", vreceiptcode, csaleid);
                         } catch (Exception e) {
                             logger.error("TOC退货业务转换成U8C对象过程中、或者单据推送到U8C出现异常!", e);
                             //记录失败
+                            String message = e.getMessage();
+                            if (message == null) {
+                                message = "未知错误";
+                            }
+                            updateSuccessOrFail1(oldValue, "N", message, null, null);
                         }
                     }
                 } else {
@@ -614,7 +759,8 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
         if (returnGoodHeaderDetailsDataDtoList1 != null && returnGoodHeaderDetailsDataDtoList1.size() > 0) {
             try {
                 // 查询基本档案
-                List<GoodsRertunSonDetailsDto> goodsRertunSonDetailsDtos = queryBasicArchivesStock(returnGoodHeaderDetailsDataDtoList1);
+                String sceneType = "tran";
+                List<GoodsRertunSonDetailsDto> goodsRertunSonDetailsDtos = queryBasicArchivesStock(returnGoodHeaderDetailsDataDtoList1, sceneType);
                 // 分组汇总
                 Map<String, List<GoodsRertunSonDetailsDto>> summaryDimensionMap = groupSummary(goodsRertunSonDetailsDtos);
                 // 查询U8C业务流程
@@ -707,7 +853,7 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
                                 noriginalcursummny = noriginalcurtaxprice.multiply(goodsRertunSonDetailsDto.getGroupShipQty()).setScale(2, BigDecimal.ROUND_HALF_UP);
                                 noriginalcurtaxmny = noriginalcursummny.subtract(noriginalcurmny).setScale(2, BigDecimal.ROUND_HALF_UP);
                             } catch (Exception e) {
-                                logger.error("TOC金额计算错误", e);
+                                logger.error("TOC退货-确认收入,金额计算错误", e);
                                 Assert.state(false, "U8C红字销售订单,金额计算错误,原因:{}", e.getMessage());
                             }
 
@@ -747,11 +893,26 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
                             Map<String, List<SaleorderRequestDto>> stringStringMap = new HashMap<>();
                             stringStringMap.put("saleorder", saleorderRequestDtoList);
                             SoSaleResultRootDto soSaleResultRootDto = sendU8CTOCOrder(JSON.toJSONString(stringStringMap));
-                            logger.info("TOC销售订单编号:{} 销售公司:{}", soSaleResultRootDto.getParentvo().getVreceiptcode(), soSaleResultRootDto.getParentvo().getPk_corp());
+
+                            String vreceiptcode = null;
+                            String pk_corp = null;
+                            String csaleid = null;
+                            if (soSaleResultRootDto != null && soSaleResultRootDto.getParentvo() != null) {
+                                vreceiptcode = soSaleResultRootDto.getParentvo().getVreceiptcode();
+                                pk_corp = soSaleResultRootDto.getParentvo().getPk_corp();
+                                csaleid = soSaleResultRootDto.getParentvo().getCsaleid();
+                            }
+                            logger.info("TOC销售订单编号:{} 销售订单主键:{} 销售公司:{}", vreceiptcode, csaleid, pk_corp);
                             //记录成功
+                            updateSuccessOrFail2(oldValue, "Y", "success", vreceiptcode, csaleid);
                         } catch (Exception e) {
                             logger.error("TOC退货业务转换成U8C对象过程中、或者单据推送到U8C出现异常!", e);
                             //记录失败
+                            String message = e.getMessage();
+                            if (message == null) {
+                                message = "未知错误";
+                            }
+                            updateSuccessOrFail2(oldValue, "N", message, null, null);
                         }
                     }
                 } else {
@@ -797,8 +958,12 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
      * @param returnGoodHeaderDetailsDataDtoList1 OFS售后入库单对象
      * @author liuyang
      */
-    private List<GoodsRertunSonDetailsDto> queryBasicArchivesStock(List<StockinOrderSearchResponse.StockinOrder> returnGoodHeaderDetailsDataDtoList1) {
+    private List<GoodsRertunSonDetailsDto> queryBasicArchivesStock(List<StockinOrderSearchResponse.StockinOrder> returnGoodHeaderDetailsDataDtoList1, String sceneType) {
+        Assert.notNull(returnGoodHeaderDetailsDataDtoList1, "returnGoodHeaderDetailsDataDtoList1不能为空");
+        Assert.notNull(sceneType, "sceneType不能为空");
+
         List<GoodsRertunSonDetailsDto> sonDetailsDtoList = new ArrayList<>();
+        List<ErrorHeaderDetailsDtoDtoV2> errorHeaderDetailsDtoDtoList = new ArrayList<>();
 
         if (returnGoodHeaderDetailsDataDtoList1 != null && returnGoodHeaderDetailsDataDtoList1.size() > 0) {
             try {
@@ -816,127 +981,147 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
                     StockinOrderSearchResponse.StockinOrder.StockinH header = stockinOrder.getHeader();
                     List<StockinOrderSearchResponse.StockinOrder.StockinB> details = stockinOrder.getDetails();
 
-                    //OFS售后订单
-                    RerturnGoodsOrderSearchData rerturnGoodsOrderSearchData1 = header.getRerturnGoodsOrderSearchData();
-                    Assert.notNull(rerturnGoodsOrderSearchData1, "无法关联到OFS售后订单 售后入库单号:{}", header.getCode());
-                    //OFS销售订单
-                    com.hzya.frame.ttxofs.dto.ofssalesordersearch.HeaderDetailsDto headerDetailsDto = header.getHeaderDetailsDto();
-                    com.hzya.frame.ttxofs.dto.ofssalesordersearch.HeaderDto header1 = headerDetailsDto.getHeader();
-                    List<DetailsDto> details1 = headerDetailsDto.getDetails();
-                    Assert.notNull(headerDetailsDto, "无法关联到OFS销售订单 售后入库单号:{}", header.getCode());
+                    try {
+                        //OFS售后订单
+                        RerturnGoodsOrderSearchData rerturnGoodsOrderSearchData1 = header.getRerturnGoodsOrderSearchData();
+                        Assert.notNull(rerturnGoodsOrderSearchData1, "无法关联到OFS售后订单 售后入库单号:{}", header.getCode());
+                        //OFS销售订单
+                        com.hzya.frame.ttxofs.dto.ofssalesordersearch.HeaderDetailsDto headerDetailsDto = header.getHeaderDetailsDto();
+                        com.hzya.frame.ttxofs.dto.ofssalesordersearch.HeaderDto header1 = headerDetailsDto.getHeader();
+                        List<DetailsDto> details1 = headerDetailsDto.getDetails();
+                        Assert.notNull(headerDetailsDto, "无法关联到OFS销售订单 售后入库单号:{}", header.getCode());
 
-                    //如果不存在,则默认一个
-                    if (header1.getSubOrderType() == null || "".equals(header1.getSubOrderType())) {
-                        header1.setSubOrderType("SALES");
-                    }
-                    BdRdclEntity bdRdclEntity = cacheTocMapVoV2.getStringBdRdclEntityMap().get(header1.getSubOrderType());
-                    Assert.notNull(bdRdclEntity, "根据业务类型({})没有匹配到U8C业务类型", header1.getSubOrderType());
+                        //如果不存在,则默认一个
+                        if (header1.getSubOrderType() == null || "".equals(header1.getSubOrderType())) {
+                            header1.setSubOrderType("SALES");
+                        }
+                        BdRdclEntity bdRdclEntity = cacheTocMapVoV2.getStringBdRdclEntityMap().get(header1.getSubOrderType());
+                        Assert.notNull(bdRdclEntity, "根据业务类型({})没有匹配到U8C业务类型", header1.getSubOrderType());
 
-                    //表头公司:通过名称匹配U8C公司
+                        //表头公司:通过名称匹配U8C公司
 //                    String corpName = "上海丽知品牌管理有限公司";
-                    Assert.notNull(header.getCompanyCode(), "O货主编码不能为空");
-                    BdCorpEntity bdCorpEntity = cacheTocMapVoV2.getStringBdCorpEntityMap().get(header.getCompanyCode());
-                    Assert.notNull(bdCorpEntity, "根据O公司编码(货主编码)({})没有匹配到U8C公司档案", header.getCompanyCode());
+                        Assert.notNull(header.getCompanyCode(), "O货主编码不能为空");
+                        BdCorpEntity bdCorpEntity = cacheTocMapVoV2.getStringBdCorpEntityMap().get(header.getCompanyCode());
+                        Assert.notNull(bdCorpEntity, "根据O公司编码(货主编码)({})没有匹配到U8C公司档案", header.getCompanyCode());
 
-                    //发货库存组织
-                    BdCalbodyEntity bdCalbodyEntity = cacheTocMapVoV2.getStringBdCalbodyEntityMap().get(bdCorpEntity.getPkCorp());
-                    Assert.notNull(bdCalbodyEntity, "根据公司主键没有查询到发货库存组织 公司主键:{}", bdCorpEntity.getPkCorp());
+                        //发货库存组织
+                        BdCalbodyEntity bdCalbodyEntity = cacheTocMapVoV2.getStringBdCalbodyEntityMap().get(bdCorpEntity.getPkCorp());
+                        Assert.notNull(bdCalbodyEntity, "根据公司主键没有查询到发货库存组织 公司主键:{}", bdCorpEntity.getPkCorp());
 
-                    //发货公司,暂时把O表头公司作为发货公司,正常情况下需要把O库存地点对于的公司作为发货公司
+                        //发货公司,暂时把O表头公司作为发货公司,正常情况下需要把O库存地点对于的公司作为发货公司
 
-                    //发货仓库
-                    //2024年8月5日 15:06:38 仓库O与U两边仓库编码是一致的,和妮姐确认过了
-                    String facilityCode = header.getFacilityCode();
-                    Assert.notNull(facilityCode, "O仓库编码不能为空");
-                    BdStordocEntity bdStordocEntity = cacheTocMapVoV2.getStringBdStordocEntityMap().get(facilityCode + bdCalbodyEntity.getPkCalbody());
-                    Assert.notNull(bdStordocEntity, "没有匹配到发货仓库 发货库存组织主键:{} O库存地点编码:{}", facilityCode, bdCalbodyEntity.getPkCalbody());
+                        //发货仓库
+                        //2024年8月5日 15:06:38 仓库O与U两边仓库编码是一致的,和妮姐确认过了
+                        String facilityCode = header.getFacilityCode();
+                        Assert.notNull(facilityCode, "O仓库编码不能为空");
+                        BdStordocEntity bdStordocEntity = cacheTocMapVoV2.getStringBdStordocEntityMap().get(facilityCode + bdCalbodyEntity.getPkCalbody());
+                        Assert.notNull(bdStordocEntity, "没有匹配到发货仓库 发货库存组织主键:{} O库存地点编码:{}", facilityCode, bdCalbodyEntity.getPkCalbody());
 
-                    //2024年8月5日 15:25:07 收货库存组织、收货仓库、默认和发货库存组织、发货仓库一致,已经和佳妮确认
-                    //收货库存组织:速网来看收货库存组织对应表头工具
-                    //收货仓库:通过收货库存组织+仓库编码,确定收货仓库
+                        //2024年8月5日 15:25:07 收货库存组织、收货仓库、默认和发货库存组织、发货仓库一致,已经和佳妮确认
+                        //收货库存组织:速网来看收货库存组织对应表头工具
+                        //收货仓库:通过收货库存组织+仓库编码,确定收货仓库
 
-                    //销售组织2024年8月5日 15:33:40 和妮姐确认,销售组织和表头公司,作为一对一的关系,
-                    BdSalestruEntity bdSalestruEntity = cacheTocMapVoV2.getStringBdSalestruEntityMap().get(bdCorpEntity.getUnitname());
-                    Assert.notNull(bdSalestruEntity, "无匹配到销售组织 表头公司名称:{}", bdCorpEntity.getUnitname());
+                        //销售组织2024年8月5日 15:33:40 和妮姐确认,销售组织和表头公司,作为一对一的关系,
+                        BdSalestruEntity bdSalestruEntity = cacheTocMapVoV2.getStringBdSalestruEntityMap().get(bdCorpEntity.getUnitname());
+                        Assert.notNull(bdSalestruEntity, "无匹配到销售组织 表头公司名称:{}", bdCorpEntity.getUnitname());
 
-                    //业务部门:暂定的部门名称:其他,2024年8月5日 15:39:42 已经和妮姐确认
-                    BdDeptdocEntity bdDeptdocEntity = cacheTocMapVoV2.getStringBdDeptdocEntityMap().get(bdCorpEntity.getPkCorp());
-                    Assert.notNull(bdDeptdocEntity, "无法匹配到业务部门 部门名称:其他 对应公司名称:{}", bdCorpEntity.getPkCorp());
+                        //业务部门:暂定的部门名称:其他,2024年8月5日 15:39:42 已经和妮姐确认
+                        BdDeptdocEntity bdDeptdocEntity = cacheTocMapVoV2.getStringBdDeptdocEntityMap().get(bdCorpEntity.getPkCorp());
+                        Assert.notNull(bdDeptdocEntity, "无法匹配到业务部门 部门名称:其他 对应公司名称:{}", bdCorpEntity.getPkCorp());
 
-                    //客商基本档案
-                    //2024年8月8日 12:05:10 O店铺的业务编码=U8C客商自定义项1,O没有店铺信息查询接口,因此无法通过出库单的店铺编码,查询到O店铺档案对应的业务编码,接口上线之后需要补充这一部分逻辑
+                        //客商基本档案
+                        //2024年8月8日 12:05:10 O店铺的业务编码=U8C客商自定义项1,O没有店铺信息查询接口,因此无法通过出库单的店铺编码,查询到O店铺档案对应的业务编码,接口上线之后需要补充这一部分逻辑
 //                    String custName = "天猫intoyou旗舰店-自营";
-                    String storeCode = header.getStoreCode();
-                    Assert.notNull(storeCode, "O店铺编码不能为空,没有办法完成业务逻辑!");
-                    Assert.state(!"".equals(storeCode.trim()), "O店铺编码不能为空,没有办法完成业务逻辑!");
-                    BdCubasdocEntity bdCubasdocEntity = cacheTocMapVoV2.getStringBdCubasdocEntityMap().get(storeCode);
-                    Assert.notNull(bdCubasdocEntity, "无法匹配到客户档案 客商名称:{}", storeCode);
+                        String storeCode = header.getStoreCode();
+                        Assert.notNull(storeCode, "O店铺编码不能为空,没有办法完成业务逻辑!");
+                        Assert.state(!"".equals(storeCode.trim()), "O店铺编码不能为空,没有办法完成业务逻辑!");
+                        BdCubasdocEntity bdCubasdocEntity = cacheTocMapVoV2.getStringBdCubasdocEntityMap().get(storeCode);
+                        Assert.notNull(bdCubasdocEntity, "无法匹配到客户档案 客商名称:{}", storeCode);
 
-                    //客商管理档案:2024年8月5日 15:41:54 TOC店铺名称查询U8C客商档案,已经和妮姐确认
-                    //2024年8月5日 15:49:49 先根据O店铺编码,得到店铺档案信息,取到名称,通过U8C接口查询出来
-                    //目前O店铺信息查询接口还没有,等待开发,所以我这里先写所一个名字
-                    BdCumandocEntity bdCumandocEntity = cacheTocMapVoV2.getStringBdCumandocEntityMap().get(bdCubasdocEntity.getPkCubasdoc() + bdCorpEntity.getPkCorp());
-                    Assert.notNull(bdCumandocEntity, "无法匹配到客商档案 店铺名称:{}", "天猫intoyou旗舰店-自营");
+                        //客商管理档案:2024年8月5日 15:41:54 TOC店铺名称查询U8C客商档案,已经和妮姐确认
+                        //2024年8月5日 15:49:49 先根据O店铺编码,得到店铺档案信息,取到名称,通过U8C接口查询出来
+                        //目前O店铺信息查询接口还没有,等待开发,所以我这里先写所一个名字
+                        BdCumandocEntity bdCumandocEntity = cacheTocMapVoV2.getStringBdCumandocEntityMap().get(bdCubasdocEntity.getPkCubasdoc() + bdCorpEntity.getPkCorp());
+                        Assert.notNull(bdCumandocEntity, "无法匹配到客商档案 店铺名称:{}", "天猫intoyou旗舰店-自营");
 
-                    //查找平台
-                    String sourcePlatformCode = header.getSourcePlatformCode();
-                    Assert.notNull(sourcePlatformCode, "O平台编码不能为空!");
-                    BdDefdocEntity bdDefdocEntity = cacheTocMapVoV2.getStringBdDefdocEntityMap().get(sourcePlatformCode);
-                    Assert.notNull(bdDefdocEntity, "根据O平台编码({})无法匹配到U8C平台档案", header.getSourcePlatformCode());
+                        //查找平台
+                        String sourcePlatformCode = header.getSourcePlatformCode();
+                        Assert.notNull(sourcePlatformCode, "O平台编码不能为空!");
+                        BdDefdocEntity bdDefdocEntity = cacheTocMapVoV2.getStringBdDefdocEntityMap().get(sourcePlatformCode);
+                        Assert.notNull(bdDefdocEntity, "根据O平台编码({})无法匹配到U8C平台档案", header.getSourcePlatformCode());
 
-                    //查找店铺
+                        //查找店铺
 //                    String storeCode2 = header.getStoreCode();
 //                    Assert.notNull(storeCode2, "O店铺编码不能为空!");
-                    BdDefdocEntity bdDefdocEntity1 = cacheTocMapVoV2.getStringBdDefdocEntityMap1().get(storeCode);
-                    Assert.notNull(bdDefdocEntity1, "根据O店铺编码({})无法匹配到U8C店铺档案", storeCode);
+                        BdDefdocEntity bdDefdocEntity1 = cacheTocMapVoV2.getStringBdDefdocEntityMap1().get(storeCode);
+                        Assert.notNull(bdDefdocEntity1, "根据O店铺编码({})无法匹配到U8C店铺档案", storeCode);
 
-                    //字段拷贝
-                    for (int j = 0; j < details.size(); j++) {
-                        StockinOrderSearchResponse.StockinOrder.StockinB stockinB = details.get(j);
+                        //字段拷贝
+                        for (int j = 0; j < details.size(); j++) {
+                            StockinOrderSearchResponse.StockinOrder.StockinB stockinB = details.get(j);
 
-                        //存货管理档案,是发货公司的存货档案
-                        BdInvmandocEntity bdInvmandocEntity = cacheTocMapVoV2.getStringBdInvmandocEntityMap().get(stockinB.getSkuCode() + bdCorpEntity.getPkCorp());
-                        Assert.notNull(bdInvmandocEntity, "无法匹配到存货管理档案 货品sku:{} 公司:{}", stockinB.getSkuCode(), bdCorpEntity.getPkCorp());
-                        //存货基本档案
-                        BdInvbasdocEntity bdInvbasdocEntity = cacheTocMapVoV2.getStringBdInvbasdocEntityMap().get(bdInvmandocEntity.getPkInvmandoc() + bdCorpEntity.getPkCorp());
-                        Assert.notNull(bdInvbasdocEntity, "无法匹配到存货基本档案 存货管理主键:{} 公司:{}", bdInvmandocEntity.getPkInvmandoc(), bdCorpEntity.getPkCorp());
-                        //存货税率
-                        BdTaxitemsEntity bdTaxitemsEntity = cacheTocMapVoV2.getStringBdTaxitemsEntityMap().get(bdInvmandocEntity.getInvcode());
-                        Assert.notNull(bdTaxitemsEntity, "无法匹配到存货税率 存货编码:{}", bdInvmandocEntity.getInvcode());
+                            //存货管理档案,是发货公司的存货档案
+                            BdInvmandocEntity bdInvmandocEntity = cacheTocMapVoV2.getStringBdInvmandocEntityMap().get(stockinB.getSkuCode() + bdCorpEntity.getPkCorp());
+                            Assert.notNull(bdInvmandocEntity, "无法匹配到存货管理档案 货品sku:{} 公司:{}", stockinB.getSkuCode(), bdCorpEntity.getPkCorp());
+                            //存货基本档案
+                            BdInvbasdocEntity bdInvbasdocEntity = cacheTocMapVoV2.getStringBdInvbasdocEntityMap().get(bdInvmandocEntity.getPkInvmandoc() + bdCorpEntity.getPkCorp());
+                            Assert.notNull(bdInvbasdocEntity, "无法匹配到存货基本档案 存货管理主键:{} 公司:{}", bdInvmandocEntity.getPkInvmandoc(), bdCorpEntity.getPkCorp());
+                            //存货税率
+                            BdTaxitemsEntity bdTaxitemsEntity = cacheTocMapVoV2.getStringBdTaxitemsEntityMap().get(bdInvmandocEntity.getInvcode());
+                            Assert.notNull(bdTaxitemsEntity, "无法匹配到存货税率 存货编码:{}", bdInvmandocEntity.getInvcode());
 
-                        //2024年8月6日 10:16:22 通过O出库单的表头,查询得出U8C档案,放在表体的原因是方便分组汇总
-                        //下一个步骤的分组汇总,是通过表体明细完成的
-                        GoodsRertunSonDetailsDto goodsRertunSonDetailsDto = new GoodsRertunSonDetailsDto();
-                        goodsRertunSonDetailsDto.setHeader(header);
-                        goodsRertunSonDetailsDto.setBdCorpEntity(bdCorpEntity);
-                        goodsRertunSonDetailsDto.setDeliverGoodsCorp(bdCorpEntity);
-                        goodsRertunSonDetailsDto.setBdCalbodyEntity(bdCalbodyEntity);
-                        goodsRertunSonDetailsDto.setBdStordocEntity(bdStordocEntity);
-                        goodsRertunSonDetailsDto.setBdCalbodyEntity1(bdCalbodyEntity);
-                        goodsRertunSonDetailsDto.setBdStordocEntity1(bdStordocEntity);
-                        goodsRertunSonDetailsDto.setBdSalestruEntity(bdSalestruEntity);
-                        goodsRertunSonDetailsDto.setBdDeptdocEntity(bdDeptdocEntity);
-                        goodsRertunSonDetailsDto.setBdCumandocEntity(bdCumandocEntity);
-                        goodsRertunSonDetailsDto.setBdCubasdocEntity(bdCubasdocEntity);
-                        goodsRertunSonDetailsDto.setPlatformArchives(bdDefdocEntity);
-                        goodsRertunSonDetailsDto.setBdRdclEntity(bdRdclEntity);
-                        goodsRertunSonDetailsDto.setShopArchives(bdDefdocEntity1);
-                        goodsRertunSonDetailsDto.setBdInvmandocEntity(bdInvmandocEntity);
-                        goodsRertunSonDetailsDto.setBdInvbasdocEntity(bdInvbasdocEntity);
-                        goodsRertunSonDetailsDto.setBdTaxitemsEntity(bdTaxitemsEntity);
+                            //2024年8月6日 10:16:22 通过O出库单的表头,查询得出U8C档案,放在表体的原因是方便分组汇总
+                            //下一个步骤的分组汇总,是通过表体明细完成的
+                            GoodsRertunSonDetailsDto goodsRertunSonDetailsDto = new GoodsRertunSonDetailsDto();
+                            goodsRertunSonDetailsDto.setHeader(header);
+                            goodsRertunSonDetailsDto.setBdCorpEntity(bdCorpEntity);
+                            goodsRertunSonDetailsDto.setDeliverGoodsCorp(bdCorpEntity);
+                            goodsRertunSonDetailsDto.setBdCalbodyEntity(bdCalbodyEntity);
+                            goodsRertunSonDetailsDto.setBdStordocEntity(bdStordocEntity);
+                            goodsRertunSonDetailsDto.setBdCalbodyEntity1(bdCalbodyEntity);
+                            goodsRertunSonDetailsDto.setBdStordocEntity1(bdStordocEntity);
+                            goodsRertunSonDetailsDto.setBdSalestruEntity(bdSalestruEntity);
+                            goodsRertunSonDetailsDto.setBdDeptdocEntity(bdDeptdocEntity);
+                            goodsRertunSonDetailsDto.setBdCumandocEntity(bdCumandocEntity);
+                            goodsRertunSonDetailsDto.setBdCubasdocEntity(bdCubasdocEntity);
+                            goodsRertunSonDetailsDto.setPlatformArchives(bdDefdocEntity);
+                            goodsRertunSonDetailsDto.setBdRdclEntity(bdRdclEntity);
+                            goodsRertunSonDetailsDto.setShopArchives(bdDefdocEntity1);
+                            goodsRertunSonDetailsDto.setBdInvmandocEntity(bdInvmandocEntity);
+                            goodsRertunSonDetailsDto.setBdInvbasdocEntity(bdInvbasdocEntity);
+                            goodsRertunSonDetailsDto.setBdTaxitemsEntity(bdTaxitemsEntity);
 
-                        BeanUtil.copyPropertiesV2(stockinB, goodsRertunSonDetailsDto);
-                        sonDetailsDtoList.add(goodsRertunSonDetailsDto);
+                            BeanUtil.copyPropertiesV2(stockinB, goodsRertunSonDetailsDto);
+                            sonDetailsDtoList.add(goodsRertunSonDetailsDto);
+                            //成功收集进入到集合
+                        }
+                    } catch (Exception e) {
+                        logger.error("档案转换抛出异常", e);
+
+                        //失败
+                        String message = e.getMessage();
+                        if (message == null) {
+                            message = "未知错误";
+                        }
+                        ErrorHeaderDetailsDtoDtoV2 errorHeaderDetailsDtoDto = new ErrorHeaderDetailsDtoDtoV2();
+                        errorHeaderDetailsDtoDto.setNewPushDate(getNewDateStr());
+                        errorHeaderDetailsDtoDto.setNewTransmitInfo(message);
+                        errorHeaderDetailsDtoDto.setNewstate("N");
+                        errorHeaderDetailsDtoDto.setHeader(header);
+                        errorHeaderDetailsDtoDto.setDetails(details);
+                        errorHeaderDetailsDtoDtoList.add(errorHeaderDetailsDtoDto);
                     }
                 }
-                //成功
             } catch (Exception e) {
                 logger.error("OFS销售出库单关联查询U8C档案失败", e);
-                //失败
             }
         } else {
             logger.info("queryBasicArchives方法headerDetailsDtoList.size为0");
         }
+        //错误日志同步到数据
+        if (errorHeaderDetailsDtoDtoList.size() > 0) {
+            updateFailOrSuccessTocofsSaleoutDetailedArchiveInquiry(errorHeaderDetailsDtoDtoList, sceneType);
+        }
         return sonDetailsDtoList;
     }
 
@@ -975,6 +1160,7 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
 
                 TocofsReturngoodsDetailedEntity tocofsReturngoodsDetailedEntity = new TocofsReturngoodsDetailedEntity();
                 BeanUtil.copyPropertiesV2(stockinB, tocofsReturngoodsDetailedEntity);
+                //补充额外的字段信息
                 createPrimaryKeyAndBusinessDateAndBusinessType(tocofsReturngoodsDetailedEntity, returnGoodSearchHeaderDto);
                 tocofsSaleoutDetailedEntityArrayList.add(tocofsReturngoodsDetailedEntity);
             }
@@ -1264,9 +1450,20 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
      */
     private void createPrimaryKeyAndBusinessDateAndBusinessType(TocofsReturngoodsDetailedEntity tocofsReturngoodsDetailedEntity, StockinOrderSearchResponse.StockinOrder.StockinH returnGoodSearchHeaderDto) {
         if (tocofsReturngoodsDetailedEntity != null && returnGoodSearchHeaderDto != null) {
-            tocofsReturngoodsDetailedEntity.setPrimaryKey(tocofsReturngoodsDetailedEntity.getId());//主表主键
-            tocofsReturngoodsDetailedEntity.setBusinessDate(returnGoodSearchHeaderDto.getCheckInFrom());//业务日期
-            tocofsReturngoodsDetailedEntity.setBusinessType("TOC_RETURN");//业务类型
+            //主表主键
+            if (tocofsReturngoodsDetailedEntity.getId() != null) {
+                tocofsReturngoodsDetailedEntity.setMaintableid(tocofsReturngoodsDetailedEntity.getId());
+            }
+            //业务日期-入库时间
+            if (returnGoodSearchHeaderDto.getCheckInFrom() != null) {
+                tocofsReturngoodsDetailedEntity.setBusinessdate(returnGoodSearchHeaderDto.getCheckInFrom());
+            }
+            //业务日期-退款完成时间
+            if (returnGoodSearchHeaderDto.getRefundedAt() != null) {
+                tocofsReturngoodsDetailedEntity.setRefundedat(returnGoodSearchHeaderDto.getRefundedAt());
+            }
+            //业务类型
+            tocofsReturngoodsDetailedEntity.setBusinesstype("TOC_RETURN");
         }
     }
 
@@ -1474,4 +1671,440 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
             }
         }
     }
+
+    /**
+     * 生成当前日期
+     *
+     * @author liuyang
+     */
+    private String getNewDateStr() {
+        LocalDateTime now = LocalDateTime.now();
+        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+        return now.format(formatter);
+    }
+
+    /**
+     * 批量修改成功、或者失败,适合档案查询的部分
+     *
+     * @param errorHeaderDetailsDtoDtoList 错误日志
+     * @param sceneType                    场景类型
+     * @author liuyang
+     */
+    private void updateFailOrSuccessTocofsSaleoutDetailedArchiveInquiry(List<ErrorHeaderDetailsDtoDtoV2> errorHeaderDetailsDtoDtoList, String sceneType) {
+        Assert.notNull(errorHeaderDetailsDtoDtoList, "errorHeaderDetailsDtoDtoList不能为空!");
+
+        Thread thread = new Thread(new Runnable() {
+            @Override
+            public void run() {
+                try {
+                    if (errorHeaderDetailsDtoDtoList != null && errorHeaderDetailsDtoDtoList.size() > 0) {
+                        List<TocofsReturngoodsDetailedEntity> tocofsSaleoutDetailedEntityList = new ArrayList<>();
+                        for (int i = 0; i < errorHeaderDetailsDtoDtoList.size(); i++) {
+                            ErrorHeaderDetailsDtoDtoV2 errorHeaderDetailsDtoDtoV2 = errorHeaderDetailsDtoDtoList.get(i);
+                            StockinOrderSearchResponse.StockinOrder.StockinH header = errorHeaderDetailsDtoDtoV2.getHeader();
+                            List<StockinOrderSearchResponse.StockinOrder.StockinB> details = errorHeaderDetailsDtoDtoV2.getDetails();
+                            String newstate = errorHeaderDetailsDtoDtoV2.getNewstate();
+                            String newPushDate = errorHeaderDetailsDtoDtoV2.getNewPushDate();
+                            String newTransmitInfo = errorHeaderDetailsDtoDtoV2.getNewTransmitInfo();
+
+                            //如果报错内容太长了,则仅保留500个长度
+                            if (newTransmitInfo != null && !"".equals(newTransmitInfo.trim()) && newTransmitInfo.length() >= 400) {
+                                newTransmitInfo = newTransmitInfo.substring(0, 400);
+                            }
+
+                            for (int j = 0; j < details.size(); j++) {
+                                StockinOrderSearchResponse.StockinOrder.StockinB stockinB = details.get(j);
+
+                                TocofsReturngoodsDetailedEntity tocofsReturngoodsDetailedEntity = new TocofsReturngoodsDetailedEntity();
+
+                                tocofsReturngoodsDetailedEntity.setId(stockinB.getId());
+                                if (sceneType.equals("stock")) {
+                                    tocofsReturngoodsDetailedEntity.setNewpushdate3(newPushDate);
+                                    tocofsReturngoodsDetailedEntity.setNewtransmitinfo3(newTransmitInfo);
+                                    tocofsReturngoodsDetailedEntity.setNewstate3(newstate);
+                                    tocofsReturngoodsDetailedEntity.setNewsystemnumber3(null);
+                                    tocofsReturngoodsDetailedEntity.setNewsystemprimary3(null);
+                                } else if (sceneType.equals("tran")) {
+                                    tocofsReturngoodsDetailedEntity.setNewpushdate4(newPushDate);
+                                    tocofsReturngoodsDetailedEntity.setNewtransmitinfo4(newTransmitInfo);
+                                    tocofsReturngoodsDetailedEntity.setNewstate4(newstate);
+                                    tocofsReturngoodsDetailedEntity.setNewsystemnumber4(null);
+                                    tocofsReturngoodsDetailedEntity.setNewsystemprimary4(null);
+                                }
+                                tocofsSaleoutDetailedEntityList.add(tocofsReturngoodsDetailedEntity);
+                            }
+                        }
+
+                        //以50行为一个批次更新状态
+                        if (tocofsSaleoutDetailedEntityList.size() > 0) {
+                            List<List<TocofsReturngoodsDetailedEntity>> splitListByCount = SplitListByCountUtil.splitListByCount(tocofsSaleoutDetailedEntityList, 50);
+                            for (int i = 0; i < splitListByCount.size(); i++) {
+                                List<TocofsReturngoodsDetailedEntity> tocofsReturngoodsDetailedEntities = splitListByCount.get(i);
+                                if (sceneType.equals("stock")) {
+                                    //库存
+                                    iTocofsReturngoodsDetailedDao.entityInsertOrUpdateBatchByTocRerturnStock(tocofsReturngoodsDetailedEntities);
+                                } else if (sceneType.equals("tran")) {
+                                    //确认收入
+                                    iTocofsReturngoodsDetailedDao.entityInsertOrUpdateBatchByTocRerturnTran(tocofsReturngoodsDetailedEntities);
+                                }
+                            }
+                        }
+                    }
+                } catch (Exception e) {
+                    logger.error("TOB业务,填充出库明细日志抛出异常", e);
+                }
+            }
+        });
+        thread.start();
+        try {
+            thread.join();
+        } catch (Exception e) {
+            logger.error("updateFailOrSuccessTocofsSaleoutDetailedArchiveInquiry方法现场抛出异常", e);
+        }
+    }
+
+    /**
+     * 处理TOC-库存同步的成功、失败错误逻辑
+     *
+     * @author liuyang
+     */
+    private void updateSuccessOrFail1(List<GoodsRertunSonDetailsDto> sonDetailsDtoList, String newstate, String newTransmitInfo, String newsystemnumber, String newsystemprimary) {
+        if (newTransmitInfo != null && !"".equals(newTransmitInfo.trim()) && newTransmitInfo.length() >= 400) {
+            newTransmitInfo = newTransmitInfo.substring(0, 400);
+        }
+
+        String finalNewTransmitInfo = newTransmitInfo;
+        Thread thread = new Thread(new Runnable() {
+            @Override
+            public void run() {
+                try {
+                    String successY = "Y";
+                    if (sonDetailsDtoList != null && sonDetailsDtoList.size() > 0) {
+                        List<TocofsReturngoodsDetailedEntity> tocofsReturngoodsDetailedEntityArrayList = new ArrayList<>();
+                        for (int i = 0; i < sonDetailsDtoList.size(); i++) {
+                            GoodsRertunSonDetailsDto goodsRertunSonDetailsDto = sonDetailsDtoList.get(i);
+
+                            TocofsReturngoodsDetailedEntity tocofsReturngoodsDetailedEntity = new TocofsReturngoodsDetailedEntity();
+                            tocofsReturngoodsDetailedEntity.setId(goodsRertunSonDetailsDto.getId());
+                            tocofsReturngoodsDetailedEntity.setNewpushdate3(getNewDateStr());
+                            tocofsReturngoodsDetailedEntity.setNewtransmitinfo3(finalNewTransmitInfo);
+                            tocofsReturngoodsDetailedEntity.setNewstate3(newstate);
+                            if (successY.equals(newstate)) {
+                                tocofsReturngoodsDetailedEntity.setNewsystemnumber3(newsystemnumber);
+                                tocofsReturngoodsDetailedEntity.setNewsystemprimary3(newsystemprimary);
+                            }
+                            tocofsReturngoodsDetailedEntityArrayList.add(tocofsReturngoodsDetailedEntity);
+                        }
+
+                        //以50行为一个批次,推送到Mysql
+                        if (tocofsReturngoodsDetailedEntityArrayList.size() > 0) {
+                            List<List<TocofsReturngoodsDetailedEntity>> splitListByCount = SplitListByCountUtil.splitListByCount(tocofsReturngoodsDetailedEntityArrayList, 50);
+                            for (int i = 0; i < splitListByCount.size(); i++) {
+                                List<TocofsReturngoodsDetailedEntity> tocofsReturngoodsDetailedEntities = splitListByCount.get(i);
+                                iTocofsReturngoodsDetailedDao.entityInsertOrUpdateBatchByTocRerturnStock(tocofsReturngoodsDetailedEntities);
+                            }
+                        }
+                    }
+                } catch (Exception e) {
+                    logger.error("TOC库存同步日志,抛出异常", e);
+                }
+            }
+        });
+        thread.start();
+        try {
+            thread.join();
+        } catch (Exception e) {
+            logger.error("updateSuccessOrFail1方法现场抛出异常", e);
+        }
+    }
+
+    /**
+     * 处理TOC-库存同步的成功、失败错误逻辑
+     *
+     * @author liuyang
+     */
+    private void updateSuccessOrFail2(List<GoodsRertunSonDetailsDto> sonDetailsDtoList, String newstate, String newTransmitInfo, String newsystemnumber, String newsystemprimary) {
+        if (newTransmitInfo != null && !"".equals(newTransmitInfo.trim()) && newTransmitInfo.length() >= 400) {
+            newTransmitInfo = newTransmitInfo.substring(0, 400);
+        }
+
+        String finalNewTransmitInfo = newTransmitInfo;
+        Thread thread = new Thread(new Runnable() {
+            @Override
+            public void run() {
+                try {
+                    String successY = "Y";
+                    if (sonDetailsDtoList != null && sonDetailsDtoList.size() > 0) {
+                        List<TocofsReturngoodsDetailedEntity> tocofsReturngoodsDetailedEntityArrayList = new ArrayList<>();
+                        for (int i = 0; i < sonDetailsDtoList.size(); i++) {
+                            GoodsRertunSonDetailsDto goodsRertunSonDetailsDto = sonDetailsDtoList.get(i);
+
+                            TocofsReturngoodsDetailedEntity tocofsReturngoodsDetailedEntity = new TocofsReturngoodsDetailedEntity();
+                            tocofsReturngoodsDetailedEntity.setId(goodsRertunSonDetailsDto.getId());
+                            tocofsReturngoodsDetailedEntity.setNewpushdate4(getNewDateStr());
+                            tocofsReturngoodsDetailedEntity.setNewtransmitinfo4(finalNewTransmitInfo);
+                            tocofsReturngoodsDetailedEntity.setNewstate4(newstate);
+                            if (successY.equals(newstate)) {
+                                tocofsReturngoodsDetailedEntity.setNewsystemnumber4(newsystemnumber);
+                                tocofsReturngoodsDetailedEntity.setNewsystemprimary4(newsystemprimary);
+                            }
+                            tocofsReturngoodsDetailedEntityArrayList.add(tocofsReturngoodsDetailedEntity);
+                        }
+
+                        //以50行为一个批次,推送到Mysql
+                        if (tocofsReturngoodsDetailedEntityArrayList.size() > 0) {
+                            List<List<TocofsReturngoodsDetailedEntity>> splitListByCount = SplitListByCountUtil.splitListByCount(tocofsReturngoodsDetailedEntityArrayList, 50);
+                            for (int i = 0; i < splitListByCount.size(); i++) {
+                                List<TocofsReturngoodsDetailedEntity> tocofsReturngoodsDetailedEntities = splitListByCount.get(i);
+                                iTocofsReturngoodsDetailedDao.entityInsertOrUpdateBatchByTocRerturnTran(tocofsReturngoodsDetailedEntities);
+                            }
+                        }
+                    }
+                } catch (Exception e) {
+                    logger.error("TOC确认收入同步日志,抛出异常", e);
+                }
+            }
+        });
+        thread.start();
+        try {
+            thread.join();
+        } catch (Exception e) {
+            logger.error("updateSuccessOrFail1方法现场抛出异常", e);
+        }
+    }
+
+    /**
+     * 筛选出未推送、或者失败的数据行,过滤库存同步业务
+     *
+     * @param tocofsReturngoodsDetailedEntityList     日志行状态
+     * @param returnGoodHeaderDetailsDataDtoArrayList 返回结果
+     * @author liuyang
+     */
+    private List<StockinOrderSearchResponse.StockinOrder> filterDataRowsAsPushOrFailedStock(List<TocofsReturngoodsDetailedEntity> tocofsReturngoodsDetailedEntityList, List<StockinOrderSearchResponse.StockinOrder> returnGoodHeaderDetailsDataDtoArrayList) throws Exception {
+        List<StockinOrderSearchResponse.StockinOrder> targetHeaderDetailsDtoList = new ArrayList<>();
+
+        if (tocofsReturngoodsDetailedEntityList != null && tocofsReturngoodsDetailedEntityList.size() > 0 && returnGoodHeaderDetailsDataDtoArrayList != null && returnGoodHeaderDetailsDataDtoArrayList.size() > 0) {
+            //字段Y(成功)或者为H(待处理)可以视为成功,完成了小段业务闭环的数据行
+            String succeseeY = "Y";
+            String succeseeH = "H";
+            for (int i = 0; i < returnGoodHeaderDetailsDataDtoArrayList.size(); i++) {
+                StockinOrderSearchResponse.StockinOrder stockinOrder = returnGoodHeaderDetailsDataDtoArrayList.get(i);
+                StockinOrderSearchResponse.StockinOrder.StockinH header = stockinOrder.getHeader();
+                List<StockinOrderSearchResponse.StockinOrder.StockinB> details = stockinOrder.getDetails();
+
+                List<StockinOrderSearchResponse.StockinOrder.StockinB> targetDetails = new ArrayList<>();
+                for (int j = 0; j < details.size(); j++) {
+                    StockinOrderSearchResponse.StockinOrder.StockinB stockinB = details.get(j);
+                    Boolean isSuccess = false;
+                    String newstate = null;
+                    for (int k = 0; k < tocofsReturngoodsDetailedEntityList.size(); k++) {
+                        TocofsReturngoodsDetailedEntity tocofsReturngoodsDetailedEntity = tocofsReturngoodsDetailedEntityList.get(k);
+                        if (tocofsReturngoodsDetailedEntity.getId().equals(stockinB.getId())) {
+                            newstate = tocofsReturngoodsDetailedEntity.getNewstate3();
+                            if (succeseeY.equals(newstate) || succeseeH.equals(newstate)) {
+                                isSuccess = true;
+                            }
+                        }
+                    }
+                    if (!isSuccess) {
+                        stockinB.setNewstate3(newstate);
+                        targetDetails.add(stockinB);
+                    }
+                }
+                if (targetDetails.size() > 0) {
+                    //如果明细行中,还存在未推送或者失败的数据,则需要更新明细行
+                    stockinOrder.setDetails(targetDetails);
+                    targetHeaderDetailsDtoList.add(stockinOrder);
+                }
+            }
+        }
+        return targetHeaderDetailsDtoList;
+    }
+
+    /**
+     * 筛选出未推送、或者失败的数据行,过滤库存同步业务
+     *
+     * @param tocofsReturngoodsDetailedEntityList     日志行状态
+     * @param returnGoodHeaderDetailsDataDtoArrayList 返回结果
+     * @author liuyang
+     */
+    private List<StockinOrderSearchResponse.StockinOrder> filterDataRowsAsPushOrFailedTran(List<TocofsReturngoodsDetailedEntity> tocofsReturngoodsDetailedEntityList, List<StockinOrderSearchResponse.StockinOrder> returnGoodHeaderDetailsDataDtoArrayList) throws Exception {
+        Assert.notNull(tocofsReturngoodsDetailedEntityList, "tocofsReturngoodsDetailedEntityList不能为空");
+        Assert.notNull(returnGoodHeaderDetailsDataDtoArrayList, "returnGoodHeaderDetailsDataDtoArrayList不能为空");
+
+        List<StockinOrderSearchResponse.StockinOrder> targetHeaderDetailsDtoList = new ArrayList<>();
+
+        if (tocofsReturngoodsDetailedEntityList != null && tocofsReturngoodsDetailedEntityList.size() > 0 && returnGoodHeaderDetailsDataDtoArrayList != null && returnGoodHeaderDetailsDataDtoArrayList.size() > 0) {
+            //字段Y(成功)或者为H(待处理)可以视为成功,完成了小段业务闭环的数据行
+            String succeseeY = "Y";
+            String succeseeH = "H";
+            for (int i = 0; i < returnGoodHeaderDetailsDataDtoArrayList.size(); i++) {
+                StockinOrderSearchResponse.StockinOrder stockinOrder = returnGoodHeaderDetailsDataDtoArrayList.get(i);
+                StockinOrderSearchResponse.StockinOrder.StockinH header = stockinOrder.getHeader();
+                List<StockinOrderSearchResponse.StockinOrder.StockinB> details = stockinOrder.getDetails();
+
+                List<StockinOrderSearchResponse.StockinOrder.StockinB> targetDetails = new ArrayList<>();
+                for (int j = 0; j < details.size(); j++) {
+                    StockinOrderSearchResponse.StockinOrder.StockinB stockinB = details.get(j);
+                    Boolean isSuccess = false;
+                    String newstate = null;
+                    for (int k = 0; k < tocofsReturngoodsDetailedEntityList.size(); k++) {
+                        TocofsReturngoodsDetailedEntity tocofsReturngoodsDetailedEntity = tocofsReturngoodsDetailedEntityList.get(k);
+                        if (tocofsReturngoodsDetailedEntity.getId().equals(stockinB.getId())) {
+                            newstate = tocofsReturngoodsDetailedEntity.getNewstate4();
+                            if (succeseeY.equals(newstate) || succeseeH.equals(newstate)) {
+                                isSuccess = true;
+                            }
+                        }
+                    }
+                    if (!isSuccess) {
+                        stockinB.setNewstate4(newstate);
+                        targetDetails.add(stockinB);
+                    }
+                }
+                if (targetDetails.size() > 0) {
+                    //如果明细行中,还存在未推送或者失败的数据,则需要更新明细行
+                    stockinOrder.setDetails(targetDetails);
+                    targetHeaderDetailsDtoList.add(stockinOrder);
+                }
+            }
+        }
+        return targetHeaderDetailsDtoList;
+    }
+
+    /**
+     * 计算时间间隔
+     *
+     * @author liuyang
+     */
+    public String computingTime(String param) {
+        if (param != null && !"".equals(param)) {
+            String[] split = param.split("/");
+            if (!(split.length == 2)) {
+                Assert.state(false, "传递的日期格式不完整 格式参考:2024-04-01/2024-04-30");
+            }
+
+            LocalDate startDate = LocalDate.parse(split[0]);
+            LocalDate endDate = LocalDate.parse(split[1]);
+
+            List<String> stringArrayList = new ArrayList<>();
+            List<String> dateRange = getDateRange(startDate, endDate);
+            if (dateRange != null && dateRange.size() > 0) {
+                for (int i = 0; i < dateRange.size(); i++) {
+                    String dateStr = dateRange.get(i);
+                    StringBuffer stringBuffer = new StringBuffer();
+                    stringBuffer.append(dateStr);
+                    stringBuffer.append(" 00:00:00");
+                    stringBuffer.append(",");
+                    stringBuffer.append(dateStr);
+                    stringBuffer.append(" 23:59:59");
+                    stringArrayList.add(stringBuffer.toString());
+                }
+            }
+            String collectDateStr = stringArrayList.stream().collect(Collectors.joining("*"));
+            logger.info("类型:time_frame 生成的日期范围:" + collectDateStr);
+            return collectDateStr;
+        }
+        return null;
+    }
+
+    /**
+     * 分割日期之后,再进行推送
+     *
+     * @author liuyang
+     */
+    public void splitDateAndPush(String param, String sceneType) throws Exception {
+        try {
+            Assert.notNull(param, "param不能为空!");
+            Assert.state(!"".equals(param), "param不能为空!");
+
+            Assert.notNull(sceneType, "sceneType不能为空!");
+            Assert.state(!"".equals(sceneType), "sceneType不能为空!");
+
+            if (param.contains("*")) {
+                String[] params = param.split("\\*");
+                if (params.length > 0) {
+                    for (int i = 0; i < params.length; i++) {
+                        String indexStr = params[i];
+                        String[] split = indexStr.split(",");
+                        logger.info("splitDateAndPush方法正在执行主要的逻辑 开始时间:{} 结束时间:{}", split[0], split[1]);
+                        if (sceneType.equals(STOCK)) {
+                            startImplementStockByTime(split[0], split[1]);
+                        } else if (sceneType.equals(TRAN)) {
+                            startImplementByTradeTime(split[0], split[1]);
+                        }
+                    }
+                }
+            } else {
+                String[] split = param.split(",");
+                logger.info("splitDateAndPush方法正在执行主要的逻辑 开始时间:{} 结束时间:{}", split[0], split[1]);
+                if (sceneType.equals(STOCK)) {
+                    startImplementStockByTime(split[0], split[1]);
+                } else if (sceneType.equals(TRAN)) {
+                    startImplementByTradeTime(split[0], split[1]);
+                }
+            }
+        } catch (Exception e) {
+            logger.error("记录splitDateAndPush方法抛出的异常", e);
+        }
+    }
+
+    /**
+     * 计算全天时间段
+     *
+     * @author liuyang
+     */
+    public List<StartAndEndVo> calculateCalculateEntireDayPeriod(String dateStr) {
+        List<StartAndEndVo> startAndEnd = new ArrayList<>();
+
+        String calculateYesterdayStr = null;
+        if (dateStr != null) {
+            calculateYesterdayStr = dateStr;
+        } else {
+            calculateYesterdayStr = calculateYesterdayDate();//拉取'昨天'的日期
+        }
+        logger.info("OFS销售出库单同步U8C销售订单,目标拉取时间:" + calculateYesterdayStr);
+
+        for (int i = 0; i <= 23; i++) {
+            String iStr = null;
+            if (i <= 9) {
+                iStr = "0" + i;
+            } else {
+                iStr = String.valueOf(i);
+            }
+            String startTime = calculateYesterdayStr + " " + iStr + ":00:00";
+            String endTime = calculateYesterdayStr + " " + iStr + ":59:59";
+
+            StartAndEndVo startAndEndVo = new StartAndEndVo();
+            startAndEndVo.setStart_time(startTime);
+            startAndEndVo.setEnd_time(endTime);
+            startAndEnd.add(startAndEndVo);
+        }
+        return startAndEnd;
+    }
+
+    /**
+     * 计算昨天的单据日期,基于定时器在凌晨5分执行的情况下
+     *
+     * @author liuyang
+     */
+    public String calculateYesterdayDate() {
+        DateTime yesterdayDate = DateUtil.yesterday();
+        return DateUtil.format(yesterdayDate, "yyyy-MM-dd");
+    }
+
+    /**
+     * 计算时间范围对应的字符串集合
+     *
+     * @author liuyang
+     */
+    private List<String> getDateRange(LocalDate startDate, LocalDate endDate) {
+        List<String> dateRange = new ArrayList<>();
+        LocalDate currentDate = startDate;
+        while (!currentDate.isAfter(endDate)) {
+            dateRange.add(currentDate.format(DateTimeFormatter.ISO_DATE));
+            currentDate = currentDate.plusDays(1);
+        }
+        return dateRange;
+    }
 }
\ No newline at end of file
diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/u8cdto/ErrorHeaderDetailsDtoDtoV2.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/u8cdto/ErrorHeaderDetailsDtoDtoV2.java
new file mode 100644
index 00000000..db38ca2c
--- /dev/null
+++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/u8cdto/ErrorHeaderDetailsDtoDtoV2.java
@@ -0,0 +1,33 @@
+package com.hzya.frame.plugin.lets.u8cdto;
+
+import com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto;
+import com.hzya.frame.ttxofs.dto.stock.StockinOrderSearchResponse;
+import lombok.Data;
+
+/**
+ * @Author:liuyang
+ * @Package:com.hzya.frame.plugin.lets.u8cdto
+ * @Project:kangarooDataCenterV3
+ * @name:ErrorHeaderDetailsDtoDto
+ * @Date:2024/9/5 15:48
+ * @Filename:ErrorHeaderDetailsDtoDto
+ */
+@Data
+public class ErrorHeaderDetailsDtoDtoV2 extends StockinOrderSearchResponse.StockinOrder {
+    //(销售)推送时间
+    private String newPushDate;
+    //(销售)报错详情
+    private String newTransmitInfo;
+    //(销售)出库同步是否成功
+    private String newstate;
+    //推送时间
+    private String def5;
+    //报错详情
+    private String def6;
+    //(销售)交易成功(TOB发票)是否成功
+    private String newstate4;
+    //下游单号
+    private String newSystemNumber4;
+    //下游主键
+    private String newSystemPrimary4;
+}
diff --git a/service/src/main/java/com/hzya/frame/ttxofs/dto/stock/StockinOrderSearchResponse.java b/service/src/main/java/com/hzya/frame/ttxofs/dto/stock/StockinOrderSearchResponse.java
index f476c406..740dc139 100644
--- a/service/src/main/java/com/hzya/frame/ttxofs/dto/stock/StockinOrderSearchResponse.java
+++ b/service/src/main/java/com/hzya/frame/ttxofs/dto/stock/StockinOrderSearchResponse.java
@@ -102,6 +102,9 @@ public class StockinOrderSearchResponse extends ReturnMessageBasics {
             private String lastUpdated;
             private String lastUpdatedBy;
             private String discountPrice;
+            private String newstate;
+            private String newstate3;
+            private String newstate4;
             //表头对象
             private StockinH returnGoodSearchHeaderDto;
         }