|
@@ -0,0 +1,85 @@
|
|
|
+<?xml version="1.0" encoding="UTF-8" ?>
|
|
|
+<!DOCTYPE mapper
|
|
|
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
+<mapper namespace="com.ruoyi.system.mapper.SysNoticeUserMapper">
|
|
|
+
|
|
|
+ <resultMap type="SysNoticeUser" id="SysNoticeUserResult">
|
|
|
+ <result property="noticeUserId" column="notice_user_id" />
|
|
|
+ <result property="noticeId" column="notice_id" />
|
|
|
+ <result property="userId" column="user_id" />
|
|
|
+ <result property="status" column="status" />
|
|
|
+ <result property="createBy" column="create_by" />
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
+ <result property="updateBy" column="update_by" />
|
|
|
+ <result property="updateTime" column="update_time" />
|
|
|
+ <result property="remark" column="remark" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectNoticeUserVo">
|
|
|
+ select notice_id, notice_user_id, user_id, status, create_by, create_time, update_by, update_time, remark
|
|
|
+ from sys_notice
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectNoticeUserById" parameterType="Long" resultMap="SysNoticeUserResult">
|
|
|
+ <include refid="selectNoticeUserVo"/>
|
|
|
+ where notice_user_id = #{noticeUserId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectNoticeUserList" parameterType="SysNoticeUser" resultMap="SysNoticeUserResult">
|
|
|
+ <include refid="selectNoticeUserVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="noticeId != null and noticeId != ''">
|
|
|
+ AND notice_id = #{noticeId}
|
|
|
+ </if>
|
|
|
+ <if test="userId != null and userId != ''">
|
|
|
+ AND user_id = #{userId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertNoticeUser" parameterType="SysNoticeUser">
|
|
|
+ insert into sys_notice_user (
|
|
|
+ <if test="noticeId != null and noticeId != '' ">notice_id, </if>
|
|
|
+ <if test="noticeUserId != null and noticeUserId != '' ">notice_user_id, </if>
|
|
|
+ <if test="userId != null and userId != '' ">user_id, </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="noticeId != null and noticeId != ''">#{noticeId}, </if>
|
|
|
+ <if test="noticeUserId != null and noticeUserId != ''">#{noticeUserId}, </if>
|
|
|
+ <if test="userId != null and userId != ''">#{userId}, </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()
|
|
|
+ )
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateNoticeUser" parameterType="SysNoticeUser">
|
|
|
+ update sys_notice_user
|
|
|
+ <set>
|
|
|
+ <if test="noticeId != null and noticeId != ''">notice_id = #{noticeId}, </if>
|
|
|
+ <if test="noticeUserId != null and noticeUserId != ''">notice_user_id = #{noticeUserId}, </if>
|
|
|
+ <if test="userId != null">user_id = #{userId}, </if>
|
|
|
+ <if test="status != null and status != ''">status = #{status}, </if>
|
|
|
+ <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
|
|
+ update_time = sysdate()
|
|
|
+ </set>
|
|
|
+ where notice_id = #{noticeId}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteNoticeUserById" parameterType="Long">
|
|
|
+ delete from sys_notice_user where notice_user_id = #{noticeUserId}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteNoticeUserByIds" parameterType="Long">
|
|
|
+ delete from sys_notice_user where notice_user_id in
|
|
|
+ <foreach item="noticeUserId" collection="array" open="(" separator="," close=")">
|
|
|
+ #{noticeUserId}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+
|
|
|
+</mapper>
|