dao.xml中的代码
<select id="selectByUserId" resultType="com.yckj.modules.ts_notices.entity.YsNoticeVo">
select
a.id AS "noticeId",
a.notice_name AS "noticeName",
a.notice_type AS "noticeType",
a.notice_content AS "noticeContent",
a.notice_time AS "noticeTime",
n.is_read AS "isRead",
n.id AS "noticeManlistId"
from ys_notice_manlist n
JOIN ys_notice a ON a.id = n.notice_id
where n.user_id =#{userId}
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
<otherwise>
order by notice_time DESC
</otherwise>
</choose>
</select>
dao层的代码
List<YsNoticeVo> selectByUserId(@Param("userId") String userId, @Param("page") Page<YsNoticeVo> page);
service的代码
public Page<YsNoticeVo> selectByUserId(Page<YsNoticeVo> page){
User user = UserUtils.getNewUser(
jeesite实现分页
最新推荐文章于 2023-07-30 21:06:49 发布