|
@@ -17,10 +17,65 @@
|
|
|
<result column="equipment_no" property="equipmentNo" />
|
|
|
<result column="indate" property="indate" />
|
|
|
</resultMap>
|
|
|
+ <resultMap id="BaseResultMapVO" type="com.hssx.cloudmodel.entity.vo.NewsNoticeVO">
|
|
|
+ <id column="id" property="id" />
|
|
|
+ <result column="project_id" property="projectId" />
|
|
|
+ <result column="project_name" property="projectName" />
|
|
|
+ <result column="mould_id" property="mouldId" />
|
|
|
+ <result column="notice_type" property="noticeType" />
|
|
|
+ <result column="content" property="content" />
|
|
|
+ <result column="mould_no" property="mouldNo" />
|
|
|
+ <result column="file_id" property="fileId" />
|
|
|
+ <result column="file_blong_type" property="fileBlongType" />
|
|
|
+ <result column="equipment_id" property="equipmentId" />
|
|
|
+ <result column="equipment_no" property="equipmentNo" />
|
|
|
+ <result column="indate" property="indate" />
|
|
|
+ <result column="user_id" property="userId" />
|
|
|
+ <result column="is_read" property="isRead" />
|
|
|
+ </resultMap>
|
|
|
|
|
|
<!-- 通用查询结果列 -->
|
|
|
<sql id="Base_Column_List">
|
|
|
id, project_id, project_name, mould_id, notice_type, content, mould_no, file_id, file_blong_type, equipment_id, equipment_no, indate
|
|
|
</sql>
|
|
|
-
|
|
|
+<!--未读的最新五条消息-->
|
|
|
+ <select id="selectNewestFiveUnreadNewsByUserId" resultMap="BaseResultMapVO">
|
|
|
+ select
|
|
|
+ tnn.id, tnn.project_id, tnn.project_name, tnn.mould_id, tnn.notice_type,
|
|
|
+ tnn.content, tnn.mould_no, tnn.file_id, tnn.file_blong_type,
|
|
|
+ tnn.equipment_id, tnn.equipment_no, tnn.indate,tnnu.user_id,tnnu.is_read
|
|
|
+ from
|
|
|
+ tb_news_notice tnn
|
|
|
+ left join
|
|
|
+ tb_news_notice_user tnnu
|
|
|
+ on
|
|
|
+ tnn.id = tnnu.news_id
|
|
|
+ where
|
|
|
+ tnnu.user_id = #{user.id}
|
|
|
+ and
|
|
|
+ tnnu.is_read = 0
|
|
|
+ limit
|
|
|
+ 0,5
|
|
|
+ </select>
|
|
|
+ <!--未读的全部消息-->
|
|
|
+ <select id="selectAllUnreadNewsByUserId" resultMap="BaseResultMapVO">
|
|
|
+ select
|
|
|
+ tnn.id, tnn.project_id, tnn.project_name, tnn.mould_id, tnn.notice_type,
|
|
|
+ tnn.content, tnn.mould_no, tnn.file_id, tnn.file_blong_type,
|
|
|
+ tnn.equipment_id, tnn.equipment_no, tnn.indate,tnnu.user_id,tnnu.is_read
|
|
|
+ from
|
|
|
+ tb_news_notice tnn
|
|
|
+ left join
|
|
|
+ tb_news_notice_user tnnu
|
|
|
+ on
|
|
|
+ tnn.id = tnnu.news_id
|
|
|
+ <where>
|
|
|
+ tnnu.user_id = #{user.id}
|
|
|
+ and
|
|
|
+ tnnu.is_read = 0
|
|
|
+ <if test="newsNotice.noticeType != null">
|
|
|
+ and tnn.notice_type = #{newsNotice.noticeType}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
</mapper>
|