罗元桥
2021-09-28 a5e8dc52dbf29b0ea4b39c00bfe8f88efb6aa76c
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="com.panzhihua.service_community.dao.ComMngBuildingDAO">
 
    <resultMap type="com.panzhihua.service_community.model.dos.ComMngBuildingDO" id="ComMngBuildingBaseResultMap">
        <result property="id" column="id"/>
        <result property="streetId" column="street_id"/>
        <result property="actId" column="act_id"/>
        <result property="villageId" column="village_id"/>
        <result property="name" column="name"/>
        <result property="buildFloorSum" column="build_floor_sum"/>
        <result property="everyFloorSum" column="every_floor_sum"/>
        <result property="buildUserSum" column="build_user_sum"/>
        <result property="buildType" column="build_type"/>
        <result property="buildStructure" column="build_structure"/>
        <result property="useType" column="use_type"/>
        <result property="buildDate" column="build_date"/>
        <result property="unitTotal" column="unit_total"/>
        <result property="elevatorTotal" column="elevator_total"/>
        <result property="buildStatus" column="build_status"/>
        <result property="path" column="path"/>
        <result property="lng" column="lng"/>
        <result property="lat" column="lat"/>
        <result property="buildingResponsible" column="building_responsible"/>
        <result property="buildingResponsibleCardNo" column="building_responsible_card_no"/>
        <result property="buildingResponsiblePhone" column="building_responsible_phone"/>
        <result property="buildingResponsibleType" column="building_responsible_type"/>
        <result property="createAt" column="create_at"/>
        <result property="updateAt" column="update_at"/>
        <result property="remark" column="remark"/>
        <result property="gridId" column="grid_id"/>
    </resultMap>
 
    <select id="find" resultType="String">
        select concat(t1.group_at,t.name,'栋') from com_mng_building t left join com_mng_village t1 on t.village_id = t1.village_id where t.id in (#{id})
    </select>
 
    <resultMap id="selectMap" type="com.panzhihua.common.model.vos.community.VillageVO">
        <result property="value" column="villageId"/>
        <result property="label" column="villageName"/>
        <collection property="children" ofType="com.panzhihua.common.model.vos.community.BuildingVO"
                    column="{village_id = village_id}"
                    javaType="java.util.ArrayList">
            <result property="value" column="id"/>
            <result property="label" column="name"/>
        </collection>
    </resultMap>
 
    <select id="select" resultMap="selectMap">
        select t.village_id as villageId,t.name as villageName,t1.id,t1.name  from com_mng_village t left join com_mng_building t1 on t.village_id = t1.village_id where t.community_id=#{id} and t1.id is not null
    </select>
 
</mapper>