Browse Source

Merge branch 'master' of http://git.yvanui.com/hust/wuhan_epi

lange 5 years ago
parent
commit
fc20c11967

+ 18 - 2
admin-ui/app/whepi/mock/menu.json

@@ -35,6 +35,14 @@
         },
         {
           "id": "ENT100023",
+          "text": "凌云出入记录",
+          "href": "/app/whepi/scan/xqmanageLY.js",
+          "iconCls": "icon-blank fa fa-align-justify",
+          "state": "close",
+          "children": []
+        },
+        {
+          "id": "ENT100024",
           "text": "巡检扫码记录",
           "href": "/app/whepi/scan/xunJian.js",
           "iconCls": "icon-blank fa fa-align-justify",
@@ -42,12 +50,20 @@
           "children": []
         },
         {
-          "id": "ENT100024",
-          "text": "特殊人员管理",
+          "id": "ENT100025",
+          "text": "其他特殊人员管理",
           "href": "/app/whepi/scan/specialPersonnel.js",
           "iconCls": "icon-blank fa fa-align-justify",
           "state": "close",
           "children": []
+        },
+        {
+          "id": "ENT100026",
+          "text": "凌云特殊人员管理",
+          "href": "/app/whepi/scan/specialPersonnelLY.js",
+          "iconCls": "icon-blank fa fa-align-justify",
+          "state": "close",
+          "children": []
         }
       ]
     },

+ 9 - 1
admin-ui/app/whepi/mock/menu7.json

@@ -12,8 +12,16 @@
     },
     {
       "id": "ENT10002",
+      "text": "出入记录",
+      "href": "/app/whepi/scan/xqmanageLY.js",
+      "iconCls": "icon-blank fa fa-align-justify",
+      "state": "close",
+      "children": []
+    },
+    {
+      "id": "ENT10003",
       "text": "特殊人员管理",
-      "href": "/app/whepi/scan/specialPersonnel.js",
+      "href": "/app/whepi/scan/specialPersonnelLY.js",
       "iconCls": "icon-blank fa fa-align-justify",
       "state": "close",
       "children": []

+ 102 - 0
admin-ui/app/whepi/scan/addOutUserLY.js

@@ -0,0 +1,102 @@
+define(function (require) {
+    return function (context) {
+
+        var $dlg, $form, isEdit = false;
+
+        return {
+            xtype: 'dialog',
+            dialogId: 'dialogEnvLog',
+            title: context.isEdit ? '编辑特殊人员信息' : '新增特殊人员信息',
+            width: 450,
+            height: 300,
+            onOpen: function () {
+                $dlg = $(this);
+                if (context.isEdit) {
+                    $.yvan.ajax({
+                        loadingMask: false,
+                        url: api('/qrImg/getDoorById'),
+                        type: 'GET',
+                        data: {tuId: context.tuId},
+                        success: function (data) {
+                            $dlg.find('form');
+                            $form.formSet(data.data);
+                        }
+                    });
+                }
+            },
+            center: {
+                items: {
+                    width: 450,
+                    height: 756,
+                    autoSizeColumns: true,
+                    xtype: 'formgroup',
+                    onRender: function () {
+                        $form = $(this);
+                    },
+                    items: [
+                        [
+                            {name: 'tuId', xtype: 'hidden'},
+                            {
+                                name: 'phone',
+                                label: '电话',
+                                required: true,
+                                validType: 'phoneNum',
+                                maxlength: 60,
+                                width: 350,
+                            },
+                            {
+                                name: 'name',
+                                label: '联系人姓名',
+                                required: true,
+                                maxlength: 60,
+                                width: 350,
+                            },
+                        ]
+                    ],
+                }
+            },
+            buttons: [
+                {
+                    text: "检查电话", iconCls: "fa fa-save", onClick: function () {
+                        var queryForm = $form.formGet();
+                        if (queryForm.phone == "") {
+                            $.yvan.msg('请先选输入电话号码');
+                            return;
+                        }
+                        $.yvan.ajax({
+                            url: api('/OutUser/getUptownHomeByPhone'),
+                            data: {phone: queryForm.phone},
+                            method: 'post',
+                            async: false,
+                            success: function (data) {
+                                if (data.data.linkman != null) {
+                                    $form.formSet({name: data.data.linkman});
+                                }
+                            }
+                        });
+                    }
+                },
+                {
+                    text: "保存", iconCls: "fa fa-save", onClick: function () {
+                        $.yvan.postForm($form, {
+                            url: api('/OutUser/saveOutUserLY'),
+                            success: function (data) {
+                                if (data.data == 1) {
+                                    $.yvan.msg('保存成功');
+                                    $dlg.window('close');
+                                    if ($.type(context.confirm) === 'function') {
+                                        context.confirm();
+                                    }
+                                }
+                            }
+                        });
+                    }
+                }, {
+                    text: "关闭", iconCls: "fa fa-times", onClick: function () {
+                        $dlg.dialog('close');
+                    }
+                }
+            ]
+        };
+    };
+});

+ 2 - 0
admin-ui/app/whepi/scan/specialPersonnel.js

@@ -15,6 +15,7 @@ define(function (require) {
             // 检索条件查询
             function queryGrid1() {
                 var queryForm = $form.formGet();
+                queryForm.tuType = 2;
                 $grid1.reload({
                     mtype: 'POST',
                     url: api('/OutUser/selectAllOutUser'),
@@ -178,6 +179,7 @@ define(function (require) {
                                         {field: 'unit', title: '单元', maxWidth: 200, align: 'left',},
                                         {field: 'name', title: '名字', maxWidth: 200, align: 'left',},
                                         {field: 'phone', title: '电话', maxWidth: 200, align: 'left',},
+                                        {field: 'doorplate', title: '门牌', maxWidth: 200, align: 'left',},
                                         {
                                             field: 'startDateStr', title: '开始时间', minWidth: 120, maxWidth: 300, align: 'left', editor: {
                                                 xtype: 'datebox',

+ 208 - 0
admin-ui/app/whepi/scan/specialPersonnelLY.js

@@ -0,0 +1,208 @@
+define(function (require) {
+        return function (context) {
+
+            var $grid1, $form;
+
+            // 输入搜索文本后点击回车按钮查询列表
+            function enterQueryGrid1(e) {
+                if (e.keyCode === 13) {
+                    var tmp = $(this).val();
+                    $form.formSet({queryProperties: tmp});
+                    queryGrid1();
+                }
+            }
+
+            // 检索条件查询
+            function queryGrid1() {
+                var queryForm = $form.formGet();
+                queryForm.tuType = 1;
+                $grid1.reload({
+                    mtype: 'POST',
+                    url: api('/OutUser/selectAllOutUserLY'),
+                    queryParams: queryForm
+                }, true);
+            }
+
+            var queryToolbar = {
+                xtype: 'toolbar',
+                title: '特殊人员详情',
+                items: [
+                    {
+                        text: '查询', iconCls: 'fa fa-search', onClick: function () {
+                            queryGrid1();
+                        }
+                    }, {
+                        text: '重置', iconCls: 'fa fa-refresh', onClick: function () {
+                            $form.formClear();
+                            queryGrid1();
+                        }
+                    }, {
+                        text: '关闭', iconCls: 'fa fa-times-circle', onClick: function () {
+                            App.closeMe(this);
+                        }
+                    }
+                ]
+            };
+
+            var queryForm = {
+                onRender: function () {
+                    $form = $(this);
+                },
+                xtype: 'form',
+                items: [[
+                    {
+                        xtype: 'textbox',
+                        label: '检索条件',
+                        name: 'queryProperties',
+                        prompt: "联系人姓名/工号",
+                        labelWidth: 'auto',
+                        events: {keydown: enterQueryGrid1}, width: 350
+                    },
+                    {
+                        xtype: 'textbox',
+                        label: '电话',
+                        name: 'phone',
+                        prompt: "小区名称",
+                        labelWidth: 'auto',
+                        events: {keydown: enterQueryGrid1}, width: 350
+                    },
+                ]]
+            };
+
+            return {
+                north: {
+                    height: 88,
+                    /* split: true,
+                     border: false,*///底框是否可变动
+                    items: [
+                        queryToolbar,
+                        queryForm
+                    ]
+                },
+                center: {
+                    height: '60%',
+                    split: true,
+                    items:
+                        {
+                            onRender: function () {
+                                $grid1 = $(this);
+                                queryGrid1()
+                            },
+                            xtype: 'grid',
+                            toolbar: {
+                                xtype: 'toolbar',
+                                title: '特殊人员详情',
+                                items: [
+                                    {
+                                        text: '添加', iconCls: 'fa fa-plus-circle fa-lg', onClick: function () {
+                                            $.yvan.showDialog(this,
+                                                require('/app/whepi/scan/addOutUserLY.js')({
+                                                    isEdit: false,
+                                                    confirm: function () {
+                                                        queryGrid1();
+                                                    }
+                                                })
+                                            );
+                                        }
+                                    },
+                                    {
+                                        text: '保存', iconCls: 'fa fa-pencil-square-o', onClick: function () {
+                                            var row = $grid1.rowData();
+                                            if (!row) {
+                                                $.yvan.msg('请选择一条要保存的数据');
+                                                return;
+                                            }
+                                            var startDateStr = row.startDateStr;
+                                            var endDateStr = row.endDateStr;
+                                            if (startDateStr > endDateStr) {
+                                                $.yvan.msg('开始时间必须小于等于结束时间');
+                                                return;
+                                            }
+                                            $.yvan.ajax({
+                                                url: api('/OutUser/updateOutUser'),
+                                                data: {
+                                                    tuId: row.tuId,
+                                                    startDate: row.startDateStr,
+                                                    endDate: row.endDateStr
+                                                },
+                                                method: 'post',
+                                                async: false,
+                                                success: function (data) {
+                                                    $.yvan.msg("操作成功");
+                                                    $grid1.reload();
+                                                    queryGrid1();
+                                                }
+                                            });
+                                        }
+                                    },
+                                    {
+                                        text: '删除', iconCls: 'fa fa fa-pencil-square-o fa-lg', onClick: function () {
+                                            var row = $grid1.checkedData();
+                                            if (row.length == 0) {
+                                                $.yvan.msg('请至少选择一行数据');
+                                                return;
+                                            }
+                                            var ids = "";
+                                            for (var i=0; i<row.length; i++) {
+                                                ids += row[i].tuId + ","
+                                            }
+                                            $.yvan.confirm('确定删除勾选的这' + row.length + '条特殊人员吗?', {
+                                                yes: function (index) {
+                                                    $.yvan.ajax({
+                                                        method: 'post',
+                                                        url: api('/OutUser/deleteOutUser'),
+                                                        data: {ids: ids},
+                                                        success: function (data) {
+                                                            $.yvan.msg("删除成功");
+                                                            $grid1.reload();
+                                                            queryGrid1();
+                                                        }
+                                                    });
+                                                }
+                                            });
+                                        }
+                                    }
+                                ]
+                            },
+                            multiselect: true, /// 表格多选
+                            idField: 'tuId',
+                            editable: true,
+                            editOnSelected: true,
+                            autoSizeColumns: true,
+                            columns:
+                                [
+                                    [
+                                        {field: 'tuId', title: '用户ID', hidden: true},
+                                        {field: 'userId', title: '用户ID', hidden: true},
+                                        {field: 'unit', title: '部门', maxWidth: 200, align: 'left',},
+                                        {field: 'name', title: '名字', maxWidth: 200, align: 'left',},
+                                        {field: 'phone', title: '电话', maxWidth: 200, align: 'left',},
+                                        {field: 'doorplate', title: '工号', maxWidth: 200, align: 'left',},
+                                        {
+                                            field: 'startDateStr', title: '开始时间', minWidth: 120, maxWidth: 300, align: 'left', editor: {
+                                                xtype: 'datebox',
+                                                required: true,
+                                                onChange: function (value) {
+                                                    console.log(value)
+                                                },
+                                                maxlength: 50
+                                            }
+                                        },
+                                        {
+                                            field: 'endDateStr', title: '结束时间', minWidth: 120, maxWidth: 200, align: 'left', editor: {
+                                                xtype: 'datebox',
+                                                required: true,
+                                                onChange: function (value) {
+                                                    console.log(value)
+                                                },
+                                                maxlength: 50
+                                            }
+                                        },
+                                    ]
+                                ]
+                        }
+                }
+            };
+        };
+    }
+);

+ 261 - 0
admin-ui/app/whepi/scan/xqmanageLY.js

@@ -0,0 +1,261 @@
+define(function (require) {
+        return function (context) {
+
+            var $grid1, $form;
+
+            // 弹框的方式
+            var widgets = {
+                // 搜索分类检索
+                selectTableUnit: {
+                    url: 'app/whepi/home/selectLYbumen.js',
+                    bind: {
+                        unitId: 'unitId',
+                        unit: 'unit',
+                    },
+                },
+            }
+
+
+            // 导出
+            function exportExcel() {
+                var queryForm = $form.formGet();
+                $.yvan.download({
+                    method: 'post',
+                    url: api('/sweepCode/exportLY?queryProperties=' + queryForm.queryProperties + '&unitId=' + queryForm.unitId + '&goStatus=' + queryForm.goStatus + '&dateSta=' + queryForm.dateSta + '&dateEnd=' + queryForm.dateEnd),
+                    fileName: '进出管理-' + $.yvan.getMoment().format('YYYY-MM-DD HH:mm:ss') + '.xlsx'
+
+                });
+            }
+
+            // 输入搜索文本后点击回车按钮查询列表
+            function enterQueryGrid1(e) {
+                if (e.keyCode === 13) {
+                    var tmp = $(this).val();
+                    $form.formSet({queryProperties: tmp});
+                    queryGrid1();
+                }
+            }
+
+            // 检索条件查询
+            function queryGrid1() {
+                var queryUrl = '/sweepCode/selectCodeLY';// 自行替换此参数
+                var queryForm = $form.formGet();
+                if (!queryForm.dateSta) {
+                    $form.formSet({dateSta: getFormatDate() + " 00:00:00"});
+                    queryForm.dateSta = getFormatDate() + " 00:00:00";
+                }
+                if (!queryForm.dateEnd) {
+                    $form.formSet({dateEnd: getFormatDate() + " 23:59:59"});
+                    queryForm.dateEnd = getFormatDate() + " 23:59:59";
+                }
+                queryForm.roleCode = App.currentRoleCode;
+                $grid1.reload({
+                    mtype: 'POST',
+                    url: api(queryUrl),
+                    queryParams: queryForm
+                }, true);
+            }
+
+            // 搜索按钮
+            var queryToolbarTitle = '进出管理';// 自行替换此参数
+            var queryToolbar = {
+                xtype: 'toolbar', title: queryToolbarTitle, items: [
+                    {
+                        text: '查询', iconCls: 'fa fa-search', onClick: function () {
+                            queryGrid1();
+                        }
+                    }, {
+                        text: '重置', iconCls: 'fa fa-refresh', onClick: function () {
+                            $form.formClear();
+                            queryGrid1();
+                        }
+                    }, {
+                        text: '关闭', iconCls: 'fa fa-times-circle', onClick: function () {
+                            App.closeMe(this);
+                        }
+                    }
+                ]
+            };
+
+            // 搜索条件
+            var queryForm = {
+                onRender: function () {
+                    $form = $(this);
+                },
+                xtype: 'form',
+                items: [[
+                    {
+                        xtype: 'textbox',
+                        label: '大门名称',
+                        name: 'queryProperties',
+                        prompt: "大门名称",
+                        labelWidth: 'auto',
+                        events: {keydown: enterQueryGrid1}, width: 250
+                    },
+                    {xtype: 'hidden', name: 'unitId'},
+                    {
+                        xtype: 'searchbox',
+                        label: '部门',
+                        name: 'unit',
+                        prompt: "部门",
+                        width: '300px',
+                        widget: widgets.selectTableUnit,// 弹出框方法
+                        labelWidth: '70px',
+                        onChange: function (value) {
+                            if (!isNotNullOrEmpty(value)) {
+                                $form.formSet({
+                                    unitId: ''
+                                })
+                            }
+                            queryGrid1();
+                        },
+                    },
+                    {
+                        xtype: 'yvselect', label: '通行状态', name: 'goStatus', labelWidth: 'auto', value: '', width: 220,
+                        data: [
+                            {id: '1', text: '允许'},
+                            {id: '-1', text: '禁止'},
+                        ],
+                        onChange: function () {
+                            queryGrid1();
+                        }
+                    },
+                    {
+                        xtype: 'datetimebox',
+                        name: 'dateSta',
+                        label: '进出时间',
+                        labelWidth: 'auto',
+                        width: 230,
+                        onChange: function (data) {
+                          /*  var expDateStart = $form.formGet().nextRepairDate;
+                            var expDateEnd = $form.formGet().expDateEnd;
+                            var expDateStart = new Date(expDateStart.replace("-", "/"));
+                            var expDateEnd = new Date(expDateEnd.replace("-", "/"));
+                            if (expDateStart > expDateEnd) {
+                                $.yvan.msg('起止日期必须大于起始日期');
+                                return;
+                            }*/
+                        }
+                    },
+                    {
+                        xtype: 'datetimebox', label: '--', name: 'dateEnd', labelWidth: 'auto', width: 220,
+                        onChange: function (data) {
+                           /* var expDateStart = $form.formGet().nextRepairDate;
+                            var expDateEnd = $form.formGet().expDateEnd;
+                            var expDateStart = new Date(expDateStart.replace("-", "/"));
+                            var expDateEnd = new Date(expDateEnd.replace("-", "/"));
+                            if (expDateStart > expDateEnd) {
+                                $.yvan.msg('起止日期必须大于起始日期');
+                                return;
+                            }*/
+                        }
+                    }
+                ]]
+            };
+
+            var gridToolbarTitle = '出入列表';// 自行替换此参数
+            var gridToolbar = {
+                xtype: 'toolbar',
+                title: gridToolbarTitle,
+                items: [
+                    {
+                        text: '导出', iconCls: 'fa fa-cloud-upload', onClick: function () {
+                            exportExcel();
+                        }
+                    },
+                ]
+            };
+
+            return {
+                north: {
+                    height: 88,
+                    /* split: true,
+                     border: false,*///底框是否可变动
+                    items: [
+                        queryToolbar,
+                        queryForm
+                    ]
+                },
+                center: {
+                    height: '60%',
+                    split: true,
+                    items:
+                        {
+                            onRender: function () {
+                                $grid1 = $(this);
+                                queryGrid1()
+                            },
+                            xtype: 'grid',
+                            toolbar:
+                            gridToolbar,
+                            idField: 'joId',
+                            autoSizeColumns: true,//序号多  正确显示
+                            columns:
+                                [
+                                    [
+                                        {field: 'uptownId', title: '小区id', maxWidth: 200, align: 'left', hidden: true},
+                                        // {field: 'uptownName', title: '小区名称', maxWidth: 200, align: 'left',},
+                                        // {field: 'ridgepole', title: '楼栋', maxWidth: 200, align: 'left',},
+                                        {field: 'unit', title: '部门', maxWidth: 200,},
+                                        {
+                                            field: 'doorplate',
+                                            title: '工号', maxWidth: 200,
+                                        },
+                                        {
+                                            field: 'linkman',
+                                            title: '用户名',
+                                        },
+                                        {
+                                            field: 'phone',
+                                            title: '电话',
+                                        },
+                                        {
+                                            field: 'doorName',
+                                            title: '出入大门',
+                                            align: 'left',
+                                        },
+                                        {
+                                            field: 'date',
+                                            title: '进出时间',
+                                            align: 'left',
+                                        },
+                                        {
+                                            field: 'inType',
+                                            title: '记录状态',
+                                            align: 'center',
+                                            formatter:function (value) {
+                                                if(value==1){
+                                                    return "进入"
+                                                }else if(value ==2){
+                                                    return "外出"
+                                                }
+
+                                            }
+                                        },
+                                        {
+                                            field: 'goStatus',
+                                            title: '通行状态',
+                                            align: 'center',
+                                            formatter:function (value) {
+                                                if(value==1){
+                                                    return "允许"
+                                                }else if(value ==-1){
+                                                    return "禁止"
+                                                }
+
+                                            }
+                                        },
+                                        {
+                                            field: 'errorInfo',
+                                            title: '禁止提示',
+                                            align: 'left',
+                                        },
+
+                                    ]
+                                ]
+                        }
+                }
+            };
+        };
+    }
+);

+ 2 - 1
whepi-doc/login.sql

@@ -210,6 +210,7 @@ CREATE TABLE out_scan  (
 DROP TABLE IF EXISTS out_user;
 CREATE TABLE out_user  (
   tu_id             bigint(20) NOT NULL DEFAULT 0 COMMENT '特殊ID',
+  tu_type           int(11) NOT NULL DEFAULT 0 COMMENT '特殊人员类型:1凌云,2非凌云',
   name              varchar(100)  NOT NULL DEFAULT '' COMMENT '特殊人员姓名',
   phone             bigint(20) NOT NULL DEFAULT 0 COMMENT '电话号码',
   start_date        date NOT NULL DEFAULT '0000-01-01' COMMENT '开始时间',
@@ -218,7 +219,7 @@ CREATE TABLE out_user  (
   time_create       datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '新增时间',
   time_update       datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
   PRIMARY KEY (tu_id) USING BTREE,
-  UNIQUE INDEX phone(phone) USING BTREE
+  UNIQUE INDEX phone(phone, tu_type, name) USING BTREE
 ) ENGINE = InnoDB default charset=utf8mb4 comment = '进出扫码特殊人员';
 
 DROP TABLE IF EXISTS out_scan_estate;

+ 6 - 4
whepi-web/src/main/java/com/bofeng/dao/OutUserMapper.java

@@ -16,13 +16,15 @@ import java.util.Map;
 public interface OutUserMapper extends BaseMapper<OutUser> {
 
 
-    @Select("SELECT * FROM out_user WHERE name = #{name} and phone = #{phone} and start_date <= curdate() and end_date >= curdate()")
-    OutUser getOutUserByPhone(@Param("name") String name, @Param("phone") Long phone);
+    @Select("SELECT * FROM out_user WHERE tu_type = #{tuType} and name = #{name} and phone = #{phone} and start_date <= curdate() and end_date >= curdate()")
+    OutUser getOutUserByPhone(@Param("tuType") Integer tuType, @Param("name") String name, @Param("phone") Long phone);
 
-    @Select("SELECT * FROM out_user WHERE phone = #{phone} and start_date <= curdate() and end_date >= curdate()")
-    OutUser queryOutUserByPhone(@Param("phone") Long phone);
+    @Select("SELECT * FROM out_user WHERE tu_type = #{tuType} and phone = #{phone}")
+    OutUser queryOutUserByPhone(@Param("tuType") Integer tuType, @Param("phone") Long phone);
 
     List<OutUser> getAllOutUser(PageDb pageDb, Map<String, Object> queryParam);
 
+    List<OutUser> getAllOutUserLY(PageDb pageDb, Map<String, Object> queryParam);
+
     Integer deleteOutUsers(@Param("ids") String ids);
 }

+ 4 - 0
whepi-web/src/main/java/com/bofeng/dao/SweepCodeMapper.java

@@ -1,6 +1,7 @@
 package com.bofeng.dao;
 
 import com.bofeng.entity.SysUptownHouse;
+import com.bofeng.entity.SysUptownHouseLY;
 import com.yvan.PageDb;
 import org.apache.ibatis.annotations.Mapper;
 import org.springframework.stereotype.Repository;
@@ -14,4 +15,7 @@ public interface SweepCodeMapper {
     List<SysUptownHouse> selectCode(PageDb pageDb, Map<String, Object> queryParam);
     List<SysUptownHouse> selectLingyunUser(PageDb pageDb, Map<String, Object> queryParam);
     List<SysUptownHouse> export(Map<String, Object> queryParam);
+
+    List<SysUptownHouseLY> selectCodeLY(PageDb pageDb, Map<String, Object> queryParam);
+    List<SysUptownHouseLY> exportLY(Map<String, Object> queryParam);
 }

+ 7 - 0
whepi-web/src/main/java/com/bofeng/entity/OutUser.java

@@ -22,6 +22,10 @@ public class OutUser {
     @TableId("tu_id")
     private Long tuId;
 
+    @ApiModelProperty("特殊人员类型:1凌云,2非凌云")
+    @TableField("tu_type")
+    private Integer tuType;
+
     @ApiModelProperty("特殊人员姓名")
     @TableField("name")
     private String name;
@@ -65,4 +69,7 @@ public class OutUser {
 
     @TableField(exist = false)
     private String endDateStr;
+
+    @TableField(exist = false)
+    private String doorplate;
 }

+ 106 - 0
whepi-web/src/main/java/com/bofeng/entity/SysUptownHouseLY.java

@@ -0,0 +1,106 @@
+package com.bofeng.entity;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.baomidou.mybatisplus.annotations.TableField;
+import com.baomidou.mybatisplus.annotations.TableId;
+import com.baomidou.mybatisplus.annotations.TableName;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.joda.time.DateTime;
+
+import java.io.Serializable;
+
+@Data
+public class SysUptownHouseLY implements Serializable {
+    @TableId("house_id")
+    private Long houseId;
+
+    @TableField(exist = false)
+    private Long uptownId;
+
+    @TableField(exist = false)
+    private Long unitId;
+
+    @TableField(exist = false)
+    private String ridgepole;
+
+    @TableField(exist = false)
+    @ExcelProperty(value = {"部门"}, index = 0)
+    private String unit;
+
+    @TableField(exist = false)
+    private String reportId;
+
+    @TableField(exist = false)
+    private String msStatus;
+
+    @TableField(exist = false)
+    private String time;
+
+    @TableField("doorplate")
+    @ExcelProperty(value = {"工号"}, index = 1)
+    private String doorplate;
+
+    @TableField("status")
+    private int status;
+
+    @TableField("report_status")
+    private int reportStatus;
+
+    @TableField("time_create")
+    private DateTime timeCreate;
+
+    @TableField("time_update")
+    private DateTime timeUpdate;
+
+    @TableField(exist = false)
+    private String uptownName;
+
+    @TableField(exist = false)
+    @ExcelProperty(value = {"出入大门"}, index = 4)
+    private String doorName;
+
+    @TableField(exist = false)
+    @ExcelProperty(value = {"进出时间"}, index = 5)
+    private String date;
+
+    @TableField(exist = false)
+    private Integer inType;
+
+    @TableField(exist = false)
+    @ExcelProperty(value = {"记录状态"}, index = 6)
+    private String inTypeStr;
+
+    @TableField(exist = false)
+    @ExcelProperty(value = {"用户名"}, index = 2)
+    private String linkman;
+
+    @TableField(exist = false)
+    @ExcelProperty(value = {"电话"}, index = 3)
+    private String phone;
+
+    @TableField(exist = false)
+    private Integer goStatus;
+
+    @ExcelProperty(value = {"通行状态"}, index = 7)
+    @ApiModelProperty("通行状态:1允许,-1禁止")
+    @TableField(exist = false)
+    private String goStatusStr;
+
+    @ExcelProperty(value = {"禁止提示"}, index = 8)
+    @ApiModelProperty("禁止提示")
+    @TableField(exist = false)
+    private String errorInfo;
+
+    @TableField(exist = false)
+    private String jcStatus;
+
+    @TableField(exist = false)
+    private String dept;
+
+    @TableField(exist = false)
+    private Long userId;
+
+
+
+}

+ 24 - 0
whepi-web/src/main/java/com/bofeng/service/SweepCodeService.java

@@ -140,6 +140,30 @@ public class SweepCodeService {
         return sysUptownHouses;
     }
 
+    public List<SysUptownHouseLY> selectCodeLY(PageDb pageDb, Map<String, Object> queryParam) {
+        List<SysUptownHouseLY> sysUptownHouses = sweepCodeMapper.selectCodeLY(pageDb,queryParam);
+        return sysUptownHouses;
+    }
+
+    public List<SysUptownHouseLY> exportLY(Map<String, Object> queryParam) {
+        List<SysUptownHouseLY> sysUptownHouses = sweepCodeMapper.exportLY(queryParam);
+        if(sysUptownHouses.size() != 0){
+            for (int i = 0; i < sysUptownHouses.size(); i++) {
+                if(sysUptownHouses.get(i).getInType() == 1 ){
+                    sysUptownHouses.get(i).setInTypeStr("进入");
+                }else if(sysUptownHouses.get(i).getInType() == 2 ){
+                    sysUptownHouses.get(i).setInTypeStr("外出");
+                }
+                if(sysUptownHouses.get(i).getGoStatus() == 1 ){
+                    sysUptownHouses.get(i).setGoStatusStr("允许");
+                }else if(sysUptownHouses.get(i).getGoStatus() == -1 ){
+                    sysUptownHouses.get(i).setGoStatusStr("禁止");
+                }
+            }
+        }
+        return sysUptownHouses;
+    }
+
     public List<OutScanEstate> selectXunJian(PageDb pageDb, Map<String, Object> queryParam) {
         List<OutScanEstate> outScanEstates = outScanEstateMapper.selectXunJian(pageDb,queryParam);
         return outScanEstates;

+ 43 - 1
whepi-web/src/main/java/com/bofeng/wx/controller/ScanAdminController.java

@@ -126,6 +126,21 @@ public class ScanAdminController {
         ExcelUtils.writeSheet(SysUptownHouse.class, sysUptownHouses).export(resp,"出入管理");
     }
 
+    @ApiOperation("凌云出入查询")
+    @PostMapping("/whepi/sweepCode/selectCodeLY")
+    public Model<List<SysUptownHouseLY>> selectCodeLY(PageDb pageDb,HttpParameterParser parser) {
+        List<SysUptownHouseLY> sysUptownHouses = sweepCodeService.selectCodeLY(pageDb,parser.getMap());
+        return Model.newSuccess(pageDb,sysUptownHouses);
+    }
+
+    @ApiOperation("凌云导出")
+    @PostMapping("/whepi/sweepCode/exportLY")
+    @SneakyThrows
+    public void exportLY(HttpParameterParser parser,HttpServletResponse resp) {
+        List<SysUptownHouseLY> sysUptownHouses = sweepCodeService.exportLY(parser.getMap());
+        ExcelUtils.writeSheet(SysUptownHouseLY.class, sysUptownHouses).export(resp,"凌云集团出入管理");
+    }
+
     @ApiOperation("出入查询")
     @PostMapping("/whepi/sweepCode/selectXunJian")
     public Model<List<OutScanEstate>> selectXunJian(PageDb pageDb,HttpParameterParser parser) {
@@ -148,6 +163,13 @@ public class ScanAdminController {
         return Model.newSuccess(pageDb,outUsers);
     }
 
+    @ApiOperation("凌云特殊人员查询")
+    @PostMapping("/whepi/OutUser/selectAllOutUserLY")
+    public Model<List<OutUser>> selectAllOutUserLY(PageDb pageDb,HttpParameterParser parser) {
+        List<OutUser> outUsers = outUserMapper.getAllOutUserLY(pageDb,parser.getMap());
+        return Model.newSuccess(pageDb,outUsers);
+    }
+
     @ApiOperation("检查电话号码")
     @PostMapping("/whepi/OutUser/getUptownHomeByPhone")
     public Model<UptownHome> getUptownHomeByPhone(@Pd(name = "phone") String phone) {
@@ -174,7 +196,26 @@ public class ScanAdminController {
     @ApiOperation("保存特殊人员")
     @PostMapping("/whepi/OutUser/saveOutUser")
     public Model saveOutUser(@JsonBody OutUser outUser) {
-        OutUser outUser1 = outUserMapper.queryOutUserByPhone(outUser.getPhone());
+        OutUser outUser1 = outUserMapper.queryOutUserByPhone(2, outUser.getPhone());
+        if (outUser1 != null) {
+            return Model.newFail("该号码已经添加为特殊人员,请仔细检查该号码。");
+        }
+        List<UptownHome> uptownHomes = uptownHomeMapper.getUptownHomeByPhone(outUser.getPhone().toString());
+        if (uptownHomes.size() > 0) {
+            outUser.setName(uptownHomes.get(0).getLinkman());
+        }
+        outUser.setTuId(IdWorker.getId());
+        outUser.setTuType(2);
+        outUser.setStartDate(new Date());
+        outUser.setEndDate(new Date());
+        outUser.setTime(1);
+        return Model.newSuccess(outUserMapper.insert(outUser));
+    }
+
+    @ApiOperation("凌云保存特殊人员")
+    @PostMapping("/whepi/OutUser/saveOutUserLY")
+    public Model saveOutUserLY(@JsonBody OutUser outUser) {
+        OutUser outUser1 = outUserMapper.queryOutUserByPhone(1, outUser.getPhone());
         if (outUser1 != null) {
             return Model.newFail("该号码已经添加为特殊人员,请仔细检查该号码。");
         }
@@ -183,6 +224,7 @@ public class ScanAdminController {
             outUser.setName(uptownHomes.get(0).getLinkman());
         }
         outUser.setTuId(IdWorker.getId());
+        outUser.setTuType(1);
         outUser.setStartDate(new Date());
         outUser.setEndDate(new Date());
         outUser.setTime(1);

+ 20 - 3
whepi-web/src/main/java/com/bofeng/wx/controller/ScanController.java

@@ -138,6 +138,15 @@ public class ScanController {
                     }
                 }
                 if (ly) {
+                    OutUser outUser = outUserMapper.getOutUserByPhone(1, uptownHomes.get(0).getLinkman(), Long.parseLong(uptownHomes.get(0).getPhone()));
+                    if (outUser != null) {
+                        model.put("collor", "green");
+                        model.put("collor2", "green");
+                        model.put("into", "允许通行");
+                        model.put("errorMsg", "特殊人员允许通行,请保证生产同时注意自身安全。");
+                        scanService.saveOutScan(userOpen.getUserId(), inType, uptownDoor.getUptownId(), uptownDoor.getDoorId(), 1, "");
+                        return new ModelAndView("/user/scan.ftl", model);
+                    }
                     MsReport msReport = msReportMapper.queryMsReportIsXG(userOpen.getUserId());
                     SimpleDateFormat s = new SimpleDateFormat("yyyy-MM-dd");
                     if (msReport != null) {
@@ -199,7 +208,7 @@ public class ScanController {
                 }
             }
             if (inType == 2) {
-                OutUser outUser = outUserMapper.getOutUserByPhone(uptownHomes.get(0).getLinkman(), Long.parseLong(uptownHomes.get(0).getPhone()));
+                OutUser outUser = outUserMapper.getOutUserByPhone(2, uptownHomes.get(0).getLinkman(), Long.parseLong(uptownHomes.get(0).getPhone()));
                 if (outUser != null) {
                     model.put("collor", "green");
                     model.put("into", "允许通行");
@@ -284,7 +293,7 @@ public class ScanController {
                 model.put("errorMsg", "您最近一分钟已经扫码,本次扫码重复。");
                 return new ModelAndView("/user/scanEstate.ftl", model);
             }
-            OutUser outUser = outUserMapper.getOutUserByPhone(uptownHomes.get(0).getLinkman(), Long.parseLong(uptownHomes.get(0).getPhone()));
+            OutUser outUser = outUserMapper.getOutUserByPhone(2, uptownHomes.get(0).getLinkman(), Long.parseLong(uptownHomes.get(0).getPhone()));
             if (outUser != null) {
                 model.put("collor", "green");
                 model.put("into", "允许通行");
@@ -368,7 +377,7 @@ public class ScanController {
                 model.put("name", uptownHomes.get(0).getLinkman());
                 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
                 model.put("now", sdf.format(new Date()));
-                OutUser outUser = outUserMapper.getOutUserByPhone(uptownHomes.get(0).getLinkman(), Long.parseLong(uptownHomes.get(0).getPhone()));
+                OutUser outUser = outUserMapper.getOutUserByPhone(2, uptownHomes.get(0).getLinkman(), Long.parseLong(uptownHomes.get(0).getPhone()));
                 if (outUser != null) {
                     model.put("collor", "green");
                     model.put("into", "允许外出");
@@ -445,6 +454,14 @@ public class ScanController {
             SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
             SimpleDateFormat s = new SimpleDateFormat("yyyy-MM-dd");
             model.put("now", sdf.format(new Date()));
+            OutUser outUser = outUserMapper.getOutUserByPhone(1, uptownHomes.get(0).getLinkman(), Long.parseLong(uptownHomes.get(0).getPhone()));
+            if (outUser != null) {
+                model.put("collor", "green");
+                model.put("collor2", "green");
+                model.put("into", "允许复工");
+                model.put("errorMsg", "特殊人员允许复工,请保证生产同时注意自身安全。");
+                return new ModelAndView("/user/returnWork.ftl", model);
+            }
             MsReport msReport = msReportMapper.queryMsReportIsXG(userId);
             if (msReport != null) {
                 List<MsReport> msReports1 = msReportMapper.queryLateStatus(userId, s.format(msReport.getReportDate()));

+ 30 - 1
whepi-web/src/main/resources/mapper/OutUserMapper.xml

@@ -3,7 +3,7 @@
 <mapper namespace="com.bofeng.dao.OutUserMapper">
 
     <select id="getAllOutUser" resultType="com.bofeng.entity.OutUser">
-        select u.tu_id,ur.user_id as userId,su.uptown_name as uptownName,uu.ridgepole,uu.unit,u.name,u.phone,
+        select u.tu_id,ur.user_id as userId,su.uptown_name as uptownName,uu.ridgepole,uu.unit,u.name,u.phone,suh.doorplate,
         DATE_FORMAT(u.start_date,'%Y-%m-%d') as startDateStr,DATE_FORMAT(u.end_date,'%Y-%m-%d') as endDateStr
         from out_user u
         left join sys_uptown_home uh on uh.phone = u.phone and uh.linkman = u.name
@@ -21,6 +21,35 @@
             <if test="phone != null and phone !=''">
                 and u.phone = #{phone}
             </if>
+            <if test="tuType != null and tuType !=''">
+                and u.tu_type = #{tuType}
+            </if>
+        </where>
+        order by u.time_update desc
+    </select>
+
+    <select id="getAllOutUserLY" resultType="com.bofeng.entity.OutUser">
+        select u.tu_id,ur.user_id as userId,su.uptown_name as uptownName,CONCAT(uu.ridgepole,uu.unit) as unit,u.name,u.phone,suh.doorplate,
+        DATE_FORMAT(u.start_date,'%Y-%m-%d') as startDateStr,DATE_FORMAT(u.end_date,'%Y-%m-%d') as endDateStr
+        from out_user u
+        left join sys_uptown_home uh on uh.phone = u.phone and uh.linkman = u.name
+        left join sys_user_role ur on ur.property_id = uh.house_id and ur.role_id = 1
+        left join sys_uptown_house suh on suh.house_id = uh.house_id
+        left join sys_uptown_unit uu on uu.unit_id = suh.unit_id
+        left join sys_uptown su on su.uptown_id = uu.uptown_id
+        <where>
+            <if test="queryProperties != null and queryProperties != ''">
+                (
+                suh.doorplate like concat('%',#{queryProperties},'%')
+                or u.name like concat('%',#{queryProperties},'%')
+                )
+            </if>
+            <if test="phone != null and phone !=''">
+                and u.phone = #{phone}
+            </if>
+            <if test="tuType != null and tuType !=''">
+                and u.tu_type = #{tuType}
+            </if>
         </where>
         order by u.time_update desc
     </select>

+ 175 - 94
whepi-web/src/main/resources/mapper/SweepCodeMapper.xml

@@ -2,111 +2,192 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.bofeng.dao.SweepCodeMapper">
     <select id="selectCode" resultType="com.bofeng.entity.SysUptownHouse">
-     select DISTINCT
-     a.uptown_name,
-     d.ridgepole,
-     d.unit,
-     e.doorplate,
-     b.door_name,
-     DATE_FORMAT(c.date,'%Y-%m-%d %H:%i:%s') as date,
-     c.in_type,
-     c.go_status as goStatus,
-     c.error_info as errorInfo,
-     g.linkman,
-     g.phone,
-     c.time_update
-     from out_scan c
-     inner join sys_user_role t on c.user_id = t.user_id and role_id =1
-     inner join sys_uptown_home g on g.house_id = t.property_id
-     inner join sys_uptown a on c.uptown_id = a.uptown_id
-     inner join sys_uptown_door b on c.door_id = b.door_id
-     inner join sys_uptown_house e on e.house_id = t.property_id
-     inner join sys_uptown_unit d on d.unit_id = e.unit_id
+        select DISTINCT
+        a.uptown_name,
+        d.ridgepole,
+        d.unit,
+        e.doorplate,
+        b.door_name,
+        DATE_FORMAT(c.date,'%Y-%m-%d %H:%i:%s') as date,
+        c.in_type,
+        c.go_status as goStatus,
+        c.error_info as errorInfo,
+        g.linkman,
+        g.phone,
+        c.time_update
+        from out_scan c
+        inner join sys_user_role t on c.user_id = t.user_id and role_id =1
+        inner join sys_uptown_home g on g.house_id = t.property_id
+        inner join sys_uptown a on c.uptown_id = a.uptown_id
+        inner join sys_uptown_door b on c.door_id = b.door_id
+        inner join sys_uptown_house e on e.house_id = t.property_id
+        inner join sys_uptown_unit d on d.unit_id = e.unit_id
         <where>
-         <if test="queryProperties != null and queryProperties != ''">
-          b.door_name like concat('%',#{queryProperties},'%')
-         </if>
-         <if test="uptownId != null and uptownId != ''">
-          and a.uptown_id = #{uptownId}
-         </if>
-         <if test="goStatus != null and goStatus !=''">
-          and c.go_status = #{goStatus}
-         </if>
-         <if test="dateSta != null and dateSta !=''">
-          and c.date >= #{dateSta}
-         </if>
-         <if test="dateEnd != null and dateEnd !=''">
-          and c.date &lt; #{dateEnd}
-         </if>
+            <if test="queryProperties != null and queryProperties != ''">
+                b.door_name like concat('%',#{queryProperties},'%')
+            </if>
+            <if test="uptownId != null and uptownId != ''">
+                and a.uptown_id = #{uptownId}
+            </if>
+            <if test="goStatus != null and goStatus !=''">
+                and c.go_status = #{goStatus}
+            </if>
+            <if test="dateSta != null and dateSta !=''">
+                and c.date >= #{dateSta}
+            </if>
+            <if test="dateEnd != null and dateEnd !=''">
+                and c.date &lt; #{dateEnd}
+            </if>
         </where>
-     order by c.time_update desc
+        order by c.time_update desc
     </select>
     <select id="selectLingyunUser" resultType="com.bofeng.entity.SysUptownHouse">
-     select
-     b.user_id,
-     a.linkman,
-     a.phone,
-     c.doorplate,
-     e.uptown_name,
-     concat(d.ridgepole,d.unit) as dept
-     from sys_uptown_home a
-     inner join sys_user_role b on a.house_id = b.property_id and b.role_id =1
-     inner join sys_uptown_house c on c.house_id = b.property_id
-     inner join sys_uptown_unit d on c.unit_id = d.unit_id
-     inner join sys_uptown e on e.uptown_id = d.uptown_id
+        select
+        b.user_id,
+        a.linkman,
+        a.phone,
+        c.doorplate,
+        e.uptown_name,
+        concat(d.ridgepole,d.unit) as dept
+        from sys_uptown_home a
+        inner join sys_user_role b on a.house_id = b.property_id and b.role_id =1
+        inner join sys_uptown_house c on c.house_id = b.property_id
+        inner join sys_uptown_unit d on c.unit_id = d.unit_id
+        inner join sys_uptown e on e.uptown_id = d.uptown_id
         <where>
-         <if test="queryProperties != null and queryProperties != ''">
-          (a.linkman like concat('%',#{queryProperties},'%')
-          or a.phone like concat('%',#{queryProperties},'%'))
-         </if>
-         <if test="uptownId != null and uptownId != ''">
-            and e.uptown_id = #{uptownId}
-         </if>
-         <if test="unitId != null and unitId != ''">
-            and d.unit_id = #{unitId}
-         </if>
+            <if test="queryProperties != null and queryProperties != ''">
+                (a.linkman like concat('%',#{queryProperties},'%')
+                or a.phone like concat('%',#{queryProperties},'%'))
+            </if>
+            <if test="uptownId != null and uptownId != ''">
+                and e.uptown_id = #{uptownId}
+            </if>
+            <if test="unitId != null and unitId != ''">
+                and d.unit_id = #{unitId}
+            </if>
         </where>
     </select>
     <select id="export" resultType="com.bofeng.entity.SysUptownHouse">
-     select DISTINCT
-     a.uptown_name,
-     d.ridgepole,
-     d.unit,
-     e.doorplate,
-     b.door_name,
-     DATE_FORMAT(c.date,'%Y-%m-%d %H:%i:%s') as date,
-     c.in_type,
-     c.go_status as goStatus,
-     c.error_info as errorInfo,
-     g.linkman,
-     g.phone,
-     c.time_update
-     from out_scan c
-     inner join sys_user_role t on c.user_id = t.user_id and role_id =1
-     inner join sys_uptown_home g on g.house_id = t.property_id
-     inner join sys_uptown a on c.uptown_id = a.uptown_id
-     inner join sys_uptown_door b on c.door_id = b.door_id
-     inner join sys_uptown_house e on e.house_id = t.property_id
-     inner join sys_uptown_unit d on d.unit_id = e.unit_id
+        select DISTINCT
+        a.uptown_name,
+        d.ridgepole,
+        d.unit,
+        e.doorplate,
+        b.door_name,
+        DATE_FORMAT(c.date,'%Y-%m-%d %H:%i:%s') as date,
+        c.in_type,
+        c.go_status as goStatus,
+        c.error_info as errorInfo,
+        g.linkman,
+        g.phone,
+        c.time_update
+        from out_scan c
+        inner join sys_user_role t on c.user_id = t.user_id and role_id =1
+        inner join sys_uptown_home g on g.house_id = t.property_id
+        inner join sys_uptown a on c.uptown_id = a.uptown_id
+        inner join sys_uptown_door b on c.door_id = b.door_id
+        inner join sys_uptown_house e on e.house_id = t.property_id
+        inner join sys_uptown_unit d on d.unit_id = e.unit_id
         <where>
-         <if test="queryProperties != null and queryProperties != ''">
-          b.door_name like concat('%',#{queryProperties},'%')
-         </if>
-         <if test="uptownId != null and uptownId != ''">
-          and a.uptown_id = #{uptownId}
-         </if>
-         <if test="goStatus != null and goStatus !=''">
-          and c.go_status = #{goStatus}
-         </if>
-         <if test="dateSta != null and dateSta !=''">
-          and c.date >= #{dateSta}
-         </if>
-         <if test="dateEnd != null and dateEnd !=''">
-          and c.date &lt; #{dateEnd}
-         </if>
+            <if test="queryProperties != null and queryProperties != ''">
+                b.door_name like concat('%',#{queryProperties},'%')
+            </if>
+            <if test="uptownId != null and uptownId != ''">
+                and a.uptown_id = #{uptownId}
+            </if>
+            <if test="goStatus != null and goStatus !=''">
+                and c.go_status = #{goStatus}
+            </if>
+            <if test="dateSta != null and dateSta !=''">
+                and c.date >= #{dateSta}
+            </if>
+            <if test="dateEnd != null and dateEnd !=''">
+                and c.date &lt; #{dateEnd}
+            </if>
         </where>
-     order by c.time_update desc
+        order by c.time_update desc
     </select>
 
 
+    <select id="selectCodeLY" resultType="com.bofeng.entity.SysUptownHouseLY">
+        select DISTINCT
+        a.uptown_name,
+        CONCAT(d.ridgepole,d.unit) as unit,
+        e.doorplate,
+        b.door_name,
+        DATE_FORMAT(c.date,'%Y-%m-%d %H:%i:%s') as date,
+        c.in_type,
+        c.go_status as goStatus,
+        c.error_info as errorInfo,
+        g.linkman,
+        g.phone,
+        c.time_update
+        from out_scan c
+        inner join sys_user_role t on c.user_id = t.user_id and role_id =1
+        inner join sys_uptown_home g on g.house_id = t.property_id
+        inner join sys_uptown a on c.uptown_id = a.uptown_id
+        inner join sys_uptown_door b on c.door_id = b.door_id
+        inner join sys_uptown_house e on e.house_id = t.property_id
+        inner join sys_uptown_unit d on d.unit_id = e.unit_id
+        <where>
+            a.uptown_id = 1238790987234
+            <if test="queryProperties != null and queryProperties != ''">
+                and b.door_name like concat('%',#{queryProperties},'%')
+            </if>
+            <if test="unitId != null and unitId != ''">
+                and d.unit_id = #{unitId}
+            </if>
+            <if test="goStatus != null and goStatus !=''">
+                and c.go_status = #{goStatus}
+            </if>
+            <if test="dateSta != null and dateSta !=''">
+                and c.date >= #{dateSta}
+            </if>
+            <if test="dateEnd != null and dateEnd !=''">
+                and c.date &lt; #{dateEnd}
+            </if>
+        </where>
+        order by c.time_update desc
+    </select>
+    <select id="exportLY" resultType="com.bofeng.entity.SysUptownHouseLY">
+        select DISTINCT
+        a.uptown_name,
+        CONCAT(d.ridgepole,d.unit) as unit,
+        e.doorplate,
+        b.door_name,
+        DATE_FORMAT(c.date,'%Y-%m-%d %H:%i:%s') as date,
+        c.in_type,
+        c.go_status as goStatus,
+        c.error_info as errorInfo,
+        g.linkman,
+        g.phone,
+        c.time_update
+        from out_scan c
+        inner join sys_user_role t on c.user_id = t.user_id and role_id =1
+        inner join sys_uptown_home g on g.house_id = t.property_id
+        inner join sys_uptown a on c.uptown_id = a.uptown_id
+        inner join sys_uptown_door b on c.door_id = b.door_id
+        inner join sys_uptown_house e on e.house_id = t.property_id
+        inner join sys_uptown_unit d on d.unit_id = e.unit_id
+        <where>
+            a.uptown_id = 1238790987234
+            <if test="queryProperties != null and queryProperties != ''">
+                and b.door_name like concat('%',#{queryProperties},'%')
+            </if>
+            <if test="unitId != null and unitId != ''">
+                and d.unit_id = #{unitId}
+            </if>
+            <if test="goStatus != null and goStatus !=''">
+                and c.go_status = #{goStatus}
+            </if>
+            <if test="dateSta != null and dateSta !=''">
+                and c.date >= #{dateSta}
+            </if>
+            <if test="dateEnd != null and dateEnd !=''">
+                and c.date &lt; #{dateEnd}
+            </if>
+        </where>
+        order by c.time_update desc
+    </select>
+
 </mapper>