liujie
2023-08-16 db7fa6a91b9534ac90e219b6f554c54c43c83a5a
management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TOrderMapper.xml
@@ -122,7 +122,7 @@
        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>
@@ -130,7 +130,7 @@
                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
@@ -399,5 +399,21 @@
        </where>
        GROUP BY `month`
    </select>
    <select id="getValidOrderCount" resultType="java.lang.Integer">
        select count(id)
        from t_order
        <where>
            <if test="driverId != null">
                AND driverId = #{driverId}
            </if>
            <if test="orderMoney != null">
                AND orderMoney &gt; #{orderMoney}
            </if>
            <if test="month != null">
                AND DATE_FORMAT(createTime, '%Y-%m') = #{month}
            </if>
            AND (`state` = 107 OR `state` = 108 OR `state` = 109)
        </where>
    </select>
</mapper>