emis-service/emis-wms/src/main/resources/mapper/WmsCustomerMapper.xml

326 lines
26 KiB
XML
Raw Normal View History

2024-01-11 08:46:48 +00:00
<?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.xdadan.erp.wms.mapper.WmsCustomerMapper">
<resultMap type="WmsCustomer" id="WmsCustomerResult">
<result property="id" column="id" />
<result property="cusNo" column="cus_no" />
<result property="selfNo" column="self_no" />
<result property="name" column="name" />
<result property="nameEn" column="name_en" />
<result property="shortName" column="short_name" />
<result property="mnemonicCode" column="mnemonic_code" />
<result property="deptCode" column="dept_code" />
<result property="companyCode" column="company_code" />
<result property="usedEntCode" column="used_ent_code" />
<result property="usedEntName" column="used_ent_name" />
<result property="calcFeeType" column="calc_fee_type" />
<result property="entAttribute" column="ent_attribute" />
<result property="cusLevel" column="cus_level" />
<result property="industry" column="industry" />
<result property="contractNo" column="contract_no" />
<result property="firstContractDate" column="first_contract_date" />
<result property="cooperationEndDate" column="cooperation_end_date" />
<result property="applyDate" column="apply_date" />
<result property="calcWeightType" column="calc_weight_type" />
<result property="orgCode" column="org_code" />
<result property="province" column="province" />
<result property="city" column="city" />
<result property="district" column="district" />
<result property="address" column="address" />
<result property="zipCode" column="zip_code" />
<result property="contact" column="contact" />
<result property="phone" column="phone" />
<result property="mobile" column="mobile" />
<result property="tax" column="tax" />
<result property="email" column="email" />
<result property="webUrl" column="web_url" />
<result property="legalPersonName" column="legal_person_name" />
<result property="legalPersonIdno" column="legal_person_idno" />
<result property="registeredCapital" column="registered_capital" />
<result property="currency" column="currency" />
<result property="businessLicenseNo" column="business_license_no" />
<result property="taxNo" column="tax_no" />
<result property="organizationCode" column="organization_code" />
<result property="roadTransLicenseNo" column="road_trans_license_no" />
<result property="mainBusiness" column="main_business" />
<result property="cooperateIntention" column="cooperate_intention" />
<result property="approvingAuthority" column="approving_authority" />
<result property="approvalNo" column="approval_no" />
<result property="registrationDate" column="registration_date" />
<result property="contact1" column="contact1" />
<result property="phone1" column="phone1" />
<result property="status" column="status" />
<result property="remark" column="remark" />
<result property="tenantId" column="tenant_id" />
<result property="delFlag" column="del_flag" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectWmsCustomerVo">
select id, cus_no, self_no, name, name_en, short_name, mnemonic_code, dept_code, company_code, used_ent_code, used_ent_name, calc_fee_type, ent_attribute, cus_level, industry, contract_no, first_contract_date, cooperation_end_date, apply_date, calc_weight_type, org_code, province, city, district, address, zip_code, contact, phone, mobile, tax, email, web_url, legal_person_name, legal_person_idno, registered_capital, currency, business_license_no, tax_no, organization_code, road_trans_license_no, main_business, cooperate_intention, approving_authority, approval_no, registration_date, contact1, phone1, status, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time from wms_customer
</sql>
<select id="selectWmsCustomerList" parameterType="WmsCustomer" resultMap="WmsCustomerResult">
<include refid="selectWmsCustomerVo"/>
<where>
<if test="id != null "> and id = #{id}</if>
<if test="cusNo != null and cusNo != ''"> and cus_no like concat('%', #{cusNo}, '%')</if>
<if test="selfNo != null and selfNo != ''"> and self_no like concat('%', #{selfNo}, '%')</if>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="nameEn != null and nameEn != ''"> and name_en like concat('%', #{nameEn}, '%')</if>
<if test="shortName != null and shortName != ''"> and short_name like concat('%', #{shortName}, '%')</if>
<if test="mnemonicCode != null and mnemonicCode != ''"> and mnemonic_code like concat('%', #{mnemonicCode}, '%')</if>
<if test="deptCode != null and deptCode != ''"> and dept_code like concat('%', #{deptCode}, '%')</if>
<if test="companyCode != null and companyCode != ''"> and company_code like concat('%', #{companyCode}, '%')</if>
<if test="usedEntCode != null and usedEntCode != ''"> and used_ent_code like concat('%', #{usedEntCode}, '%')</if>
<if test="usedEntName != null and usedEntName != ''"> and used_ent_name like concat('%', #{usedEntName}, '%')</if>
<if test="calcFeeType != null and calcFeeType != ''"> and calc_fee_type like concat('%', #{calcFeeType}, '%')</if>
<if test="entAttribute != null and entAttribute != ''"> and ent_attribute like concat('%', #{entAttribute}, '%')</if>
<if test="cusLevel != null and cusLevel != ''"> and cus_level like concat('%', #{cusLevel}, '%')</if>
<if test="industry != null and industry != ''"> and industry like concat('%', #{industry}, '%')</if>
<if test="contractNo != null and contractNo != ''"> and contract_no like concat('%', #{contractNo}, '%')</if>
<if test="firstContractDate != null "> and first_contract_date = #{firstContractDate}</if>
<if test="cooperationEndDate != null "> and cooperation_end_date = #{cooperationEndDate}</if>
<if test="applyDate != null "> and apply_date = #{applyDate}</if>
<if test="calcWeightType != null and calcWeightType != ''"> and calc_weight_type like concat('%', #{calcWeightType}, '%')</if>
<if test="orgCode != null and orgCode != ''"> and org_code like concat('%', #{orgCode}, '%')</if>
<if test="province != null and province != ''"> and province like concat('%', #{province}, '%')</if>
<if test="city != null and city != ''"> and city like concat('%', #{city}, '%')</if>
<if test="district != null and district != ''"> and district like concat('%', #{district}, '%')</if>
<if test="address != null and address != ''"> and address like concat('%', #{address}, '%')</if>
<if test="zipCode != null and zipCode != ''"> and zip_code like concat('%', #{zipCode}, '%')</if>
<if test="contact != null and contact != ''"> and contact like concat('%', #{contact}, '%')</if>
<if test="phone != null and phone != ''"> and phone like concat('%', #{phone}, '%')</if>
<if test="mobile != null and mobile != ''"> and mobile like concat('%', #{mobile}, '%')</if>
<if test="tax != null and tax != ''"> and tax like concat('%', #{tax}, '%')</if>
<if test="email != null and email != ''"> and email like concat('%', #{email}, '%')</if>
<if test="webUrl != null and webUrl != ''"> and web_url like concat('%', #{webUrl}, '%')</if>
<if test="legalPersonName != null and legalPersonName != ''"> and legal_person_name like concat('%', #{legalPersonName}, '%')</if>
<if test="legalPersonIdno != null and legalPersonIdno != ''"> and legal_person_idno like concat('%', #{legalPersonIdno}, '%')</if>
<if test="registeredCapital != null and registeredCapital != ''"> and registered_capital like concat('%', #{registeredCapital}, '%')</if>
<if test="currency != null and currency != ''"> and currency like concat('%', #{currency}, '%')</if>
<if test="businessLicenseNo != null and businessLicenseNo != ''"> and business_license_no like concat('%', #{businessLicenseNo}, '%')</if>
<if test="taxNo != null and taxNo != ''"> and tax_no like concat('%', #{taxNo}, '%')</if>
<if test="organizationCode != null and organizationCode != ''"> and organization_code like concat('%', #{organizationCode}, '%')</if>
<if test="roadTransLicenseNo != null and roadTransLicenseNo != ''"> and road_trans_license_no like concat('%', #{roadTransLicenseNo}, '%')</if>
<if test="mainBusiness != null and mainBusiness != ''"> and main_business like concat('%', #{mainBusiness}, '%')</if>
<if test="cooperateIntention != null and cooperateIntention != ''"> and cooperate_intention like concat('%', #{cooperateIntention}, '%')</if>
<if test="approvingAuthority != null and approvingAuthority != ''"> and approving_authority like concat('%', #{approvingAuthority}, '%')</if>
<if test="approvalNo != null and approvalNo != ''"> and approval_no like concat('%', #{approvalNo}, '%')</if>
<if test="registrationDate != null "> and registration_date = #{registrationDate}</if>
<if test="contact1 != null and contact1 != ''"> and contact1 like concat('%', #{contact1}, '%')</if>
<if test="phone1 != null and phone1 != ''"> and phone1 like concat('%', #{phone1}, '%')</if>
<if test="status != null "> and status = #{status}</if>
<if test="remark != null and remark != ''"> and remark like concat('%', #{remark}, '%')</if>
<if test="tenantId != null and tenantId != ''"> and tenant_id like concat('%', #{tenantId}, '%')</if>
<if test="delFlag != null and delFlag != ''"> and del_flag like concat('%', #{delFlag}, '%')</if>
<if test="createBy != null and createBy != ''"> and create_by like concat('%', #{createBy}, '%')</if>
<if test="createTime != null "> and create_time = #{createTime}</if>
<if test="updateBy != null and updateBy != ''"> and update_by like concat('%', #{updateBy}, '%')</if>
<if test="updateTime != null "> and update_time = #{updateTime}</if>
</where>
order by create_time desc
</select>
<select id="selectWmsCustomerById" parameterType="Long" resultMap="WmsCustomerResult">
select id, cus_no, self_no, name, name_en, short_name, mnemonic_code, dept_code, company_code, used_ent_code, used_ent_name, calc_fee_type, ent_attribute, cus_level, industry, contract_no, first_contract_date, cooperation_end_date, apply_date, calc_weight_type, org_code, province, city, district, address, zip_code, contact, phone, mobile, tax, email, web_url, legal_person_name, legal_person_idno, registered_capital, currency, business_license_no, tax_no, organization_code, road_trans_license_no, main_business, cooperate_intention, approving_authority, approval_no, registration_date, contact1, phone1, status, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time
from wms_customer a
where a.id = #{id}
</select>
<insert id="insertWmsCustomer" parameterType="WmsCustomer">
insert into wms_customer
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="cusNo != null and cusNo != ''">cus_no,</if>
<if test="selfNo != null and selfNo != ''">self_no,</if>
<if test="name != null and name != ''">name,</if>
<if test="nameEn != null and nameEn != ''">name_en,</if>
<if test="shortName != null and shortName != ''">short_name,</if>
<if test="mnemonicCode != null and mnemonicCode != ''">mnemonic_code,</if>
<if test="deptCode != null and deptCode != ''">dept_code,</if>
<if test="companyCode != null and companyCode != ''">company_code,</if>
<if test="usedEntCode != null and usedEntCode != ''">used_ent_code,</if>
<if test="usedEntName != null and usedEntName != ''">used_ent_name,</if>
<if test="calcFeeType != null and calcFeeType != ''">calc_fee_type,</if>
<if test="entAttribute != null and entAttribute != ''">ent_attribute,</if>
<if test="cusLevel != null and cusLevel != ''">cus_level,</if>
<if test="industry != null and industry != ''">industry,</if>
<if test="contractNo != null and contractNo != ''">contract_no,</if>
<if test="firstContractDate != null">first_contract_date,</if>
<if test="cooperationEndDate != null">cooperation_end_date,</if>
<if test="applyDate != null">apply_date,</if>
<if test="calcWeightType != null and calcWeightType != ''">calc_weight_type,</if>
<if test="orgCode != null and orgCode != ''">org_code,</if>
<if test="province != null and province != ''">province,</if>
<if test="city != null and city != ''">city,</if>
<if test="district != null and district != ''">district,</if>
<if test="address != null and address != ''">address,</if>
<if test="zipCode != null and zipCode != ''">zip_code,</if>
<if test="contact != null and contact != ''">contact,</if>
<if test="phone != null and phone != ''">phone,</if>
<if test="mobile != null and mobile != ''">mobile,</if>
<if test="tax != null and tax != ''">tax,</if>
<if test="email != null and email != ''">email,</if>
<if test="webUrl != null and webUrl != ''">web_url,</if>
<if test="legalPersonName != null and legalPersonName != ''">legal_person_name,</if>
<if test="legalPersonIdno != null and legalPersonIdno != ''">legal_person_idno,</if>
<if test="registeredCapital != null and registeredCapital != ''">registered_capital,</if>
<if test="currency != null and currency != ''">currency,</if>
<if test="businessLicenseNo != null and businessLicenseNo != ''">business_license_no,</if>
<if test="taxNo != null and taxNo != ''">tax_no,</if>
<if test="organizationCode != null and organizationCode != ''">organization_code,</if>
<if test="roadTransLicenseNo != null and roadTransLicenseNo != ''">road_trans_license_no,</if>
<if test="mainBusiness != null and mainBusiness != ''">main_business,</if>
<if test="cooperateIntention != null and cooperateIntention != ''">cooperate_intention,</if>
<if test="approvingAuthority != null and approvingAuthority != ''">approving_authority,</if>
<if test="approvalNo != null and approvalNo != ''">approval_no,</if>
<if test="registrationDate != null">registration_date,</if>
<if test="contact1 != null and contact1 != ''">contact1,</if>
<if test="phone1 != null and phone1 != ''">phone1,</if>
<if test="status != null">status,</if>
<if test="remark != null and remark != ''">remark,</if>
<if test="tenantId != null and tenantId != ''">tenant_id,</if>
<if test="delFlag != null and delFlag != ''">del_flag,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null and updateBy != ''">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="cusNo != null and cusNo != ''">#{cusNo},</if>
<if test="selfNo != null and selfNo != ''">#{selfNo},</if>
<if test="name != null and name != ''">#{name},</if>
<if test="nameEn != null and nameEn != ''">#{nameEn},</if>
<if test="shortName != null and shortName != ''">#{shortName},</if>
<if test="mnemonicCode != null and mnemonicCode != ''">#{mnemonicCode},</if>
<if test="deptCode != null and deptCode != ''">#{deptCode},</if>
<if test="companyCode != null and companyCode != ''">#{companyCode},</if>
<if test="usedEntCode != null and usedEntCode != ''">#{usedEntCode},</if>
<if test="usedEntName != null and usedEntName != ''">#{usedEntName},</if>
<if test="calcFeeType != null and calcFeeType != ''">#{calcFeeType},</if>
<if test="entAttribute != null and entAttribute != ''">#{entAttribute},</if>
<if test="cusLevel != null and cusLevel != ''">#{cusLevel},</if>
<if test="industry != null and industry != ''">#{industry},</if>
<if test="contractNo != null and contractNo != ''">#{contractNo},</if>
<if test="firstContractDate != null">#{firstContractDate},</if>
<if test="cooperationEndDate != null">#{cooperationEndDate},</if>
<if test="applyDate != null">#{applyDate},</if>
<if test="calcWeightType != null and calcWeightType != ''">#{calcWeightType},</if>
<if test="orgCode != null and orgCode != ''">#{orgCode},</if>
<if test="province != null and province != ''">#{province},</if>
<if test="city != null and city != ''">#{city},</if>
<if test="district != null and district != ''">#{district},</if>
<if test="address != null and address != ''">#{address},</if>
<if test="zipCode != null and zipCode != ''">#{zipCode},</if>
<if test="contact != null and contact != ''">#{contact},</if>
<if test="phone != null and phone != ''">#{phone},</if>
<if test="mobile != null and mobile != ''">#{mobile},</if>
<if test="tax != null and tax != ''">#{tax},</if>
<if test="email != null and email != ''">#{email},</if>
<if test="webUrl != null and webUrl != ''">#{webUrl},</if>
<if test="legalPersonName != null and legalPersonName != ''">#{legalPersonName},</if>
<if test="legalPersonIdno != null and legalPersonIdno != ''">#{legalPersonIdno},</if>
<if test="registeredCapital != null and registeredCapital != ''">#{registeredCapital},</if>
<if test="currency != null and currency != ''">#{currency},</if>
<if test="businessLicenseNo != null and businessLicenseNo != ''">#{businessLicenseNo},</if>
<if test="taxNo != null and taxNo != ''">#{taxNo},</if>
<if test="organizationCode != null and organizationCode != ''">#{organizationCode},</if>
<if test="roadTransLicenseNo != null and roadTransLicenseNo != ''">#{roadTransLicenseNo},</if>
<if test="mainBusiness != null and mainBusiness != ''">#{mainBusiness},</if>
<if test="cooperateIntention != null and cooperateIntention != ''">#{cooperateIntention},</if>
<if test="approvingAuthority != null and approvingAuthority != ''">#{approvingAuthority},</if>
<if test="approvalNo != null and approvalNo != ''">#{approvalNo},</if>
<if test="registrationDate != null">#{registrationDate},</if>
<if test="contact1 != null and contact1 != ''">#{contact1},</if>
<if test="phone1 != null and phone1 != ''">#{phone1},</if>
<if test="status != null">#{status},</if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="tenantId != null and tenantId != ''">#{tenantId},</if>
<if test="delFlag != null and delFlag != ''">#{delFlag},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateWmsCustomer" parameterType="WmsCustomer">
update wms_customer
<trim prefix="SET" suffixOverrides=",">
<if test="cusNo != null and cusNo != ''">cus_no = #{cusNo},</if>
<if test="selfNo != null and selfNo != ''">self_no = #{selfNo},</if>
<if test="name != null and name != ''">name = #{name},</if>
<if test="nameEn != null and nameEn != ''">name_en = #{nameEn},</if>
<if test="shortName != null and shortName != ''">short_name = #{shortName},</if>
<if test="mnemonicCode != null and mnemonicCode != ''">mnemonic_code = #{mnemonicCode},</if>
<if test="deptCode != null and deptCode != ''">dept_code = #{deptCode},</if>
<if test="companyCode != null and companyCode != ''">company_code = #{companyCode},</if>
<if test="usedEntCode != null and usedEntCode != ''">used_ent_code = #{usedEntCode},</if>
<if test="usedEntName != null and usedEntName != ''">used_ent_name = #{usedEntName},</if>
<if test="calcFeeType != null and calcFeeType != ''">calc_fee_type = #{calcFeeType},</if>
<if test="entAttribute != null and entAttribute != ''">ent_attribute = #{entAttribute},</if>
<if test="cusLevel != null and cusLevel != ''">cus_level = #{cusLevel},</if>
<if test="industry != null and industry != ''">industry = #{industry},</if>
<if test="contractNo != null and contractNo != ''">contract_no = #{contractNo},</if>
<if test="firstContractDate != null">first_contract_date = #{firstContractDate},</if>
<if test="cooperationEndDate != null">cooperation_end_date = #{cooperationEndDate},</if>
<if test="applyDate != null">apply_date = #{applyDate},</if>
<if test="calcWeightType != null and calcWeightType != ''">calc_weight_type = #{calcWeightType},</if>
<if test="orgCode != null and orgCode != ''">org_code = #{orgCode},</if>
<if test="province != null and province != ''">province = #{province},</if>
<if test="city != null and city != ''">city = #{city},</if>
<if test="district != null and district != ''">district = #{district},</if>
<if test="address != null and address != ''">address = #{address},</if>
<if test="zipCode != null and zipCode != ''">zip_code = #{zipCode},</if>
<if test="contact != null and contact != ''">contact = #{contact},</if>
<if test="phone != null and phone != ''">phone = #{phone},</if>
<if test="mobile != null and mobile != ''">mobile = #{mobile},</if>
<if test="tax != null and tax != ''">tax = #{tax},</if>
<if test="email != null and email != ''">email = #{email},</if>
<if test="webUrl != null and webUrl != ''">web_url = #{webUrl},</if>
<if test="legalPersonName != null and legalPersonName != ''">legal_person_name = #{legalPersonName},</if>
<if test="legalPersonIdno != null and legalPersonIdno != ''">legal_person_idno = #{legalPersonIdno},</if>
<if test="registeredCapital != null and registeredCapital != ''">registered_capital = #{registeredCapital},</if>
<if test="currency != null and currency != ''">currency = #{currency},</if>
<if test="businessLicenseNo != null and businessLicenseNo != ''">business_license_no = #{businessLicenseNo},</if>
<if test="taxNo != null and taxNo != ''">tax_no = #{taxNo},</if>
<if test="organizationCode != null and organizationCode != ''">organization_code = #{organizationCode},</if>
<if test="roadTransLicenseNo != null and roadTransLicenseNo != ''">road_trans_license_no = #{roadTransLicenseNo},</if>
<if test="mainBusiness != null and mainBusiness != ''">main_business = #{mainBusiness},</if>
<if test="cooperateIntention != null and cooperateIntention != ''">cooperate_intention = #{cooperateIntention},</if>
<if test="approvingAuthority != null and approvingAuthority != ''">approving_authority = #{approvingAuthority},</if>
<if test="approvalNo != null and approvalNo != ''">approval_no = #{approvalNo},</if>
<if test="registrationDate != null">registration_date = #{registrationDate},</if>
<if test="contact1 != null and contact1 != ''">contact1 = #{contact1},</if>
<if test="phone1 != null and phone1 != ''">phone1 = #{phone1},</if>
<if test="status != null">status = #{status},</if>
<if test="remark != null and remark != ''">remark = #{remark},</if>
<if test="tenantId != null and tenantId != ''">tenant_id = #{tenantId},</if>
<if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteWmsCustomerById" parameterType="Long">
delete from wms_customer where id = #{id}
</delete>
<delete id="deleteWmsCustomerByIds" parameterType="String">
delete from wms_customer where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>