<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//oos.juyouhx.com//DTD Mapper 3.0//EN" "http://oss.juyouhx.com/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.scpyun.platform.standard.jilinsscgsdp.GridFloorInfo" name="楼层信息">

	<select id="getFloorId" resultType="string" parameterType="map">
        select 
             id
        from
             jl_grid_floor
        where
            unit_id = #{unitId}
        and
            name = #{floorNum}
        and
            del_flag = 0
        limit 1
    </select>

    <select id="getSort" resultType="decimal" parameterType="string">
        select
        sort
        from
        jl_grid_floor
        where
        unit_id = #{unitId}
        order by sort desc
        limit 1
    </select>

    <insert id="saveFloorInfo" parameterType="map">
        insert into
        jl_grid_floor
        (
        id,
        name,
        sort,
        grade,
        company_code,
        city_id,
        area_id,
        street_id,
        community_id,
        garden_id,
        residential_id,
        building_id,
        unit_id,
        del_flag,
        create_by,
        create_time,
        data_source
        )
        values
        (
        #{id},
        #{name},
        #{sort},
        #{grade},
        #{companyCode},
        #{cityId},
        #{areaId},
        #{streetId},
        #{communityId},
        #{gardenId},
        #{residentialId},
        #{buildingId},
        #{unitId},
        #{delFlag},
        #{createBy},
        #{createTime},
        #{dataSource}
        )
    </insert>
</mapper>
