|
@@ -1,11 +1,46 @@
|
|
|
package com.sky.ioc.mapper.notice;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
|
+import com.sky.ioc.entity.domain.notice.Notice;
|
|
|
+import com.sky.ioc.entity.params.notice.NoticeParam;
|
|
|
import org.apache.ibatis.annotations.Mapper;
|
|
|
+import org.apache.ibatis.annotations.Param;
|
|
|
+import org.apache.ibatis.annotations.Select;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
@Mapper
|
|
|
-public interface NoticeMapper extends BaseMapper {
|
|
|
+public interface NoticeMapper extends BaseMapper<Notice> {
|
|
|
+
|
|
|
+ @Select("<script>" +
|
|
|
+ "select id,title,content,address,type,time from notice where is_del=0 " +
|
|
|
+ "<if test='noticeParam!=null and noticeParam.startTime != null '>" +
|
|
|
+ "<![CDATA[ and time >= #{noticeParam.startTime} AND time <= #{noticeParam.endTime} ]]> " +
|
|
|
+ "</if>" +
|
|
|
+ "<if test='noticeParam!=null and noticeParam.type != null '>" +
|
|
|
+ " and type=#{noticeParam.type} " +
|
|
|
+ "</if>"+
|
|
|
+ "<if test='noticeParam!=null and noticeParam.status != null '>" +
|
|
|
+ " and status=#{noticeParam.status} " +
|
|
|
+ "</if>"+
|
|
|
+ " order by time desc limit #{noticeParam.pageSize} offset #{noticeParam.pageStart}" +
|
|
|
+ "</script>")
|
|
|
+ List<Map<String,Object>> listPage(@Param("noticeParam")NoticeParam noticeParam);
|
|
|
|
|
|
|
|
|
+ @Select("<script>" +
|
|
|
+ "select count(1) from notice where is_del=0 " +
|
|
|
+ "<if test='noticeParam!=null and noticeParam.startTime != null '>" +
|
|
|
+ "<![CDATA[ and time >= #{noticeParam.startTime} AND time <= #{noticeParam.endTime} ]]> " +
|
|
|
+ "</if>" +
|
|
|
+ "<if test='noticeParam!=null and noticeParam.type != null '>" +
|
|
|
+ " and type=#{noticeParam.type} " +
|
|
|
+ "</if>"+
|
|
|
+ "<if test='noticeParam!=null and noticeParam.status != null '>" +
|
|
|
+ " and status=#{noticeParam.status} " +
|
|
|
+ "</if>"+
|
|
|
+ "</script>")
|
|
|
+ long countPage(@Param("noticeParam")NoticeParam noticeParam);
|
|
|
|
|
|
}
|