<?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="SXtszMdzhglStorequalificationMapper" >
    <!-- 通用查询映射结果 -->

    <select id="selectSXtszMdzhglStorequalificationList" parameterType="pd" resultType="pd">
        select * from s_xtsz_mdzhgl_storequalification where 1=1
        <if test="id !=null and id !='' ">
            and id = #{id}
        </if>
        <if test="storeId !=null and storeId !='' ">
            and storeId = #{storeId}
        </if>
        <if test="companyName !=null and companyName !='' ">
            and companyName = #{companyName}
        </if>
        <if test="legalRepresentative !=null and legalRepresentative !='' ">
            and legalRepresentative = #{legalRepresentative}
        </if>
        <if test="businessLicenseRegistrationNumber !=null and businessLicenseRegistrationNumber !='' ">
            and businessLicenseRegistrationNumber = #{businessLicenseRegistrationNumber}
        </if>
        <if test="businessLicenseAddress !=null and businessLicenseAddress !='' ">
            and businessLicenseAddress = #{businessLicenseAddress}
        </if>
        <if test="businessScope !=null and businessScope !='' ">
            and businessScope = #{businessScope}
        </if>
        <if test="businessLicenseValidityPeriod !=null and businessLicenseValidityPeriod !='' ">
            and businessLicenseValidityPeriod = #{businessLicenseValidityPeriod}
        </if>
        <if test="businessLicenseUrl !=null and businessLicenseUrl !='' ">
            and businessLicenseUrl = #{businessLicenseUrl}
        </if>
        <if test="internetPharmaceuticalInformationServiceCertificate !=null and internetPharmaceuticalInformationServiceCertificate !='' ">
            and internetPharmaceuticalInformationServiceCertificate = #{internetPharmaceuticalInformationServiceCertificate}
        </if>
        <if test="internetPharmaceuticalTransactionServiceCertificate !=null and internetPharmaceuticalTransactionServiceCertificate !='' ">
            and internetPharmaceuticalTransactionServiceCertificate = #{internetPharmaceuticalTransactionServiceCertificate}
        </if>
        <if test="pharmaceuticalOperationPermit !=null and pharmaceuticalOperationPermit !='' ">
            and pharmaceuticalOperationPermit = #{pharmaceuticalOperationPermit}
        </if>
        <if test="foodOperationPermit !=null and foodOperationPermit !='' ">
            and foodOperationPermit = #{foodOperationPermit}
        </if>
        <if test="medicalDeviceOperationPermit !=null and medicalDeviceOperationPermit !='' ">
            and medicalDeviceOperationPermit = #{medicalDeviceOperationPermit}
        </if>
        <if test="secondClassMedicalDeviceFilingCertificate !=null and secondClassMedicalDeviceFilingCertificate !='' ">
            and secondClassMedicalDeviceFilingCertificate = #{secondClassMedicalDeviceFilingCertificate}
        </if>
        <if test="pharmaceuticalQualityManagementStandardCertification !=null and pharmaceuticalQualityManagementStandardCertification !='' ">
            and pharmaceuticalQualityManagementStandardCertification = #{pharmaceuticalQualityManagementStandardCertification}
        </if>
        <if test="medicalDeviceNetworkSalesFilingCertificate !=null and medicalDeviceNetworkSalesFilingCertificate !='' ">
            and medicalDeviceNetworkSalesFilingCertificate = #{medicalDeviceNetworkSalesFilingCertificate}
        </if>
        <if test="pharmacistRegistrationCertificate !=null and pharmacistRegistrationCertificate !='' ">
            and pharmacistRegistrationCertificate = #{pharmacistRegistrationCertificate}
        </if>
        <if test="platformEntryAgreement !=null and platformEntryAgreement !='' ">
            and platformEntryAgreement = #{platformEntryAgreement}
        </if>
        <if test="id !=null and id !='' ">
            and id = #{id}
        </if>
    </select>


    <update id="updateSXtszMdzhglStorequalification" parameterType="pd" >
        update s_xtsz_mdzhgl_storequalification
        <trim prefix=" SET " suffix="" prefixOverrides="," suffixOverrides=",">
        <if test="storeId !=null and storeId !='' ">
            storeId = #{storeId},
        </if>
        <if test="companyName !=null and companyName !='' ">
            companyName = #{companyName},
        </if>
        <if test="legalRepresentative !=null and legalRepresentative !='' ">
            legalRepresentative = #{legalRepresentative},
        </if>
        <if test="businessLicenseRegistrationNumber !=null and businessLicenseRegistrationNumber !='' ">
            businessLicenseRegistrationNumber = #{businessLicenseRegistrationNumber},
        </if>
        <if test="businessLicenseAddress !=null and businessLicenseAddress !='' ">
            businessLicenseAddress = #{businessLicenseAddress},
        </if>
        <if test="businessScope !=null and businessScope !='' ">
            businessScope = #{businessScope},
        </if>
        <if test="businessLicenseValidityPeriod !=null and businessLicenseValidityPeriod !='' ">
            businessLicenseValidityPeriod = #{businessLicenseValidityPeriod},
        </if>
        <if test="businessLicenseUrl !=null and businessLicenseUrl !='' ">
            businessLicenseUrl = #{businessLicenseUrl},
        </if>
        <if test="internetPharmaceuticalInformationServiceCertificate !=null and internetPharmaceuticalInformationServiceCertificate !='' ">
            internetPharmaceuticalInformationServiceCertificate = #{internetPharmaceuticalInformationServiceCertificate},
        </if>
        <if test="internetPharmaceuticalTransactionServiceCertificate !=null and internetPharmaceuticalTransactionServiceCertificate !='' ">
            internetPharmaceuticalTransactionServiceCertificate = #{internetPharmaceuticalTransactionServiceCertificate},
        </if>
        <if test="pharmaceuticalOperationPermit !=null and pharmaceuticalOperationPermit !='' ">
            pharmaceuticalOperationPermit = #{pharmaceuticalOperationPermit},
        </if>
        <if test="foodOperationPermit !=null and foodOperationPermit !='' ">
            foodOperationPermit = #{foodOperationPermit},
        </if>
        <if test="medicalDeviceOperationPermit !=null and medicalDeviceOperationPermit !='' ">
            medicalDeviceOperationPermit = #{medicalDeviceOperationPermit},
        </if>
        <if test="secondClassMedicalDeviceFilingCertificate !=null and secondClassMedicalDeviceFilingCertificate !='' ">
            secondClassMedicalDeviceFilingCertificate = #{secondClassMedicalDeviceFilingCertificate},
        </if>
        <if test="pharmaceuticalQualityManagementStandardCertification !=null and pharmaceuticalQualityManagementStandardCertification !='' ">
            pharmaceuticalQualityManagementStandardCertification = #{pharmaceuticalQualityManagementStandardCertification},
        </if>
        <if test="medicalDeviceNetworkSalesFilingCertificate !=null and medicalDeviceNetworkSalesFilingCertificate !='' ">
            medicalDeviceNetworkSalesFilingCertificate = #{medicalDeviceNetworkSalesFilingCertificate},
        </if>
        <if test="pharmacistRegistrationCertificate !=null and pharmacistRegistrationCertificate !='' ">
            pharmacistRegistrationCertificate = #{pharmacistRegistrationCertificate},
        </if>
        <if test="platformEntryAgreement !=null and platformEntryAgreement !='' ">
            platformEntryAgreement = #{platformEntryAgreement},
        </if>
        </trim>
        <if test="up != null and up!=''">
            <if test="id != null and id!=''">
                where id=#{id}
            </if>
        </if>
    </update>

    <delete id="SXtszMdzhglStorequalificationRemove" parameterType="pd">
        <if test="ids != null">
            delete from s_xtsz_mdzhgl_storequalification where
            <if test="ids != null">
                id in(${ids})
            </if>
        </if>
    </delete>

    <insert id="addSXtszMdzhglStorequalification" parameterType="pd" >

        insert into s_xtsz_mdzhgl_storequalification
        <trim prefix="(" suffix=")" prefixOverrides="," suffixOverrides=",">

        <if test="storeId !=null and storeId !='' ">
            storeId,
        </if>
        <if test="companyName !=null and companyName !='' ">
            companyName,
        </if>
        <if test="legalRepresentative !=null and legalRepresentative !='' ">
            legalRepresentative,
        </if>
        <if test="businessLicenseRegistrationNumber !=null and businessLicenseRegistrationNumber !='' ">
            businessLicenseRegistrationNumber,
        </if>
        <if test="businessLicenseAddress !=null and businessLicenseAddress !='' ">
            businessLicenseAddress,
        </if>
        <if test="businessScope !=null and businessScope !='' ">
            businessScope,
        </if>
        <if test="businessLicenseValidityPeriod !=null and businessLicenseValidityPeriod !='' ">
            businessLicenseValidityPeriod,
        </if>
        <if test="businessLicenseUrl !=null and businessLicenseUrl !='' ">
            businessLicenseUrl,
        </if>
        <if test="internetPharmaceuticalInformationServiceCertificate !=null and internetPharmaceuticalInformationServiceCertificate !='' ">
            internetPharmaceuticalInformationServiceCertificate,
        </if>
        <if test="internetPharmaceuticalTransactionServiceCertificate !=null and internetPharmaceuticalTransactionServiceCertificate !='' ">
            internetPharmaceuticalTransactionServiceCertificate,
        </if>
        <if test="pharmaceuticalOperationPermit !=null and pharmaceuticalOperationPermit !='' ">
            pharmaceuticalOperationPermit,
        </if>
        <if test="foodOperationPermit !=null and foodOperationPermit !='' ">
            foodOperationPermit,
        </if>
        <if test="medicalDeviceOperationPermit !=null and medicalDeviceOperationPermit !='' ">
            medicalDeviceOperationPermit,
        </if>
        <if test="secondClassMedicalDeviceFilingCertificate !=null and secondClassMedicalDeviceFilingCertificate !='' ">
            secondClassMedicalDeviceFilingCertificate,
        </if>
        <if test="pharmaceuticalQualityManagementStandardCertification !=null and pharmaceuticalQualityManagementStandardCertification !='' ">
            pharmaceuticalQualityManagementStandardCertification,
        </if>
        <if test="medicalDeviceNetworkSalesFilingCertificate !=null and medicalDeviceNetworkSalesFilingCertificate !='' ">
            medicalDeviceNetworkSalesFilingCertificate,
        </if>
        <if test="pharmacistRegistrationCertificate !=null and pharmacistRegistrationCertificate !='' ">
            pharmacistRegistrationCertificate,
        </if>
        <if test="platformEntryAgreement !=null and platformEntryAgreement !='' ">
            platformEntryAgreement,
        </if>
        </trim>
        <trim prefix=" VALUES (" suffix=")" prefixOverrides="," suffixOverrides=",">
        <if test="storeId !=null and storeId !='' ">
             #{storeId},
        </if>
        <if test="companyName !=null and companyName !='' ">
             #{companyName},
        </if>
        <if test="legalRepresentative !=null and legalRepresentative !='' ">
             #{legalRepresentative},
        </if>
        <if test="businessLicenseRegistrationNumber !=null and businessLicenseRegistrationNumber !='' ">
             #{businessLicenseRegistrationNumber},
        </if>
        <if test="businessLicenseAddress !=null and businessLicenseAddress !='' ">
             #{businessLicenseAddress},
        </if>
        <if test="businessScope !=null and businessScope !='' ">
             #{businessScope},
        </if>
        <if test="businessLicenseValidityPeriod !=null and businessLicenseValidityPeriod !='' ">
             #{businessLicenseValidityPeriod},
        </if>
        <if test="businessLicenseUrl !=null and businessLicenseUrl !='' ">
             #{businessLicenseUrl},
        </if>
        <if test="internetPharmaceuticalInformationServiceCertificate !=null and internetPharmaceuticalInformationServiceCertificate !='' ">
             #{internetPharmaceuticalInformationServiceCertificate},
        </if>
        <if test="internetPharmaceuticalTransactionServiceCertificate !=null and internetPharmaceuticalTransactionServiceCertificate !='' ">
             #{internetPharmaceuticalTransactionServiceCertificate},
        </if>
        <if test="pharmaceuticalOperationPermit !=null and pharmaceuticalOperationPermit !='' ">
             #{pharmaceuticalOperationPermit},
        </if>
        <if test="foodOperationPermit !=null and foodOperationPermit !='' ">
             #{foodOperationPermit},
        </if>
        <if test="medicalDeviceOperationPermit !=null and medicalDeviceOperationPermit !='' ">
             #{medicalDeviceOperationPermit},
        </if>
        <if test="secondClassMedicalDeviceFilingCertificate !=null and secondClassMedicalDeviceFilingCertificate !='' ">
             #{secondClassMedicalDeviceFilingCertificate},
        </if>
        <if test="pharmaceuticalQualityManagementStandardCertification !=null and pharmaceuticalQualityManagementStandardCertification !='' ">
             #{pharmaceuticalQualityManagementStandardCertification},
        </if>
        <if test="medicalDeviceNetworkSalesFilingCertificate !=null and medicalDeviceNetworkSalesFilingCertificate !='' ">
             #{medicalDeviceNetworkSalesFilingCertificate},
        </if>
        <if test="pharmacistRegistrationCertificate !=null and pharmacistRegistrationCertificate !='' ">
             #{pharmacistRegistrationCertificate},
        </if>
        <if test="platformEntryAgreement !=null and platformEntryAgreement !='' ">
             #{platformEntryAgreement},
        </if>
        </trim>

    </insert>

</mapper>
