构造属性结构

This commit is contained in:
2026-05-30 10:11:09 +08:00
parent 545c86098e
commit 4fb389ea3a
5 changed files with 228 additions and 101 deletions

View File

@@ -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 &gt; o.pay_time
OR (o2.pay_time = o.pay_time AND o2.id &gt; o.id)
)
)
</select>
</mapper>