|
@@ -12,6 +12,8 @@
|
|
<result property="noticeContent" column="notice_content"/>
|
|
<result property="noticeContent" column="notice_content"/>
|
|
<result property="status" column="status"/>
|
|
<result property="status" column="status"/>
|
|
<result property="type" column="type"/>
|
|
<result property="type" column="type"/>
|
|
|
|
+ <result property="classIdKeJian" column="class_id_kejian"/>
|
|
|
|
+ <result property="classIdBuKeJian" column="class_id_bukejian"/>
|
|
<result property="senderId" column="sender_id"/>
|
|
<result property="senderId" column="sender_id"/>
|
|
<result property="senderName" column="sender_name"/>
|
|
<result property="senderName" column="sender_name"/>
|
|
<result property="senderDept" column="sender_dept"/>
|
|
<result property="senderDept" column="sender_dept"/>
|
|
@@ -22,10 +24,13 @@
|
|
<result property="remark" column="remark"/>
|
|
<result property="remark" column="remark"/>
|
|
<result property="avatar" column="avatar"/>
|
|
<result property="avatar" column="avatar"/>
|
|
<result property="schoolName" column="school_name"/>
|
|
<result property="schoolName" column="school_name"/>
|
|
|
|
+ <result property="comment" column="comment"/>
|
|
|
|
+ <result property="prised" column="prised"/>
|
|
|
|
+ <result property="collect" column="collect"/>
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectXiaoyuanNoticeVo">
|
|
<sql id="selectXiaoyuanNoticeVo">
|
|
- select notice_id, image, notice_title, notice_type, notice_content, status, type,school_name,avatar, sender_id, sender_name, sender_dept, create_by, create_time, update_by, update_time, remark from xiaoyuan_notice
|
|
|
|
|
|
+ select notice_id, image, notice_title, notice_type, notice_content, status, type,school_name,avatar, sender_id, sender_name, sender_dept, create_by, create_time, update_by, update_time, remark,collect,prised,comment from xiaoyuan_notice
|
|
</sql>
|
|
</sql>
|
|
|
|
|
|
<select id="selectXiaoyuanNoticeList" parameterType="XiaoyuanNotice" resultMap="XiaoyuanNoticeResult">
|
|
<select id="selectXiaoyuanNoticeList" parameterType="XiaoyuanNotice" resultMap="XiaoyuanNoticeResult">
|
|
@@ -41,64 +46,21 @@ SELECT
|
|
school_name,
|
|
school_name,
|
|
sender_id,
|
|
sender_id,
|
|
sender_name,
|
|
sender_name,
|
|
|
|
+ class_id_kejian,
|
|
|
|
+ class_id_bukejian
|
|
sender_dept,
|
|
sender_dept,
|
|
create_by,
|
|
create_by,
|
|
create_time,
|
|
create_time,
|
|
update_by,
|
|
update_by,
|
|
update_time,
|
|
update_time,
|
|
- remark
|
|
|
|
|
|
+ remark,
|
|
|
|
+ comment,
|
|
|
|
+ prised,
|
|
|
|
+ collect
|
|
FROM
|
|
FROM
|
|
xiaoyuan_notice
|
|
xiaoyuan_notice
|
|
WHERE
|
|
WHERE
|
|
- type = '0'
|
|
|
|
- UNION
|
|
|
|
-SELECT
|
|
|
|
- notice_id,
|
|
|
|
- image,
|
|
|
|
- notice_title,
|
|
|
|
- notice_type,
|
|
|
|
- notice_content,
|
|
|
|
- STATUS,
|
|
|
|
- type,
|
|
|
|
- avatar,
|
|
|
|
- school_name,
|
|
|
|
- sender_id,
|
|
|
|
- sender_name,
|
|
|
|
- sender_dept,
|
|
|
|
- create_by,
|
|
|
|
- create_time,
|
|
|
|
- update_by,
|
|
|
|
- update_time,
|
|
|
|
- remark
|
|
|
|
-FROM
|
|
|
|
- xiaoyuan_notice
|
|
|
|
-WHERE
|
|
|
|
- find_in_set( sender_dept, ${senderDept} )
|
|
|
|
- and type = '1'
|
|
|
|
- UNION
|
|
|
|
-SELECT
|
|
|
|
- notice_id,
|
|
|
|
- image,
|
|
|
|
- notice_title,
|
|
|
|
- notice_type,
|
|
|
|
- notice_content,
|
|
|
|
- STATUS,
|
|
|
|
- type,
|
|
|
|
- avatar,
|
|
|
|
- school_name,
|
|
|
|
- sender_id,
|
|
|
|
- sender_name,
|
|
|
|
- sender_dept,
|
|
|
|
- create_by,
|
|
|
|
- create_time,
|
|
|
|
- update_by,
|
|
|
|
- update_time,
|
|
|
|
- remark
|
|
|
|
-FROM
|
|
|
|
- xiaoyuan_notice
|
|
|
|
-WHERE
|
|
|
|
- sender_id = ${senderId}
|
|
|
|
- AND type = '2'
|
|
|
|
|
|
+ (type = '0') or (type = '3' and sender_id = #{senderId}) or (type = '1' and find_in_set_multiple(#{senderDept},class_id_kejian)) or (type = '2' and !find_in_set_multiple(#{senderDept},class_id_bukejian)) order by create_time DESC
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="selectXiaoyuanNoticeByNoticeId" parameterType="Integer" resultMap="XiaoyuanNoticeResult">
|
|
<select id="selectXiaoyuanNoticeByNoticeId" parameterType="Integer" resultMap="XiaoyuanNoticeResult">
|
|
@@ -119,6 +81,8 @@ WHERE
|
|
<if test="noticeContent != null and noticeContent != ''">notice_content,</if>
|
|
<if test="noticeContent != null and noticeContent != ''">notice_content,</if>
|
|
<if test="status != null and status != ''">status,</if>
|
|
<if test="status != null and status != ''">status,</if>
|
|
<if test="type != null and type != ''">type,</if>
|
|
<if test="type != null and type != ''">type,</if>
|
|
|
|
+ <if test="classIdKeJian != null and classIdKeJian != ''">class_id_kejian,</if>
|
|
|
|
+ <if test="classIdBuKeJian != null and classIdBuKeJian != ''">class_id_bukejian,</if>
|
|
<if test="schoolName != null and schoolName != ''">school_name,</if>
|
|
<if test="schoolName != null and schoolName != ''">school_name,</if>
|
|
<if test="avatar != null and avatar != ''">avatar,</if>
|
|
<if test="avatar != null and avatar != ''">avatar,</if>
|
|
<if test="senderId != null">sender_id,</if>
|
|
<if test="senderId != null">sender_id,</if>
|
|
@@ -129,6 +93,9 @@ WHERE
|
|
<if test="updateBy != null">update_by,</if>
|
|
<if test="updateBy != null">update_by,</if>
|
|
<if test="updateTime != null">update_time,</if>
|
|
<if test="updateTime != null">update_time,</if>
|
|
<if test="remark != null">remark,</if>
|
|
<if test="remark != null">remark,</if>
|
|
|
|
+ <if test="comment != null">comment,</if>
|
|
|
|
+ <if test="prised != null">prised,</if>
|
|
|
|
+ <if test="collect != null">collect,</if>
|
|
</trim>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="image != null">#{image},</if>
|
|
<if test="image != null">#{image},</if>
|
|
@@ -137,6 +104,8 @@ WHERE
|
|
<if test="noticeContent != null and noticeContent != ''">#{noticeContent},</if>
|
|
<if test="noticeContent != null and noticeContent != ''">#{noticeContent},</if>
|
|
<if test="status != null and status != ''">#{status},</if>
|
|
<if test="status != null and status != ''">#{status},</if>
|
|
<if test="type != null and type != ''">#{type},</if>
|
|
<if test="type != null and type != ''">#{type},</if>
|
|
|
|
+ <if test="classIdKeJian != null and classIdKeJian != ''">#{classIdKeJian},</if>
|
|
|
|
+ <if test="classIdBuKeJian != null and classIdBuKeJian != ''">#{classIdBuKeJian},</if>
|
|
<if test="schoolName != null and schoolName != ''">#{schoolName},</if>
|
|
<if test="schoolName != null and schoolName != ''">#{schoolName},</if>
|
|
<if test="avatar != null and avatar != ''">#{avatar},</if>
|
|
<if test="avatar != null and avatar != ''">#{avatar},</if>
|
|
<if test="senderId != null">#{senderId},</if>
|
|
<if test="senderId != null">#{senderId},</if>
|
|
@@ -147,6 +116,9 @@ WHERE
|
|
<if test="updateBy != null">#{updateBy},</if>
|
|
<if test="updateBy != null">#{updateBy},</if>
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
<if test="remark != null">#{remark},</if>
|
|
<if test="remark != null">#{remark},</if>
|
|
|
|
+ <if test="comment != null">#{comment},</if>
|
|
|
|
+ <if test="prised != null">#{prised},</if>
|
|
|
|
+ <if test="collect != null">#{collect},</if>
|
|
</trim>
|
|
</trim>
|
|
</insert>
|
|
</insert>
|
|
|
|
|
|
@@ -159,6 +131,8 @@ WHERE
|
|
<if test="noticeContent != null and noticeContent != ''">notice_content = #{noticeContent},</if>
|
|
<if test="noticeContent != null and noticeContent != ''">notice_content = #{noticeContent},</if>
|
|
<if test="status != null and status != ''">status = #{status},</if>
|
|
<if test="status != null and status != ''">status = #{status},</if>
|
|
<if test="type != null and type != ''">type = #{type},</if>
|
|
<if test="type != null and type != ''">type = #{type},</if>
|
|
|
|
+ <if test="classIdKeJian != null and classIdKeJian != ''">class_id_kejian = #{classIdKeJian},</if>
|
|
|
|
+ <if test="classIdBuKeJian != null and classIdBuKeJian != ''">class_id_bukejian = #{classIdBuKeJian},</if>
|
|
<if test="schoolName != null and schoolName != ''">school_name = #{schoolName},</if>
|
|
<if test="schoolName != null and schoolName != ''">school_name = #{schoolName},</if>
|
|
<if test="avatar != null and avatar != ''">avatar = #{avatar},</if>
|
|
<if test="avatar != null and avatar != ''">avatar = #{avatar},</if>
|
|
<if test="senderId != null">sender_id = #{senderId},</if>
|
|
<if test="senderId != null">sender_id = #{senderId},</if>
|
|
@@ -169,6 +143,9 @@ WHERE
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
<if test="remark != null">remark = #{remark},</if>
|
|
<if test="remark != null">remark = #{remark},</if>
|
|
|
|
+ <if test="comment != null">comment = #{comment},</if>
|
|
|
|
+ <if test="prised != null">prised = #{prised},</if>
|
|
|
|
+ <if test="collect != null">collect = #{collect},</if>
|
|
</trim>
|
|
</trim>
|
|
where notice_id = #{noticeId}
|
|
where notice_id = #{noticeId}
|
|
</update>
|
|
</update>
|