智慧保安后台管理项目备份
zhongrj
2024-05-24 b5960d1968e007b91d4d33dd7cbb74f1b566f2c1
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<?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.springblade.modules.seinspect.mapper.SeinspectMapper">
 
    <!-- 通用查询映射结果 -->
<!--    <resultMap id="seinspectResultMap" type="org.springblade.modules.seinspect.entity.Seinspect">-->
<!--        <id column="id" property="id"/>-->
<!--        <result column="realName" property="realname"/>-->
<!--        <result column="carid" property="carid"/>-->
<!--        <result column="sName" property="sname"/>-->
<!--        <result column="inspectman" property="inspectman"/>-->
<!--        <result column="deptName" property="deptname"/>-->
<!--        <result column="reviewTime" property="reviewtime"/>-->
<!--        <result column="insid" property="insid"/>-->
<!--        <result column="examination_type" property="examinationType"/>-->
<!--        <result column="jid" property="jid"/>-->
<!--        <result column="deptid" property="deptid"/>-->
<!--        <result column="jurisdiction" property="jurisdiction"/>-->
<!--        <result column="url" property="url"/>-->
<!--    </resultMap>-->
 
 
    <select id="selectSeinspectPage" resultType="org.springblade.modules.seinspect.vo.SeinspectVO">
        select
        ss.*,
        bu.real_name realName,
        bd.dept_name examinerDeptName,
        bu1.real_name securityName
        from
        sys_seinspect ss
        left join
        blade_user bu
        on
        bu.id = ss.examiner_id
        left join
        blade_dept bd
        on
        bd.id = ss.examiner_dept_id
        left join
        blade_user bu1
        on
        bu1.id = ss.security_id
        where 1 = 1
        <if test="seinspect.realName!=null and seinspect.realName!=''">
            and bu.real_name like concat('%',#{seinspect.realName},'%')
        </if>
        <if test="seinspect.examinerDeptName!=null and seinspect.examinerDeptName!=''">
            and bd.dept_name like concat('%',#{seinspect.examinerDeptName},'%')
        </if>
        <if test="seinspect.securityName!=null and seinspect.securityName!=''">
            and bu1.real_name like concat('%',#{seinspect.securityName},'%')
        </if>
        <if test="seinspect.result!=null and seinspect.result!=''">
            and ss.result like concat('%',#{seinspect.result},'%')
        </if>
        <if test="seinspect.startTime!=null and seinspect.startTime!=''">
            and ss.reviewTime &gt;= #{seinspect.startTime}
        </if>
        <if test="seinspect.endTime!=null and seinspect.endTime!=''">
            and ss.reviewTime &lt;= #{seinspect.endTime}
        </if>
    </select>
 
 
    <select id="exportSeinspect" resultType="org.springblade.modules.seinspect.excel.SeinspectExcel">
        select
        bu1.real_name securityName,
        bu.real_name realName,
        bd.dept_name examinerDeptName,
        ss.reviewTime reviewtime,
        ss.content,
        ss.result
        from
        sys_seinspect ss
        left join
        blade_user bu
        on
        bu.id = ss.examiner_id
        left join
        blade_dept bd
        on
        bd.id = ss.examiner_dept_id
        left join
        blade_user bu1
        on
        bu1.id = ss.security_id
        left join
        sys_jurisdiction sj
        on
        sj.id = ss.jurisdiction
        where 1 = 1
        <if test="seinspect.jurisdiction!=null and seinspect.jurisdiction!='' and seinspect.jurisdiction!='1372091709474910209'">
            and (sj.id = #{seinspect.jurisdiction} or sj.parent_id = #{seinspect.jurisdiction})
        </if>
        <if test="seinspect.realName!=null and seinspect.realName!=''">
            and bu.real_name like concat('%',#{seinspect.realName},'%')
        </if>
        <if test="seinspect.examinerDeptName!=null and seinspect.examinerDeptName!=''">
            and bd.dept_name like concat('%',#{seinspect.examinerDeptName},'%')
        </if>
        <if test="seinspect.securityName!=null and seinspect.securityName!=''">
            and bu1.real_name like concat('%',#{seinspect.securityName},'%')
        </if>
        <if test="seinspect.result!=null and seinspect.result!=''">
            and ss.result like concat('%',#{seinspect.result},'%')
        </if>
        <if test="seinspect.startTime!=null and seinspect.startTime!=''">
            and ss.reviewTime &gt;= #{seinspect.startTime}
        </if>
        <if test="seinspect.endTime!=null and seinspect.endTime!=''">
            and ss.reviewTime &lt;= #{seinspect.endTime}
        </if>
        <if test="seinspect.reviewtime!=null and seinspect.reviewtime!=''">
            and ss.reviewTime &lt;= #{seinspect.reviewtime}
        </if>
 
    </select>
 
 
 
</mapper>