|
@@ -1,100 +1,113 @@
|
|
|
<?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">
|
|
|
+ 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="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="noticeContent" column="notice_content" />
|
|
|
- <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="companyId" column="company_id" />
|
|
|
+ <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" />
|
|
|
</resultMap>
|
|
|
-
|
|
|
- <sql id="selectNoticeVo">
|
|
|
- select notice_id, notice_title, notice_type, cast(notice_content as char) as notice_content, status, create_by, create_time, update_by, update_time, remark,company_id
|
|
|
- from sys_notice
|
|
|
+
|
|
|
+ <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 from sys_notice
|
|
|
</sql>
|
|
|
-
|
|
|
- <select id="selectNoticeById" parameterType="Long" resultMap="SysNoticeResult">
|
|
|
- <include refid="selectNoticeVo"/>
|
|
|
- where notice_id = #{noticeId}
|
|
|
- </select>
|
|
|
-
|
|
|
+
|
|
|
<select id="selectNoticeList" parameterType="SysNotice" resultMap="SysNoticeResult">
|
|
|
- <include refid="selectNoticeVo"/>
|
|
|
+ <include refid="selectSysNoticeVo"/>
|
|
|
<where>
|
|
|
- <if test="companyId != null and companyId != ''">
|
|
|
- AND company_id = #{companyId}
|
|
|
- </if>
|
|
|
- <if test="status != null and status != ''">
|
|
|
- AND status = #{status}
|
|
|
- </if>
|
|
|
- <if test="noticeTitle != null and noticeTitle != ''">
|
|
|
- AND notice_title like concat('%', #{noticeTitle}, '%')
|
|
|
- </if>
|
|
|
- <if test="noticeType != null and noticeType != ''">
|
|
|
- AND notice_type = #{noticeType}
|
|
|
- </if>
|
|
|
- <if test="createBy != null and createBy != ''">
|
|
|
- AND create_by like concat('%', #{createBy}, '%')
|
|
|
- </if>
|
|
|
- </where>
|
|
|
- ORDER BY create_time DESC
|
|
|
+ <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="noticeTitle != null and noticeTitle != '' ">notice_title, </if>
|
|
|
+ insert into sys_notice
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="noticeId != null">notice_id,</if>
|
|
|
<if test="companyId != null">company_id,</if>
|
|
|
- <if test="noticeType != null and noticeType != '' ">notice_type, </if>
|
|
|
- <if test="noticeContent != null and noticeContent != '' ">notice_content, </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="noticeTitle != null and noticeTitle != ''">#{noticeTitle}, </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>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="noticeId != null">#{noticeId},</if>
|
|
|
<if test="companyId != null">#{companyId},</if>
|
|
|
- <if test="noticeType != null and noticeType != ''">#{noticeType}, </if>
|
|
|
- <if test="noticeContent != null and noticeContent != ''">#{noticeContent}, </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()
|
|
|
- )
|
|
|
+ <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>
|
|
|
+ </trim>
|
|
|
</insert>
|
|
|
-
|
|
|
+
|
|
|
<update id="updateNotice" parameterType="SysNotice">
|
|
|
- update sys_notice
|
|
|
- <set>
|
|
|
+ update sys_notice
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
<if test="companyId != null">company_id = #{companyId},</if>
|
|
|
- <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 and status != ''">status = #{status}, </if>
|
|
|
- <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
|
|
- update_time = sysdate()
|
|
|
- </set>
|
|
|
+ <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="Long">
|
|
|
+
|
|
|
+ <delete id="deleteNoticeById" parameterType="String">
|
|
|
delete from sys_notice where notice_id = #{noticeId}
|
|
|
</delete>
|
|
|
-
|
|
|
- <delete id="deleteNoticeByIds" parameterType="Long">
|
|
|
- delete from sys_notice where notice_id in
|
|
|
+
|
|
|
+ <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>
|