zhongrj
2023-06-03 b112d242575fe96123b1e8dad434f46e6d2bb3d1
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
<?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="cn.gistack.sm.materials.mapper.RescueTeamManageMapper">
    <!--namespace根据自己需要创建的的mapper的路径和名称填写-->
    <select id="selectMyPage" resultType="cn.gistack.sm.materials.vo.RescueTeamManageVO">
        SELECT RM.*,
        aab1."ad_name" cityName,
        aab2."ad_name" countyName,
        aab3."ad_name" townName
        FROM SM_RESCUETEAM_MANAGE RM
        LEFT JOIN SJZT_MD."att_ad_base" aab1 ON aab1."guid" = RM.city
        LEFT JOIN SJZT_MD."att_ad_base" aab2 ON aab2."guid" = RM.county
        LEFT JOIN SJZT_MD."att_ad_base" aab3 ON aab3."guid" = RM.town
        WHERE RM.IS_DELETED = 0
        <if test="vo.resName !=null and vo.resName !=''">
            AND RM.RES_NAME LIKE CONCAT('%',#{vo.resName},'%')
        </if>
        <if test="vo.userName !=null and vo.userName !=''">
            AND RM.USER_NAME LIKE CONCAT('%',#{vo.userName},'%')
        </if>
        <if test="vo.userPhone !=null and vo.userPhone !=''">
            AND RM.USER_PHONE LIKE CONCAT('%',#{vo.userPhone},'%')
        </if>
        <if test="vo.city !=null and vo.city !=''">
            AND RM.city = #{vo.city}
        </if>
        <if test="vo.county !=null and vo.county !=''">
            AND RM.county = #{vo.county}
        </if>
        <if test="vo.town !=null and vo.town !=''">
            AND RM.town = #{vo.town}
        </if>
    </select>
</mapper>