|
@@ -11,10 +11,12 @@
|
|
<result column="im_group_id_" property="imGroupId"/>
|
|
<result column="im_group_id_" property="imGroupId"/>
|
|
<result column="title_" property="title"/>
|
|
<result column="title_" property="title"/>
|
|
<result column="content_" property="content"/>
|
|
<result column="content_" property="content"/>
|
|
- <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="real_name_" property="realName"/>
|
|
|
|
+ <result column="avatar_" property="avatar"/>
|
|
|
|
+ <result column="is_top_" property="isTop"/>
|
|
|
|
+ <result column="del_flag_" property="delFlag"/>
|
|
<result column="create_time_" property="createTime"/>
|
|
<result column="create_time_" property="createTime"/>
|
|
|
|
+ <result column="operator_id_" property="operatorId"/>
|
|
<result column="update_time_" property="updateTime"/>
|
|
<result column="update_time_" property="updateTime"/>
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
@@ -31,11 +33,10 @@
|
|
<!-- 向数据库增加一条记录 -->
|
|
<!-- 向数据库增加一条记录 -->
|
|
<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.ImGroupNotice" useGeneratedKeys="true" keyColumn="id"
|
|
<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.ImGroupNotice" useGeneratedKeys="true" keyColumn="id"
|
|
keyProperty="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_)
|
|
|
|
- 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())
|
|
|
|
|
|
+ INSERT INTO im_group_notice (im_group_id_,title_,content_,is_top_,
|
|
|
|
+ del_flag_,create_time_,update_time_,operator_id_)
|
|
|
|
+ VALUES(#{imGroupId},#{title},#{content},#{isTop},
|
|
|
|
+ #{delFlag},now(),now(),#{operatorId})
|
|
</insert>
|
|
</insert>
|
|
|
|
|
|
<!-- 根据主键查询一条记录 -->
|
|
<!-- 根据主键查询一条记录 -->
|
|
@@ -43,7 +44,7 @@
|
|
UPDATE im_group_notice
|
|
UPDATE im_group_notice
|
|
<set>
|
|
<set>
|
|
<if test="delFlag != null">
|
|
<if test="delFlag != null">
|
|
- del_flag_ = #{delFlag, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
|
|
|
+ del_flag_ = #{delFlag},
|
|
</if>
|
|
</if>
|
|
<if test="title != null">
|
|
<if test="title != null">
|
|
title_ = #{title},
|
|
title_ = #{title},
|
|
@@ -52,14 +53,14 @@
|
|
content_ = content,
|
|
content_ = content,
|
|
</if>
|
|
</if>
|
|
<if test="isTop != null">
|
|
<if test="isTop != null">
|
|
- is_top_ = #{isTop, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
|
- </if>
|
|
|
|
- <if test="isSentToNewMember != null">
|
|
|
|
- is_sent_to_new_member_ = #{isSentToNewMember, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
|
|
|
+ is_top_ = #{isTop},
|
|
</if>
|
|
</if>
|
|
<if test="updateTime != null">
|
|
<if test="updateTime != null">
|
|
update_time_ = NOW()
|
|
update_time_ = NOW()
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="operatorId != null">
|
|
|
|
+ operator_id_ = #{operatorId}
|
|
|
|
+ </if>
|
|
</set>
|
|
</set>
|
|
WHERE id_ = #{id}
|
|
WHERE id_ = #{id}
|
|
</update>
|
|
</update>
|
|
@@ -71,15 +72,31 @@
|
|
|
|
|
|
<!-- 分页查询 -->
|
|
<!-- 分页查询 -->
|
|
<select id="queryPage" resultMap="ImGroupNotice" parameterType="map">
|
|
<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"/>
|
|
<include refid="global.limit"/>
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<!-- 查询当前表的总记录数 -->
|
|
<!-- 查询当前表的总记录数 -->
|
|
<select id="queryCount" resultType="int">
|
|
<select id="queryCount" resultType="int">
|
|
SELECT COUNT(*) FROM im_group_notice
|
|
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>
|
|
|
|
+ <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>
|
|
</mapper>
|