租赁系统
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
package com.m2pool.lease.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.m2pool.lease.dto.UserWalletDataDto;
|
||||
import com.m2pool.lease.entity.LeaseAutoAddress;
|
||||
import org.apache.ibatis.annotations.MapKey;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface LeaseAutoAddressMapper extends BaseMapper<LeaseAutoAddress> {
|
||||
/**
|
||||
* 获取一个未使用的地址
|
||||
* @return
|
||||
*/
|
||||
LeaseAutoAddress getOneStatusIsNoUse();
|
||||
|
||||
|
||||
/**
|
||||
* 获取所有有效的地址
|
||||
* @return
|
||||
*/
|
||||
List<UserWalletDataDto> getValidAddress();
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.m2pool.lease.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.m2pool.lease.dto.v2.CoinAndAlgorithmDto;
|
||||
import com.m2pool.lease.entity.LeaseGpuConfig;
|
||||
import com.m2pool.lease.netty.message.GpuMessage;
|
||||
import com.m2pool.lease.task.info.BlockInfo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* GPU对应币种挖矿算力(只要gpu类型相同那么就使用这个配置) Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-11-27
|
||||
*/
|
||||
@Mapper
|
||||
public interface LeaseGpuConfigMapper extends BaseMapper<LeaseGpuConfig> {
|
||||
/**
|
||||
* 批量插入或更新
|
||||
* @param gpuMessages
|
||||
* @return
|
||||
*/
|
||||
int insertOrUpdateBatchByGpuInfo(@Param("list") List<CoinAndAlgorithmDto> gpuMessages);
|
||||
|
||||
/**
|
||||
* 通过实体类批量插入或更新
|
||||
* @param leaseGpuConfigs
|
||||
* @return
|
||||
*/
|
||||
int insertOrUpdateBatchByEntity(@Param("list") List<LeaseGpuConfig> leaseGpuConfigs);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.m2pool.lease.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.m2pool.lease.dto.v2.*;
|
||||
import com.m2pool.lease.entity.LeaseMachineConfig;
|
||||
import com.m2pool.lease.vo.BaseVo;
|
||||
import com.m2pool.lease.vo.v2.CoinAndAlgorithmVo;
|
||||
import org.apache.ibatis.annotations.MapKey;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* GPU对应币种挖矿算力(只要gpu类型相同那么就使用这个配置) Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-11-27
|
||||
*/
|
||||
@Mapper
|
||||
public interface LeaseMachineConfigMapper extends BaseMapper<LeaseMachineConfig> {
|
||||
/**
|
||||
* 获取配置列表
|
||||
* @param coin
|
||||
* @param algorithm
|
||||
* @return
|
||||
*/
|
||||
List<MiningConfigSelectDto> getConfigList(@Param("coin") String coin,@Param("algorithm") String algorithm);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取矿机支持的币种和算法
|
||||
* @return
|
||||
*/
|
||||
List<CoinAndAlgorithmDto> getMachineSupportCoinAndAlgorithm(@Param("machineIds") List<BaseVo> machineIds);
|
||||
|
||||
|
||||
/**
|
||||
* 获取理论算力
|
||||
* @return
|
||||
*/
|
||||
List<MachineHashRateMapDto> getTheoryHashRate(@Param("list") List<OrderMiningInfoDto> orderMiningInfoDtoList);
|
||||
}
|
||||
165
src/main/java/com/m2pool/lease/mapper/LeaseMachineMapper.java
Normal file
165
src/main/java/com/m2pool/lease/mapper/LeaseMachineMapper.java
Normal file
@@ -0,0 +1,165 @@
|
||||
package com.m2pool.lease.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.m2pool.lease.dto.MachinePayTypeDto;
|
||||
import com.m2pool.lease.dto.v2.*;
|
||||
import com.m2pool.lease.entity.LeaseMachine;
|
||||
import com.m2pool.lease.vo.v2.SellerMachineVo;
|
||||
import com.m2pool.lease.vo.v2.ShopMachineVo;
|
||||
import org.apache.ibatis.annotations.MapKey;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* gpu类型出售矿机表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-11-21
|
||||
*/
|
||||
public interface LeaseMachineMapper extends BaseMapper<LeaseMachine> {
|
||||
|
||||
/**
|
||||
* 获取店铺ids
|
||||
* @return
|
||||
*/
|
||||
Set<Long> getShopIds();
|
||||
|
||||
/**
|
||||
* 根据id集合查询店铺信息
|
||||
* @return
|
||||
*/
|
||||
List<ShopInfoDto> getExistsMachineShop(@Param("ids") Set<Long> ids, @Param("coin") String coin , @Param("algorithm") String algorithm);
|
||||
|
||||
|
||||
/**
|
||||
* 获取店铺对应GPU或ASIC矿机信息
|
||||
* @param shopMachineVo
|
||||
* @return
|
||||
*/
|
||||
List<MachineInfoDto> getShopMachineList(@Param("shopMachineVo") ShopMachineVo shopMachineVo);
|
||||
|
||||
|
||||
/**
|
||||
* 根据id集合获取gpu配置信息
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
List<PowerIncomeInfoDto> getGpuConfigList(@Param("ids") List<Long> ids);
|
||||
|
||||
|
||||
/**
|
||||
* 获取店铺Gpu或Asic对应矿机信息
|
||||
* @param sellerMachineVo
|
||||
* @return
|
||||
*/
|
||||
List<SellerMachineInfoDto> getShopMachineListForSeller(@Param("sellerMachineVo") SellerMachineVo sellerMachineVo, @Param("shopId") Long shopId);
|
||||
|
||||
/**
|
||||
* 根据矿机id获取对应的矿机价格列表
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
List<MachinePayTypeDto> getMachinePriceList(@Param("list") List<SellerMachineInfoDto> ids);
|
||||
|
||||
|
||||
/**
|
||||
* 根据矿机id获取对应的矿机价格列表
|
||||
* @param machineIds
|
||||
* @return
|
||||
*/
|
||||
List<Long> getShopIdsByMachineIds(@Param("machineIds") List<Long> machineIds);
|
||||
|
||||
|
||||
/**
|
||||
* 获取购物车对应矿机信息
|
||||
* @param machineIds
|
||||
* @return
|
||||
*/
|
||||
List<CartMachineInfoDto> getMachinesByIds(@Param("machineIds") List<Long> machineIds);
|
||||
|
||||
|
||||
/**
|
||||
* 获取购物车对应矿机信息
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
List<AsicCoinAndAlgoDto> getCoinAndAlgoList(@Param("list") List<SellerMachineInfoDto> ids);
|
||||
|
||||
|
||||
/**
|
||||
* 修改gpu矿机售出状态
|
||||
* @param asicMachines
|
||||
* @return
|
||||
*/
|
||||
int updateLockState(@Param("list") List<LeaseMachine> asicMachines);
|
||||
|
||||
|
||||
/**
|
||||
* 修改asic 矿机售出数量
|
||||
* @param gpuMachines
|
||||
* @return
|
||||
*/
|
||||
int updateLockNumbers(@Param("list") List<LeaseMachine> gpuMachines);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 根据id 获取配置算法和币种
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@MapKey("id")
|
||||
Map<Long, MiningConfigDto> getCoinAndAlgoById(@Param("ids") List<Long> ids);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取矿机详情信息含临时信息
|
||||
* @param machineId
|
||||
* @return
|
||||
*/
|
||||
List<MachineConfigDto> getEffectMachineAndTempMachineList(@Param("machineId") Long machineId);
|
||||
|
||||
|
||||
/**
|
||||
* 获取租赁系统中支持的币种(挖矿软件支持 + 矿池支持的交集)
|
||||
* @return
|
||||
*/
|
||||
List<String> getSupportCoin();
|
||||
|
||||
|
||||
/**
|
||||
* 获取租赁系统中支持的算力(挖矿软件支持 + 矿池支持的交集)
|
||||
* @return
|
||||
*/
|
||||
List<String> getSupportAlgo(@Param("coin") String coin);
|
||||
|
||||
/**
|
||||
* 检测矿机是否能够上架
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@MapKey("machineId")
|
||||
Map<Long, MachineEffectDto> checkIsEffect(@Param("list") List<SellerMachineInfoDto> ids);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 批量修改矿机已售可售数量
|
||||
* @param list
|
||||
* @return
|
||||
*/
|
||||
boolean updateBatchSaleNumbers(@Param("list") List<LeaseMachine> list);
|
||||
|
||||
/**
|
||||
* 检测店铺下是否有已出售的矿机
|
||||
* @return
|
||||
*/
|
||||
int checkHasSaleMachineByShopId(@Param("shopId") Long shopId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.m2pool.lease.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.m2pool.lease.dto.MachinePayTypeDto;
|
||||
import com.m2pool.lease.entity.LeaseMachinePrice;
|
||||
import com.m2pool.lease.entity.LeaseProductMachinePrice;
|
||||
import com.m2pool.lease.vo.OrderInfoVo;
|
||||
import org.apache.ibatis.annotations.MapKey;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 商品表对应的物品机器表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-11-25
|
||||
*/
|
||||
@Mapper
|
||||
public interface LeaseMachinePriceMapper extends BaseMapper<LeaseMachinePrice> {
|
||||
/**
|
||||
* 获取机器价格通过id
|
||||
* @param machineIds
|
||||
* @return
|
||||
*/
|
||||
List<MachinePayTypeDto> getMachinePriceByMachineIds(@Param("list") List<Long> machineIds);
|
||||
|
||||
|
||||
/**
|
||||
* 获取订单总金额 按照chain 和 分组 coin -v2
|
||||
* @param orderInfoVoList
|
||||
* @return
|
||||
*/
|
||||
@MapKey("machineId")
|
||||
Map<Long, LeaseMachinePrice> getOrderTotalPriceGroupByChainAndCoin(@Param("list") List<OrderInfoVo> orderInfoVoList);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.m2pool.lease.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.m2pool.lease.entity.LeaseMachineConfig;
|
||||
import com.m2pool.lease.entity.LeaseMachineTempConfig;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* GPU对应币种挖矿算力临时表(主机gpu信息变更临时表) Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-12-09
|
||||
*/
|
||||
@Mapper
|
||||
public interface LeaseMachineTempConfigMapper extends BaseMapper<LeaseMachineTempConfig> {
|
||||
|
||||
/**
|
||||
* 批量插入
|
||||
* @param needUpdateInfo
|
||||
* @return
|
||||
*/
|
||||
int insertBatch(@Param("list") List<LeaseMachineConfig> needUpdateInfo);
|
||||
|
||||
/**
|
||||
* 批量插入
|
||||
* @param needUpdateInfo
|
||||
* @return
|
||||
*/
|
||||
int insertBatchByTempList(@Param("list") List<LeaseMachineTempConfig> needUpdateInfo);
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.m2pool.lease.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.m2pool.lease.dto.v2.CoinAndAlgorithmDto;
|
||||
import com.m2pool.lease.entity.LeaseMiningSoftwareConfig;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 挖矿软件公共配置表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-11-27
|
||||
*/
|
||||
@Mapper
|
||||
public interface LeaseMiningSoftwareConfigMapper extends BaseMapper<LeaseMiningSoftwareConfig> {
|
||||
/**
|
||||
* 查询支持的币种和算法
|
||||
* @param miningsofts
|
||||
* @return
|
||||
*/
|
||||
List<CoinAndAlgorithmDto> selectSupportAlgorithm(@Param("miningsofts") List<String> miningsofts,@Param("modelList") List<String> modelList);
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.m2pool.lease.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.m2pool.lease.dto.UserMinerDto;
|
||||
import com.m2pool.lease.entity.LeaseNexaMachineAvgPower;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 矿池nexa机器实时平均算力 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-29
|
||||
*/
|
||||
@Mapper
|
||||
public interface LeaseNexaMachineAvgPowerMapper extends BaseMapper<LeaseNexaMachineAvgPower> {
|
||||
|
||||
/**
|
||||
* 批量插入数据
|
||||
*
|
||||
* @param list
|
||||
* @return
|
||||
*/
|
||||
boolean insertBatchDatas(@Param("list") List<LeaseNexaMachineAvgPower> list);
|
||||
|
||||
/**
|
||||
* 根据用户和矿工查询数据
|
||||
*
|
||||
* @param userMinerList
|
||||
* @return
|
||||
*/
|
||||
List<LeaseNexaMachineAvgPower> selectListByUserAndMiner(@Param("list") List<UserMinerDto> userMinerList);
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.m2pool.lease.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.m2pool.lease.annotation.HashRateDB;
|
||||
import com.m2pool.lease.dto.ProductMachineDto;
|
||||
import com.m2pool.lease.entity.LeaseNexaMachinePower;
|
||||
import com.m2pool.lease.entity.LeaseProductMachine;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 已售商品矿工实时算力表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-25
|
||||
*/
|
||||
@Mapper
|
||||
public interface LeaseNexaMachinePowerMapper extends BaseMapper<LeaseNexaMachinePower> {
|
||||
|
||||
/**
|
||||
* 获取指定时间段内指定表内指定矿工的实时算力
|
||||
* @param leaseProductMachines
|
||||
* @param pointDate
|
||||
* @param tableName
|
||||
* @return
|
||||
*/
|
||||
@HashRateDB
|
||||
List<LeaseNexaMachinePower> getMachinePowerInHashRateById(@Param("leaseProductMachines") List<LeaseProductMachine> leaseProductMachines, @Param("pointDate")Date pointDate, @Param("tableName") String tableName);
|
||||
|
||||
/**
|
||||
* 获取3天内算力总和
|
||||
* @param leaseProductMachines
|
||||
* @param coin
|
||||
* @return
|
||||
*/
|
||||
@HashRateDB
|
||||
List<ProductMachineDto> getMachineThreePower(@Param("leaseProductMachines") List<LeaseProductMachine> leaseProductMachines, @Param("coin") String coin);
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.m2pool.lease.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.m2pool.lease.dto.OrderStatusDto;
|
||||
import com.m2pool.lease.entity.LeaseOrderFee;
|
||||
import com.m2pool.lease.entity.LeaseOrderItem;
|
||||
import com.m2pool.lease.entity.LeasePaymentRecord;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 订单明细表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Mapper
|
||||
public interface LeaseOrderFeeMapper extends BaseMapper<LeaseOrderFee> {
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.m2pool.lease.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.m2pool.lease.annotation.Pool2DB;
|
||||
import com.m2pool.lease.dto.OrderInfoDto;
|
||||
import com.m2pool.lease.entity.LeaseOrderInfo;
|
||||
import com.m2pool.lease.entity.LeaseUserOwnedProduct;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 订单表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Mapper
|
||||
public interface LeaseOrderInfoMapper extends BaseMapper<LeaseOrderInfo> {
|
||||
|
||||
/**
|
||||
* 根据订单状态查询订单(买家)
|
||||
*
|
||||
* @param status 订单状态
|
||||
* @return 订单列表
|
||||
*/
|
||||
List<OrderInfoDto> getOrdersByStatus(@Param("authId") Long authId, @Param("status") Integer status);
|
||||
|
||||
|
||||
/**
|
||||
* 根据订单状态查询订单(卖家)
|
||||
*
|
||||
* @param status 订单状态
|
||||
* @param ids 订单id集合
|
||||
* @return 订单列表
|
||||
*/
|
||||
List<OrderInfoDto> getOrdersByStatusForSeller( @Param("status") Integer status,@Param("ids") List<Long> ids);
|
||||
|
||||
/**
|
||||
* 根据机器id集合查看订单详情信息
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
List<LeaseUserOwnedProduct> getOrderItemsByMachineId(@Param("ids") List<Long> ids);
|
||||
|
||||
/**
|
||||
* 获取需要付款的订单列表 状态为7 订单进行中的订单
|
||||
* @return
|
||||
*/
|
||||
List<LeaseOrderInfo> getNeedPayOrderList();
|
||||
|
||||
@Pool2DB
|
||||
BigDecimal getCoinPrice(@Param("coin") String coin);
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
package com.m2pool.lease.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.m2pool.lease.dto.OrderStatusDto;
|
||||
import com.m2pool.lease.dto.v2.OrderTimeInfoDto;
|
||||
import com.m2pool.lease.entity.LeaseOrderItem;
|
||||
import com.m2pool.lease.entity.LeasePaymentRecord;
|
||||
import com.m2pool.lease.mq.message.RabbitmqPayAutoReturnInfoMessage;
|
||||
import org.apache.ibatis.annotations.MapKey;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.transaction.Transaction;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 订单明细表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Mapper
|
||||
public interface LeaseOrderItemMapper extends BaseMapper<LeaseOrderItem> {
|
||||
|
||||
/**
|
||||
* 获取订单状态为支付中的订单机器id
|
||||
*
|
||||
* @param list
|
||||
* @return
|
||||
*/
|
||||
List<Long> getMachineByOrderStatusIsPayInData(@Param("list") List<LeasePaymentRecord> list);
|
||||
|
||||
/**
|
||||
*通过订单详情id找到订单id
|
||||
* @param orderItemIds
|
||||
* @return
|
||||
*/
|
||||
List<Long> getOrderIds(@Param("orderItemIds") List<Long> orderItemIds);
|
||||
|
||||
|
||||
|
||||
List<OrderStatusDto> getOrderInfoStatus(@Param("orderIds") List<Long> orderIds);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 通过订单详情id找到订单id
|
||||
* @param itemIds
|
||||
* @return
|
||||
*/
|
||||
List<Long> selectOrderInfoIds(@Param("itemIds") Set<Long> itemIds);
|
||||
|
||||
|
||||
/**
|
||||
* 获取需要更新已实际支付总金额的订单详情
|
||||
* @param address
|
||||
* @param transaction
|
||||
* @return
|
||||
*/
|
||||
List<LeaseOrderItem> getNeedUpdateOrderItem(@Param("orderId") Long orderId);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 通过订单id找到订单详情
|
||||
* @param orderIds
|
||||
* @return
|
||||
*/
|
||||
List<LeaseOrderItem> getOrderItemByOrderIds(@Param("orderIds") Set<Long> orderIds);
|
||||
|
||||
|
||||
/**
|
||||
* 获取订单详情id
|
||||
* @return
|
||||
*/
|
||||
List<OrderTimeInfoDto> getOneDayApartOrder();
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
package com.m2pool.lease.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.m2pool.lease.annotation.MiningDB;
|
||||
import com.m2pool.lease.dto.v2.*;
|
||||
import com.m2pool.lease.entity.LeaseOrderMining;
|
||||
import com.m2pool.lease.netty.message.ClientConfigurationMining;
|
||||
import org.apache.ibatis.annotations.MapKey;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 挖矿中订单 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-12-02
|
||||
*/
|
||||
@Mapper
|
||||
public interface LeaseOrderMiningMapper extends BaseMapper<LeaseOrderMining> {
|
||||
/**
|
||||
* 批量插入
|
||||
*
|
||||
* @param orderMiningList
|
||||
* @return
|
||||
*/
|
||||
int insertBatch(@Param("list") List<LeaseOrderMining> orderMiningList);
|
||||
|
||||
|
||||
/**
|
||||
* 获取矿池正在挖矿中的信息
|
||||
*
|
||||
* @param clientConfigurationMining
|
||||
* @return
|
||||
*/
|
||||
int updateOrderMining(@Param("userEmail") String userEmail,@Param("clientConfigurationMining") ClientConfigurationMining clientConfigurationMining);
|
||||
|
||||
/**
|
||||
* 获取用户购买的机器列表
|
||||
* @param authId
|
||||
* @return
|
||||
*/
|
||||
List<PurchasedMachineListDto> getPurchasedItems(@Param("authId") Long authId);
|
||||
|
||||
/**
|
||||
* 根据id获取用户购买的机器信息
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
MiningConfigInfoDto getPurchasedInfo(@Param("id") Long id);
|
||||
|
||||
|
||||
/**
|
||||
* 获取最近一次的算力
|
||||
* @param list
|
||||
* @return
|
||||
*/
|
||||
@MiningDB
|
||||
@MapKey("miner")
|
||||
Map<String,MiningHashrateInfoDto> getRecentlyHashrate(@Param("pool") String pool,@Param("wallet") String wallet,@Param("coin") String coin,@Param("list") List<PurchasedMachineDto> list);
|
||||
|
||||
|
||||
/**
|
||||
* 获取最近24小时的算力
|
||||
* @return
|
||||
*/
|
||||
@MiningDB
|
||||
List<RealHashrateInfoDto> getRecently24HourHashrate(@Param("list") List<PurchasedMachineListDto> list,@Param("tableName") String tableName,@Param("now") Date now);
|
||||
|
||||
|
||||
/**
|
||||
* 根据orderId集合获取挖矿中的信息
|
||||
* @param orderIds
|
||||
* @return
|
||||
*/
|
||||
List<PurchasedMachineListDto> getMiningInfoByOrderId(@Param("orderIds") List<Long> orderIds);
|
||||
|
||||
|
||||
/**
|
||||
* 检查是否存在挖矿中矿工
|
||||
* @param list
|
||||
* @return
|
||||
*/
|
||||
List<OrderMiningInfoDto> checkMiningMinersExist(@Param("list") List<OrderMiningInfoDto> list);
|
||||
|
||||
|
||||
/**
|
||||
* 获取用户购买的矿机信息
|
||||
* @param info
|
||||
* @return
|
||||
*/
|
||||
List<PurchasedMachineDto> getPurchasedMachineInfo(@Param("info") MiningConfigInfoDto info);
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package com.m2pool.lease.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.m2pool.lease.dto.*;
|
||||
import com.m2pool.lease.entity.LeasePayRechargeMessage;
|
||||
import com.m2pool.lease.entity.LeaseUserWalletData;
|
||||
import org.apache.ibatis.annotations.MapKey;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 充值业务mapper层
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-09-10
|
||||
*/
|
||||
@Mapper
|
||||
public interface LeasePayRechargeMessageMapper extends BaseMapper<LeasePayRechargeMessage> {
|
||||
|
||||
/**
|
||||
* 获取充值记录列表
|
||||
*
|
||||
* @param walletList 钱包集合
|
||||
* @param status
|
||||
* @return
|
||||
*/
|
||||
@Deprecated
|
||||
List<PayRechargeMessageDto> balanceRechargeList(@Param("walletList") List<LeaseUserWalletData> walletList, @Param("status") Integer status);
|
||||
|
||||
/**
|
||||
* 获取近半年是否有充值记录
|
||||
*
|
||||
* @param fromAddress
|
||||
* @return
|
||||
*/
|
||||
boolean checkRechargeOperator(@Param("fromAddress") String fromAddress);
|
||||
|
||||
/**
|
||||
* 批量获取近半年是否有充值记录
|
||||
*
|
||||
* @param fromAddressList
|
||||
* @return
|
||||
*/
|
||||
@MapKey("fromAddress")
|
||||
Map<String, CheckAddressDto> checkRechargeOperatorBatch(@Param("list") List<LeaseUserWalletData> fromAddressList);
|
||||
|
||||
/**
|
||||
* 交易流水---充值
|
||||
*
|
||||
* @param walletList
|
||||
* @return
|
||||
*/
|
||||
List<TransactionRecordDto> transactionRecord(@Param("walletList") List<LeaseUserWalletData> walletList);
|
||||
|
||||
|
||||
/**
|
||||
* 最近交易
|
||||
*
|
||||
* @param walletList
|
||||
* @return
|
||||
*/
|
||||
List<RecentlyTransactionDto> getRecentlyTransaction(@Param("walletList") List<LeaseUserWalletData> walletList);
|
||||
|
||||
/**
|
||||
* 根据唯一索引修改或删除
|
||||
*
|
||||
* @param leasePayRechargeMessage
|
||||
* @return
|
||||
*/
|
||||
int saveOrUpdateByIndex(@Param("leasePayRechargeMessage") LeasePayRechargeMessage leasePayRechargeMessage);
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.m2pool.lease.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.m2pool.lease.dto.CheckAddressDto;
|
||||
import com.m2pool.lease.dto.PayRecordMessageDto;
|
||||
import com.m2pool.lease.dto.RecentlyTransactionDto;
|
||||
import com.m2pool.lease.dto.TransactionRecordDto;
|
||||
import com.m2pool.lease.entity.LeasePayRecordMessage;
|
||||
import com.m2pool.lease.entity.LeasePayRecordMessageInfo;
|
||||
import com.m2pool.lease.entity.LeaseShopConfig;
|
||||
import com.m2pool.lease.entity.LeaseUserWalletData;
|
||||
import org.apache.ibatis.annotations.MapKey;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* LeasePayRecordMessageMapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-09-10
|
||||
*/
|
||||
@Mapper
|
||||
public interface LeasePayRecordMessageInfoMapper extends BaseMapper<LeasePayRecordMessageInfo> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
package com.m2pool.lease.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.m2pool.lease.dto.*;
|
||||
import com.m2pool.lease.entity.LeasePayRecordMessage;
|
||||
import com.m2pool.lease.entity.LeaseShopConfig;
|
||||
import com.m2pool.lease.entity.LeaseUserWalletData;
|
||||
import org.apache.ibatis.annotations.MapKey;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* LeasePayRecordMessageMapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-09-10
|
||||
*/
|
||||
@Mapper
|
||||
public interface LeasePayRecordMessageMapper extends BaseMapper<LeasePayRecordMessage> {
|
||||
/**
|
||||
* 检查用户半年内是否有支付操作
|
||||
* @param fromAddress
|
||||
* @return
|
||||
*/
|
||||
boolean checkPayOperator(@Param("fromAddress") String fromAddress);
|
||||
|
||||
|
||||
/**
|
||||
* 检查用户批量是否有支付操作
|
||||
* @param fromAddressList
|
||||
* @return
|
||||
*/
|
||||
@MapKey("fromAddress")
|
||||
Map<String, CheckAddressDto> checkPayOperatorBatch(@Param("list") List<LeaseUserWalletData> fromAddressList);
|
||||
|
||||
/**
|
||||
* 批量查询用户余额支付列表
|
||||
* @param walletList
|
||||
* @param status
|
||||
* @return
|
||||
*/
|
||||
|
||||
List<PayRecordMessageDto> balancePayList(@Param("walletList") List<LeaseShopConfig> walletList, @Param("status") Integer status);
|
||||
|
||||
/**
|
||||
* 交易流水---支付
|
||||
* @param walletList
|
||||
* @return
|
||||
*/
|
||||
List<TransactionRecordDto> transactionRecord(@Param("walletList") List<LeaseUserWalletData> walletList);
|
||||
|
||||
|
||||
/**
|
||||
* 最近交易
|
||||
* @param walletList
|
||||
* @return
|
||||
*/
|
||||
List<RecentlyTransactionDto> getRecentlyTransaction(@Param("walletList") List<LeaseUserWalletData> walletList);
|
||||
|
||||
|
||||
/**
|
||||
* 保存或者更新根据txHash
|
||||
* @param leasePayRecordMessage
|
||||
* @return
|
||||
*/
|
||||
int updateByTxHash(@Param("leasePayRecordMessage") LeasePayRecordMessage leasePayRecordMessage,@Param("txHash") String txHash);
|
||||
|
||||
/**
|
||||
* 根据订单id获取队列id
|
||||
* @param infoIds
|
||||
* @return
|
||||
*/
|
||||
@MapKey("orderId")
|
||||
Map<Long,LeasePayRecordMessage> getQueueIdByInfoIds(@Param("infoIds") List<Long> infoIds);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
package com.m2pool.lease.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.m2pool.lease.dto.*;
|
||||
import com.m2pool.lease.dto.v2.PayWithdrawSellerRecordDto;
|
||||
import com.m2pool.lease.entity.LeasePayWithdrawMessage;
|
||||
import com.m2pool.lease.entity.LeaseUserWalletData;
|
||||
import org.apache.ibatis.annotations.MapKey;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 提现mapper层
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-09-10
|
||||
*/
|
||||
@Mapper
|
||||
public interface LeasePayWithdrawMessageMapper extends BaseMapper<LeasePayWithdrawMessage> {
|
||||
|
||||
/**
|
||||
* 获取提现记录列表
|
||||
*
|
||||
* @param walletList 钱包集合
|
||||
* @param status
|
||||
* @return
|
||||
*/
|
||||
@Deprecated
|
||||
List<PayWithdrawMessageDto> balanceWithdrawList(@Param("walletList") List<LeaseUserWalletData> walletList,
|
||||
@Param("status") Integer status);
|
||||
|
||||
|
||||
/**
|
||||
* 检查用户半年内是否有提现操作
|
||||
* @param fromAddress
|
||||
* @return
|
||||
*/
|
||||
boolean checkWithdrawOperator(@Param("fromAddress") String fromAddress);
|
||||
|
||||
|
||||
/**
|
||||
* 检查用户半年内是否有提现操作
|
||||
* @param fromAddressList
|
||||
* @return
|
||||
*/
|
||||
@MapKey("fromAddress")
|
||||
Map<String, CheckAddressDto> checkWithdrawOperatorBatch(@Param("list") List<LeaseUserWalletData> fromAddressList);
|
||||
|
||||
/**
|
||||
* 交易流水---提现
|
||||
*
|
||||
* @param walletList
|
||||
* @return
|
||||
*/
|
||||
List<TransactionRecordDto> transactionRecord(@Param("walletList") List<LeaseUserWalletData> walletList);
|
||||
|
||||
/**
|
||||
* 最近交易
|
||||
*
|
||||
* @param walletList
|
||||
* @return
|
||||
*/
|
||||
List<RecentlyTransactionDto> getRecentlyTransaction(@Param("walletList") List<LeaseUserWalletData> walletList);
|
||||
|
||||
|
||||
/**
|
||||
* 获取最近一条数据的提现状态
|
||||
*
|
||||
* @param fromAddress
|
||||
* @return
|
||||
*/
|
||||
Integer getRecentlyOneData(@Param("fromAddress") String fromAddress,@Param("chain")String chain);
|
||||
|
||||
|
||||
/**
|
||||
* 获取商户提现记录
|
||||
*
|
||||
* @param shopId
|
||||
* @return
|
||||
*/
|
||||
List<PayWithdrawSellerRecordDto> getSellerWithdrawRecord(@Param("shopId") Long shopId);
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.m2pool.lease.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.m2pool.lease.mq.message.RabbitmqOrderMessage;
|
||||
import com.m2pool.lease.entity.LeasePaymentRecord;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 支付记录表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Mapper
|
||||
public interface LeasePaymentRecordMapper extends BaseMapper<LeasePaymentRecord> {
|
||||
|
||||
/**
|
||||
* 检查订单支付状态
|
||||
*
|
||||
* @param message
|
||||
* @return
|
||||
*/
|
||||
List<LeasePaymentRecord> checkPaymentRecordStatus(@Param("list") List<RabbitmqOrderMessage> message);
|
||||
|
||||
/**
|
||||
* 批量更新订单支付状态
|
||||
*
|
||||
* @param list
|
||||
* @return
|
||||
*/
|
||||
int updateBatchStatusForOderIdAndShopId(@Param("list") List<LeasePaymentRecord> list);
|
||||
|
||||
|
||||
/**
|
||||
* 查询最近15分钟处于支付中的订单
|
||||
* @return
|
||||
*/
|
||||
List<LeasePaymentRecord> getIsPayInData();
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.m2pool.lease.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.m2pool.lease.entity.LeaseProductIncome;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 商品收益表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Mapper
|
||||
public interface LeaseProductIncomeMapper extends BaseMapper<LeaseProductIncome> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,155 @@
|
||||
package com.m2pool.lease.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.m2pool.lease.annotation.Pool2DB;
|
||||
import com.m2pool.lease.dto.*;
|
||||
import com.m2pool.lease.entity.LeaseProductMachine;
|
||||
import com.m2pool.lease.vo.ProductMachineVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 商品表对应的物品机器表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Mapper
|
||||
public interface LeaseProductMachineMapper extends BaseMapper<LeaseProductMachine> {
|
||||
|
||||
|
||||
/**
|
||||
* 获取当前账户对应的挖矿账户
|
||||
*
|
||||
* @param userId 账户ID
|
||||
* @return 挖矿账户集合
|
||||
*/
|
||||
@Pool2DB
|
||||
List<UserMinerDto> getUserMinersList(@Param("userId") String userId, @Param("coin") String coin);
|
||||
|
||||
/**
|
||||
* 根据机器ID集合获取机器信息
|
||||
*
|
||||
* @param machineIds 机器ID集合
|
||||
* @return 机器信息集合
|
||||
*/
|
||||
List<ProductMachineDto> getMachinesByIds(@Param("machineIds") List<Long> machineIds);
|
||||
|
||||
/**
|
||||
* 创建订单业务----修改乐观锁(sale_state 改为 2 售出中)
|
||||
* @param machineIds
|
||||
* @return
|
||||
*/
|
||||
int updateLockState(@Param("machineIds") List<Long> machineIds);
|
||||
|
||||
/**
|
||||
* 获取当前账户对应的挖矿账户的机器矿工集合 (1天内有过算力的才能上架)
|
||||
*
|
||||
* @param user 账户ID
|
||||
* @param coin 币种
|
||||
* @return 挖矿账户的机器矿工集合
|
||||
*/
|
||||
@Pool2DB
|
||||
List<UserMinerDto> getMinerMachines(@Param("user") String user, @Param("coin") String coin);
|
||||
|
||||
/**
|
||||
* 获取当前账户对应的挖矿账户的已经上架正在售出或已售出的机器矿工
|
||||
*
|
||||
* @param user 账户ID
|
||||
* @param coin 币种
|
||||
* @return 挖矿账户的机器矿工集合
|
||||
*/
|
||||
List<String> getMinerMachinesIsSale(@Param("user") String user, @Param("coin") String coin);
|
||||
|
||||
/**
|
||||
* 获取商品价格范围
|
||||
*
|
||||
* @param productId 商品ID
|
||||
* @return 商品价格范围
|
||||
*/
|
||||
PriceDto getPriceRange(@Param("productId") Long productId);
|
||||
|
||||
|
||||
@Pool2DB
|
||||
List<ProductMachineDto> getRecentlyFiveMinutesData(@Param("leaseProductMachines") List<LeaseProductMachine> leaseProductMachines, @Param("coin") String coin);
|
||||
|
||||
|
||||
|
||||
int saveOrUpdateBatchs(@Param("leaseProductMachines") List<LeaseProductMachine> leaseProductMachines);
|
||||
|
||||
|
||||
/**
|
||||
* 检测当前商铺是否有已售出机器
|
||||
*
|
||||
* @param shopId 商家ID
|
||||
* @return 检测结果
|
||||
*/
|
||||
int checkHasSaleMachineByShopId(@Param("shopId") Long shopId);
|
||||
|
||||
/**
|
||||
* 检测当前商品是否存在已售出机器
|
||||
*
|
||||
* @param productId 商品ID
|
||||
* @return 检测结果
|
||||
*/
|
||||
int checkHasSaleMachineByProductId(@Param("productId") Long productId);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取机器售价列表
|
||||
*
|
||||
* @param machineIds 机器ID集合
|
||||
* @return 机器价格列表
|
||||
*/
|
||||
List<MachinePayTypeDto> getPriceList(@Param("list")List<Long> machineIds);
|
||||
|
||||
|
||||
/**
|
||||
* 查询绑定新钱包后,已存在的商品矿机
|
||||
*
|
||||
* @param shopId 店铺id
|
||||
* @return 商品列表
|
||||
*/
|
||||
List<ProductMachineForWalletConfigDto> getProductListForShopWalletConfig(@Param("shopId")Long shopId);
|
||||
|
||||
|
||||
/**
|
||||
* 获取商品对应的机器ID集合
|
||||
*
|
||||
* @param productId 商品ID
|
||||
* @return 机器ID集合
|
||||
*/
|
||||
List<Long> getIdsForProductId(@Param("productId")Long productId);
|
||||
|
||||
|
||||
/**
|
||||
* 获取店铺对应的机器ID集合
|
||||
*
|
||||
* @param productId 商品ID
|
||||
* @return 机器ID集合
|
||||
*/
|
||||
List<Long> getIdsForShopId(@Param("shopId")Long shopId);
|
||||
|
||||
/**
|
||||
* 根据价格范围,功耗范围,算力范围 获取商品对应的机器
|
||||
*
|
||||
* @param productMachineVo 商品参数
|
||||
* @return 机器列表
|
||||
*/
|
||||
List<ProductMachineDto> getMachinesByPriceAndPowerAndDissipation(@Param("productMachineVo") ProductMachineVo productMachineVo,@Param("coin") String coin);
|
||||
|
||||
|
||||
/**
|
||||
* 批量插入机器算力数据
|
||||
*
|
||||
* @param list 机器算力数据
|
||||
* @return 插入结果
|
||||
*/
|
||||
int batchInsertPowers(@Param("coin")String coin,@Param("list")List<ProductMachineDto> list);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.m2pool.lease.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.m2pool.lease.dto.MachinePayTypeDto;
|
||||
import com.m2pool.lease.entity.LeaseOrderItem;
|
||||
import com.m2pool.lease.entity.LeaseProductMachinePrice;
|
||||
import com.m2pool.lease.vo.OrderInfoVo;
|
||||
import org.apache.ibatis.annotations.MapKey;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 商品表对应的物品机器表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Mapper
|
||||
public interface LeaseProductMachinePriceMapper extends BaseMapper<LeaseProductMachinePrice> {
|
||||
|
||||
/**
|
||||
* 获取订单总金额 按照chain 和 分组 coin
|
||||
* @param orderInfoVoList
|
||||
* @return
|
||||
*/
|
||||
@MapKey("productMachineId")
|
||||
Map<Long,LeaseProductMachinePrice> getOrderTotalPriceGroupByChainAndCoin(@Param("list") List<OrderInfoVo> orderInfoVoList);
|
||||
|
||||
|
||||
/**
|
||||
* 获取机器价格通过id
|
||||
* @param machineIds
|
||||
* @return
|
||||
*/
|
||||
List<MachinePayTypeDto> getMachinePriceByMachineIds(@Param("list") List<Long> machineIds);
|
||||
|
||||
@MapKey("productMachineId")
|
||||
Map<Long,LeaseProductMachinePrice> getPriceByOrderItems(@Param("list") List<LeaseOrderItem> orderInfoVoList);
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package com.m2pool.lease.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.m2pool.lease.annotation.Pool2DB;
|
||||
import com.m2pool.lease.dto.PayTypeDto;
|
||||
import com.m2pool.lease.dto.ProductDto;
|
||||
import com.m2pool.lease.dto.ProductForWalletConfigDto;
|
||||
import com.m2pool.lease.entity.LeaseProduct;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 商品表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Mapper
|
||||
public interface LeaseProductMapper extends BaseMapper<LeaseProduct> {
|
||||
|
||||
/**
|
||||
* 获取近三天币种对应的全网算力
|
||||
* @param coin
|
||||
* @return
|
||||
*/
|
||||
@Pool2DB
|
||||
BigDecimal getCoinNetPower(@Param("coin") String coin);
|
||||
|
||||
|
||||
/**
|
||||
* 获取近三天的全网实际报块数
|
||||
* @param coin
|
||||
* @return
|
||||
*/
|
||||
@Pool2DB
|
||||
BigDecimal getNetBlocks(@Param("coin") String coin);
|
||||
|
||||
|
||||
/**
|
||||
* 获取商品列表(弃用)
|
||||
* @param coin
|
||||
* @param algorithm
|
||||
* @return
|
||||
*/
|
||||
List<ProductDto> getProductList(@Param("coin") String coin , @Param("algorithm") String algorithm);
|
||||
|
||||
|
||||
/**
|
||||
* 用户个人中心 和 首页商城 商品列表获取
|
||||
* @param coin 用于商城首页
|
||||
* @param algorithm 用于商城首页
|
||||
* @param shopId 用于个人中心商品列表
|
||||
* @return
|
||||
*/
|
||||
List<ProductDto> getProductListForShopAndUserCenter(@Param("coin") String coin , @Param("algorithm") String algorithm,@Param("shopId") Long shopId);
|
||||
|
||||
/**
|
||||
* 获取支持的支付方式
|
||||
* @param shopId
|
||||
* @return
|
||||
*/
|
||||
List<PayTypeDto> getSupportPayType(@Param("shopId")Long shopId);
|
||||
|
||||
|
||||
/**
|
||||
* 获取商品列表(用于钱包配置)
|
||||
* @param shopId
|
||||
* @return
|
||||
*/
|
||||
List<ProductForWalletConfigDto> getProductListForShopWalletConfig(@Param("shopId")Long shopId);
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.m2pool.lease.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.m2pool.lease.entity.LeaseShopAddressConfig;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface LeaseShopAddressConfigMapper extends BaseMapper<LeaseShopAddressConfig> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package com.m2pool.lease.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.m2pool.lease.dto.*;
|
||||
import com.m2pool.lease.dto.v2.ShopWalletInfoDto;
|
||||
import com.m2pool.lease.entity.LeasePayRecordMessage;
|
||||
import com.m2pool.lease.entity.LeaseShopConfig;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 店铺商品配置表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-08-05
|
||||
*/
|
||||
public interface LeaseShopConfigMapper extends BaseMapper<LeaseShopConfig> {
|
||||
/**
|
||||
* 获取链和币种
|
||||
* @return
|
||||
*/
|
||||
List<CoinFullDto> getChainAndList(@Param("chain") String chain);
|
||||
|
||||
List<CoinFullDto> getChainAndListForSeller(@Param("shopId") Long shopId);
|
||||
|
||||
/**
|
||||
* 更具链名称和币种名称获取币种图标
|
||||
* @param chain
|
||||
* @param coinList
|
||||
* @return
|
||||
*/
|
||||
List<LeaseShopConfig> getCoinIconByChainAndCoin(@Param("chain") String chain, @Param("coinList") List<String> coinList);
|
||||
|
||||
/**
|
||||
* 根据店铺id和链名称和币种获取店铺配置(包含已删除的配置)
|
||||
* @param list
|
||||
* @return
|
||||
*/
|
||||
List<ShopConfigDelDto> selectShopConfigByShopIdAndSymbolAndChain(@Param("list") List<ShopChainAndCoinDto> list);
|
||||
|
||||
/**
|
||||
* 获取店铺支持的支付方式
|
||||
* @param shopIds
|
||||
* @return
|
||||
*/
|
||||
List<PayTypeDto> getPayType(@Param("list") List<Long> shopIds);
|
||||
|
||||
/**
|
||||
* 获取店铺钱包信息
|
||||
* @param shopId
|
||||
* @return
|
||||
*/
|
||||
List<ShopWalletInfoDto> getShopWalletInfoList(@Param("shopId") Long shopId);
|
||||
|
||||
|
||||
/**
|
||||
* 获取店铺钱包信息
|
||||
* @param shopId
|
||||
* @return
|
||||
*/
|
||||
ShopWalletInfoDto getShopWalletInfo(@Param("shopId") Long shopId,@Param("address") String address,@Param("chain") String chain,@Param("coin") String coin);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 根据支付记录修改余额
|
||||
* @param reocrdList 钱包信息
|
||||
* @return 更新数量
|
||||
*/
|
||||
int updateBalance(@Param("list") List<LeasePayRecordMessage> reocrdList);
|
||||
}
|
||||
65
src/main/java/com/m2pool/lease/mapper/LeaseShopMapper.java
Normal file
65
src/main/java/com/m2pool/lease/mapper/LeaseShopMapper.java
Normal file
@@ -0,0 +1,65 @@
|
||||
package com.m2pool.lease.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.m2pool.lease.dto.ChainAndCoinDto;
|
||||
import com.m2pool.lease.dto.PayConfigDto;
|
||||
import com.m2pool.lease.entity.LeaseShop;
|
||||
import com.m2pool.lease.entity.LeaseShopConfig;
|
||||
import org.apache.ibatis.annotations.MapKey;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 店铺表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-08-05
|
||||
*/
|
||||
@Mapper
|
||||
public interface LeaseShopMapper extends BaseMapper<LeaseShop> {
|
||||
|
||||
/**
|
||||
* 获取买家自定义的支付地址和支付币种和链
|
||||
* @param chainAndCoinSet
|
||||
* @return
|
||||
*/
|
||||
List<LeaseShopConfig> getPayAddressAndPayCoin(@Param("chainAndCoinSet") Set<ChainAndCoinDto> chainAndCoinSet);
|
||||
|
||||
|
||||
/**
|
||||
* 获取单个店铺钱包信息
|
||||
* @param shopId
|
||||
* @return
|
||||
*/
|
||||
List<PayConfigDto> getShopWalletInfo(@Param("shopId") Long shopId);
|
||||
|
||||
|
||||
/**
|
||||
* 获取多个店铺钱包信息
|
||||
* @param shopIds
|
||||
* @return
|
||||
*/
|
||||
List<PayConfigDto> getShopWalletInfoList(@Param("shopIds") List<Long> shopIds);
|
||||
|
||||
|
||||
/**
|
||||
* 根据商品id集合获取店铺id集合
|
||||
* @param machineIds
|
||||
* @return
|
||||
*/
|
||||
List<Long> getShopIdsByMachineIds(@Param("machineIds") List<Long> machineIds);
|
||||
|
||||
/**
|
||||
* 根据店铺id集合获取店铺名称
|
||||
* @param shopIds
|
||||
* @return
|
||||
*/
|
||||
@MapKey("id")
|
||||
Map<Long,LeaseShop> getShopNameMapByIds(@Param("shopIds") List<Long> shopIds);
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.m2pool.lease.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.m2pool.lease.dto.ShoppingCartInfoDto;
|
||||
import com.m2pool.lease.entity.LeaseShoppingCartInfo;
|
||||
import com.m2pool.lease.vo.ProductAndMachineVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 购物车详情表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-24
|
||||
*/
|
||||
@Mapper
|
||||
public interface LeaseShoppingCartInfoMapper extends BaseMapper<LeaseShoppingCartInfo> {
|
||||
|
||||
/**
|
||||
* 查询购物车详情列表
|
||||
* @return
|
||||
*/
|
||||
List<ShoppingCartInfoDto> getProductAndMachineIds(@Param("userId") String userId, @Param("version") Integer version);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 批量删除购物车详情数据
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
int deleteBatchData(@Param("ids") List<Long> ids);
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.m2pool.lease.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.m2pool.lease.entity.LeaseShoppingCart;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 购物车表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Mapper
|
||||
public interface LeaseShoppingCartMapper extends BaseMapper<LeaseShoppingCart> {
|
||||
|
||||
}
|
||||
71
src/main/java/com/m2pool/lease/mapper/LeaseUserMapper.java
Normal file
71
src/main/java/com/m2pool/lease/mapper/LeaseUserMapper.java
Normal file
@@ -0,0 +1,71 @@
|
||||
package com.m2pool.lease.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.m2pool.lease.entity.GoogleInfo;
|
||||
import com.m2pool.lease.entity.LeaseUser;
|
||||
import com.m2pool.lease.vo.v2.UserGoogleAuthInfo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Mapper
|
||||
public interface LeaseUserMapper extends BaseMapper<LeaseUser> {
|
||||
/**
|
||||
* 获取谷歌验证相关信息
|
||||
* @param email
|
||||
* @return
|
||||
*/
|
||||
GoogleInfo getGoogleInfoByEmail(@Param("email") String email);
|
||||
|
||||
/**
|
||||
* 验证码是否已存在
|
||||
* @param secret
|
||||
* @return
|
||||
*/
|
||||
boolean checkSecretIfExist(@Param("secret") String secret);
|
||||
|
||||
/**
|
||||
* 获取用户谷歌验证码相关信息(包括密码)
|
||||
* @param email
|
||||
* @return
|
||||
*/
|
||||
UserGoogleAuthInfo getUserInfoByEmail(@Param("email") String email);
|
||||
|
||||
|
||||
/**
|
||||
* 绑定谷歌验证码
|
||||
* @param info
|
||||
* @return
|
||||
*/
|
||||
boolean bingGoogleAuthenticator(@Param("info") UserGoogleAuthInfo info);
|
||||
|
||||
|
||||
/**
|
||||
* 关闭谷歌验证码
|
||||
* @param info
|
||||
* @return
|
||||
*/
|
||||
boolean closeGoogleAuthenticator(@Param("info") UserGoogleAuthInfo info);
|
||||
|
||||
|
||||
/**
|
||||
* 验证用户是否已绑定谷歌验证码
|
||||
* @param email
|
||||
* @return
|
||||
*/
|
||||
Integer checkIfBindByEmail(@Param("email") String email);
|
||||
|
||||
/**
|
||||
* 开启谷歌验证码
|
||||
* @param info
|
||||
* @return
|
||||
*/
|
||||
boolean openGoogleAuthenticator(@Param("info") UserGoogleAuthInfo info);
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.m2pool.lease.mapper;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.m2pool.lease.annotation.Pool2DB;
|
||||
import com.m2pool.lease.dto.HourIncomeDto;
|
||||
import com.m2pool.lease.dto.UserMinerDto;
|
||||
import com.m2pool.lease.dto.UserMinerPowerDto;
|
||||
import com.m2pool.lease.entity.LeaseUserOwnedProduct;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户拥有商品详情表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Mapper
|
||||
public interface LeaseUserOwnedProductMapper extends BaseMapper<LeaseUserOwnedProduct> {
|
||||
/**
|
||||
* 获取已生效商品机器id集合
|
||||
* @param beginOfDay
|
||||
* @return
|
||||
*/
|
||||
List<Long> getProductMachineIds(@Param("beginOfDay") DateTime beginOfDay);
|
||||
|
||||
|
||||
/**
|
||||
* 获取小时收益列表
|
||||
* @param coin
|
||||
* @param start
|
||||
* @param end
|
||||
* @return
|
||||
*/
|
||||
@Pool2DB
|
||||
List<HourIncomeDto> getHourIncomeList(@Param("list") List<LeaseUserOwnedProduct> list,@Param("coin") String coin, @Param("start") LocalDateTime start, @Param("end") LocalDateTime end);
|
||||
|
||||
|
||||
/**
|
||||
* 批量更新收益
|
||||
* @param list
|
||||
* @return
|
||||
*/
|
||||
int updateBatchIncome(@Param("list") List<LeaseUserOwnedProduct> list);
|
||||
|
||||
|
||||
/**
|
||||
* 获取矿机实时算力(30m)
|
||||
* @param list
|
||||
* @param coin
|
||||
* @return
|
||||
*/
|
||||
@Pool2DB
|
||||
List<UserMinerPowerDto> getUserMinerPower(@Param("list")List<UserMinerDto> list,@Param("coin") String coin);
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.m2pool.lease.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.m2pool.lease.dto.ChainAndCoinDto;
|
||||
import com.m2pool.lease.dto.UserWalletDataDto;
|
||||
import com.m2pool.lease.entity.LeasePayRecordMessage;
|
||||
import com.m2pool.lease.entity.LeaseUserWalletData;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
@Mapper
|
||||
public interface LeaseUserWalletDataMapper extends BaseMapper<LeaseUserWalletData> {
|
||||
|
||||
/**
|
||||
* 根据用户 ID 查询钱包信息
|
||||
* @param authId 用户 ID
|
||||
* @return 钱包信息
|
||||
*/
|
||||
List<UserWalletDataDto> selectByUserId(@Param("authId") Long authId);
|
||||
|
||||
/**
|
||||
* 根据钱包地址查询钱包信息
|
||||
* @param address 钱包地址
|
||||
* @return 钱包信息
|
||||
*/
|
||||
UserWalletDataDto getWalletInfoByAddress(@Param("address") String address,@Param("symbol") String symbol,@Param("userId") String userId);
|
||||
|
||||
/**
|
||||
* 根据链查询钱包信息
|
||||
* @param chain 链
|
||||
* @return 钱包信息
|
||||
*/
|
||||
List<UserWalletDataDto> getWalletInfoByChain(@Param("chain") String chain,@Param("authId") Long authId);
|
||||
|
||||
|
||||
/**
|
||||
* 获取余额为 不为0 的钱包地址
|
||||
* @param chain 链
|
||||
* @return 钱包地址
|
||||
*/
|
||||
List<LeaseUserWalletData> getWalletForBalanceIsZero(@Param("list") List<UserWalletDataDto> addressList);
|
||||
|
||||
/**
|
||||
* 根据链和币种查询钱包信息
|
||||
* @param chainAndCoinSet 链和币种
|
||||
* @return 钱包信息
|
||||
*/
|
||||
List<LeaseUserWalletData> selectWalletByChainAndCoinAndUsername(@Param("list") Set<ChainAndCoinDto> chainAndCoinSet,@Param("authId") Long authId);
|
||||
|
||||
|
||||
/**
|
||||
* 根据支付记录修改余额及冻结余额
|
||||
* @param reocrdList 钱包信息
|
||||
* @return 更新数量
|
||||
*/
|
||||
int updateBalanceAndBlockBalance(@Param("list") List<LeasePayRecordMessage> reocrdList);
|
||||
}
|
||||
Reference in New Issue
Block a user