干燥机配套车间生产管理系统/云平台服务端
baoshiwei
2023-03-10 58d42ccf875b120f40fddce63752298e916e0b0b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.system.mapper.SysAnnouncementMapper">
 
    <resultMap id="SysAnnouncement" type="org.jeecg.modules.system.entity.SysAnnouncement" >
        <result column="id" property="id" jdbcType="VARCHAR"/>
        <result column="titile" property="titile" jdbcType="VARCHAR"/>
        <result column="msg_content" property="msgContent" jdbcType="VARCHAR"/>
        <result column="start_time" property="startTime" jdbcType="TIMESTAMP"/>
        <result column="end_time" property="endTime" jdbcType="TIMESTAMP"/>
        <result column="sender" property="sender" jdbcType="VARCHAR"/>
        <result column="priority" property="priority" jdbcType="VARCHAR"/>
        <result column="msg_category" property="msgCategory" jdbcType="VARCHAR"/>
        <result column="msg_type" property="msgType" jdbcType="VARCHAR"/>
        <result column="send_status" property="sendStatus" jdbcType="VARCHAR"/>
        <result column="send_time" property="sendTime" jdbcType="VARCHAR"/>
        <result column="cancel_time" property="cancelTime" jdbcType="VARCHAR"/>
        <result column="del_flag" property="delFlag" jdbcType="VARCHAR"/>
        <result column="create_by" property="createBy" jdbcType="VARCHAR"/>
        <result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
        <result column="update_by" property="updateBy" jdbcType="VARCHAR"/>
        <result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
        <result column="user_ids" property="userIds" jdbcType="VARCHAR"/>
        <result column="bus_type" property="busType" jdbcType="VARCHAR"/>
        <result column="bus_id" property="busId" jdbcType="VARCHAR"/>
        <result column="open_type" property="openType" jdbcType="VARCHAR"/>
        <result column="open_page" property="openPage" jdbcType="VARCHAR"/>
 
        <result column="read_flag" property="readFlag" jdbcType="VARCHAR"/>
        <result column="star_flag" property="starFlag" jdbcType="VARCHAR"/>
        <result column="send_id" property="sendId" jdbcType="VARCHAR"/>
    </resultMap>
    
    
    <select id="querySysCementListByUserId" parameterType="String"  resultMap="SysAnnouncement">
       select * from sys_announcement 
       where send_status = '1' 
       and del_flag = '0' 
       and msg_category = #{msgCategory} 
       and id IN ( select annt_id from sys_announcement_send where user_id = #{userId} and read_flag = '0')
       order by create_time DESC
    </select>
 
 
    <!-- 查询消息记录 -->
    <select id="queryMessageList" resultMap="SysAnnouncement">
       select a.*, 
               b.read_flag, 
               b.star_flag,
               b.id as send_id
       from sys_announcement a
       join sys_announcement_send b on b.annt_id = a.id
       where a.send_status = '1' and a.del_flag = '0' and b.user_id = #{userId}
        <if test="fromUser!=null and fromUser!=''">
            and a.sender = #{fromUser}
        </if>
    
        <if test="beginDate!=null">
            and a.create_time &gt;= #{beginDate}
        </if>
        <if test="endDate!=null">
            and a.create_time &lt;= #{endDate}
        </if>
 
        <if test="starFlag!=null and starFlag!=''">
            and b.star_flag = #{starFlag}
        </if>
       order by b.read_flag ASC,a.create_time DESC
    </select>
    
</mapper>