huliguo
2 天以前 5d7b65670282a4fad015e37d567cfa171b162052
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
<?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.errand.mapper.CommunityMapper">
 
    <resultMap id="communityListVO" type="com.ruoyi.errand.object.vo.app.CommunityListVO">
        <id column="id" property="id"/>
        <result column="name" property="name"/>
    </resultMap>
 
    <select id="selectListByRegionId"  resultMap="communityListVO">
        select id ,name
        from t_community where region_id = #{regionId}
        and del_flag=0
        and status = 0
    </select>
    <select id="getTotalCommunityList" resultType="com.ruoyi.errand.object.vo.app.CommunityListVO">
        select id ,name
        from t_community where del_flag=0
    </select>
    <select id="getAllCommunityList" resultType="com.ruoyi.errand.object.vo.sys.AllCommunityListVO">
        select
            id as communityId,
            name as name
        from
        t_community
        where
            del_flag=0
        and
        id not in
        <foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
            #{item}
        </foreach>
    </select>
    <select id="getCommunityPageList" resultType="com.ruoyi.errand.object.vo.sys.CommunityPageListVO">
        select
            tc.id,
            tc.name as name,
            tr.name as regionName,
            tc.admin_name as adminName,
            tc.admin_phone as adminPhone,
            tco.name as courierName,
            tc.status as status
            from    t_community tc
        left join  t_region tr on tc.region_id = tr.id
        left join t_community_courier tcc on tc.id = tcc.community_id
        left join t_courier tco on tcc.courier_id = toc.id
        where
            del_flag=0
        <if test="dto.name !=null  and ''!= dto.name">
            and tc.name like concat('%',#{dto.name},'%')
        </if>
        <if test="dto.regionId!=null">
            and tc.region_id =#{dto.regionId}
        </if>
        <if test="dto.adminName !=null  and ''!= dto.adminName">
            and tc.admin_name like concat('%',#{dto.adminName},'%')
        </if>
        <if test="dto.adminPhone !=null  and ''!= dto.adminPhone">
            and tc.admin_phone like concat('%',#{dto.adminPhone},'%')
        </if>
        <if test="dto.courierName !=null  and ''!= dto.courierName">
            and tco.name like concat('%',#{dto.courierName},'%')
        </if>
        <if test="dto.status!=null">
            and tc.status =#{dto.status}
        </if>
    </select>
</mapper>