|
|
|
@@ -347,37 +347,40 @@ |
|
|
|
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId" /> |
|
|
|
<result column="trade_amt" jdbcType="DECIMAL" property="tradeAmt" /> |
|
|
|
<result column="report_date" jdbcType="VARCHAR" property="reportDate" /> |
|
|
|
<result column="merchant_phone" jdbcType="VARCHAR" property="merchantPhone" /> |
|
|
|
<result column="merchant_name" jdbcType="VARCHAR" property="merchantName" /> |
|
|
|
</resultMap> |
|
|
|
|
|
|
|
<sql id="WxMerchantMicroPayColumnsVo"> |
|
|
|
m.id as id, |
|
|
|
m.tenant_id as tenant_id, |
|
|
|
m.name as merchant_name, |
|
|
|
wm.id as id, |
|
|
|
wm.tenant_id as tenant_id, |
|
|
|
wm.name as merchant_name, |
|
|
|
wm.link_phone as merchant_phone, |
|
|
|
mo.xTime as report_date, |
|
|
|
(case when mo.amount > 0 then mo.amount else 0 end) trade_amt |
|
|
|
</sql> |
|
|
|
|
|
|
|
<select id="findListOfMerchantMicroPayOrderByDate" parameterType="map" resultMap="WxMerchantMicroPayVo"> |
|
|
|
select |
|
|
|
<include refid="WxMerchantMicroPayColumnsVo"/> |
|
|
|
from wx_merchant m |
|
|
|
from wx_merchant wm |
|
|
|
left join |
|
|
|
(select m.id as mid, IFNULL(sum(o.payment),0) amount |
|
|
|
(select m.id as mid, IFNULL(sum(o.payment),0) amount,DATE_FORMAT(o.create_date,'%Y-%m-%d') xTime |
|
|
|
from wx_merchant m, wx_order o, wx_merchant_b_user bu |
|
|
|
where bu.id = o.product_id |
|
|
|
and m.status = 1 |
|
|
|
and m.id = bu.merchant_id |
|
|
|
and o.order_status = '1' |
|
|
|
and o.type = 1 |
|
|
|
<if test="startDate != null"> |
|
|
|
AND o.create_date > #{startDate,jdbcType=TIMESTAMP} |
|
|
|
<if test="startTime != null"> |
|
|
|
AND o.create_date > #{startTime} |
|
|
|
</if> |
|
|
|
<if test="endDate != null"> |
|
|
|
AND o.create_date < #{endDate,jdbcType=TIMESTAMP} |
|
|
|
<if test="endTime != null"> |
|
|
|
AND o.create_date < #{endTime} |
|
|
|
</if> |
|
|
|
group by m.id) mo on mo.mid = m.id |
|
|
|
where m.status = 1 |
|
|
|
order by m.create_date desc |
|
|
|
group by m.id,xTime) mo on mo.mid = wm.id |
|
|
|
where wm.status = 1 |
|
|
|
order by wm.create_date desc |
|
|
|
</select> |
|
|
|
|
|
|
|
<resultMap id="orderMap" type="com.iformall.domain.po.WxOrder"> |
|
|
|
|