jintao.geng пре 12 часа
родитељ
комит
65e0aa809c

+ 2 - 2
lot/src/main/java/cn/hobbystocks/auc/service/impl/LotServiceImpl.java

@@ -661,7 +661,7 @@ public class LotServiceImpl extends ServiceImpl<LotMapper,Lot> implements ILotSe
             // 传了二级分类 → 直接用
             categoryIds.add(request.getChildCategoryId());
         } else if (Objects.nonNull(request.getMainCategoryId())) {
-            // 只传一级 → 查询该一级下所有二级ID(单表查询)
+            // 只传一级 → 查询该一级下所有二级ID
             categoryIds = spuCategoryMapper.listChildByParentId(request.getMainCategoryId());
         }
 
@@ -670,7 +670,7 @@ public class LotServiceImpl extends ServiceImpl<LotMapper,Lot> implements ILotSe
             return Lists.newArrayList();
         }
 
-        // 3. 查询拍品ID(单表)
+        // 3. 查询拍品ID
         List<Long> lotIds = spuCategoryMapper.listLotIdsByCategoryIds(categoryIds);
 
         if (CollectionUtils.isEmpty(lotIds)) {

+ 12 - 0
lot/src/main/resources/mapper/LotMapper.xml

@@ -82,6 +82,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                     #{id}
                 </foreach>
             </if>
+            <if test="status==1">
+                and status in ('Starting','Bidding')
+            </if>
+            <if test="status==2">
+                and status ='Waiting' and now()>start_time
+            </if>
+            <if test="status==3">
+                and status ='Sold'
+            </if>
+            <if test="status==4">
+                and now()+ interval '1 hour'>end_time and status in ('Starting','Bidding')
+            </if>
 
         </where>
         order by sort desc,id desc