From d93356927d8a0a5a91963c28d461d9107562d759 Mon Sep 17 00:00:00 2001
From: xin <1099200748@qq.com>
Date: Fri, 30 May 2025 17:38:26 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/xin'

---
 oying-system/src/main/resources/mapper/pc/product/ProductMapper.xml |   60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 60 insertions(+), 0 deletions(-)

diff --git a/oying-system/src/main/resources/mapper/pc/product/ProductMapper.xml b/oying-system/src/main/resources/mapper/pc/product/ProductMapper.xml
new file mode 100644
index 0000000..43a18b8
--- /dev/null
+++ b/oying-system/src/main/resources/mapper/pc/product/ProductMapper.xml
@@ -0,0 +1,60 @@
+<?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.oying.modules.pc.product.mapper.ProductMapper">
+    <resultMap id="BaseResultMap" type="com.oying.modules.pc.product.domain.Product">
+        <id column="product_id" property="productId"/>
+        <result column="store_id" property="storeId"/>
+        <result column="code" property="code"/>
+        <result column="barcode" property="barcode"/>
+        <result column="name" property="name"/>
+        <result column="title" property="title"/>
+        <result column="category_id" property="categoryId"/>
+        <result column="second_category_id" property="secondCategoryId"/>
+        <result column="status" property="status"/>
+        <result column="main_image" property="mainImage"/>
+        <result column="detail_image" property="detailImage"/>
+        <result column="description" property="description"/>
+        <result column="price" property="price"/>
+        <result column="stock_quantity" property="stockQuantity"/>
+        <result column="min_purchase_quantity" property="minPurchaseQuantity"/>
+        <result column="warn_stock" property="warnStock"/>
+        <result column="weight" property="weight"/>
+        <result column="width" property="width"/>
+        <result column="length" property="length"/>
+        <result column="height" property="height"/>
+        <result column="deleted_flag" property="deletedFlag"/>
+        <result column="version" property="version"/>
+    </resultMap>
+
+    <sql id="Base_Column_List">
+        product_id, store_id, code, barcode, name, title, category_id, second_category_id, status, main_image, detail_image, description, price, stock_quantity, min_purchase_quantity, warn_stock, weight, width, length, height, deleted_flag, create_by, create_time, update_by, update_time, version
+    </sql>
+
+    <select id="findAll" resultMap="BaseResultMap">
+        select
+        <include refid="Base_Column_List"/>
+        from pc_product
+        <where>
+            <if test="criteria.storeId != null">
+                and store_id = #{criteria.storeId}
+            </if>
+            <if test="criteria.categoryId != null">
+                and category_id = #{criteria.categoryId}
+            </if>
+            <if test="criteria.secondCategoryId != null">
+                and second_category_id = #{criteria.secondCategoryId}
+            </if>
+            <if test="criteria.blurry != null and criteria.blurry != ''">
+                and (name like concat('%',#{criteria.blurry},'%') or title like concat('%',#{criteria.blurry},'%'))
+            </if>
+            <if test="criteria.status != null">
+                and status = #{criteria.status}
+            </if>
+            <if test="criteria.active != null">
+                and active = #{criteria.active}
+            </if>
+        </where>
+        order by product_id desc
+    </select>
+
+</mapper>
\ No newline at end of file

--
Gitblit v1.9.3