Browse Source

订单列表

小么熊🐻 2 years ago
parent
commit
a93ecbd895

+ 1 - 10
sdjk-service/src/main/java/com/miaxis/order/dto/OrderInfoDto.java

@@ -1,15 +1,9 @@
 package com.miaxis.order.dto;
 
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.TableName;
-import com.miaxis.common.annotation.Excel;
-import com.miaxis.common.core.domain.BaseBusinessEntity;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
-import java.util.Date;
-
 /**
  * ad对象 ad_info
  *
@@ -21,9 +15,6 @@ import java.util.Date;
 public class OrderInfoDto {
     private static final long serialVersionUID = 1L;
 
-    /** 主键 */
-    @ApiModelProperty(value = "主键")
-    private Long id;
 
     /** 商品名称 */
     @ApiModelProperty(value = "商品名称")
@@ -38,7 +29,7 @@ public class OrderInfoDto {
     private String outRefundNo;
 
     /** 订单总金额 */
-    @ApiModelProperty(value = "打开类型 1站内打开 2站外打开")
+    @ApiModelProperty(value = "订单总金额")
     private Integer total;
 
     /** 交易类型 */

+ 28 - 0
sdjk-service/src/main/java/com/miaxis/order/mapper/OrderInfoMapper.java

@@ -21,4 +21,32 @@ public interface OrderInfoMapper extends BaseMapper<OrderInfo> {
      */
     public List<OrderInfo> selectOrderInfoList(OrderInfoDto orderInfo);
 
+    /**
+     * 查询今日收益
+     *
+     * @param orderInfo orderInfo
+     * @return orderInfo集合
+     */
+    public Integer selectTodayTotal(OrderInfoDto orderInfo);
+
+
+    /**
+     * 查询昨日收益
+     *
+     * @param orderInfo orderInfo
+     * @return orderInfo 集合
+     */
+    public Integer selectYesterdayTotal(OrderInfoDto orderInfo);
+
+
+    /**
+     * 总收益
+     *
+     * @param orderInfo orderInfo
+     * @return orderInfo 集合
+     */
+    public Integer selectTotal(OrderInfoDto orderInfo);
+
+
+
 }

+ 77 - 0
sdjk-service/src/main/resources/mapper/order/OrderInfoMapper.xml

@@ -0,0 +1,77 @@
+<?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="com.miaxis.order.mapper.OrderInfoMapper">
+
+    <resultMap type="OrderInfo" id="OrderInfoResult">
+        <result property="id"    column="id"    />
+        <result property="goodsName"    column="goods_name"    />
+        <result property="out_trade_no"    column="outTradeNo"    />
+        <result property="outRefundNo"    column="out_refund_no"    />
+        <result property="total"    column="total"    />
+        <result property="tradeType"    column="trade_type"    />
+        <result property="successTime"    column="success_time"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateTime"    column="update_time"    />
+    </resultMap>
+
+    <sql id="selectOrderInfoVo">
+        select * from v_wx_order
+    </sql>
+
+    <select id="selectOrderInfoList" parameterType="OrderInfoDto" resultMap="OrderInfoResult">
+        <include refid="selectOrderInfoVo"/>
+        <where>
+            <if test="goodsName != null  and goodsName != ''"> and goods_name = #{goodsName}</if>
+            <if test="outTradeNo != null  and outTradeNo != ''"> and out_trade_no = #{outTradeNo}</if>
+            <if test="outRefundNo != null and outRefundNo != '' "> and status = #{status}</if>
+            <if test="total != null "> and total = #{total}</if>
+            <if test="tradeType != null and tradeType != ''  "> and trade_type = #{tradeType}</if>
+            <if test="referralUserId != null and referralUserId != ''  "> and referral_user_id = #{referralUserId}</if>
+            <if test="startTime != null and startTime != '' ">
+                and DATE_FORMAT(success_time,'%Y-%m-%d') <![CDATA[ >= ]]> #{startTime}
+            </if>
+            <if test="endTime != null and endTime != '' ">
+                and DATE_FORMAT(success_time, '%Y-%m-%d') <![CDATA[ <= ]]> #{endTime}
+            </if>
+        </where>
+    </select>
+
+
+    <select id="selectTodayTotal" parameterType="OrderInfoDto" resultType="Integer">
+        select sum(total) FROM v_wx_order
+        <where>
+            <if test="goodsName != null  and goodsName != ''"> and goods_name = #{goodsName}</if>
+            <if test="outTradeNo != null  and outTradeNo != ''"> and out_trade_no = #{outTradeNo}</if>
+            <if test="outRefundNo != null and outRefundNo != '' "> and status = #{status}</if>
+            <if test="total != null "> and total = #{total}</if>
+            <if test="tradeType != null and tradeType != ''  "> and trade_type = #{tradeType}</if>
+            <if test="referralUserId != null and referralUserId != ''  "> and referral_user_id = #{referralUserId}</if>
+            and TO_DAYS(success_time) = TO_DAYS(NOW())
+        </where>
+    </select>
+
+
+    <select id="selectYesterdayTotal" parameterType="OrderInfoDto" resultType="Integer">
+        select sum(total) FROM v_wx_order
+        <where>
+            <if test="goodsName != null  and goodsName != ''"> and goods_name = #{goodsName}</if>
+            <if test="outTradeNo != null  and outTradeNo != ''"> and out_trade_no = #{outTradeNo}</if>
+            <if test="outRefundNo != null and outRefundNo != '' "> and status = #{status}</if>
+            <if test="total != null "> and total = #{total}</if>
+            <if test="tradeType != null and tradeType != ''  "> and trade_type = #{tradeType}</if>
+            <if test="referralUserId != null and referralUserId != ''  "> and referral_user_id = #{referralUserId}</if>
+            and TO_DAYS(NOW()) - TO_DAYS(success_time) = 1
+        </where>
+    </select>
+
+    <select id="selectTotal" parameterType="OrderInfoDto" resultType="Integer">
+        select sum(total) FROM v_wx_order
+        <where>
+            <if test="referralUserId != null and referralUserId != ''  "> and referral_user_id = #{referralUserId}</if>
+        </where>
+    </select>
+
+
+</mapper>