From 6681556b7f379908213fbe400d43dd108c330cd2 Mon Sep 17 00:00:00 2001
From: Fancy <Fancy.fx@outlook.com>
Date: 星期四, 16 一月 2025 16:26:45 +0800
Subject: [PATCH] product type

---
 pms-parent/pms-global/src/main/resources/mapper/PltProductMapper.xml |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/pms-parent/pms-global/src/main/resources/mapper/PltProductMapper.xml b/pms-parent/pms-global/src/main/resources/mapper/PltProductMapper.xml
index ecd826b..b00a373 100644
--- a/pms-parent/pms-global/src/main/resources/mapper/PltProductMapper.xml
+++ b/pms-parent/pms-global/src/main/resources/mapper/PltProductMapper.xml
@@ -41,6 +41,9 @@
     <select id="selectProNameById" parameterType="java.lang.Long" resultType="java.lang.String">
         select name proName from plt_product where id=#{proId,jdbcType=BIGINT}
     </select>
+    <select id="selectProTypeById" parameterType="java.lang.Long" resultType="java.lang.String">
+        select type proName from plt_product where id=#{proId,jdbcType=BIGINT}
+    </select>
   <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap2">
     <!--@mbg.generated-->
     select
@@ -159,7 +162,7 @@
     where p.deleted!=1
     <trim prefix="and " suffixOverrides="and">
       <if test="type != null and type != ''">
-        p.type = #{type,jdbcType=VARCHAR} and
+        p.type like concat('%', #{type}, '%') and
       </if>
     </trim>
     order by id desc
@@ -176,7 +179,7 @@
     where p.deleted!=1
     <trim prefix="and " suffixOverrides="and">
       <if test="type != null and type != ''">
-        p.type = #{type,jdbcType=VARCHAR} and
+        p.type like concat('%', #{type}, '%') and
       </if>
     </trim>
   </select>
@@ -211,7 +214,7 @@
     select max(code) from plt_product
   </select>
     <select id="exists" resultType="java.lang.Boolean">
-        select count(1) from plt_product where name = #{name}
+        select count(1) from plt_product where name = #{name} and type = #{type}
         <if test="id != null">
             and id != #{id}
         </if>

--
Gitblit v1.8.0