Commit 210c56d9 by rongkailun

【修改】修改图片资讯bug

parent e391e734
...@@ -32,4 +32,6 @@ public class NewsParams extends PageParams { ...@@ -32,4 +32,6 @@ public class NewsParams extends PageParams {
private Integer classId; private Integer classId;
private String type; private String type;
private List list;
} }
...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.office.common.utils.PageUtils; import io.office.common.utils.PageUtils;
import io.office.common.utils.Query; import io.office.common.utils.Query;
import io.office.common.utils.R; import io.office.common.utils.R;
import io.office.modules.manage.dao.NewsDao;
import io.office.modules.manage.dao.PictureDao; import io.office.modules.manage.dao.PictureDao;
import io.office.modules.manage.entity.NewsEntity; import io.office.modules.manage.entity.NewsEntity;
import io.office.modules.manage.entity.PictureEntity; import io.office.modules.manage.entity.PictureEntity;
...@@ -108,8 +109,12 @@ public class PictureServiceImpl extends ServiceImpl<PictureDao, PictureEntity> i ...@@ -108,8 +109,12 @@ public class PictureServiceImpl extends ServiceImpl<PictureDao, PictureEntity> i
return page; return page;
} }
@Autowired
NewsDao newsDao;
@Override @Override
public Page<PictureEntity> selectPictureNewList(NewsParams params, Page page) { public Page<PictureEntity> selectPictureNewList(NewsParams params, Page page) {
List<PictureEntity> list = this.newsDao.pictureTop4();
params.setList(list);
List<PictureEntity> newsList = this.pictureDao.selectPictureNewList(params, page); List<PictureEntity> newsList = this.pictureDao.selectPictureNewList(params, page);
page.setRecords(newsList); page.setRecords(newsList);
return page; return page;
......
...@@ -68,25 +68,17 @@ ...@@ -68,25 +68,17 @@
ORDER BY ORDER BY
pictureID DESC pictureID DESC
</select> </select>
<select id="selectPictureNewList" resultMap="pictureMap" parameterType="io.office.modules.manage.entity.dto.PictureParams"> <select id="selectPictureNewList" resultMap="pictureMap" parameterType="io.office.modules.manage.entity.dto.NewsParams">
SELECT SELECT *
* FROM picture
FROM WHERE status = 1
picture AND PicLevel > 0
WHERE
status = 1 AND pictureid NOT IN
AND PicLevel > 0 <foreach collection="params.list" index="index" item="item" open="(" separator="," close=")">
AND pictureid NOT IN ( #{item.pictureid}
SELECT </foreach>
TOP 4 pictureid ORDER BY PicLevel DESC,
FROM pictureid DESC
picture
ORDER BY
PicLevel DESC,
pictureid DESC
)
ORDER BY
PicLevel DESC,
pictureid DESC
</select> </select>
</mapper> </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