Browse Source

商家列表查询优化、增加协议详情查询

liude 5 months ago
parent
commit
772e1a9cb0
1 changed files with 11 additions and 2 deletions
  1. 11 2
      vehicle-server/src/main/resources/mapper/MerchantMapper.xml

+ 11 - 2
vehicle-server/src/main/resources/mapper/MerchantMapper.xml

@@ -60,7 +60,11 @@
             mt.region between #{param.code} and #{param.boundary} and mt.status = 'ONLINE'
             <if test="param.keyword != null and !param.keyword.isEmpty()">
                 and (mt.name like concat('%', #{param.keyword}, '%')
-                or mt.id in (select gds.merchant_id from goods gds where gds.name like concat('%', #{param.keyword}, '%')))
+                or mt.id in (select gds.merchant_id from goods gds where gds.name like concat('%', #{param.keyword}, '%')
+                or gds.description like concat('%', #{keyword}, '%')
+                )
+                or c.name like concat('%', #{keyword}, '%')
+                )
             </if>
             <if test="param.categoryId != null">
                 and  (mt.main_business = #{param.categoryId} or mt.ancillary_business like concat('%',#{param.categoryId} , '%'))
@@ -93,7 +97,12 @@
             mt.region between #{code} and #{boundary} and mt.status = 'ONLINE'
             <if test="keyword != null and !keyword.isEmpty()">
                 and (mt.name like concat('%', #{keyword}, '%')
-                or mt.id in (select gds.merchant_id from goods gds where gds.name like concat('%', #{keyword}, '%')))
+                or mt.id in (select gds.merchant_id from goods gds where gds.name like concat('%', #{keyword}, '%')
+                    or gds.description like concat('%', #{keyword}, '%')
+                )
+                or c.name like concat('%', #{keyword}, '%')
+                )
+
             </if>
             <if test="categoryId != null">
                 and  (mt.main_business = #{categoryId} or mt.ancillary_business like concat('%',#{categoryId} , '%'))