Files
usdt/ruoyi-system/src/main/resources/mapper/system/RentWalletMapper.xml
T
2026-10-22 11:09:36 -04:00

200 lines
14 KiB
XML

<?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.RentWalletMapper">
<resultMap type="RentWallet" id="RentWalletResult">
<result property="id" column="id" />
<result property="nodeId" column="node_id" />
<result property="network" column="network" />
<result property="address" column="address" />
<result property="status" column="status" />
<result property="permissionId" column="permission_id" />
<result property="ownershipMethod" column="ownership_method" />
<result property="ownershipChallenge" column="ownership_challenge" />
<result property="ownershipMessage" column="ownership_message" />
<result property="ownershipSignature" column="ownership_signature" />
<result property="ownershipVerifiedAddress" column="ownership_verified_address" />
<result property="challengeIssuedAt" column="challenge_issued_at" />
<result property="challengeExpiresAt" column="challenge_expires_at" />
<result property="challengeConsumedAt" column="challenge_consumed_at" />
<result property="ownershipVerifiedAt" column="ownership_verified_at" />
<result property="ownershipEvidence" column="ownership_evidence" />
<result property="energyAvailable" column="energy_available" />
<result property="bandwidthAvailable" column="bandwidth_available" />
<result property="energyEnabled" column="energy_enabled" />
<result property="bandwidthEnabled" column="bandwidth_enabled" />
<result property="energyDelegatableSun" column="energy_delegatable_sun" />
<result property="energyReservedSun" column="energy_reserved_sun" />
<result property="energyRetainSun" column="energy_retain_sun" />
<result property="bandwidthDelegatableSun" column="bandwidth_delegatable_sun" />
<result property="bandwidthReservedSun" column="bandwidth_reserved_sun" />
<result property="bandwidthRetainSun" column="bandwidth_retain_sun" />
<result property="totalEnergyLimit" column="total_energy_limit" />
<result property="totalEnergyWeight" column="total_energy_weight" />
<result property="totalBandwidthLimit" column="total_bandwidth_limit" />
<result property="totalBandwidthWeight" column="total_bandwidth_weight" />
<result property="snapshotAt" column="snapshot_at" />
<result property="snapshotExpiresAt" column="snapshot_expires_at" />
<result property="snapshotBlockHeight" column="snapshot_block_height" />
<result property="snapshotMinBlockHeight" column="snapshot_min_block_height" />
<result property="policy" column="policy" />
<result property="version" column="version" />
<result property="createdAt" column="created_at" />
<result property="updatedAt" column="updated_at" />
</resultMap>
<sql id="selectRentWalletVo">
select id, node_id, network, address, status, permission_id, ownership_method, ownership_challenge, ownership_message, ownership_signature, ownership_verified_address, challenge_issued_at, challenge_expires_at, challenge_consumed_at, ownership_verified_at, ownership_evidence, energy_available, bandwidth_available, energy_enabled, bandwidth_enabled, energy_delegatable_sun, energy_reserved_sun, energy_retain_sun, bandwidth_delegatable_sun, bandwidth_reserved_sun, bandwidth_retain_sun, total_energy_limit, total_energy_weight, total_bandwidth_limit, total_bandwidth_weight, snapshot_at, snapshot_expires_at, snapshot_block_height, snapshot_min_block_height, policy, version, created_at, updated_at from rent_wallet
</sql>
<select id="selectRentWalletList" parameterType="RentWallet" resultMap="RentWalletResult">
<include refid="selectRentWalletVo"/>
<where>
<if test="address != null and address != ''"> and address = #{address}</if>
</where>
</select>
<select id="selectRentWalletById" parameterType="Long" resultMap="RentWalletResult">
<include refid="selectRentWalletVo"/>
where id = #{id}
</select>
<insert id="insertRentWallet" parameterType="RentWallet" useGeneratedKeys="true" keyProperty="id">
insert into rent_wallet
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="nodeId != null">node_id,</if>
<if test="network != null and network != ''">network,</if>
<if test="address != null and address != ''">address,</if>
<if test="status != null and status != ''">status,</if>
<if test="permissionId != null">permission_id,</if>
<if test="ownershipMethod != null">ownership_method,</if>
<if test="ownershipChallenge != null">ownership_challenge,</if>
<if test="ownershipMessage != null">ownership_message,</if>
<if test="ownershipSignature != null">ownership_signature,</if>
<if test="ownershipVerifiedAddress != null">ownership_verified_address,</if>
<if test="challengeIssuedAt != null">challenge_issued_at,</if>
<if test="challengeExpiresAt != null">challenge_expires_at,</if>
<if test="challengeConsumedAt != null">challenge_consumed_at,</if>
<if test="ownershipVerifiedAt != null">ownership_verified_at,</if>
<if test="ownershipEvidence != null">ownership_evidence,</if>
<if test="energyAvailable != null">energy_available,</if>
<if test="bandwidthAvailable != null">bandwidth_available,</if>
<if test="energyEnabled != null">energy_enabled,</if>
<if test="bandwidthEnabled != null">bandwidth_enabled,</if>
<if test="energyDelegatableSun != null">energy_delegatable_sun,</if>
<if test="energyReservedSun != null">energy_reserved_sun,</if>
<if test="energyRetainSun != null">energy_retain_sun,</if>
<if test="bandwidthDelegatableSun != null">bandwidth_delegatable_sun,</if>
<if test="bandwidthReservedSun != null">bandwidth_reserved_sun,</if>
<if test="bandwidthRetainSun != null">bandwidth_retain_sun,</if>
<if test="totalEnergyLimit != null">total_energy_limit,</if>
<if test="totalEnergyWeight != null">total_energy_weight,</if>
<if test="totalBandwidthLimit != null">total_bandwidth_limit,</if>
<if test="totalBandwidthWeight != null">total_bandwidth_weight,</if>
<if test="snapshotAt != null">snapshot_at,</if>
<if test="snapshotExpiresAt != null">snapshot_expires_at,</if>
<if test="snapshotBlockHeight != null">snapshot_block_height,</if>
<if test="snapshotMinBlockHeight != null">snapshot_min_block_height,</if>
<if test="policy != null">policy,</if>
<if test="version != null">version,</if>
<if test="createdAt != null">created_at,</if>
<if test="updatedAt != null">updated_at,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="nodeId != null">#{nodeId},</if>
<if test="network != null and network != ''">#{network},</if>
<if test="address != null and address != ''">#{address},</if>
<if test="status != null and status != ''">#{status},</if>
<if test="permissionId != null">#{permissionId},</if>
<if test="ownershipMethod != null">#{ownershipMethod},</if>
<if test="ownershipChallenge != null">#{ownershipChallenge},</if>
<if test="ownershipMessage != null">#{ownershipMessage},</if>
<if test="ownershipSignature != null">#{ownershipSignature},</if>
<if test="ownershipVerifiedAddress != null">#{ownershipVerifiedAddress},</if>
<if test="challengeIssuedAt != null">#{challengeIssuedAt},</if>
<if test="challengeExpiresAt != null">#{challengeExpiresAt},</if>
<if test="challengeConsumedAt != null">#{challengeConsumedAt},</if>
<if test="ownershipVerifiedAt != null">#{ownershipVerifiedAt},</if>
<if test="ownershipEvidence != null">#{ownershipEvidence},</if>
<if test="energyAvailable != null">#{energyAvailable},</if>
<if test="bandwidthAvailable != null">#{bandwidthAvailable},</if>
<if test="energyEnabled != null">#{energyEnabled},</if>
<if test="bandwidthEnabled != null">#{bandwidthEnabled},</if>
<if test="energyDelegatableSun != null">#{energyDelegatableSun},</if>
<if test="energyReservedSun != null">#{energyReservedSun},</if>
<if test="energyRetainSun != null">#{energyRetainSun},</if>
<if test="bandwidthDelegatableSun != null">#{bandwidthDelegatableSun},</if>
<if test="bandwidthReservedSun != null">#{bandwidthReservedSun},</if>
<if test="bandwidthRetainSun != null">#{bandwidthRetainSun},</if>
<if test="totalEnergyLimit != null">#{totalEnergyLimit},</if>
<if test="totalEnergyWeight != null">#{totalEnergyWeight},</if>
<if test="totalBandwidthLimit != null">#{totalBandwidthLimit},</if>
<if test="totalBandwidthWeight != null">#{totalBandwidthWeight},</if>
<if test="snapshotAt != null">#{snapshotAt},</if>
<if test="snapshotExpiresAt != null">#{snapshotExpiresAt},</if>
<if test="snapshotBlockHeight != null">#{snapshotBlockHeight},</if>
<if test="snapshotMinBlockHeight != null">#{snapshotMinBlockHeight},</if>
<if test="policy != null">#{policy},</if>
<if test="version != null">#{version},</if>
<if test="createdAt != null">#{createdAt},</if>
<if test="updatedAt != null">#{updatedAt},</if>
</trim>
</insert>
<update id="updateRentWallet" parameterType="RentWallet">
update rent_wallet
<trim prefix="SET" suffixOverrides=",">
<if test="nodeId != null">node_id = #{nodeId},</if>
<if test="network != null and network != ''">network = #{network},</if>
<if test="address != null and address != ''">address = #{address},</if>
<if test="status != null and status != ''">status = #{status},</if>
<if test="permissionId != null">permission_id = #{permissionId},</if>
<if test="ownershipMethod != null">ownership_method = #{ownershipMethod},</if>
<if test="ownershipChallenge != null">ownership_challenge = #{ownershipChallenge},</if>
<if test="ownershipMessage != null">ownership_message = #{ownershipMessage},</if>
<if test="ownershipSignature != null">ownership_signature = #{ownershipSignature},</if>
<if test="ownershipVerifiedAddress != null">ownership_verified_address = #{ownershipVerifiedAddress},</if>
<if test="challengeIssuedAt != null">challenge_issued_at = #{challengeIssuedAt},</if>
<if test="challengeExpiresAt != null">challenge_expires_at = #{challengeExpiresAt},</if>
<if test="challengeConsumedAt != null">challenge_consumed_at = #{challengeConsumedAt},</if>
<if test="ownershipVerifiedAt != null">ownership_verified_at = #{ownershipVerifiedAt},</if>
<if test="ownershipEvidence != null">ownership_evidence = #{ownershipEvidence},</if>
<if test="energyAvailable != null">energy_available = #{energyAvailable},</if>
<if test="bandwidthAvailable != null">bandwidth_available = #{bandwidthAvailable},</if>
<if test="energyEnabled != null">energy_enabled = #{energyEnabled},</if>
<if test="bandwidthEnabled != null">bandwidth_enabled = #{bandwidthEnabled},</if>
<if test="energyDelegatableSun != null">energy_delegatable_sun = #{energyDelegatableSun},</if>
<if test="energyReservedSun != null">energy_reserved_sun = #{energyReservedSun},</if>
<if test="energyRetainSun != null">energy_retain_sun = #{energyRetainSun},</if>
<if test="bandwidthDelegatableSun != null">bandwidth_delegatable_sun = #{bandwidthDelegatableSun},</if>
<if test="bandwidthReservedSun != null">bandwidth_reserved_sun = #{bandwidthReservedSun},</if>
<if test="bandwidthRetainSun != null">bandwidth_retain_sun = #{bandwidthRetainSun},</if>
<if test="totalEnergyLimit != null">total_energy_limit = #{totalEnergyLimit},</if>
<if test="totalEnergyWeight != null">total_energy_weight = #{totalEnergyWeight},</if>
<if test="totalBandwidthLimit != null">total_bandwidth_limit = #{totalBandwidthLimit},</if>
<if test="totalBandwidthWeight != null">total_bandwidth_weight = #{totalBandwidthWeight},</if>
<if test="snapshotAt != null">snapshot_at = #{snapshotAt},</if>
<if test="snapshotExpiresAt != null">snapshot_expires_at = #{snapshotExpiresAt},</if>
<if test="snapshotBlockHeight != null">snapshot_block_height = #{snapshotBlockHeight},</if>
<if test="snapshotMinBlockHeight != null">snapshot_min_block_height = #{snapshotMinBlockHeight},</if>
<if test="policy != null">policy = #{policy},</if>
<if test="version != null">version = #{version},</if>
<if test="createdAt != null">created_at = #{createdAt},</if>
<if test="updatedAt != null">updated_at = #{updatedAt},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteRentWalletById" parameterType="Long">
delete from rent_wallet where id = #{id}
</delete>
<delete id="deleteRentWalletByIds" parameterType="String">
delete from rent_wallet where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>