603 lines
38 KiB
XML
603 lines
38 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.ruoyi.customer.supplierinfo.mapper.BmsSupplierMapper">
|
|
|
|
<resultMap type="BmsSupplier" id="BmsSupplierResult">
|
|
<result property="supplierId" column="supplier_id" />
|
|
<result property="supplierCode" column="supplier_code" />
|
|
<result property="supplierName" column="supplier_name" />
|
|
<result property="supplierCodeDw" column="supplier_code_dw" />
|
|
<result property="creditCode" column="credit_code" />
|
|
<result property="supplierType" column="supplier_type" />
|
|
<result property="isEnable" column="is_enable" />
|
|
<result property="purchaserUserId" column="purchaser_user_id" />
|
|
<result property="purchaserUser" column="purchaser_user" />
|
|
<result property="settlementUserId" column="settlement_user_id" />
|
|
<result property="settlementUser" column="settlement_user" />
|
|
<result property="serviceUserId" column="service_user_id" />
|
|
<result property="serviceUser" column="service_user" />
|
|
<result property="ed" column="ed" />
|
|
<result property="zq" column="zq" />
|
|
<result property="settlementType" column="settlement_type" />
|
|
<result property="tempEd" column="temp_ed" />
|
|
<result property="accountBalance" column="account_balance" />
|
|
<result property="foreignCurrencyBalance" column="foreign_currency_balance" />
|
|
<result property="creditEd" column="credit_ed" />
|
|
<result property="weightThreshold" column="weight_threshold" />
|
|
<result property="throwRatio" column="throw_ratio" />
|
|
<result property="cooperationStartDate" column="cooperation_start_date" />
|
|
<result property="cooperationStatus" column="cooperation_status" />
|
|
<result property="channelIds" column="channel_ids" />
|
|
<result property="remark" column="remark" />
|
|
<result property="createBy" column="create_by" />
|
|
<result property="createTime" column="create_time" />
|
|
<result property="updateBy" column="update_by" />
|
|
<result property="updateTime" column="update_time" />
|
|
<result property="delFlag" column="del_flag" />
|
|
</resultMap>
|
|
|
|
<sql id="selectBmsSupplierVo">
|
|
select supplier_id, supplier_code, supplier_name, supplier_code_dw, credit_code, supplier_type, is_enable, purchaser_user_id, purchaser_user, settlement_user_id, settlement_user, service_user_id, service_user, ed, zq, settlement_type, temp_ed, account_balance, foreign_currency_balance, credit_ed, weight_threshold, throw_ratio, cooperation_start_date, cooperation_status, channel_ids, remark, create_by, create_time, update_by, update_time, del_flag from bms_supplier
|
|
</sql>
|
|
|
|
<select id="selectBmsSupplierList" parameterType="BmsSupplier" resultMap="BmsSupplierResult">
|
|
<include refid="selectBmsSupplierVo"/>
|
|
<where>
|
|
<if test="supplierCode != null and supplierCode != ''"> and supplier_code = #{supplierCode}</if>
|
|
<if test="supplierName != null and supplierName != ''"> and supplier_name like concat('%', #{supplierName}, '%')</if>
|
|
<if test="supplierCodeDw != null and supplierCodeDw != ''"> and supplier_code_dw = #{supplierCodeDw}</if>
|
|
<if test="creditCode != null and creditCode != ''"> and credit_code = #{creditCode}</if>
|
|
<if test="supplierType != null and supplierType != ''"> and supplier_type = #{supplierType}</if>
|
|
<if test="isEnable != null and isEnable != ''"> and is_enable = #{isEnable}</if>
|
|
<if test="purchaserUserId != null and purchaserUserId != ''"> and purchaser_user_id = #{purchaserUserId}</if>
|
|
<if test="purchaserUser != null and purchaserUser != ''"> and purchaser_user = #{purchaserUser}</if>
|
|
<if test="settlementUserId != null and settlementUserId != ''"> and settlement_user_id = #{settlementUserId}</if>
|
|
<if test="settlementUser != null and settlementUser != ''"> and settlement_user = #{settlementUser}</if>
|
|
<if test="serviceUserId != null and serviceUserId != ''"> and service_user_id = #{serviceUserId}</if>
|
|
<if test="serviceUser != null and serviceUser != ''"> and service_user = #{serviceUser}</if>
|
|
<if test="cooperationStatus != null and cooperationStatus != ''"> and cooperation_status = #{cooperationStatus}</if>
|
|
</where>
|
|
</select>
|
|
|
|
<select id="selectBmsSupplierBySupplierId" parameterType="Long" resultMap="BmsSupplierResult">
|
|
<include refid="selectBmsSupplierVo"/>
|
|
where supplier_id = #{supplierId}
|
|
</select>
|
|
|
|
<insert id="insertBmsSupplier" parameterType="BmsSupplier" useGeneratedKeys="true" keyProperty="supplierId">
|
|
insert into bms_supplier
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="supplierCode != null and supplierCode != ''">supplier_code,</if>
|
|
<if test="supplierName != null and supplierName != ''">supplier_name,</if>
|
|
<if test="supplierCodeDw != null">supplier_code_dw,</if>
|
|
<if test="creditCode != null">credit_code,</if>
|
|
<if test="supplierType != null">supplier_type,</if>
|
|
<if test="isEnable != null">is_enable,</if>
|
|
<if test="purchaserUserId != null">purchaser_user_id,</if>
|
|
<if test="purchaserUser != null">purchaser_user,</if>
|
|
<if test="settlementUserId != null">settlement_user_id,</if>
|
|
<if test="settlementUser != null">settlement_user,</if>
|
|
<if test="serviceUserId != null">service_user_id,</if>
|
|
<if test="serviceUser != null">service_user,</if>
|
|
<if test="ed != null">ed,</if>
|
|
<if test="zq != null">zq,</if>
|
|
<if test="settlementType != null">settlement_type,</if>
|
|
<if test="tempEd != null">temp_ed,</if>
|
|
<if test="accountBalance != null">account_balance,</if>
|
|
<if test="foreignCurrencyBalance != null">foreign_currency_balance,</if>
|
|
<if test="creditEd != null">credit_ed,</if>
|
|
<if test="weightThreshold != null">weight_threshold,</if>
|
|
<if test="throwRatio != null">throw_ratio,</if>
|
|
<if test="cooperationStartDate != null">cooperation_start_date,</if>
|
|
<if test="cooperationStatus != null">cooperation_status,</if>
|
|
<if test="channelIds != null">channel_ids,</if>
|
|
<if test="remark != null">remark,</if>
|
|
<if test="createBy != null">create_by,</if>
|
|
<if test="createTime != null">create_time,</if>
|
|
<if test="delFlag != null">del_flag,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="supplierCode != null and supplierCode != ''">#{supplierCode},</if>
|
|
<if test="supplierName != null and supplierName != ''">#{supplierName},</if>
|
|
<if test="supplierCodeDw != null">#{supplierCodeDw},</if>
|
|
<if test="creditCode != null">#{creditCode},</if>
|
|
<if test="supplierType != null">#{supplierType},</if>
|
|
<if test="isEnable != null">#{isEnable},</if>
|
|
<if test="purchaserUserId != null">#{purchaserUserId},</if>
|
|
<if test="purchaserUser != null">#{purchaserUser},</if>
|
|
<if test="settlementUserId != null">#{settlementUserId},</if>
|
|
<if test="settlementUser != null">#{settlementUser},</if>
|
|
<if test="serviceUserId != null">#{serviceUserId},</if>
|
|
<if test="serviceUser != null">#{serviceUser},</if>
|
|
<if test="ed != null">#{ed},</if>
|
|
<if test="zq != null">#{zq},</if>
|
|
<if test="settlementType != null">#{settlementType},</if>
|
|
<if test="tempEd != null">#{tempEd},</if>
|
|
<if test="accountBalance != null">#{accountBalance},</if>
|
|
<if test="foreignCurrencyBalance != null">#{foreignCurrencyBalance},</if>
|
|
<if test="creditEd != null">#{creditEd},</if>
|
|
<if test="weightThreshold != null">#{weightThreshold},</if>
|
|
<if test="throwRatio != null">#{throwRatio},</if>
|
|
<if test="cooperationStartDate != null">#{cooperationStartDate},</if>
|
|
<if test="cooperationStatus != null">#{cooperationStatus},</if>
|
|
<if test="channelIds != null">#{channelIds},</if>
|
|
<if test="remark != null">#{remark},</if>
|
|
<if test="createBy != null">#{createBy},</if>
|
|
<if test="createTime != null">#{createTime},</if>
|
|
<if test="delFlag != null">#{delFlag},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateBmsSupplier" parameterType="BmsSupplier">
|
|
update bms_supplier
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="supplierCode != null and supplierCode != ''">supplier_code = #{supplierCode},</if>
|
|
<if test="supplierName != null and supplierName != ''">supplier_name = #{supplierName},</if>
|
|
<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="isEnable != null">is_enable = #{isEnable},</if>
|
|
purchaser_user_id = #{purchaserUserId},
|
|
purchaser_user = #{purchaserUser},
|
|
settlement_user_id = #{settlementUserId},
|
|
settlement_user = #{settlementUser},
|
|
service_user_id = #{serviceUserId},
|
|
service_user = #{serviceUser},
|
|
<if test="ed != null">ed = #{ed},</if>
|
|
<if test="zq != null">zq = #{zq},</if>
|
|
<if test="settlementType != null">settlement_type = #{settlementType},</if>
|
|
<if test="tempEd != null">temp_ed = #{tempEd},</if>
|
|
<if test="accountBalance != null">account_balance = #{accountBalance},</if>
|
|
<if test="foreignCurrencyBalance != null">foreign_currency_balance = #{foreignCurrencyBalance},</if>
|
|
<if test="creditEd != null">credit_ed = #{creditEd},</if>
|
|
<if test="weightThreshold != null">weight_threshold = #{weightThreshold},</if>
|
|
<if test="throwRatio != null">throw_ratio = #{throwRatio},</if>
|
|
<if test="cooperationStartDate != null">cooperation_start_date = #{cooperationStartDate},</if>
|
|
<if test="cooperationStatus != null">cooperation_status = #{cooperationStatus},</if>
|
|
<if test="channelIds != null">channel_ids = #{channelIds},</if>
|
|
<if test="remark != null">remark = #{remark},</if>
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
|
</trim>
|
|
where supplier_id = #{supplierId}
|
|
</update>
|
|
|
|
<delete id="deleteBmsSupplierBySupplierId" parameterType="Long">
|
|
delete from bms_supplier where supplier_id = #{supplierId}
|
|
</delete>
|
|
|
|
<delete id="deleteBmsSupplierBySupplierIds" parameterType="Long">
|
|
delete from bms_supplier where supplier_id in
|
|
<foreach item="supplierId" collection="array" open="(" separator="," close=")">
|
|
#{supplierId}
|
|
</foreach>
|
|
</delete>
|
|
|
|
<!-- ========== bms_supplier_attachment 子表 ========== -->
|
|
<resultMap type="com.ruoyi.customer.supplierinfo.domain.BmsSupplierAttachment" id="BmsSupplierAttachmentResult">
|
|
<result property="attachmentId" column="attachment_id" />
|
|
<result property="supplierId" column="supplier_id" />
|
|
<result property="fileName" column="file_name" />
|
|
<result property="filePath" column="file_path" />
|
|
<result property="fileSize" column="file_size" />
|
|
<result property="fileType" column="file_type" />
|
|
<result property="fileExtension" column="file_extension" />
|
|
<result property="attachmentType" column="attachment_type" />
|
|
<result property="isLogo" column="is_logo" />
|
|
<result property="sortOrder" column="sort_order" />
|
|
<result property="remark" column="remark" />
|
|
<result property="createBy" column="create_by" />
|
|
<result property="createTime" column="create_time" />
|
|
<result property="updateBy" column="update_by" />
|
|
<result property="updateTime" column="update_time" />
|
|
<result property="delFlag" column="del_flag" />
|
|
</resultMap>
|
|
|
|
<sql id="selectBmsSupplierAttachmentVo">
|
|
select attachment_id, supplier_id, file_name, file_path, file_size, file_type, file_extension, attachment_type, is_logo, sort_order, remark, create_by, create_time, update_by, update_time, del_flag from bms_supplier_attachment
|
|
</sql>
|
|
|
|
<select id="selectBmsSupplierAttachmentList" parameterType="com.ruoyi.customer.supplierinfo.domain.BmsSupplierAttachment" resultMap="BmsSupplierAttachmentResult">
|
|
<include refid="selectBmsSupplierAttachmentVo"/>
|
|
<where>
|
|
<if test="supplierId != null"> and supplier_id = #{supplierId}</if>
|
|
<if test="fileName != null and fileName != ''"> and file_name like concat('%', #{fileName}, '%')</if>
|
|
<if test="attachmentType != null and attachmentType != ''"> and attachment_type = #{attachmentType}</if>
|
|
<if test="isLogo != null and isLogo != ''"> and is_logo = #{isLogo}</if>
|
|
and del_flag = '0'
|
|
</where>
|
|
order by sort_order asc
|
|
</select>
|
|
|
|
<insert id="insertBmsSupplierAttachment" parameterType="com.ruoyi.customer.supplierinfo.domain.BmsSupplierAttachment" useGeneratedKeys="true" keyProperty="attachmentId">
|
|
insert into bms_supplier_attachment
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="supplierId != null">supplier_id,</if>
|
|
<if test="fileName != null">file_name,</if>
|
|
<if test="filePath != null">file_path,</if>
|
|
<if test="fileSize != null">file_size,</if>
|
|
<if test="fileType != null">file_type,</if>
|
|
<if test="fileExtension != null">file_extension,</if>
|
|
<if test="attachmentType != null">attachment_type,</if>
|
|
<if test="isLogo != null">is_logo,</if>
|
|
<if test="sortOrder != null">sort_order,</if>
|
|
<if test="remark != null">remark,</if>
|
|
<if test="createBy != null">create_by,</if>
|
|
<if test="createTime != null">create_time,</if>
|
|
<if test="delFlag != null">del_flag,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="supplierId != null">#{supplierId},</if>
|
|
<if test="fileName != null">#{fileName},</if>
|
|
<if test="filePath != null">#{filePath},</if>
|
|
<if test="fileSize != null">#{fileSize},</if>
|
|
<if test="fileType != null">#{fileType},</if>
|
|
<if test="fileExtension != null">#{fileExtension},</if>
|
|
<if test="attachmentType != null">#{attachmentType},</if>
|
|
<if test="isLogo != null">#{isLogo},</if>
|
|
<if test="sortOrder != null">#{sortOrder},</if>
|
|
<if test="remark != null">#{remark},</if>
|
|
<if test="createBy != null">#{createBy},</if>
|
|
<if test="createTime != null">#{createTime},</if>
|
|
<if test="delFlag != null">#{delFlag},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateBmsSupplierAttachment" parameterType="com.ruoyi.customer.supplierinfo.domain.BmsSupplierAttachment">
|
|
update bms_supplier_attachment
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="supplierId != null">supplier_id = #{supplierId},</if>
|
|
<if test="fileName != null">file_name = #{fileName},</if>
|
|
<if test="filePath != null">file_path = #{filePath},</if>
|
|
<if test="fileSize != null">file_size = #{fileSize},</if>
|
|
<if test="fileType != null">file_type = #{fileType},</if>
|
|
<if test="fileExtension != null">file_extension = #{fileExtension},</if>
|
|
<if test="attachmentType != null">attachment_type = #{attachmentType},</if>
|
|
<if test="isLogo != null">is_logo = #{isLogo},</if>
|
|
<if test="sortOrder != null">sort_order = #{sortOrder},</if>
|
|
<if test="remark != null">remark = #{remark},</if>
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
</trim>
|
|
where attachment_id = #{attachmentId}
|
|
</update>
|
|
|
|
<delete id="deleteBmsSupplierAttachmentBySupplierId" parameterType="Long">
|
|
update bms_supplier_attachment set del_flag = '2' where supplier_id = #{supplierId}
|
|
</delete>
|
|
|
|
<delete id="deleteBmsSupplierAttachmentByAttachmentId" parameterType="Long">
|
|
update bms_supplier_attachment set del_flag = '2' where attachment_id = #{attachmentId}
|
|
</delete>
|
|
|
|
<!-- ========== bms_supplier_company 子表 ========== -->
|
|
<resultMap type="com.ruoyi.customer.supplierinfo.domain.BmsSupplierCompany" id="BmsSupplierCompanyResult">
|
|
<result property="companyId" column="company_id" />
|
|
<result property="supplierId" column="supplier_id" />
|
|
<result property="companyNameFull" column="company_name_full" />
|
|
<result property="englishName" column="english_name" />
|
|
<result property="creditCode" column="credit_code" />
|
|
<result property="legalPerson" column="legal_person" />
|
|
<result property="legalPersonPhone" column="legal_person_phone" />
|
|
<result property="legalPersonIdCard" column="legal_person_id_card" />
|
|
<result property="registeredCapital" column="registered_capital" />
|
|
<result property="capitalCurrency" column="capital_currency" />
|
|
<result property="paidInCapital" column="paid_in_capital" />
|
|
<result property="establishDate" column="establish_date" />
|
|
<result property="businessTermStart" column="business_term_start" />
|
|
<result property="businessTermEnd" column="business_term_end" />
|
|
<result property="businessTermPermanent" column="business_term_permanent" />
|
|
<result property="registrationAuthority" column="registration_authority" />
|
|
<result property="registrationNumber" column="registration_number" />
|
|
<result property="operatingStatus" column="operating_status" />
|
|
<result property="businessScope" column="business_scope" />
|
|
<result property="shareholders" column="shareholders" />
|
|
<result property="employeeCount" column="employee_count" />
|
|
<result property="companyPhone" column="company_phone" />
|
|
<result property="companyFax" column="company_fax" />
|
|
<result property="companyWebsite" column="company_website" />
|
|
<result property="companyEmail" column="company_email" />
|
|
<result property="registeredProvince" column="registered_province" />
|
|
<result property="registeredCity" column="registered_city" />
|
|
<result property="registeredDistrict" column="registered_district" />
|
|
<result property="registeredAddressDetail" column="registered_address_detail" />
|
|
<result property="businessLicenseOssId" column="business_license_oss_id" />
|
|
<result property="attachmentIds" column="attachment_ids" />
|
|
<result property="remark" column="remark" />
|
|
<result property="createBy" column="create_by" />
|
|
<result property="createTime" column="create_time" />
|
|
<result property="updateBy" column="update_by" />
|
|
<result property="updateTime" column="update_time" />
|
|
<result property="delFlag" column="del_flag" />
|
|
</resultMap>
|
|
|
|
<sql id="selectBmsSupplierCompanyVo">
|
|
select company_id, supplier_id, company_name_full, english_name, credit_code, legal_person, legal_person_phone, legal_person_id_card, registered_capital, capital_currency, paid_in_capital, establish_date, business_term_start, business_term_end, business_term_permanent, registration_authority, registration_number, operating_status, business_scope, shareholders, employee_count, company_phone, company_fax, company_website, company_email, registered_province, registered_city, registered_district, registered_address_detail, business_license_oss_id, attachment_ids, remark, create_by, create_time, update_by, update_time, del_flag from bms_supplier_company
|
|
</sql>
|
|
|
|
<select id="selectBmsSupplierCompanyList" parameterType="com.ruoyi.customer.supplierinfo.domain.BmsSupplierCompany" resultMap="BmsSupplierCompanyResult">
|
|
<include refid="selectBmsSupplierCompanyVo"/>
|
|
<where>
|
|
<if test="supplierId != null"> and supplier_id = #{supplierId}</if>
|
|
<if test="companyNameFull != null and companyNameFull != ''"> and company_name_full like concat('%', #{companyNameFull}, '%')</if>
|
|
<if test="creditCode != null and creditCode != ''"> and credit_code = #{creditCode}</if>
|
|
<if test="legalPerson != null and legalPerson != ''"> and legal_person like concat('%', #{legalPerson}, '%')</if>
|
|
<if test="operatingStatus != null and operatingStatus != ''"> and operating_status = #{operatingStatus}</if>
|
|
and del_flag = '0'
|
|
</where>
|
|
order by company_id asc
|
|
</select>
|
|
|
|
<select id="selectBmsSupplierCompanyByCompanyId" parameterType="Long" resultMap="BmsSupplierCompanyResult">
|
|
<include refid="selectBmsSupplierCompanyVo"/>
|
|
where company_id = #{companyId} and del_flag = '0'
|
|
</select>
|
|
|
|
<insert id="insertBmsSupplierCompany" parameterType="com.ruoyi.customer.supplierinfo.domain.BmsSupplierCompany" useGeneratedKeys="true" keyProperty="companyId">
|
|
insert into bms_supplier_company
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="supplierId != null">supplier_id,</if>
|
|
<if test="companyNameFull != null">company_name_full,</if>
|
|
<if test="englishName != null">english_name,</if>
|
|
<if test="creditCode != null">credit_code,</if>
|
|
<if test="legalPerson != null">legal_person,</if>
|
|
<if test="legalPersonPhone != null">legal_person_phone,</if>
|
|
<if test="legalPersonIdCard != null">legal_person_id_card,</if>
|
|
<if test="registeredCapital != null">registered_capital,</if>
|
|
<if test="capitalCurrency != null">capital_currency,</if>
|
|
<if test="paidInCapital != null">paid_in_capital,</if>
|
|
<if test="establishDate != null">establish_date,</if>
|
|
<if test="businessTermStart != null">business_term_start,</if>
|
|
<if test="businessTermEnd != null">business_term_end,</if>
|
|
<if test="businessTermPermanent != null">business_term_permanent,</if>
|
|
<if test="registrationAuthority != null">registration_authority,</if>
|
|
<if test="registrationNumber != null">registration_number,</if>
|
|
<if test="operatingStatus != null">operating_status,</if>
|
|
<if test="businessScope != null">business_scope,</if>
|
|
<if test="shareholders != null">shareholders,</if>
|
|
<if test="employeeCount != null">employee_count,</if>
|
|
<if test="companyPhone != null">company_phone,</if>
|
|
<if test="companyFax != null">company_fax,</if>
|
|
<if test="companyWebsite != null">company_website,</if>
|
|
<if test="companyEmail != null">company_email,</if>
|
|
<if test="registeredProvince != null">registered_province,</if>
|
|
<if test="registeredCity != null">registered_city,</if>
|
|
<if test="registeredDistrict != null">registered_district,</if>
|
|
<if test="registeredAddressDetail != null">registered_address_detail,</if>
|
|
<if test="businessLicenseOssId != null">business_license_oss_id,</if>
|
|
<if test="attachmentIds != null">attachment_ids,</if>
|
|
<if test="remark != null">remark,</if>
|
|
<if test="createBy != null">create_by,</if>
|
|
<if test="createTime != null">create_time,</if>
|
|
<if test="delFlag != null">del_flag,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="supplierId != null">#{supplierId},</if>
|
|
<if test="companyNameFull != null">#{companyNameFull},</if>
|
|
<if test="englishName != null">#{englishName},</if>
|
|
<if test="creditCode != null">#{creditCode},</if>
|
|
<if test="legalPerson != null">#{legalPerson},</if>
|
|
<if test="legalPersonPhone != null">#{legalPersonPhone},</if>
|
|
<if test="legalPersonIdCard != null">#{legalPersonIdCard},</if>
|
|
<if test="registeredCapital != null">#{registeredCapital},</if>
|
|
<if test="capitalCurrency != null">#{capitalCurrency},</if>
|
|
<if test="paidInCapital != null">#{paidInCapital},</if>
|
|
<if test="establishDate != null">#{establishDate},</if>
|
|
<if test="businessTermStart != null">#{businessTermStart},</if>
|
|
<if test="businessTermEnd != null">#{businessTermEnd},</if>
|
|
<if test="businessTermPermanent != null">#{businessTermPermanent},</if>
|
|
<if test="registrationAuthority != null">#{registrationAuthority},</if>
|
|
<if test="registrationNumber != null">#{registrationNumber},</if>
|
|
<if test="operatingStatus != null">#{operatingStatus},</if>
|
|
<if test="businessScope != null">#{businessScope},</if>
|
|
<if test="shareholders != null">#{shareholders},</if>
|
|
<if test="employeeCount != null">#{employeeCount},</if>
|
|
<if test="companyPhone != null">#{companyPhone},</if>
|
|
<if test="companyFax != null">#{companyFax},</if>
|
|
<if test="companyWebsite != null">#{companyWebsite},</if>
|
|
<if test="companyEmail != null">#{companyEmail},</if>
|
|
<if test="registeredProvince != null">#{registeredProvince},</if>
|
|
<if test="registeredCity != null">#{registeredCity},</if>
|
|
<if test="registeredDistrict != null">#{registeredDistrict},</if>
|
|
<if test="registeredAddressDetail != null">#{registeredAddressDetail},</if>
|
|
<if test="businessLicenseOssId != null">#{businessLicenseOssId},</if>
|
|
<if test="attachmentIds != null">#{attachmentIds},</if>
|
|
<if test="remark != null">#{remark},</if>
|
|
<if test="createBy != null">#{createBy},</if>
|
|
<if test="createTime != null">#{createTime},</if>
|
|
<if test="delFlag != null">#{delFlag},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateBmsSupplierCompany" parameterType="com.ruoyi.customer.supplierinfo.domain.BmsSupplierCompany">
|
|
update bms_supplier_company
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="supplierId != null">supplier_id = #{supplierId},</if>
|
|
<if test="companyNameFull != null">company_name_full = #{companyNameFull},</if>
|
|
<if test="englishName != null">english_name = #{englishName},</if>
|
|
<if test="creditCode != null">credit_code = #{creditCode},</if>
|
|
<if test="legalPerson != null">legal_person = #{legalPerson},</if>
|
|
<if test="legalPersonPhone != null">legal_person_phone = #{legalPersonPhone},</if>
|
|
<if test="legalPersonIdCard != null">legal_person_id_card = #{legalPersonIdCard},</if>
|
|
<if test="registeredCapital != null">registered_capital = #{registeredCapital},</if>
|
|
<if test="capitalCurrency != null">capital_currency = #{capitalCurrency},</if>
|
|
<if test="paidInCapital != null">paid_in_capital = #{paidInCapital},</if>
|
|
<if test="establishDate != null">establish_date = #{establishDate},</if>
|
|
<if test="businessTermStart != null">business_term_start = #{businessTermStart},</if>
|
|
<if test="businessTermEnd != null">business_term_end = #{businessTermEnd},</if>
|
|
<if test="businessTermPermanent != null">business_term_permanent = #{businessTermPermanent},</if>
|
|
<if test="registrationAuthority != null">registration_authority = #{registrationAuthority},</if>
|
|
<if test="registrationNumber != null">registration_number = #{registrationNumber},</if>
|
|
<if test="operatingStatus != null">operating_status = #{operatingStatus},</if>
|
|
<if test="businessScope != null">business_scope = #{businessScope},</if>
|
|
<if test="shareholders != null">shareholders = #{shareholders},</if>
|
|
<if test="employeeCount != null">employee_count = #{employeeCount},</if>
|
|
<if test="companyPhone != null">company_phone = #{companyPhone},</if>
|
|
<if test="companyFax != null">company_fax = #{companyFax},</if>
|
|
<if test="companyWebsite != null">company_website = #{companyWebsite},</if>
|
|
<if test="companyEmail != null">company_email = #{companyEmail},</if>
|
|
<if test="registeredProvince != null">registered_province = #{registeredProvince},</if>
|
|
<if test="registeredCity != null">registered_city = #{registeredCity},</if>
|
|
<if test="registeredDistrict != null">registered_district = #{registeredDistrict},</if>
|
|
<if test="registeredAddressDetail != null">registered_address_detail = #{registeredAddressDetail},</if>
|
|
<if test="businessLicenseOssId != null">business_license_oss_id = #{businessLicenseOssId},</if>
|
|
<if test="attachmentIds != null">attachment_ids = #{attachmentIds},</if>
|
|
<if test="remark != null">remark = #{remark},</if>
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
</trim>
|
|
where company_id = #{companyId}
|
|
</update>
|
|
|
|
<delete id="deleteBmsSupplierCompanyBySupplierId" parameterType="Long">
|
|
update bms_supplier_company set del_flag = '2' where supplier_id = #{supplierId}
|
|
</delete>
|
|
|
|
<delete id="deleteBmsSupplierCompanyByCompanyId" parameterType="Long">
|
|
update bms_supplier_company set del_flag = '2' where company_id = #{companyId}
|
|
</delete>
|
|
|
|
<!-- ========== bms_supplier_contact 子表 ========== -->
|
|
<resultMap type="com.ruoyi.customer.supplierinfo.domain.BmsSupplierContact" id="BmsSupplierContactResult">
|
|
<result property="contactId" column="contact_id" />
|
|
<result property="supplierId" column="supplier_id" />
|
|
<result property="contactName" column="contact_name" />
|
|
<result property="position" column="position" />
|
|
<result property="department" column="department" />
|
|
<result property="phone" column="phone" />
|
|
<result property="landline" column="landline" />
|
|
<result property="email" column="email" />
|
|
<result property="wechat" column="wechat" />
|
|
<result property="qq" column="qq" />
|
|
<result property="country" column="country" />
|
|
<result property="province" column="province" />
|
|
<result property="city" column="city" />
|
|
<result property="district" column="district" />
|
|
<result property="contactAddress" column="contact_address" />
|
|
<result property="postalCode" column="postal_code" />
|
|
<result property="isDefault" column="is_default" />
|
|
<result property="contactType" column="contact_type" />
|
|
<result property="sortOrder" column="sort_order" />
|
|
<result property="remark" column="remark" />
|
|
<result property="createBy" column="create_by" />
|
|
<result property="createTime" column="create_time" />
|
|
<result property="updateBy" column="update_by" />
|
|
<result property="updateTime" column="update_time" />
|
|
<result property="delFlag" column="del_flag" />
|
|
</resultMap>
|
|
|
|
<sql id="selectBmsSupplierContactVo">
|
|
select contact_id, supplier_id, contact_name, position, department, phone, landline, email, wechat, qq, country, province, city, district, contact_address, postal_code, is_default, contact_type, sort_order, remark, create_by, create_time, update_by, update_time, del_flag from bms_supplier_contact
|
|
</sql>
|
|
|
|
<select id="selectBmsSupplierContactList" parameterType="com.ruoyi.customer.supplierinfo.domain.BmsSupplierContact" resultMap="BmsSupplierContactResult">
|
|
<include refid="selectBmsSupplierContactVo"/>
|
|
<where>
|
|
<if test="supplierId != null"> and supplier_id = #{supplierId}</if>
|
|
<if test="contactName != null and contactName != ''"> and contact_name like concat('%', #{contactName}, '%')</if>
|
|
<if test="phone != null and phone != ''"> and phone = #{phone}</if>
|
|
<if test="contactType != null and contactType != ''"> and contact_type = #{contactType}</if>
|
|
<if test="isDefault != null and isDefault != ''"> and is_default = #{isDefault}</if>
|
|
and del_flag = '0'
|
|
</where>
|
|
order by sort_order asc
|
|
</select>
|
|
|
|
<select id="selectBmsSupplierContactByContactId" parameterType="Long" resultMap="BmsSupplierContactResult">
|
|
<include refid="selectBmsSupplierContactVo"/>
|
|
where contact_id = #{contactId} and del_flag = '0'
|
|
</select>
|
|
|
|
<insert id="insertBmsSupplierContact" parameterType="com.ruoyi.customer.supplierinfo.domain.BmsSupplierContact" useGeneratedKeys="true" keyProperty="contactId">
|
|
insert into bms_supplier_contact
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="supplierId != null">supplier_id,</if>
|
|
<if test="contactName != null">contact_name,</if>
|
|
<if test="position != null">position,</if>
|
|
<if test="department != null">department,</if>
|
|
<if test="phone != null">phone,</if>
|
|
<if test="landline != null">landline,</if>
|
|
<if test="email != null">email,</if>
|
|
<if test="wechat != null">wechat,</if>
|
|
<if test="qq != null">qq,</if>
|
|
<if test="country != null">country,</if>
|
|
<if test="province != null">province,</if>
|
|
<if test="city != null">city,</if>
|
|
<if test="district != null">district,</if>
|
|
<if test="contactAddress != null">contact_address,</if>
|
|
<if test="postalCode != null">postal_code,</if>
|
|
<if test="isDefault != null">is_default,</if>
|
|
<if test="contactType != null">contact_type,</if>
|
|
<if test="sortOrder != null">sort_order,</if>
|
|
<if test="remark != null">remark,</if>
|
|
<if test="createBy != null">create_by,</if>
|
|
<if test="createTime != null">create_time,</if>
|
|
<if test="delFlag != null">del_flag,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="supplierId != null">#{supplierId},</if>
|
|
<if test="contactName != null">#{contactName},</if>
|
|
<if test="position != null">#{position},</if>
|
|
<if test="department != null">#{department},</if>
|
|
<if test="phone != null">#{phone},</if>
|
|
<if test="landline != null">#{landline},</if>
|
|
<if test="email != null">#{email},</if>
|
|
<if test="wechat != null">#{wechat},</if>
|
|
<if test="qq != null">#{qq},</if>
|
|
<if test="country != null">#{country},</if>
|
|
<if test="province != null">#{province},</if>
|
|
<if test="city != null">#{city},</if>
|
|
<if test="district != null">#{district},</if>
|
|
<if test="contactAddress != null">#{contactAddress},</if>
|
|
<if test="postalCode != null">#{postalCode},</if>
|
|
<if test="isDefault != null">#{isDefault},</if>
|
|
<if test="contactType != null">#{contactType},</if>
|
|
<if test="sortOrder != null">#{sortOrder},</if>
|
|
<if test="remark != null">#{remark},</if>
|
|
<if test="createBy != null">#{createBy},</if>
|
|
<if test="createTime != null">#{createTime},</if>
|
|
<if test="delFlag != null">#{delFlag},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateBmsSupplierContact" parameterType="com.ruoyi.customer.supplierinfo.domain.BmsSupplierContact">
|
|
update bms_supplier_contact
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="supplierId != null">supplier_id = #{supplierId},</if>
|
|
<if test="contactName != null">contact_name = #{contactName},</if>
|
|
<if test="position != null">position = #{position},</if>
|
|
<if test="department != null">department = #{department},</if>
|
|
<if test="phone != null">phone = #{phone},</if>
|
|
<if test="landline != null">landline = #{landline},</if>
|
|
<if test="email != null">email = #{email},</if>
|
|
<if test="wechat != null">wechat = #{wechat},</if>
|
|
<if test="qq != null">qq = #{qq},</if>
|
|
<if test="country != null">country = #{country},</if>
|
|
<if test="province != null">province = #{province},</if>
|
|
<if test="city != null">city = #{city},</if>
|
|
<if test="district != null">district = #{district},</if>
|
|
<if test="contactAddress != null">contact_address = #{contactAddress},</if>
|
|
<if test="postalCode != null">postal_code = #{postalCode},</if>
|
|
<if test="isDefault != null">is_default = #{isDefault},</if>
|
|
<if test="contactType != null">contact_type = #{contactType},</if>
|
|
<if test="sortOrder != null">sort_order = #{sortOrder},</if>
|
|
<if test="remark != null">remark = #{remark},</if>
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
</trim>
|
|
where contact_id = #{contactId}
|
|
</update>
|
|
|
|
<delete id="deleteBmsSupplierContactBySupplierId" parameterType="Long">
|
|
update bms_supplier_contact set del_flag = '2' where supplier_id = #{supplierId}
|
|
</delete>
|
|
|
|
<delete id="deleteBmsSupplierContactByContactId" parameterType="Long">
|
|
update bms_supplier_contact set del_flag = '2' where contact_id = #{contactId}
|
|
</delete>
|
|
|
|
</mapper>
|