|
@@ -11,10 +11,13 @@
|
|
|
<result column="im_group_id_" property="imGroupId"/>
|
|
|
<result column="title_" property="title"/>
|
|
|
<result column="content_" property="content"/>
|
|
|
+ <result column="real_name_" property="realName"/>
|
|
|
+ <result column="avatar_" property="avatar"/>
|
|
|
<result column="is_top_" property="isTop" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
|
|
|
<result column="is_sent_to_new_member_" property="isSentToNewMember" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
|
|
|
<result column="del_flag_" property="delFlag" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
|
|
|
<result column="create_time_" property="createTime"/>
|
|
|
+ <result column="operator_id_" property="operatorId"/>
|
|
|
<result column="update_time_" property="updateTime"/>
|
|
|
</resultMap>
|
|
|
|
|
@@ -32,10 +35,10 @@
|
|
|
<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.ImGroupNotice" useGeneratedKeys="true" keyColumn="id"
|
|
|
keyProperty="id">
|
|
|
INSERT INTO im_group_notice (im_group_id_,title_,content_,is_top_,is_sent_to_new_member_,
|
|
|
- del_flag_,create_time_,update_time_)
|
|
|
+ del_flag_,create_time_,update_time_,operator_id_)
|
|
|
VALUES(#{imGroupId},#{title},#{content},#{isTop, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
#{isSentToNewMember, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
- #{delFlag, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},now(),now())
|
|
|
+ #{delFlag, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},now(),now(),#{operatorId})
|
|
|
</insert>
|
|
|
|
|
|
<!-- 根据主键查询一条记录 -->
|
|
@@ -60,6 +63,9 @@
|
|
|
<if test="updateTime != null">
|
|
|
update_time_ = NOW()
|
|
|
</if>
|
|
|
+ <if test="operatorId != null">
|
|
|
+ operator_id_ = #{operatorId}
|
|
|
+ </if>
|
|
|
</set>
|
|
|
WHERE id_ = #{id}
|
|
|
</update>
|
|
@@ -71,15 +77,31 @@
|
|
|
|
|
|
<!-- 分页查询 -->
|
|
|
<select id="queryPage" resultMap="ImGroupNotice" parameterType="map">
|
|
|
- SELECT * FROM im_group_notice
|
|
|
- WHERE del_flag_ != 1
|
|
|
- ORDER BY update_time_ DESC
|
|
|
+ SELECT ign.*,su.real_name_,su.avatar_ FROM im_group_notice ign
|
|
|
+ LEFT JOIN sys_user su ON su.id_ = ign.operator_id_
|
|
|
+ <where>
|
|
|
+ ign.del_flag_ = 0
|
|
|
+ <if test="groupId != null">
|
|
|
+ AND ign.im_group_id_ = #{groupId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ ORDER BY ign.is_top_ DESC,ign.update_time_ DESC
|
|
|
<include refid="global.limit"/>
|
|
|
</select>
|
|
|
|
|
|
<!-- 查询当前表的总记录数 -->
|
|
|
<select id="queryCount" resultType="int">
|
|
|
SELECT COUNT(*) FROM im_group_notice
|
|
|
- WHERE del_flag_ != 1
|
|
|
+ <where>
|
|
|
+ del_flag_ = 0
|
|
|
+ <if test="groupId != null">
|
|
|
+ AND im_group_id_ = #{groupId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
</select>
|
|
|
+ <select id="getNewNotice" resultMap="ImGroupNotice">
|
|
|
+ SELECT * FROM im_group_notice ign
|
|
|
+ WHERE ign.im_group_id_ = #{groupId} AND ign.del_flag_ = 0
|
|
|
+ ORDER BY ign.is_top_ DESC,ign.update_time_ DESC LIMIT 1
|
|
|
+ </select>
|
|
|
</mapper>
|