liyong
2026-05-09 98d23d2bff330b6d1b30dde59f4e828ad255b2bb
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
<?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="com.ruoyi.approve.mapper.LogReportMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.ruoyi.approve.pojo.LogReport">
        <id column="id" property="id" />
        <result column="title" property="title" />
        <result column="report_type" property="reportType" />
        <result column="log_type" property="logType" />
        <result column="content" property="content" />
        <result column="push_status" property="pushStatus" />
        <result column="create_user" property="createUser" />
        <result column="create_time" property="createTime" />
        <result column="dept_id" property="deptId" />
    </resultMap>
    <select id="listPage" resultType="com.ruoyi.approve.bean.dto.LogReportDto">
        select
        slr.*,
        su.nick_name as create_user_name
        from
        log_report slr
        left join sys_user su on slr.create_user = su.user_id
        <where>
            <if test="ew.title != null and ew.title != ''">
                and slr.title like concat('%', #{ew.title}, '%')
            </if>
            <if test="ew.logType != null and ew.logType != ''">
                and slr.log_type = #{ew.logType}
            </if>
            <if test="ew.reportType != null and ew.reportType != ''">
                and slr.report_type = #{ew.reportType}
            </if>
            <if test="ew.pushStatus != null and ew.pushStatus != ''">
                and slr.push_status = #{ew.pushStatus}
            </if>
            <if test="ew.createUser != null and ew.createUser != ''">
                and slr.create_user = #{ew.createUser}
            </if>
            <if test="ew.startTime != null and ew.endTime !=''">
                and slr.create_time between #{ew.startTime} and #{ew.endTime}
            </if>
 
            <if test="ew.ccUserIds != null">
                and (
                slr.create_user = #{userId}
                or (
                slr.cc_users is not null
                and slr.cc_users != ''
                and find_in_set(#{userId}, slr.cc_users)
                )
                )
            </if>
        </where>
        order by slr.create_time desc
    </select>
 
</mapper>