huanghongfa
2021-11-16 74356b2053effb9a71d632c4ba3d66124636c3de
便民服务热门商家接口调整,将犇师傅维修中心默认排到第一位
3个文件已修改
53 ■■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ConvenientMerchantDAO.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ConvenientMerchantServiceImpl.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ConvenientMerchantMapper.xml 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ConvenientMerchantDAO.java
@@ -51,6 +51,8 @@
     */
    ConvenientMerchantVO selectMerchantById(@Param("merchantId") Long merchantId);
    List<ConvenientMerchantVO> selectMerchantByName(@Param("communityId") Long communityId, @Param("currentMon") String currentMon);
    /**
     * 获取社区下热门商家
     *
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ConvenientMerchantServiceImpl.java
@@ -289,6 +289,15 @@
        page.setSize(pagePopularMerchantDTO.getPageSize());
        page.setCurrent(pagePopularMerchantDTO.getPageNum());
        IPage<ConvenientMerchantVO> merchantVOList = this.baseMapper.getPopularMerchants(page, pagePopularMerchantDTO.getCommunityId(), currentMon);
        if(pagePopularMerchantDTO.getPageNum().equals(1L)){
            //第一页默认把犇师傅维修中心加载到第一个
            List<ConvenientMerchantVO> merchantList = this.baseMapper.selectMerchantByName(pagePopularMerchantDTO.getCommunityId(), currentMon);
            if(merchantList != null && merchantList.size() > 0){
                merchantList.addAll(merchantVOList.getRecords());
                merchantVOList.setRecords(merchantList);
            }
        }
        return R.ok(merchantVOList);
    }
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ConvenientMerchantMapper.xml
@@ -68,6 +68,46 @@
        LEFT JOIN sys_user su ON ccm.user_id = su.user_id
        WHERE ccm.id = #{merchantId}
    </select>
    <select id="selectMerchantByName" resultType="com.panzhihua.common.model.vos.community.convenient.ConvenientMerchantVO">
        SELECT
            temp.id,
            temp.NAME,
            temp.introduction,
            temp.logo,
            temp.serviceScope,
        IF
            (
                SUM( temp.consultation_volume ) IS NULL,
                0,
            SUM( temp.consultation_volume )) AS monthConsultationVolume
        FROM
            (
            SELECT
                ccm.id,
                ccm.NAME,
                ccm.introduction,
                ccm.logo,
                cccs.consultation_volume,
                GROUP_CONCAT( ccss.service_name ) AS serviceScope
            FROM
                com_convenient_merchants ccm
                LEFT JOIN (
                SELECT
                    *
                FROM
                    com_convenient_consultation_statistics
                WHERE
                    statistic_date LIKE #{currentMon}) cccs ON ccm.id = cccs.merchant_id
                    LEFT JOIN com_convenient_service_scope ccss ON ccm.id = ccss.merchant_id
                WHERE
                    ( ccm.community_id = #{communityId} or ccm.community_id = 0)  AND ccm.business_status = 1 and ccm.is_del = 0 and ccm.`name` = '犇师傅维修中心' GROUP BY cccs.id
                    ) temp
                GROUP BY
                    temp.id
            ORDER BY
            SUM( temp.consultation_volume ) DESC
    </select>
    <select id="getPopularMerchants" resultType="com.panzhihua.common.model.vos.community.convenient.ConvenientMerchantVO">
        SELECT
            temp.id, temp.name, temp.introduction, temp.logo,
@@ -79,7 +119,7 @@
            FROM com_convenient_merchants ccm
            LEFT JOIN (SELECT * FROM com_convenient_consultation_statistics WHERE statistic_date LIKE #{currentMon}) cccs ON ccm.id = cccs.merchant_id
            LEFT JOIN com_convenient_service_scope ccss ON ccm.id = ccss.merchant_id
            WHERE ( ccm.community_id = #{communityId} or ccm.community_id = 0)  AND ccm.business_status = 1 and ccm.is_del = 0 GROUP BY cccs.id
            WHERE ( ccm.community_id = #{communityId} or ccm.community_id = 0)  AND ccm.business_status = 1 and ccm.is_del = 0 and ccm.`name` != '犇师傅维修中心' GROUP BY cccs.id
        ) temp GROUP BY temp.id ORDER BY SUM(temp.consultation_volume) DESC
    </select>
    <select id="getClassifyMerchants" resultType="com.panzhihua.common.model.vos.community.convenient.ConvenientMerchantVO">