Commit 210c56d9 by rongkailun

【修改】修改图片资讯bug

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