<?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.community.unit.mapper.UnitMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="unitResultMap" type="org.springblade.community.unit.entity.Unit">
        <result column="id" property="id"/>
        <result column="status" property="status"/>
        <result column="type" property="type"/>
        <result column="name" property="name"/>
        <result column="unit_number" property="unitNumber"/>
        <result column="residential_id" property="residentialId"/>
        <result column="residential_name" property="residentialName"/>
        <result column="org_position" property="orgPosition"/>
        <result column="estate_position" property="estatePosition"/>
        <result column="person_name" property="personName"/>
        <result column="person_tel" property="personTel"/>
        <result column="built_year" property="builtYear"/>
        <result column="property_nature" property="propertyNature"/>
        <result column="including_elevator" property="includingElevator"/>
        <result column="room_number" property="roomNumber"/>
        <result column="user_number" property="userNumber"/>
        <result column="serial" property="serial"/>
        <result column="remark" property="remark"/>
        <result column="org_pid" property="orgPid"/>
        <result column="org_pid_name" property="orgPidName"/>
        <result column="root_org_id" property="rootOrgId"/>
        <result column="create_account_id" property="createAccountId"/>
        <result column="create_date" property="createDate"/>
        <result column="building_id" property="buildingId"/>
        <result column="old_id" property="oldId"/>
        <result column="floor_number" property="floorNumber"/>
        <result column="building_name" property="buildingName"/>
        <result column="pic" property="pic"/>
        <result column="tenant_id" property="tenantId"/>
        <result column="inhabitant_id" property="inhabitantId"/>
    </resultMap>


    <select id="selectUnitPage" resultMap="unitResultMap">
        select * from estate_unit where is_deleted = 0
    </select>

</mapper>
