|
@@ -21,7 +21,8 @@
|
|
|
<sql id="selectPostBulletinVo">
|
|
|
select notice_id,
|
|
|
notice_title,
|
|
|
- cast(notice_content as char) as notice_content status,
|
|
|
+ cast(notice_content as char) as notice_content,
|
|
|
+ status,
|
|
|
publisher_id,
|
|
|
publisher_by,
|
|
|
create_by,
|
|
@@ -35,9 +36,18 @@
|
|
|
<select id="selectPostBulletinList" parameterType="PostBulletin" resultMap="PostBulletinResult">
|
|
|
<include refid="selectPostBulletinVo"/>
|
|
|
<where>
|
|
|
+--标题查询
|
|
|
<if test="noticeTitle != null and noticeTitle != ''">
|
|
|
AND notice_title like concat('%', #{noticeTitle}, '%')
|
|
|
</if>
|
|
|
+--内容查询
|
|
|
+ <if test="noticeContent != null and noticeTitle != ''">
|
|
|
+ AND notice_content like concat('%', #{noticeContent}, '%')
|
|
|
+ </if>
|
|
|
+-- 时间查询
|
|
|
+ <if test="createTime != null and noticeTitle != ''">
|
|
|
+ AND create_time like concat('%', #{createTime}, '%')
|
|
|
+ </if>
|
|
|
</where>
|
|
|
</select>
|
|
|
|
|
@@ -47,29 +57,31 @@
|
|
|
</select>
|
|
|
|
|
|
<insert id="insertPostBulletin" parameterType="PostBulletin" useGeneratedKeys="true" keyProperty="noticeId">
|
|
|
- insert into post_bulletin(
|
|
|
- <if test="noticeTitle != null and noticeTitle != ''">notice_title,</if>
|
|
|
- <if test="noticeContent != null">notice_content,</if>
|
|
|
- <if test="status != null">status,</if>
|
|
|
- <if test="publisherId != null">publisher_id,</if>
|
|
|
- <if test="publisherBy != null">publisher_by,</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>
|
|
|
- )values(
|
|
|
- <if test="noticeTitle != null and noticeTitle != ''">#{noticeTitle},</if>
|
|
|
- <if test="noticeContent != null">#{noticeContent},</if>
|
|
|
- <if test="status != null">#{status},</if>
|
|
|
- <if test="publisherId != null">#{publisherId},</if>
|
|
|
- <if test="publisherBy != null">#{publisherBy},</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>
|
|
|
- )
|
|
|
+ insert into post_bulletin
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="noticeTitle != null and noticeTitle != ''">notice_title,</if>
|
|
|
+ <if test="noticeContent != null">notice_content,</if>
|
|
|
+ <if test="status != null">status,</if>
|
|
|
+ <if test="publisherId != null">publisher_id,</if>
|
|
|
+ <if test="publisherBy != null">publisher_by,</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="noticeContent != null">#{noticeContent},</if>
|
|
|
+ <if test="status != null">#{status},</if>
|
|
|
+ <if test="publisherId != null">#{publisherId},</if>
|
|
|
+ <if test="publisherBy != null">#{publisherBy},</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="updatePostBulletin" parameterType="PostBulletin">
|