<?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.GridUnit" name="单元信息">

	<select id="queryUnitId" resultType="string" parameterType="map">
        select 
              id
        from
            jl_grid_unit
        where
            building_id = #{buildingId}
        and
            name = #{unitName}
        and
            del_flag = 0
        limit 1
    </select>

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