<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.newfeifan.mall.module.trade.dal.mysql.order.TradeOrderMapper">

    <select id="selectOrderCountWithTime"
            resultType="cn.newfeifan.mall.module.trade.service.order.TradeOrderCountWithMoney">
        SELECT
            DATE(o.create_time) `date`,
            SUM(o.pay_integral) / 10000 money,
            count(*) count
        FROM
            trade_order o
        WHERE
            date(o.create_time) BETWEEN #{start} AND #{end} and o.merchant_id = #{merId} and o.shop_id = #{shopId} and o.pay_status = 1
        GROUP BY
            DATE(o.create_time)
        ORDER BY
            `date`;
    </select>
</mapper>
