|
@@ -0,0 +1,122 @@
|
|
|
+<?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.PoNoticeMapper">
|
|
|
+
|
|
|
+ <resultMap type="PoNotice" id="PoNoticeResult">
|
|
|
+ <result property="noticeId" column="notice_id"/>
|
|
|
+ <result property="noticeTitle" column="notice_title"/>
|
|
|
+ <result property="noticeContent" column="notice_content"/>
|
|
|
+ <result property="noticeType" column="notice_type"/>
|
|
|
+ <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"/>
|
|
|
+ <result property="publisherId" column="publisher_id"/>
|
|
|
+ <result property="userId" column="user_id" typeHandler="com.ruoyi.common.utils.sql.List2VarcharHandler"/>
|
|
|
+ <result property="delFlag" column="del_flag"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectPoNoticeVo">
|
|
|
+ select notice_id,
|
|
|
+ notice_title,
|
|
|
+ cast(notice_content as char) as notice_content,
|
|
|
+ notice_type,
|
|
|
+ status,
|
|
|
+ create_by,
|
|
|
+ create_time,
|
|
|
+ update_by,
|
|
|
+ update_time,
|
|
|
+ remark,
|
|
|
+ publisher_id,
|
|
|
+ user_id,
|
|
|
+ del_flag
|
|
|
+ from po_notice
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectPoNoticeById" parameterType="Long" resultMap="PoNoticeResult">
|
|
|
+ <include refid="selectPoNoticeVo"/>
|
|
|
+ where notice_id = #{noticeId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectPoNoticeList" parameterType="PoNotice" resultMap="PoNoticeResult">
|
|
|
+ <include refid="selectPoNoticeVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="noticeTitle != null and noticeTitle != ''">
|
|
|
+ AND notice_title like concat('%', #{noticeTitle}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="createBy != null and createBy != ''">
|
|
|
+ AND create_by like concat('%', #{createBy}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="publisherId != null and publisherId != ''">
|
|
|
+ AND publisher_id like concat('%', #{publisherId}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="delFlag != null and delFlag != ''">
|
|
|
+ AND del_flag like concat('%', #{delFlag}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="noticeType != null and noticeType != ''">
|
|
|
+ AND notice_type like concat('%', #{noticeType}, '%')
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertPoNotice" parameterType="PoNotice">
|
|
|
+ insert into po_notice (
|
|
|
+ <if test="noticeTitle != null and noticeTitle != '' ">notice_title,</if>
|
|
|
+ <if test="noticeContent != null and noticeContent != '' ">notice_content,</if>
|
|
|
+ <if test="noticeType != null and noticeType != '' ">notice_type,</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="publisherId != null and publisherId != ''">publisher_id,</if>
|
|
|
+ <if test="userId != null and userId != ''">user_id,</if>
|
|
|
+ del_flag,
|
|
|
+ create_time
|
|
|
+ )values(
|
|
|
+ <if test="noticeTitle != null and noticeTitle != ''">#{noticeTitle},</if>
|
|
|
+ <if test="noticeContent != null and noticeContent != ''">#{noticeContent},</if>
|
|
|
+ <if test="noticeType != null and noticeType != ''">#{noticeType},</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="publisherId != null and publisherId != ''">#{publisher_id},</if>
|
|
|
+ <if test="userId != null and userId != ''">#{user_id},</if>
|
|
|
+ 0,
|
|
|
+ sysdate()
|
|
|
+ )
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updatePoNotice" parameterType="PoNotice">
|
|
|
+ update po_notice
|
|
|
+ <set>
|
|
|
+ <if test="noticeTitle != null and noticeTitle != ''">notice_title = #{noticeTitle},</if>
|
|
|
+ <if test="noticeContent != null">notice_content = #{noticeContent},</if>
|
|
|
+ <if test="noticeType != null and noticeType != ''">notice_type = #{noticeType},</if>
|
|
|
+ <if test="status != null and status != ''">status = #{status},</if>
|
|
|
+ <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
|
|
+ <if test="remark != null and remark != ''">remark = #{remark},</if>
|
|
|
+ <if test="publisherId != null and publisherId != ''">publisher_id = #{publisherId},</if>
|
|
|
+ <if test="userId != null and userId != ''">user_id = #{userId},</if>
|
|
|
+ <if test="delFlag != null and delFlag != ''">del_flag = #{del_flag},</if>
|
|
|
+ update_time = sysdate()
|
|
|
+ </set>
|
|
|
+ where notice_id = #{noticeId}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deletePoNoticeById" parameterType="Long">
|
|
|
+ delete
|
|
|
+ from po_notice
|
|
|
+ where notice_id = #{noticeId}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deletePoNoticeByIds" parameterType="Long">
|
|
|
+ delete from po_notice where notice_id in
|
|
|
+ <foreach item="noticeId" collection="array" open="(" separator="," close=")">
|
|
|
+ #{noticeId}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+
|
|
|
+</mapper>
|