41 lines
1.9 KiB
XML
41 lines
1.9 KiB
XML
<?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="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="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}
|
|
, channel_ids = #{channelIds}
|
|
<if test="remark != null">, remark = #{remark}</if>
|
|
, update_by = #{updateBy}
|
|
, update_time = #{updateTime}
|
|
WHERE supplier_code = #{supplierCode} AND del_flag = '0'
|
|
</update>
|
|
</mapper>
|