linhui.li 1 неделя назад
Родитель
Сommit
e507310899

+ 1 - 1
lot/src/main/java/cn/hobbystocks/auc/mapper/LotNoticeMapper.java

@@ -9,7 +9,7 @@ import org.apache.ibatis.annotations.Param;
 public interface LotNoticeMapper extends BaseMapper<LotNotice> {
 
     //根据分类查询拍卖公告列表
-    Page<LotNoticeVO>  selectNoticeByType(Page<LotNoticeVO> page, @Param("lotNotice") LotNotice lotNotice);
+    Page<LotNoticeVO>  selectNoticeByType(Page<LotNoticeVO> page, @Param("type") String type);
 
 
 

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

@@ -21,7 +21,7 @@ public class LotNoticeServiceImpl extends ServiceImpl<LotNoticeMapper, LotNotice
         Page<LotNotice> lotNoticePage = new Page<>(lotNotice.getPageNum(), lotNotice.getPageSize());
         LambdaQueryWrapper<LotNotice> lotNoticeLambdaQueryWrapper = new LambdaQueryWrapper<>();
         if (StringUtils.isNotEmpty(lotNotice.getTitle()))
-            lotNoticeLambdaQueryWrapper.eq(LotNotice::getTitle,lotNotice.getTitle());
+            lotNoticeLambdaQueryWrapper.like(LotNotice::getTitle,"%"+lotNotice.getTitle()+"%");
         lotNoticeLambdaQueryWrapper.orderByDesc(LotNotice::getId);
         return getBaseMapper().selectList(lotNoticePage, lotNoticeLambdaQueryWrapper);
     }
@@ -43,6 +43,6 @@ public class LotNoticeServiceImpl extends ServiceImpl<LotNoticeMapper, LotNotice
     @Override
     public Page<LotNoticeVO> selectLotNoticeByType(LotNotice lotNotice) {
         Page<LotNoticeVO> lotNoticePage = new Page<>(lotNotice.getPageNum(), lotNotice.getPageSize());
-        return getBaseMapper().selectNoticeByType(lotNoticePage,lotNotice);
+        return getBaseMapper().selectNoticeByType(lotNoticePage,lotNotice.getType());
     }
 }

+ 2 - 5
lot/src/main/resources/mapper/LotNoticeMapper.xml

@@ -6,11 +6,8 @@
     <select id="selectNoticeByType" resultType="cn.hobbystocks.auc.vo.LotNoticeVO">
         select id,title,content,type,create_time createTime,case when create_time + INTERVAL '7 day'>now() then 1 else 0 end as isNew from lot_notice
         <where>
-            <if test="lotNotice.type!=null and lotNotice.type!=''">
-                and type=#{lotNotice.type}
-            </if>
-            <if test="lotNotice.title!=null and lotNotice.title!=''">
-                and title like concat('%',#{lotNotice.title},'%')
+            <if test="type!=null and type!=''">
+                and type=#{type}
             </if>
            and status=1
         </where>