4 Commitit f14e270337 ... e5c1d29abc

Tekijä SHA1 Viesti Päivämäärä
  hamjin e5c1d29abc 判定重复逻辑 2 vuotta sitten
  hamjin 643c0d319d 使用逻辑删除,修正错误 2 vuotta sitten
  hamjin d459ea18da 增加藏品数量 2 vuotta sitten
  hamjin a418514d9a 增加藏品图片 2 vuotta sitten

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

@@ -41,8 +41,7 @@ public class PoCollectionServiceImpl implements IPoCollectionService {
      * @return
      */
     @Override
-    public List<PoCollection> selectPoCollectionList(PoCollection poCollection)
-    {
+    public List<PoCollection> selectPoCollectionList(PoCollection poCollection) {
         return poCollectionMapper.selectPoCollectionList(poCollection);
     }
 
@@ -68,7 +67,7 @@ public class PoCollectionServiceImpl implements IPoCollectionService {
     @Override
     public int insertCollection(PoCollection collection) {
         List<PoCollection> poCollection = poCollectionMapper.selectPoCollectionList(collection);
-        if (poCollection != null)
+        if (poCollection != null && !poCollection.isEmpty())
             return -1;
         return poCollectionMapper.insertPoCollection(collection);
     }
@@ -83,9 +82,8 @@ public class PoCollectionServiceImpl implements IPoCollectionService {
     public int batchInsertCollection(List<PoCollection> collection) {
         for (PoCollection collection1 : collection) {
             List<PoCollection> list = poCollectionMapper.selectPoCollectionList(collection1);
-            if (list == null || list.isEmpty())
-                continue;
-            return -1;
+            if (list != null && !list.isEmpty())
+                return -1;
         }
         return poCollectionMapper.batchInsertPoCollection(collection);
     }
@@ -108,8 +106,7 @@ public class PoCollectionServiceImpl implements IPoCollectionService {
      * @return
      */
     @Override
-    public int deletePoCollectionByCollectionIds(Long[] collectionIds)
-    {
+    public int deletePoCollectionByCollectionIds(Long[] collectionIds) {
         return poCollectionMapper.deletePoCollectionByCollectionIds(collectionIds);
     }
 
@@ -120,8 +117,7 @@ public class PoCollectionServiceImpl implements IPoCollectionService {
      * @return
      */
     @Override
-    public int deletePoCollectionByCollectionId(Long collectionId)
-    {
+    public int deletePoCollectionByCollectionId(Long collectionId) {
         return poCollectionMapper.deletePoCollectionByCollectionId(collectionId);
     }
 }

+ 22 - 9
ruoyi-system/src/main/resources/mapper/system/PoCollectionMapper.xml

@@ -36,6 +36,7 @@
                update_time,
                remark,
                del_flag,
+               image,
                publisher_name,
                formwork,
                price,
@@ -58,14 +59,13 @@
             <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="image != null  and image != ''"> and image = #{image}</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="story != null  and story != ''"> and story = #{story}</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>
         </where>
     </select>
 
@@ -76,6 +76,8 @@
         <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>
@@ -91,6 +93,8 @@
         <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="publisherName != null and publisherName != ''">#{publisherName},</if>
         <if test="formwork != null and formwork != ''">#{formwork},</if>
         <if test="price != null and price != ''">#{price},</if>
@@ -110,6 +114,8 @@
         <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>
@@ -126,6 +132,8 @@
             <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="publisherName != null and publisherName != ''">#{publisherName},</if>
             <if test="formwork != null and formwork != ''">#{formwork},</if>
             <if test="price != null and price != ''">#{price},</if>
@@ -147,27 +155,32 @@
             <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 != ''">tetherId = #{tetherId},</if>
+            <if test="tetherId != null and tetherId != ''">tether_id = #{tetherId},</if>
+            <if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
             update_time = sysdate()
         </set>
         where collection_id = #{collectionId}
     </update>
 
-    <delete id="deletePoCollectionByCollectionId" parameterType="Long">
-        delete from po_collection where collection_id = #{collectionId}
-    </delete>
+    <update id="deletePoCollectionByCollectionId" parameterType="Long">
+        update po_collection
+        SET del_flag = #{1}
+        where collection_id = #{collectionId}
+    </update>
 
-    <delete id="deletePoCollectionByCollectionIds" parameterType="String">
-        delete from po_collection where collection_id in
+    <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>
-    </delete>
+    </update>
 
 </mapper>