From d9d43aec7372dc579ced50eda32d7881265533b9 Mon Sep 17 00:00:00 2001
From: zyy <zyy@email.com>
Date: Mon, 14 Jul 2025 17:58:05 +0800
Subject: [PATCH] AI产品交易
---
src/main/resources/mapper/StockAiOrderMapper.xml | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 48 insertions(+), 0 deletions(-)
diff --git a/src/main/resources/mapper/StockAiOrderMapper.xml b/src/main/resources/mapper/StockAiOrderMapper.xml
new file mode 100644
index 0000000..9aa1fb3
--- /dev/null
+++ b/src/main/resources/mapper/StockAiOrderMapper.xml
@@ -0,0 +1,48 @@
+<?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.nq.dao.StockAiOrderMapper" >
+
+ <sql id="Base_Column_List" >
+ id, user_id, stock_ai_id, buy_date, buy_amount, remain_amount, real_earning, status, audit_date
+ </sql>
+
+ <select id="getAdminStockAiOrderList" resultType="com.nq.vo.stock.ai.StockAiOrderVO">
+ SELECT s.id, user_id, stock_ai_id, buy_date, buy_amount, remain_amount, real_earning, s.status, audit_date,
+ phone, real_name, stock_name, success_rate, expected_earning, cycle, a.stock_type
+ FROM stock_ai_order s
+ LEFT JOIN user u ON u.id = s.user_id
+ LEFT JOIN stock_ai a ON a.id = s.stock_ai_id
+ <where>
+ <if test="stockType != null and stockType != ''">
+ and a.stock_type = #{stockType}
+ </if>
+ <if test="status != null and status != ''">
+ and s.status = #{status}
+ </if>
+ <if test="userId != null">
+ and u.id = #{userId}
+ </if>
+ <if test="phone != null and phone != ''">
+ and u.phone like concat('%',#{phone},'%')
+ </if>
+ </where>
+ ORDER BY buy_date DESC
+ </select>
+
+ <select id="getStockAiOrderList" resultType="com.nq.vo.stock.ai.StockAiOrderTypeVO">
+ SELECT s.id, user_id, stock_ai_id, buy_date, buy_amount, remain_amount, real_earning, s.status, audit_date,
+ a.stock_name, a.stock_type
+ FROM stock_ai_order s
+ LEFT JOIN stock_ai a ON a.id = s.stock_ai_id
+ <where>
+ <if test="status != null and status != ''">
+ and s.status = #{status}
+ </if>
+ <if test="userId != null">
+ and user_id = #{userId}
+ </if>
+ </where>
+ ORDER BY buy_date DESC
+ </select>
+
+</mapper>
--
Gitblit v1.9.3