From 530385f0901cb838540bc3f83d573686eb3a3bb4 Mon Sep 17 00:00:00 2001
From: liuxm <liuxm@fescotech.com>
Date: 星期四, 16 五月 2024 17:48:47 +0800
Subject: [PATCH] 按功能点添加权限;工站添加生产线关联

---
 pms-parent/pms-global/src/main/resources/mapper/PltProductMapper.xml |   79 +++++++++++++++++++--------------------
 1 files changed, 39 insertions(+), 40 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 00d97f0..0714a04 100644
--- a/pms-parent/pms-global/src/main/resources/mapper/PltProductMapper.xml
+++ b/pms-parent/pms-global/src/main/resources/mapper/PltProductMapper.xml
@@ -8,18 +8,41 @@
     <result column="name" jdbcType="VARCHAR" property="name" />
     <result column="type" jdbcType="VARCHAR" property="type" />
     <result column="image" jdbcType="BIGINT" property="image" />
-    <result column="director" jdbcType="BIGINT" property="director" />
+    <result column="director" jdbcType="VARCHAR" property="director" />
     <result column="d_mobile" jdbcType="VARCHAR" property="dMobile" />
-    <result column="deleted" property="deleted" typeHandler="com.dy.common.mybatis.BooleanTypeHandler" />
+    <result property="deleted" column="deleted" typeHandler="com.dy.common.mybatis.BooleanTypeHandler"/>
     <result column="dt" jdbcType="TIMESTAMP" property="dt" />
     <result column="remark" jdbcType="VARCHAR" property="remark" />
-    <association property="directorName" column="director" javaType="java.lang.Long"
-                 select="com.dy.pmsGlobal.daoBa.BaUserMapper.selectNameById" />
+    <collection property="params" ofType="com.dy.pmsGlobal.pojoPlt.PltProductParams" fetchType="eager" select="selectParams" column="id" />
+    <collection property="processDocuments" ofType="com.dy.pmsGlobal.pojoPlt.PltProductFile" fetchType="eager" select="selectDocuments" column="id"/>
+    <collection property="userManual" ofType="com.dy.pmsGlobal.pojoPlt.PltProductFile" fetchType="eager" select="selectUserManual" column="id" />
+    <collection property="materials" ofType="com.dy.pmsGlobal.pojoPlt.PltProductFile" fetchType="eager" select="selectMaterials" column="id"/>
   </resultMap>
+
   <sql id="Base_Column_List">
     <!--@mbg.generated-->
     id, `name`, `type`, image, director, d_mobile,deleted, dt, remark
   </sql>
+  <select id="selectParams" resultMap="com.dy.pmsGlobal.daoPlt.PltProParamsMapper.BaseResultMap">
+    select *
+    from plt_product_params
+    where pro_id = #{proId,jdbcType=BIGINT} and deleted !=1
+  </select>
+  <select id="selectDocuments" resultMap="com.dy.pmsGlobal.daoPlt.PltProductFileMapper.BaseResultMap">
+    select *
+    from plt_product_file
+    where pro_id = #{proId,jdbcType=BIGINT} and file_type = '01'
+  </select>
+  <select id="selectUserManual" resultMap="com.dy.pmsGlobal.daoPlt.PltProductFileMapper.BaseResultMap">
+    select *
+    from plt_product_file
+    where pro_id = #{proId,jdbcType=BIGINT} and file_type = '02'
+  </select>
+  <select id="selectMaterials" resultMap="com.dy.pmsGlobal.daoPlt.PltProductFileMapper.BaseResultMap">
+    select *
+    from plt_product_file
+    where pro_id = #{proId,jdbcType=BIGINT} and file_type = '03'
+  </select>
 
   <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
     <!--@mbg.generated-->
@@ -28,11 +51,7 @@
     from plt_product
     where id = #{id,jdbcType=BIGINT}
   </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
-    <!--@mbg.generated-->
-    delete from plt_product
-    where id = #{id,jdbcType=BIGINT}
-  </delete>
+
   <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pmsGlobal.pojoPlt.PltProduct" useGeneratedKeys="true">
     <!--@mbg.generated-->
     insert into plt_product (`name`, `type`, image,
@@ -143,27 +162,12 @@
   </sql>
   <select id="selectSome" resultMap="BaseResultMap">
     select
-    <include refid="Join_Column_List" >
-      <property name="alias" value="p"/>
-    </include>
+    <include refid="Base_Column_List" />
     from plt_product p
-    left join ba_user u on u.id=p.director
-    where p.deleted!=1 and u.deleted!=1
+    where p.deleted!=1
     <trim prefix="and " suffixOverrides="and">
       <if test="type != null and type != ''">
         p.type = #{type,jdbcType=VARCHAR} and
-      </if>
-      <if test="name != null and name != ''">
-        p.name like concat('%', #{name}, '%') and
-      </if>
-      <if test="director != null  and director != '' ">
-        u.name like concat('%', #{director}, '%') and
-      </if>
-      <if test="dMobile != null and dMobile != '' ">
-        p.d_mobile =#{dMobile,jdbcType=VARCHAR} and
-      </if>
-      <if test="dt != null and dt != '' ">
-        DATE_FORMAT(p.dt, '%Y-%m-%d') = #{dt,jdbcType=TIMESTAMP}
       </if>
     </trim>
     order by id desc
@@ -177,24 +181,19 @@
   <select id="selectSomeCount" resultType="java.lang.Long">
     select count(1)
     from plt_product p
-    left join ba_user u on u.id=p.director
-    where p.deleted!=1 and u.deleted!=1
+    where p.deleted!=1
     <trim prefix="and " suffixOverrides="and">
       <if test="type != null and type != ''">
         p.type = #{type,jdbcType=VARCHAR} and
       </if>
-      <if test="name != null and name != ''">
-        u.name like concat('%', #{name}, '%') and
-      </if>
-      <if test="director != null  and director != '' ">
-        p.director like concat('%', #{director}, '%') and
-      </if>
-      <if test="dMobile != null and dMobile != '' ">
-        p.d_mobile =#{dMobile,jdbcType=VARCHAR} and
-      </if>
-      <if test="dt != null and dt != '' ">
-        DATE_FORMAT(p.dt, '%Y-%m-%d') = #{dt,jdbcType=TIMESTAMP}
-      </if>
     </trim>
   </select>
+  <select id="selectAll" resultType="com.dy.pmsGlobal.pojoPlt.PltProduct">
+    select
+    <include refid="Base_Column_List" />
+    from plt_product p
+    where p.deleted!=1
+    order by id desc
+  </select>
+
 </mapper>
\ No newline at end of file

--
Gitblit v1.8.0