| | |
| | | <result column="discountMoney" property="discountMoney"/> |
| | | <result column="receivableMoney" property="receivableMoney"/> |
| | | <result column="payMoney" property="payMoney"/> |
| | | <result column="receiveMoney" property="receiveMoney"/> |
| | | <result column="orderFrom" property="orderFrom" /> |
| | | <result column="orderFromDesc" property="orderFromDesc" /> |
| | | <result column="createTime" property="createTime" /> |
| | | <collection property="mgtOrderGoodsVoList" ofType="com.ruoyi.order.domain.vo.MgtOrderGoodsPageVo"> |
| | | <result column="goodsName" property="goodsName"/> |
| | |
| | | toc.coupon_money couponDiscount, |
| | | toc.receivable_money receivableMoney, |
| | | toc.receivable_deposit receivableDeposit, |
| | | toc.pay_money payMoney, |
| | | toc.change_receivable_money receiveMoney, |
| | | IFNULL(toc.offline_pay_money,0) payMoney, |
| | | toc.change_receivable_money-IFNULL(toc.offline_pay_money,0) unPaidMoney, |
| | | toc.create_time createTime |
| | | FROM t_order toc |
| | | WHERE toc.del_flag = 0 AND toc.user_id = #{userId} AND toc.order_status = 2 AND toc.close_flag = 0 |
| | | WHERE toc.del_flag = 0 AND toc.user_id = #{userId} AND toc.order_status >= 2 AND toc.close_flag = 0 |
| | | ORDER BY toc.create_time DESC |
| | | </select> |
| | | |
| | |
| | | tog.goods_type goodsType, |
| | | tog.buy_num buyNum, |
| | | toc.create_time createTime, |
| | | toc.order_from orderFrom |
| | | toc.order_from orderFrom, |
| | | toc.activity_name activityName |
| | | FROM t_order toc |
| | | INNER JOIN t_order_goods tog ON tog.order_id = toc.order_id |
| | | WHERE toc.del_flag = 0 AND toc.shop_id = #{param.shopId} |
| | |
| | | toc.order_status orderStatus, |
| | | toc.order_money orderGoodsMoney, |
| | | toc.coupon_money couponDiscount, |
| | | toc.receivable_money receivableMoney, |
| | | toc.receivable_money-toc.online_pay_money receivableMoney, |
| | | toc.receivable_deposit receivableDeposit, |
| | | toc.pay_money payMoney |
| | | FROM t_order toc |
| | | toc.change_receivable_money payMoney, |
| | | IFNULL(toc.offline_pay_money,0) receiveMoney, |
| | | IFNULL(toc.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, |
| | | tpr.pay_time receiveMoneyTime, |
| | | tpr.pay_money thisReceiveMoney, |
| | | CASE tpr.pay_type WHEN 1 THEN "微信" WHEN 2 THEN "现金" WHEN 3 THEN "支付宝" END thisReceiveType |
| | | FROM t_pay_record tpr |
| | | INNER JOIN t_order toc ON tpr.order_id = toc.order_id |
| | | WHERE toc.del_flag = 0 AND toc.user_id = #{userId} AND (toc.order_status = 2 OR toc.order_status = 3) |
| | | ORDER BY toc.create_time DESC |
| | | </select> |
| | |
| | | IFNULL(SUM(IFNULL(toc.order_money,0)),0) totalOrderMoney, |
| | | IFNULL(SUM(IFNULL(toc.receivable_money,0)),0) totalReceivableMoney, |
| | | IFNULL(SUM(IFNULL(toc.discount_money,0)),0) totalDiscountMoney, |
| | | IFNULL(SUM(IFNULL(toc.pay_money,0)),0) totalPayMoney |
| | | IFNULL(SUM(IFNULL(toc.pay_money,0)),0) totalPayMoney, |
| | | IFNULL(SUM(IFNULL(toc.change_receivable_money,0)),0) totalReceiveMoney |
| | | FROM t_order toc |
| | | WHERE toc.del_flag = 0 AND toc.user_id = #{param.userId} |
| | | WHERE toc.del_flag = 0 AND toc.user_id = #{param.memberUserId} |
| | | <if test="param.orderStatus != null"> |
| | | AND toc.order_status = #{param.orderStatus} |
| | | </if> |
| | |
| | | toc.discount_money discountMoney, |
| | | toc.receivable_money receivableMoney, |
| | | toc.pay_money payMoney, |
| | | toc.change_receivable_money receiveMoney, |
| | | tog.goods_name goodsName, |
| | | tog.buy_num buyNum, |
| | | toc.create_time createTime, |
| | |
| | | AND Date(toc.create_time) <= #{param.endOrderDate} |
| | | </if> |
| | | <if test="param.keyword != null and param.keyword != ''"> |
| | | AND toc.order_no LIKE CONCAT('%',#{param.keyword},'%') |
| | | AND (toc.order_no LIKE CONCAT('%',#{param.keyword},'%') OR tog.goods_name LIKE CONCAT('%',#{param.keyword},'%')) |
| | | </if> |
| | | ORDER BY toc.create_time DESC |
| | | </select> |
| | |
| | | |
| | | <select id="totalOrderFirst" resultType="com.ruoyi.order.domain.vo.MgtOrderTotal"> |
| | | SELECT |
| | | COUNT(order_id) orderTotal, |
| | | IFNULL(SUM(order_money),0) orderMoneyTotal |
| | | FROM t_order ORDER BY create_time DESC |
| | | COUNT(temp.order_id) orderTotal, |
| | | IFNULL(SUM(temp.order_money),0) orderMoneyTotal |
| | | FROM |
| | | (SELECT toc.order_id,toc.order_money,toc.pay_money |
| | | FROM t_order toc |
| | | INNER JOIN t_order_goods tog ON tog.order_id = toc.order_id |
| | | WHERE toc.del_flag = 0 AND (toc.order_from = 1 OR toc.order_from = 3) |
| | | <if test="param.orderStatus != null"> |
| | | AND toc.order_status = #{param.orderStatus} |
| | | </if> |
| | | <if test="param.goodsType != null and param.goodsType !=''"> |
| | | AND tog.goods_type = #{param.goodsType} |
| | | </if> |
| | | <if test="param.shopId != null and param.shopId != ''"> |
| | | AND toc.shop_id = #{param.shopId} |
| | | </if> |
| | | <if test="param.shopIds != null and param.shopIds != ''"> |
| | | AND FIND_IN_SET(toc.shop_id, #{param.shopIds}) > 0 |
| | | </if> |
| | | <if test="param.keyword != null and param.keyword != ''"> |
| | | AND (toc.order_no LIKE CONCAT('%',#{param.keyword},'%') OR toc.activity_name LIKE CONCAT('%',#{param.keyword},'%') OR FIND_IN_SET(toc.user_id, #{param.userIds}) > 0) |
| | | </if> |
| | | <if test="param.verifyStartTime != null and param.verifyStartTime != ''"> |
| | | AND Date(toc.use_time) >= #{param.verifyStartTime} |
| | | </if> |
| | | <if test="param.verifyEndTime != null and param.verifyEndTime != ''"> |
| | | AND Date(toc.use_time) <= #{param.verifyEndTime} |
| | | </if> |
| | | GROUP BY toc.order_id) AS temp |
| | | </select> |
| | | |
| | | <select id="totalOrderSecond" resultType="com.ruoyi.order.domain.vo.MgtOrderTotal"> |
| | |
| | | IFNULL(SUM(CASE WHEN order_from = 2 THEN 1 ELSE 0 END),0) activityOrderTotal |
| | | FROM t_order |
| | | WHERE del_flag = 0 |
| | | </select> |
| | | |
| | | <select id="activityUserTotal" resultType="java.lang.Integer"> |
| | | SELECT |
| | | COUNT(DISTINCT user_id) |
| | | FROM t_order |
| | | WHERE del_flag = 0 AND order_from = 2 |
| | | </select> |
| | | |
| | | <select id="getTotalOrderTotalOrderFrom" resultType="com.ruoyi.order.domain.vo.MgtTotalOrderTotalVo"> |
| | |
| | | SELECT |
| | | DATE(toc.create_time) AS mapKey, |
| | | COUNT(DISTINCT tog.order_id) AS mapValueFirst, |
| | | SUM(tog.order_money) AS mapValueSecond |
| | | SUM(tog.goods_receivable_money) AS mapValueSecond |
| | | FROM t_order toc |
| | | INNER JOIN t_order_goods tog ON toc.order_id = tog.order_id |
| | | WHERE toc.del_flag = 0 AND tog.del_flag = 0 AND tog.goods_type = #{param.goodsType} |
| | |
| | | FROM t_order |
| | | WHERE del_flag = 0 AND shop_id = #{param.shopId} |
| | | <if test="param.memberUserId != null and param.memberUserId != ''"> |
| | | AND toc.user_id = #{param.memberUserId} |
| | | AND user_id = #{param.memberUserId} |
| | | </if> |
| | | <if test="param.type != null and param.type ==1 "> |
| | | AND (toc.order_status = 2 OR toc.order_status = 3) |
| | | AND (order_status = 2 OR order_status = 3) |
| | | </if> |
| | | <if test="param.type != null and param.type ==2 "> |
| | | AND toc.order_status = 2 |
| | | AND order_status = 2 |
| | | </if> |
| | | <if test="param.type != null and param.type ==3 "> |
| | | AND toc.order_status = 3 |
| | | AND order_status = 3 |
| | | </if> |
| | | <if test="param.orderFrom != null and param.orderFrom != '' "> |
| | | AND toc.order_from = #{param.orderFrom} |
| | | AND order_from = #{param.orderFrom} |
| | | </if> |
| | | <if test="param.startOrderDate != null and param.startOrderDate != '' "> |
| | | AND Date(toc.create_time) >= #{param.startOrderDate} |
| | | AND Date(create_time) >= #{param.startOrderDate} |
| | | </if> |
| | | <if test="param.endOrderDate != null and param.endOrderDate != '' "> |
| | | AND Date(toc.create_time) <= #{param.endOrderDate} |
| | | AND Date(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 order_no LIKE CONCAT('%',#{param.keyword},'%') |
| | | </if> |
| | | </select> |
| | | |
| | |
| | | INNER JOIN t_order_goods tog ON tog.order_id = toc.order_id |
| | | WHERE toc.del_flag = 0 AND toc.order_status > 1 AND toc.user_id = #{userId} AND tog.goods_id = #{goodsId} |
| | | </select> |
| | | |
| | | <select id="getMgtShopAllOrderTotal" resultType="com.ruoyi.order.domain.vo.MgtShopAllOrderTotal"> |
| | | SELECT |
| | | COUNT(DISTINCT toc.order_id) orderTotal, |
| | | IFNULL(SUM(toc.order_money),0) totalOrderMoney, |
| | | IFNULL(SUM(toc.change_receivable_money),0) totalReceiveMoney |
| | | FROM t_order toc |
| | | WHERE toc.del_flag = 0 AND (toc.order_from = 1 OR toc.order_from = 3) |
| | | <if test="param.orderFrom != null"> |
| | | AND toc.order_from = #{param.orderFrom} |
| | | </if> |
| | | <if test="param.orderStatus != null"> |
| | | AND toc.order_status = #{param.orderStatus} |
| | | </if> |
| | | <if test="param.orderNo != null and param.orderNo !=''"> |
| | | AND toc.order_no LIKE CONCAT('%',#{param.orderNo},'%') |
| | | </if> |
| | | <if test="param.shopId != null and param.shopId != ''"> |
| | | AND toc.shop_id = #{param.shopId} |
| | | </if> |
| | | <if test="param.startOrderDate != null and param.startOrderDate != '' "> |
| | | AND Date(toc.create_time) >= #{param.startOrderDate} |
| | | </if> |
| | | <if test="param.endOrderDate != null and param.endOrderDate != '' "> |
| | | AND Date(toc.create_time) <= #{param.endOrderDate} |
| | | </if> |
| | | ORDER BY toc.create_time DESC |
| | | </select> |
| | | |
| | | <select id="pageMerMemberPayOrder" resultMap="merOrderResultMap"> |
| | | SELECT |
| | | toc.user_id userId, |
| | | toc.order_id orderId, |
| | | toc.order_no orderNo, |
| | | toc.pay_type payType, |
| | | toc.order_status orderStatus, |
| | | toc.order_money orderGoodsMoney, |
| | | toc.coupon_money couponDiscount, |
| | | toc.receivable_money-toc.online_pay_money receivableMoney, |
| | | toc.receivable_deposit receivableDeposit, |
| | | toc.change_receivable_money payMoney, |
| | | IFNULL(toc.offline_pay_money,0) receiveMoney, |
| | | toc.order_remark orderRemark, |
| | | tog.goods_name goodsName, |
| | | tog.goods_type goodsType, |
| | | tog.buy_num buyNum, |
| | | toc.create_time createTime, |
| | | toc.order_from orderFrom |
| | | FROM t_order toc |
| | | INNER JOIN t_order_goods tog ON tog.order_id = toc.order_id |
| | | WHERE toc.del_flag = 0 AND (toc.order_status = 2 OR toc.order_status = 3) AND toc.shop_id = #{param.shopId} AND toc.user_id = #{param.memberUserId} |
| | | ORDER BY toc.create_time DESC |
| | | </select> |
| | | </mapper> |