| | |
| | | <if test="param.memberUserId != null and param.memberUserId != ''"> |
| | | AND toc.user_id = #{param.memberUserId} |
| | | </if> |
| | | <if test="param.memberUserIdList != null and param.memberUserIdList.size()>0"> |
| | | AND toc.user_id IN |
| | | <foreach collection="param.memberUserIdList" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | <if test="param.type != null and param.type ==1 "> |
| | | AND (toc.order_status = 2 OR toc.order_status = 3) |
| | | </if> |
| | |
| | | AND Date(toc.create_time) <= #{param.endOrderDate} |
| | | </if> |
| | | <if test="param.keyword != null and param.keyword != ''"> |
| | | AND (toc.order_no LIKE CONCAT('%',#{param.keyword},'%') OR tog.goods_name LIKE CONCAT('%',#{param.keyword},'%')) |
| | | AND (toc.order_no LIKE CONCAT('%',#{param.keyword},'%') OR tog.goods_name LIKE CONCAT('%',#{param.keyword},'%') |
| | | <if test="param.memberUserIdList != null and param.memberUserIdList.size()>0"> |
| | | OR toc.user_id IN |
| | | <foreach collection="param.memberUserIdList" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | ) |
| | | </if> |
| | | ORDER BY toc.create_time DESC |
| | | </select> |
| | |
| | | |
| | | <select id="totalMerOrder" resultType="com.ruoyi.order.domain.vo.MerTotalOrderVo"> |
| | | SELECT |
| | | COUNT(order_id) orderTotal, |
| | | IFNULL(SUM(receivable_money-IFNULL(online_pay_money,0)),0) receivableMoney, |
| | | IFNULL(SUM(change_receivable_money),0) relReceiveMoney, |
| | | IFNULL(SUM(CASE pay_type WHEN 1 THEN online_pay_money WHEN 2 THEN IFNULL(offline_pay_money,0) END),0) relPayMoney, |
| | | IFNULL(SUM(change_receivable_money-IFNULL(CASE pay_type WHEN 1 THEN online_pay_money WHEN 2 THEN IFNULL(offline_pay_money,0) END,0)),0) unpaidMoney, |
| | | IFNULL(SUM(CASE pay_type WHEN 2 THEN online_pay_money ELSE 0 END),0) receivableDeposit |
| | | FROM t_order |
| | | WHERE del_flag = 0 AND shop_id = #{param.shopId} |
| | | COUNT(toc.order_id) orderTotal, |
| | | IFNULL(SUM(toc.receivable_money-IFNULL(toc.online_pay_money,0)),0) receivableMoney, |
| | | IFNULL(SUM(toc.change_receivable_money),0) relReceiveMoney, |
| | | IFNULL(SUM(CASE toc.pay_type WHEN 1 THEN toc.online_pay_money WHEN 2 THEN IFNULL(toc.offline_pay_money,0) END),0) relPayMoney, |
| | | IFNULL(SUM(toc.change_receivable_money-IFNULL(CASE toc.pay_type WHEN 1 THEN toc.online_pay_money WHEN 2 THEN IFNULL(toc.offline_pay_money,0) END,0)),0) unpaidMoney, |
| | | IFNULL(SUM(CASE toc.pay_type WHEN 2 THEN toc.online_pay_money ELSE 0 END),0) receivableDeposit |
| | | FROM t_order toc |
| | | WHERE toc.del_flag = 0 AND toc.shop_id = #{param.shopId} |
| | | <if test="param.memberUserId != null and param.memberUserId != ''"> |
| | | AND user_id = #{param.memberUserId} |
| | | </if> |
| | | <if test="param.type == null"> |
| | | AND order_status (order_status = 2 OR order_status = 3) |
| | | AND toc.user_id = #{param.memberUserId} |
| | | </if> |
| | | <if test="param.type != null and param.type ==1 "> |
| | | AND (order_status = 2 OR order_status = 3) |
| | | AND (toc.order_status = 2 OR toc.order_status = 3) |
| | | </if> |
| | | <if test="param.type != null and param.type ==2 "> |
| | | AND order_status = 2 |
| | | AND toc.order_status = 2 |
| | | </if> |
| | | <if test="param.type != null and param.type ==3 "> |
| | | AND order_status = 3 |
| | | AND toc.order_status = 3 |
| | | </if> |
| | | <if test="param.orderFrom != null and param.orderFrom != '' "> |
| | | AND order_from = #{param.orderFrom} |
| | | AND toc.order_from = #{param.orderFrom} |
| | | </if> |
| | | <if test="param.startOrderDate != null and param.startOrderDate != '' "> |
| | | AND Date(create_time) >= #{param.startOrderDate} |
| | | AND Date(toc.create_time) >= #{param.startOrderDate} |
| | | </if> |
| | | <if test="param.endOrderDate != null and param.endOrderDate != '' "> |
| | | AND Date(create_time) <= #{param.endOrderDate} |
| | | AND Date(toc.create_time) <= #{param.endOrderDate} |
| | | </if> |
| | | <if test="param.keyword != null and param.keyword != ''"> |
| | | AND order_no LIKE CONCAT('%',#{param.keyword},'%') |
| | | AND (toc.order_no LIKE CONCAT('%',#{param.keyword},'%') OR |
| | | toc.order_id IN (SELECT DISTINCT tog.order_id FROM t_order_goods tog WHERE tog.goods_name LIKE CONCAT('%',#{param.keyword},'%')) |
| | | <if test="param.memberUserIdList != null and param.memberUserIdList.size()>0"> |
| | | OR toc.user_id IN |
| | | <foreach collection="param.memberUserIdList" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | ) |
| | | </if> |
| | | ORDER BY toc.create_time DESC |
| | | </select> |
| | | |
| | | <select id="pageMgtShopAllOrder" resultMap="mgtShopAllOrderResultMap"> |