Procházet zdrojové kódy

藏品Service层框架

Signed-off-by: hamjin <335908093@qq.com>
hamjin před 2 roky
rodič
revize
a6c5ef2c87

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

@@ -0,0 +1,67 @@
+package com.ruoyi.system.service;
+
+import com.ruoyi.system.domain.PoCollection;
+
+import java.util.List;
+
+/**
+ * 消息接口
+ */
+public interface IPoCollectionService {
+    /**
+     * 根据Id查询
+     *
+     * @param collectionIdList 要查询的藏品ID
+     * @return 藏品ID对应的藏品
+     */
+    public List<PoCollection> selectCollectionByCollectionId(Long[] collectionIdList);
+
+    /**
+     * 增加
+     *
+     * @param collection 藏品信息
+     * @return 操作状态
+     */
+    public int insertCollection(PoCollection collection);
+
+    /**
+     * 修改
+     *
+     * @param collection 更新的藏品信息
+     * @return 操作状态
+     */
+    public int updateCollection(PoCollection collection);
+
+    /**
+     * 批量删除
+     *
+     * @param collectionIds
+     * @return
+     */
+    int deleteCollectionByIds(Long[] collectionIds);
+
+    /**
+     * 删除
+     *
+     * @param collectionId
+     * @return
+     */
+    int deleteCollectionById(Long collectionId);
+
+    /**
+     * 获取符合要求的藏品
+     *
+     * @param collection 搜索的藏品信息
+     * @return 符合要求的藏品,默认为全部藏品
+     */
+    List<PoCollection> selectCollections(PoCollection collection);
+
+    /**
+     * 获取藏品详细内容
+     *
+     * @param collectionId 藏品ID
+     * @return 藏品信息
+     */
+    PoCollection selectCollectionById(Long collectionId);
+}
+

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

@@ -0,0 +1,95 @@
+package com.ruoyi.system.service.impl;
+
+import com.ruoyi.system.domain.PoCollection;
+import com.ruoyi.system.mapper.PoCollectionMapper;
+import com.ruoyi.system.service.IPoCollectionService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class PoCollectionServiceImpl implements IPoCollectionService {
+    @Autowired
+    PoCollectionMapper poCollectionMapper;
+
+    /**
+     * 根据Id查询
+     *
+     * @param collectionIdList 要查询的藏品ID表
+     * @return 藏品ID对应的藏品
+     */
+    @Override
+    public List<PoCollection> selectCollectionByCollectionId(Long[] collectionIdList) {
+        return null;
+    }
+
+    /**
+     * 获取符合要求的藏品
+     *
+     * @param collection 搜索的藏品信息
+     * @return 符合要求的藏品,默认为全部藏品
+     */
+    @Override
+    public List<PoCollection> selectCollections(PoCollection collection) {
+        return null;
+    }
+
+    /**
+     * 获取藏品详细内容
+     *
+     * @param collectionId 藏品ID
+     * @return 藏品信息
+     */
+    @Override
+    public PoCollection selectCollectionById(Long collectionId) {
+        return null;
+    }
+
+    /**
+     * 增加
+     *
+     * @param collection 藏品信息
+     * @return 操作状态
+     */
+    @Override
+    public int insertCollection(PoCollection collection) {
+        List<PoCollection> poCollection = poCollectionMapper.selectPoCollectionList(collection);
+        if (poCollection != null)
+            return -1;
+        return poCollectionMapper.insertPoCollection(collection);
+    }
+
+    /**
+     * 修改
+     *
+     * @param collection 更新的藏品信息
+     * @return 操作状态
+     */
+    @Override
+    public int updateCollection(PoCollection collection) {
+        return poCollectionMapper.updatePoCollection(collection);
+    }
+
+    /**
+     * 批量删除
+     *
+     * @param collectionIds 藏品ID
+     * @return 操作状态
+     */
+    @Override
+    public int deleteCollectionByIds(Long[] collectionIds) {
+        return 0;
+    }
+
+    /**
+     * 单个删除
+     *
+     * @param collectionId 藏品ID
+     * @return 操作状态
+     */
+    @Override
+    public int deleteCollectionById(Long collectionId) {
+        return 0;
+    }
+}