智慧保安后台管理-外网
Administrator
2022-06-16 8b375fe00a241b3a769b82fe3dac8d1c9dce8a02
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
<?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.coinspect.mapper.CoinspectMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="coinspectResultMap" type="org.springblade.modules.coinspect.vo.CoinspectVO">
        <id column="id" property="id"/>
        <result column="examiner_id" property="examinerId"/>
        <result column="reviewed_dept_id" property="reviewedDeptId"/>
        <result column="examiner_dept_id" property="examinerDeptId"/>
        <result column="reviewTime" property="reviewtime"/>
        <result column="insid" property="insid"/>
        <result column="results" property="results"/>
        <result column="url" property="url"/>
    </resultMap>
 
 
    <select id="selectCoinspectPage" resultType="org.springblade.modules.coinspect.vo.CoinspectVO">
        select
            sc.*,
            bu.real_name realName,
            bd.dept_name examinerDeptName,
            bd1.dept_name reviewedDeptName
        from
            sys_coinspect sc
        left join
            blade_user bu
        on
            bu.id = sc.examiner_id
        left join
            blade_dept bd
        on
            bd.id = sc.examiner_dept_id
        left join
            blade_dept bd1
        on
            bd1.id = sc.reviewed_dept_id
        where 1 = 1
        <if test="coinspect.realName!=null and coinspect.realName!=''">
            and bu.real_name like concat('%',#{coinspect.realName},'%')
        </if>
        <if test="coinspect.examinerDeptName!=null and coinspect.examinerDeptName!=''">
            and bd.dept_name like concat('%',#{coinspect.examinerDeptName},'%')
        </if>
        <if test="coinspect.reviewedDeptName!=null and coinspect.reviewedDeptName!=''">
            and bd1.dept_name like concat('%',#{coinspect.reviewedDeptName},'%')
        </if>
        <if test="coinspect.results!=null and coinspect.results!=''">
            and sc.results like concat('%',#{coinspect.results},'%')
        </if>
    </select>
 
</mapper>