|
|
@@ -69,6 +69,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="isAudit" column="is_audit"/>
|
|
|
<result property="storeId" column="store_id"/>
|
|
|
<result property="instructionManual" column="instruction_manual"/>
|
|
|
+ <result property="business" column="business"/>
|
|
|
+ <result property="businessStart" column="business_start"/>
|
|
|
+ <result property="businessEnd" column="business_end"/>
|
|
|
+ <result property="license" column="license"/>
|
|
|
+ <result property="licenseStart" column="license_start"/>
|
|
|
+ <result property="licenseEnd" column="license_end"/>
|
|
|
+ <result property="certificate" column="certificate"/>
|
|
|
+ <result property="certificateStart" column="certificate_start"/>
|
|
|
+ <result property="certificateEnd" column="certificate_end"/>
|
|
|
+ <result property="voucher" column="voucher"/>
|
|
|
+ <result property="voucherStart" column="voucher_start"/>
|
|
|
+ <result property="voucherEnd" column="voucher_end"/>
|
|
|
+ <result property="gmpAuth" column="gmp_auth"/>
|
|
|
+ <result property="gmpAuthStart" column="gmp_auth_start"/>
|
|
|
+ <result property="gmpAuthEnd" column="gmp_auth_end"/>
|
|
|
+ <result property="businessLink" column="business_link"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectFsStoreProductVo">
|
|
|
@@ -79,7 +95,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
integral, product_type, prescribe_code, prescribe_spec, prescribe_factory, prescribe_name,
|
|
|
is_display,tui_cate_id,company_ids,is_drug,drug_image,drug_reg_cert_no,common_name,dosage_form,
|
|
|
unit_price,batch_number,mah,mah_address,manufacturer,manufacturer_address,indications,dosage,
|
|
|
- adverse_reactions,contraindications,precautions,is_audit,store_id,instruction_manual,review_audit,qualification_certificate,qualification_certificate_start,qualification_certificate_end
|
|
|
+ adverse_reactions,contraindications,precautions,is_audit,store_id,instruction_manual,review_audit,qualification_certificate,qualification_certificate_start,qualification_certificate_end,
|
|
|
+ business, business_start, business_end,
|
|
|
+ license, license_start, license_end,
|
|
|
+ certificate, certificate_start, certificate_end,
|
|
|
+ voucher, voucher_start, voucher_end,
|
|
|
+ gmp_auth, gmp_auth_start, gmp_auth_end,business_link
|
|
|
from fs_store_product_scrm
|
|
|
</sql>
|
|
|
|
|
|
@@ -261,6 +282,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="qualificationCertificate != null and qualificationCertificate != ''">qualification_certificate ,</if>
|
|
|
<if test="qualificationCertificateStart != null">qualification_certificate_start ,</if>
|
|
|
<if test="qualificationCertificateEnd != null">qualification_certificate_end ,</if>
|
|
|
+ <if test="business != null and business != ''">business ,</if>
|
|
|
+ <if test="businessStart != null">business_start ,</if>
|
|
|
+ <if test="businessEnd != null">business_end ,</if>
|
|
|
+ <if test="license != null and license != ''">license ,</if>
|
|
|
+ <if test="licenseStart != null">license_start ,</if>
|
|
|
+ <if test="licenseEnd != null">license_end ,</if>
|
|
|
+ <if test="certificate != null and certificate != ''">certificate ,</if>
|
|
|
+ <if test="certificateStart != null">certificate_start ,</if>
|
|
|
+ <if test="certificateEnd != null">certificate_end ,</if>
|
|
|
+ <if test="voucher != null and voucher != ''">voucher ,</if>
|
|
|
+ <if test="voucherStart != null">voucher_start ,</if>
|
|
|
+ <if test="voucherEnd != null">voucher_end ,</if>
|
|
|
+ <if test="gmpAuth != null and gmpAuth != ''">gmp_auth ,</if>
|
|
|
+ <if test="gmpAuthStart != null">gmp_auth_start ,</if>
|
|
|
+ <if test="gmpAuthEnd != null">gmp_auth_end ,</if>
|
|
|
+ <if test="businessLink != null">business_link ,</if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="image != null and image != ''">#{image},</if>
|
|
|
@@ -330,6 +367,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="qualificationCertificate != null and qualificationCertificate != ''">#{qualificationCertificate} ,</if>
|
|
|
<if test="qualificationCertificateStart != null">#{qualificationCertificateStart} ,</if>
|
|
|
<if test="qualificationCertificateEnd != null ">#{qualificationCertificateEnd} ,</if>
|
|
|
+ <if test="business != null and business != ''">#{business} ,</if>
|
|
|
+ <if test="businessStart != null">#{businessStart} ,</if>
|
|
|
+ <if test="businessEnd != null">#{businessEnd} ,</if>
|
|
|
+ <if test="license != null and license != ''">#{license} ,</if>
|
|
|
+ <if test="licenseStart != null">#{licenseStart} ,</if>
|
|
|
+ <if test="licenseEnd != null">#{licenseEnd} ,</if>
|
|
|
+ <if test="certificate != null and certificate != ''">#{certificate} ,</if>
|
|
|
+ <if test="certificateStart != null">#{certificateStart} ,</if>
|
|
|
+ <if test="certificateEnd != null">#{certificateEnd} ,</if>
|
|
|
+ <if test="voucher != null and voucher != ''">#{voucher} ,</if>
|
|
|
+ <if test="voucherStart != null">#{voucherStart} ,</if>
|
|
|
+ <if test="voucherEnd != null">#{voucherEnd} ,</if>
|
|
|
+ <if test="gmpAuth != null and gmpAuth != ''">#{gmpAuth} ,</if>
|
|
|
+ <if test="gmpAuthStart != null">#{gmpAuthStart} ,</if>
|
|
|
+ <if test="gmpAuthEnd != null">#{gmpAuthEnd} ,</if>
|
|
|
+ <if test="businessLink != null">#{businessLink} ,</if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
|
|
|
@@ -403,6 +456,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="qualificationCertificate != null and qualificationCertificate != ''">qualification_certificate = #{qualificationCertificate} ,</if>
|
|
|
<if test="qualificationCertificateStart != null ">qualification_certificate_start = #{qualificationCertificateStart} ,</if>
|
|
|
<if test="qualificationCertificateEnd != null ">qualification_certificate_end = #{qualificationCertificateEnd} ,</if>
|
|
|
+ <if test="business != null and business != ''">business = #{business} ,</if>
|
|
|
+ <if test="businessStart != null">business_start = #{businessStart} ,</if>
|
|
|
+ <if test="businessEnd != null">business_end = #{businessEnd} ,</if>
|
|
|
+ <if test="license != null and license != ''">license = #{license} ,</if>
|
|
|
+ <if test="licenseStart != null">license_start = #{licenseStart} ,</if>
|
|
|
+ <if test="licenseEnd != null">license_end = #{licenseEnd} ,</if>
|
|
|
+ <if test="certificate != null and certificate != ''">certificate = #{certificate} ,</if>
|
|
|
+ <if test="certificateStart != null">certificate_start = #{certificateStart} ,</if>
|
|
|
+ <if test="certificateEnd != null">certificate_end = #{certificateEnd} ,</if>
|
|
|
+ <if test="voucher != null and voucher != ''">voucher = #{voucher} ,</if>
|
|
|
+ <if test="voucherStart != null">voucher_start = #{voucherStart} ,</if>
|
|
|
+ <if test="voucherEnd != null">voucher_end = #{voucherEnd} ,</if>
|
|
|
+ <if test="gmpAuth != null and gmpAuth != ''">gmp_auth = #{gmpAuth} ,</if>
|
|
|
+ <if test="gmpAuthStart != null">gmp_auth_start = #{gmpAuthStart} ,</if>
|
|
|
+ <if test="gmpAuthEnd != null">gmp_auth_end = #{gmpAuthEnd} ,</if>
|
|
|
+ <if test="businessLink != null">business_link = #{businessLink} ,</if>
|
|
|
</trim>
|
|
|
where product_id = #{productId}
|
|
|
</update>
|
|
|
@@ -602,18 +671,87 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
<select id="getProductNoticeInfo" resultType="java.lang.String">
|
|
|
SELECT
|
|
|
- CONCAT(
|
|
|
- product_name,
|
|
|
- '商品的',
|
|
|
- CASE
|
|
|
- WHEN qualification_certificate_end < CURDATE() THEN '首营资质已过期'
|
|
|
- ELSE '首营资质即将15天内过期'
|
|
|
- END
|
|
|
- ) AS status_text
|
|
|
+ CONCAT(
|
|
|
+ product_name,
|
|
|
+ '商品的',
|
|
|
+ '生产企业营业执照',
|
|
|
+ CASE
|
|
|
+ WHEN business_end < CURDATE() THEN '已过期'
|
|
|
+ ELSE '即将15天内过期'
|
|
|
+ END
|
|
|
+ ) AS status_text
|
|
|
FROM fs_store_product_scrm
|
|
|
- WHERE qualification_certificate IS NOT NULL
|
|
|
- AND qualification_certificate_end IS NOT NULL
|
|
|
- AND qualification_certificate_end <= DATE_ADD(CURDATE(), INTERVAL 15 DAY);
|
|
|
+ WHERE business_end IS NOT NULL
|
|
|
+ AND business_end <= DATE_ADD(CURDATE(), INTERVAL 15 DAY)
|
|
|
+ <if test="storeId != null">AND store_id = #{storeId}</if>
|
|
|
+
|
|
|
+ UNION ALL
|
|
|
+
|
|
|
+ SELECT
|
|
|
+ CONCAT(
|
|
|
+ product_name,
|
|
|
+ '商品的',
|
|
|
+ '生产企业的生产许可证/备案凭证',
|
|
|
+ CASE
|
|
|
+ WHEN license_end < CURDATE() THEN '已过期'
|
|
|
+ ELSE '即将15天内过期'
|
|
|
+ END
|
|
|
+ ) AS status_text
|
|
|
+ FROM fs_store_product_scrm
|
|
|
+ WHERE license_end IS NOT NULL
|
|
|
+ AND license_end <= DATE_ADD(CURDATE(), INTERVAL 15 DAY)
|
|
|
+ <if test="storeId != null">AND store_id = #{storeId}</if>
|
|
|
+
|
|
|
+ UNION ALL
|
|
|
+
|
|
|
+ SELECT
|
|
|
+ CONCAT(
|
|
|
+ product_name,
|
|
|
+ '商品的',
|
|
|
+ '商品注册证/备案凭证',
|
|
|
+ CASE
|
|
|
+ WHEN certificate_end < CURDATE() THEN '已过期'
|
|
|
+ ELSE '即将15天内过期'
|
|
|
+ END
|
|
|
+ ) AS status_text
|
|
|
+ FROM fs_store_product_scrm
|
|
|
+ WHERE certificate_end IS NOT NULL
|
|
|
+ AND certificate_end <= DATE_ADD(CURDATE(), INTERVAL 15 DAY)
|
|
|
+ <if test="storeId != null">AND store_id = #{storeId}</if>
|
|
|
+
|
|
|
+ UNION ALL
|
|
|
+
|
|
|
+ SELECT
|
|
|
+ CONCAT(
|
|
|
+ product_name,
|
|
|
+ '商品的',
|
|
|
+ '备案证书有效期',
|
|
|
+ CASE
|
|
|
+ WHEN voucher_end < CURDATE() THEN '已过期'
|
|
|
+ ELSE '即将15天内过期'
|
|
|
+ END
|
|
|
+ ) AS status_text
|
|
|
+ FROM fs_store_product_scrm
|
|
|
+ WHERE voucher_end IS NOT NULL
|
|
|
+ AND voucher_end <= DATE_ADD(CURDATE(), INTERVAL 15 DAY)
|
|
|
+ <if test="storeId != null">AND store_id = #{storeId}</if>
|
|
|
+
|
|
|
+ UNION ALL
|
|
|
+
|
|
|
+ SELECT
|
|
|
+ CONCAT(
|
|
|
+ product_name,
|
|
|
+ '商品的',
|
|
|
+ 'GMP认证有效期',
|
|
|
+ CASE
|
|
|
+ WHEN gmp_auth_end < CURDATE() THEN '已过期'
|
|
|
+ ELSE '即将15天内过期'
|
|
|
+ END
|
|
|
+ ) AS status_text
|
|
|
+ FROM fs_store_product_scrm
|
|
|
+ WHERE gmp_auth_end IS NOT NULL
|
|
|
+ AND gmp_auth_end <= DATE_ADD(CURDATE(), INTERVAL 15 DAY)
|
|
|
+ <if test="storeId != null">AND store_id = #{storeId}</if>
|
|
|
</select>
|
|
|
|
|
|
</mapper>
|