计算当日报表数据
This commit is contained in:
@@ -244,6 +244,63 @@ public class LbDailyUserTradeController {
|
||||
}
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete/by-date-and-tenant")
|
||||
@Operation(summary = "按日期和租户删除", description = "根据报表日期和租户ID删除当天用户交易记录")
|
||||
public ResponseEntity<Map<String, Object>> deleteByDateAndTenant(
|
||||
@Parameter(description = "报表日期,格式:yyyy-MM-dd", required = true)
|
||||
@RequestParam String reportDate,
|
||||
@Parameter(description = "租户ID", required = true)
|
||||
@RequestParam String tenantId) {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
try {
|
||||
if (tenantId == null || tenantId.trim().isEmpty()) {
|
||||
result.put("success", false);
|
||||
result.put("message", "tenantId不能为空");
|
||||
return ResponseEntity.badRequest().body(result);
|
||||
}
|
||||
if (reportDate == null || reportDate.trim().isEmpty()) {
|
||||
result.put("success", false);
|
||||
result.put("message", "reportDate不能为空");
|
||||
return ResponseEntity.badRequest().body(result);
|
||||
}
|
||||
|
||||
LocalDate parsedReportDate;
|
||||
try {
|
||||
parsedReportDate = LocalDate.parse(reportDate.trim());
|
||||
} catch (Exception e) {
|
||||
result.put("success", false);
|
||||
result.put("message", "报表日期格式错误,请使用 yyyy-MM-dd");
|
||||
return ResponseEntity.badRequest().body(result);
|
||||
}
|
||||
|
||||
LambdaQueryWrapper<LbDailyUserTrade> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(LbDailyUserTrade::getReportDate, parsedReportDate);
|
||||
|
||||
long deleteCount = lbDailyUserTradeService.count(queryWrapper);
|
||||
if (deleteCount == 0) {
|
||||
result.put("success", true);
|
||||
result.put("message", "未匹配到可删除记录");
|
||||
result.put("deleteCount", 0);
|
||||
return ResponseEntity.ok(result);
|
||||
}
|
||||
|
||||
boolean success = lbDailyUserTradeService.remove(queryWrapper);
|
||||
if (success) {
|
||||
result.put("success", true);
|
||||
result.put("message", "删除成功");
|
||||
result.put("deleteCount", deleteCount);
|
||||
return ResponseEntity.ok(result);
|
||||
}
|
||||
result.put("success", false);
|
||||
result.put("message", "删除失败");
|
||||
return ResponseEntity.badRequest().body(result);
|
||||
} catch (Exception e) {
|
||||
result.put("success", false);
|
||||
result.put("message", "删除异常:" + e.getMessage());
|
||||
return ResponseEntity.internalServerError().body(result);
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping("/import")
|
||||
@Operation(summary = "导入交易记录", description = "按Excel模板导入当天用户交易记录")
|
||||
public ResponseEntity<Map<String, Object>> importExcel(
|
||||
|
||||
@@ -0,0 +1,244 @@
|
||||
package com.rj.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.rj.entity.LbDailyUserTradeReport;
|
||||
import com.rj.service.ILbDailyUserTradeReportService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 当天用户交易报表 前端控制器
|
||||
* </p>
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/lbDailyUserTradeReport")
|
||||
@Tag(name = "当天用户交易报表", description = "当天用户交易报表相关接口")
|
||||
public class LbDailyUserTradeReportController {
|
||||
|
||||
@Autowired
|
||||
private ILbDailyUserTradeReportService lbDailyUserTradeReportService;
|
||||
|
||||
@PostMapping("/add")
|
||||
@Operation(summary = "新增报表记录", description = "新增当天用户交易报表记录")
|
||||
public ResponseEntity<Map<String, Object>> add(@RequestBody LbDailyUserTradeReport tradeReport) {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
try {
|
||||
if (tradeReport.getId() == null || tradeReport.getId().trim().isEmpty()) {
|
||||
tradeReport.setId(UUID.randomUUID().toString());
|
||||
}
|
||||
if (tradeReport.getYestodaySellAmt() == null) {
|
||||
tradeReport.setYestodaySellAmt(BigDecimal.ZERO);
|
||||
}
|
||||
if (tradeReport.getDailySellAmt() == null) {
|
||||
tradeReport.setDailySellAmt(BigDecimal.ZERO);
|
||||
}
|
||||
if (tradeReport.getDailyBuyAmt() == null) {
|
||||
tradeReport.setDailyBuyAmt(BigDecimal.ZERO);
|
||||
}
|
||||
if (tradeReport.getServiceAmt() == null) {
|
||||
tradeReport.setServiceAmt(BigDecimal.ZERO);
|
||||
}
|
||||
if (tradeReport.getDikouAmt() == null) {
|
||||
tradeReport.setDikouAmt(BigDecimal.ZERO);
|
||||
}
|
||||
if (tradeReport.getDiffAmt() == null) {
|
||||
tradeReport.setDiffAmt(BigDecimal.ZERO);
|
||||
}
|
||||
if (tradeReport.getReportDate() == null) {
|
||||
tradeReport.setReportDate(LocalDateTime.now());
|
||||
}
|
||||
tradeReport.setCreatedAt(LocalDateTime.now());
|
||||
tradeReport.setUpdatedAt(LocalDateTime.now());
|
||||
|
||||
boolean success = lbDailyUserTradeReportService.save(tradeReport);
|
||||
if (success) {
|
||||
result.put("success", true);
|
||||
result.put("message", "新增成功");
|
||||
result.put("data", tradeReport);
|
||||
return ResponseEntity.ok(result);
|
||||
}
|
||||
result.put("success", false);
|
||||
result.put("message", "新增失败");
|
||||
return ResponseEntity.badRequest().body(result);
|
||||
} catch (Exception e) {
|
||||
result.put("success", false);
|
||||
result.put("message", "新增异常:" + e.getMessage());
|
||||
return ResponseEntity.internalServerError().body(result);
|
||||
}
|
||||
}
|
||||
|
||||
@GetMapping("/get/{id}")
|
||||
@Operation(summary = "根据ID查询", description = "根据ID查询当天用户交易报表记录")
|
||||
public ResponseEntity<Map<String, Object>> getById(
|
||||
@Parameter(description = "主键ID", required = true) @PathVariable String id) {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
try {
|
||||
LbDailyUserTradeReport data = lbDailyUserTradeReportService.getById(id);
|
||||
if (data == null) {
|
||||
result.put("success", false);
|
||||
result.put("message", "记录不存在");
|
||||
return ResponseEntity.badRequest().body(result);
|
||||
}
|
||||
result.put("success", true);
|
||||
result.put("message", "查询成功");
|
||||
result.put("data", data);
|
||||
return ResponseEntity.ok(result);
|
||||
} catch (Exception e) {
|
||||
result.put("success", false);
|
||||
result.put("message", "查询异常:" + e.getMessage());
|
||||
return ResponseEntity.internalServerError().body(result);
|
||||
}
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "分页条件查询", description = "分页查询当天用户交易报表记录")
|
||||
public ResponseEntity<Map<String, Object>> list(
|
||||
@Parameter(description = "页码", example = "1") @RequestParam(defaultValue = "1") Integer current,
|
||||
@Parameter(description = "每页大小", example = "10") @RequestParam(defaultValue = "10") Integer size,
|
||||
@Parameter(description = "租户ID") @RequestParam(required = false) String tenantId,
|
||||
@Parameter(description = "用户ID") @RequestParam(required = false) String userId,
|
||||
@Parameter(description = "数据类型") @RequestParam(required = false) String dataType,
|
||||
@Parameter(description = "昵称(模糊查询)") @RequestParam(required = false) String nickname,
|
||||
@Parameter(description = "报表开始时间,格式:yyyy-MM-dd HH:mm:ss")
|
||||
@RequestParam(required = false) String reportStartTime,
|
||||
@Parameter(description = "报表结束时间,格式:yyyy-MM-dd HH:mm:ss")
|
||||
@RequestParam(required = false) String reportEndTime,
|
||||
@Parameter(description = "创建开始时间,格式:yyyy-MM-dd HH:mm:ss")
|
||||
@RequestParam(required = false) String createdStartTime,
|
||||
@Parameter(description = "创建结束时间,格式:yyyy-MM-dd HH:mm:ss")
|
||||
@RequestParam(required = false) String createdEndTime) {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
try {
|
||||
LambdaQueryWrapper<LbDailyUserTradeReport> queryWrapper = new LambdaQueryWrapper<>();
|
||||
if (tenantId != null && !tenantId.trim().isEmpty()) {
|
||||
queryWrapper.eq(LbDailyUserTradeReport::getTenantId, tenantId.trim());
|
||||
}
|
||||
if (userId != null && !userId.trim().isEmpty()) {
|
||||
queryWrapper.eq(LbDailyUserTradeReport::getUserId, userId.trim());
|
||||
}
|
||||
if (dataType != null && !dataType.trim().isEmpty()) {
|
||||
queryWrapper.eq(LbDailyUserTradeReport::getDataType, dataType.trim());
|
||||
}
|
||||
if (nickname != null && !nickname.trim().isEmpty()) {
|
||||
queryWrapper.like(LbDailyUserTradeReport::getNickname, nickname.trim());
|
||||
}
|
||||
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
if (reportStartTime != null && !reportStartTime.trim().isEmpty()) {
|
||||
try {
|
||||
queryWrapper.ge(LbDailyUserTradeReport::getReportDate, LocalDateTime.parse(reportStartTime.trim(), formatter));
|
||||
} catch (Exception e) {
|
||||
result.put("success", false);
|
||||
result.put("message", "报表开始时间格式错误,请使用 yyyy-MM-dd HH:mm:ss");
|
||||
return ResponseEntity.badRequest().body(result);
|
||||
}
|
||||
}
|
||||
if (reportEndTime != null && !reportEndTime.trim().isEmpty()) {
|
||||
try {
|
||||
queryWrapper.le(LbDailyUserTradeReport::getReportDate, LocalDateTime.parse(reportEndTime.trim(), formatter));
|
||||
} catch (Exception e) {
|
||||
result.put("success", false);
|
||||
result.put("message", "报表结束时间格式错误,请使用 yyyy-MM-dd HH:mm:ss");
|
||||
return ResponseEntity.badRequest().body(result);
|
||||
}
|
||||
}
|
||||
if (createdStartTime != null && !createdStartTime.trim().isEmpty()) {
|
||||
try {
|
||||
queryWrapper.ge(LbDailyUserTradeReport::getCreatedAt, LocalDateTime.parse(createdStartTime.trim(), formatter));
|
||||
} catch (Exception e) {
|
||||
result.put("success", false);
|
||||
result.put("message", "创建开始时间格式错误,请使用 yyyy-MM-dd HH:mm:ss");
|
||||
return ResponseEntity.badRequest().body(result);
|
||||
}
|
||||
}
|
||||
if (createdEndTime != null && !createdEndTime.trim().isEmpty()) {
|
||||
try {
|
||||
queryWrapper.le(LbDailyUserTradeReport::getCreatedAt, LocalDateTime.parse(createdEndTime.trim(), formatter));
|
||||
} catch (Exception e) {
|
||||
result.put("success", false);
|
||||
result.put("message", "创建结束时间格式错误,请使用 yyyy-MM-dd HH:mm:ss");
|
||||
return ResponseEntity.badRequest().body(result);
|
||||
}
|
||||
}
|
||||
|
||||
queryWrapper.orderByDesc(LbDailyUserTradeReport::getCreatedAt);
|
||||
Page<LbDailyUserTradeReport> page = lbDailyUserTradeReportService.page(new Page<>(current, size), queryWrapper);
|
||||
|
||||
result.put("success", true);
|
||||
result.put("message", "查询成功");
|
||||
result.put("data", page.getRecords());
|
||||
result.put("total", page.getTotal());
|
||||
result.put("current", page.getCurrent());
|
||||
result.put("size", page.getSize());
|
||||
result.put("pages", page.getPages());
|
||||
return ResponseEntity.ok(result);
|
||||
} catch (Exception e) {
|
||||
result.put("success", false);
|
||||
result.put("message", "查询异常:" + e.getMessage());
|
||||
return ResponseEntity.internalServerError().body(result);
|
||||
}
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "修改报表记录", description = "根据ID修改当天用户交易报表记录")
|
||||
public ResponseEntity<Map<String, Object>> update(@RequestBody LbDailyUserTradeReport tradeReport) {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
try {
|
||||
if (tradeReport.getId() == null || tradeReport.getId().trim().isEmpty()) {
|
||||
result.put("success", false);
|
||||
result.put("message", "ID不能为空");
|
||||
return ResponseEntity.badRequest().body(result);
|
||||
}
|
||||
tradeReport.setUpdatedAt(LocalDateTime.now());
|
||||
boolean success = lbDailyUserTradeReportService.updateById(tradeReport);
|
||||
if (success) {
|
||||
result.put("success", true);
|
||||
result.put("message", "修改成功");
|
||||
result.put("data", tradeReport);
|
||||
return ResponseEntity.ok(result);
|
||||
}
|
||||
result.put("success", false);
|
||||
result.put("message", "修改失败");
|
||||
return ResponseEntity.badRequest().body(result);
|
||||
} catch (Exception e) {
|
||||
result.put("success", false);
|
||||
result.put("message", "修改异常:" + e.getMessage());
|
||||
return ResponseEntity.internalServerError().body(result);
|
||||
}
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete/{id}")
|
||||
@Operation(summary = "删除报表记录", description = "根据ID删除当天用户交易报表记录")
|
||||
public ResponseEntity<Map<String, Object>> delete(
|
||||
@Parameter(description = "主键ID", required = true) @PathVariable String id) {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
try {
|
||||
boolean success = lbDailyUserTradeReportService.removeById(id);
|
||||
if (success) {
|
||||
result.put("success", true);
|
||||
result.put("message", "删除成功");
|
||||
return ResponseEntity.ok(result);
|
||||
}
|
||||
result.put("success", false);
|
||||
result.put("message", "删除失败");
|
||||
return ResponseEntity.badRequest().body(result);
|
||||
} catch (Exception e) {
|
||||
result.put("success", false);
|
||||
result.put("message", "删除异常:" + e.getMessage());
|
||||
return ResponseEntity.internalServerError().body(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -41,7 +41,7 @@ public class LbDailyUserTrade implements Serializable {
|
||||
@TableField("nickname")
|
||||
private String nickname;
|
||||
|
||||
@Schema(description = "单日卖出金额")
|
||||
@Schema(description = "当日卖出金额")
|
||||
@TableField("daily_sell_amt")
|
||||
private BigDecimal dailySellAmt;
|
||||
|
||||
|
||||
86
src/main/java/com/rj/entity/LbDailyUserTradeReport.java
Normal file
86
src/main/java/com/rj/entity/LbDailyUserTradeReport.java
Normal file
@@ -0,0 +1,86 @@
|
||||
package com.rj.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 当天用户交易报表
|
||||
* </p>
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("lb_daily_user_trade_report")
|
||||
@Schema(description = "当天用户交易报表")
|
||||
public class LbDailyUserTradeReport implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "表ID(UUID)")
|
||||
@TableId("id")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "租户ID")
|
||||
@TableField("tenant_id")
|
||||
private String tenantId;
|
||||
|
||||
@Schema(description = "用户ID")
|
||||
@TableField("user_id")
|
||||
private String userId;
|
||||
|
||||
@Schema(description = "昵称")
|
||||
@TableField("nickname")
|
||||
private String nickname;
|
||||
|
||||
@Schema(description = "昨日买入金额")
|
||||
@TableField("yestoday_sell_amt")
|
||||
private BigDecimal yestodaySellAmt;
|
||||
|
||||
@Schema(description = "当日卖出金额")
|
||||
@TableField("daily_sell_amt")
|
||||
private BigDecimal dailySellAmt;
|
||||
|
||||
@Schema(description = "当日买入金额")
|
||||
@TableField("daily_buy_amt")
|
||||
private BigDecimal dailyBuyAmt;
|
||||
|
||||
@Schema(description = "服务费金额")
|
||||
@TableField("service_amt")
|
||||
private BigDecimal serviceAmt;
|
||||
|
||||
@Schema(description = "差额")
|
||||
@TableField("diff_amt")
|
||||
private BigDecimal diffAmt;
|
||||
|
||||
@Schema(description = "抵扣金额")
|
||||
@TableField("dikou_amt")
|
||||
private BigDecimal dikouAmt;
|
||||
|
||||
@Schema(description = "描述")
|
||||
@TableField("desc_content")
|
||||
private String descContent;
|
||||
|
||||
@Schema(description = "数据类型")
|
||||
@TableField("data_type")
|
||||
private String dataType;
|
||||
|
||||
@Schema(description = "插入时间")
|
||||
@TableField("created_at")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "修改时间")
|
||||
@TableField("updated_at")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
@Schema(description = "报表日期")
|
||||
@TableField("report_date")
|
||||
private LocalDateTime reportDate;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.rj.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.rj.entity.LbDailyUserTradeReport;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 当天用户交易报表 Mapper 接口
|
||||
* </p>
|
||||
*/
|
||||
public interface LbDailyUserTradeReportMapper extends BaseMapper<LbDailyUserTradeReport> {
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.rj.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.rj.entity.LbDailyUserTradeReport;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 当天用户交易报表 服务类
|
||||
* </p>
|
||||
*/
|
||||
public interface ILbDailyUserTradeReportService extends IService<LbDailyUserTradeReport> {
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.rj.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.rj.entity.LbDailyUserTradeReport;
|
||||
import com.rj.mapper.LbDailyUserTradeReportMapper;
|
||||
import com.rj.service.ILbDailyUserTradeReportService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 当天用户交易报表 服务实现类
|
||||
* </p>
|
||||
*/
|
||||
@Service
|
||||
public class LbDailyUserTradeReportServiceImpl extends ServiceImpl<LbDailyUserTradeReportMapper, LbDailyUserTradeReport>
|
||||
implements ILbDailyUserTradeReportService {
|
||||
}
|
||||
@@ -35,6 +35,8 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -75,6 +77,15 @@ public class LbDailyUserTradeServiceImpl extends ServiceImpl<LbDailyUserTradeMap
|
||||
result.put("message", "defaultReportDate 格式错误,请使用 yyyy-MM-dd");
|
||||
return result;
|
||||
}
|
||||
} else {
|
||||
// 未传导入日期时,尝试从文件名中提取 yyyy-MM-dd 作为导入日期
|
||||
fallbackReportDate = extractDateFromFilename(originalFilename);
|
||||
if (fallbackReportDate != null) {
|
||||
log.info("未提供 defaultReportDate,已从文件名解析报表日期,fileName={}, reportDate={}",
|
||||
originalFilename, fallbackReportDate);
|
||||
} else {
|
||||
log.info("未提供 defaultReportDate,且文件名未包含日期,将使用当前日期作为报表日期,fileName={}", originalFilename);
|
||||
}
|
||||
}
|
||||
|
||||
List<LbDailyUserTrade> importList = new ArrayList<>();
|
||||
@@ -488,4 +499,32 @@ public class LbDailyUserTradeServiceImpl extends ServiceImpl<LbDailyUserTradeMap
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 从文件名中提取 yyyy-MM-dd 格式的日期,例如:
|
||||
* 用户下单统计表_2026-04-23.xlsx -> 2026-04-23
|
||||
*/
|
||||
private LocalDate extractDateFromFilename(String fileName) {
|
||||
if (fileName == null) {
|
||||
return null;
|
||||
}
|
||||
// 只看文件名本身,去掉路径
|
||||
String simpleName = fileName;
|
||||
int slashIdx = Math.max(simpleName.lastIndexOf('/'), simpleName.lastIndexOf('\\'));
|
||||
if (slashIdx >= 0 && slashIdx + 1 < simpleName.length()) {
|
||||
simpleName = simpleName.substring(slashIdx + 1);
|
||||
}
|
||||
// 匹配第一个 yyyy-MM-dd
|
||||
Pattern pattern = Pattern.compile("(\\d{4}-\\d{2}-\\d{2})");
|
||||
Matcher matcher = pattern.matcher(simpleName);
|
||||
if (matcher.find()) {
|
||||
String dateStr = matcher.group(1);
|
||||
try {
|
||||
return LocalDate.parse(dateStr, DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
||||
} catch (Exception ignore) {
|
||||
// 忽略解析异常,返回 null 走默认逻辑
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
28
src/main/resources/mapper/LbDailyUserTradeReportMapper.xml
Normal file
28
src/main/resources/mapper/LbDailyUserTradeReportMapper.xml
Normal file
@@ -0,0 +1,28 @@
|
||||
<?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.rj.mapper.LbDailyUserTradeReportMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.rj.entity.LbDailyUserTradeReport">
|
||||
<id column="id" property="id"/>
|
||||
<result column="tenant_id" property="tenantId"/>
|
||||
<result column="user_id" property="userId"/>
|
||||
<result column="nickname" property="nickname"/>
|
||||
<result column="yestoday_sell_amt" property="yestodaySellAmt"/>
|
||||
<result column="daily_sell_amt" property="dailySellAmt"/>
|
||||
<result column="daily_buy_amt" property="dailyBuyAmt"/>
|
||||
<result column="service_amt" property="serviceAmt"/>
|
||||
<result column="diff_amt" property="diffAmt"/>
|
||||
<result column="dikou_amt" property="dikouAmt"/>
|
||||
<result column="desc_content" property="descContent"/>
|
||||
<result column="data_type" property="dataType"/>
|
||||
<result column="created_at" property="createdAt"/>
|
||||
<result column="updated_at" property="updatedAt"/>
|
||||
<result column="report_date" property="reportDate"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id, tenant_id, user_id, nickname, yestoday_sell_amt, daily_sell_amt, daily_buy_amt, service_amt, diff_amt, dikou_amt,
|
||||
desc_content, data_type, created_at, updated_at, report_date
|
||||
</sql>
|
||||
|
||||
</mapper>
|
||||
@@ -3,7 +3,7 @@ CREATE TABLE `lb_daily_user_trade` (
|
||||
`tenant_id` VARCHAR(64) NOT NULL COMMENT '租户ID',
|
||||
`user_id` VARCHAR(64) NOT NULL COMMENT '用户ID',
|
||||
`nickname` VARCHAR(100) DEFAULT NULL COMMENT '昵称',
|
||||
`daily_sell_amt` DECIMAL(18,2) NOT NULL DEFAULT 0.00 COMMENT '单日卖出金额',
|
||||
`daily_sell_amt` DECIMAL(18,2) NOT NULL DEFAULT 0.00 COMMENT '当日卖出金额',
|
||||
`daily_buy_amt` DECIMAL(18,2) NOT NULL DEFAULT 0.00 COMMENT '当日买入金额',
|
||||
`diff_amt` DECIMAL(18,2) NOT NULL DEFAULT 0.00 COMMENT '差额',
|
||||
`promoter_id` VARCHAR(64) DEFAULT NULL COMMENT '推广人ID',
|
||||
|
||||
Reference in New Issue
Block a user