|
@@ -21,6 +21,7 @@
|
|
<result column="memo_" property="memo"/>
|
|
<result column="memo_" property="memo"/>
|
|
<result column="read_status_" property="readStatus"/>
|
|
<result column="read_status_" property="readStatus"/>
|
|
<result column="group_" property="group"/>
|
|
<result column="group_" property="group"/>
|
|
|
|
+ <result column="jpush_type_" property="jpushType"/>
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
<resultMap type="com.ym.mec.biz.dal.dto.Mapper" id="Mapper">
|
|
<resultMap type="com.ym.mec.biz.dal.dto.Mapper" id="Mapper">
|
|
@@ -30,6 +31,9 @@
|
|
|
|
|
|
<sql id="queryCondition">
|
|
<sql id="queryCondition">
|
|
<where>
|
|
<where>
|
|
|
|
+ <if test="jpushType != null and jpushType != ''">
|
|
|
|
+ and (jpush_type_ = #{jpushType} OR jpush_type_ IS NULL)
|
|
|
|
+ </if>
|
|
<if test="userId != null">
|
|
<if test="userId != null">
|
|
and user_id_ = #{userId}
|
|
and user_id_ = #{userId}
|
|
</if>
|
|
</if>
|
|
@@ -72,8 +76,9 @@
|
|
|
|
|
|
<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.SysMessage">
|
|
<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.SysMessage">
|
|
insert into sys_message (user_id_,title_, content_,type_, receiver_,
|
|
insert into sys_message (user_id_,title_, content_,type_, receiver_,
|
|
- send_time_, error_msg_,memo_, create_on_,modify_on_,group_)
|
|
|
|
- values (#{userId}, #{title},#{content},#{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}, #{receiver},now(),#{errorMsg},#{memo},now(),now(),#{group})
|
|
|
|
|
|
+ send_time_, error_msg_,memo_, create_on_,modify_on_,group_,jpush_type_)
|
|
|
|
+ values (#{userId}, #{title},#{content},#{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
|
+ #{receiver},now(),#{errorMsg},#{memo},now(),now(),#{group},#{jpushType})
|
|
</insert>
|
|
</insert>
|
|
|
|
|
|
<insert id="batchInsert" parameterType="com.ym.mec.biz.dal.entity.SysMessage">
|
|
<insert id="batchInsert" parameterType="com.ym.mec.biz.dal.entity.SysMessage">
|
|
@@ -81,7 +86,7 @@
|
|
title_, content_,
|
|
title_, content_,
|
|
type_, status_, receiver_,
|
|
type_, status_, receiver_,
|
|
send_time_, error_msg_,read_status_,memo_, create_on_,
|
|
send_time_, error_msg_,read_status_,memo_, create_on_,
|
|
- modify_on_,group_)
|
|
|
|
|
|
+ modify_on_,group_,jpush_type_)
|
|
values
|
|
values
|
|
<foreach collection="list" item="item" index="index"
|
|
<foreach collection="list" item="item" index="index"
|
|
separator=",">
|
|
separator=",">
|
|
@@ -92,7 +97,7 @@
|
|
#{item.status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}, #{item.receiver,jdbcType=VARCHAR},
|
|
#{item.status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}, #{item.receiver,jdbcType=VARCHAR},
|
|
#{item.sendTime},#{item.errorMsg,jdbcType=VARCHAR},#{item.readStatus},#{item.memo},
|
|
#{item.sendTime},#{item.errorMsg,jdbcType=VARCHAR},#{item.readStatus},#{item.memo},
|
|
#{item.createOn},
|
|
#{item.createOn},
|
|
- #{item.modifyOn},#{item.group}
|
|
|
|
|
|
+ #{item.modifyOn},#{item.group},#{item.jpushType}
|
|
)
|
|
)
|
|
</foreach>
|
|
</foreach>
|
|
</insert>
|
|
</insert>
|
|
@@ -144,7 +149,7 @@
|
|
</update>
|
|
</update>
|
|
<update id="updateStatus">
|
|
<update id="updateStatus">
|
|
update sys_message set read_status_=#{status}
|
|
update sys_message set read_status_=#{status}
|
|
- where user_id_ =#{userId}
|
|
|
|
|
|
+ where user_id_ = #{userId} AND (jpush_type_ = #{jpushType} OR jpush_type_ IS NULL)
|
|
</update>
|
|
</update>
|
|
|
|
|
|
<update id="updateOneStatus">
|
|
<update id="updateOneStatus">
|
|
@@ -172,7 +177,9 @@
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="queryCountOfUnread" resultMap="Mapper" parameterType="map">
|
|
<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
|
|
|
|
|
|
+ SELECT group_ key_,COUNT(*) value_ FROM sys_message
|
|
|
|
+ WHERE user_id_ = #{userId} AND read_status_ = 0 and status_ = 2
|
|
|
|
+ AND (jpush_type_ = #{jpushType} OR jpush_type_ IS NULL)
|
|
<if test="type != null">
|
|
<if test="type != null">
|
|
and type_ = #{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
|
|
and type_ = #{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
|
|
</if>
|
|
</if>
|