ソースを参照

商家列表修改

wwl 4 年 前
コミット
c647724fbf

+ 3 - 36
zzjs-admin/src/main/java/com/miaxis/app/controller/customer/AppletCustomerInfoController.java

@@ -31,32 +31,16 @@ public class AppletCustomerInfoController extends BaseController {
 
 
     /**
-     * 查询客户信息列表
-     */
-    @GetMapping("/list")
-    @ApiOperation("查询客户信息列表")
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "pageNum", value = "当前页码", dataType = "int", paramType = "query", required = false),
-            @ApiImplicitParam(name = "pageSize", value = "每页数据量", dataType = "int", paramType = "query", required = false),
-    })
-    public ResponsePageInfo<CustomerInfo> list(@ModelAttribute CustomerInfo customerInfo) {
-        startPage();
-        List<CustomerInfo> list = customerInfoService.selectCustomerInfoList(customerInfo);
-        return toResponsePageInfo(list);
-    }
-
-
-    /**
-     * 查询所属品类商家
+     * 查询商家列表
      */
     @GetMapping(value = "/getCustomerListByProductId/{id}")
-    @ApiOperation("查询所属品类商家")
+    @ApiOperation("查询商家列表")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "pageNum", value = "当前页码", dataType = "int", paramType = "query", required = false),
             @ApiImplicitParam(name = "pageSize", value = "每页数据量", dataType = "int", paramType = "query", required = false),
     })
     public ResponsePageInfo<ExhibitionCustomerInfoVo> getCustomerListByProductId(
-            @ApiParam(name = "id", value = "品类id", required = true)
+            @ApiParam(name = "id", value = "品类id (0:精选列表)", required = true)
             @PathVariable("id") Long id
     ) {
         startPage();
@@ -66,22 +50,5 @@ public class AppletCustomerInfoController extends BaseController {
         return toResponsePageInfo(list);
     }
 
-    /**
-     * 查询精选商家列表 根据收藏数排行
-     */
-    @GetMapping(value = "/getCustomerListByCollectionCount")
-    @ApiOperation("查询精选商家列表")
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "pageNum", value = "当前页码", dataType = "int", paramType = "query", required = false),
-            @ApiImplicitParam(name = "pageSize", value = "每页数据量", dataType = "int", paramType = "query", required = false),
-    })
-    public ResponsePageInfo<ExhibitionCustomerInfoVo> getCustomerListByCollectionCount() {
-        startPage();
-        //获取当前用户
-        UserInfo userInfo = SecurityUtils.getLoginUser().getStudent();
-        List<ExhibitionCustomerInfoVo> list = customerInfoService.getCustomerListByCollectionCount(userInfo.getId());
-        return toResponsePageInfo(list);
-    }
-
 
 }

+ 1 - 7
zzjs-service/src/main/java/com/miaxis/customer/mapper/CustomerInfoMapper.java

@@ -33,19 +33,13 @@ public interface CustomerInfoMapper extends BaseMapper<CustomerInfo> {
     CustomerInfoVo getCustomerById(@Param("id") Long id);
 
     /**
-     * 查询所属品类商家
+     * 查询商家列表
      * @param productId
      * @param userId
      * @return
      */
     List<ExhibitionCustomerInfoVo> getCustomerListByProductId(@Param("productId") Long productId,@Param("userId")Long userId);
 
-    /**
-     * 查询精选商家列表 根据收藏数排行
-     * @param userId
-     * @return
-     */
-    List<ExhibitionCustomerInfoVo> getCustomerListByCollectionCount(Long userId);
 
     /**
      * 查询用户收藏列表

+ 1 - 8
zzjs-service/src/main/java/com/miaxis/customer/service/ICustomerInfoService.java

@@ -48,7 +48,7 @@ public interface ICustomerInfoService extends IService<CustomerInfo>{
 
     /**
      * applet
-     * 查询所属品类商家
+     * 查询商家列表
      * @param productId
      * @param userId
      * @return
@@ -56,11 +56,4 @@ public interface ICustomerInfoService extends IService<CustomerInfo>{
     List<ExhibitionCustomerInfoVo> getCustomerListByProductId(Long productId,Long userId);
 
 
-    /**
-     * 查询精选商家列表 根据收藏数排行
-     * @param userId
-     * @return
-     */
-    List<ExhibitionCustomerInfoVo> getCustomerListByCollectionCount(Long userId);
-
 }

+ 1 - 13
zzjs-service/src/main/java/com/miaxis/customer/service/impl/CustomerInfoServiceImpl.java

@@ -83,7 +83,7 @@ public class CustomerInfoServiceImpl extends ServiceImpl<CustomerInfoMapper, Cus
 
     /**
      * applet
-     * 查询所属品类商家
+     * 查询商家列表
      * @param productId
      * @param userId
      * @return
@@ -95,16 +95,4 @@ public class CustomerInfoServiceImpl extends ServiceImpl<CustomerInfoMapper, Cus
 
 
 
-    /**
-     * applet
-     * 查询精选商家列表 根据收藏数排行
-     * @param userId
-     * @return
-     */
-    @Override
-    public List<ExhibitionCustomerInfoVo> getCustomerListByCollectionCount(Long userId) {
-        return customerInfoMapper.getCustomerListByCollectionCount(userId);
-    }
-
-
 }

+ 11 - 23
zzjs-service/src/main/resources/mapper/customer/CustomerInfoMapper.xml

@@ -122,30 +122,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         LEFT JOIN file_info f1 on f1.file_id = ci.corporate_logo
         LEFT JOIN file_info f2 on f2.file_id = ci.applet_logo
         LEFT JOIN file_info f3 on f3.file_id = ci.applet_qr_code
-        WHERE ci.industry_type = #{productId}
-
-    </select>
-
+        <where>
+            1=1
+            <choose>
+                <when test="productId == 0">
+                    ORDER BY collectionCount DESC
+                </when>
+                <otherwise>
+                    and ci.industry_type = #{productId}
+                </otherwise>
+            </choose>
+        </where>
 
-    <select id="getCustomerListByCollectionCount" resultType="com.miaxis.customer.vo.ExhibitionCustomerInfoVo">
-        SELECT
-        ci.id,
-        (select COUNT(1) from collection_info coi where coi.customer_id = ci.id) as collectionCount,
-        ci.corporate_name,
-        f1.file_url as corporateLogoFileUrl,
-        ci.applet_address,
-        f2.file_url as appletLogoFileUrl,
-        f3.file_url as appletQrCodeFileUrl,
-        ci.applet_introduce,
-        ci.create_time,
-        ci.update_time,
-        (SELECT COUNT(1) from collection_info coi where coi.user_id = #{userId} and customer_id = ci.id) as collectionStatus,
-        ci.status
-        FROM `customer_info` ci
-        LEFT JOIN file_info f1 on f1.file_id = ci.corporate_logo
-        LEFT JOIN file_info f2 on f2.file_id = ci.applet_logo
-        LEFT JOIN file_info f3 on f3.file_id = ci.applet_qr_code
-        ORDER BY collectionCount DESC
     </select>