Browse Source

获取藏品列表详情

zhangyang 2 years ago
parent
commit
f1e8c600b9

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

@@ -9,6 +9,7 @@ import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.system.domain.PoCollection;
 import com.ruoyi.system.domain.vo.TetherVo;
 import com.ruoyi.system.service.IPoUserService;
+import com.ruoyi.system.service.impl.PoCollectionServiceImpl;
 import io.swagger.annotations.ApiOperation;
 import net.sf.jsqlparser.util.validation.metadata.DatabaseException;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -40,6 +41,9 @@ public class PoTetherController extends BaseController
     @Autowired
     private IPoUserService poUserService;
 
+    @Autowired
+    private PoCollectionServiceImpl poCollectionService;
+
     /**
      * 标题和时间搜索消息列表
      */
@@ -129,7 +133,7 @@ public class PoTetherController extends BaseController
     public TableDataInfo collectionList( @PathVariable("tetherId") Long tetherId){
 
         startPage();
-        List<PoCollection> collectionList = poTetherService.selectPoCollectionListById(tetherId);
+        List<PoCollection> collectionList = poCollectionService.selectPoCollectionListById(tetherId);
         return getDataTable(collectionList);
     }
 

+ 7 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/PoCollectionMapper.java

@@ -67,4 +67,11 @@ public interface PoCollectionMapper extends BaseMapper<PoCollection> {
             "sold_out = case when count > 0 then 0 when count = 0 then 0 end " +
             "where collection_id = #{collectionId} and sold_out = 0 and count >= #{count}")
     int updateSellCount(Long collectionId, Long count);
+
+    /**
+     * 藏品按钮
+     * @param tetherId
+     * @return
+     */
+    List<PoCollection> selectPoCollectionListById(Long tetherId);
 }

+ 7 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/IPoCollectionService.java

@@ -74,5 +74,12 @@ public interface IPoCollectionService extends IService<PoCollection> {
      * 定时更新藏品状态
      */
     void updateCollectionStatus();
+
+    /**
+     * 藏品按钮
+     * @param tetherId
+     * @return
+     */
+    List<PoCollection> selectPoCollectionListById(Long tetherId);
 }
 

+ 10 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/PoCollectionServiceImpl.java

@@ -132,4 +132,14 @@ public class PoCollectionServiceImpl extends ServiceImpl<PoCollectionMapper,PoCo
     public void updateCollectionStatus() {
         poCollectionMapper.updateCollectionStatus();
     }
+
+    /**
+     * 藏品按钮
+     * @param tetherId
+     * @return
+     */
+    @Override
+    public List<PoCollection> selectPoCollectionListById(Long tetherId) {
+        return poCollectionMapper.selectPoCollectionListById(tetherId);
+    }
 }

+ 7 - 0
ruoyi-system/src/main/resources/mapper/system/PoCollectionMapper.xml

@@ -64,6 +64,13 @@
         </where>
     </select>
 
+    <select id="selectPoCollectionListById" resultType="PoCollection" resultMap="PoCollectionResult">
+
+        <include refid="selectPoCollectionVo"></include>
+        where tether_id = #{tetherId}
+
+    </select>
+
     <insert id="insertPoCollection" parameterType="PoCollection" useGeneratedKeys="true" keyProperty="collectionId">
         insert into po_collection (
         <if test="collectionTitle != null and collectionTitle != '' ">collection_title,</if>