|
|
@@ -1,114 +1,25 @@
|
|
|
-<?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">
|
|
|
+<?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.tianhu.system.mapper.SysNoticeMapper">
|
|
|
|
|
|
- <resultMap type="SysNotice" id="SysNoticeResult">
|
|
|
- <result property="noticeId" column="notice_id" />
|
|
|
- <result property="companyId" column="company_id" />
|
|
|
- <result property="tableId" column="table_id" />
|
|
|
- <result property="noticeTitle" column="notice_title" />
|
|
|
- <result property="noticeType" column="notice_type" />
|
|
|
- <result property="type" column="type" />
|
|
|
- <result property="status" column="status" />
|
|
|
- <result property="messageSend" column="message_send" />
|
|
|
- <result property="workType" column="work_type" />
|
|
|
- <result property="messageId" column="message_id" />
|
|
|
- <result property="messageStatus" column="message_status" />
|
|
|
- <result property="messageCode" column="message_code" />
|
|
|
- <result property="remark" column="remark" />
|
|
|
- <result property="createTime" column="create_time" />
|
|
|
+ <!-- 通用查询映射结果 -->
|
|
|
+ <resultMap id="BaseResultMap" type="com.tianhu.system.domain.SysNotice">
|
|
|
+ <id column="notice_id" property="noticeId" />
|
|
|
+ <result column="company_id" property="companyId" />
|
|
|
+ <result column="table_id" property="tableId" />
|
|
|
+ <result column="notice_title" property="noticeTitle" />
|
|
|
+ <result column="type" property="type" />
|
|
|
+ <result column="notice_type" property="noticeType" />
|
|
|
+ <result column="work_type" property="workType" />
|
|
|
+ <result column="status" property="status" />
|
|
|
+ <result column="message_send" property="messageSend" />
|
|
|
+ <result column="message_id" property="messageId" />
|
|
|
+ <result column="message_code" property="messageCode" />
|
|
|
+ <result column="message_status" property="messageStatus" />
|
|
|
+ <result column="open_type" property="openType" />
|
|
|
+ <result column="open_url" property="openUrl" />
|
|
|
+ <result column="remark" property="remark" />
|
|
|
+ <result column="create_time" property="createTime" />
|
|
|
</resultMap>
|
|
|
|
|
|
- <sql id="selectSysNoticeVo">
|
|
|
- select notice_id, company_id, table_id, notice_title, notice_type, type, status, message_send, work_type, message_id, message_status, message_code, remark, create_time from sys_notice
|
|
|
- </sql>
|
|
|
-
|
|
|
- <select id="selectNoticeList" parameterType="SysNotice" resultMap="SysNoticeResult">
|
|
|
- <include refid="selectSysNoticeVo"/>
|
|
|
- <where>
|
|
|
- <if test="companyId != null and companyId != ''"> and company_id = #{companyId}</if>
|
|
|
- <if test="tableId != null and tableId != ''"> and table_id = #{tableId}</if>
|
|
|
- <if test="noticeTitle != null and noticeTitle != ''"> and notice_title = #{noticeTitle}</if>
|
|
|
- <if test="noticeType != null and noticeType != ''"> and notice_type = #{noticeType}</if>
|
|
|
- <if test="type != null and type != ''"> and type = #{type}</if>
|
|
|
- <if test="status != null and status != ''"> and status = #{status}</if>
|
|
|
- <if test="messageSend != null and messageSend != ''"> and message_send = #{messageSend}</if>
|
|
|
- <if test="workType != null and workType != ''"> and work_type = #{workType}</if>
|
|
|
- <if test="messageId != null and messageId != ''"> and message_id = #{messageId}</if>
|
|
|
- <if test="messageStatus != null and messageStatus != ''"> and message_status = #{messageStatus}</if>
|
|
|
- <if test="messageCode != null and messageCode != ''"> and message_code = #{messageCode}</if>
|
|
|
- </where>
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="selectNoticeById" parameterType="String" resultMap="SysNoticeResult">
|
|
|
- <include refid="selectSysNoticeVo"/>
|
|
|
- where notice_id = #{noticeId}
|
|
|
- </select>
|
|
|
-
|
|
|
- <insert id="insertNotice" parameterType="SysNotice">
|
|
|
- insert into sys_notice(
|
|
|
- <if test="noticeId != null">notice_id,</if>
|
|
|
- <if test="companyId != null">company_id,</if>
|
|
|
- <if test="tableId != null">table_id,</if>
|
|
|
- <if test="noticeTitle != null and noticeTitle != ''">notice_title,</if>
|
|
|
- <if test="noticeType != null and noticeType != ''">notice_type,</if>
|
|
|
- <if test="type != null">type,</if>
|
|
|
- <if test="status != null">status,</if>
|
|
|
- <if test="messageSend != null">message_send,</if>
|
|
|
- <if test="workType != null">work_type,</if>
|
|
|
- <if test="messageId != null">message_id,</if>
|
|
|
- <if test="messageStatus != null">message_status,</if>
|
|
|
- <if test="messageCode != null">message_code,</if>
|
|
|
- <if test="remark != null">remark,</if>
|
|
|
- create_time
|
|
|
- )values(
|
|
|
- <if test="noticeId != null">#{noticeId},</if>
|
|
|
- <if test="companyId != null">#{companyId},</if>
|
|
|
- <if test="tableId != null">#{tableId},</if>
|
|
|
- <if test="noticeTitle != null and noticeTitle != ''">#{noticeTitle},</if>
|
|
|
- <if test="noticeType != null and noticeType != ''">#{noticeType},</if>
|
|
|
- <if test="type != null">#{type},</if>
|
|
|
- <if test="status != null">#{status},</if>
|
|
|
- <if test="messageSend != null">#{messageSend},</if>
|
|
|
- <if test="workType != null">#{workType},</if>
|
|
|
- <if test="messageId != null">#{messageId},</if>
|
|
|
- <if test="messageStatus != null">#{messageStatus},</if>
|
|
|
- <if test="messageCode != null">#{messageCode},</if>
|
|
|
- <if test="remark != null">#{remark},</if>
|
|
|
- sysdate()
|
|
|
- )
|
|
|
- </insert>
|
|
|
-
|
|
|
- <update id="updateNotice" parameterType="SysNotice">
|
|
|
- update sys_notice
|
|
|
- <trim prefix="SET" suffixOverrides=",">
|
|
|
- <if test="companyId != null">company_id = #{companyId},</if>
|
|
|
- <if test="tableId != null">table_id = #{tableId},</if>
|
|
|
- <if test="noticeTitle != null and noticeTitle != ''">notice_title = #{noticeTitle},</if>
|
|
|
- <if test="noticeType != null and noticeType != ''">notice_type = #{noticeType},</if>
|
|
|
- <if test="type != null">type = #{type},</if>
|
|
|
- <if test="status != null">status = #{status},</if>
|
|
|
- <if test="messageSend != null">message_send = #{messageSend},</if>
|
|
|
- <if test="workType != null">work_type = #{workType},</if>
|
|
|
- <if test="messageId != null">message_id = #{messageId},</if>
|
|
|
- <if test="messageStatus != null">message_status = #{messageStatus},</if>
|
|
|
- <if test="messageCode != null">message_code = #{messageCode},</if>
|
|
|
- <if test="remark != null">remark = #{remark},</if>
|
|
|
- </trim>
|
|
|
- where notice_id = #{noticeId}
|
|
|
- </update>
|
|
|
-
|
|
|
- <delete id="deleteNoticeById" parameterType="String">
|
|
|
- delete from sys_notice where notice_id = #{noticeId}
|
|
|
- </delete>
|
|
|
-
|
|
|
- <delete id="deleteNoticeByIds" parameterType="String">
|
|
|
- delete from sys_notice where notice_id in
|
|
|
- <foreach item="noticeId" collection="array" open="(" separator="," close=")">
|
|
|
- #{noticeId}
|
|
|
- </foreach>
|
|
|
- </delete>
|
|
|
-
|
|
|
-</mapper>
|
|
|
+</mapper>
|