From 919acbd3e8148ffc5dfabc6d6468fa90f868a3cc Mon Sep 17 00:00:00 2001
From: 彭雪彬 <1724387007@qq.com>
Date: Tue, 21 Oct 2025 17:49:45 +0800
Subject: [PATCH] 邀请新用户记录添加

---
 oying-system/src/main/resources/mapper/pc/product/ProductAuditMapper.xml |   52 ++++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 46 insertions(+), 6 deletions(-)

diff --git a/oying-system/src/main/resources/mapper/pc/product/ProductAuditMapper.xml b/oying-system/src/main/resources/mapper/pc/product/ProductAuditMapper.xml
index f36506a..3cad00d 100644
--- a/oying-system/src/main/resources/mapper/pc/product/ProductAuditMapper.xml
+++ b/oying-system/src/main/resources/mapper/pc/product/ProductAuditMapper.xml
@@ -16,22 +16,62 @@
         <result column="update_time" property="updateTime"/>
     </resultMap>
 
+    <resultMap id="JoinResultMap" type="com.oying.modules.pc.product.view.ProductAuditView">
+        <result column="product_id" property="productId"/>
+        <result column="product_name" property="productName"/>
+        <result column="product_title" property="productTitle"/>
+        <result column="audit_id" property="auditId"/>
+        <result column="type" property="type"/>
+        <result column="status" property="status"/>
+        <result column="data" property="data"/>
+        <result column="reason" property="reason"/>
+        <result column="auditor" property="auditor"/>
+        <result column="audit_time" property="auditTime"/>
+        <result column="create_by" property="createBy"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_by" property="updateBy"/>
+        <result column="update_time" property="updateTime"/>
+    </resultMap>
+
     <sql id="Base_Column_List">
         audit_id, product_id, type, status, reason, auditor, audit_time, data, create_by, create_time, update_by, update_time
     </sql>
 
-    <select id="findAll" resultMap="BaseResultMap">
+    <sql id="Join_Column_List">
+        p.name as product_name, p.title as product_title,
+        pa.audit_id, pa.product_id, pa.type, pa.status, pa.reason, pa.auditor, pa.audit_time, pa.data, pa.create_by, pa.create_time, pa.update_by, pa.update_time
+    </sql>
+
+    <select id="findAll" resultMap="JoinResultMap">
         select
-        <include refid="Base_Column_List"/>
-        from pc_product_audit
+        <include refid="Join_Column_List"/>
+        from pc_product_audit as pa left join pc_product as p on pa.product_id = p.product_id
         <where>
+            <if test="criteria.blurry != null and criteria.blurry != ''">
+                and p.name like concat('%', #{criteria.blurry}, '%')
+            </if>
+            <if test="criteria.productName != null and criteria.productName != ''">
+                and p.name like concat('%', #{criteria.productName}, '%')
+            </if>
+            <if test="criteria.blurry != null and criteria.blurry != ''">
+                and p.title like concat('%', #{criteria.blurry}, '%')
+            </if>
+            <if test="criteria.productTitle != null and criteria.productTitle != ''">
+                and p.title like concat('%', #{criteria.productTitle}, '%')
+            </if>
             <if test="criteria.productId != null">
-                and product_id = #{criteria.productId}
+                and pa.product_id = #{criteria.productId}
             </if>
             <if test="criteria.type != null and criteria.type != ''">
-                and type = #{criteria.type}
+                and pa.type = #{criteria.type}
+            </if>
+            <if test="criteria.status != null">
+                and pa.status = #{criteria.status}
+            </if>
+            <if test="criteria.createBy != null and criteria.createBy != ''">
+                and pa.create_by = #{criteria.createBy}
             </if>
         </where>
-        order by audit_id desc
+        order by pa.audit_id desc
     </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.3