|
@@ -16,11 +16,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="updateTime" column="update_time" />
|
|
|
<result property="remark" column="remark" />
|
|
|
<result property="userId" column="user_id" />
|
|
|
+ <result property="isPinned" column="is_pinned" />
|
|
|
<!--<result property="readFlag" column="read_flag" />-->
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectNoticeVo">
|
|
|
- select d.notice_id, d.notice_title, d.notice_type, d.notice_content, d.status, d.create_by, d.create_time, d.update_by, d.update_time, d.remark
|
|
|
+ select d.notice_id, d.notice_title, d.notice_type, d.notice_content, d.status, d.create_by, d.create_time, d.update_by, d.update_time, d.remark, d.is_pinned
|
|
|
from sys_notice d
|
|
|
</sql>
|
|
|
|
|
@@ -30,7 +31,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</select>
|
|
|
|
|
|
<select id="selectNoticeList" parameterType="SysNotice" resultMap="SysNoticeResult">
|
|
|
- select n.user_id, d.notice_id, d.notice_title, d.notice_type, d.notice_content, d.status, d.create_by, d.create_time, d.update_by, d.update_time, d.remark
|
|
|
+ select n.user_id, d.notice_id, d.notice_title, d.notice_type, d.notice_content, d.status, d.create_by, d.create_time, d.update_by, d.update_time, d.remark, d.is_pinned
|
|
|
from sys_notice d
|
|
|
LEFT JOIN SYS_USER_NOTICE n on d.NOTICE_ID = n.NOTICE_ID
|
|
|
<if test="userId != null and userId != ''">
|
|
@@ -47,17 +48,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
AND d.create_by like concat(concat('%',#{createBy}),'%')
|
|
|
</if>
|
|
|
</where>
|
|
|
- order by n.user_id
|
|
|
+ order by n.user_id, d.IS_PINNED desc
|
|
|
</select>
|
|
|
|
|
|
<select id="selectNoticeUnList" parameterType="SysNotice" resultMap="SysNoticeResult">
|
|
|
- select n.user_id, d.notice_id, d.notice_title, d.notice_type, d.notice_content, d.status, d.create_by, d.create_time, d.update_by, d.update_time, d.remark
|
|
|
+ select n.user_id, d.notice_id, d.notice_title, d.notice_type, d.notice_content, d.status, d.create_by, d.create_time, d.update_by, d.update_time, d.remark, d.is_pinned
|
|
|
from sys_notice d
|
|
|
LEFT JOIN SYS_USER_NOTICE n on d.NOTICE_ID = n.NOTICE_ID
|
|
|
<if test="userId != null and userId != ''">
|
|
|
and n.USER_ID = #{userId}
|
|
|
</if>
|
|
|
where n.user_id is null
|
|
|
+ order by d.IS_PINNED desc
|
|
|
</select>
|
|
|
|
|
|
<insert id="insertNotice" parameterType="SysNotice">
|
|
@@ -93,6 +95,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="noticeContent != null">notice_content = #{noticeContent}, </if>
|
|
|
<if test="status != null and status != ''">status = #{status}, </if>
|
|
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
|
|
+ <if test="isPinned != null and isPinned != ''">is_pinned = #{isPinned},</if>
|
|
|
update_time = sysdate
|
|
|
</set>
|
|
|
where notice_id = #{noticeId}
|