添加全局配置代码
This commit is contained in:
1 parent
00a4a08c70
commit
ce9d974b57
7 files changed
+1154
No files matched your search
@@ -0,0 +1,118 @@
|
|||||||
|
package com.ruoyi.system.controller;
|
||||||
|
import com.ruoyi.common.select.Ids;
|
||||||
|
import com.ruoyi.common.select.SelectItem;
|
||||||
|
import java.util.List;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PutMapping;
|
||||||
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import com.ruoyi.common.annotation.Log;
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import com.ruoyi.system.domain.UsdtConfig;
|
||||||
|
import com.ruoyi.system.domain.UsdtConfigPlus;
|
||||||
|
import com.ruoyi.system.service.IUsdtConfigService;
|
||||||
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 全局配置Controller
|
||||||
|
*
|
||||||
|
* @author luqj
|
||||||
|
* @date 2026-10-08
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/system/config")
|
||||||
|
public class UsdtConfigController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private IUsdtConfigService usdtConfigService;
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:config:getByIds')")
|
||||||
|
@PostMapping("/getByIds")
|
||||||
|
public AjaxResult getByIds(@RequestBody Ids ids)
|
||||||
|
{
|
||||||
|
List<UsdtConfigPlus> list = usdtConfigService.getByIds(ids.getLongIds(),UsdtConfigPlus::getVersion,UsdtConfigPlus::getId);
|
||||||
|
return AjaxResult.success(list);
|
||||||
|
}
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:config:select')")
|
||||||
|
@GetMapping("/select")
|
||||||
|
public AjaxResult select(String keyword)
|
||||||
|
{
|
||||||
|
List<SelectItem> list = usdtConfigService.select(keyword);
|
||||||
|
return AjaxResult.success(list);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 查询全局配置列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:config:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(UsdtConfig usdtConfig)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<UsdtConfig> list = usdtConfigService.selectUsdtConfigList(usdtConfig);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出全局配置列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:config:export')")
|
||||||
|
@Log(title = "全局配置", businessType = BusinessType.EXPORT)
|
||||||
|
@GetMapping("/export")
|
||||||
|
public AjaxResult export(UsdtConfig usdtConfig)
|
||||||
|
{
|
||||||
|
List<UsdtConfig> list = usdtConfigService.selectUsdtConfigList(usdtConfig);
|
||||||
|
ExcelUtil<UsdtConfig> util = new ExcelUtil<UsdtConfig>(UsdtConfig.class);
|
||||||
|
return util.exportExcel(list, "config");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取全局配置详细信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:config:query')")
|
||||||
|
@GetMapping(value = "/{id}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||||
|
{
|
||||||
|
return AjaxResult.success(usdtConfigService.selectUsdtConfigById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增全局配置
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:config:add')")
|
||||||
|
@Log(title = "全局配置", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@RequestBody UsdtConfig usdtConfig)
|
||||||
|
{
|
||||||
|
return toAjax(usdtConfigService.insertUsdtConfig(usdtConfig));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改全局配置
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:config:edit')")
|
||||||
|
@Log(title = "全局配置", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@RequestBody UsdtConfig usdtConfig)
|
||||||
|
{
|
||||||
|
return toAjax(usdtConfigService.updateUsdtConfig(usdtConfig));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除全局配置
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:config:remove')")
|
||||||
|
@Log(title = "全局配置", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public AjaxResult remove(@PathVariable Long[] ids)
|
||||||
|
{
|
||||||
|
return toAjax(usdtConfigService.deleteUsdtConfigByIds(ids));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,279 @@
|
|||||||
|
package com.ruoyi.system.domain;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
import com.ruoyi.common.annotation.Excel;
|
||||||
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
import java.io.Serializable;
|
||||||
|
/**
|
||||||
|
* 全局配置对象 usdt_config
|
||||||
|
*
|
||||||
|
* @author luqj
|
||||||
|
* @date 2026-10-08
|
||||||
|
*/
|
||||||
|
public class UsdtConfig extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 主键 */
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/** 代付手续费 */
|
||||||
|
@Excel(name = "代付手续费")
|
||||||
|
private BigDecimal payUsdtNum;
|
||||||
|
|
||||||
|
/** 代收手续费 */
|
||||||
|
@Excel(name = "代收手续费")
|
||||||
|
private BigDecimal receiveUsdtNum;
|
||||||
|
|
||||||
|
/** 波场网络类型 */
|
||||||
|
@Excel(name = "波场网络类型")
|
||||||
|
private Integer tronNetType;
|
||||||
|
|
||||||
|
/** 信封版本;配置密码轮换成功后递增 */
|
||||||
|
@Excel(name = "信封版本;配置密码轮换成功后递增")
|
||||||
|
private Long version;
|
||||||
|
|
||||||
|
/** 助记词和 DEK 使用的加密算法 */
|
||||||
|
@Excel(name = "助记词和 DEK 使用的加密算法")
|
||||||
|
private String encryptionAlgorithm;
|
||||||
|
|
||||||
|
/** 配置密码派生算法 */
|
||||||
|
@Excel(name = "配置密码派生算法")
|
||||||
|
private String passwordKdf;
|
||||||
|
|
||||||
|
/** PBKDF2 迭代次数;轮换时按当前安全策略更新 */
|
||||||
|
@Excel(name = "PBKDF2 迭代次数;轮换时按当前安全策略更新")
|
||||||
|
private Long iterations;
|
||||||
|
|
||||||
|
/** AES-GCM 加密后的助记词密文,Base64;禁止保存明文助记词 */
|
||||||
|
@Excel(name = "AES-GCM 加密后的助记词密文,Base64;禁止保存明文助记词")
|
||||||
|
private String encryptedMnemonic;
|
||||||
|
|
||||||
|
/** 助记词 AES-GCM nonce,Base64,通常为 12 字节 */
|
||||||
|
@Excel(name = "助记词 AES-GCM nonce,Base64,通常为 12 字节")
|
||||||
|
private String mnemonicNonce;
|
||||||
|
|
||||||
|
/** 由 KEK 包装后的 DEK,Base64;禁止保存明文 DEK */
|
||||||
|
@Excel(name = "由 KEK 包装后的 DEK,Base64;禁止保存明文 DEK")
|
||||||
|
private String encryptedDek;
|
||||||
|
|
||||||
|
/** DEK AES-GCM nonce,Base64,通常为 12 字节 */
|
||||||
|
@Excel(name = "DEK AES-GCM nonce,Base64,通常为 12 字节")
|
||||||
|
private String dekNonce;
|
||||||
|
|
||||||
|
/** 配置密码派生 KEK 使用的 salt,Base64 */
|
||||||
|
@Excel(name = "配置密码派生 KEK 使用的 salt,Base64")
|
||||||
|
private String keySalt;
|
||||||
|
|
||||||
|
/** 配置密码校验哈希使用的独立 salt,Base64 */
|
||||||
|
@Excel(name = "配置密码校验哈希使用的独立 salt,Base64")
|
||||||
|
private String passwordSalt;
|
||||||
|
|
||||||
|
/** PBKDF2 配置密码校验值,Base64;不是可逆密码 */
|
||||||
|
@Excel(name = "PBKDF2 配置密码校验值,Base64;不是可逆密码")
|
||||||
|
private String passwordHash;
|
||||||
|
|
||||||
|
/** 最近一次配置密码轮换时间 */
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@Excel(name = "最近一次配置密码轮换时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
|
private Date rotatedAt;
|
||||||
|
|
||||||
|
/** $column.columnComment */
|
||||||
|
@Excel(name = "最近一次配置密码轮换时间")
|
||||||
|
private BigDecimal trxNum;
|
||||||
|
|
||||||
|
/** 主账号地址 */
|
||||||
|
@Excel(name = "主账号地址")
|
||||||
|
private String tokenAddress;
|
||||||
|
|
||||||
|
public void setId(Long id)
|
||||||
|
{
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getId()
|
||||||
|
{
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
public void setPayUsdtNum(BigDecimal payUsdtNum)
|
||||||
|
{
|
||||||
|
this.payUsdtNum = payUsdtNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getPayUsdtNum()
|
||||||
|
{
|
||||||
|
return payUsdtNum;
|
||||||
|
}
|
||||||
|
public void setReceiveUsdtNum(BigDecimal receiveUsdtNum)
|
||||||
|
{
|
||||||
|
this.receiveUsdtNum = receiveUsdtNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getReceiveUsdtNum()
|
||||||
|
{
|
||||||
|
return receiveUsdtNum;
|
||||||
|
}
|
||||||
|
public void setTronNetType(Integer tronNetType)
|
||||||
|
{
|
||||||
|
this.tronNetType = tronNetType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getTronNetType()
|
||||||
|
{
|
||||||
|
return tronNetType;
|
||||||
|
}
|
||||||
|
public void setVersion(Long version)
|
||||||
|
{
|
||||||
|
this.version = version;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getVersion()
|
||||||
|
{
|
||||||
|
return version;
|
||||||
|
}
|
||||||
|
public void setEncryptionAlgorithm(String encryptionAlgorithm)
|
||||||
|
{
|
||||||
|
this.encryptionAlgorithm = encryptionAlgorithm;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEncryptionAlgorithm()
|
||||||
|
{
|
||||||
|
return encryptionAlgorithm;
|
||||||
|
}
|
||||||
|
public void setPasswordKdf(String passwordKdf)
|
||||||
|
{
|
||||||
|
this.passwordKdf = passwordKdf;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPasswordKdf()
|
||||||
|
{
|
||||||
|
return passwordKdf;
|
||||||
|
}
|
||||||
|
public void setIterations(Long iterations)
|
||||||
|
{
|
||||||
|
this.iterations = iterations;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getIterations()
|
||||||
|
{
|
||||||
|
return iterations;
|
||||||
|
}
|
||||||
|
public void setEncryptedMnemonic(String encryptedMnemonic)
|
||||||
|
{
|
||||||
|
this.encryptedMnemonic = encryptedMnemonic;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEncryptedMnemonic()
|
||||||
|
{
|
||||||
|
return encryptedMnemonic;
|
||||||
|
}
|
||||||
|
public void setMnemonicNonce(String mnemonicNonce)
|
||||||
|
{
|
||||||
|
this.mnemonicNonce = mnemonicNonce;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMnemonicNonce()
|
||||||
|
{
|
||||||
|
return mnemonicNonce;
|
||||||
|
}
|
||||||
|
public void setEncryptedDek(String encryptedDek)
|
||||||
|
{
|
||||||
|
this.encryptedDek = encryptedDek;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEncryptedDek()
|
||||||
|
{
|
||||||
|
return encryptedDek;
|
||||||
|
}
|
||||||
|
public void setDekNonce(String dekNonce)
|
||||||
|
{
|
||||||
|
this.dekNonce = dekNonce;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDekNonce()
|
||||||
|
{
|
||||||
|
return dekNonce;
|
||||||
|
}
|
||||||
|
public void setKeySalt(String keySalt)
|
||||||
|
{
|
||||||
|
this.keySalt = keySalt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getKeySalt()
|
||||||
|
{
|
||||||
|
return keySalt;
|
||||||
|
}
|
||||||
|
public void setPasswordSalt(String passwordSalt)
|
||||||
|
{
|
||||||
|
this.passwordSalt = passwordSalt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPasswordSalt()
|
||||||
|
{
|
||||||
|
return passwordSalt;
|
||||||
|
}
|
||||||
|
public void setPasswordHash(String passwordHash)
|
||||||
|
{
|
||||||
|
this.passwordHash = passwordHash;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPasswordHash()
|
||||||
|
{
|
||||||
|
return passwordHash;
|
||||||
|
}
|
||||||
|
public void setRotatedAt(Date rotatedAt)
|
||||||
|
{
|
||||||
|
this.rotatedAt = rotatedAt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getRotatedAt()
|
||||||
|
{
|
||||||
|
return rotatedAt;
|
||||||
|
}
|
||||||
|
public void setTrxNum(BigDecimal trxNum)
|
||||||
|
{
|
||||||
|
this.trxNum = trxNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getTrxNum()
|
||||||
|
{
|
||||||
|
return trxNum;
|
||||||
|
}
|
||||||
|
public void setTokenAddress(String tokenAddress)
|
||||||
|
{
|
||||||
|
this.tokenAddress = tokenAddress;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTokenAddress()
|
||||||
|
{
|
||||||
|
return tokenAddress;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
.append("id", getId())
|
||||||
|
.append("payUsdtNum", getPayUsdtNum())
|
||||||
|
.append("receiveUsdtNum", getReceiveUsdtNum())
|
||||||
|
.append("tronNetType", getTronNetType())
|
||||||
|
.append("version", getVersion())
|
||||||
|
.append("encryptionAlgorithm", getEncryptionAlgorithm())
|
||||||
|
.append("passwordKdf", getPasswordKdf())
|
||||||
|
.append("iterations", getIterations())
|
||||||
|
.append("encryptedMnemonic", getEncryptedMnemonic())
|
||||||
|
.append("mnemonicNonce", getMnemonicNonce())
|
||||||
|
.append("encryptedDek", getEncryptedDek())
|
||||||
|
.append("dekNonce", getDekNonce())
|
||||||
|
.append("keySalt", getKeySalt())
|
||||||
|
.append("passwordSalt", getPasswordSalt())
|
||||||
|
.append("passwordHash", getPasswordHash())
|
||||||
|
.append("rotatedAt", getRotatedAt())
|
||||||
|
.append("trxNum", getTrxNum())
|
||||||
|
.append("tokenAddress", getTokenAddress())
|
||||||
|
.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,264 @@
|
|||||||
|
package com.ruoyi.system.domain;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
import com.ruoyi.common.annotation.Excel;
|
||||||
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
/**
|
||||||
|
* 全局配置对象 usdt_config
|
||||||
|
*
|
||||||
|
* @author luqj
|
||||||
|
* @date 2026-10-08
|
||||||
|
*/
|
||||||
|
@TableName(value = "usdt_config")
|
||||||
|
public class UsdtConfigPlus implements Serializable
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 主键 */
|
||||||
|
private Long id;
|
||||||
|
/** 代付手续费 */
|
||||||
|
@Excel(name = "代付手续费")
|
||||||
|
private BigDecimal payUsdtNum;
|
||||||
|
/** 代收手续费 */
|
||||||
|
@Excel(name = "代收手续费")
|
||||||
|
private BigDecimal receiveUsdtNum;
|
||||||
|
/** 波场网络类型 */
|
||||||
|
@Excel(name = "波场网络类型 0 测试网络, 1 正式网络")
|
||||||
|
private Integer tronNetType;
|
||||||
|
/** 信封版本;配置密码轮换成功后递增 */
|
||||||
|
@Excel(name = "信封版本;配置密码轮换成功后递增")
|
||||||
|
private Long version;
|
||||||
|
/** 助记词和 DEK 使用的加密算法 */
|
||||||
|
@Excel(name = "助记词和 DEK 使用的加密算法")
|
||||||
|
private String encryptionAlgorithm;
|
||||||
|
/** 配置密码派生算法 */
|
||||||
|
@Excel(name = "配置密码派生算法")
|
||||||
|
private String passwordKdf;
|
||||||
|
/** PBKDF2 迭代次数;轮换时按当前安全策略更新 */
|
||||||
|
@Excel(name = "PBKDF2 迭代次数;轮换时按当前安全策略更新")
|
||||||
|
private Long iterations;
|
||||||
|
/** AES-GCM 加密后的助记词密文,Base64;禁止保存明文助记词 */
|
||||||
|
@Excel(name = "AES-GCM 加密后的助记词密文,Base64;禁止保存明文助记词")
|
||||||
|
private String encryptedMnemonic;
|
||||||
|
/** 助记词 AES-GCM nonce,Base64,通常为 12 字节 */
|
||||||
|
@Excel(name = "助记词 AES-GCM nonce,Base64,通常为 12 字节")
|
||||||
|
private String mnemonicNonce;
|
||||||
|
/** 由 KEK 包装后的 DEK,Base64;禁止保存明文 DEK */
|
||||||
|
@Excel(name = "由 KEK 包装后的 DEK,Base64;禁止保存明文 DEK")
|
||||||
|
private String encryptedDek;
|
||||||
|
/** DEK AES-GCM nonce,Base64,通常为 12 字节 */
|
||||||
|
@Excel(name = "DEK AES-GCM nonce,Base64,通常为 12 字节")
|
||||||
|
private String dekNonce;
|
||||||
|
/** 配置密码派生 KEK 使用的 salt,Base64 */
|
||||||
|
@Excel(name = "配置密码派生 KEK 使用的 salt,Base64")
|
||||||
|
private String keySalt;
|
||||||
|
/** 配置密码校验哈希使用的独立 salt,Base64 */
|
||||||
|
@Excel(name = "配置密码校验哈希使用的独立 salt,Base64")
|
||||||
|
private String passwordSalt;
|
||||||
|
/** PBKDF2 配置密码校验值,Base64;不是可逆密码 */
|
||||||
|
@Excel(name = "PBKDF2 配置密码校验值,Base64;不是可逆密码")
|
||||||
|
private String passwordHash;
|
||||||
|
/** 最近一次配置密码轮换时间 */
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@Excel(name = "最近一次配置密码轮换时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
|
private Date rotatedAt;
|
||||||
|
/** $column.columnComment */
|
||||||
|
@Excel(name = "最近一次配置密码轮换时间")
|
||||||
|
private BigDecimal trxNum;
|
||||||
|
/** 主账号地址 */
|
||||||
|
@Excel(name = "主账号地址")
|
||||||
|
private String tokenAddress;
|
||||||
|
public void setId(Long id)
|
||||||
|
{
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getId()
|
||||||
|
{
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
public void setPayUsdtNum(BigDecimal payUsdtNum)
|
||||||
|
{
|
||||||
|
this.payUsdtNum = payUsdtNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getPayUsdtNum()
|
||||||
|
{
|
||||||
|
return payUsdtNum;
|
||||||
|
}
|
||||||
|
public void setReceiveUsdtNum(BigDecimal receiveUsdtNum)
|
||||||
|
{
|
||||||
|
this.receiveUsdtNum = receiveUsdtNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getReceiveUsdtNum()
|
||||||
|
{
|
||||||
|
return receiveUsdtNum;
|
||||||
|
}
|
||||||
|
public void setTronNetType(Integer tronNetType)
|
||||||
|
{
|
||||||
|
this.tronNetType = tronNetType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getTronNetType()
|
||||||
|
{
|
||||||
|
return tronNetType;
|
||||||
|
}
|
||||||
|
public void setVersion(Long version)
|
||||||
|
{
|
||||||
|
this.version = version;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getVersion()
|
||||||
|
{
|
||||||
|
return version;
|
||||||
|
}
|
||||||
|
public void setEncryptionAlgorithm(String encryptionAlgorithm)
|
||||||
|
{
|
||||||
|
this.encryptionAlgorithm = encryptionAlgorithm;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEncryptionAlgorithm()
|
||||||
|
{
|
||||||
|
return encryptionAlgorithm;
|
||||||
|
}
|
||||||
|
public void setPasswordKdf(String passwordKdf)
|
||||||
|
{
|
||||||
|
this.passwordKdf = passwordKdf;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPasswordKdf()
|
||||||
|
{
|
||||||
|
return passwordKdf;
|
||||||
|
}
|
||||||
|
public void setIterations(Long iterations)
|
||||||
|
{
|
||||||
|
this.iterations = iterations;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getIterations()
|
||||||
|
{
|
||||||
|
return iterations;
|
||||||
|
}
|
||||||
|
public void setEncryptedMnemonic(String encryptedMnemonic)
|
||||||
|
{
|
||||||
|
this.encryptedMnemonic = encryptedMnemonic;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEncryptedMnemonic()
|
||||||
|
{
|
||||||
|
return encryptedMnemonic;
|
||||||
|
}
|
||||||
|
public void setMnemonicNonce(String mnemonicNonce)
|
||||||
|
{
|
||||||
|
this.mnemonicNonce = mnemonicNonce;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMnemonicNonce()
|
||||||
|
{
|
||||||
|
return mnemonicNonce;
|
||||||
|
}
|
||||||
|
public void setEncryptedDek(String encryptedDek)
|
||||||
|
{
|
||||||
|
this.encryptedDek = encryptedDek;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEncryptedDek()
|
||||||
|
{
|
||||||
|
return encryptedDek;
|
||||||
|
}
|
||||||
|
public void setDekNonce(String dekNonce)
|
||||||
|
{
|
||||||
|
this.dekNonce = dekNonce;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDekNonce()
|
||||||
|
{
|
||||||
|
return dekNonce;
|
||||||
|
}
|
||||||
|
public void setKeySalt(String keySalt)
|
||||||
|
{
|
||||||
|
this.keySalt = keySalt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getKeySalt()
|
||||||
|
{
|
||||||
|
return keySalt;
|
||||||
|
}
|
||||||
|
public void setPasswordSalt(String passwordSalt)
|
||||||
|
{
|
||||||
|
this.passwordSalt = passwordSalt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPasswordSalt()
|
||||||
|
{
|
||||||
|
return passwordSalt;
|
||||||
|
}
|
||||||
|
public void setPasswordHash(String passwordHash)
|
||||||
|
{
|
||||||
|
this.passwordHash = passwordHash;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPasswordHash()
|
||||||
|
{
|
||||||
|
return passwordHash;
|
||||||
|
}
|
||||||
|
public void setRotatedAt(Date rotatedAt)
|
||||||
|
{
|
||||||
|
this.rotatedAt = rotatedAt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getRotatedAt()
|
||||||
|
{
|
||||||
|
return rotatedAt;
|
||||||
|
}
|
||||||
|
public void setTrxNum(BigDecimal trxNum)
|
||||||
|
{
|
||||||
|
this.trxNum = trxNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getTrxNum()
|
||||||
|
{
|
||||||
|
return trxNum;
|
||||||
|
}
|
||||||
|
public void setTokenAddress(String tokenAddress)
|
||||||
|
{
|
||||||
|
this.tokenAddress = tokenAddress;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTokenAddress()
|
||||||
|
{
|
||||||
|
return tokenAddress;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
.append("id", getId())
|
||||||
|
.append("payUsdtNum", getPayUsdtNum())
|
||||||
|
.append("receiveUsdtNum", getReceiveUsdtNum())
|
||||||
|
.append("tronNetType", getTronNetType())
|
||||||
|
.append("version", getVersion())
|
||||||
|
.append("encryptionAlgorithm", getEncryptionAlgorithm())
|
||||||
|
.append("passwordKdf", getPasswordKdf())
|
||||||
|
.append("iterations", getIterations())
|
||||||
|
.append("encryptedMnemonic", getEncryptedMnemonic())
|
||||||
|
.append("mnemonicNonce", getMnemonicNonce())
|
||||||
|
.append("encryptedDek", getEncryptedDek())
|
||||||
|
.append("dekNonce", getDekNonce())
|
||||||
|
.append("keySalt", getKeySalt())
|
||||||
|
.append("passwordSalt", getPasswordSalt())
|
||||||
|
.append("passwordHash", getPasswordHash())
|
||||||
|
.append("rotatedAt", getRotatedAt())
|
||||||
|
.append("trxNum", getTrxNum())
|
||||||
|
.append("tokenAddress", getTokenAddress())
|
||||||
|
.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,65 @@
|
|||||||
|
package com.ruoyi.system.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import com.ruoyi.system.domain.UsdtConfig;
|
||||||
|
import com.ruoyi.system.domain.UsdtConfigPlus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 全局配置Mapper接口
|
||||||
|
*
|
||||||
|
* @author luqj
|
||||||
|
* @date 2026-10-08
|
||||||
|
*/
|
||||||
|
public interface UsdtConfigMapper extends BaseMapper<UsdtConfigPlus>
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询全局配置
|
||||||
|
*
|
||||||
|
* @param id 全局配置ID
|
||||||
|
* @return 全局配置
|
||||||
|
*/
|
||||||
|
public UsdtConfig selectUsdtConfigById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全局配置列表
|
||||||
|
*
|
||||||
|
* @param usdtConfig 全局配置
|
||||||
|
* @return 全局配置集合
|
||||||
|
*/
|
||||||
|
public List<UsdtConfig> selectUsdtConfigList(UsdtConfig usdtConfig);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增全局配置
|
||||||
|
*
|
||||||
|
* @param usdtConfig 全局配置
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertUsdtConfig(UsdtConfig usdtConfig);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改全局配置
|
||||||
|
*
|
||||||
|
* @param usdtConfig 全局配置
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateUsdtConfig(UsdtConfig usdtConfig);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除全局配置
|
||||||
|
*
|
||||||
|
* @param id 全局配置ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteUsdtConfigById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除全局配置
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteUsdtConfigByIds(Long[] ids);
|
||||||
|
}
|
||||||
@@ -0,0 +1,89 @@
|
|||||||
|
package com.ruoyi.system.service;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.List;
|
||||||
|
import com.ruoyi.system.domain.UsdtConfig;
|
||||||
|
import com.ruoyi.system.domain.UsdtConfigPlus;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
|
||||||
|
import com.ruoyi.common.select.SelectItem;
|
||||||
|
/**
|
||||||
|
* 全局配置Service接口
|
||||||
|
*
|
||||||
|
* @author luqj
|
||||||
|
* @date 2026-10-08
|
||||||
|
*/
|
||||||
|
public interface IUsdtConfigService extends IService<UsdtConfigPlus>
|
||||||
|
{
|
||||||
|
|
||||||
|
List<SelectItem> select(String keyword);
|
||||||
|
/**
|
||||||
|
* 查询全局配置
|
||||||
|
*
|
||||||
|
* @param id 全局配置ID
|
||||||
|
* @return 全局配置
|
||||||
|
*/
|
||||||
|
public UsdtConfig selectUsdtConfigById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全局配置列表
|
||||||
|
*
|
||||||
|
* @param usdtConfig 全局配置
|
||||||
|
* @return 全局配置集合
|
||||||
|
*/
|
||||||
|
public List<UsdtConfig> selectUsdtConfigList(UsdtConfig usdtConfig);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增全局配置
|
||||||
|
*
|
||||||
|
* @param usdtConfig 全局配置
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertUsdtConfig(UsdtConfig usdtConfig);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改全局配置
|
||||||
|
*
|
||||||
|
* @param usdtConfig 全局配置
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateUsdtConfig(UsdtConfig usdtConfig);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除全局配置
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的全局配置ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteUsdtConfigByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除全局配置信息
|
||||||
|
*
|
||||||
|
* @param id 全局配置ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteUsdtConfigById(Long id);
|
||||||
|
|
||||||
|
List<UsdtConfigPlus> getByIds(List<Long> ids, SFunction<UsdtConfigPlus, ?>... columns);
|
||||||
|
|
||||||
|
UsdtConfigPlus getById(Long id, SFunction<UsdtConfigPlus, ?>... columns);
|
||||||
|
|
||||||
|
Map<Long, UsdtConfigPlus> getMapByIds(List<Long> ids, SFunction<UsdtConfigPlus, ?>... columns);
|
||||||
|
|
||||||
|
List<UsdtConfigPlus> getByIds(List<Long> ids);
|
||||||
|
|
||||||
|
Map<Long, UsdtConfigPlus> getMapByIds(List<Long> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param field sum 字段
|
||||||
|
* @param where 条件
|
||||||
|
* @param tClass 返回类型
|
||||||
|
* @param <T>
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
<T> T sum(String field, String where, Class<T> tClass);
|
||||||
|
|
||||||
|
Long count(String where);
|
||||||
|
|
||||||
|
<T> List<T> countByGroupBy(String select, String where, String groupby, Class<T> tClass);
|
||||||
|
}
|
||||||
@@ -0,0 +1,203 @@
|
|||||||
|
package com.ruoyi.system.service.impl;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.ruoyi.system.mapper.UsdtConfigMapper;
|
||||||
|
import com.ruoyi.system.domain.UsdtConfig;
|
||||||
|
import com.ruoyi.system.domain.UsdtConfigPlus;
|
||||||
|
import com.ruoyi.system.service.IUsdtConfigService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.jdbc.core.JdbcTemplate;
|
||||||
|
import com.ruoyi.common.select.SelectItem;
|
||||||
|
/**
|
||||||
|
* 全局配置Service业务层处理
|
||||||
|
*
|
||||||
|
* @author luqj
|
||||||
|
* @date 2026-10-08
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class UsdtConfigServiceImpl extends ServiceImpl<UsdtConfigMapper, UsdtConfigPlus> implements IUsdtConfigService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private UsdtConfigMapper usdtConfigMapper;
|
||||||
|
@Autowired
|
||||||
|
private JdbcTemplate jdbcTemplate;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<UsdtConfigPlus> getByIds(List<Long> ids, SFunction<UsdtConfigPlus, ?>... columns) {
|
||||||
|
LambdaQueryWrapper<UsdtConfigPlus> lambdaQueryWrapper = new LambdaQueryWrapper<UsdtConfigPlus>()
|
||||||
|
.select(columns).in(UsdtConfigPlus::getId, ids);
|
||||||
|
return this.list(lambdaQueryWrapper);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public List<SelectItem> select(String keyword) {
|
||||||
|
LambdaQueryWrapper<UsdtConfigPlus> lambdaQueryWrapper = new LambdaQueryWrapper<UsdtConfigPlus>()
|
||||||
|
.select(UsdtConfigPlus::getId, UsdtConfigPlus::getName)
|
||||||
|
.like(UsdtConfigPlus::getName, keyword);
|
||||||
|
List<UsdtConfigPlus> list = this.list(lambdaQueryWrapper);
|
||||||
|
List<SelectItem> result =new ArrayList<>();
|
||||||
|
for (UsdtConfigPlus item : list){
|
||||||
|
SelectItem selectItem = new SelectItem();
|
||||||
|
selectItem.setName(item.getName());
|
||||||
|
selectItem.setId(item.getId());
|
||||||
|
result.add(selectItem);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public UsdtConfigPlus getById(Long id, SFunction<UsdtConfigPlus, ?>... columns) {
|
||||||
|
LambdaQueryWrapper<UsdtConfigPlus> lambdaQueryWrapper = new LambdaQueryWrapper<UsdtConfigPlus>()
|
||||||
|
.select(columns).eq(UsdtConfigPlus::getId, id);
|
||||||
|
return baseMapper.selectOne(lambdaQueryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<Long, UsdtConfigPlus> getMapByIds(List<Long> ids, SFunction<UsdtConfigPlus, ?>... columns) {
|
||||||
|
List<UsdtConfigPlus> list = this.getByIds(ids, columns);
|
||||||
|
Map<Long, UsdtConfigPlus> map = new HashMap<>();
|
||||||
|
for (UsdtConfigPlus item : list) {
|
||||||
|
map.put(item.getId(), item);
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<Long, UsdtConfigPlus> getMapByIds(List<Long> ids) {
|
||||||
|
List<UsdtConfigPlus> list = this.getByIds(ids);
|
||||||
|
Map<Long, UsdtConfigPlus> map = new HashMap<>();
|
||||||
|
for (UsdtConfigPlus item : list) {
|
||||||
|
map.put(item.getId(), item);
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<UsdtConfigPlus> getByIds(List<Long> ids) {
|
||||||
|
LambdaQueryWrapper<UsdtConfigPlus> lambdaQueryWrapper = new LambdaQueryWrapper<UsdtConfigPlus>().in(UsdtConfigPlus::getId, ids);
|
||||||
|
return this.list(lambdaQueryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
public <T> T sum(String field, String where, Class<T> tClass) {
|
||||||
|
StringBuffer stringBuffer = new StringBuffer();
|
||||||
|
stringBuffer.append("select ");
|
||||||
|
stringBuffer.append(" sum(" + field + ") as total ");
|
||||||
|
stringBuffer.append(" from usdt_config ");
|
||||||
|
if (StringUtils.isNotBlank(where)) {
|
||||||
|
stringBuffer.append(" where ");
|
||||||
|
stringBuffer.append(where);
|
||||||
|
}
|
||||||
|
T result = jdbcTemplate.queryForObject(stringBuffer.toString(), tClass);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long count(String where) {
|
||||||
|
StringBuffer stringBuffer = new StringBuffer();
|
||||||
|
stringBuffer.append("select ");
|
||||||
|
stringBuffer.append(" count(1)");
|
||||||
|
stringBuffer.append(" from ");
|
||||||
|
stringBuffer.append(" usdt_config ");
|
||||||
|
if (StringUtils.isNotBlank(where)) {
|
||||||
|
stringBuffer.append(" where ");
|
||||||
|
stringBuffer.append(where);
|
||||||
|
}
|
||||||
|
Long result = jdbcTemplate.queryForObject(stringBuffer.toString(), Long.class);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public <T> List<T> countByGroupBy(String select, String where, String groupby, Class<T> tClass) {
|
||||||
|
StringBuffer stringBuffer = new StringBuffer();
|
||||||
|
stringBuffer.append("select ");
|
||||||
|
stringBuffer.append(select);
|
||||||
|
stringBuffer.append(" from ");
|
||||||
|
stringBuffer.append(" usdt_config ");
|
||||||
|
if (StringUtils.isNotBlank(where)) {
|
||||||
|
stringBuffer.append(" where ");
|
||||||
|
stringBuffer.append(where);
|
||||||
|
}
|
||||||
|
stringBuffer.append(" group by ");
|
||||||
|
stringBuffer.append(groupby);
|
||||||
|
List result = jdbcTemplate.queryForList(stringBuffer.toString());
|
||||||
|
List<T> tList = JSONArray.parseArray(JSONArray.toJSONString(result), tClass);
|
||||||
|
return tList;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 查询全局配置
|
||||||
|
*
|
||||||
|
* @param id 全局配置ID
|
||||||
|
* @return 全局配置
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public UsdtConfig selectUsdtConfigById(Long id)
|
||||||
|
{
|
||||||
|
return usdtConfigMapper.selectUsdtConfigById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全局配置列表
|
||||||
|
*
|
||||||
|
* @param usdtConfig 全局配置
|
||||||
|
* @return 全局配置
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<UsdtConfig> selectUsdtConfigList(UsdtConfig usdtConfig)
|
||||||
|
{
|
||||||
|
return usdtConfigMapper.selectUsdtConfigList(usdtConfig);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增全局配置
|
||||||
|
*
|
||||||
|
* @param usdtConfig 全局配置
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertUsdtConfig(UsdtConfig usdtConfig)
|
||||||
|
{
|
||||||
|
return usdtConfigMapper.insertUsdtConfig(usdtConfig);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改全局配置
|
||||||
|
*
|
||||||
|
* @param usdtConfig 全局配置
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateUsdtConfig(UsdtConfig usdtConfig)
|
||||||
|
{
|
||||||
|
return usdtConfigMapper.updateUsdtConfig(usdtConfig);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除全局配置
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的全局配置ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteUsdtConfigByIds(Long[] ids)
|
||||||
|
{
|
||||||
|
return usdtConfigMapper.deleteUsdtConfigByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除全局配置信息
|
||||||
|
*
|
||||||
|
* @param id 全局配置ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteUsdtConfigById(Long id)
|
||||||
|
{
|
||||||
|
return usdtConfigMapper.deleteUsdtConfigById(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,136 @@
|
|||||||
|
<?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.UsdtConfigMapper">
|
||||||
|
|
||||||
|
<resultMap type="UsdtConfig" id="UsdtConfigResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="payUsdtNum" column="pay_usdt_num" />
|
||||||
|
<result property="receiveUsdtNum" column="receive_usdt_num" />
|
||||||
|
<result property="tronNetType" column="tron_net_type" />
|
||||||
|
<result property="version" column="version" />
|
||||||
|
<result property="encryptionAlgorithm" column="encryption_algorithm" />
|
||||||
|
<result property="passwordKdf" column="password_kdf" />
|
||||||
|
<result property="iterations" column="iterations" />
|
||||||
|
<result property="encryptedMnemonic" column="encrypted_mnemonic" />
|
||||||
|
<result property="mnemonicNonce" column="mnemonic_nonce" />
|
||||||
|
<result property="encryptedDek" column="encrypted_dek" />
|
||||||
|
<result property="dekNonce" column="dek_nonce" />
|
||||||
|
<result property="keySalt" column="key_salt" />
|
||||||
|
<result property="passwordSalt" column="password_salt" />
|
||||||
|
<result property="passwordHash" column="password_hash" />
|
||||||
|
<result property="rotatedAt" column="rotated_at" />
|
||||||
|
<result property="trxNum" column="trx_num" />
|
||||||
|
<result property="tokenAddress" column="token_address" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectUsdtConfigVo">
|
||||||
|
select id, pay_usdt_num, receive_usdt_num, tron_net_type, version, encryption_algorithm, password_kdf, iterations, encrypted_mnemonic, mnemonic_nonce, encrypted_dek, dek_nonce, key_salt, password_salt, password_hash, rotated_at, trx_num, token_address from usdt_config
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectUsdtConfigList" parameterType="UsdtConfig" resultMap="UsdtConfigResult">
|
||||||
|
<include refid="selectUsdtConfigVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="payUsdtNum != null "> and pay_usdt_num = #{payUsdtNum}</if>
|
||||||
|
<if test="receiveUsdtNum != null "> and receive_usdt_num = #{receiveUsdtNum}</if>
|
||||||
|
<if test="tronNetType != null "> and tron_net_type = #{tronNetType}</if>
|
||||||
|
<if test="version != null "> and version = #{version}</if>
|
||||||
|
<if test="encryptionAlgorithm != null and encryptionAlgorithm != ''"> and encryption_algorithm = #{encryptionAlgorithm}</if>
|
||||||
|
<if test="passwordKdf != null and passwordKdf != ''"> and password_kdf = #{passwordKdf}</if>
|
||||||
|
<if test="iterations != null "> and iterations = #{iterations}</if>
|
||||||
|
<if test="encryptedMnemonic != null and encryptedMnemonic != ''"> and encrypted_mnemonic = #{encryptedMnemonic}</if>
|
||||||
|
<if test="mnemonicNonce != null and mnemonicNonce != ''"> and mnemonic_nonce = #{mnemonicNonce}</if>
|
||||||
|
<if test="encryptedDek != null and encryptedDek != ''"> and encrypted_dek = #{encryptedDek}</if>
|
||||||
|
<if test="dekNonce != null and dekNonce != ''"> and dek_nonce = #{dekNonce}</if>
|
||||||
|
<if test="keySalt != null and keySalt != ''"> and key_salt = #{keySalt}</if>
|
||||||
|
<if test="passwordSalt != null and passwordSalt != ''"> and password_salt = #{passwordSalt}</if>
|
||||||
|
<if test="passwordHash != null and passwordHash != ''"> and password_hash = #{passwordHash}</if>
|
||||||
|
<if test="rotatedAt != null "> and rotated_at = #{rotatedAt}</if>
|
||||||
|
<if test="trxNum != null "> and trx_num = #{trxNum}</if>
|
||||||
|
<if test="tokenAddress != null and tokenAddress != ''"> and token_address = #{tokenAddress}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectUsdtConfigById" parameterType="Long" resultMap="UsdtConfigResult">
|
||||||
|
<include refid="selectUsdtConfigVo"/>
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertUsdtConfig" parameterType="UsdtConfig" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
insert into usdt_config
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="payUsdtNum != null">pay_usdt_num,</if>
|
||||||
|
<if test="receiveUsdtNum != null">receive_usdt_num,</if>
|
||||||
|
<if test="tronNetType != null">tron_net_type,</if>
|
||||||
|
<if test="version != null">version,</if>
|
||||||
|
<if test="encryptionAlgorithm != null and encryptionAlgorithm != ''">encryption_algorithm,</if>
|
||||||
|
<if test="passwordKdf != null and passwordKdf != ''">password_kdf,</if>
|
||||||
|
<if test="iterations != null">iterations,</if>
|
||||||
|
<if test="encryptedMnemonic != null and encryptedMnemonic != ''">encrypted_mnemonic,</if>
|
||||||
|
<if test="mnemonicNonce != null and mnemonicNonce != ''">mnemonic_nonce,</if>
|
||||||
|
<if test="encryptedDek != null and encryptedDek != ''">encrypted_dek,</if>
|
||||||
|
<if test="dekNonce != null and dekNonce != ''">dek_nonce,</if>
|
||||||
|
<if test="keySalt != null and keySalt != ''">key_salt,</if>
|
||||||
|
<if test="passwordSalt != null and passwordSalt != ''">password_salt,</if>
|
||||||
|
<if test="passwordHash != null and passwordHash != ''">password_hash,</if>
|
||||||
|
<if test="rotatedAt != null">rotated_at,</if>
|
||||||
|
<if test="trxNum != null">trx_num,</if>
|
||||||
|
<if test="tokenAddress != null">token_address,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="payUsdtNum != null">#{payUsdtNum},</if>
|
||||||
|
<if test="receiveUsdtNum != null">#{receiveUsdtNum},</if>
|
||||||
|
<if test="tronNetType != null">#{tronNetType},</if>
|
||||||
|
<if test="version != null">#{version},</if>
|
||||||
|
<if test="encryptionAlgorithm != null and encryptionAlgorithm != ''">#{encryptionAlgorithm},</if>
|
||||||
|
<if test="passwordKdf != null and passwordKdf != ''">#{passwordKdf},</if>
|
||||||
|
<if test="iterations != null">#{iterations},</if>
|
||||||
|
<if test="encryptedMnemonic != null and encryptedMnemonic != ''">#{encryptedMnemonic},</if>
|
||||||
|
<if test="mnemonicNonce != null and mnemonicNonce != ''">#{mnemonicNonce},</if>
|
||||||
|
<if test="encryptedDek != null and encryptedDek != ''">#{encryptedDek},</if>
|
||||||
|
<if test="dekNonce != null and dekNonce != ''">#{dekNonce},</if>
|
||||||
|
<if test="keySalt != null and keySalt != ''">#{keySalt},</if>
|
||||||
|
<if test="passwordSalt != null and passwordSalt != ''">#{passwordSalt},</if>
|
||||||
|
<if test="passwordHash != null and passwordHash != ''">#{passwordHash},</if>
|
||||||
|
<if test="rotatedAt != null">#{rotatedAt},</if>
|
||||||
|
<if test="trxNum != null">#{trxNum},</if>
|
||||||
|
<if test="tokenAddress != null">#{tokenAddress},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateUsdtConfig" parameterType="UsdtConfig">
|
||||||
|
update usdt_config
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="payUsdtNum != null">pay_usdt_num = #{payUsdtNum},</if>
|
||||||
|
<if test="receiveUsdtNum != null">receive_usdt_num = #{receiveUsdtNum},</if>
|
||||||
|
<if test="tronNetType != null">tron_net_type = #{tronNetType},</if>
|
||||||
|
<if test="version != null">version = #{version},</if>
|
||||||
|
<if test="encryptionAlgorithm != null and encryptionAlgorithm != ''">encryption_algorithm = #{encryptionAlgorithm},</if>
|
||||||
|
<if test="passwordKdf != null and passwordKdf != ''">password_kdf = #{passwordKdf},</if>
|
||||||
|
<if test="iterations != null">iterations = #{iterations},</if>
|
||||||
|
<if test="encryptedMnemonic != null and encryptedMnemonic != ''">encrypted_mnemonic = #{encryptedMnemonic},</if>
|
||||||
|
<if test="mnemonicNonce != null and mnemonicNonce != ''">mnemonic_nonce = #{mnemonicNonce},</if>
|
||||||
|
<if test="encryptedDek != null and encryptedDek != ''">encrypted_dek = #{encryptedDek},</if>
|
||||||
|
<if test="dekNonce != null and dekNonce != ''">dek_nonce = #{dekNonce},</if>
|
||||||
|
<if test="keySalt != null and keySalt != ''">key_salt = #{keySalt},</if>
|
||||||
|
<if test="passwordSalt != null and passwordSalt != ''">password_salt = #{passwordSalt},</if>
|
||||||
|
<if test="passwordHash != null and passwordHash != ''">password_hash = #{passwordHash},</if>
|
||||||
|
<if test="rotatedAt != null">rotated_at = #{rotatedAt},</if>
|
||||||
|
<if test="trxNum != null">trx_num = #{trxNum},</if>
|
||||||
|
<if test="tokenAddress != null">token_address = #{tokenAddress},</if>
|
||||||
|
</trim>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteUsdtConfigById" parameterType="Long">
|
||||||
|
delete from usdt_config where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteUsdtConfigByIds" parameterType="String">
|
||||||
|
delete from usdt_config where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
||||||
Reference in new issue
Block a user