添加资金流水等表逻辑

This commit is contained in:
lu7213 committed 2025-12-05 11:51:24 +08:00
1 parent 8d3cb18a46
commit a8e2a507d9
23 files changed
+3305 -2

No files matched your search

@@ -0,0 +1,96 @@
<?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.ruoyi.system.mapper.UsdtFundFlowMapper">
<resultMap type="UsdtFundFlow" id="UsdtFundFlowResult">
<result property="id" column="id" />
<result property="orderId" column="order_id" />
<result property="userId" column="user_id" />
<result property="appId" column="app_id" />
<result property="createdAt" column="created_at" />
<result property="updatedAt" column="updated_at" />
<result property="deletedAt" column="deleted_at" />
<result property="amount" column="amount" />
<result property="opType" column="op_type" />
<result property="token" column="token" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectUsdtFundFlowVo">
select id, order_id, user_id, app_id, created_at, updated_at, deleted_at, amount, op_type, token, remark from usdt_fund_flow
</sql>
<select id="selectUsdtFundFlowList" parameterType="UsdtFundFlow" resultMap="UsdtFundFlowResult">
<include refid="selectUsdtFundFlowVo"/>
<where>
<if test="orderId != null "> and order_id = #{orderId}</if>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="appId != null "> and app_id = #{appId}</if>
<if test="opType != null "> and op_type = #{opType}</if>
<if test="remark != null and remark != ''"> and remark like concat('%', #{remark}, '%')</if>
</where>
</select>
<select id="selectUsdtFundFlowById" parameterType="Long" resultMap="UsdtFundFlowResult">
<include refid="selectUsdtFundFlowVo"/>
where id = #{id}
</select>
<insert id="insertUsdtFundFlow" parameterType="UsdtFundFlow" useGeneratedKeys="true" keyProperty="id">
insert into usdt_fund_flow
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="orderId != null">order_id,</if>
<if test="userId != null">user_id,</if>
<if test="appId != null">app_id,</if>
<if test="createdAt != null">created_at,</if>
<if test="updatedAt != null">updated_at,</if>
<if test="deletedAt != null">deleted_at,</if>
<if test="amount != null">amount,</if>
<if test="opType != null">op_type,</if>
<if test="token != null">token,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="orderId != null">#{orderId},</if>
<if test="userId != null">#{userId},</if>
<if test="appId != null">#{appId},</if>
<if test="createdAt != null">#{createdAt},</if>
<if test="updatedAt != null">#{updatedAt},</if>
<if test="deletedAt != null">#{deletedAt},</if>
<if test="amount != null">#{amount},</if>
<if test="opType != null">#{opType},</if>
<if test="token != null">#{token},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateUsdtFundFlow" parameterType="UsdtFundFlow">
update usdt_fund_flow
<trim prefix="SET" suffixOverrides=",">
<if test="orderId != null">order_id = #{orderId},</if>
<if test="userId != null">user_id = #{userId},</if>
<if test="appId != null">app_id = #{appId},</if>
<if test="createdAt != null">created_at = #{createdAt},</if>
<if test="updatedAt != null">updated_at = #{updatedAt},</if>
<if test="deletedAt != null">deleted_at = #{deletedAt},</if>
<if test="amount != null">amount = #{amount},</if>
<if test="opType != null">op_type = #{opType},</if>
<if test="token != null">token = #{token},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteUsdtFundFlowById" parameterType="Long">
delete from usdt_fund_flow where id = #{id}
</delete>
<delete id="deleteUsdtFundFlowByIds" parameterType="String">
delete from usdt_fund_flow where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
@@ -0,0 +1,127 @@
<?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.ruoyi.system.mapper.UsdtOrdersMapper">
<resultMap type="UsdtOrders" id="UsdtOrdersResult">
<result property="id" column="id" />
<result property="tradeId" column="trade_id" />
<result property="orderId" column="order_id" />
<result property="blockTransactionId" column="block_transaction_id" />
<result property="actualAmount" column="actual_amount" />
<result property="amount" column="amount" />
<result property="token" column="token" />
<result property="status" column="status" />
<result property="notifyUrl" column="notify_url" />
<result property="redirectUrl" column="redirect_url" />
<result property="callbackNum" column="callback_num" />
<result property="callbackConfirm" column="callback_confirm" />
<result property="createdAt" column="created_at" />
<result property="updatedAt" column="updated_at" />
<result property="deletedAt" column="deleted_at" />
<result property="appId" column="app_id" />
<result property="settlementStatus" column="settlement_status" />
<result property="userId" column="user_id" />
</resultMap>
<sql id="selectUsdtOrdersVo">
select id, trade_id, order_id, block_transaction_id, actual_amount, amount, token, status, notify_url, redirect_url, callback_num, callback_confirm, created_at, updated_at, deleted_at, app_id, settlement_status, user_id from orders
</sql>
<select id="selectUsdtOrdersList" parameterType="UsdtOrders" resultMap="UsdtOrdersResult">
<include refid="selectUsdtOrdersVo"/>
<where>
<if test="tradeId != null and tradeId != ''"> and trade_id like concat('%', #{tradeId}, '%')</if>
<if test="orderId != null and orderId != ''"> and order_id like concat('%', #{orderId}, '%')</if>
<if test="token != null and token != ''"> and token = #{token}</if>
<if test="status != null "> and status = #{status}</if>
<if test="callbackConfirm != null "> and callback_confirm = #{callbackConfirm}</if>
<if test="appId != null "> and app_id = #{appId}</if>
<if test="settlementStatus != null "> and settlement_status = #{settlementStatus}</if>
<if test="userId != null "> and user_id = #{userId}</if>
</where>
</select>
<select id="selectUsdtOrdersById" parameterType="Long" resultMap="UsdtOrdersResult">
<include refid="selectUsdtOrdersVo"/>
where id = #{id}
</select>
<insert id="insertUsdtOrders" parameterType="UsdtOrders" useGeneratedKeys="true" keyProperty="id">
insert into orders
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="tradeId != null and tradeId != ''">trade_id,</if>
<if test="orderId != null and orderId != ''">order_id,</if>
<if test="blockTransactionId != null">block_transaction_id,</if>
<if test="actualAmount != null">actual_amount,</if>
<if test="amount != null">amount,</if>
<if test="token != null and token != ''">token,</if>
<if test="status != null">status,</if>
<if test="notifyUrl != null and notifyUrl != ''">notify_url,</if>
<if test="redirectUrl != null">redirect_url,</if>
<if test="callbackNum != null">callback_num,</if>
<if test="callbackConfirm != null">callback_confirm,</if>
<if test="createdAt != null">created_at,</if>
<if test="updatedAt != null">updated_at,</if>
<if test="deletedAt != null">deleted_at,</if>
<if test="appId != null">app_id,</if>
<if test="settlementStatus != null">settlement_status,</if>
<if test="userId != null">user_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="tradeId != null and tradeId != ''">#{tradeId},</if>
<if test="orderId != null and orderId != ''">#{orderId},</if>
<if test="blockTransactionId != null">#{blockTransactionId},</if>
<if test="actualAmount != null">#{actualAmount},</if>
<if test="amount != null">#{amount},</if>
<if test="token != null and token != ''">#{token},</if>
<if test="status != null">#{status},</if>
<if test="notifyUrl != null and notifyUrl != ''">#{notifyUrl},</if>
<if test="redirectUrl != null">#{redirectUrl},</if>
<if test="callbackNum != null">#{callbackNum},</if>
<if test="callbackConfirm != null">#{callbackConfirm},</if>
<if test="createdAt != null">#{createdAt},</if>
<if test="updatedAt != null">#{updatedAt},</if>
<if test="deletedAt != null">#{deletedAt},</if>
<if test="appId != null">#{appId},</if>
<if test="settlementStatus != null">#{settlementStatus},</if>
<if test="userId != null">#{userId},</if>
</trim>
</insert>
<update id="updateUsdtOrders" parameterType="UsdtOrders">
update orders
<trim prefix="SET" suffixOverrides=",">
<if test="tradeId != null and tradeId != ''">trade_id = #{tradeId},</if>
<if test="orderId != null and orderId != ''">order_id = #{orderId},</if>
<if test="blockTransactionId != null">block_transaction_id = #{blockTransactionId},</if>
<if test="actualAmount != null">actual_amount = #{actualAmount},</if>
<if test="amount != null">amount = #{amount},</if>
<if test="token != null and token != ''">token = #{token},</if>
<if test="status != null">status = #{status},</if>
<if test="notifyUrl != null and notifyUrl != ''">notify_url = #{notifyUrl},</if>
<if test="redirectUrl != null">redirect_url = #{redirectUrl},</if>
<if test="callbackNum != null">callback_num = #{callbackNum},</if>
<if test="callbackConfirm != null">callback_confirm = #{callbackConfirm},</if>
<if test="createdAt != null">created_at = #{createdAt},</if>
<if test="updatedAt != null">updated_at = #{updatedAt},</if>
<if test="deletedAt != null">deleted_at = #{deletedAt},</if>
<if test="appId != null">app_id = #{appId},</if>
<if test="settlementStatus != null">settlement_status = #{settlementStatus},</if>
<if test="userId != null">user_id = #{userId},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteUsdtOrdersById" parameterType="Long">
delete from orders where id = #{id}
</delete>
<delete id="deleteUsdtOrdersByIds" parameterType="String">
delete from orders where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
@@ -0,0 +1,90 @@
<?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.ruoyi.system.mapper.UsdtUserSettlementConfigurationMapper">
<resultMap type="UsdtUserSettlementConfiguration" id="UsdtUserSettlementConfigurationResult">
<result property="id" column="id" />
<result property="userId" column="user_id" />
<result property="commissionRate" column="commission_rate" />
<result property="createdAt" column="created_at" />
<result property="updatedAt" column="updated_at" />
<result property="deletedAt" column="deleted_at" />
<result property="withdrawalFee" column="withdrawal_fee" />
<result property="status" column="status" />
<result property="extInfo" column="ext_info" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectUsdtUserSettlementConfigurationVo">
select id, user_id, commission_rate, created_at, updated_at, deleted_at, withdrawal_fee, status, ext_info, remark from usdt_user_settlement_configuration
</sql>
<select id="selectUsdtUserSettlementConfigurationList" parameterType="UsdtUserSettlementConfiguration" resultMap="UsdtUserSettlementConfigurationResult">
<include refid="selectUsdtUserSettlementConfigurationVo"/>
<where>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="status != null "> and status = #{status}</if>
<if test="remark != null and remark != ''"> and remark like concat('%', #{remark}, '%')</if>
</where>
</select>
<select id="selectUsdtUserSettlementConfigurationById" parameterType="Long" resultMap="UsdtUserSettlementConfigurationResult">
<include refid="selectUsdtUserSettlementConfigurationVo"/>
where id = #{id}
</select>
<insert id="insertUsdtUserSettlementConfiguration" parameterType="UsdtUserSettlementConfiguration" useGeneratedKeys="true" keyProperty="id">
insert into usdt_user_settlement_configuration
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="userId != null">user_id,</if>
<if test="commissionRate != null">commission_rate,</if>
<if test="createdAt != null">created_at,</if>
<if test="updatedAt != null">updated_at,</if>
<if test="deletedAt != null">deleted_at,</if>
<if test="withdrawalFee != null">withdrawal_fee,</if>
<if test="status != null">status,</if>
<if test="extInfo != null">ext_info,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="userId != null">#{userId},</if>
<if test="commissionRate != null">#{commissionRate},</if>
<if test="createdAt != null">#{createdAt},</if>
<if test="updatedAt != null">#{updatedAt},</if>
<if test="deletedAt != null">#{deletedAt},</if>
<if test="withdrawalFee != null">#{withdrawalFee},</if>
<if test="status != null">#{status},</if>
<if test="extInfo != null">#{extInfo},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateUsdtUserSettlementConfiguration" parameterType="UsdtUserSettlementConfiguration">
update usdt_user_settlement_configuration
<trim prefix="SET" suffixOverrides=",">
<if test="userId != null">user_id = #{userId},</if>
<if test="commissionRate != null">commission_rate = #{commissionRate},</if>
<if test="createdAt != null">created_at = #{createdAt},</if>
<if test="updatedAt != null">updated_at = #{updatedAt},</if>
<if test="deletedAt != null">deleted_at = #{deletedAt},</if>
<if test="withdrawalFee != null">withdrawal_fee = #{withdrawalFee},</if>
<if test="status != null">status = #{status},</if>
<if test="extInfo != null">ext_info = #{extInfo},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteUsdtUserSettlementConfigurationById" parameterType="Long">
delete from usdt_user_settlement_configuration where id = #{id}
</delete>
<delete id="deleteUsdtUserSettlementConfigurationByIds" parameterType="String">
delete from usdt_user_settlement_configuration where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>