| | |
| | | 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.userName |
| | | SELECT date_format(o.payTime, '%Y-%m') AS monthTime,COUNT(o.id) AS amount,d.userName |
| | | FROM t_order o |
| | | LEFT JOIN (SELECT id,name AS userName from t_driver) d ON o.driverId = d.id |
| | | <where> |
| | |
| | | AND o.agentId = #{agentId} |
| | | </if> |
| | | <if test="monthDate != null and monthDate != ''"> |
| | | AND date_format(o.createTime, '%Y-%m') LIKE concat('',#{monthDate},'%') |
| | | AND date_format(o.payTime, '%Y-%m') LIKE concat('',#{monthDate},'%') |
| | | </if> |
| | | AND (o.`state` = 107 OR o.`state` = 108 OR o.`state` = 109) |
| | | AND d.userName is not null |