| | |
| | | "SELECT ss.sys_user_id, sum(sr.pay_amount) AS t , DATE_FORMAT(sr.pay_time,'%Y%m%d') days\n" + |
| | | "FROM com_shop_order sr LEFT JOIN com_shop_store ss ON sr.store_id = ss.id\n" + |
| | | "WHERE sr.pay_status = 2 AND DATE_FORMAT(sr.pay_time,'%Y%m%d') = DATE_FORMAT(NOW(),'%Y%m%d')\n" + |
| | | "<if test='userId!=null'>" + |
| | | "<if test='userId!=null and userId!=0L'>" + |
| | | " and ss.sys_user_id = #{userId}\n" + |
| | | "</if>" + |
| | | "GROUP BY days\n" + |
| | |
| | | "SELECT ss.sys_user_id, sum(sr.pay_amount) AS t, DATE_FORMAT(sr.pay_time,'%Y%u') weeks\n" + |
| | | "FROM com_shop_order sr LEFT JOIN com_shop_store ss ON sr.store_id = ss.id\n" + |
| | | "WHERE sr.pay_status = 2 AND DATE_FORMAT(sr.pay_time,'%Y%u') = DATE_FORMAT(NOW(),'%Y%u')\n" + |
| | | "<if test='userId!=null'>" + |
| | | "<if test='userId!=null and userId!=0L'>" + |
| | | " and ss.sys_user_id = #{userId}\n" + |
| | | "</if>" + |
| | | "GROUP BY weeks\n" + |
| | |
| | | "SELECT ss.sys_user_id, sum(sr.pay_amount) AS t, DATE_FORMAT(sr.pay_time,'%Y%m') months\n" + |
| | | "FROM com_shop_order sr LEFT JOIN com_shop_store ss ON sr.store_id = ss.id\n" + |
| | | "WHERE sr.pay_status = 2 AND DATE_FORMAT(sr.pay_time,'%Y%m') = DATE_FORMAT(NOW(),'%Y%m')\n" + |
| | | "<if test='userId!=null'>" + |
| | | "<if test='userId!=null and userId!=0L'>" + |
| | | " and ss.sys_user_id = #{userId}\n" + |
| | | "</if>" + |
| | | "GROUP BY months\n" + |