供应商管理数据同步, 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
@@ -0,0 +1,148 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bms.masterdata.mapper.ChannelMasterSyncMapper">
<!-- ============ 服务渠道 ============ -->
<insert id="upsertServiceChannel">
INSERT INTO srv_service_channel (
id, channel_code, channel_name, service_code, service_name,
bl_open, bl_multiple, cargo_type, pay_type, shipper_name, shipper_id,
query_type, trajectory_code, final_service_name, des_port,
weight_type, dim_divisor, weight_rule, shipment_type, data_from, remarks,
create_name, create_man_code, create_date, modifier, modifier_code, modify_date,
gmt_create, gmt_modified, sync_time
) VALUES
<foreach collection="list" item="it" separator=",">
(#{it.id}, #{it.channelCode}, #{it.channelName}, #{it.serviceCode}, #{it.serviceName},
#{it.blOpen}, #{it.blMultiple}, #{it.cargoType}, #{it.payType}, #{it.shipperName}, #{it.shipperId},
#{it.queryType}, #{it.trajectoryCode}, #{it.finalServiceName}, #{it.desPort},
#{it.weightType}, #{it.dimDivisor}, #{it.weightRule}, #{it.shipmentType}, #{it.dataFrom}, #{it.remarks},
#{it.createName}, #{it.createManCode}, #{it.createDate}, #{it.modifier}, #{it.modifierCode}, #{it.modifyDate},
#{it.gmtCreate}, #{it.gmtModified}, NOW())
</foreach>
ON DUPLICATE KEY UPDATE
channel_code = VALUES(channel_code),
channel_name = VALUES(channel_name),
service_code = VALUES(service_code),
service_name = VALUES(service_name),
bl_open = VALUES(bl_open),
bl_multiple = VALUES(bl_multiple),
cargo_type = VALUES(cargo_type),
pay_type = VALUES(pay_type),
shipper_name = VALUES(shipper_name),
shipper_id = VALUES(shipper_id),
query_type = VALUES(query_type),
trajectory_code = VALUES(trajectory_code),
final_service_name = VALUES(final_service_name),
des_port = VALUES(des_port),
weight_type = VALUES(weight_type),
dim_divisor = VALUES(dim_divisor),
weight_rule = VALUES(weight_rule),
shipment_type = VALUES(shipment_type),
data_from = VALUES(data_from),
remarks = VALUES(remarks),
create_name = VALUES(create_name),
create_man_code = VALUES(create_man_code),
create_date = VALUES(create_date),
modifier = VALUES(modifier),
modifier_code = VALUES(modifier_code),
modify_date = VALUES(modify_date),
gmt_create = VALUES(gmt_create),
gmt_modified = VALUES(gmt_modified),
sync_time = NOW()
</insert>
<!-- ============ 线路产品 ============ -->
<insert id="upsertLineProduct">
INSERT INTO srv_line_product (
id, line_code, line_name, product_type, line_type, bl_cargo, cargo_name,
product_storage, product_first, product_clearance,
product_storage_code, product_first_code, product_clearance_code,
bl_open, bl_section, disp_code, disp_name, fee_class,
gmt_create, gmt_modified, shipper_id, shipment_rule, weight, cargo_type,
product_category, volume_basis, weight_type, service_type, shipment_type,
tax_amount, tax_currency, battery_type, remark,
create_name, create_man_code, create_date, modifier, modifier_code, modify_date, sync_time
) VALUES
<foreach collection="list" item="it" separator=",">
(#{it.id}, #{it.lineCode}, #{it.lineName}, #{it.productType}, #{it.lineType}, #{it.blCargo}, #{it.cargoName},
#{it.productStorage}, #{it.productFirst}, #{it.productClearance},
#{it.productStorageCode}, #{it.productFirstCode}, #{it.productClearanceCode},
#{it.blOpen}, #{it.blSection}, #{it.dispCode}, #{it.dispName}, #{it.feeClass},
#{it.gmtCreate}, #{it.gmtModified}, #{it.shipperId}, #{it.shipmentRule}, #{it.weight}, #{it.cargoType},
#{it.productCategory}, #{it.volumeBasis}, #{it.weightType}, #{it.serviceType}, #{it.shipmentType},
#{it.taxAmount}, #{it.taxCurrency}, #{it.batteryType}, #{it.remark},
#{it.createName}, #{it.createManCode}, #{it.createDate}, #{it.modifier}, #{it.modifierCode}, #{it.modifyDate}, NOW())
</foreach>
ON DUPLICATE KEY UPDATE
line_code = VALUES(line_code),
line_name = VALUES(line_name),
product_type = VALUES(product_type),
line_type = VALUES(line_type),
bl_cargo = VALUES(bl_cargo),
cargo_name = VALUES(cargo_name),
product_storage = VALUES(product_storage),
product_first = VALUES(product_first),
product_clearance = VALUES(product_clearance),
product_storage_code = VALUES(product_storage_code),
product_first_code = VALUES(product_first_code),
product_clearance_code = VALUES(product_clearance_code),
bl_open = VALUES(bl_open),
bl_section = VALUES(bl_section),
disp_code = VALUES(disp_code),
disp_name = VALUES(disp_name),
fee_class = VALUES(fee_class),
gmt_create = VALUES(gmt_create),
gmt_modified = VALUES(gmt_modified),
shipper_id = VALUES(shipper_id),
shipment_rule = VALUES(shipment_rule),
weight = VALUES(weight),
cargo_type = VALUES(cargo_type),
product_category = VALUES(product_category),
volume_basis = VALUES(volume_basis),
weight_type = VALUES(weight_type),
service_type = VALUES(service_type),
shipment_type = VALUES(shipment_type),
tax_amount = VALUES(tax_amount),
tax_currency = VALUES(tax_currency),
battery_type = VALUES(battery_type),
remark = VALUES(remark),
create_name = VALUES(create_name),
create_man_code = VALUES(create_man_code),
create_date = VALUES(create_date),
modifier = VALUES(modifier),
modifier_code = VALUES(modifier_code),
modify_date = VALUES(modify_date),
sync_time = NOW()
</insert>
<!-- ============ 产品-渠道关系 ============ -->
<insert id="upsertProductChannel">
INSERT INTO srv_product_channel (
guid, product_id, channel_code, channel_name, priority, is_enabled,
line_code, line_name, country_code, start_weight, end_weight,
order_count, order_count_ratio, sync_time
) VALUES
<foreach collection="list" item="it" separator=",">
(#{it.guid}, #{it.productId}, #{it.channelCode}, #{it.channelName}, #{it.priority}, #{it.isEnabled},
#{it.lineCode}, #{it.lineName}, #{it.countryCode}, #{it.startWeight}, #{it.endWeight},
#{it.orderCount}, #{it.orderCountRatio}, NOW())
</foreach>
ON DUPLICATE KEY UPDATE
product_id = VALUES(product_id),
channel_code = VALUES(channel_code),
channel_name = VALUES(channel_name),
priority = VALUES(priority),
is_enabled = VALUES(is_enabled),
line_code = VALUES(line_code),
line_name = VALUES(line_name),
country_code = VALUES(country_code),
start_weight = VALUES(start_weight),
end_weight = VALUES(end_weight),
order_count = VALUES(order_count),
order_count_ratio = VALUES(order_count_ratio),
sync_time = NOW()
</insert>
</mapper>
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bms.masterdata.mapper.OracleChannelMasterMapper">
<select id="selectAllServiceChannel" resultType="java.util.HashMap" fetchSize="500">
SELECT ID, CHANNEL_CODE, CHANNEL_NAME, SERVICE_CODE, SERVICE_NAME,
CREATE_NAME, CREATE_MAN_CODE, CREATE_DATE, MODIFIER, MODIFIER_CODE, MODIFY_DATE,
BL_OPEN, BL_MULTIPLE, GMT_CREATE, GMT_MODIFIED, DATA_FROM, REMARKS,
CARGO_TYPE, PAY_TYPE, SHIPPER_NAME, SHIPPER_ID, QUERY_TYPE, TRAJECTORY_CODE,
FINAL_SERVICE_NAME, DES_PORT, WEIGHT_TYPE, DIM_DIVISOR, WEIGHT_RULE, SHIPMENT_TYPE
FROM WEISHI_USER.TAB_SERVICE_CHANNEL
</select>
<select id="selectAllLineProduct" resultType="java.util.HashMap" fetchSize="500">
SELECT ID, LINE_CODE, LINE_NAME, PRODUCT_TYPE, LINE_TYPE, BL_CARGO, CARGO_NAME,
PRODUCT_STORAGE, PRODUCT_FIRST, PRODUCT_CLEARANCE, REMARK,
CREATE_NAME, CREATE_MAN_CODE, CREATE_DATE, MODIFIER, MODIFIER_CODE, MODIFY_DATE,
BL_OPEN, PRODUCT_STORAGE_CODE, PRODUCT_FIRST_CODE, PRODUCT_CLEARANCE_CODE,
BL_SECTION, DISP_CODE, DISP_NAME, FEE_CLASS, GMT_CREATE, GMT_MODIFIED,
SHIPPER_ID, SHIPMENT_RULE, WEIGHT, CARGO_TYPE, PRODUCT_CATEGORY, VOLUME_BASIS,
WEIGHT_TYPE, SERVICE_TYPE, SHIPMENT_TYPE, TAX_AMOUNT, TAX_CURRENCY, BATTERY_TYPE
FROM WEISHI_USER.TAB_LINE_PRODUCT
</select>
<select id="selectAllProductChannel" resultType="java.util.HashMap" fetchSize="500">
SELECT GUID, PRODUCT_ID, CHANNEL_NAME, CHANNEL_CODE, PRIORITY, IS_ENABLED,
LINE_NAME, LINE_CODE, COUNTRY_CODE, START_WEIGHT, END_WEIGHT,
ORDER_COUNT, ORDER_COUNT_RATIO
FROM WEISHI_USER.TAB_PRODUCT_CHANNEL
</select>
</mapper>
@@ -0,0 +1,69 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bms.masterdata.mapper.ServiceChannelMapper">
<resultMap id="ServiceChannelResult" type="com.bms.masterdata.domain.ServiceChannel">
<result property="id" column="id"/>
<result property="channelCode" column="channel_code"/>
<result property="channelName" column="channel_name"/>
<result property="serviceCode" column="service_code"/>
<result property="serviceName" column="service_name"/>
<result property="blOpen" column="bl_open"/>
<result property="blMultiple" column="bl_multiple"/>
<result property="cargoType" column="cargo_type"/>
<result property="payType" column="pay_type"/>
<result property="shipperName" column="shipper_name"/>
<result property="shipperId" column="shipper_id"/>
<result property="queryType" column="query_type"/>
<result property="trajectoryCode" column="trajectory_code"/>
<result property="finalServiceName" column="final_service_name"/>
<result property="desPort" column="des_port"/>
<result property="weightType" column="weight_type"/>
<result property="dimDivisor" column="dim_divisor"/>
<result property="weightRule" column="weight_rule"/>
<result property="shipmentType" column="shipment_type"/>
<result property="dataFrom" column="data_from"/>
<result property="remarks" column="remarks"/>
<result property="createName" column="create_name"/>
<result property="createManCode" column="create_man_code"/>
<result property="createDate" column="create_date"/>
<result property="modifier" column="modifier"/>
<result property="modifierCode" column="modifier_code"/>
<result property="modifyDate" column="modify_date"/>
<result property="gmtCreate" column="gmt_create"/>
<result property="gmtModified" column="gmt_modified"/>
</resultMap>
<sql id="selectChannelVo">
select id, channel_code, channel_name, service_code, service_name, bl_open, bl_multiple,
cargo_type, pay_type, shipper_name, shipper_id, query_type, trajectory_code,
final_service_name, des_port, weight_type, dim_divisor, weight_rule, shipment_type,
data_from, remarks, create_name, create_man_code, create_date, modifier,
modifier_code, modify_date, gmt_create, gmt_modified, sync_time
from srv_service_channel
</sql>
<select id="selectServiceChannelList" parameterType="com.bms.masterdata.domain.ServiceChannel" resultMap="ServiceChannelResult">
<include refid="selectChannelVo"/>
<where>
<if test="channelCode != null and channelCode != ''">
AND channel_code like concat('%', #{channelCode}, '%')
</if>
<if test="channelName != null and channelName != ''">
AND channel_name like concat('%', #{channelName}, '%')
</if>
<if test="serviceCode != null and serviceCode != ''">
AND service_code = #{serviceCode}
</if>
<if test="serviceName != null and serviceName != ''">
AND service_name like concat('%', #{serviceName}, '%')
</if>
<if test="blOpen != null and blOpen != ''">
AND bl_open = #{blOpen}
</if>
</where>
order by service_code, channel_code
</select>
</mapper>