浏览代码

拍品公告管理搜索修改

linhui.li 1 周之前
父节点
当前提交
bc2a6256a1

+ 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("type") String type);
+    Page<LotNoticeVO>  selectNoticeByType(Page<LotNoticeVO> page, @Param("lotNotice") LotNotice lotNotice);
 
 
 

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

@@ -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.getType());
+        return getBaseMapper().selectNoticeByType(lotNoticePage,lotNotice);
     }
 }

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

@@ -6,8 +6,11 @@
     <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="type!=null and type!=''">
-                and type=#{type}
+            <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>
            and status=1
         </where>