puzhibing
2023-04-18 67bfacb03541ef2ee4c1496f4cc7600014cd1005
management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TOrderMapper.xml
@@ -125,9 +125,9 @@
        GROUP BY `month`
    </select>
    <select id="getDataStatisticsOrderCount" resultType="com.stylefeng.guns.modular.system.controller.resp.PerformanceTableResp">
        SELECT date_format(o.createTime, '%Y-%m') AS monthTime,COUNT(o.id) AS amount,d.name AS userName
        SELECT date_format(o.createTime, '%Y-%m') AS monthTime,COUNT(o.id) AS amount,d.userName
        FROM t_order o
        LEFT JOIN t_driver d ON o.driverId = d.id
        LEFT JOIN (SELECT id,name AS userName from t_driver) d ON o.driverId = d.id
        <where>
            <if test="agentId != null">
                AND o.agentId = #{agentId}
@@ -136,6 +136,7 @@
                AND date_format(o.createTime, '%Y-%m') LIKE concat('',#{monthDate},'%')
            </if>
            AND (o.`state` = 107 OR o.`state` = 108 OR o.`state` = 109)
            AND d.userName is not null
        </where>
        GROUP BY monthTime,userName
        ORDER BY amount DESC
@@ -344,9 +345,9 @@
        GROUP BY `month`
    </select>
    <select id="getDataStatisticsOrderCountByIds" resultType="com.stylefeng.guns.modular.system.controller.resp.PerformanceTableResp">
        SELECT date_format(o.createTime, '%Y-%m') AS monthTime,COUNT(o.id) AS amount,d.name AS userName
        SELECT date_format(o.createTime, '%Y-%m') AS monthTime,COUNT(o.id) AS amount,d.userName
        FROM t_order o
        LEFT JOIN t_driver d ON o.driverId = d.id
        LEFT JOIN (SELECT id,name AS userName from t_driver) d ON o.driverId = d.id
        <where>
            <if test="ids != null and ids.size() > 0">
                AND o.agentId IN
@@ -358,6 +359,7 @@
                AND date_format(o.createTime, '%Y-%m') LIKE concat('',#{monthDate},'%')
            </if>
            AND (o.`state` = 107 OR o.`state` = 108 OR o.`state` = 109)
            AND d.userName is not null
        </where>
        GROUP BY monthTime,userName
        ORDER BY amount DESC