瀏覽代碼

完善藏品列表功能

zhangyang 2 年之前
父節點
當前提交
7f21a479f3

+ 2 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/PoTetherController.java

@@ -6,6 +6,7 @@ import javax.servlet.http.HttpServletResponse;
 
 
 import com.ruoyi.common.constant.UserConstants;
 import com.ruoyi.common.constant.UserConstants;
 import com.ruoyi.system.domain.PoCollection;
 import com.ruoyi.system.domain.PoCollection;
+import com.ruoyi.system.domain.PoTetherandcollection;
 import com.ruoyi.system.domain.PoUser;
 import com.ruoyi.system.domain.PoUser;
 import com.ruoyi.system.domain.vo.TetherVo;
 import com.ruoyi.system.domain.vo.TetherVo;
 import com.ruoyi.system.service.IPoUserService;
 import com.ruoyi.system.service.IPoUserService;
@@ -117,7 +118,7 @@ public class PoTetherController extends BaseController
     public TableDataInfo collectionList( @PathVariable("tetherId") Long tetherId){
     public TableDataInfo collectionList( @PathVariable("tetherId") Long tetherId){
 
 
         startPage();
         startPage();
-        List<PoCollection> collectionList = poTetherService.selectPoCollectionListById(tetherId);
+        List<PoTetherandcollection> collectionList = poTetherService.selectPoCollectionListById(tetherId);
         return getDataTable(collectionList);
         return getDataTable(collectionList);
     }
     }
 
 

+ 3 - 2
ruoyi-system/src/main/java/com/ruoyi/system/mapper/PoTetherMapper.java

@@ -3,8 +3,8 @@ package com.ruoyi.system.mapper;
 import java.util.Date;
 import java.util.Date;
 import java.util.List;
 import java.util.List;
 
 
-import com.ruoyi.system.domain.PoCollection;
 import com.ruoyi.system.domain.PoTether;
 import com.ruoyi.system.domain.PoTether;
+import com.ruoyi.system.domain.PoTetherandcollection;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Param;
 
 
 /**
 /**
@@ -98,10 +98,11 @@ public interface PoTetherMapper
 
 
     /**
     /**
      * 通过id查询藏品详细信息
      * 通过id查询藏品详细信息
+     *
      * @param tetherId
      * @param tetherId
      * @return
      * @return
      */
      */
-    List<PoCollection> selectPoCollectionListById(Long tetherId);
+    List<PoTetherandcollection> selectPoCollectionListById(Long tetherId);
 
 
     /**
     /**
      * 检验标题是否重复
      * 检验标题是否重复

+ 2 - 1
ruoyi-system/src/main/java/com/ruoyi/system/service/IPoTetherService.java

@@ -5,6 +5,7 @@ import java.util.List;
 
 
 import com.ruoyi.system.domain.PoCollection;
 import com.ruoyi.system.domain.PoCollection;
 import com.ruoyi.system.domain.PoTether;
 import com.ruoyi.system.domain.PoTether;
+import com.ruoyi.system.domain.PoTetherandcollection;
 import com.ruoyi.system.domain.vo.TetherVo;
 import com.ruoyi.system.domain.vo.TetherVo;
 
 
 /**
 /**
@@ -60,7 +61,7 @@ public interface IPoTetherService
      * @param
      * @param
      * @return
      * @return
      */
      */
-    List<PoCollection> selectPoCollectionListById(Long tetherId);
+    List<PoTetherandcollection> selectPoCollectionListById(Long tetherId);
 
 
     /**
     /**
      * 新增套系
      * 新增套系

+ 3 - 2
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/PoTetherServiceImpl.java

@@ -11,6 +11,7 @@ import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.bean.BeanUtils;
 import com.ruoyi.common.utils.bean.BeanUtils;
 import com.ruoyi.system.domain.PoCollection;
 import com.ruoyi.system.domain.PoCollection;
 import com.ruoyi.system.domain.PoNews;
 import com.ruoyi.system.domain.PoNews;
+import com.ruoyi.system.domain.PoTetherandcollection;
 import com.ruoyi.system.domain.vo.TetherVo;
 import com.ruoyi.system.domain.vo.TetherVo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
@@ -126,7 +127,7 @@ public class PoTetherServiceImpl implements IPoTetherService
      * @return
      * @return
      */
      */
     @Override
     @Override
-    public List<PoCollection> selectPoCollectionListById(Long tetherId) {
+    public List<PoTetherandcollection> selectPoCollectionListById(Long tetherId) {
 
 
         return poTetherMapper.selectPoCollectionListById(tetherId);
         return poTetherMapper.selectPoCollectionListById(tetherId);
     }
     }
@@ -143,7 +144,7 @@ public class PoTetherServiceImpl implements IPoTetherService
         this.poTetherMapper.insertPoTether(tetherVo);
         this.poTetherMapper.insertPoTether(tetherVo);
         Long tetherId = tetherVo.getTetherId();
         Long tetherId = tetherVo.getTetherId();
         //套系包含藏品
         //套系包含藏品
-        List<PoCollection> poCollections = tetherVo.getPoCollections();
+        List<PoTetherandcollection> poCollections = tetherVo.getPoTetherandcollections();
         poCollections.stream().map((item)->{
         poCollections.stream().map((item)->{
             item.setTetherId(tetherId);
             item.setTetherId(tetherId);
             return item;
             return item;

+ 11 - 4
ruoyi-system/src/main/resources/mapper/system/PoTetherMapper.xml

@@ -23,7 +23,7 @@
         <result property="cochain"    column="cochain"    />
         <result property="cochain"    column="cochain"    />
     </resultMap>
     </resultMap>
 
 
-    <resultMap type="PoCollection" id="PoCollectionResult">
+    <resultMap type="PoTetherandcollection" id="PoTetherandcollectionResult">
         <result property="collectionId"    column="collection_id"    />
         <result property="collectionId"    column="collection_id"    />
         <result property="collectionTitle"    column="collection_title"    />
         <result property="collectionTitle"    column="collection_title"    />
         <result property="status"    column="status"    />
         <result property="status"    column="status"    />
@@ -42,10 +42,11 @@
         <result property="story"    column="story"    />
         <result property="story"    column="story"    />
         <result property="grounding"    column="grounding"    />
         <result property="grounding"    column="grounding"    />
         <result property="cochain"    column="cochain"    />
         <result property="cochain"    column="cochain"    />
+        <result property="tetherId"    column="tether_id"    />
     </resultMap>
     </resultMap>
 
 
     <sql id="selectPoTetherVo">
     <sql id="selectPoTetherVo">
-        select tether_id, tether_name, show_time, create_by, create_time, update_by, update_time, total, status, remark ,sell_status,del_flag,image,exchange ,grounding,cochain from po_tether
+        select tether_id, tether_name, show_time, create_by, create_time, update_by, update_time, total, status, remark ,sell_status,del_flag,image,exchange ,grounding,cochain ,tether_id from po_tether
     </sql>
     </sql>
 
 
 <!--在售-->
 <!--在售-->
@@ -60,6 +61,7 @@
             <if test="exchange != null">and exchange = #{exchange}</if>
             <if test="exchange != null">and exchange = #{exchange}</if>
             <if test="grounding != null">and grounding = #{grounding}</if>
             <if test="grounding != null">and grounding = #{grounding}</if>
             <if test="cochain != null">and cochain = #{cochain}</if>
             <if test="cochain != null">and cochain = #{cochain}</if>
+            <if test="tetherId != null">and tether_id = #{tetherId}</if>
             and del_flag = '0'
             and del_flag = '0'
             and sell_status = 0
             and sell_status = 0
         </where>
         </where>
@@ -93,6 +95,7 @@
             <if test="exchange != null">and exchange = #{exchange}</if>
             <if test="exchange != null">and exchange = #{exchange}</if>
             <if test="grounding != null">and grounding = #{grounding}</if>
             <if test="grounding != null">and grounding = #{grounding}</if>
             <if test="cochain != null">and cochain = #{cochain}</if>
             <if test="cochain != null">and cochain = #{cochain}</if>
+            <if test="tetherId != null">and tether_id = #{tetherId}</if>
             and del_flag = '0'
             and del_flag = '0'
             and sell_status = 1
             and sell_status = 1
         </where>
         </where>
@@ -127,15 +130,16 @@
             <if test="exchange != null">and exchange = #{exchange}</if>
             <if test="exchange != null">and exchange = #{exchange}</if>
             <if test="grounding != null">and grounding = #{grounding}</if>
             <if test="grounding != null">and grounding = #{grounding}</if>
             <if test="cochain != null">and cochain = #{cochain}</if>
             <if test="cochain != null">and cochain = #{cochain}</if>
+            <if test="tetherId != null">and tether_id = #{tetherId}</if>
             and del_flag = '0'
             and del_flag = '0'
         </where>
         </where>
 
 
     </select>
     </select>
 
 
 <!--    根据套系id 查询对应藏品按钮里面的藏品信息-->
 <!--    根据套系id 查询对应藏品按钮里面的藏品信息-->
-    <select id="selectPoCollectionListById" resultMap="PoCollectionResult" >
+    <select id="selectPoCollectionListById" resultMap="PoTetherandcollectionResult" >
         select c.collection_title , c.image , c.collection_type , c.create_time , c.create_by
         select c.collection_title , c.image , c.collection_type , c.create_time , c.create_by
-             , c.total , c.status , c.price , c.story , c.grounding , c.cochain from po_collection c
+             , c.total , c.status , c.price , c.story , c.grounding , c.cochain ,c.tether_id from po_Tetherandcollection c
              left join po_tether t on t.tether_id = c.tether_id where t.tether_id = #{tetherId}
              left join po_tether t on t.tether_id = c.tether_id where t.tether_id = #{tetherId}
 
 
     </select>
     </select>
@@ -177,6 +181,7 @@
             <if test="exchange != null">exchange,</if>
             <if test="exchange != null">exchange,</if>
             <if test="grounding != null">grounding,</if>
             <if test="grounding != null">grounding,</if>
             <if test="cochain != null">cochain,</if>
             <if test="cochain != null">cochain,</if>
+            <if test="tetherId != null ">tether_id,</if>
         </trim>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="tetherName != null">#{tetherName},</if>
             <if test="tetherName != null">#{tetherName},</if>
@@ -193,6 +198,7 @@
             <if test="exchange != null ">#{exchange},</if>
             <if test="exchange != null ">#{exchange},</if>
             <if test="grounding != null">#{grounding},</if>
             <if test="grounding != null">#{grounding},</if>
             <if test="cochain != null">#{cochain},</if>
             <if test="cochain != null">#{cochain},</if>
+            <if test="tetherId != null">#{tetherId},</if>
         </trim>
         </trim>
     </insert>
     </insert>
 
 
@@ -213,6 +219,7 @@
             <if test="exchange != null">exchange = #{exchange},</if>
             <if test="exchange != null">exchange = #{exchange},</if>
             <if test="grounding != null">grounding = #{grounding},</if>
             <if test="grounding != null">grounding = #{grounding},</if>
             <if test="cochain != null">cochain = #{cochain},</if>
             <if test="cochain != null">cochain = #{cochain},</if>
+            <if test="tetherId != null">tether_id #{tetherId},</if>
         </trim>
         </trim>
         where tether_id = #{tetherId}
         where tether_id = #{tetherId}
     </update>
     </update>