| | |
| | | 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} |
| | |
| | | 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 |
| | |
| | | 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 |
| | |
| | | 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 |