zhongrj
2024-04-03 b42bdf8eb9baa28c6d2e363ffaebadfc62d2025a
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
<?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.grid.mapper.GridPatrolRecordMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="gridPatrolRecordResultMap" type="org.springblade.modules.grid.entity.GridPatrolRecordEntity">
        <result property="id"    column="id"    />
        <result property="name"    column="name"    />
        <result property="context"    column="context"    />
        <result property="url"    column="url"    />
        <result property="patrolTime"    column="patrol_time"    />
        <result property="createTime"    column="create_time"    />
        <result property="createUser"    column="create_user"    />
        <result property="isDeleted"    column="is_deleted"    />
        <result property="latitude"    column="latitude"    />
        <result property="longitude"    column="longitude"    />
        <result property="location"    column="location"    />
    </resultMap>
 
    <!--自定义分页查询-->
    <select id="selectGridPatrolRecordPage" resultType="org.springblade.modules.grid.vo.GridPatrolRecordVO">
        select jgpr.* from jczz_grid_patrol_record jgpr
        LEFT JOIN blade_user bu on bu.id = jgpr.create_user and bu.is_deleted = 0
        LEFT JOIN blade_dept bd on bd.id = bu.dept_id and bd.is_deleted = 0
        where jgpr.is_deleted = 0
        <if test="gridPatrolRecord.name!=null and gridPatrolRecord.name!=''">
            and jgpr.name like concat('%',#{gridPatrolRecord.name},'%')
        </if>
        <if test="gridPatrolRecord.context!=null and gridPatrolRecord.context!=''">
            and jgpr.context like concat('%',#{gridPatrolRecord.context},'%')
        </if>
        <if test="gridPatrolRecord.createUser!=null">
            and jgpr.create_user = #{gridPatrolRecord.createUser}
        </if>
    </select>
 
 
</mapper>