|
|
@@ -172,157 +172,157 @@ public interface FsStoreProductScrmMapper
|
|
|
// " order by p.product_id desc "+
|
|
|
//
|
|
|
// "</script>"})
|
|
|
-@Select({"<script> " +
|
|
|
- "select " +
|
|
|
- "DISTINCT p.*,pc.cate_name, ss.store_name,hs.push_status " +
|
|
|
- "from fs_store_product_scrm p " +
|
|
|
- "left join fs_store_product_category_scrm pc " +
|
|
|
- "on p.cate_id = pc.cate_id " +
|
|
|
- "left JOIN fs_store_scrm ss " +
|
|
|
- "on ss.store_id = p.store_id " +
|
|
|
- "left join ( " +
|
|
|
- "select product_id, push_status " +
|
|
|
- "from ( " +
|
|
|
- "select " +
|
|
|
- "product_id, push_status, " +
|
|
|
- "ROW_NUMBER() over (partition by product_id order by id desc) as rn " +
|
|
|
- "from fs_store_hospital580_product_push_scrm " +
|
|
|
- ") t " +
|
|
|
- "where rn = 1 " +
|
|
|
- ") hs on hs.product_id = p.product_id " +
|
|
|
- // 评论表关联
|
|
|
- "left join fs_store_order_scrm_comment fsosc " +
|
|
|
- "on FIND_IN_SET(p.product_id, fsosc.product_ids) and fsosc.is_del != 1 " +
|
|
|
- // 订单表关联
|
|
|
- "<if test='maps.transactionStatus != null'> " +
|
|
|
- "inner join fs_store_order_item_scrm ois on p.product_id = ois.product_id " +
|
|
|
- "inner join fs_store_order_scrm sos on sos.id = ois.order_id " +
|
|
|
- "</if> " +
|
|
|
- // 投诉表关联
|
|
|
- "<if test='maps.complaint != null and maps.complaint.trim() != \"\"'> " +
|
|
|
- "inner join fs_user_complaint uc " +
|
|
|
- "on FIND_IN_SET(p.product_id, uc.product_ids) " +
|
|
|
- "</if> " +
|
|
|
- "where 1=1 " +
|
|
|
- //审核通过的才会展示到列表,防止主要商品列表中展示未审核商品
|
|
|
- "<if test='maps.isAudit == null'>"+
|
|
|
- "<if test='maps.isShow == 1'>" +
|
|
|
- "and p.is_audit = 1"+
|
|
|
- "</if>" +
|
|
|
- "<if test='maps.isShow == 0'>" +
|
|
|
- "and p.is_audit != 1"+
|
|
|
- "</if>" +
|
|
|
- "</if>" +
|
|
|
- // 评论内容条件
|
|
|
- "<if test='maps.commentContent != null and maps.commentContent.trim() != \"\"'> " +
|
|
|
- "and fsosc.content like CONCAT('%', #{maps.commentContent}, '%') " +
|
|
|
- "and fsosc.product_ids is not null " +
|
|
|
- "</if> " +
|
|
|
- // 投诉内容条件
|
|
|
- "<if test='maps.complaint != null and maps.complaint.trim() != \"\"'> " +
|
|
|
- "and uc.content like CONCAT('%', #{maps.complaint}, '%') " +
|
|
|
- "</if> " +
|
|
|
- // 商品名称模糊查询
|
|
|
- "<if test='maps.productName != null and maps.productName.trim() != \"\"'> " +
|
|
|
- "and p.product_name like CONCAT('%', #{maps.productName}, '%') " +
|
|
|
- "</if> " +
|
|
|
- // 分类ID条件(包含子分类)
|
|
|
- "<if test='maps.cateId != null'> " +
|
|
|
- "and (pc.cate_id = #{maps.cateId} or pc.pid = #{maps.cateId}) " +
|
|
|
- "</if> " +
|
|
|
- // 商品类型条件
|
|
|
- "<if test='maps.productType != null'> " +
|
|
|
- "and p.product_type = #{maps.productType} " +
|
|
|
- "</if> " +
|
|
|
- // 显示状态条件
|
|
|
- "<if test='maps.isShow != null'> " +
|
|
|
- "and p.is_show = #{maps.isShow} " +
|
|
|
- "</if> " +
|
|
|
- // 公司ID集合匹配
|
|
|
- "<if test='maps.companyIds != null and maps.companyIds.trim() != \"\"'> " +
|
|
|
- "and p.company_ids regexp replace(#{maps.companyIds}, ',', '|') " +
|
|
|
- "</if> " +
|
|
|
- // 单个店铺ID条件
|
|
|
- "<if test='maps.storeId != null and maps.storeId != \"\"'> " +
|
|
|
- "and p.store_id = #{maps.storeId} " +
|
|
|
- "</if> " +
|
|
|
- // 多个店铺ID条件
|
|
|
- "<if test='maps.storeIds != null'> " +
|
|
|
- "and p.store_id in " +
|
|
|
- "<foreach collection='maps.storeIds' item='item' index='index' open='(' separator=',' close=')'> " +
|
|
|
- "#{item} " +
|
|
|
- "</foreach> " +
|
|
|
- "</if> " +
|
|
|
- // 审核状态条件
|
|
|
- "<if test='maps.isAudit != null'> " +
|
|
|
- "and p.is_audit = #{maps.isAudit} " +
|
|
|
- "</if> " +
|
|
|
- // 药品注册证号
|
|
|
- "<if test='maps.drugRegCertNo != null and maps.drugRegCertNo.trim() != \"\"'> " +
|
|
|
- "and drug_reg_cert_no like CONCAT('%', #{maps.drugRegCertNo}, '%') " +
|
|
|
- "</if> " +
|
|
|
- // 通用名称
|
|
|
- "<if test='maps.commonName != null and maps.commonName.trim() != \"\"'> " +
|
|
|
- "and common_name like CONCAT('%', #{maps.commonName}, '%') " +
|
|
|
- "</if> " +
|
|
|
- // 剂型
|
|
|
- "<if test='maps.dosageForm != null and maps.dosageForm.trim() != \"\"'> " +
|
|
|
- "and dosage_form like CONCAT('%', #{maps.dosageForm}, '%') " +
|
|
|
- "</if> " +
|
|
|
- // 单价
|
|
|
- "<if test='maps.unitPrice != null and maps.unitPrice.trim() != \"\"'> " +
|
|
|
- "and unit_price = #{maps.unitPrice} " +
|
|
|
- "</if> " +
|
|
|
- // 批号
|
|
|
- "<if test='maps.batchNumber != null and maps.batchNumber.trim() != \"\"'> " +
|
|
|
- "and batch_number like CONCAT('%', #{maps.batchNumber}, '%') " +
|
|
|
- "</if> " +
|
|
|
- // 上市许可持有人
|
|
|
- "<if test='maps.mah != null and maps.mah.trim() != \"\"'> " +
|
|
|
- "and mah like CONCAT('%', #{maps.mah}, '%') " +
|
|
|
- "</if> " +
|
|
|
- // 持有人地址
|
|
|
- "<if test='maps.mahAddress != null and maps.mahAddress.trim() != \"\"'> " +
|
|
|
- "and mah_address like CONCAT('%', #{maps.mahAddress}, '%') " +
|
|
|
- "</if> " +
|
|
|
- // 生产企业
|
|
|
- "<if test='maps.manufacturer != null and maps.manufacturer.trim() != \"\"'> " +
|
|
|
- "and manufacturer like CONCAT('%', #{maps.manufacturer}, '%') " +
|
|
|
- "</if> " +
|
|
|
- // 生产地址
|
|
|
- "<if test='maps.manufacturerAddress != null and maps.manufacturerAddress.trim() != \"\"'> " +
|
|
|
- "and manufacturer_address like CONCAT('%', #{maps.manufacturerAddress}, '%') " +
|
|
|
- "</if> " +
|
|
|
- // 适应症
|
|
|
- "<if test='maps.indications != null and maps.indications.trim() != \"\"'> " +
|
|
|
- "and indications like CONCAT('%', #{maps.indications}, '%') " +
|
|
|
- "</if> " +
|
|
|
- // 用法用量
|
|
|
- "<if test='maps.dosage != null and maps.dosage.trim() != \"\"'> " +
|
|
|
- "and dosage like CONCAT('%', #{maps.dosage}, '%') " +
|
|
|
- "</if> " +
|
|
|
- // 不良反应
|
|
|
- "<if test='maps.adverseReactions != null and maps.adverseReactions.trim() != \"\"'> " +
|
|
|
- "and adverse_reactions like CONCAT('%', #{maps.adverseReactions}, '%') " +
|
|
|
- "</if> " +
|
|
|
- // 禁忌症
|
|
|
- "<if test='maps.contraindications != null and maps.contraindications.trim() != \"\"'> " +
|
|
|
- "and contraindications like CONCAT('%', #{maps.contraindications}, '%') " +
|
|
|
- "</if> " +
|
|
|
- // 注意事项
|
|
|
- "<if test='maps.precautions != null and maps.precautions.trim() != \"\"'> " +
|
|
|
- "and precautions like CONCAT('%', #{maps.precautions}, '%') " +
|
|
|
- "</if> " +
|
|
|
- // 处方规格
|
|
|
- "<if test='maps.prescribeSpec != null and maps.prescribeSpec.trim() != \"\"'> " +
|
|
|
- "and p.prescribe_spec like CONCAT('%', #{maps.prescribeSpec}, '%') " +
|
|
|
- "</if> " +
|
|
|
- // 交易状态条件
|
|
|
- "<if test='maps.transactionStatus != null'> " +
|
|
|
- "and sos.`status` = #{maps.transactionStatus} " +
|
|
|
- "</if> " +
|
|
|
- "order by p.product_id desc " +
|
|
|
- "</script>"})
|
|
|
+//@Select({"<script> " +
|
|
|
+// "select " +
|
|
|
+// "DISTINCT p.*,pc.cate_name, ss.store_name,hs.push_status " +
|
|
|
+// "from fs_store_product_scrm p " +
|
|
|
+// "left join fs_store_product_category_scrm pc " +
|
|
|
+// "on p.cate_id = pc.cate_id " +
|
|
|
+// "left JOIN fs_store_scrm ss " +
|
|
|
+// "on ss.store_id = p.store_id " +
|
|
|
+// "left join ( " +
|
|
|
+// "select product_id, push_status " +
|
|
|
+// "from ( " +
|
|
|
+// "select " +
|
|
|
+// "product_id, push_status, " +
|
|
|
+// "ROW_NUMBER() over (partition by product_id order by id desc) as rn " +
|
|
|
+// "from fs_store_hospital580_product_push_scrm " +
|
|
|
+// ") t " +
|
|
|
+// "where rn = 1 " +
|
|
|
+// ") hs on hs.product_id = p.product_id " +
|
|
|
+// // 评论表关联
|
|
|
+// "left join fs_store_order_scrm_comment fsosc " +
|
|
|
+// "on FIND_IN_SET(p.product_id, fsosc.product_ids) and fsosc.is_del != 1 " +
|
|
|
+// // 订单表关联
|
|
|
+// "<if test='maps.transactionStatus != null'> " +
|
|
|
+// "inner join fs_store_order_item_scrm ois on p.product_id = ois.product_id " +
|
|
|
+// "inner join fs_store_order_scrm sos on sos.id = ois.order_id " +
|
|
|
+// "</if> " +
|
|
|
+// // 投诉表关联
|
|
|
+// "<if test='maps.complaint != null and maps.complaint.trim() != \"\"'> " +
|
|
|
+// "inner join fs_user_complaint uc " +
|
|
|
+// "on FIND_IN_SET(p.product_id, uc.product_ids) " +
|
|
|
+// "</if> " +
|
|
|
+// "where 1=1 " +
|
|
|
+// //审核通过的才会展示到列表,防止主要商品列表中展示未审核商品
|
|
|
+// "<if test='maps.isAudit == null'>"+
|
|
|
+// "<if test='maps.isShow == 1'>" +
|
|
|
+// "and p.is_audit = 1"+
|
|
|
+// "</if>" +
|
|
|
+// "<if test='maps.isShow == 0'>" +
|
|
|
+// "and p.is_audit != 1"+
|
|
|
+// "</if>" +
|
|
|
+// "</if>" +
|
|
|
+// // 评论内容条件
|
|
|
+// "<if test='maps.commentContent != null and maps.commentContent.trim() != \"\"'> " +
|
|
|
+// "and fsosc.content like CONCAT('%', #{maps.commentContent}, '%') " +
|
|
|
+// "and fsosc.product_ids is not null " +
|
|
|
+// "</if> " +
|
|
|
+// // 投诉内容条件
|
|
|
+// "<if test='maps.complaint != null and maps.complaint.trim() != \"\"'> " +
|
|
|
+// "and uc.content like CONCAT('%', #{maps.complaint}, '%') " +
|
|
|
+// "</if> " +
|
|
|
+// // 商品名称模糊查询
|
|
|
+// "<if test='maps.productName != null and maps.productName.trim() != \"\"'> " +
|
|
|
+// "and p.product_name like CONCAT('%', #{maps.productName}, '%') " +
|
|
|
+// "</if> " +
|
|
|
+// // 分类ID条件(包含子分类)
|
|
|
+// "<if test='maps.cateId != null'> " +
|
|
|
+// "and (pc.cate_id = #{maps.cateId} or pc.pid = #{maps.cateId}) " +
|
|
|
+// "</if> " +
|
|
|
+// // 商品类型条件
|
|
|
+// "<if test='maps.productType != null'> " +
|
|
|
+// "and p.product_type = #{maps.productType} " +
|
|
|
+// "</if> " +
|
|
|
+// // 显示状态条件
|
|
|
+// "<if test='maps.isShow != null'> " +
|
|
|
+// "and p.is_show = #{maps.isShow} " +
|
|
|
+// "</if> " +
|
|
|
+// // 公司ID集合匹配
|
|
|
+// "<if test='maps.companyIds != null and maps.companyIds.trim() != \"\"'> " +
|
|
|
+// "and p.company_ids regexp replace(#{maps.companyIds}, ',', '|') " +
|
|
|
+// "</if> " +
|
|
|
+// // 单个店铺ID条件
|
|
|
+// "<if test='maps.storeId != null and maps.storeId != \"\"'> " +
|
|
|
+// "and p.store_id = #{maps.storeId} " +
|
|
|
+// "</if> " +
|
|
|
+// // 多个店铺ID条件
|
|
|
+// "<if test='maps.storeIds != null'> " +
|
|
|
+// "and p.store_id in " +
|
|
|
+// "<foreach collection='maps.storeIds' item='item' index='index' open='(' separator=',' close=')'> " +
|
|
|
+// "#{item} " +
|
|
|
+// "</foreach> " +
|
|
|
+// "</if> " +
|
|
|
+// // 审核状态条件
|
|
|
+// "<if test='maps.isAudit != null'> " +
|
|
|
+// "and p.is_audit = #{maps.isAudit} " +
|
|
|
+// "</if> " +
|
|
|
+// // 药品注册证号
|
|
|
+// "<if test='maps.drugRegCertNo != null and maps.drugRegCertNo.trim() != \"\"'> " +
|
|
|
+// "and drug_reg_cert_no like CONCAT('%', #{maps.drugRegCertNo}, '%') " +
|
|
|
+// "</if> " +
|
|
|
+// // 通用名称
|
|
|
+// "<if test='maps.commonName != null and maps.commonName.trim() != \"\"'> " +
|
|
|
+// "and common_name like CONCAT('%', #{maps.commonName}, '%') " +
|
|
|
+// "</if> " +
|
|
|
+// // 剂型
|
|
|
+// "<if test='maps.dosageForm != null and maps.dosageForm.trim() != \"\"'> " +
|
|
|
+// "and dosage_form like CONCAT('%', #{maps.dosageForm}, '%') " +
|
|
|
+// "</if> " +
|
|
|
+// // 单价
|
|
|
+// "<if test='maps.unitPrice != null and maps.unitPrice.trim() != \"\"'> " +
|
|
|
+// "and unit_price = #{maps.unitPrice} " +
|
|
|
+// "</if> " +
|
|
|
+// // 批号
|
|
|
+// "<if test='maps.batchNumber != null and maps.batchNumber.trim() != \"\"'> " +
|
|
|
+// "and batch_number like CONCAT('%', #{maps.batchNumber}, '%') " +
|
|
|
+// "</if> " +
|
|
|
+// // 上市许可持有人
|
|
|
+// "<if test='maps.mah != null and maps.mah.trim() != \"\"'> " +
|
|
|
+// "and mah like CONCAT('%', #{maps.mah}, '%') " +
|
|
|
+// "</if> " +
|
|
|
+// // 持有人地址
|
|
|
+// "<if test='maps.mahAddress != null and maps.mahAddress.trim() != \"\"'> " +
|
|
|
+// "and mah_address like CONCAT('%', #{maps.mahAddress}, '%') " +
|
|
|
+// "</if> " +
|
|
|
+// // 生产企业
|
|
|
+// "<if test='maps.manufacturer != null and maps.manufacturer.trim() != \"\"'> " +
|
|
|
+// "and manufacturer like CONCAT('%', #{maps.manufacturer}, '%') " +
|
|
|
+// "</if> " +
|
|
|
+// // 生产地址
|
|
|
+// "<if test='maps.manufacturerAddress != null and maps.manufacturerAddress.trim() != \"\"'> " +
|
|
|
+// "and manufacturer_address like CONCAT('%', #{maps.manufacturerAddress}, '%') " +
|
|
|
+// "</if> " +
|
|
|
+// // 适应症
|
|
|
+// "<if test='maps.indications != null and maps.indications.trim() != \"\"'> " +
|
|
|
+// "and indications like CONCAT('%', #{maps.indications}, '%') " +
|
|
|
+// "</if> " +
|
|
|
+// // 用法用量
|
|
|
+// "<if test='maps.dosage != null and maps.dosage.trim() != \"\"'> " +
|
|
|
+// "and dosage like CONCAT('%', #{maps.dosage}, '%') " +
|
|
|
+// "</if> " +
|
|
|
+// // 不良反应
|
|
|
+// "<if test='maps.adverseReactions != null and maps.adverseReactions.trim() != \"\"'> " +
|
|
|
+// "and adverse_reactions like CONCAT('%', #{maps.adverseReactions}, '%') " +
|
|
|
+// "</if> " +
|
|
|
+// // 禁忌症
|
|
|
+// "<if test='maps.contraindications != null and maps.contraindications.trim() != \"\"'> " +
|
|
|
+// "and contraindications like CONCAT('%', #{maps.contraindications}, '%') " +
|
|
|
+// "</if> " +
|
|
|
+// // 注意事项
|
|
|
+// "<if test='maps.precautions != null and maps.precautions.trim() != \"\"'> " +
|
|
|
+// "and precautions like CONCAT('%', #{maps.precautions}, '%') " +
|
|
|
+// "</if> " +
|
|
|
+// // 处方规格
|
|
|
+// "<if test='maps.prescribeSpec != null and maps.prescribeSpec.trim() != \"\"'> " +
|
|
|
+// "and p.prescribe_spec like CONCAT('%', #{maps.prescribeSpec}, '%') " +
|
|
|
+// "</if> " +
|
|
|
+// // 交易状态条件
|
|
|
+// "<if test='maps.transactionStatus != null'> " +
|
|
|
+// "and sos.`status` = #{maps.transactionStatus} " +
|
|
|
+// "</if> " +
|
|
|
+// "order by p.product_id desc " +
|
|
|
+// "</script>"})
|
|
|
List<FsStoreProductListVO> selectFsStoreProductListVO(@Param("maps") FsStoreProductScrm fsStoreProduct);
|
|
|
|
|
|
|