楼栋查询

<p><%@ Page Language="C#" AutoEventWireup="true" %> <%@ Import Namespace="Transcend.Utility" %> <%@ Import Namespace="Newtonsoft.Json" %></p>
<script type="text/javascript" src="http://www.cnblogs.com/Scripts/Extjs/ext-all-debug.js"></script>
<script type="text/javascript" src="http://www.cnblogs.com/Scripts/Extjs/ext-lang-zh_CN.js"></script>
<script type="text/javascript" src="http://www.cnblogs.com/JavaScript/Util/SysHelper.js"></script>
<script type="text/javascript">// <![CDATA[
Ext.BLANK_IMAGE_URL = SysHelper.GetRootPath() +       "Scripts/Extjs/resources/themes/images/default/tree/s.gif";
        Ext.onReady(function () {

            var Buildingstore = Ext.create(‘Ext.data.Store‘, {
                pageSize:1,
                fields: [
                   {
                       name: "RBUILDID",
                       type: ‘string‘
                   }, {
                       name: "BUILDNO",
                       type: ‘string‘
                   },
                   {
                       name: "DEVELOPER",
                       type: ‘string‘
                   }, {
                       name: "PROJECTNAME",
                       type: ‘string‘
                   }, {
                       name: "STREET",
                       type: ‘string‘
                   }, {
                       name: "DOORNO",
                       type: "string"
                   }, {
                       name: "BUILDNO",
                       type: ‘string‘
                   }, {
                       name: "BUILDAREA",
                       type: ‘number‘
                   },
                    {
                        name: "LOCATION",
                        type: ‘string‘
                    }, {
                        name: "LANDNO",
                        type: ‘string‘
                    }, {
                        name: "GRAPHNO",
                        type: ‘string‘
                    }, {
                        name: "BUILDUNIT",
                        type: ‘number‘
                    }, {
                        name: "FLOORS",
                        type: ‘number‘
                    }, {
                        name: "DIVISIONID",
                        type: ‘number‘
                    }, {
                        name: "SETS",
                        type: ‘number‘
                    }, {
                        name: "UPFLOORS",
                        type: ‘number‘
                    }, {
                        name: "HOUSESUITE",
                        type: ‘number‘
                    }, {
                        name: "UNDERFLOORS",
                        type: ‘number‘
                    }, {
                        name: "BUILDYEAR",
                        type: "date"
                    }, {
                        name: "FLOORON",
                        type: ‘number‘
                    }, {
                        name: "FL0OREND",
                        type: ‘number‘
                    }, {
                        name: "CREATEDATE",
                        type: ‘date‘

                    }, {
                        name: "STRUCTURE",
                        type: ‘string‘
                    }, {
                        name: "SETAREA",
                        type: "number"
                    }, {
                        name: "DOORNO",
                        type: "number"
                    }, {
                        name: "REMARK",
                        type: ‘string‘
                    }
                ],
                proxy: {
                    type: ‘ajax‘,
                    url: ‘buildSearch.aspx?Type=Building‘,
                    reader: {
                        type: ‘json‘,
                        root: ‘Data‘,
                        totalProperty:‘totalCount‘
                    },

                    listeners: {
                        exception: function (sender, response, operation) {
                          //  debugger;
                        }
                    }
                },

                autoLoad: true
            });

            var grid = Ext.create("Ext.grid.Panel", {
                layout: ‘fit‘,
                store: Buildingstore,
                columns: [
                    { xtype: "rownumberer", text: "序号", width: 40 },
                    { text: ‘楼栋编号‘, dataIndex: ‘RBUILDID‘ },
                    { text: ‘开发公司‘, dataIndex: ‘DEVELOPER‘ },
                    { text: ‘幢号‘, dataIndex: ‘BUILDNO‘ },
                    { text: ‘街道‘, dataIndex: ‘STREET‘ },
                    { text: ‘创建时间‘, dataIndex: ‘CREATEDATE‘, xtype:‘datecolumn‘, format:‘Y-m-d‘ },
                    { text: ‘地上层数‘, dataIndex: ‘UPFLOORS‘ },
                    { text: ‘地下层数‘, dataIndex: ‘UNDERFLOORS‘ },
                    { text: ‘总套数‘, dataIndex: ‘HOUSESUITE‘ },
                    { text: ‘区县‘, dataIndex: ‘DIVISIONID‘ },
                    { text: ‘坐落‘, dataIndex: ‘LOCATION‘ },
                    { text: ‘单元‘, dataIndex: ‘BUILDUNIT‘ },
                    { text: ‘所在层‘, dataIndex: ‘FLOORON‘ },
                    { text: ‘终止层‘, dataIndex: ‘FL0OREND‘ },
                    { text: ‘结构‘, dataIndex: ‘STRUCTURE‘ },
                    { text: ‘建筑面积‘, dataIndex: ‘BUILDAREA‘ },
                    { text: ‘项目名称‘, dataIndex: ‘PROJECTNAME‘ },
                    { text: ‘门牌号‘, dataIndex: ‘DOORNO‘ },
                    { text: ‘备注‘, dataIndex: ‘REMARK‘ },
                    { text: ‘套内面积‘, dataIndex: ‘SETAREA‘ }
                ],
                dockedItems: [{
                    xtype: ‘pagingtoolbar‘,
                    store: Buildingstore,
                    dock: ‘bottom‘,
                    displayInfo: true
                }],
                listeners: {
                    itemclick: function (m, r) {
                        var id = r.get("RBUILDID");
                        alert(id);

                    }
                }
            })

            dockedItems: [{
                xtype: ‘pagingtoolbar‘,
                store: Buildingstore,
                dock: ‘bottom‘,
                displayInfo: true
            }]

            var roomCol = [
                { xtype: "rownumberer", text: "序号", width: 40 },
                {
                    header: ‘楼栋编号‘,
                    width: 100,
                    type: ‘string‘
                },
                {
                    header: "坐落",
                    width: 100,
                    type: ‘string‘
                },
                  {
                      header: ‘开发公司‘,
                      width: 100,
                      type: ‘string‘

                  },
                  {
                      header: ‘建筑面积‘,
                      width: 100,
                      type: ‘number‘

                  },
                  {
                      header: ‘街道‘,
                      width: 100,
                      type: ‘number‘

                  },
                  {
                      header: ‘地上层数‘,
                      width: 100,
                      type: ‘number‘

                  },
                  {
                      header: ‘地下层数‘,
                      width: 100,
                      type: ‘number‘

                  },
                  {
                      header: ‘总层数‘,
                      width: 100,
                      type: ‘number‘

                  }, {
                      header: "所在层",
                      width: 100,
                      type: ‘number‘

                  }, {
                      header: "终止层",
                      width: 100,
                      type: ‘number‘
                  }, {
                      header: "单元",
                      width: 100,
                      type: ‘number‘
                  }, {
                      header: "套内面积",
                      width: 100,
                      type: ‘number‘
                  }, {
                      header: "创建时间",
                      width: 100,
                      xtype: ‘date‘,
                      dateIndex: ‘CREATEDATE‘,
                      format:‘Y-m-d‘

                  }, {
                      header: "幢号",
                      width: 100,
                      type: ‘number‘
                  }, {
                      header: "区县",
                      width: 100,
                      type: ‘string‘
                  }, {
                      header: "备注",
                      width: 100,
                      type: ‘varchar2‘
                  }
            ];

            var textFiled = [{
                xtype: ‘textfield‘,
                labelWidth: 45,
                padding: ‘5 5 4 0‘,
                displayField: ‘TEXT‘,
                valueField: ‘ID‘,
                labelAlign: "right",
                name: ‘DIVISIONID‘,
                fieldLabel: ‘区县‘

            }, {
                xtype: ‘textfield‘,
                labelWidth: 50,
                padding: ‘5 5 4 0‘,
                displayField: ‘TEXT‘,
                valueField: ‘ID‘,
                labelAlign: "right",
                name: ‘LOCATION‘,
                fieldLabel: ‘坐落‘
            }, {
                xtype: ‘textfield‘,
                labelWidth: 50,
                padding: ‘5 5 4 0‘,
                displayField: ‘TEXT‘,
                valueField: ‘ID‘,
                labelAlign: "right",
                name: ‘RBUILDID‘,
                fieldLabel: ‘楼栋编号‘
            }, {
                xtype: ‘textfield‘,
                labelWidth: 50,
                padding: ‘5 5 4 0‘,
                displayField: ‘TEXT‘,
                valueField: ‘ID‘,
                labelAlign: "right",
                name: ‘BUILDNO‘,
                fieldLabel: ‘幢号‘
            }, {
                xtype: ‘textfield‘,
                labelWidth: 50,
                padding: ‘5 5 4 0‘,
                displayField: ‘TEXT‘,
                valueField: ‘ID‘,
                labelAlign: "right",
                name: ‘PROJECTNAME‘,
                fieldLabel: ‘项目名称‘

            }, {
                xtype: ‘textfield‘,
                labelWidth: 50,
                padding: ‘5 5 4 0‘,
                displayField: ‘TEXT‘,
                valueField: ‘ID‘,
                labelAlign: "right",
                name: ‘DOORNO‘,
                fieldLabel: ‘门牌号‘
            },
             {
                 padding: ‘4 3 3 3‘,
                 xtype: ‘button‘,
                 labelWidth: 60,
                 labelAlign: "right",
                 name: ‘Search‘,
                 text: ‘查询‘,
                 handler: function () {
                    // debugger;
                     var xx = this.up(‘form‘).getValues();
                     var stringexp = Ext.encode(xx);
                     Buildingstore.proxy.extraParams = {
                         stringexp: stringexp
                     }
                     Buildingstore.load();
                 }
             }]

            function btnclick() {
                var Buildingstore = new Ext.data.Store({
                    url: ‘buildSearch.aspx?Type=Building‘,
                    reader: {
                        type: ‘json‘,
                        root: ‘Data‘,
                        totalProperty: ‘totalCount‘
                    }
                });
                //Buildingstore.load();
                //grid.reconfigure(Buildingstore, grid);
            }
           // debugger;
            Ext.create("Ext.container.Viewport", {
                renderTo: Ext.getBody(),
                layout: ‘border‘,
                items: [

                    //{
                    //    title: ‘房屋信息‘,
                    //    region: ‘south‘,
                    //    xtype: ‘gridpanel‘,
                    //    columns: roomCol,
                    //    flex: 1,
                    //    split: true

                    //},
                    {
                        layout: ‘border‘,
                        region: ‘center‘,
                        items: [{
                            region: ‘north‘,
                            xtype: ‘form‘,
                            height: 45,
                            layout: {
                                type: ‘table‘,
                                columns: 10
                            },
                            items: textFiled
                        }, {
                            title: ‘楼栋信息‘,
                            region: ‘center‘,
                            xtype: ‘panel‘,
                            layout: ‘fit‘,
                            items: grid
                        }]
                    }]
            })
        })
// ]]></script>
<script type="text/javascript">// <![CDATA[
/// <summary>
        /// 加载
        /// </summary>

        public void load()
        {
            if (!IsPostBack)
            {

                if (Request["Type"] == "Building")
                {

                    GetBuildingData();
                    Response.End();
                }
            }
        }

        public void GetBuildingData()
         {
             var page = int.Parse((this.Request.QueryString["page"] ?? "0").ToString());
             var pagesize = int.Parse((this.Request.QueryString["limit"] ?? "0").ToString());
             string mc = @"select  a.* from   (  Select
                       row_number() over( order by o.rbuildid) rowindex,o.rbuildid,
                           d.fullname,
                           o.DEVELOPER,
                           o.HAVEFLUE,
                           o.PROJECTNAME,
                           o.STREET,
                           o.DOORNO,
                           o.BUILDNO,
                           o.LOCATION,
                           o.LANDNO,
                           o.GRAPHNO,
                           o.FLOORS,
                           o.SETS,
                           o.UPFLOORS,
                           o.UNDERFLOORS,
                           o.BUILDYEAR,
                           o.STRUCTURE,
                           o.BUILDSTATUS,
                           o.BLDSTATUSDATE,
                           o.USAGE,
                           o.FORECASTBUILDAREA,
                           o.FORECASTUNDERAREA,
                           o.FORECASTUPAREA,
                           o.BUILDAREA,
                           o.UNDERAREA,
                           o.UPAREA,
                           o.GISID,
                           o.SETAREA,
                           o.PUBLICAREA,
                           o.BALCONYAREA,
                           o.LANDAPPORAREA,
                           o.LANDAREA,
                           o.FORECASTSETAREA,
                           o.FORECASTPUBLICAREA,
                           o.FORECASTBALCONYAREA,
                           o.createuserid,
                           o.lmodifydate,
                           o.lmuserid,
                           o.createdate,
                           o.remark
                      from rbuilding o, division d
                       where o.divisionid = d.id ) a
                       where  a.rowindex > " + pagesize + " * " + (page - 1) + " and a.rowindex <= " + pagesize +" * " + (page - 1) + " + " + pagesize;

            string sql = @"Select o.rbuildid,
                           d.fullname,
                           o.DEVELOPER,
                           o.HAVEFLUE,
                           o.PROJECTNAME,
                           o.STREET,
                           o.DOORNO,
                           o.BUILDNO,
                           o.LOCATION,
                           o.LANDNO,
                           o.GRAPHNO,
                           o.FLOORS,
                           o.SETS,
                           o.UPFLOORS,
                           o.UNDERFLOORS,
                           o.BUILDYEAR,
                           o.STRUCTURE,
                           o.BUILDSTATUS,
                           o.BLDSTATUSDATE,
                           o.USAGE,
                           o.FORECASTBUILDAREA,
                           o.FORECASTUNDERAREA,
                           o.FORECASTUPAREA,
                           o.BUILDAREA,
                           o.UNDERAREA,
                           o.UPAREA,
                           o.GISID,
                           o.SETAREA,
                           o.PUBLICAREA,
                           o.BALCONYAREA,
                           o.LANDAPPORAREA,
                           o.LANDAREA,
                           o.FORECASTSETAREA,
                           o.FORECASTPUBLICAREA,
                           o.FORECASTBALCONYAREA,
                           o.createuserid,
                           o.lmodifydate,
                           o.lmuserid,
                           o.createdate,
                           o.remark
                      from rbuilding o, division d
                       where o.divisionid = d.id ";
            string stringexp = Request["stringexp"];

            FindInfo find = new FindInfo();
            if (stringexp != null)
            {
                find = Newtonsoft.Json.JsonConvert.DeserializeObject<FindInfo>(stringexp);
            }
            if (!string.IsNullOrEmpty(find.BUILDNO))
            {
                sql += "and BUILDNO=‘" + find.BUILDNO + "‘";
            }
            if (!string.IsNullOrEmpty(find.LOCATION))
            {
                sql += "and LOCATION =‘" + find.LOCATION + "‘";
            }
            if (!string.IsNullOrEmpty(find.DIVISIONID))
            {
                sql += "and DIVISIONID =‘" + find.DIVISIONID + "‘";
            }
            if (!string.IsNullOrEmpty(find.DOORNO))
            {
                sql += "and DOORNO =‘" + find.DOORNO + "‘";
            }
            if (!string.IsNullOrEmpty(find.PROJECTNAME))
            {
                sql += "and PROJECTNAME =‘" + find.PROJECTNAME + "‘";
            }
            if (!string.IsNullOrEmpty(find.RBUILDID))
            {
                sql += "and RBUILDID =‘" + find.RBUILDID + "‘";
            }
            var data = Transcend.Utility.Db.FindDictionary(mc);
            var count = Convert.ToInt32(Transcend.Utility.Db.ExecuteScaler("select count(*) count from (" + sql + ")"));
            var datas = new ResultInfo() { Data = data, totalCount = count };
            var stringdata = Newtonsoft.Json.JsonConvert.SerializeObject(datas);
            Response.Clear();
            Response.Write(stringdata);
        }

        public class ResultInfo
        {
            public int totalCount { get; set; }
            public object Data { get; set; }
        }
        public class FindInfo
        {
            public string DIVISIONID { get; set; }
            public string LOCATION { get; set; }
            public string RBUILDID { get; set; }
            public string BUILDNO { get; set; }
            public string PROJECTNAME { get; set; }
            public string DOORNO { get; set; }
        }
// ]]></script>
<p><%load();%></p>

  

时间: 2024-10-03 07:45:25

楼栋查询的相关文章

楼栋信息 楼层信息

http://www.szzlb.gov.cn/LEAPV5/czww_webmap/czww_fwbmcx

mybatis一对一 和 一对多 嵌套查询

实际项目中的,接口对外VO  会出现 一对一 和 一对多的情况,举例:小区 下面有 楼栋  ,楼栋 下面有 房屋    ,   房屋里面又房间 小区Vo  : districtVo { id: name: List<buildVo> builds } 楼栋Vo :buildVo{ id; name; did; List<apartmentVo> apartments } 房屋Vo :apartmentVo{ id: name: List<RoomVo> } ......

你真的会玩SQL吗?三范式、数据完整性

每次上新功能时都需要添加新表,这时就要涉及到表结构的设计,那就要提到三范式,对于三范式教科书上说得很绕口,那简单点的呢?  三范式 第一范式:属性不可分,不允许存在隐藏字段,属性保持“原子性” 第二范式:要有主键.为实现区分通常需要为表加上一个列,以存储各个实例的唯一标识. 第三范式:要求一个数据库表中不包含已在其它表中已包含的非主关键字信息. 正规化范式(BCDF):所有表中的决定因素必须是一个候选键,如果只有一个候选键,那么就和第三范式是一样的. 第四范式(4NF):消除多值依赖. 第五范式

Oracle字符串中包含数字、特殊符号的排序

问题描述: 某小区,需要按照小区.楼栋.单元号.房间号进行排序,但是按照地址描述排序时,因为字符串中包含数字,所以造成了如下的结果, 1号楼之后应该是2号楼,但是查询结果却是10号楼 . 尝试解决 使用正则表达式替换 结果: 虽然楼栋号排序正常了,但是会发现房间号排序出现了混乱.  继续想办法 终极办法: 使用translate函数 可以发现,结果正常显示 . 以下附上translate使用方法 一.语法: TRANSLATE(string,from_str,to_str) 二.目的 返回将(所

2012高校GIS论坛

江苏省会议中心 南京·钟山宾馆(2012年4月21-22日) 以"突破与提升"为主题的"2012高校GIS论坛"将于4月在南京举行,由南京大学和工程中心共同承办.高校GIS论坛每两年举办一次,已在北京九华山庄成功举办三届,现已发展成为国内高校GIS教育界最有权威,最具影响力的高端论坛. 赛迪网直播小组正在现场进行图文.微博直播——2012高校GIS论坛! 主持人:尊敬的李院长.曹省长.陈校长,“突破与提升2012高校GIS论坛”现在开幕!首先请允许我介绍出席今天开幕

非典型T_SQL的总结

? ------over的两种常用的用法--- --第一种分组 当然要注意了,这里的分组并不是实际的分组,而是根据你的业务需求而坐的临时分组 ? select roomguid,Room, avg(total) over(partition by bldGUID) as 楼栋均价, AVG(total) over(partition by ProjGUID) as 项目均价 from p_room ? --产生行号 用来产生行号的时候,over()一定要order by select ROW_N

easyui-datagrid高度放大或缩小动态设置分页參数

<div class="map_leftInfo" style="height: 745px;width:320px;border: 1px solid #dfdfdf;"> <div style="margin:2px 5px auto 2px;height:100%;"> <div id="queryCondition" style="border-bottom: 1px solid

导出数据优化技巧

因为在公司业务需要,经常会有导数据的情况,有的时候需要查询统计的信息比较多,需要查询多个表去取值,有时候可能跨库到sqlserver中,sqlserver中不同的城市对应不同的库,加上数据量比较大,如果不采取合适的方案会对服务器负载影响很大,加上大家都是那个服务器上做操作,很容易使服务器崩溃. 所以总结了网上的一些优化技巧,使之符合公司业务需求.当然要配合sql优化. 加了进度条和脚本运行时间统计,使导数据过程更加有乐趣. 废话不多说,贴部分代码供大家参考: <?php set_time_lim

【转】物业管理与移动互联网科技|微信公众平台,物业app,物业O2O

[导语]当下,物业管理行业正在接受新科技浪潮的冲击和洗礼,业界企业纷纷探索物业服务的新发展模式.云服务.微社区.微信公众平台.app等,这些本来陌生的词汇在物业管理行业变得耳熟能详.在借助科技手段拓展多种经营,提升竞争力.增加创富能力.开展信息化建设和管理的同时,部分物业服务企业的发展模式和理念又提升了一大步,现代科技推动物业管理行业发展正在成为现实. 第一部分:移动互联网改变传统物业管理 <ignore_js_op>  从6000斤香梨看社区O2O——记长城物业盛世家园社区香梨团购活动 普而