定时任务同步供应商数据
This commit is contained in:
@@ -11,6 +11,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="supplierCodeDw" column="supplier_code_dw" />
|
||||
<result property="creditCode" column="credit_code" />
|
||||
<result property="supplierType" column="supplier_type" />
|
||||
<result property="invoiceType" column="invoice_type" />
|
||||
<result property="kacheType" column="kache_type" />
|
||||
<result property="isEnable" column="is_enable" />
|
||||
<result property="purchaserUserId" column="purchaser_user_id" />
|
||||
<result property="purchaserUser" column="purchaser_user" />
|
||||
@@ -40,6 +42,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<sql id="selectBmsSupplierVo">
|
||||
select s.supplier_id, s.supplier_code, s.supplier_name, s.supplier_code_dw, s.credit_code, s.supplier_type,
|
||||
s.invoice_type, s.kache_type,
|
||||
s.is_enable, s.purchaser_user_id, s.purchaser_user, s.settlement_user_id, s.settlement_user,
|
||||
s.service_user_id, s.service_user, s.ed, s.zq, s.settlement_type, s.temp_ed, s.account_balance,
|
||||
s.foreign_currency_balance, s.credit_ed, s.weight_threshold, s.throw_ratio, s.cooperation_start_date,
|
||||
@@ -59,6 +62,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="supplierCodeDw != null and supplierCodeDw != ''"> and s.supplier_code_dw = #{supplierCodeDw}</if>
|
||||
<if test="creditCode != null and creditCode != ''"> and s.credit_code = #{creditCode}</if>
|
||||
<if test="supplierType != null and supplierType != ''"> and s.supplier_type = #{supplierType}</if>
|
||||
<if test="invoiceType != null and invoiceType != ''"> and s.invoice_type = #{invoiceType}</if>
|
||||
<if test="kacheType != null and kacheType != ''"> and s.kache_type = #{kacheType}</if>
|
||||
<if test="isEnable != null and isEnable != ''"> and s.is_enable = #{isEnable}</if>
|
||||
<if test="purchaserUserId != null and purchaserUserId != ''"> and s.purchaser_user_id = #{purchaserUserId}</if>
|
||||
<if test="purchaserUser != null and purchaserUser != ''"> and s.purchaser_user = #{purchaserUser}</if>
|
||||
@@ -86,6 +91,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="supplierCodeDw != null">supplier_code_dw,</if>
|
||||
<if test="creditCode != null">credit_code,</if>
|
||||
<if test="supplierType != null">supplier_type,</if>
|
||||
<if test="invoiceType != null">invoice_type,</if>
|
||||
<if test="kacheType != null">kache_type,</if>
|
||||
<if test="isEnable != null">is_enable,</if>
|
||||
<if test="purchaserUserId != null">purchaser_user_id,</if>
|
||||
<if test="purchaserUser != null">purchaser_user,</if>
|
||||
@@ -116,6 +123,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="supplierCodeDw != null">#{supplierCodeDw},</if>
|
||||
<if test="creditCode != null">#{creditCode},</if>
|
||||
<if test="supplierType != null">#{supplierType},</if>
|
||||
<if test="invoiceType != null">#{invoiceType},</if>
|
||||
<if test="kacheType != null">#{kacheType},</if>
|
||||
<if test="isEnable != null">#{isEnable},</if>
|
||||
<if test="purchaserUserId != null">#{purchaserUserId},</if>
|
||||
<if test="purchaserUser != null">#{purchaserUser},</if>
|
||||
@@ -150,6 +159,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="supplierCodeDw != null">supplier_code_dw = #{supplierCodeDw},</if>
|
||||
<if test="creditCode != null">credit_code = #{creditCode},</if>
|
||||
<if test="supplierType != null">supplier_type = #{supplierType},</if>
|
||||
<if test="invoiceType != null">invoice_type = #{invoiceType},</if>
|
||||
<if test="kacheType != null">kache_type = #{kacheType},</if>
|
||||
<if test="isEnable != null">is_enable = #{isEnable},</if>
|
||||
purchaser_user_id = #{purchaserUserId},
|
||||
purchaser_user = #{purchaserUser},
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
<?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.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
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,47 @@
|
||||
<?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.customer.supplierinfo.mapper.SupplierSyncMapper">
|
||||
|
||||
<select id="selectExistingCodes" resultType="java.lang.String">
|
||||
SELECT supplier_code FROM sup_supplier WHERE del_flag = '0'
|
||||
</select>
|
||||
|
||||
<insert id="insertSyncSupplier" parameterType="com.bms.customer.supplierinfo.domain.BmsSupplier">
|
||||
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="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="remark != null">, #{remark}</if>
|
||||
<if test="createTime != null">, #{createTime}</if>
|
||||
)
|
||||
</insert>
|
||||
|
||||
<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>
|
||||
<if test="remark != null">, remark = #{remark}</if>
|
||||
, update_by = #{updateBy}
|
||||
, update_time = #{updateTime}
|
||||
WHERE supplier_code = #{supplierCode} AND del_flag = '0'
|
||||
</update>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user