xuhy
1 天以前 4e0b0be90a8bf14a59f4cfee7959534adea24ba3
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
<?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.system.mapper.TLocationMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.ruoyi.system.model.TLocation">
        <id column="id" property="id" />
        <result column="create_time" property="createTime" />
        <result column="update_time" property="updateTime" />
        <result column="create_by" property="createBy" />
        <result column="update_by" property="updateBy" />
        <result column="disabled" property="disabled" />
        <result column="location_code" property="locationCode" />
        <result column="location_name" property="locationName" />
        <result column="project_id" property="projectId" />
        <result column="location_leader" property="locationLeader" />
        <result column="location_cleaner" property="locationCleaner" />
        <result column="location_type" property="locationType" />
        <result column="location_address" property="locationAddress" />
        <result column="location_lon" property="locationLon" />
        <result column="location_lat" property="locationLat" />
    </resultMap>
 
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, create_time, update_time, create_by, update_by, disabled, location_code, location_name, project_id, location_leader, location_cleaner, location_type, location_address, location_lon, location_lat
    </sql>
    <select id="pageList" resultType="com.ruoyi.system.vo.system.LocationListVO">
        select t1.*,t2.location_name as locationTypeName,t3.cleaner_name as cleanerName from t_location t1
        left join  t_location_type t2 on t1.location_type = t2.id
        left join  t_cleaner t3 on t1.location_cleaner = t3.id
        where 1=1
        <if test="query.locationName != null and query.locationName != ''">
            and t1.location_name like concat('%', #{query.locationName}, '%')
        </if>
        <if test="query.locationCode != null and query.locationCode != ''">
            and t1.location_code like concat('%', #{query.locationCode}, '%')
        </if>
        <if test="query.locationType != null and query.locationType != ''">
            and t1.location_type = #{query.locationType}
        </if>
        <if test="query.projectId != null and query.projectId != ''">
            and t1.project_id = #{query.projectId}
        </if>
        <if test="query.locationCleaner != null and query.locationCleaner != ''">
            and t1.location_cleaner = #{query.locationCleaner}
        </if>
        and t1.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
        order by t1.create_time desc
    </select>
 
</mapper>