|
|
@@ -72,97 +72,252 @@ public interface FsStoreProductScrmMapper
|
|
|
* @return 结果
|
|
|
*/
|
|
|
public int deleteFsStoreProductByIds(Long[] productIds);
|
|
|
- @Select({"<script> " +
|
|
|
- "select p.*,pc.cate_name, fs_store.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 on fs_store.store_id = p.store_id " +
|
|
|
- "left join (select product_id, push_status from fs_store_hospital580_product_push_scrm h1 where h1.id = (select max(h2.id) from fs_store_hospital580_product_push_scrm h2 where h2.product_id = h1.product_id)) hs on hs.product_id = p.product_id " +
|
|
|
- "<if test = 'maps.commentContent != null and maps.commentContent !=\"\" '> " +
|
|
|
- " inner join fs_store_order_scrm_comment fsosc on FIND_IN_SET(p.product_id,fsosc.product_ids) and fsosc.is_del != 1" +
|
|
|
- "</if>" +
|
|
|
- "where 1=1 " +
|
|
|
- "<if test = 'maps.commentContent != null and maps.commentContent !=\"\" '> " +
|
|
|
- "and fsosc.comment_content like CONCAT('%',#{maps.commentContent},'%') " +
|
|
|
- "</if>" +
|
|
|
- "<if test = 'maps.productName != null and maps.productName !=\"\" '> " +
|
|
|
- "and p.product_name like CONCAT('%',#{maps.productName},'%') " +
|
|
|
- "</if>" +
|
|
|
- "<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>" +
|
|
|
- "<if test = 'maps.companyIds != null and maps.companyIds != \"\" '> " +
|
|
|
- "and find_in_set(#{maps.companyIds}, p.company_ids) " +
|
|
|
- "</if>"+
|
|
|
- "<if test = 'maps.storeId != null and maps.storeId != \"\" '> " +
|
|
|
- "and p.store_id = #{maps.storeId} " +
|
|
|
- "</if>"+
|
|
|
- "<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 != \"\"'>" +
|
|
|
- " AND drug_reg_cert_no LIKE CONCAT('%', #{maps.drugRegCertNo}, '%')" +
|
|
|
- "</if>" +
|
|
|
- "<if test='maps.commonName != null and maps.commonName != \"\"'>" +
|
|
|
- " AND common_name LIKE CONCAT('%', #{maps.commonName}, '%')" +
|
|
|
- "</if>" +
|
|
|
- "<if test='maps.dosageForm != null and maps.dosageForm != \"\"'>" +
|
|
|
- " AND dosage_form LIKE CONCAT('%', #{maps.dosageForm}, '%')" +
|
|
|
- "</if>" +
|
|
|
- "<if test='maps.unitPrice != null and maps.unitPrice != \"\"'>" +
|
|
|
- " AND unit_price = #{maps.unitPrice}" +
|
|
|
- "</if>" +
|
|
|
- "<if test='maps.batchNumber != null and maps.batchNumber != \"\"'>" +
|
|
|
- " AND batch_number LIKE CONCAT('%', #{maps.batchNumber}, '%')" +
|
|
|
- "</if>" +
|
|
|
- "<if test='maps.mah != null and maps.mah != \"\"'>" +
|
|
|
- " AND mah LIKE CONCAT('%', #{maps.mah}, '%')" +
|
|
|
- "</if>" +
|
|
|
- "<if test='maps.mahAddress != null and maps.mahAddress != \"\"'>" +
|
|
|
- " AND mah_address LIKE CONCAT('%', #{maps.mahAddress}, '%')" +
|
|
|
- "</if>" +
|
|
|
- "<if test='maps.manufacturer != null and maps.manufacturer != \"\"'>" +
|
|
|
- " AND manufacturer LIKE CONCAT('%', #{maps.manufacturer}, '%')" +
|
|
|
- "</if>" +
|
|
|
- "<if test='maps.manufacturerAddress != null and maps.manufacturerAddress != \"\"'>" +
|
|
|
- " AND manufacturer_address LIKE CONCAT('%', #{maps.manufacturerAddress}, '%')" +
|
|
|
- " </if>" +
|
|
|
- " <if test='maps.indications != null and maps.indications != \"\"'>" +
|
|
|
- " AND indications LIKE CONCAT('%', #{maps.indications}, '%')" +
|
|
|
- " </if>" +
|
|
|
- " <if test='maps.dosage != null and maps.dosage != \"\"'>" +
|
|
|
- " AND dosage LIKE CONCAT('%', #{maps.dosage}, '%')" +
|
|
|
- " </if>" +
|
|
|
- " <if test='maps.adverseReactions != null and maps.adverseReactions != \"\"'>" +
|
|
|
- " AND adverse_reactions LIKE CONCAT('%', #{maps.adverseReactions}, '%')" +
|
|
|
- " </if>" +
|
|
|
- " <if test='maps.contraindications != null and maps.contraindications != \"\"'>" +
|
|
|
- " AND contraindications LIKE CONCAT('%', #{maps.contraindications}, '%')" +
|
|
|
- " </if>" +
|
|
|
- " <if test='maps.precautions != null and maps.precautions != \"\"'>" +
|
|
|
- " AND precautions LIKE CONCAT('%', #{maps.precautions}, '%')" +
|
|
|
- " </if>"+
|
|
|
- " <if test='maps.prescribeSpec != null and maps.prescribeSpec != \"\"'>" +
|
|
|
- " AND p.prescribe_spec LIKE CONCAT('%', #{maps.prescribeSpec}, '%')" +
|
|
|
- " </if>"+
|
|
|
- " order by p.product_id desc "+
|
|
|
-
|
|
|
- "</script>"})
|
|
|
+// @Select({"<script> " +
|
|
|
+// "select DISTINCT p.*,pc.cate_name, fs_store.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 on fs_store.store_id = p.store_id " +
|
|
|
+// "left join (select product_id, push_status from fs_store_hospital580_product_push_scrm h1 where h1.id = (select max(h2.id) from fs_store_hospital580_product_push_scrm h2 where h2.product_id = h1.product_id)) hs on hs.product_id = p.product_id " +
|
|
|
+// "<if test = 'maps.commentContent != null and maps.commentContent !=\"\" '> " +
|
|
|
+// " inner join fs_store_order_scrm_comment fsosc on FIND_IN_SET(p.product_id,fsosc.product_ids) and fsosc.is_del != 1" +
|
|
|
+// "</if>" +
|
|
|
+// "<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 !=\"\" '> " +
|
|
|
+// " fs_user_complaint uc INNER JOIN FIND_IN_SET(p.product_id,uc.product_ids)" +
|
|
|
+// "and fsosc.product_ids is not null" +
|
|
|
+// "</if>" +
|
|
|
+// "where 1=1 " +
|
|
|
+// "<if test = 'maps.commentContent != null and maps.commentContent !=\"\" '> " +
|
|
|
+// "and fsosc.content like CONCAT('%',#{maps.commentContent},'%') " +
|
|
|
+// "</if>" +
|
|
|
+// "<if test = 'maps.complaint != null and maps.complaint !=\"\" '> " +
|
|
|
+// "and uc.content like CONCAT('%',#{maps.complaint},'%') " +
|
|
|
+// "</if>" +
|
|
|
+// "<if test = 'maps.productName != null and maps.productName !=\"\" '> " +
|
|
|
+// "and p.product_name like CONCAT('%',#{maps.productName},'%') " +
|
|
|
+// "</if>" +
|
|
|
+// "<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>" +
|
|
|
+// "<if test = 'maps.companyIds != null and maps.companyIds != \"\" '> " +
|
|
|
+// "and find_in_set(#{maps.companyIds}, p.company_ids) " +
|
|
|
+// "</if>"+
|
|
|
+// "<if test = 'maps.storeId != null and maps.storeId != \"\" '> " +
|
|
|
+// "and p.store_id = #{maps.storeId} " +
|
|
|
+// "</if>"+
|
|
|
+// "<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 != \"\"'>" +
|
|
|
+// " AND drug_reg_cert_no LIKE CONCAT('%', #{maps.drugRegCertNo}, '%')" +
|
|
|
+// "</if>" +
|
|
|
+// "<if test='maps.commonName != null and maps.commonName != \"\"'>" +
|
|
|
+// " AND common_name LIKE CONCAT('%', #{maps.commonName}, '%')" +
|
|
|
+// "</if>" +
|
|
|
+// "<if test='maps.dosageForm != null and maps.dosageForm != \"\"'>" +
|
|
|
+// " AND dosage_form LIKE CONCAT('%', #{maps.dosageForm}, '%')" +
|
|
|
+// "</if>" +
|
|
|
+// "<if test='maps.unitPrice != null and maps.unitPrice != \"\"'>" +
|
|
|
+// " AND unit_price = #{maps.unitPrice}" +
|
|
|
+// "</if>" +
|
|
|
+// "<if test='maps.batchNumber != null and maps.batchNumber != \"\"'>" +
|
|
|
+// " AND batch_number LIKE CONCAT('%', #{maps.batchNumber}, '%')" +
|
|
|
+// "</if>" +
|
|
|
+// "<if test='maps.mah != null and maps.mah != \"\"'>" +
|
|
|
+// " AND mah LIKE CONCAT('%', #{maps.mah}, '%')" +
|
|
|
+// "</if>" +
|
|
|
+// "<if test='maps.mahAddress != null and maps.mahAddress != \"\"'>" +
|
|
|
+// " AND mah_address LIKE CONCAT('%', #{maps.mahAddress}, '%')" +
|
|
|
+// "</if>" +
|
|
|
+// "<if test='maps.manufacturer != null and maps.manufacturer != \"\"'>" +
|
|
|
+// " AND manufacturer LIKE CONCAT('%', #{maps.manufacturer}, '%')" +
|
|
|
+// "</if>" +
|
|
|
+// "<if test='maps.manufacturerAddress != null and maps.manufacturerAddress != \"\"'>" +
|
|
|
+// " AND manufacturer_address LIKE CONCAT('%', #{maps.manufacturerAddress}, '%')" +
|
|
|
+// " </if>" +
|
|
|
+// " <if test='maps.indications != null and maps.indications != \"\"'>" +
|
|
|
+// " AND indications LIKE CONCAT('%', #{maps.indications}, '%')" +
|
|
|
+// " </if>" +
|
|
|
+// " <if test='maps.dosage != null and maps.dosage != \"\"'>" +
|
|
|
+// " AND dosage LIKE CONCAT('%', #{maps.dosage}, '%')" +
|
|
|
+// " </if>" +
|
|
|
+// " <if test='maps.adverseReactions != null and maps.adverseReactions != \"\"'>" +
|
|
|
+// " AND adverse_reactions LIKE CONCAT('%', #{maps.adverseReactions}, '%')" +
|
|
|
+// " </if>" +
|
|
|
+// " <if test='maps.contraindications != null and maps.contraindications != \"\"'>" +
|
|
|
+// " AND contraindications LIKE CONCAT('%', #{maps.contraindications}, '%')" +
|
|
|
+// " </if>" +
|
|
|
+// " <if test='maps.precautions != null and maps.precautions != \"\"'>" +
|
|
|
+// " AND precautions LIKE CONCAT('%', #{maps.precautions}, '%')" +
|
|
|
+// " </if>"+
|
|
|
+// " <if test='maps.prescribeSpec != null and maps.prescribeSpec != \"\"'>" +
|
|
|
+// " 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, fs_store.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 " +
|
|
|
+ "on fs_store.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.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.trim() != \"\"'> " +
|
|
|
+ "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);
|
|
|
|
|
|
|
|
|
@Select({"<script> " +
|
|
|
- " select p.*,pc.cate_name from (SELECT ave.bar_code as bar_code,p.product_id, p.image, p.slider_image,p.product_name, p.product_info,p.keyword, p.cate_id, p.price, p.vip_price, " +
|
|
|
+ " select p.*,pc.cate_name,hs.push_status from (SELECT ave.bar_code as bar_code,p.product_id, p.image, p.slider_image,p.product_name, p.product_info,p.keyword, p.cate_id, p.price, p.vip_price, " +
|
|
|
" p.ot_price,p.agent_price, p.postage,p.unit_name,p.sort,p.sales,p.stock,p.is_show,p.is_hot,p.is_benefit,p.is_best,p.is_new,p.description,p.create_time,p.update_time,p.is_postage,p.is_del,p.give_integral," +
|
|
|
- " p.cost,p.is_good,p.browse,p.code_path,p.temp_id,p.spec_type,p.is_integral,p.integral,p.product_type,p.prescribe_code, p.prescribe_spec,p.prescribe_factory,p.prescribe_name,p.is_display,p.tui_cate_id ,hs.push_status" +
|
|
|
+ " p.cost,p.is_good,p.browse,p.code_path,p.temp_id,p.spec_type,p.is_integral,p.integral,p.product_type,p.prescribe_code, p.prescribe_spec,p.prescribe_factory,p.prescribe_name,p.is_display,p.tui_cate_id" +
|
|
|
" FROM fs_store_product_scrm p LEFT JOIN fs_store_product_attr_value_scrm ave on p.product_id=ave.product_id WHERE ave.bar_code != '' and p.product_id is not null" +
|
|
|
") p left join fs_store_product_category_scrm pc on p.cate_id=pc.cate_id " +
|
|
|
"left join (select product_id, push_status from fs_store_hospital580_product_push_scrm h1 where h1.id = (select max(h2.id) from fs_store_hospital580_product_push_scrm h2 where h2.product_id = h1.product_id)) hs on hs.product_id = p.product_id " +
|