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<YsNo
jeesite实现分页
最新推荐文章于 2020-12-07 11:13:03 发布