update 后台管理系统出入账接口问题修复

This commit is contained in:
yyb
2025-08-27 15:03:11 +08:00
parent f8264b2df1
commit 981838726c
10 changed files with 164 additions and 50 deletions

View File

@@ -36,7 +36,7 @@
`user`,
address,
`date`,
should_out_date as shouldOutDate,
DATE(`date`) as shouldOutDate,
max_height,
allocation_amount as allocationAmount,
transfer_amount as transferAmount
@@ -46,10 +46,10 @@
coin = #{coin} AND `user` = #{user}
<choose>
<when test="startDate != null and endDate != null">
and `should_out_date` >= #{startDate} and `should_out_date`<![CDATA[ <= ]]> #{endDate}
and DATE(`date`) >= #{startDate} and DATE(`date`) <![CDATA[ <= ]]> #{endDate}
</when>
<otherwise>
and `should_out_date` >= DATE_SUB(NOW(), INTERVAL 1 MONTH)
and `date` >= DATE_SUB(DATE(NOW()), INTERVAL 1 MONTH)
</otherwise>
</choose>
</where>

View File

@@ -5,46 +5,40 @@
<mapper namespace="com.m2pool.manage.mapper.ManageWalletOutInMapper">
<select id="getWalletInfo" resultType="com.m2pool.manage.entity.ManageWalletOutIn">
<select id="getWalletIn" resultType="com.m2pool.manage.entity.ManageWalletOutIn">
SELECT
wi.coin,
wi.`user`,
wi.should_out_date AS shouldOutDate,
wi.amount AS allocationAmount,
wo.address,
wo.`date`,
wo.max_height AS maxHeight,
wo.tx_id AS txId,
wo.amount AS transferAmount
wi.`create_date` as `date`,
wi.max_height AS maxHeight
FROM
wallet_in wi
LEFT JOIN wallet_outv2 wo
ON
DATE(wi.create_date) = DATE(wo.`date`) AND wi.coin = wo.coin AND wi.`user` = wo.`user`
<where>
wo.`date` <![CDATA[ <= ]]> NOW()
<if test="startDate != null">
AND wo.`date` > #{startDate}
</if>
<choose>
<when test="startDate != null">
wi.`create_date` >= DATE(#{startDate})
</when>
<otherwise>
wi.`create_date` <![CDATA[ <= ]]> NOW()
</otherwise>
</choose>
</where>
UNION
</select>
<select id="getWalletOut" resultType="com.m2pool.manage.entity.ManageWalletOutIn">
SELECT
wi.coin,
wi.`user`,
wi.should_out_date AS shouldOutDate,
wi.amount AS allocationAmount,
wo.coin,
wo.`user`,
wo.address,
wo.`date`,
wo.max_height AS maxHeight,
wo.tx_id AS txId,
wo.amount AS transferAmount
FROM
wallet_in wi
RIGHT JOIN wallet_outv2 wo
ON
DATE(wi.create_date) = DATE(wo.`date`) AND wi.coin = wo.coin AND wi.`user` = wo.`user`
wallet_outv2 wo
<where>
wo.`date` <![CDATA[ <= ]]> NOW()
AND wo.`date` <![CDATA[ <= ]]> NOW()
<if test="startDate != null">
AND wo.`date` > #{startDate}
</if>