|
@@ -5,16 +5,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
<mapper namespace="com.ruoyi.project.system.mapper.SysUserNoticeMapper">
|
|
<mapper namespace="com.ruoyi.project.system.mapper.SysUserNoticeMapper">
|
|
|
|
|
|
<resultMap type="SysUserNotice" id="SysUserNoticeResult">
|
|
<resultMap type="SysUserNotice" id="SysUserNoticeResult">
|
|
- <result property="id" column="id" />
|
|
|
|
<result property="userId" column="user_id" />
|
|
<result property="userId" column="user_id" />
|
|
<result property="noticeId" column="notice_id" />
|
|
<result property="noticeId" column="notice_id" />
|
|
- <result property="read" column="read" />
|
|
|
|
<result property="createtime" column="createtime" />
|
|
<result property="createtime" column="createtime" />
|
|
<result property="deptName" column="dept_name" />
|
|
<result property="deptName" column="dept_name" />
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectSysUserNoticeVo">
|
|
<sql id="selectSysUserNoticeVo">
|
|
- select d.id, d.user_id, d.notice_id, d.read, d.createtime ,s.dept_name from sys_user_notice d
|
|
|
|
|
|
+ select d.user_id, d.notice_id, d.createtime ,s.dept_name from sys_user_notice d
|
|
left join sys_dept s on s.dept_id = d.dept_id
|
|
left join sys_dept s on s.dept_id = d.dept_id
|
|
</sql>
|
|
</sql>
|
|
|
|
|
|
@@ -23,7 +21,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
<where>
|
|
<where>
|
|
<if test="userId != null "> and user_id = #{userId}</if>
|
|
<if test="userId != null "> and user_id = #{userId}</if>
|
|
<if test="noticeId != null "> and notice_id = #{noticeId}</if>
|
|
<if test="noticeId != null "> and notice_id = #{noticeId}</if>
|
|
- <if test="read != null "> and read = #{read}</if>
|
|
|
|
<if test="createtime != null "> and createtime = #{createtime}</if>
|
|
<if test="createtime != null "> and createtime = #{createtime}</if>
|
|
and d.del_flag = 0
|
|
and d.del_flag = 0
|
|
</where>
|
|
</where>
|
|
@@ -33,55 +30,44 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
<select id="selectSysUserNoticeById" parameterType="Long" resultMap="SysUserNoticeResult">
|
|
<select id="selectSysUserNoticeById" parameterType="Long" resultMap="SysUserNoticeResult">
|
|
<include refid="selectSysUserNoticeVo"/>
|
|
<include refid="selectSysUserNoticeVo"/>
|
|
- where id = #{id}
|
|
|
|
|
|
+ where user_id = #{userId}
|
|
</select>
|
|
</select>
|
|
|
|
|
|
- <select id="selectSysUserNoticeByUserId" parameterType="Long" resultMap="SysUserNoticeResult">
|
|
|
|
- <include refid="selectSysUserNoticeVo"/>
|
|
|
|
- where USER_ID = #{userId}
|
|
|
|
- </select>
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
<insert id="insertSysUserNotice" parameterType="SysUserNotice">
|
|
<insert id="insertSysUserNotice" parameterType="SysUserNotice">
|
|
- <selectKey keyProperty="id" resultType="long" order="BEFORE">
|
|
|
|
- SELECT seq_sys_user_notice.NEXTVAL as id FROM DUAL
|
|
|
|
- </selectKey>
|
|
|
|
insert into sys_user_notice
|
|
insert into sys_user_notice
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
- <if test="id != null">id,</if>
|
|
|
|
<if test="userId != null">user_id,</if>
|
|
<if test="userId != null">user_id,</if>
|
|
<if test="noticeId != null">notice_id,</if>
|
|
<if test="noticeId != null">notice_id,</if>
|
|
- <if test="read != null">read,</if>
|
|
|
|
<if test="createtime != null">createtime,</if>
|
|
<if test="createtime != null">createtime,</if>
|
|
</trim>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
- <if test="id != null">#{id},</if>
|
|
|
|
<if test="userId != null">#{userId},</if>
|
|
<if test="userId != null">#{userId},</if>
|
|
<if test="noticeId != null">#{noticeId},</if>
|
|
<if test="noticeId != null">#{noticeId},</if>
|
|
- <if test="read != null">#{read},</if>
|
|
|
|
<if test="createtime != null">#{createtime},</if>
|
|
<if test="createtime != null">#{createtime},</if>
|
|
</trim>
|
|
</trim>
|
|
</insert>
|
|
</insert>
|
|
|
|
|
|
- <update id="updateSysUserNotice" parameterType="SysUserNotice">
|
|
|
|
|
|
+ <!--<update id="updateSysUserNotice" parameterType="SysUserNotice">
|
|
update sys_user_notice
|
|
update sys_user_notice
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
- <if test="userId != null">user_id = #{userId},</if>
|
|
|
|
<if test="noticeId != null">notice_id = #{noticeId},</if>
|
|
<if test="noticeId != null">notice_id = #{noticeId},</if>
|
|
- <if test="read != null">read = #{read},</if>
|
|
|
|
<if test="createtime != null">createtime = #{createtime},</if>
|
|
<if test="createtime != null">createtime = #{createtime},</if>
|
|
</trim>
|
|
</trim>
|
|
- where id = #{id}
|
|
|
|
- </update>
|
|
|
|
|
|
+ where user_id = #{userId}
|
|
|
|
+ </update>-->
|
|
|
|
|
|
- <update id="deleteSysUserNoticeById" parameterType="Long">
|
|
|
|
- update sys_user_notice set del_flag = 2 where id = #{id}
|
|
|
|
|
|
+ <!-- <update id="deleteSysUserNoticeById" parameterType="Long">
|
|
|
|
+ update sys_user_notice set del_flag = 2 where user_id = #{userId}
|
|
</update>
|
|
</update>
|
|
|
|
|
|
<update id="deleteSysUserNoticeByIds" parameterType="String">
|
|
<update id="deleteSysUserNoticeByIds" parameterType="String">
|
|
- update sys_user_notice set del_flag = 2 where id in
|
|
|
|
- <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
|
- #{id}
|
|
|
|
|
|
+ update sys_user_notice set del_flag = 2 where user_id in
|
|
|
|
+ <foreach item="userId" collection="array" open="(" separator="," close=")">
|
|
|
|
+ #{userId}
|
|
</foreach>
|
|
</foreach>
|
|
- </update>
|
|
|
|
|
|
+ </update>-->
|
|
|
|
|
|
</mapper>
|
|
</mapper>
|