From 591e3b8a10ed15023f3ad9e5a72a887ef89b0bb2 Mon Sep 17 00:00:00 2001
From: 刘小明 <liuxm_a@163.com>
Date: 星期一, 26 八月 2024 20:47:46 +0800
Subject: [PATCH] 修改判空方式

---
 pms-parent/pms-global/src/main/resources/mapper/OthFileMapper.xml |   70 ++++++++++++++++++-----------------
 1 files changed, 36 insertions(+), 34 deletions(-)

diff --git a/pms-parent/pms-global/src/main/resources/mapper/OthFileMapper.xml b/pms-parent/pms-global/src/main/resources/mapper/OthFileMapper.xml
index 79591c6..a29bce5 100644
--- a/pms-parent/pms-global/src/main/resources/mapper/OthFileMapper.xml
+++ b/pms-parent/pms-global/src/main/resources/mapper/OthFileMapper.xml
@@ -10,12 +10,14 @@
     <result column="new_name" property="newName" />
     <result column="hash" property="hash" />
     <result column="file_path" property="filePath" />
-    <result column="download_path" property="downloadPath" />
     <result column="dt" property="dt" />
   </resultMap>
   <sql id="Base_Column_List">
     <!--@mbg.generated-->
-    id, org_name, ext_name, new_name, hash, file_path, download_path, dt
+    id, org_name, ext_name, new_name, hash, file_path, dt
+  </sql>
+  <sql id="Join_Column_List">
+    ${alias}.id, ${alias}.org_name, ${alias}.ext_name, ${alias}.new_name, ${alias}.hash, ${alias}.file_path, ${alias}.dt
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
     <!--@mbg.generated-->
@@ -31,63 +33,57 @@
   </delete>
   <insert id="insert" parameterType="com.dy.pmsGlobal.pojoOth.OthFile">
     <!--@mbg.generated-->
-    insert into oth_file (id, org_name, ext_name, new_name, hash, file_path, download_path, 
+    insert into oth_file (id, org_name, ext_name, new_name, hash, file_path,
       dt)
-    values (#{id}, #{orgName}, #{extName}, #{newName}, #{hash}, #{filePath}, #{downloadPath}, 
+    values (#{id}, #{orgName}, #{extName}, #{newName}, #{hash}, #{filePath},
       #{dt})
   </insert>
   <insert id="insertSelective" parameterType="com.dy.pmsGlobal.pojoOth.OthFile">
     <!--@mbg.generated-->
     insert into oth_file
     <trim prefix="(" suffix=")" suffixOverrides=",">
-      <if test="id != null">
+      <if test="id != null and id !=''">
         id,
       </if>
-      <if test="orgName != null">
+      <if test="orgName!= null and orgName !=''">
         org_name,
       </if>
-      <if test="extName != null">
+      <if test="extName!= null and extName !=''">
         ext_name,
       </if>
-      <if test="newName != null">
+      <if test="newName!= null and newName !=''">
         new_name,
       </if>
-      <if test="hash != null">
+      <if test="hash!= null and hash !=''">
         hash,
       </if>
-      <if test="filePath != null">
+      <if test="filePath!= null and filePath !=''">
         file_path,
       </if>
-      <if test="downloadPath != null">
-        download_path,
-      </if>
-      <if test="dt != null">
+      <if test="dt != null and dt !=''">
         dt,
       </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
-      <if test="id != null">
+      <if test="id != null and id !=''">
         #{id},
       </if>
-      <if test="orgName != null">
+      <if test="orgName!= null and orgName !=''">
         #{orgName},
       </if>
-      <if test="extName != null">
+      <if test="extName!= null and extName !=''">
         #{extName},
       </if>
-      <if test="newName != null">
+      <if test="newName!= null and newName !=''">
         #{newName},
       </if>
-      <if test="hash != null">
+      <if test="hash!= null and hash !=''">
         #{hash},
       </if>
-      <if test="filePath != null">
+      <if test="filePath!= null and filePath !=''">
         #{filePath},
       </if>
-      <if test="downloadPath != null">
-        #{downloadPath},
-      </if>
-      <if test="dt != null">
+      <if test="dt != null and dt !=''">
         #{dt},
       </if>
     </trim>
@@ -96,25 +92,22 @@
     <!--@mbg.generated-->
     update oth_file
     <set>
-      <if test="orgName != null">
+      <if test="orgName!= null and orgName !=''">
         org_name = #{orgName},
       </if>
-      <if test="extName != null">
+      <if test="extName!= null and extName !=''">
         ext_name = #{extName},
       </if>
-      <if test="newName != null">
+      <if test="newName!= null and newName !=''">
         new_name = #{newName},
       </if>
-      <if test="hash != null">
+      <if test="hash!= null and hash !=''">
         hash = #{hash},
       </if>
-      <if test="filePath != null">
+      <if test="filePath!= null and filePath !=''">
         file_path = #{filePath},
       </if>
-      <if test="downloadPath != null">
-        download_path = #{downloadPath},
-      </if>
-      <if test="dt != null">
+      <if test="dt != null and dt !=''">
         dt = #{dt},
       </if>
     </set>
@@ -128,8 +121,17 @@
       new_name = #{newName},
       hash = #{hash},
       file_path = #{filePath},
-      download_path = #{downloadPath},
       dt = #{dt}
     where id = #{id}
   </update>
+
+  <select id="selectByProId" resultMap="BaseResultMap">
+    select
+    <include refid="Join_Column_List">
+        <property name="alias" value="f"/>
+    </include>
+    from oth_file f
+    inner join plt_product_file pf on f.id = pf.file_id
+    where pf.pro_id = #{proId}
+  </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.8.0