构造属性结构
This commit is contained in:
@@ -59,4 +59,29 @@
|
||||
today_order_count = VALUES(today_order_count)
|
||||
</insert>
|
||||
|
||||
<select id="selectLatestPaidStatsByTenantId" resultType="com.rj.dto.LbBuyerTradeStats">
|
||||
SELECT o.buyer_id AS buyerId,
|
||||
o.pay_time AS payTime,
|
||||
o.total_money AS totalMoney
|
||||
FROM lb_order_row o
|
||||
WHERE o.tenant_id = #{tenantId}
|
||||
AND o.data_type = #{dataType}
|
||||
AND o.buyer_id IS NOT NULL
|
||||
AND o.pay_time IS NOT NULL
|
||||
AND TRIM(o.pay_time) != ''
|
||||
AND NOT EXISTS (
|
||||
SELECT 1
|
||||
FROM lb_order_row o2
|
||||
WHERE o2.tenant_id = o.tenant_id
|
||||
AND o2.data_type = o.data_type
|
||||
AND o2.buyer_id = o.buyer_id
|
||||
AND o2.pay_time IS NOT NULL
|
||||
AND TRIM(o2.pay_time) != ''
|
||||
AND (
|
||||
o2.pay_time > o.pay_time
|
||||
OR (o2.pay_time = o.pay_time AND o2.id > o.id)
|
||||
)
|
||||
)
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user