Browse Source

商品区分上架、下架、待审核、审核驳回等列表展示

Guos 2 weeks ago
parent
commit
20c40a0479

+ 1 - 1
fs-admin/src/main/java/com/fs/hisStore/controller/FsStoreProductScrmController.java

@@ -70,7 +70,7 @@ public class FsStoreProductScrmController extends BaseController {
 
     /**
      * 商品关键字检查
-     * 只要商品关键字在数据库中存在,就不允许添加商品。
+     * 只要商品成分的关键字在数据库中存在,就不允许添加商品。
      * @param keyWords
      * @return
      */

+ 151 - 151
fs-service/src/main/java/com/fs/hisStore/mapper/FsStoreProductScrmMapper.java

@@ -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);
 
 

+ 14 - 2
fs-service/src/main/java/com/fs/hisStore/service/IFsStoreProductScrmService.java

@@ -86,13 +86,22 @@ public interface IFsStoreProductScrmService
      */
     public int deleteFsStoreProductById(Long productId);
 
+    /**
+     * 查询商品列表
+     * @param fsStoreProduct
+     * @return
+     */
     List<FsStoreProductListVO> selectFsStoreProductListVO(FsStoreProductScrm fsStoreProduct);
 
     List<FsStoreProductListVO> selectFsStoreProductBarCodeListVO(FsStoreProductScrm fsStoreProduct);
 
     Map<String,Object> getFormatAttr(Long productId, String jsonStr,Long[] stores);
 
-
+    /**
+     * 添加或修改商品
+     * @param fsStoreProduct
+     * @return
+     */
     R addOrEdit(FsStoreProductAddEditParam fsStoreProduct);
 
     List<FsStoreProductListQueryVO> selectFsStoreProductTuiQuery(int count);
@@ -143,7 +152,10 @@ public interface IFsStoreProductScrmService
 
     List<FsStoreProductRuleScrm> selectFsStoreProductRuleList();
 
-
+    /**
+     * 批量审核商品
+     * @param auditDTO
+     */
     void batchAudit(ProductAuditDTO auditDTO);
 
     FsStoreProductScrm selectFsStoreProductByIdAudit(Long productId);

+ 6 - 0
fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreProductScrmServiceImpl.java

@@ -284,6 +284,12 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
         return fsStoreProductMapper.deleteFsStoreProductById(productId);
     }
 
+
+    /**
+     * 查询商品列表
+     * @param fsStoreProduct
+     * @return
+     */
     @Override
     public List<FsStoreProductListVO> selectFsStoreProductListVO(FsStoreProductScrm fsStoreProduct) {
         List<FsStoreProductListVO> fsStoreProductListVOS = fsStoreProductMapper.selectFsStoreProductListVO(fsStoreProduct);

+ 157 - 0
fs-service/src/main/resources/mapper/hisStore/FsStoreProductScrmMapper.xml

@@ -856,4 +856,161 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </if>
     </select>
 
+    <sql id="baseSql">
+       DISTINCT p.product_id, p.image,p.video, p.slider_image, p.product_name, p.product_info, p.keyword, p.bar_code,
+       p.cate_id, p.price, p.vip_price, p.ot_price, p.postage, p.unit_name, p.sort, p.sales, p.stock,
+       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,p.company_ids,p.is_drug,p.drug_image,p.drug_reg_cert_no,p.common_name,p.dosage_form,
+       p.unit_price,p.batch_number,p.mah,p.mah_address,p.manufacturer,p.manufacturer_address,p.indications,p.ingredient,p.dosage,
+       p.adverse_reactions,p.contraindications,p.precautions,p.is_audit,p.store_id,
+       p.is_business_permanent,p.is_license_permanent,p.is_certificate_permanent,p.is_gmp_auth_permanent
+    </sql>
+
+
+    <select id="selectFsStoreProductListVO" resultType="com.fs.hisStore.vo.FsStoreProductListVO">
+       SELECT
+            <include refid="baseSql"/>,
+                case
+                    when p.is_show = 1 and p.is_audit = 1 then 1
+                    when p.is_show = 0 and p.is_audit = 0 then 0
+                    when p.is_show = 1 and p.is_audit = 0 then 3
+                    when p.is_show = 0 and p.is_audit = 2 then 4
+                end AS is_show,
+                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
+            and p.is_del = 0
+            <if test="maps.isAudit == null and maps.isShow != null">
+                <if test="maps.isShow == 1">
+                    AND p.is_audit = 1
+                    AND p.is_show = 1
+                </if>
+                <if test="maps.isShow == 0">
+                    AND p.is_audit != 1
+                    AND p.is_show = #{maps.isShow}
+                </if>
+                <if test="maps.isShow == -1">
+                </if>
+                <if test="maps.isShow == 3">
+                    AND p.is_audit = 0
+                    AND p.is_show = 1
+                </if>
+                <if test="maps.isShow == 4">
+                    AND p.is_audit = 2
+                    AND p.is_show = 0
+                </if>
+            </if>
+            <if test="maps.isAudit != null">
+                AND p.is_audit = #{maps.isAudit}
+            </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>
+            <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.companyIds != null and maps.companyIds.trim() != ''">
+                AND p.company_ids REGEXP REPLACE(#{maps.companyIds}, ',', '|')
+            </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.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
+    </select>
+
 </mapper>