|
@@ -3,7 +3,7 @@
|
|
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.ruoyi.system.mapper.SysNoticeMapper">
|
|
|
-
|
|
|
+
|
|
|
<resultMap type="SysNotice" id="SysNoticeResult">
|
|
|
<result property="noticeId" column="notice_id" />
|
|
|
<result property="noticeTitle" column="notice_title" />
|
|
@@ -15,75 +15,95 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="updateBy" column="update_by" />
|
|
|
<result property="updateTime" column="update_time" />
|
|
|
<result property="remark" column="remark" />
|
|
|
+ <result property="isPinned" column="is_pinned" />
|
|
|
+ <result property="deptId" column="dept_id" />
|
|
|
</resultMap>
|
|
|
-
|
|
|
+
|
|
|
<sql id="selectNoticeVo">
|
|
|
- select notice_id, notice_title, notice_type, notice_content, status, create_by, create_time, update_by, update_time, remark
|
|
|
- from sys_notice
|
|
|
+ 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, d.dept_id
|
|
|
+ from sys_notice d
|
|
|
</sql>
|
|
|
-
|
|
|
+
|
|
|
<select id="selectNoticeById" parameterType="Long" resultMap="SysNoticeResult">
|
|
|
<include refid="selectNoticeVo"/>
|
|
|
where notice_id = #{noticeId}
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<select id="selectNoticeList" parameterType="SysNotice" resultMap="SysNoticeResult">
|
|
|
<include refid="selectNoticeVo"/>
|
|
|
<where>
|
|
|
- <if test="noticeTitle != null and noticeTitle != ''">
|
|
|
- AND notice_title like concat('%', #{noticeTitle}, '%')
|
|
|
- </if>
|
|
|
- <if test="noticeType != null and noticeType != ''">
|
|
|
- AND notice_type = #{noticeType}
|
|
|
- </if>
|
|
|
- <if test="createBy != null and createBy != ''">
|
|
|
- AND create_by like concat('%', #{createBy}, '%')
|
|
|
- </if>
|
|
|
- </where>
|
|
|
+ <if test="noticeTitle != null and noticeTitle != ''">
|
|
|
+ AND notice_title like concat(concat('%',#{noticeTitle}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="noticeType != null and noticeType != ''">
|
|
|
+ AND notice_type = #{noticeType}
|
|
|
+ </if>
|
|
|
+ <if test="createBy != null and createBy != ''">
|
|
|
+ AND create_by like concat(concat('%',#{createBy}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="isPinned != null and isPinned != ''">
|
|
|
+ AND is_pinned = #{isPinned}
|
|
|
+ </if>
|
|
|
+ <if test="deptId != null and deptId != ''">
|
|
|
+ AND dept_id = #{deptId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ <!-- 数据范围过滤 -->
|
|
|
+ ${params.dataScope}
|
|
|
+ order by IS_PINNED desc
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<insert id="insertNotice" parameterType="SysNotice">
|
|
|
+ <selectKey keyProperty="noticeId" order="BEFORE" resultType="long">
|
|
|
+ select seq_sys_notice.nextval as noticeId from DUAL
|
|
|
+ </selectKey>
|
|
|
insert into sys_notice (
|
|
|
- <if test="noticeTitle != null and noticeTitle != '' ">notice_title, </if>
|
|
|
- <if test="noticeType != null and noticeType != '' ">notice_type, </if>
|
|
|
- <if test="noticeContent != null and noticeContent != '' ">notice_content, </if>
|
|
|
- <if test="status != null and status != '' ">status, </if>
|
|
|
- <if test="remark != null and remark != ''">remark,</if>
|
|
|
- <if test="createBy != null and createBy != ''">create_by,</if>
|
|
|
- create_time
|
|
|
- )values(
|
|
|
- <if test="noticeTitle != null and noticeTitle != ''">#{noticeTitle}, </if>
|
|
|
- <if test="noticeType != null and noticeType != ''">#{noticeType}, </if>
|
|
|
- <if test="noticeContent != null and noticeContent != ''">#{noticeContent}, </if>
|
|
|
- <if test="status != null and status != ''">#{status}, </if>
|
|
|
- <if test="remark != null and remark != ''">#{remark},</if>
|
|
|
- <if test="createBy != null and createBy != ''">#{createBy},</if>
|
|
|
- sysdate
|
|
|
- )
|
|
|
+ <if test="noticeId != null and noticeId != '' ">notice_id, </if>
|
|
|
+ <if test="noticeTitle != null and noticeTitle != '' ">notice_title, </if>
|
|
|
+ <if test="noticeType != null and noticeType != '' ">notice_type, </if>
|
|
|
+ <if test="noticeContent != null and noticeContent != '' ">notice_content, </if>
|
|
|
+ <if test="status != null and status != '' ">status, </if>
|
|
|
+ <if test="remark != null and remark != ''">remark,</if>
|
|
|
+ <if test="createBy != null and createBy != ''">create_by,</if>
|
|
|
+ <if test="deptId != null">dept_id,</if>
|
|
|
+ create_time,is_pinned
|
|
|
+ )values(
|
|
|
+ <if test="noticeId != null and noticeId != '' ">#{noticeId}, </if>
|
|
|
+ <if test="noticeTitle != null and noticeTitle != ''">#{noticeTitle}, </if>
|
|
|
+ <if test="noticeType != null and noticeType != ''">#{noticeType}, </if>
|
|
|
+ <if test="noticeContent != null and noticeContent != ''">#{noticeContent}, </if>
|
|
|
+ <if test="status != null and status != ''">#{status}, </if>
|
|
|
+ <if test="remark != null and remark != ''">#{remark},</if>
|
|
|
+ <if test="createBy != null and createBy != ''">#{createBy},</if>
|
|
|
+ <if test="deptId != null">#{deptId},</if>
|
|
|
+ sysdate,0
|
|
|
+ )
|
|
|
</insert>
|
|
|
-
|
|
|
+
|
|
|
<update id="updateNotice" parameterType="SysNotice">
|
|
|
- update sys_notice
|
|
|
+ update sys_notice
|
|
|
<set>
|
|
|
<if test="noticeTitle != null and noticeTitle != ''">notice_title = #{noticeTitle}, </if>
|
|
|
<if test="noticeType != null and noticeType != ''">notice_type = #{noticeType}, </if>
|
|
|
<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>
|
|
|
+ <if test="deptId != null">dept_id = #{deptId},</if>
|
|
|
update_time = sysdate
|
|
|
</set>
|
|
|
where notice_id = #{noticeId}
|
|
|
</update>
|
|
|
-
|
|
|
+
|
|
|
<delete id="deleteNoticeById" parameterType="Long">
|
|
|
delete from sys_notice where notice_id = #{noticeId}
|
|
|
</delete>
|
|
|
-
|
|
|
+
|
|
|
<delete id="deleteNoticeByIds" parameterType="Long">
|
|
|
- delete from sys_notice where notice_id in
|
|
|
+ delete from sys_notice where notice_id in
|
|
|
<foreach item="noticeId" collection="array" open="(" separator="," close=")">
|
|
|
#{noticeId}
|
|
|
</foreach>
|
|
|
</delete>
|
|
|
-
|
|
|
+
|
|
|
</mapper>
|