6 Commits d3872cc505 ... bc53e10809

Author SHA1 Message Date
  hamjin bc53e10809 套系:添加Mapper和TableId 2 years ago
  hamjin b7407b353e 添加定时任务 2 years ago
  hamjin f50c0cbaf6 基础类:忽略不存在的字段 2 years ago
  hamjin 7dab19ad7f 藏品管理: 引入MyBatisPlus 2 years ago
  hamjin ce6855a24b 通知公告:使用LomBook 2 years ago
  hamjin 80f38a6b6e 添加LomBook依赖 2 years ago

+ 7 - 5
ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/SpringTaskConfig.java

@@ -2,22 +2,24 @@ package com.ruoyi.web.controller.common;
 
 
 import com.ruoyi.system.mapper.PoTetherMapper;
+import com.ruoyi.system.service.IPoCollectionService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.scheduling.annotation.EnableScheduling;
 import org.springframework.scheduling.annotation.Scheduled;
 
-import java.util.Date;
-
 @Configuration
 @EnableScheduling
 public class SpringTaskConfig {
     @Autowired
     PoTetherMapper poTetherMapper;
 
+    @Autowired
+    IPoCollectionService collectionService;
+
     @Scheduled(cron = "0/5 * * * * ?")
-    public  void cron() {
-      Integer i =  poTetherMapper.updateSellStatus();
-      System.out.println(i);
+    public void cron() {
+        poTetherMapper.updateSellStatus();
+        collectionService.updateCollectionStatus();
     }
 }

+ 76 - 24
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/PoCollectionController.java

@@ -9,12 +9,14 @@ import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.system.domain.PoCollection;
 import com.ruoyi.system.service.IPoCollectionService;
 import io.swagger.annotations.ApiOperation;
+import lombok.extern.log4j.Log4j2;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletResponse;
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -23,7 +25,8 @@ import java.util.List;
  * @author ruoyi
  */
 @RestController
-@RequestMapping("/collections")
+@RequestMapping("/system/collections")
+@Log4j2
 public class PoCollectionController extends BaseController {
     @Autowired
     private IPoCollectionService collectionService;
@@ -33,36 +36,57 @@ public class PoCollectionController extends BaseController {
      */
     @PreAuthorize("@ss.hasPermi('system:collection:list')")
     @GetMapping("/list")
-    @ApiOperation("藏品列表 查询和搜索")
-    public TableDataInfo list(PoCollection poCollection)
-    {
+    @ApiOperation("藏品列表 查询")
+    @Log(title = "藏品", businessType = BusinessType.EXPORT)
+    public TableDataInfo list(@RequestBody(required = false) PoCollection poCollection) {
         startPage();
         List<PoCollection> list = collectionService.selectPoCollectionList(poCollection);
         return getDataTable(list);
     }
 
+    /**
+     * 获取藏品列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:collection:list')")
+    @GetMapping("/query")
+    @ApiOperation("藏品列表 搜索")
+    @Log(title = "藏品", businessType = BusinessType.EXPORT)
+    public TableDataInfo query(@RequestParam(value = "collectionName", required = false) String collectionName,
+                               @RequestParam(value = "startTime", required = false) Date startTime,
+                               @RequestParam(value = "endTime", required = false) Date endTime,
+                               @RequestParam(value = "status", required = false) Long status,
+                               @RequestParam(value = "delFlag", required = false) Long delFlag) {
+
+        startPage();
+        List<PoCollection> list = collectionService.queryPoCollectionList(collectionName, startTime, endTime, status, delFlag);
+        return getDataTable(list);
+    }
+
     /**
      * 导出藏品列表
      */
     @PreAuthorize("@ss.hasPermi('system:collection:export')")
     @Log(title = "获取藏品列表", businessType = BusinessType.EXPORT)
-    @PostMapping("/export")
+    @GetMapping("/export")
     @ApiOperation("藏品列表导出")
-    public void export(HttpServletResponse response, PoCollection poCollection)
-    {
-        List<PoCollection> list = collectionService.selectPoCollectionList(poCollection);
-        ExcelUtil<PoCollection> util = new ExcelUtil<>(PoCollection.class);
-        util.exportExcel(response, list, "藏品数据");
+    public void export(HttpServletResponse response,
+                       @RequestParam(value = "collectionName", required = false) String collectionName,
+                       @RequestParam(value = "startTime", required = false) Date startTime,
+                       @RequestParam(value = "endTime", required = false) Date endTime,
+                       @RequestParam(value = "status", required = false) Long status,
+                       @RequestParam(value = "delFlag", required = false) Long delFlag) {
+        List<PoCollection> list = collectionService.queryPoCollectionList(collectionName, startTime, endTime, status, delFlag);
+        new ExcelUtil<>(PoCollection.class).exportExcel(response, list, "藏品数据");
     }
 
     /**
      * 根据藏品编号获取详细信息
      */
     @PreAuthorize("@ss.hasPermi('system:collection:query')")
-    @GetMapping(value = "/{collectionId}")
+    @GetMapping(value = "/get")
     @ApiOperation("藏品详情查询")
-    public AjaxResult getInfo(@PathVariable("collectionId") Long collectionId)
-    {
+    @Log(title = "藏品", businessType = BusinessType.EXPORT)
+    public AjaxResult getInfo(@RequestParam("id") Long collectionId) {
         return success(collectionService.selectCollectionById(collectionId));
     }
 
@@ -72,26 +96,55 @@ public class PoCollectionController extends BaseController {
     @PreAuthorize("@ss.hasPermi('collection:add')")
     @Log(title = "藏品", businessType = BusinessType.INSERT)
     @ApiOperation("添加藏品")
-    @PostMapping
-    public AjaxResult add(@Validated @RequestBody PoCollection collection) {
+    @PostMapping("/insert")
+    public AjaxResult insert(@Validated @RequestBody PoCollection collection) {
         List<PoCollection> collectionList = collectionService.selectPoCollectionList(collection);
-        if (collectionList != null && !collectionList.isEmpty())
-            return error("重复的藏品");
+        if (collectionList != null && !collectionList.isEmpty()) {
+            for (PoCollection col : collectionList) {
+                if (col.equals(collection)) {
+                    return error("重复的藏品:" + collection + ",已有藏品:" + collectionList);
+                }
+            }
+        }
+        collection.setCreateBy(getUsername());
+        collection.setUpdateBy(getUsername());
         return toAjax(collectionService.insertCollection(collection));
     }
 
+    /**
+     * 批量新增藏品
+     */
+    @PreAuthorize("@ss.hasPermi('collection:add')")
+    @Log(title = "藏品", businessType = BusinessType.INSERT)
+    @ApiOperation("添加藏品")
+    @PostMapping("/batchInsert")
+    public AjaxResult batchInsert(@Validated @RequestBody List<PoCollection> collectionList) {
+        for (PoCollection collection : collectionList) {
+            List<PoCollection> colList = collectionService.selectPoCollectionList(collection);
+            if (colList == null || colList.isEmpty())
+                continue;
+            for (PoCollection col : colList) {
+                if (col.equals(collection)) {
+                    return error("重复的藏品:" + collection + ",已有藏品:" + collectionList);
+                }
+            }
+        }
+        return toAjax(collectionService.batchInsertCollection(collectionList));
+    }
+
     /**
      * 修改藏品
      */
     @PreAuthorize("@ss.hasPermi('collection:edit')")
     @Log(title = "藏品", businessType = BusinessType.UPDATE)
     @ApiOperation("编辑藏品")
-    @PutMapping
-    public AjaxResult edit(@Validated @RequestBody PoCollection collection) {
+    @PutMapping("/update")
+    public AjaxResult update(@Validated @RequestBody PoCollection collection) {
+        log.info(collection);
         PoCollection collection1 = collectionService.selectCollectionById(collection.getCollectionId());
         if (collection1 == null)
             return error("要修改的藏品不存在");
-        if (collection1.getCochain() == 0)
+        if (collection1.getColCochain() == 0)
             return error("要修改的藏品已上链");
         collection.setUpdateBy(getUsername());
         return toAjax(collectionService.updateCollection(collection));
@@ -102,10 +155,9 @@ public class PoCollectionController extends BaseController {
      */
     @PreAuthorize("@ss.hasPermi('system:collection:remove')")
     @Log(title = "删除藏品", businessType = BusinessType.DELETE)
-    @DeleteMapping("/{collectionIds}")
-    @ApiOperation("根据藏品ID删除藏品")
-    public AjaxResult remove(@PathVariable Long[] collectionIds)
-    {
+    @DeleteMapping("/delete")
+    @ApiOperation("根据藏品ID批量删除藏品")
+    public AjaxResult remove(@RequestBody Long[] collectionIds) {
         return toAjax(collectionService.deletePoCollectionByCollectionIds(collectionIds));
     }
 }

+ 3 - 3
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/PoNoticeController.java

@@ -32,7 +32,7 @@ public class PoNoticeController extends BaseController {
      */
     @PreAuthorize("@ss.hasPermi('system:notice:list')")
     @GetMapping("/list")
-    @ApiOperation("获取通知公告")
+    @ApiOperation("通知公告获取列表, 搜索")
     public TableDataInfo list(PoNotice poNotice) {
         startPage();
         List<PoNotice> list = poNoticeService.selectPoNoticeList(poNotice);
@@ -40,7 +40,7 @@ public class PoNoticeController extends BaseController {
     }
 
     /**
-     * 获取通知公告列表
+     * 导出通知公告列表
      */
     @PreAuthorize("@ss.hasPermi('system:notice:list')")
     @GetMapping("/export")
@@ -56,7 +56,7 @@ public class PoNoticeController extends BaseController {
      */
     @PreAuthorize("@ss.hasPermi('system:notice:query')")
     @GetMapping(value = "/{poNoticeId}")
-    @ApiOperation("获取通知公告内容")
+    @ApiOperation("获取通知公告详情")
     public AjaxResult getInfo(@PathVariable("poNoticeId") Long poNoticeId) {
         return success(poNoticeService.selectPoNoticeById(poNoticeId));
     }

+ 7 - 0
ruoyi-common/pom.xml

@@ -139,6 +139,13 @@
             <artifactId>javax.servlet-api</artifactId>
         </dependency>
 
+        <!--Lombook-->
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <version>1.18.20</version>
+        </dependency>
+
     </dependencies>
 
 </project>

+ 7 - 3
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BaseEntity.java

@@ -1,12 +1,14 @@
 package com.ruoyi.common.core.domain;
 
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+
 import java.io.Serializable;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.Map;
-import com.fasterxml.jackson.annotation.JsonFormat;
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.annotation.JsonInclude;
 
 /**
  * Entity基类
@@ -19,6 +21,7 @@ public class BaseEntity implements Serializable
 
     /** 搜索值 */
     @JsonIgnore
+    @TableField(exist = false)
     private String searchValue;
 
     /** 创建者 */
@@ -40,6 +43,7 @@ public class BaseEntity implements Serializable
 
     /** 请求参数 */
     @JsonInclude(JsonInclude.Include.NON_EMPTY)
+    @TableField(exist = false)
     private Map<String, Object> params;
 
     public String getSearchValue()

+ 98 - 188
ruoyi-system/src/main/java/com/ruoyi/system/domain/PoCollection.java

@@ -1,222 +1,132 @@
 package com.ruoyi.system.domain;
 
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.fasterxml.jackson.annotation.JsonFormat;
 import com.ruoyi.common.annotation.Excel;
 import com.ruoyi.common.core.domain.BaseEntity;
-import org.apache.commons.lang3.builder.ToStringBuilder;
-import org.apache.commons.lang3.builder.ToStringStyle;
+import lombok.Data;
+
+import java.util.Date;
 
 /**
  * 【藏品管理】藏品 po_collection
  *
  * @author ruoyi
- * @date 2023-02-12
+ * @date 2023-03-19
  */
-public class PoCollection extends BaseEntity
-{
+@Data
+public class PoCollection extends BaseEntity {
     private static final long serialVersionUID = 1L;
 
-    /** 藏品Id */
+    /**
+     * 藏品Id
+     */
+    @Excel(name = "藏品ID")
+    @TableId
     private Long collectionId;
 
+    /*套系ID*/
+    @Excel(name = "套系ID")
     private Long tetherId;
 
-    /** 藏品名字 */
+    /**
+     * 藏品名字
+     */
     @Excel(name = "藏品名字")
     private String collectionTitle;
 
-    /** 藏品状态(0正常 1禁止) */
-    @Excel(name = "藏品状态", readConverterExp = "0=正常,1=禁止")
-    private String status;
-
-    /** 藏品类型(0邮票 1其他) */
+    /**
+     * 发行方
+     */
+    @Excel(name = "发行方")
+    private String publisherName;
+
+    /*展示开始时间*/
+    @Excel(name = "开始展示时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date showStart;
+
+    /*展示结束时间*/
+    @Excel(name = "结束展示时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date showEnd;
+
+    /**
+     * 藏品状态(0=正常,1=预售,2=过期)
+     */
+    @Excel(name = "藏品状态", readConverterExp = "0=正常,1=预售,2=过期")
+    private Long status;
+
+    /**
+     * 藏品类型(0=邮票 1=其他)
+     */
     @Excel(name = "藏品类型", readConverterExp = "0=邮票,1=其他")
     private Long collectionType;
 
-    /** 是否删除(1删除 0未删除) */
-    private Long delFlag;
+    /**
+     * 藏品数量
+     */
+    @Excel(name = "藏品数量")
+    @TableField("total")
+    private Long colTotal;
 
-    /** 藏品数量 */
+    /**
+     * 藏品剩余数量
+     */
     @Excel(name = "藏品数量")
-    private Long total;
+    @TableField("count")
+    private Long colCount;
 
-    /** 藏品图片 */
+    /**
+     * 藏品图片
+     */
     @Excel(name = "藏品图片")
-    private String image;
+    @TableField("image")
+    private String colImage;
 
-    /** 模版 */
+    /**
+     * 模版
+     */
     @Excel(name = "模版")
-    private String formwork;
+    private String formWork;
 
-    /** 藏品价格 */
+    /**
+     * 藏品价格
+     */
     @Excel(name = "藏品价格")
-    private Long price;
+    @TableField("price")
+    private Double colPrice;
 
-    /** 发行方 */
-    @Excel(name = "发行方")
-    private Long publisherName;
-
-    /** 作者故事 */
+    /**
+     * 作者故事
+     */
     @Excel(name = "作者故事")
-    private String story;
-
-    /** 是否上架(0上链 1未上链) */
-    @Excel(name = "是否上架", readConverterExp = "0=上链,1=未上链")
-    private Long grounding;
-
-    /** 是否上链(0上链1未上链) */
-    @Excel(name = "是否上链", readConverterExp = "0=上链1未上链")
-    private Long cochain;
-
-
-    public void setTetherId(Long tetherId) {
-        this.tetherId = tetherId;
-    }
-
-    public Long getTetherId() {
-        return tetherId;
-    }
-
-    public void setCollectionId(Long collectionId)
-    {
-        this.collectionId = collectionId;
-    }
-
-    public Long getCollectionId()
-    {
-        return collectionId;
-    }
-    public void setCollectionTitle(String collectionTitle)
-    {
-        this.collectionTitle = collectionTitle;
-    }
-
-    public String getCollectionTitle()
-    {
-        return collectionTitle;
-    }
-    public void setStatus(String status)
-    {
-        this.status = status;
-    }
-
-    public String getStatus()
-    {
-        return status;
-    }
-    public void setCollectionType(Long collectionType)
-    {
-        this.collectionType = collectionType;
-    }
-
-    public Long getCollectionType()
-    {
-        return collectionType;
-    }
-    public void setDelFlag(Long delFlag)
-    {
-        this.delFlag = delFlag;
-    }
-
-    public Long getDelFlag()
-    {
-        return delFlag;
-    }
-    public void setTotal(Long total)
-    {
-        this.total = total;
-    }
-
-    public Long getTotal()
-    {
-        return total;
-    }
-    public void setImage(String image)
-    {
-        this.image = image;
-    }
-
-    public String getImage()
-    {
-        return image;
-    }
-    public void setFormwork(String formwork)
-    {
-        this.formwork = formwork;
-    }
-
-    public String getFormwork()
-    {
-        return formwork;
-    }
-    public void setPrice(Long price)
-    {
-        this.price = price;
-    }
-
-    public Long getPrice()
-    {
-        return price;
-    }
-    public void setPublisherName(Long publisherName)
-    {
-        this.publisherName = publisherName;
-    }
-
-    public Long getPublisherName()
-    {
-        return publisherName;
-    }
-    public void setStory(String story)
-    {
-        this.story = story;
-    }
-
-    public String getStory()
-    {
-        return story;
-    }
-    public void setGrounding(Long grounding)
-    {
-        this.grounding = grounding;
-    }
-
-    public Long getGrounding()
-    {
-        return grounding;
-    }
-    public void setCochain(Long cochain)
-    {
-        this.cochain = cochain;
-    }
-
-    public Long getCochain()
-    {
-        return cochain;
-    }
-
-    @Override
-    public String toString() {
-        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
-                .append("collectionId", getCollectionId())
-                .append("collectionTitle", getCollectionTitle())
-                .append("status", getStatus())
-                .append("collectionType", getCollectionType())
-                .append("createTime", getCreateTime())
-                .append("createBy", getCreateBy())
-                .append("updateTime", getUpdateTime())
-                .append("updateBy", getUpdateBy())
-                .append("delFlag", getDelFlag())
-                .append("total", getTotal())
-                .append("remark", getRemark())
-                .append("image", getImage())
-                .append("formwork", getFormwork())
-                .append("price", getPrice())
-                .append("publisherName", getPublisherName())
-                .append("story", getStory())
-                .append("grounding", getGrounding())
-                .append("cochain", getCochain())
-                .append("tetherId",getTetherId())
-                .toString();
-    }
+    @TableField("story")
+    private String colStory;
+
+    /**
+     * 是否上架(0=上架,1=未上架)
+     */
+    @Excel(name = "是否上架", readConverterExp = "0=上架,1=未上架")
+    @TableField("grounding")
+    private Long colGrounding;
+
+    /**
+     * 是否上链(0=上链,1=未上链)
+     */
+    @Excel(name = "是否上链", readConverterExp = "0=上链,1=未上链")
+    @TableField("cochain")
+    private Long colCochain;
+
+    /**
+     * 是否删除(0=未删除,1=删除 )
+     */
+    @Excel(name = "是否删除", readConverterExp = "0=正常,1=已删除")
+    private Long delFlag;
+
+    /** 是否售罄(0=未删除,1=删除 ) */
+    @Excel(name = "是否售罄",readConverterExp = "0=正常,1=已售罄")
+    private Long soldOut;
 }
 

+ 2 - 89
ruoyi-system/src/main/java/com/ruoyi/system/domain/PoNotice.java

@@ -2,7 +2,7 @@ package com.ruoyi.system.domain;
 
 import com.ruoyi.common.annotation.Excel;
 import com.ruoyi.common.core.domain.BaseEntity;
-import org.apache.commons.lang3.builder.ToStringBuilder;
+import lombok.Data;
 
 import java.util.List;
 
@@ -11,7 +11,7 @@ import java.util.List;
  *
  * @author blue
  */
-
+@Data
 public class PoNotice extends BaseEntity {
     private static final long serialVersionUID = 1L;
     /**
@@ -67,91 +67,4 @@ public class PoNotice extends BaseEntity {
      */
     @Excel(name = "逻辑删除状态", readConverterExp = "0未删除,1删除")
     private Boolean delFlag;
-
-    public Long getNoticeId() {
-        return noticeId;
-    }
-
-    public void setNoticeId(Long noticeId) {
-        this.noticeId = noticeId;
-    }
-
-    public String getNoticeTitle() {
-        return noticeTitle;
-    }
-
-    public void setNoticeTitle(String noticeTitle) {
-        this.noticeTitle = noticeTitle;
-    }
-
-    public String getNoticeContent() {
-        return noticeContent;
-    }
-
-    public void setNoticeContent(String noticeContent) {
-        this.noticeContent = noticeContent;
-    }
-
-    public Integer getNoticeType() {
-        return noticeType;
-    }
-
-    public void setNoticeType(Integer noticeType) {
-        this.noticeType = noticeType;
-    }
-
-    public Integer getStatus() {
-        return status;
-    }
-
-    public void setStatus(Integer status) {
-        this.status = status;
-    }
-
-    public Long getPublisherId() {
-        return publisherId;
-    }
-
-    public void setPublisherId(Long publisherId) {
-        this.publisherId = publisherId;
-    }
-
-    public List<String> getUserId() {
-        return userId;
-    }
-
-    public void setUserId(List<String> userId) {
-        this.userId = userId;
-    }
-
-    public List<String> getReadUserId() {
-        return readUserId;
-    }
-
-    public void setReadUserId(List<String> readUserId) {
-        this.readUserId = readUserId;
-    }
-
-    public Boolean getDelFlag() {
-        return delFlag;
-    }
-
-    public void setDelFlag(Boolean delFlag) {
-        this.delFlag = delFlag;
-    }
-
-    @Override
-    public String toString() {
-        return new ToStringBuilder(this)
-                .append("noticeId", noticeId)
-                .append("noticeTitle", noticeTitle)
-                .append("noticeContent", noticeContent)
-                .append("noticeType", noticeType)
-                .append("status", status)
-                .append("publisherId", publisherId)
-                .append("userId", userId)
-                .append("readUserId", readUserId)
-                .append("delFlag", delFlag)
-                .toString();
-    }
 }

+ 6 - 5
ruoyi-system/src/main/java/com/ruoyi/system/domain/PoTether.java

@@ -1,13 +1,13 @@
 package com.ruoyi.system.domain;
 
-import java.util.Date;
-
-import com.baomidou.mybatisplus.extension.activerecord.Model;
+import com.baomidou.mybatisplus.annotation.TableId;
 import com.fasterxml.jackson.annotation.JsonFormat;
-import org.apache.commons.lang3.builder.ToStringBuilder;
-import org.apache.commons.lang3.builder.ToStringStyle;
 import com.ruoyi.common.annotation.Excel;
 import com.ruoyi.common.core.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+import java.util.Date;
 
 /**
  * 套系对象 po_tether
@@ -20,6 +20,7 @@ public class PoTether extends BaseEntity
     private static final long serialVersionUID = 1L;
 
     /** 套系id */
+    @TableId
     private Long tetherId;
 
     /** 套系名字 */

+ 4 - 2
ruoyi-system/src/main/java/com/ruoyi/system/domain/PoTetherandcollection.java

@@ -1,9 +1,10 @@
 package com.ruoyi.system.domain;
 
-import org.apache.commons.lang3.builder.ToStringBuilder;
-import org.apache.commons.lang3.builder.ToStringStyle;
+import com.baomidou.mybatisplus.annotation.TableId;
 import com.ruoyi.common.annotation.Excel;
 import com.ruoyi.common.core.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
 
 import java.io.Serializable;
 
@@ -18,6 +19,7 @@ public class PoTetherandcollection extends BaseEntity implements Serializable
     private static final long serialVersionUID = 1L;
 
     /** 藏品Id */
+    @TableId
     private Long collectionId;
 
     /** 藏品名字 */

+ 18 - 27
ruoyi-system/src/main/java/com/ruoyi/system/mapper/PoCollectionMapper.java

@@ -1,7 +1,9 @@
 package com.ruoyi.system.mapper;
 
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.ruoyi.system.domain.PoCollection;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Update;
 
 import java.util.List;
 
@@ -11,15 +13,7 @@ import java.util.List;
  * @author blue
  */
 @Mapper
-public interface PoCollectionMapper {
-    /**
-     * 查询多个藏品信息
-     *
-     * @param collectionIdList 藏品ID
-     * @return 藏品信息
-     */
-     List<PoCollection> selectCollectionById(Long[] collectionIdList);
-
+public interface PoCollectionMapper extends BaseMapper<PoCollection> {
     /**
      * 查询藏品列表
      *
@@ -28,15 +22,6 @@ public interface PoCollectionMapper {
      */
     List<PoCollection> selectPoCollectionList(PoCollection poCollection);
 
-    /**
-     * 查询单个藏品信息
-     *
-     * @param collectionId 藏品ID
-     * @return 藏品信息
-     */
-    PoCollection selectCollectionById(Long collectionId);
-
-
     /**
      * 新增藏品
      *
@@ -62,18 +47,24 @@ public interface PoCollectionMapper {
     int updatePoCollection(PoCollection collections);
 
     /**
-     * 删除藏品
-     *
-     * @param collectionId 藏品ID
-     * @return 结果
+     * 定时更新藏品状态
      */
-    public int deletePoCollectionByCollectionId(Long collectionId);
+    @Update("update po_collection set status = " +
+            "case when now() > show_start then 2 " +
+            "when show_end > now() then 1 " +
+            "when now() >= show_start and show_end >= now() then 0 " +
+            "end;")
+    void updateCollectionStatus();
 
     /**
-     * 批量删除藏品信息
+     * 售卖藏品
      *
-     * @param collectionIds 需要删除的藏品ID
-     * @return 结果
+     * @param collectionId 藏品ID
+     * @param count        售卖数量
+     * @return 操作结果
      */
-    public int deletePoCollectionByCollectionIds(Long[] collectionIds);
+    @Update("update po_collection set count = count - #{count}," +
+            "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);
 }

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

@@ -1,20 +1,22 @@
 package com.ruoyi.system.mapper;
 
-import java.util.Date;
-import java.util.List;
-
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.ruoyi.system.domain.PoTether;
 import com.ruoyi.system.domain.PoTetherandcollection;
 import com.ruoyi.system.domain.vo.TetherVo;
+import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.Date;
+import java.util.List;
+
 /**
  * 套系Mapper接口
  *
  * @author ruoyi
  * @date 2023-02-12
  */
+@Mapper
 public interface PoTetherMapper extends BaseMapper<PoTether>
 {
     /**

+ 27 - 26
ruoyi-system/src/main/java/com/ruoyi/system/service/IPoCollectionService.java

@@ -2,21 +2,13 @@ package com.ruoyi.system.service;
 
 import com.ruoyi.system.domain.PoCollection;
 
+import java.util.Date;
 import java.util.List;
 
 /**
  * 消息接口
  */
 public interface IPoCollectionService {
-    /**
-     * 批量查询藏品
-     *
-     * @param collectionList
-     * @return
-     */
-    public List<PoCollection> selectPoCollectionsByCollections(List<PoCollection> collectionList);
-
-
     /**
      * 获取藏品详细内容
      *
@@ -26,12 +18,24 @@ public interface IPoCollectionService {
     PoCollection selectCollectionById(Long collectionId);
 
     /**
-     * 查询藏品列表
+     * 获取藏品列表
      *
-     * @param poCollection
-     * @return
+     * @param poCollection 藏品信息
+     * @return 藏品列表
      */
-    public List<PoCollection> selectPoCollectionList(PoCollection poCollection);
+    List<PoCollection> selectPoCollectionList(PoCollection poCollection);
+
+    /**
+     * 搜索,导出藏品列表
+     *
+     * @param collectionName 藏品名字(模糊查询)
+     * @param startTime      创建时间起始
+     * @param endTime        创建时间结束
+     * @param status         藏品状态
+     * @param delFlag        是否已删除
+     * @return 藏品列表
+     */
+    List<PoCollection> queryPoCollectionList(String collectionName, Date startTime, Date endTime, Long status, Long delFlag);
 
     /**
      * 增加
@@ -39,15 +43,15 @@ public interface IPoCollectionService {
      * @param collection 藏品信息
      * @return 操作状态
      */
-    public int insertCollection(PoCollection collection);
+    int insertCollection(PoCollection collection);
 
     /**
      * 批量增加
      *
-     * @param collection 藏品信息
+     * @param collectionList 藏品信息
      * @return 操作状态
      */
-    public int batchInsertCollection(List<PoCollection> collection);
+    int batchInsertCollection(List<PoCollection> collectionList);
 
     /**
      * 修改
@@ -55,22 +59,19 @@ public interface IPoCollectionService {
      * @param collection 更新的藏品信息
      * @return 操作状态
      */
-    public int updateCollection(PoCollection collection);
+    int updateCollection(PoCollection collection);
 
     /**
-     * 批量删除藏品
+     * 删除藏品
      *
-     * @param collectionIds
-     * @return
+     * @param collectionIds 藏品ID
+     * @return 操作结果
      */
-    public int deletePoCollectionByCollectionIds(Long[] collectionIds);
+    int deletePoCollectionByCollectionIds(Long[] collectionIds);
 
     /**
-     * 删除藏品
-     *
-     * @param collectionId
-     * @return 结果
+     * 定时更新藏品状态
      */
-    public int deletePoCollectionByCollectionId(Long collectionId);
+    void updateCollectionStatus();
 }
 

+ 54 - 43
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/PoCollectionServiceImpl.java

@@ -1,15 +1,15 @@
 package com.ruoyi.system.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 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.ArrayList;
+import java.util.Arrays;
+import java.util.Date;
 import java.util.List;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
 
 @Service
 public class PoCollectionServiceImpl implements IPoCollectionService {
@@ -17,34 +17,56 @@ public class PoCollectionServiceImpl implements IPoCollectionService {
     PoCollectionMapper poCollectionMapper;
 
     /**
-     * 查询藏品
+     * 藏品列表搜索Wrapper
      *
-     * @param collectionList
-     * @return
+     * @param col 查询条件
+     * @return wrapper
      */
-    @Override
-    public List<PoCollection> selectPoCollectionsByCollections(List<PoCollection> collectionList) {
-        List<PoCollection> result = new ArrayList<>();
-        for (PoCollection collection1 : collectionList) {
-            List<PoCollection> list = poCollectionMapper.selectPoCollectionList(collection1);
-            if (list == null || list.isEmpty())
-                continue;
-            result = Stream.of(result, list).flatMap(List::stream).distinct().collect(Collectors.toList());
-        }
-        return result;
+    QueryWrapper<PoCollection> genWrapper(PoCollection col) {
+        QueryWrapper<PoCollection> wrapper = new QueryWrapper<>();
+        if (col == null)
+            return wrapper;
+        if (col.getCollectionTitle() != null && !col.getCollectionTitle().isEmpty())
+            wrapper.like("collection_title", col.getCollectionTitle());
+        if (col.getShowStart() != null)
+            wrapper.ge("show_start", col.getShowStart());
+        if (col.getShowEnd() != null)
+            wrapper.le("show_end", col.getShowEnd());
+        if (col.getStatus() != null)
+            wrapper.eq("status", col.getStatus());
+        wrapper.eq("del_flag", col.getDelFlag() == null ? 0 : col.getDelFlag());
+        return wrapper;
     }
 
     /**
      * 查询藏品列表
      *
-     * @param poCollection
-     * @return
+     * @param poCollection 藏品信息
+     * @return 藏品列表
      */
     @Override
     public List<PoCollection> selectPoCollectionList(PoCollection poCollection) {
-        return poCollectionMapper.selectPoCollectionList(poCollection);
+        return poCollectionMapper.selectList(genWrapper(poCollection));
     }
 
+    /**
+     * 搜索藏品列表
+     *
+     * @param collectionName 藏品名字(模糊查询)
+     * @param startTime      创建时间起始
+     * @param endTime        创建时间结束
+     * @return 藏品列表
+     */
+    @Override
+    public List<PoCollection> queryPoCollectionList(String collectionName, Date startTime, Date endTime, Long status, Long delFlag) {
+        PoCollection col = new PoCollection();
+        col.setCollectionTitle(collectionName);
+        col.setStatus(status);
+        col.setShowStart(startTime);
+        col.setShowEnd(endTime);
+        col.setDelFlag(delFlag);
+        return poCollectionMapper.selectList(genWrapper(col));
+    }
 
     /**
      * 获取藏品详细内容
@@ -54,38 +76,30 @@ public class PoCollectionServiceImpl implements IPoCollectionService {
      */
     @Override
     public PoCollection selectCollectionById(Long collectionId) {
-        return poCollectionMapper.selectCollectionById(collectionId);
+        return poCollectionMapper.selectById(collectionId);
     }
 
 
     /**
-     * 增加
+     * 添加藏品
      *
      * @param collection 藏品信息
      * @return 操作状态
      */
     @Override
     public int insertCollection(PoCollection collection) {
-        List<PoCollection> poCollection = poCollectionMapper.selectPoCollectionList(collection);
-        if (poCollection != null && !poCollection.isEmpty())
-            return -1;
-        return poCollectionMapper.insertPoCollection(collection);
+        return poCollectionMapper.insert(collection);
     }
 
     /**
-     * 批量增加
+     * 批量添加藏品
      *
-     * @param collection 藏品信息
+     * @param collectionList 藏品信息
      * @return 操作状态
      */
     @Override
-    public int batchInsertCollection(List<PoCollection> collection) {
-        for (PoCollection collection1 : collection) {
-            List<PoCollection> list = poCollectionMapper.selectPoCollectionList(collection1);
-            if (list != null && !list.isEmpty())
-                return -1;
-        }
-        return poCollectionMapper.batchInsertPoCollection(collection);
+    public int batchInsertCollection(List<PoCollection> collectionList) {
+        return poCollectionMapper.batchInsertPoCollection(collectionList);
     }
 
     /**
@@ -102,22 +116,19 @@ public class PoCollectionServiceImpl implements IPoCollectionService {
     /**
      * 批量删除藏品
      *
-     * @param collectionIds 需要删除的藏品主键
-     * @return
+     * @param collectionIds 需要删除的藏品ID
+     * @return 操作结果
      */
     @Override
     public int deletePoCollectionByCollectionIds(Long[] collectionIds) {
-        return poCollectionMapper.deletePoCollectionByCollectionIds(collectionIds);
+        return poCollectionMapper.deleteBatchIds(Arrays.asList(collectionIds));
     }
 
     /**
-     * 删除藏品
-     *
-     * @param collectionId
-     * @return
+     * 定时更新藏品状态
      */
     @Override
-    public int deletePoCollectionByCollectionId(Long collectionId) {
-        return poCollectionMapper.deletePoCollectionByCollectionId(collectionId);
+    public void updateCollectionStatus() {
+        poCollectionMapper.updateCollectionStatus();
     }
 }

+ 98 - 111
ruoyi-system/src/main/resources/mapper/system/PoCollectionMapper.xml

@@ -3,70 +3,64 @@
         PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.ruoyi.system.mapper.PoCollectionMapper">
-
     <resultMap type="PoCollection" id="PoCollectionResult">
         <result property="collectionId" column="collection_id"/>
+        <result property="tetherId" column="tether_id"/>
         <result property="collectionTitle" column="collection_title"/>
-        <result property="collectionType" column="collection_type"/>
+        <result property="publisherName" column="publisher_name"/>
         <result property="status" column="status"/>
+        <result property="collectionType" column="collection_type"/>
+        <result property="colTotal" column="total"/>
+        <result property="colCount" column="count"/>
         <result property="createBy" column="create_by"/>
         <result property="createTime" column="create_time"/>
         <result property="updateBy" column="update_by"/>
         <result property="updateTime" column="update_time"/>
-        <result property="delFlag" column="del_flag"/>
+        <result property="showStart" column="show_start"/>
+        <result property="showEnd" column="show_end"/>
+        <result property="colImage" column="image"/>
+        <result property="formWork" column="form_work"/>
+        <result property="colPrice" column="price"/>
+        <result property="colStory" column="story"/>
+        <result property="colGrounding" column="grounding"/>
+        <result property="colCochain" column="cochain"/>
         <result property="remark" column="remark"/>
-        <result property="image" column="image"/>
-        <result property="formwork" column="formwork"/>
-        <result property="price" column="price"/>
-        <result property="publisherName" column="publisher_name"/>
-        <result property="story" column="story"/>
-        <result property="grounding" column="grouding"/>
-        <result property="cochain" column="cochain"/>
-        <result property="tetherId" column="tether_id"/>
+        <result property="delFlag" column="del_flag"/>
+        <result property="soldOut" column="sold_out"/>
     </resultMap>
 
     <sql id="selectPoCollectionVo">
         select collection_id,
+               tether_id,
                collection_title,
-               collection_type,
+               publisher_name,
                status,
-               create_by,
+               collection_type,
+               total,
+               count,
                create_time,
-               update_by,
+               create_by,
                update_time,
-               remark,
-               del_flag,
+               update_by,
+               show_start,
+               show_end,
                image,
-               publisher_name,
-               formwork,
+               form_work,
                price,
                story,
                grounding,
                cochain,
-               tether_id
+               remark,
+               del_flag,
+               sold_out
         from po_collection
     </sql>
 
-    <select id="selectCollectionById" parameterType="Long" resultMap="PoCollectionResult">
-        <include refid="selectPoCollectionVo"/>
-        where collection_id = #{collectionId}
-    </select>
-
     <select id="selectPoCollectionList" parameterType="PoCollection" resultMap="PoCollectionResult">
         <include refid="selectPoCollectionVo"/>
         <where>
-            <if test="collectionTitle != null  and collectionTitle != ''">and collection_title = #{collectionTitle}</if>
-            <if test="status != null  and status != ''">and status = #{status}</if>
-            <if test="collectionType != null ">and collection_type = #{collectionType}</if>
-            <if test="total != null ">and total = #{total}</if>
-            <if test="formwork != null  and formwork != ''">and formwork = #{formwork}</if>
-            <if test="price != null ">and price = #{price}</if>
-            <if test="publisherName != null ">and publisher_name like concat('%', #{publisherName}, '%')</if>
-            <if test="grounding != null ">and grounding = #{grounding}</if>
-            <if test="cochain != null ">and cochain = #{cochain}</if>
-            <if test="tetherId != null ">and tether_id = #{tetherId}</if>
-            <if test="delFlag != null">and del_flag = #{delFlag}</if>
             <if test="delFlag == null">and del_flag = 0</if>
+            <if test="delFlag != null">and del_flag = #{delFlag}</if>
         </where>
     </select>
 
@@ -77,73 +71,77 @@
         <if test="status != null and status != '' ">status,</if>
         <if test="remark != null and remark != ''">remark,</if>
         <if test="createBy != null and createBy != ''">create_by,</if>
-        <if test="total != null and total != ''">total,</if>
-        <if test="image != null and image != ''">image,</if>
+        <if test="showStart != null">show_start,</if>
+        <if test="showEnd != null">show_end,</if>
+        <if test="colTotal != null and colTotal != ''">total, count,</if>
+        <if test="colImage != null and colImage != ''">image,</if>
         <if test="publisherName != null and publisherName != ''">publisher_name,</if>
-        <if test="formwork != null and formwork != ''">formwork,</if>
-        <if test="price != null and price != ''">price,</if>
-        <if test="story != null and story != ''">story,</if>
-        <if test="grouding != null and grouding != ''">grounding,</if>
-        <if test="cochain != null and cochain != ''">cochain,</if>
+        <if test="formWork != null and formWork != ''">form_work,</if>
+        <if test="colPrice != null and colPrice != ''">price,</if>
+        <if test="colStory != null and colStory != ''">story,</if>
+        <if test="colGrounding != null and colGrounding != ''">grounding,</if>
+        <if test="colCochain != null and colCochain != ''">cochain,</if>
         <if test="tetherId != null and tetherId != ''">tether_id,</if>
-        del_flag,
-        create_time
+        del_flag, sold_out
         )values(
         <if test="collectionTitle != null and collectionTitle != ''">#{collectionTitle},</if>
         <if test="collectionType != null and collectionType != ''">#{collectionType},</if>
         <if test="status != null and status != ''">#{status},</if>
         <if test="remark != null and remark != ''">#{remark},</if>
         <if test="createBy != null and createBy != ''">#{createBy},</if>
-        <if test="total != null and total != ''">#{total},</if>
-        <if test="image != null and image != ''">#{image},</if>
+        <if test="showStart != null">#{showStart},</if>
+        <if test="showEnd != null">#{showEnd},</if>
+        <if test="colTotal != null">#{colTotal}, #{colTotal},</if>
+        <if test="colImage != null and colImage != ''">#{colImage},</if>
         <if test="publisherName != null and publisherName != ''">#{publisherName},</if>
-        <if test="formwork != null and formwork != ''">#{formwork},</if>
-        <if test="price != null and price != ''">#{price},</if>
-        <if test="story != null and story != ''">#{story},</if>
-        <if test="grouding != null and grouding != ''">#{grounding},</if>
-        <if test="cochain != null and cochain != ''">#{cochain},</if>
-        <if test="tetherId != null and tetherId != ''">#{tetherId},</if>
-        0,
-        sysdate()
+        <if test="formWork != null and formWork != ''">#{formWork},</if>
+        <if test="colPrice != null">#{colPrice},</if>
+        <if test="colStory != null and colStory != ''">#{colStory},</if>
+        <if test="colGrounding != null">#{colGrounding},</if>
+        <if test="colCochain != null">#{colCochain},</if>
+        <if test="tetherId != null">#{tetherId},</if>
+        0, 0
         )
     </insert>
 
     <insert id="batchInsertPoCollection" parameterType="PoCollection">
         insert into po_collection (
+        <if test="tetherId != null">tether_id,</if>
         <if test="collectionTitle != null and collectionTitle != '' ">collection_title,</if>
-        <if test="collectionType != null and collectionType != '' ">collection_type,</if>
-        <if test="status != null and status != '' ">status,</if>
-        <if test="remark != null and remark != ''">remark,</if>
-        <if test="createBy != null and createBy != ''">create_by,</if>
-        <if test="total != null and total != ''">total,</if>
-        <if test="image != null and image != ''">image,</if>
         <if test="publisherName != null and publisherName != ''">publisher_name,</if>
-        <if test="formwork != null and formwork != ''">formwork,</if>
-        <if test="price != null and price != ''">price,</if>
-        <if test="story != null and story != ''">story,</if>
-        <if test="grouding != null and grouding != ''">grounding,</if>
-        <if test="cochain != null and cochain != ''">cochain,</if>
-        <if test="tetherId != null and tetherId != ''">tether_id,</if>
-        del_flag,
-        create_time
+        <if test="status != null">status,</if>
+        <if test="collectionType != null">collection_type,</if>
+        <if test="colTotal != null">total, count,</if>
+        <if test="createBy != null and createBy != ''">create_by,</if>
+        <if test="showStart != null">show_start,</if>
+        <if test="showEnd != null">show_end,</if>
+        <if test="colImage != null and colImage != ''">image,</if>
+        <if test="formWork != null and formWork != ''">form_work,</if>
+        <if test="colPrice != null">price,</if>
+        <if test="colStory != null and colStory != ''">story,</if>
+        <if test="colGrounding != null">grounding,</if>
+        <if test="colCochain != null">cochain,</if>
+        <if test="remark != null and remark != ''">remark,</if>
+        del_flag, sold_out
         )values(
         <foreach collection="collections" item="PoCollection" separator=",">
-            <if test="collectionTitle != null and collectionTitle != ''">#{collectionTitle},</if>
-            <if test="collectionType != null and collectionType != ''">#{collectionType},</if>
-            <if test="status != null and status != ''">#{status},</if>
-            <if test="remark != null and remark != ''">#{remark},</if>
-            <if test="createBy != null and createBy != ''">#{createBy},</if>
-            <if test="total != null and total != ''">#{total},</if>
-            <if test="image != null and image != ''">#{image},</if>
+            <if test="tetherId != null">#{tetherId},</if>
+            <if test="collectionTitle != null and collectionTitle != '' ">#{collectionTitle},</if>
             <if test="publisherName != null and publisherName != ''">#{publisherName},</if>
-            <if test="formwork != null and formwork != ''">#{formwork},</if>
-            <if test="price != null and price != ''">#{price},</if>
-            <if test="story != null and story != ''">#{story},</if>
-            <if test="grouding != null and grouding != ''">#{grounding},</if>
-            <if test="cochain != null and cochain != ''">#{cochain},</if>
-            <if test="tetherId != null and tetherId != ''">#{tetherId},</if>
-            0,
-            sysdate()
+            <if test="status != null">#{status},</if>
+            <if test="collectionType != null">#{collectionType},</if>
+            <if test="colTotal != null">#{colTotal}, #{colTotal},</if>
+            <if test="createBy != null and createBy != ''">#{createBy},</if>
+            <if test="showStart != null">s#{showStart},</if>
+            <if test="showEnd != null">#{showEnd},</if>
+            <if test="colImage != null and colImage != ''">#{colImage},</if>
+            <if test="formWork != null and formWork != ''">#{formWork},</if>
+            <if test="colPrice != null">#{colPrice},</if>
+            <if test="colStory != null and colStory != ''">#{colStory},</if>
+            <if test="colGrounding != null">#{colGrounding},</if>
+            <if test="colCochain != null">#{colCochain},</if>
+            <if test="remark != null and remark != ''">#{remark},</if>
+            0, 0
         </foreach>
         )
     </insert>
@@ -151,37 +149,26 @@
     <update id="updatePoCollection" parameterType="PoCollection">
         update po_collection
         <set>
+            <if test="tetherId != null and tetherId != ''">tether_id = #{tetherId},</if>
             <if test="collectionTitle != null and collectionTitle != ''">collection_title = #{collectionTitle},</if>
-            <if test="collectionType != null and collectionType != ''">collection_type = #{collectionType},</if>
-            <if test="status != null and status != ''">status = #{status},</if>
-            <if test="remark != null and remark != ''">remark = #{remark},</if>
-            <if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
-            <if test="total != null and total != ''">total = #{total},</if>
-            <if test="image != null and image != ''">image = #{image},</if>
             <if test="publisherName != null and publisherName != ''">publisher_name = #{publisherName},</if>
-            <if test="formwork != null and formwork != ''">formwork = #{formwork},</if>
-            <if test="price != null and price != ''">price = #{price},</if>
-            <if test="story != null and story != ''">story = #{story},</if>
-            <if test="grouding != null and grouding != ''">grouding = #{grounding},</if>
-            <if test="cochain != null and cochain != ''">cochain = #{cochain},</if>
-            <if test="tetherId != null and tetherId != ''">tether_id = #{tetherId},</if>
-            <if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
-            update_time = sysdate()
+            <if test="status != null">status = #{status},</if>
+            <if test="collectionType != null">collection_type = #{collectionType},</if>
+            <if test="colTotal != null">total = #{colTotal},</if>
+            <if test="colCount != null">count = #{colCount},</if>
+            <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
+            <if test="showStart != null">show_start = #{showStart},</if>
+            <if test="showEnd != null">show_end = #{showEnd},</if>
+            <if test="colImage != null and colImage != ''">image = #{colImage},</if>
+            <if test="formWork != null and formWork != ''">form_work = #{formWork},</if>
+            <if test="colPrice != null">price = #{colPrice},</if>
+            <if test="colStory != null and colStory != ''">story = #{colStory},</if>
+            <if test="colGrounding != null ">grounding = #{colGrounding},</if>
+            <if test="colCochain != null">cochain = #{colCochain},</if>
+            <if test="remark != null">remark = #{remark},</if>
+            <if test="delFlag != null">del_flag = #{delFlag},</if>
+            <if test="soldOut != null">sold_out = #{soldOut},</if>
         </set>
         where collection_id = #{collectionId}
     </update>
-
-    <update id="deletePoCollectionByCollectionId" parameterType="Long">
-        update po_collection
-        SET del_flag = 1
-        where collection_id = #{collectionId}
-    </update>
-
-    <update id="deletePoCollectionByCollectionIds" parameterType="String">
-        update po_collection SET del_flag = #{1} where collection_id in
-        <foreach item="collectionId" collection="array" open="(" separator="," close=")">
-            #{collectionId}
-        </foreach>
-    </update>
-
 </mapper>