|
@@ -18,6 +18,8 @@
|
|
|
<result column="create_on_" property="createOn"/>
|
|
|
<result column="modify_on_" property="modifyOn"/>
|
|
|
<result column="user_id_" property="userId"/>
|
|
|
+ <result column="message_config_id_" property="messageConfigId"/>
|
|
|
+ <result column="sub_type_" property="subType"/>
|
|
|
<result column="memo_" property="memo"/>
|
|
|
<result column="read_status_" property="readStatus"/>
|
|
|
<result column="group_" property="group"/>
|
|
@@ -81,9 +83,9 @@
|
|
|
|
|
|
<insert id="insert" parameterType="com.yonge.cooleshow.biz.dal.entity.SysMessage">
|
|
|
insert into sys_message (user_id_,title_, content_,type_, receiver_,
|
|
|
- send_time_, error_msg_,memo_, create_on_,modify_on_,group_,client_id_)
|
|
|
+ send_time_, error_msg_,memo_, create_on_,modify_on_,group_,client_id_,message_config_id_)
|
|
|
values (#{userId}, #{title},#{content},#{type},
|
|
|
- #{receiver},now(),#{errorMsg},#{memo},now(),now(),#{group},#{clientId})
|
|
|
+ #{receiver},now(),#{errorMsg},#{memo},now(),now(),#{group},#{clientId},#{messageConfigId})
|
|
|
</insert>
|
|
|
|
|
|
<insert id="batchInsert" parameterType="com.yonge.cooleshow.biz.dal.entity.SysMessage">
|
|
@@ -91,7 +93,7 @@
|
|
|
title_, content_,
|
|
|
type_, status_, receiver_,
|
|
|
send_time_, error_msg_,read_status_,memo_, create_on_,
|
|
|
- modify_on_,group_,client_id_)
|
|
|
+ modify_on_,group_,client_id_,message_config_id_)
|
|
|
values
|
|
|
<foreach collection="list" item="item" index="index"
|
|
|
separator=",">
|
|
@@ -102,7 +104,7 @@
|
|
|
#{item.status}, #{item.receiver,jdbcType=VARCHAR},
|
|
|
#{item.sendTime},#{item.errorMsg,jdbcType=VARCHAR},#{item.readStatus},#{item.memo},
|
|
|
#{item.createOn},
|
|
|
- #{item.modifyOn},#{item.group},#{item.clientId})
|
|
|
+ #{item.modifyOn},#{item.group},#{item.clientId},#{item.messageConfigId})
|
|
|
</foreach>
|
|
|
</insert>
|
|
|
|
|
@@ -148,6 +150,9 @@
|
|
|
<if test="group != null">
|
|
|
group_ = #{group},
|
|
|
</if>
|
|
|
+ <if test="messageConfigId != null">
|
|
|
+ message_config_id_ = #{messageConfigId},
|
|
|
+ </if>
|
|
|
</set>
|
|
|
where id_ = #{id,jdbcType=BIGINT}
|
|
|
</update>
|
|
@@ -168,7 +173,10 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="queryPage" parameterType="map" resultMap="message">
|
|
|
- select m.* from sys_message m
|
|
|
+ select m.*,
|
|
|
+ smc.sub_type_
|
|
|
+ from sys_message m
|
|
|
+ left join sys_message_config smc on m.message_config_id_ = smc.id_
|
|
|
<include refid="queryCondition" />
|
|
|
order by m.create_on_ desc
|
|
|
<include refid="global.limit" />
|
|
@@ -190,7 +198,7 @@
|
|
|
<select id="queryCountOfUnread" resultMap="Mapper" parameterType="map">
|
|
|
SELECT group_ key_,COUNT(*) value_ FROM sys_message
|
|
|
WHERE user_id_ = #{userId} AND read_status_ = 0 and status_ = 2
|
|
|
- AND (client_id_ = #{jpushType} OR client_id_ IS NULL) and send_time_ >= now()
|
|
|
+ AND (client_id_ = #{jpushType} OR client_id_ IS NULL) and send_time_ <= now()
|
|
|
<if test="type != null">
|
|
|
and type_ = #{type}
|
|
|
</if>
|