|
@@ -5,7 +5,7 @@
|
|
|
<!--
|
|
<!--
|
|
|
WARNING - @mbg.generated
|
|
WARNING - @mbg.generated
|
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Thu Dec 14 21:04:23 CST 2017.
|
|
|
|
|
|
|
+ This element was generated on Wed Dec 20 08:38:46 CST 2017.
|
|
|
-->
|
|
-->
|
|
|
<id column="id" jdbcType="VARCHAR" property="id" />
|
|
<id column="id" jdbcType="VARCHAR" property="id" />
|
|
|
<result column="creater" jdbcType="VARCHAR" property="creater" />
|
|
<result column="creater" jdbcType="VARCHAR" property="creater" />
|
|
@@ -19,12 +19,13 @@
|
|
|
<result column="resource_id" jdbcType="VARCHAR" property="resourceId" />
|
|
<result column="resource_id" jdbcType="VARCHAR" property="resourceId" />
|
|
|
<result column="resource_type" jdbcType="INTEGER" property="resourceType" />
|
|
<result column="resource_type" jdbcType="INTEGER" property="resourceType" />
|
|
|
<result column="delete_sign" jdbcType="BIT" property="deleteSign" />
|
|
<result column="delete_sign" jdbcType="BIT" property="deleteSign" />
|
|
|
|
|
+ <result column="is_draft" jdbcType="INTEGER" property="isDraft" />
|
|
|
</resultMap>
|
|
</resultMap>
|
|
|
<sql id="Example_Where_Clause">
|
|
<sql id="Example_Where_Clause">
|
|
|
<!--
|
|
<!--
|
|
|
WARNING - @mbg.generated
|
|
WARNING - @mbg.generated
|
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Thu Dec 14 21:04:23 CST 2017.
|
|
|
|
|
|
|
+ This element was generated on Wed Dec 20 08:38:46 CST 2017.
|
|
|
-->
|
|
-->
|
|
|
<where>
|
|
<where>
|
|
|
<foreach collection="oredCriteria" item="criteria" separator="or">
|
|
<foreach collection="oredCriteria" item="criteria" separator="or">
|
|
@@ -58,7 +59,7 @@
|
|
|
<!--
|
|
<!--
|
|
|
WARNING - @mbg.generated
|
|
WARNING - @mbg.generated
|
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Thu Dec 14 21:04:23 CST 2017.
|
|
|
|
|
|
|
+ This element was generated on Wed Dec 20 08:38:46 CST 2017.
|
|
|
-->
|
|
-->
|
|
|
<where>
|
|
<where>
|
|
|
<foreach collection="example.oredCriteria" item="criteria" separator="or">
|
|
<foreach collection="example.oredCriteria" item="criteria" separator="or">
|
|
@@ -92,16 +93,16 @@
|
|
|
<!--
|
|
<!--
|
|
|
WARNING - @mbg.generated
|
|
WARNING - @mbg.generated
|
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Thu Dec 14 21:04:23 CST 2017.
|
|
|
|
|
|
|
+ This element was generated on Wed Dec 20 08:38:46 CST 2017.
|
|
|
-->
|
|
-->
|
|
|
id, creater, create_time, update_time, producer_id, consumer_type, title, body, subject,
|
|
id, creater, create_time, update_time, producer_id, consumer_type, title, body, subject,
|
|
|
- resource_id, resource_type, delete_sign
|
|
|
|
|
|
|
+ resource_id, resource_type, delete_sign, is_draft
|
|
|
</sql>
|
|
</sql>
|
|
|
<select id="selectByExample" parameterType="com.goafanti.common.model.MessageFromSystemExample" resultMap="BaseResultMap">
|
|
<select id="selectByExample" parameterType="com.goafanti.common.model.MessageFromSystemExample" resultMap="BaseResultMap">
|
|
|
<!--
|
|
<!--
|
|
|
WARNING - @mbg.generated
|
|
WARNING - @mbg.generated
|
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Thu Dec 14 21:04:23 CST 2017.
|
|
|
|
|
|
|
+ This element was generated on Wed Dec 20 08:38:46 CST 2017.
|
|
|
-->
|
|
-->
|
|
|
select
|
|
select
|
|
|
<if test="distinct">
|
|
<if test="distinct">
|
|
@@ -120,7 +121,7 @@
|
|
|
<!--
|
|
<!--
|
|
|
WARNING - @mbg.generated
|
|
WARNING - @mbg.generated
|
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Thu Dec 14 21:04:23 CST 2017.
|
|
|
|
|
|
|
+ This element was generated on Wed Dec 20 08:38:46 CST 2017.
|
|
|
-->
|
|
-->
|
|
|
select
|
|
select
|
|
|
<include refid="Base_Column_List" />
|
|
<include refid="Base_Column_List" />
|
|
@@ -131,7 +132,7 @@
|
|
|
<!--
|
|
<!--
|
|
|
WARNING - @mbg.generated
|
|
WARNING - @mbg.generated
|
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Thu Dec 14 21:04:23 CST 2017.
|
|
|
|
|
|
|
+ This element was generated on Wed Dec 20 08:38:46 CST 2017.
|
|
|
-->
|
|
-->
|
|
|
delete from message_from_system
|
|
delete from message_from_system
|
|
|
where id = #{id,jdbcType=VARCHAR}
|
|
where id = #{id,jdbcType=VARCHAR}
|
|
@@ -140,7 +141,7 @@
|
|
|
<!--
|
|
<!--
|
|
|
WARNING - @mbg.generated
|
|
WARNING - @mbg.generated
|
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Thu Dec 14 21:04:23 CST 2017.
|
|
|
|
|
|
|
+ This element was generated on Wed Dec 20 08:38:46 CST 2017.
|
|
|
-->
|
|
-->
|
|
|
delete from message_from_system
|
|
delete from message_from_system
|
|
|
<if test="_parameter != null">
|
|
<if test="_parameter != null">
|
|
@@ -151,24 +152,24 @@
|
|
|
<!--
|
|
<!--
|
|
|
WARNING - @mbg.generated
|
|
WARNING - @mbg.generated
|
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Thu Dec 14 21:04:23 CST 2017.
|
|
|
|
|
|
|
+ This element was generated on Wed Dec 20 08:38:46 CST 2017.
|
|
|
-->
|
|
-->
|
|
|
insert into message_from_system (id, creater, create_time,
|
|
insert into message_from_system (id, creater, create_time,
|
|
|
update_time, producer_id, consumer_type,
|
|
update_time, producer_id, consumer_type,
|
|
|
title, body, subject,
|
|
title, body, subject,
|
|
|
- resource_id, resource_type, delete_sign
|
|
|
|
|
- )
|
|
|
|
|
|
|
+ resource_id, resource_type, delete_sign,
|
|
|
|
|
+ is_draft)
|
|
|
values (#{id,jdbcType=VARCHAR}, #{creater,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
|
|
values (#{id,jdbcType=VARCHAR}, #{creater,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
|
|
|
#{updateTime,jdbcType=TIMESTAMP}, #{producerId,jdbcType=VARCHAR}, #{consumerType,jdbcType=INTEGER},
|
|
#{updateTime,jdbcType=TIMESTAMP}, #{producerId,jdbcType=VARCHAR}, #{consumerType,jdbcType=INTEGER},
|
|
|
#{title,jdbcType=VARCHAR}, #{body,jdbcType=VARCHAR}, #{subject,jdbcType=INTEGER},
|
|
#{title,jdbcType=VARCHAR}, #{body,jdbcType=VARCHAR}, #{subject,jdbcType=INTEGER},
|
|
|
- #{resourceId,jdbcType=VARCHAR}, #{resourceType,jdbcType=INTEGER}, #{deleteSign,jdbcType=BIT}
|
|
|
|
|
- )
|
|
|
|
|
|
|
+ #{resourceId,jdbcType=VARCHAR}, #{resourceType,jdbcType=INTEGER}, #{deleteSign,jdbcType=BIT},
|
|
|
|
|
+ #{isDraft,jdbcType=INTEGER})
|
|
|
</insert>
|
|
</insert>
|
|
|
<insert id="insertSelective" parameterType="com.goafanti.common.model.MessageFromSystem">
|
|
<insert id="insertSelective" parameterType="com.goafanti.common.model.MessageFromSystem">
|
|
|
<!--
|
|
<!--
|
|
|
WARNING - @mbg.generated
|
|
WARNING - @mbg.generated
|
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Thu Dec 14 21:04:23 CST 2017.
|
|
|
|
|
|
|
+ This element was generated on Wed Dec 20 08:38:46 CST 2017.
|
|
|
-->
|
|
-->
|
|
|
insert into message_from_system
|
|
insert into message_from_system
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
@@ -208,6 +209,9 @@
|
|
|
<if test="deleteSign != null">
|
|
<if test="deleteSign != null">
|
|
|
delete_sign,
|
|
delete_sign,
|
|
|
</if>
|
|
</if>
|
|
|
|
|
+ <if test="isDraft != null">
|
|
|
|
|
+ is_draft,
|
|
|
|
|
+ </if>
|
|
|
</trim>
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="id != null">
|
|
<if test="id != null">
|
|
@@ -246,13 +250,16 @@
|
|
|
<if test="deleteSign != null">
|
|
<if test="deleteSign != null">
|
|
|
#{deleteSign,jdbcType=BIT},
|
|
#{deleteSign,jdbcType=BIT},
|
|
|
</if>
|
|
</if>
|
|
|
|
|
+ <if test="isDraft != null">
|
|
|
|
|
+ #{isDraft,jdbcType=INTEGER},
|
|
|
|
|
+ </if>
|
|
|
</trim>
|
|
</trim>
|
|
|
</insert>
|
|
</insert>
|
|
|
<select id="countByExample" parameterType="com.goafanti.common.model.MessageFromSystemExample" resultType="java.lang.Long">
|
|
<select id="countByExample" parameterType="com.goafanti.common.model.MessageFromSystemExample" resultType="java.lang.Long">
|
|
|
<!--
|
|
<!--
|
|
|
WARNING - @mbg.generated
|
|
WARNING - @mbg.generated
|
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Thu Dec 14 21:04:23 CST 2017.
|
|
|
|
|
|
|
+ This element was generated on Wed Dec 20 08:38:46 CST 2017.
|
|
|
-->
|
|
-->
|
|
|
select count(*) from message_from_system
|
|
select count(*) from message_from_system
|
|
|
<if test="_parameter != null">
|
|
<if test="_parameter != null">
|
|
@@ -263,7 +270,7 @@
|
|
|
<!--
|
|
<!--
|
|
|
WARNING - @mbg.generated
|
|
WARNING - @mbg.generated
|
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Thu Dec 14 21:04:23 CST 2017.
|
|
|
|
|
|
|
+ This element was generated on Wed Dec 20 08:38:46 CST 2017.
|
|
|
-->
|
|
-->
|
|
|
update message_from_system
|
|
update message_from_system
|
|
|
<set>
|
|
<set>
|
|
@@ -303,6 +310,9 @@
|
|
|
<if test="record.deleteSign != null">
|
|
<if test="record.deleteSign != null">
|
|
|
delete_sign = #{record.deleteSign,jdbcType=BIT},
|
|
delete_sign = #{record.deleteSign,jdbcType=BIT},
|
|
|
</if>
|
|
</if>
|
|
|
|
|
+ <if test="record.isDraft != null">
|
|
|
|
|
+ is_draft = #{record.isDraft,jdbcType=INTEGER},
|
|
|
|
|
+ </if>
|
|
|
</set>
|
|
</set>
|
|
|
<if test="_parameter != null">
|
|
<if test="_parameter != null">
|
|
|
<include refid="Update_By_Example_Where_Clause" />
|
|
<include refid="Update_By_Example_Where_Clause" />
|
|
@@ -312,7 +322,7 @@
|
|
|
<!--
|
|
<!--
|
|
|
WARNING - @mbg.generated
|
|
WARNING - @mbg.generated
|
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Thu Dec 14 21:04:23 CST 2017.
|
|
|
|
|
|
|
+ This element was generated on Wed Dec 20 08:38:46 CST 2017.
|
|
|
-->
|
|
-->
|
|
|
update message_from_system
|
|
update message_from_system
|
|
|
set id = #{record.id,jdbcType=VARCHAR},
|
|
set id = #{record.id,jdbcType=VARCHAR},
|
|
@@ -326,7 +336,8 @@
|
|
|
subject = #{record.subject,jdbcType=INTEGER},
|
|
subject = #{record.subject,jdbcType=INTEGER},
|
|
|
resource_id = #{record.resourceId,jdbcType=VARCHAR},
|
|
resource_id = #{record.resourceId,jdbcType=VARCHAR},
|
|
|
resource_type = #{record.resourceType,jdbcType=INTEGER},
|
|
resource_type = #{record.resourceType,jdbcType=INTEGER},
|
|
|
- delete_sign = #{record.deleteSign,jdbcType=BIT}
|
|
|
|
|
|
|
+ delete_sign = #{record.deleteSign,jdbcType=BIT},
|
|
|
|
|
+ is_draft = #{record.isDraft,jdbcType=INTEGER}
|
|
|
<if test="_parameter != null">
|
|
<if test="_parameter != null">
|
|
|
<include refid="Update_By_Example_Where_Clause" />
|
|
<include refid="Update_By_Example_Where_Clause" />
|
|
|
</if>
|
|
</if>
|
|
@@ -335,7 +346,7 @@
|
|
|
<!--
|
|
<!--
|
|
|
WARNING - @mbg.generated
|
|
WARNING - @mbg.generated
|
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Thu Dec 14 21:04:23 CST 2017.
|
|
|
|
|
|
|
+ This element was generated on Wed Dec 20 08:38:46 CST 2017.
|
|
|
-->
|
|
-->
|
|
|
update message_from_system
|
|
update message_from_system
|
|
|
<set>
|
|
<set>
|
|
@@ -372,6 +383,9 @@
|
|
|
<if test="deleteSign != null">
|
|
<if test="deleteSign != null">
|
|
|
delete_sign = #{deleteSign,jdbcType=BIT},
|
|
delete_sign = #{deleteSign,jdbcType=BIT},
|
|
|
</if>
|
|
</if>
|
|
|
|
|
+ <if test="isDraft != null">
|
|
|
|
|
+ is_draft = #{isDraft,jdbcType=INTEGER},
|
|
|
|
|
+ </if>
|
|
|
</set>
|
|
</set>
|
|
|
where id = #{id,jdbcType=VARCHAR}
|
|
where id = #{id,jdbcType=VARCHAR}
|
|
|
</update>
|
|
</update>
|
|
@@ -379,7 +393,7 @@
|
|
|
<!--
|
|
<!--
|
|
|
WARNING - @mbg.generated
|
|
WARNING - @mbg.generated
|
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
- This element was generated on Thu Dec 14 21:04:23 CST 2017.
|
|
|
|
|
|
|
+ This element was generated on Wed Dec 20 08:38:46 CST 2017.
|
|
|
-->
|
|
-->
|
|
|
update message_from_system
|
|
update message_from_system
|
|
|
set creater = #{creater,jdbcType=VARCHAR},
|
|
set creater = #{creater,jdbcType=VARCHAR},
|
|
@@ -392,13 +406,14 @@
|
|
|
subject = #{subject,jdbcType=INTEGER},
|
|
subject = #{subject,jdbcType=INTEGER},
|
|
|
resource_id = #{resourceId,jdbcType=VARCHAR},
|
|
resource_id = #{resourceId,jdbcType=VARCHAR},
|
|
|
resource_type = #{resourceType,jdbcType=INTEGER},
|
|
resource_type = #{resourceType,jdbcType=INTEGER},
|
|
|
- delete_sign = #{deleteSign,jdbcType=BIT}
|
|
|
|
|
|
|
+ delete_sign = #{deleteSign,jdbcType=BIT},
|
|
|
|
|
+ is_draft = #{isDraft,jdbcType=INTEGER}
|
|
|
where id = #{id,jdbcType=VARCHAR}
|
|
where id = #{id,jdbcType=VARCHAR}
|
|
|
</update>
|
|
</update>
|
|
|
<insert id="insertBatchProducer" parameterType="com.goafanti.common.model.MessageProducer">
|
|
<insert id="insertBatchProducer" parameterType="com.goafanti.common.model.MessageProducer">
|
|
|
insert into message_producer (id,consumer_id,message_id)
|
|
insert into message_producer (id,consumer_id,message_id)
|
|
|
values
|
|
values
|
|
|
- <foreach item="item" index="index" collection="list" separator=",">
|
|
|
|
|
|
|
+ <foreach collection="list" index="index" item="item" separator=",">
|
|
|
(
|
|
(
|
|
|
#{item.id,jdbcType=VARCHAR},#{item.consumerId,jdbcType=VARCHAR},#{item.messageId,jdbcType=VARCHAR}
|
|
#{item.id,jdbcType=VARCHAR},#{item.consumerId,jdbcType=VARCHAR},#{item.messageId,jdbcType=VARCHAR}
|
|
|
)
|
|
)
|
|
@@ -407,7 +422,7 @@
|
|
|
<insert id="insertBatchConsumer" parameterType="com.goafanti.common.model.MessageConsumer">
|
|
<insert id="insertBatchConsumer" parameterType="com.goafanti.common.model.MessageConsumer">
|
|
|
insert into message_consumer (id,consumer_id,message_id)
|
|
insert into message_consumer (id,consumer_id,message_id)
|
|
|
values
|
|
values
|
|
|
- <foreach item="item" index="index" collection="list" separator=",">
|
|
|
|
|
|
|
+ <foreach collection="list" index="index" item="item" separator=",">
|
|
|
(
|
|
(
|
|
|
#{item.id,jdbcType=VARCHAR},#{item.consumerId,jdbcType=VARCHAR},#{item.messageId,jdbcType=VARCHAR}
|
|
#{item.id,jdbcType=VARCHAR},#{item.consumerId,jdbcType=VARCHAR},#{item.messageId,jdbcType=VARCHAR}
|
|
|
)
|
|
)
|
|
@@ -418,16 +433,21 @@
|
|
|
a.id,
|
|
a.id,
|
|
|
a.message_id as messageId,
|
|
a.message_id as messageId,
|
|
|
b.registration_id as registrationId
|
|
b.registration_id as registrationId
|
|
|
|
|
+ c.resource_id as resourceId
|
|
|
from
|
|
from
|
|
|
- message_producer a left join jpush_easemob_account b on
|
|
|
|
|
- a.consumer_id = b.uid
|
|
|
|
|
|
|
+ message_producer a
|
|
|
|
|
+ left join
|
|
|
|
|
+ jpush_easemob_account b on a.consumer_id = b.uid
|
|
|
|
|
+ left join
|
|
|
|
|
+ message_from_system c on a.message_id = c.id
|
|
|
where
|
|
where
|
|
|
- a.message_id is not null
|
|
|
|
|
- and a.send_time is null
|
|
|
|
|
- and a.consumer_id = #{uid,jdbcType=VARCHAR};
|
|
|
|
|
|
|
+ a.consumer_id = #{uid,jdbcType=VARCHAR}
|
|
|
|
|
+ and a.send_time is null <!-- 未发送 -->
|
|
|
|
|
+ and c.is_draft = 0 <!-- 非草稿 -->
|
|
|
|
|
+ and c.delete_sign = false <!-- 未删除 -->
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
- <update id="updateJpushEasemobAccount" parameterType="java.lang.String">
|
|
|
|
|
|
|
+ <update id="updateJpushEasemobAccount">
|
|
|
update jpush_easemob_account
|
|
update jpush_easemob_account
|
|
|
<set>
|
|
<set>
|
|
|
<if test="uuid != null and uuid != ''">
|
|
<if test="uuid != null and uuid != ''">
|
|
@@ -439,6 +459,9 @@
|
|
|
<if test="userName != null and userName != ''">
|
|
<if test="userName != null and userName != ''">
|
|
|
username = #{userName,jdbcType=VARCHAR}
|
|
username = #{userName,jdbcType=VARCHAR}
|
|
|
</if>
|
|
</if>
|
|
|
|
|
+ <if test="lastLoginTime != null">
|
|
|
|
|
+ last_login_time = #{lastLoginTime,jdbcType=TIMESTAMP}
|
|
|
|
|
+ </if>
|
|
|
where uid = #{uid,jdbcType=VARCHAR}
|
|
where uid = #{uid,jdbcType=VARCHAR}
|
|
|
</set>
|
|
</set>
|
|
|
</update>
|
|
</update>
|
|
@@ -457,4 +480,113 @@
|
|
|
<select id="selectRecommendTarget" parameterType="java.lang.String" resultType="com.goafanti.common.model.MessageFromSystem">
|
|
<select id="selectRecommendTarget" parameterType="java.lang.String" resultType="com.goafanti.common.model.MessageFromSystem">
|
|
|
#{sql,jdbcType=VARCHAR}
|
|
#{sql,jdbcType=VARCHAR}
|
|
|
</select>
|
|
</select>
|
|
|
|
|
+
|
|
|
|
|
+ <select id="listSystemMessage" resultMap="BaseResultMap">
|
|
|
|
|
+ select
|
|
|
|
|
+ a.id,
|
|
|
|
|
+ a.create_time,
|
|
|
|
|
+ a.creater,
|
|
|
|
|
+ a.consumer_type,
|
|
|
|
|
+ a.resource_type,
|
|
|
|
|
+ a.title,
|
|
|
|
|
+ a.body
|
|
|
|
|
+ from
|
|
|
|
|
+ message_from_system a
|
|
|
|
|
+ where
|
|
|
|
|
+ a.subject = #{subject,jdbcType=INTEGER}
|
|
|
|
|
+ and a.is_draft = #{isDraft,jdbcType=INTEGER}
|
|
|
|
|
+ and a.delete_sign = false
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
|
|
+ <select id="selectMessageWithGroup" resultType="com.goafanti.app.bo.IndexBo">
|
|
|
|
|
+ select
|
|
|
|
|
+ x.*,y.*
|
|
|
|
|
+ from
|
|
|
|
|
+ (
|
|
|
|
|
+ select
|
|
|
|
|
+ t1.sysMessageTitle,
|
|
|
|
|
+ t2.sysMessageUnRead
|
|
|
|
|
+ from
|
|
|
|
|
+ (
|
|
|
|
|
+ select
|
|
|
|
|
+ title as sysMessageTitle,
|
|
|
|
|
+ 1 as nouse
|
|
|
|
|
+ from
|
|
|
|
|
+ message_consumer a left join message_from_system b on
|
|
|
|
|
+ a.message_id = b.id
|
|
|
|
|
+ where
|
|
|
|
|
+ consumer_id = #{uid,jdbcType=VARCHAR}
|
|
|
|
|
+ and a.read_time is not null
|
|
|
|
|
+ <!-- and a.delete_sign = false -->
|
|
|
|
|
+ and b.subject = 1
|
|
|
|
|
+ order by
|
|
|
|
|
+ a.create_time desc limit 1
|
|
|
|
|
+ ) t1 right join(
|
|
|
|
|
+ select
|
|
|
|
|
+ count(*) as sysMessageUnRead,
|
|
|
|
|
+ 1 as nouse
|
|
|
|
|
+ from
|
|
|
|
|
+ message_consumer a left join message_from_system b on
|
|
|
|
|
+ a.message_id = b.id
|
|
|
|
|
+ where
|
|
|
|
|
+ consumer_id = #{uid,jdbcType=VARCHAR}
|
|
|
|
|
+ and a.read_time is not null
|
|
|
|
|
+ <!-- and a.delete_sign = false -->
|
|
|
|
|
+ and b.subject = 1
|
|
|
|
|
+ ) t2 on
|
|
|
|
|
+ t1.nouse = t2.nouse
|
|
|
|
|
+ ) x,
|
|
|
|
|
+ (
|
|
|
|
|
+ select
|
|
|
|
|
+ t3.recMessageTitle,
|
|
|
|
|
+ t4.recMessageUnRead
|
|
|
|
|
+ from
|
|
|
|
|
+ (
|
|
|
|
|
+ select
|
|
|
|
|
+ title as recMessageTitle,
|
|
|
|
|
+ 1 as nouse
|
|
|
|
|
+ from
|
|
|
|
|
+ message_consumer a left join message_from_system b on
|
|
|
|
|
+ a.message_id = b.id
|
|
|
|
|
+ where
|
|
|
|
|
+ consumer_id = #{uid,jdbcType=VARCHAR}
|
|
|
|
|
+ and a.read_time is not null
|
|
|
|
|
+ <!-- and a.delete_sign = false -->
|
|
|
|
|
+ and b.subject = 2
|
|
|
|
|
+ order by
|
|
|
|
|
+ a.create_time desc limit 1
|
|
|
|
|
+ ) t3 right join(
|
|
|
|
|
+ select
|
|
|
|
|
+ count(*) as recMessageUnRead,
|
|
|
|
|
+ 1 as nouse
|
|
|
|
|
+ from
|
|
|
|
|
+ message_consumer a left join message_from_system b on
|
|
|
|
|
+ a.message_id = b.id
|
|
|
|
|
+ where
|
|
|
|
|
+ consumer_id = #{uid,jdbcType=VARCHAR}
|
|
|
|
|
+ and a.read_time is not null
|
|
|
|
|
+ <!-- and a.delete_sign = false -->
|
|
|
|
|
+ and b.subject = 2
|
|
|
|
|
+ ) t4 on
|
|
|
|
|
+ t3.nouse = t4.nouse
|
|
|
|
|
+ ) y
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
|
|
+ <select id="listPersonalMessage" resultMap="BaseResultMap">
|
|
|
|
|
+ select
|
|
|
|
|
+ b.title,b.create_time,b.subject
|
|
|
|
|
+ from
|
|
|
|
|
+ message_consumer a left join message_from_system b on
|
|
|
|
|
+ a.message_id = b.id
|
|
|
|
|
+ where
|
|
|
|
|
+ a.consumer_id = #{uid,jdbcType=VARCHAR}
|
|
|
|
|
+ and a.delete_sign = false
|
|
|
|
|
+ <if test="subject != null">
|
|
|
|
|
+ and b.subject = #{subject,jdbcType=INTEGER}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="resourceType != null">
|
|
|
|
|
+ and b.resource_type = #{resourceType,jdbcType=INTEGER}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
</mapper>
|
|
</mapper>
|