luodangjia
2024-09-30 d8786c8c3b5084bdad9ef318d056d81579e622f0
ruoyi-service/ruoyi-order/src/main/resources/mapper/order/TOrderEvaluateMapper.xml
@@ -125,10 +125,15 @@
        order by a.create_time desc
    </select>
    <select id="goodTop" resultType="java.util.Map">
        SELECT count(1) as counts ,ot.evaluation_tag_id
        from t_order_evaluate_tag ot
                 left join t_order_evaluate te on ot.order_evaluate_id = te.id
                 left join t_charging_order co on te.order_id = co.id
        SELECT
        count( 1 ) AS counts,
        tt.`name`
        FROM
        t_order_evaluate_tag ot
        LEFT JOIN t_order_evaluate te ON ot.order_evaluate_id = te.id
        LEFT JOIN t_charging_order co ON te.order_id = co.id
        LEFT JOIN `charging_pile_other`.`t_evaluation_tag` tt on ot.evaluation_tag_id = tt.id
        WHERE ot.evaluation_tag_id in (
            SELECT id from `charging_pile_other`.`t_evaluation_tag` WHERE type = 1
        ) <if test="null != siteIds">
@@ -137,18 +142,25 @@
                #{item}
            </foreach>
        </if>
        GROUP BY ot.evaluation_tag_id
        ORDER BY counts desc
            limit 5
        GROUP BY
        tt.`name`
        ORDER BY
        counts DESC
        LIMIT 5
    </select>
    <select id="badTop" resultType="java.util.Map">
        SELECT count(1) as counts ,ot.evaluation_tag_id
        from t_order_evaluate_tag ot
        left join t_order_evaluate te on ot.order_evaluate_id = te.id
        left join t_charging_order co on te.order_id = co.id
        SELECT
        count( 1 ) AS counts,
        tt.`name`
        FROM
        t_order_evaluate_tag ot
        LEFT JOIN t_order_evaluate te ON ot.order_evaluate_id = te.id
        LEFT JOIN t_charging_order co ON te.order_id = co.id
        LEFT JOIN `charging_pile_other`.`t_evaluation_tag` tt on ot.evaluation_tag_id = tt.id
        WHERE ot.evaluation_tag_id in (
        SELECT id from `charging_pile_other`.`t_evaluation_tag` WHERE type = 3
        ) <if test="null != siteIds">
@@ -157,8 +169,10 @@
            #{item}
        </foreach>
    </if>
        GROUP BY ot.evaluation_tag_id
        ORDER BY counts desc
        limit 5
        GROUP BY
        tt.`name`
        ORDER BY
        counts DESC
        LIMIT 5
    </select>
</mapper>