|
@@ -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>
|