|
@@ -59,6 +59,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="medicalLicense" column="medical_license" />
|
|
<result property="medicalLicense" column="medical_license" />
|
|
|
<result property="medicalLicenseExpiryStart" column="medical_license_expiry_start" />
|
|
<result property="medicalLicenseExpiryStart" column="medical_license_expiry_start" />
|
|
|
<result property="medicalLicenseExpiryEnd" column="medical_license_expiry_end" />
|
|
<result property="medicalLicenseExpiryEnd" column="medical_license_expiry_end" />
|
|
|
|
|
+
|
|
|
|
|
+ <result property="settlementAgreement" column="settlement_agreement" />
|
|
|
|
|
+ <result property="settlementAgreementStart" column="settlement_agreement_start" />
|
|
|
|
|
+ <result property="settlementAgreementEnd" column="settlement_agreement_end" />
|
|
|
|
|
+ <result property="qualityAssuranceAgreement" column="quality_assurance_agreement" />
|
|
|
|
|
+ <result property="qualityAssuranceAgreementStart" column="quality_assurance_agreement_start" />
|
|
|
|
|
+ <result property="qualityAssuranceAgreementEnd" column="quality_assurance_agreement_end" />
|
|
|
|
|
+ <result property="otherSpecialQualification" column="other_special_qualification" />
|
|
|
|
|
+ <result property="otherSpecialQualificationStart" column="other_special_qualification_start" />
|
|
|
|
|
+ <result property="otherSpecialQualificationEnd" column="other_special_qualification_end" />
|
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
|
|
<sql id="selectFsStoreVo">
|
|
<sql id="selectFsStoreVo">
|
|
@@ -70,7 +80,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
drug_license_expiry_start,drug_license_expiry_end,medical_device1,medical_device1_expiry_start,medical_device1_expiry_end,
|
|
drug_license_expiry_start,drug_license_expiry_end,medical_device1,medical_device1_expiry_start,medical_device1_expiry_end,
|
|
|
medicalDevice2,medical_device2_expiry_start,medical_device2_expiry_end,medicalDevice3,medical_device3_expiry_start,
|
|
medicalDevice2,medical_device2_expiry_start,medical_device2_expiry_end,medicalDevice3,medical_device3_expiry_start,
|
|
|
medical_device3_expiry_end,food_license,food_license_expiry_start,food_license_expiry_end,medical_license,
|
|
medical_device3_expiry_end,food_license,food_license_expiry_start,food_license_expiry_end,medical_license,
|
|
|
- medical_license_expiry_start,medical_license_expiry_end
|
|
|
|
|
|
|
+ medical_license_expiry_start,medical_license_expiry_end,settlement_agreement,settlement_agreement_start,settlement_agreement_end,
|
|
|
|
|
+ quality_assurance_agreement,quality_assurance_agreement_start,quality_assurance_agreement_end,other_special_qualification,
|
|
|
|
|
+ other_special_qualification_start,other_special_qualification_end
|
|
|
from fs_store_scrm
|
|
from fs_store_scrm
|
|
|
</sql>
|
|
</sql>
|
|
|
|
|
|
|
@@ -148,6 +160,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="medicalLicense !=null">medical_license , </if>
|
|
<if test="medicalLicense !=null">medical_license , </if>
|
|
|
<if test="medicalLicenseExpiryStart !=null ">medical_license_expiry_start , </if>
|
|
<if test="medicalLicenseExpiryStart !=null ">medical_license_expiry_start , </if>
|
|
|
<if test="medicalLicenseExpiryEnd !=null ">medical_license_expiry_end , </if>
|
|
<if test="medicalLicenseExpiryEnd !=null ">medical_license_expiry_end , </if>
|
|
|
|
|
+ <if test="settlementAgreement !=null ">settlement_agreement , </if>
|
|
|
|
|
+ <if test="settlementAgreementStart !=null ">settlement_agreement_start , </if>
|
|
|
|
|
+ <if test="settlementAgreementEnd !=null ">settlement_agreement_end , </if>
|
|
|
|
|
+ <if test="qualityAssuranceAgreement !=null ">quality_assurance_agreement , </if>
|
|
|
|
|
+ <if test="qualityAssuranceAgreementStart !=null ">quality_assurance_agreement_start , </if>
|
|
|
|
|
+ <if test="qualityAssuranceAgreementEnd !=null ">quality_assurance_agreement_end , </if>
|
|
|
|
|
+ <if test="otherSpecialQualification !=null ">other_special_qualification , </if>
|
|
|
|
|
+ <if test="otherSpecialQualificationStart !=null ">other_special_qualification_start , </if>
|
|
|
|
|
+ <if test="otherSpecialQualificationEnd !=null ">other_special_qualification_end , </if>
|
|
|
</trim>
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="cityIds != null">#{cityIds},</if>
|
|
<if test="cityIds != null">#{cityIds},</if>
|
|
@@ -203,6 +224,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="medicalLicense !=null">#{medicalLicense}, </if>
|
|
<if test="medicalLicense !=null">#{medicalLicense}, </if>
|
|
|
<if test="medicalLicenseExpiryStart !=null ">#{medicalLicenseExpiryStart}, </if>
|
|
<if test="medicalLicenseExpiryStart !=null ">#{medicalLicenseExpiryStart}, </if>
|
|
|
<if test="medicalLicenseExpiryEnd !=null ">#{medicalLicenseExpiryEnd}, </if>
|
|
<if test="medicalLicenseExpiryEnd !=null ">#{medicalLicenseExpiryEnd}, </if>
|
|
|
|
|
+ <if test="isBusinessLicensePermanent !=null ">#{isBusinessLicensePermanent}, </if>
|
|
|
|
|
+ <if test="settlementAgreement !=null ">#{settlementAgreement} , </if>
|
|
|
|
|
+ <if test="settlementAgreementStart !=null ">#{settlementAgreementStart} , </if>
|
|
|
|
|
+ <if test="settlementAgreementEnd !=null ">#{settlementAgreementEnd} , </if>
|
|
|
|
|
+ <if test="qualityAssuranceAgreement !=null ">#{qualityAssuranceAgreement} , </if>
|
|
|
|
|
+ <if test="qualityAssuranceAgreementStart !=null ">#{qualityAssuranceAgreementStart} , </if>
|
|
|
|
|
+ <if test="qualityAssuranceAgreementEnd !=null ">#{qualityAssuranceAgreementEnd} , </if>
|
|
|
|
|
+ <if test="otherSpecialQualification !=null ">#{otherSpecialQualification} , </if>
|
|
|
|
|
+ <if test="otherSpecialQualificationStart !=null ">#{otherSpecialQualificationStart} , </if>
|
|
|
|
|
+ <if test="otherSpecialQualificationEnd !=null ">#{otherSpecialQualificationEnd} , </if>
|
|
|
</trim>
|
|
</trim>
|
|
|
</insert>
|
|
</insert>
|
|
|
|
|
|
|
@@ -262,6 +293,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="medicalLicense !=null and medicalLicense !=''"> medical_license = #{medicalLicense} ,</if>
|
|
<if test="medicalLicense !=null and medicalLicense !=''"> medical_license = #{medicalLicense} ,</if>
|
|
|
<if test="medicalLicenseExpiryStart !=null "> medical_license_expiry_start = #{medicalLicenseExpiryStart} ,</if>
|
|
<if test="medicalLicenseExpiryStart !=null "> medical_license_expiry_start = #{medicalLicenseExpiryStart} ,</if>
|
|
|
<if test="medicalLicenseExpiryEnd !=null "> medical_license_expiry_end = #{medicalLicenseExpiryEnd} ,</if>
|
|
<if test="medicalLicenseExpiryEnd !=null "> medical_license_expiry_end = #{medicalLicenseExpiryEnd} ,</if>
|
|
|
|
|
+ <if test="isBusinessLicensePermanent !=null ">is_business_license_permanent = #{isBusinessLicensePermanent}, </if>
|
|
|
|
|
+ <if test="settlementAgreement !=null ">settlement_agreement = #{settlementAgreement} , </if>
|
|
|
|
|
+ <if test="settlementAgreementStart !=null ">settlement_agreement_start = #{settlementAgreementStart} , </if>
|
|
|
|
|
+ <if test="settlementAgreementEnd !=null ">settlement_agreement_end = #{settlementAgreementEnd} , </if>
|
|
|
|
|
+ <if test="qualityAssuranceAgreement !=null ">quality_assurance_agreement = #{qualityAssuranceAgreement} , </if>
|
|
|
|
|
+ <if test="qualityAssuranceAgreementStart !=null ">quality_assurance_agreement_start = #{qualityAssuranceAgreementStart} , </if>
|
|
|
|
|
+ <if test="qualityAssuranceAgreementEnd !=null ">quality_assurance_agreement_end = #{qualityAssuranceAgreementEnd} , </if>
|
|
|
|
|
+ <if test="otherSpecialQualification !=null ">other_special_qualification = #{otherSpecialQualification} , </if>
|
|
|
|
|
+ <if test="otherSpecialQualificationStart !=null ">other_special_qualification_start = #{otherSpecialQualificationStart} , </if>
|
|
|
|
|
+ <if test="otherSpecialQualificationEnd !=null ">other_special_qualification_end = #{otherSpecialQualificationEnd} , </if>
|
|
|
</trim>
|
|
</trim>
|
|
|
where store_id = #{storeId}
|
|
where store_id = #{storeId}
|
|
|
</update>
|
|
</update>
|
|
@@ -317,4 +358,61 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
order by store_id desc
|
|
order by store_id desc
|
|
|
</where>
|
|
</where>
|
|
|
</select>
|
|
</select>
|
|
|
|
|
+
|
|
|
|
|
+ <select id="queryValidStoreAgreementExpiryTips" resultType="String">
|
|
|
|
|
+ SELECT
|
|
|
|
|
+ CONCAT(
|
|
|
|
|
+ store_name,
|
|
|
|
|
+ '的',
|
|
|
|
|
+ CASE
|
|
|
|
|
+ WHEN (settlement_agreement IS NOT NULL AND settlement_agreement_end BETWEEN NOW() AND DATE_ADD(NOW(), INTERVAL 15 DAY))
|
|
|
|
|
+ AND (quality_assurance_agreement IS NOT NULL AND quality_assurance_agreement_end BETWEEN NOW() AND DATE_ADD(NOW(), INTERVAL 15 DAY))
|
|
|
|
|
+ THEN '结算协议和质量保证协议即将在15天内过期'
|
|
|
|
|
+
|
|
|
|
|
+ WHEN (settlement_agreement IS NOT NULL AND settlement_agreement_end < NOW())
|
|
|
|
|
+ AND (quality_assurance_agreement IS NOT NULL AND quality_assurance_agreement_end < NOW())
|
|
|
|
|
+ THEN '结算协议和质量保证协议已过期'
|
|
|
|
|
+
|
|
|
|
|
+ WHEN settlement_agreement IS NOT NULL AND settlement_agreement_end BETWEEN NOW() AND DATE_ADD(NOW(), INTERVAL 15 DAY)
|
|
|
|
|
+ THEN '结算协议即将在15天内过期'
|
|
|
|
|
+
|
|
|
|
|
+ WHEN settlement_agreement IS NOT NULL AND settlement_agreement_end < NOW()
|
|
|
|
|
+ THEN '结算协议已过期'
|
|
|
|
|
+
|
|
|
|
|
+ WHEN quality_assurance_agreement IS NOT NULL AND quality_assurance_agreement_end BETWEEN NOW() AND DATE_ADD(NOW(), INTERVAL 15 DAY)
|
|
|
|
|
+ THEN '质量保证协议即将在15天内过期'
|
|
|
|
|
+
|
|
|
|
|
+ WHEN quality_assurance_agreement IS NOT NULL AND quality_assurance_agreement_end < NOW()
|
|
|
|
|
+ THEN '质量保证协议已过期'
|
|
|
|
|
+
|
|
|
|
|
+ WHEN (settlement_agreement IS NOT NULL AND settlement_agreement_end BETWEEN NOW() AND DATE_ADD(NOW(), INTERVAL 15 DAY))
|
|
|
|
|
+ AND (quality_assurance_agreement IS NOT NULL AND quality_assurance_agreement_end < NOW())
|
|
|
|
|
+ THEN '结算协议即将在15天内过期,质量保证协议已过期'
|
|
|
|
|
+
|
|
|
|
|
+ WHEN (settlement_agreement IS NOT NULL AND settlement_agreement_end < NOW())
|
|
|
|
|
+ AND (quality_assurance_agreement IS NOT NULL AND quality_assurance_agreement_end BETWEEN NOW() AND DATE_ADD(NOW(), INTERVAL 15 DAY))
|
|
|
|
|
+ THEN '结算协议已过期,质量保证协议即将在15天内过期'
|
|
|
|
|
+ END
|
|
|
|
|
+ ) AS agreement_status
|
|
|
|
|
+ FROM
|
|
|
|
|
+ fs_store_scrm
|
|
|
|
|
+ WHERE
|
|
|
|
|
+ STATUS = 1
|
|
|
|
|
+ AND (
|
|
|
|
|
+ (
|
|
|
|
|
+ settlement_agreement IS NOT NULL
|
|
|
|
|
+ AND (
|
|
|
|
|
+ settlement_agreement_end BETWEEN NOW() AND DATE_ADD(NOW(), INTERVAL 15 DAY)
|
|
|
|
|
+ OR settlement_agreement_end < NOW()
|
|
|
|
|
+ )
|
|
|
|
|
+ )
|
|
|
|
|
+ OR (
|
|
|
|
|
+ quality_assurance_agreement IS NOT NULL
|
|
|
|
|
+ AND (
|
|
|
|
|
+ quality_assurance_agreement_end BETWEEN NOW() AND DATE_ADD(NOW(), INTERVAL 15 DAY)
|
|
|
|
|
+ OR quality_assurance_agreement_end < NOW()
|
|
|
|
|
+ )
|
|
|
|
|
+ )
|
|
|
|
|
+ )
|
|
|
|
|
+ </select>
|
|
|
</mapper>
|
|
</mapper>
|