|
@@ -0,0 +1,151 @@
|
|
|
+<?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.ZxNoticeMapper">
|
|
|
+
|
|
|
+ <resultMap type="ZxNotice" id="ZxNoticeResult">
|
|
|
+ <result property="zxNoticeId" column="zx_notice_id" />
|
|
|
+ <result property="noticeTitle" column="notice_title" />
|
|
|
+ <result property="noticeType" column="notice_type" />
|
|
|
+ <result property="noticeContent" column="notice_content" />
|
|
|
+ <result property="status" column="status" />
|
|
|
+ <result property="issuer" column="issuer" />
|
|
|
+ <result property="issuerDept" column="issuer_dept" />
|
|
|
+ <result property="issuerDeptId" column="issuer_dept_id" />
|
|
|
+ <result property="issuerTime" column="issuer_time" />
|
|
|
+ <result property="type" column="type" />
|
|
|
+ <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="updateTime" column="update_time" />
|
|
|
+ <result property="remark" column="remark" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <resultMap id="ZxNoticeZxUserNoticeResult" type="ZxNotice" extends="ZxNoticeResult">
|
|
|
+ <collection property="zxUserNoticeList" notNullColumn="sub_user_id" javaType="java.util.List" resultMap="ZxUserNoticeResult" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <resultMap type="ZxUserNotice" id="ZxUserNoticeResult">
|
|
|
+ <result property="userId" column="sub_user_id" />
|
|
|
+ <result property="userName" column="sub_user_name" />
|
|
|
+ <result property="zxNoticeId" column="sub_zx_notice_id" />
|
|
|
+ <result property="zxNoticeType" column="sub_zx_notice_type" />
|
|
|
+ <result property="createTime" column="sub_create_time" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectZxNoticeVo">
|
|
|
+ select zx_notice_id, notice_title, notice_type, notice_content, status, issuer, issuer_dept, issuer_dept_id, issuer_time, create_by, create_time, update_by, update_time, remark from zx_notice
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectZxNoticeList" parameterType="ZxNotice" resultMap="ZxNoticeResult">
|
|
|
+ select a.zx_notice_id, a.notice_title, a.notice_type, a.notice_content, a.status, a.issuer, a.issuer_dept, a.issuer_dept_id, a.issuer_time, a.create_by, a.create_time, a.update_by, a.update_time, a.remark,
|
|
|
+ IFNULL( b.zx_notice_type, 'N' ) as type
|
|
|
+ from zx_notice a
|
|
|
+ left join zx_user_notice b on b.zx_notice_id = a.zx_notice_id
|
|
|
+ where a.zx_notice_id = #{zxNoticeId}
|
|
|
+ <where>
|
|
|
+ <if test="noticeTitle != null and noticeTitle != ''"> and a.notice_title = #{noticeTitle}</if>
|
|
|
+ <if test="noticeType != null and noticeType != ''"> and a.notice_type = #{noticeType}</if>
|
|
|
+ <if test="noticeContent != null and noticeContent != ''"> and a.notice_content = #{noticeContent}</if>
|
|
|
+ <if test="status != null and status != ''"> and a.status = #{status}</if>
|
|
|
+ <if test="issuer != null and issuer != ''"> and a.issuer = #{issuer}</if>
|
|
|
+ <if test="issuerDept != null and issuerDept != ''"> and a.issuer_dept = #{issuerDept}</if>
|
|
|
+ <if test="issuerDeptId != null "> and a.issuer_dept_id = #{issuerDeptId}</if>
|
|
|
+ <if test="issuerTime != null "> and a.issuer_time = #{issuerTime}</if>
|
|
|
+ </where>
|
|
|
+ order by issuer_time DESC
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectZxNoticeByZxNoticeId" parameterType="Long" resultMap="ZxNoticeZxUserNoticeResult">
|
|
|
+ select a.zx_notice_id, a.notice_title, a.notice_type, a.notice_content, a.status, a.issuer, a.issuer_dept, a.issuer_dept_id, a.issuer_time, a.create_by, a.create_time, a.update_by, a.update_time, a.remark,
|
|
|
+ b.user_id as sub_user_id, b.user_name as sub_user_name,b.zx_notice_type as sub_zx_notice_type, b.zx_notice_id as sub_zx_notice_id, b.create_time as sub_create_time
|
|
|
+ from zx_notice a
|
|
|
+ left join zx_user_notice b on b.zx_notice_id = a.zx_notice_id
|
|
|
+ where a.zx_notice_id = #{zxNoticeId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertZxNotice" parameterType="ZxNotice" useGeneratedKeys="true" keyProperty="zxNoticeId">
|
|
|
+ insert into zx_notice
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="noticeTitle != null and noticeTitle != ''">notice_title,</if>
|
|
|
+ <if test="noticeType != null and noticeType != ''">notice_type,</if>
|
|
|
+ <if test="noticeContent != null">notice_content,</if>
|
|
|
+ <if test="status != null">status,</if>
|
|
|
+ <if test="issuer != null">issuer,</if>
|
|
|
+ <if test="issuerDept != null">issuer_dept,</if>
|
|
|
+ <if test="issuerDeptId != null">issuer_dept_id,</if>
|
|
|
+ <if test="issuerTime != null">issuer_time,</if>
|
|
|
+ <if test="createBy != null">create_by,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ <if test="updateBy != null">update_by,</if>
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
+ <if test="remark != null">remark,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="noticeTitle != null and noticeTitle != ''">#{noticeTitle},</if>
|
|
|
+ <if test="noticeType != null and noticeType != ''">#{noticeType},</if>
|
|
|
+ <if test="noticeContent != null">#{noticeContent},</if>
|
|
|
+ <if test="status != null">#{status},</if>
|
|
|
+ <if test="issuer != null">#{issuer},</if>
|
|
|
+ <if test="issuerDept != null">#{issuerDept},</if>
|
|
|
+ <if test="issuerDeptId != null">#{issuerDeptId},</if>
|
|
|
+ <if test="issuerTime != null">#{issuerTime},</if>
|
|
|
+ <if test="createBy != null">#{createBy},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ <if test="updateBy != null">#{updateBy},</if>
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
+ <if test="remark != null">#{remark},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateZxNotice" parameterType="ZxNotice">
|
|
|
+ update zx_notice
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <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">status = #{status},</if>
|
|
|
+ <if test="issuer != null">issuer = #{issuer},</if>
|
|
|
+ <if test="issuerDept != null">issuer_dept = #{issuerDept},</if>
|
|
|
+ <if test="issuerDeptId != null">issuer_dept_id = #{issuerDeptId},</if>
|
|
|
+ <if test="issuerTime != null">issuer_time = #{issuerTime},</if>
|
|
|
+ <if test="createBy != null">create_by = #{createBy},</if>
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
+ <if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
+ <if test="remark != null">remark = #{remark},</if>
|
|
|
+ </trim>
|
|
|
+ where zx_notice_id = #{zxNoticeId}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteZxNoticeByZxNoticeId" parameterType="Long">
|
|
|
+ delete from zx_notice where zx_notice_id = #{zxNoticeId}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteZxNoticeByZxNoticeIds" parameterType="String">
|
|
|
+ delete from zx_notice where zx_notice_id in
|
|
|
+ <foreach item="zxNoticeId" collection="array" open="(" separator="," close=")">
|
|
|
+ #{zxNoticeId}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteZxUserNoticeByZxNoticeIds" parameterType="String">
|
|
|
+ delete from zx_user_notice where zx_notice_id in
|
|
|
+ <foreach item="zxNoticeId" collection="array" open="(" separator="," close=")">
|
|
|
+ #{zxNoticeId}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteZxUserNoticeByZxNoticeId" parameterType="Long">
|
|
|
+ delete from zx_user_notice where zx_notice_id = #{zxNoticeId}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <insert id="batchZxUserNotice">
|
|
|
+ insert into zx_user_notice( user_id, user_name, zx_notice_id, create_time) values
|
|
|
+ <foreach item="item" index="index" collection="list" separator=",">
|
|
|
+ ( #{item.userId}, #{item.userName}, #{item.zxNoticeId}, #{item.createTime})
|
|
|
+ </foreach>
|
|
|
+ </insert>
|
|
|
+</mapper>
|