Commit beeb48fa by rongkailun

【新增】图片资讯、中心活动、党办文化 四个图片接口;

专题推荐、专题推荐详情、上月资讯排行
parent d38793c1
......@@ -428,4 +428,39 @@ public class NewsController extends AbstractController {
return R.ok().put("data", list);
}
/**图片资讯上方*/
@Login
@GetMapping("/api/pictureTop4")
public R pictureTop4() {
List<PictureEntity> list = this.newsService.pictureTop4();
return R.ok().put("data", list);
}
/**上月资讯排行*/
@Login
@GetMapping("/api/syzxphList")
public R syzxphList() {
List<NewsEntity> list = this.newsService.syzxphList();
return R.ok().put("data", list);
}
/**专题推荐*/
@Login
@GetMapping("/api/zttjList")
public R zttjList() {
List<NewtopicEntity> list = this.newsService.zttjList();
return R.ok().put("data", list);
}
@Autowired
@Lazy
NewtopicService newtopicService;
/**专题推荐*/
@Login
@GetMapping("/api/newsTopicInfo/{id}")
public R newsTopicInfo(@PathVariable("id") String id) {
NewtopicEntity newtopic = newtopicService.getById(id);
return R.ok().put("data", newtopic);
}
}
......@@ -82,4 +82,12 @@ public interface NewsDao extends BaseMapper<NewsEntity> {
List<NewsEntity> centerTop6();
List<NewsEntity> gzzdTop7();
List<PictureEntity> pictureTop4();
List<NewsEntity> pictureBelow();
List<NewsEntity> syzxphList();
List<NewtopicEntity> zttjList();
}
......@@ -80,5 +80,13 @@ public interface NewsService extends IService<NewsEntity> {
List<NewsEntity> centerTop6();
List<NewsEntity> gzzdTop7();
List<PictureEntity> pictureTop4();
List<NewsEntity> pictureBelow();
List<NewsEntity> syzxphList();
List<NewtopicEntity> zttjList();
}
......@@ -477,6 +477,30 @@ public class NewsServiceImpl extends ServiceImpl<NewsDao, NewsEntity> implements
return list;
}
@Override
public List<PictureEntity> pictureTop4() {
List<PictureEntity> list = this.newsDao.pictureTop4();
return list;
}
@Override
public List<NewsEntity> pictureBelow() {
List<NewsEntity> list = this.newsDao.pictureBelow();
return list;
}
@Override
public List<NewsEntity> syzxphList() {
List<NewsEntity> list = this.newsDao.syzxphList();
return list;
}
@Override
public List<NewtopicEntity> zttjList() {
List<NewtopicEntity> list = this.newsDao.zttjList();
return list;
}
private List<Map<String, Object>> getDataListNew(Map<String, Object> map, Page page) {
List<Map<String,Object>> list = this.newsDao.searchKnowledgeInfoNewList(map,page);
return list;
......
......@@ -210,7 +210,7 @@
and t.classid = #{newsParams.classId}
and t.levels > 0
and t.status = '1'
order by t.levels desc,t.id desc
order by t.levels desc,t.showtime DESC,t.id desc
</select>
<select id="getHdbdList" resultMap="newsMap">
......@@ -563,4 +563,34 @@ ORDER BY
levels DESC,
releasedate DESC
</select>
<select id="pictureTop4" resultType="io.office.modules.manage.entity.PictureEntity">
select top 4 * from picture where status=1 and PicLevel>0 order by PicLevel desc, pictureid desc
</select>
<select id="pictureBelow" resultType="io.office.modules.manage.entity.NewsEntity">
select top 4 * from picture where status=1 and PicLevel>0 order by PicLevel desc, pictureid desc
</select>
<select id="syzxphList" resultType="io.office.modules.manage.entity.NewsEntity">
SELECT
TOP 10 *
FROM
news
WHERE
status = 1
AND levels > 0
AND (
classid IN (5, 6, 7, 8)
OR classid IN (
SELECT
id
FROM
newsClass
WHERE
p_id = 5
)
)
and DATEDIFF(mm,releasedate,getdate())=1 and classid !=29 and levels != 9 order by hits desc
</select>
<select id="zttjList" resultType="io.office.modules.manage.entity.NewtopicEntity">
select top 10 * from NewTopic where levels>0 and parentid=0 and checkflag=1 order by levels desc,classid desc
</select>
</mapper>
\ No newline at end of file
......@@ -70,22 +70,23 @@
</select>
<select id="selectPictureNewList" resultMap="pictureMap" parameterType="io.office.modules.manage.entity.dto.PictureParams">
SELECT
t.pictureID,
t.title,
t.Picture_type,
t.showtime,
t.inputDate,
t.keyword,
t.Editor,
t.lasteditor,
t.auditor,
t.Status,
t.PicLevel
*
FROM
picture
WHERE
status = 1
AND PicLevel > 0
AND pictureid NOT IN (
SELECT
TOP 4 pictureid
FROM
picture t
where 1=1
and t.PicLevel > 0
and t.status = '1'
order by t.PicLevel desc,t.showtime desc ,t.inputDate desc,t.pictureID desc
picture
ORDER BY
PicLevel DESC,
pictureid DESC
)
ORDER BY
PicLevel DESC,
pictureid DESC
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment