供应商管理数据同步, tms系统产品,服务渠道,产品渠道关系数据同步

This commit is contained in:
wuweihua
2026-10-12 10:28:06 +08:00
parent d08485d738
commit 2a9825c498
29 changed files with 1646 additions and 127 deletions
@@ -4,13 +4,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bms.customer.supplierinfo.mapper.OracleSupplierSyncMapper">
<!-- 老系统供应商主表全量读取;只取 sup_supplier 能承接的列。
三个类型字段口径以 TAB_SUPPLIER 为准:
SUP_TYPE 1卡车行 2航司代理 3报关行 4清关行 5尾派服务商 6报关代理
INVOICE_TYPE 1增普 2增专 3电普 4其他普票;KACHE_TYPE 0国内 1国外 -->
<select id="selectAllTabSupplier" resultType="java.util.HashMap" fetchSize="500">
SELECT SUP_CODE, SUP_NAME, SUP_TYPE, INVOICE_TYPE, KACHE_TYPE,
BL_OPEN, QUOTA, SETTLEMENT_PERIOD, REMARK, CREATE_TIME
FROM WEISHI_USER.TAB_SUPPLIER
<!-- 服务商(供应商)主数据:TAB_SERVICE_INFO(2026-10-10 起替代取数错误的 TAB_SUPPLIER)
SERVICE_TYPE 为中文口径:尾程渠道 -> 供应商类型 5(尾派服务商),清关 -> 4(清关行);
BL_OPEN:1 启用,其余停用 -->
<select id="selectAllServiceInfo" resultType="java.util.HashMap" fetchSize="500">
SELECT SERVICE_CODE, SERVICE_NAME, SERVICE_TYPE, BL_OPEN, REMARK, CREATE_DATE
FROM WEISHI_USER.TAB_SERVICE_INFO
</select>
<!-- 服务渠道:TAB_SERVICE_CHANNEL,按 SERVICE_CODE 归属于服务商;
同步时将同一服务商下全部渠道编码(含停用)聚合写入 sup_supplier.channel_ids -->
<select id="selectAllServiceChannel" resultType="java.util.HashMap" fetchSize="500">
SELECT SERVICE_CODE, CHANNEL_CODE
FROM WEISHI_USER.TAB_SERVICE_CHANNEL
ORDER BY SERVICE_CODE, CHANNEL_CODE
</select>
</mapper>
@@ -12,33 +12,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
INSERT INTO sup_supplier (
supplier_code, supplier_name, is_enable, del_flag, create_by
<if test="supplierType != null">, supplier_type</if>
<if test="invoiceType != null">, invoice_type</if>
<if test="kacheType != null">, kache_type</if>
<if test="ed != null">, ed</if>
<if test="zq != null">, zq</if>
<if test="channelIds != null">, channel_ids</if>
<if test="remark != null">, remark</if>
<if test="createTime != null">, create_time</if>
) VALUES (
#{supplierCode}, #{supplierName}, #{isEnable}, '0', #{createBy}
<if test="supplierType != null">, #{supplierType}</if>
<if test="invoiceType != null">, #{invoiceType}</if>
<if test="kacheType != null">, #{kacheType}</if>
<if test="ed != null">, #{ed}</if>
<if test="zq != null">, #{zq}</if>
<if test="channelIds != null">, #{channelIds}</if>
<if test="remark != null">, #{remark}</if>
<if test="createTime != null">, #{createTime}</if>
)
</insert>
<!-- 同步源(TAB_SERVICE_INFO/CHANNEL)无开票类型、卡车行类型、额度、账期,
更新时这些列一律不动,保留库内维护值;supplier_type/channel_ids 以源为准 -->
<update id="updateSyncSupplierByCode" parameterType="com.bms.customer.supplierinfo.domain.BmsSupplier">
UPDATE sup_supplier
SET supplier_name = #{supplierName}
, is_enable = #{isEnable}
, supplier_type = #{supplierType}
, invoice_type = #{invoiceType}
, kache_type = #{kacheType}
<if test="ed != null">, ed = #{ed}</if>
<if test="zq != null">, zq = #{zq}</if>
, channel_ids = #{channelIds}
<if test="remark != null">, remark = #{remark}</if>
, update_by = #{updateBy}
, update_time = #{updateTime}