فهرست منبع

凌云集团更改公司

peiguo 5 سال پیش
والد
کامیت
0607218ede

+ 110 - 86
admin-ui/app/whepi/daka/dakaLY.js

@@ -1,7 +1,7 @@
 define(function (require) {
     return function (context) {
 
-      var $grid1, $form;
+      var $grid1, $form, $coma;
 
       // 弹框的方式
       var widgets = {
@@ -15,13 +15,48 @@ define(function (require) {
         },
       }
 
+      // 下拉选清空并重新赋值
+      function reloadValuea(_datas) {
+        if ($coma) {
+          $coma.combobox('clear');// 清除当前的选项
+          $coma.combobox('loadData', _datas);// 重新加载数据
+        }
+      }
+
+      // 获取联机下拉选二级信息
+      function getList(id) {
+        id = id == undefined ? 0 : id
+        var _datas = [];
+        _datas.push({
+          "id": "",
+          "text": "全部",
+          "selected": true
+        });
+        $.yvan.ajax({
+          url: api('/home/getDepartmentIdLYepi.json?unitId=' + id),
+          method: 'GET',
+          async: true,
+          success: function (data) {
+            if (data.data != null && data.data != undefined) {
+              for (var i = 0; i < data.data.length; i++) {
+                _datas.push({
+                  "id": data.data[i].departmentId,
+                  "text": data.data[i].departmentName
+                })
+              }
+              reloadValuea(_datas);
+            }
+          }
+        });
+        return _datas;
+      }
 
       // 导出
       function exportExcel() {
         var queryForm = $form.formGet();
         $.yvan.download({
           method: 'post',
-          url: api('/sweepCode/exportLY?queryProperties=' + queryForm.queryProperties + '&errorInfo=' + queryForm.errorInfo  + '&phone=' + queryForm.phone + '&unitId=' + queryForm.unitId + '&goStatus=' + queryForm.goStatus + '&dateSta=' + queryForm.dateSta + '&dateEnd=' + queryForm.dateEnd),
+          url: api('/clock/exSelectClockLY?phone=' + queryForm.phone + '&unitId=' + queryForm.unitId + '&departmentId=' + queryForm.departmentId + '&dateSta=' + queryForm.dateSta + '&dateEnd=' + queryForm.dateEnd),
           fileName: '签到管理-' + $.yvan.getMoment().format('YYYY-MM-DD HH:mm:ss') + '.xlsx'
 
         });
@@ -52,7 +87,7 @@ define(function (require) {
 
       // 检索条件查询
       function queryGrid1() {
-        var queryUrl = '/sweepCode/selectCodeLY';// 自行替换此参数
+        var queryUrl = '/clock/selectClockLY';// 自行替换此参数
         var queryForm = $form.formGet();
         if (!queryForm.dateSta) {
           $form.formSet({dateSta: getFormatDate() + " 00:00:00"});
@@ -98,14 +133,14 @@ define(function (require) {
         },
         xtype: 'form',
         items: [[
-          {
-            xtype: 'textbox',
-            label: '大门名称',
-            name: 'queryProperties',
-            prompt: "大门名称",
-            labelWidth: 'auto',
-            events: {keydown: enterQueryGrid1}, width: 250
-          },
+          // {
+          //   xtype: 'textbox',
+          //   label: '大门名称',
+          //   name: 'queryProperties',
+          //   prompt: "大门名称",
+          //   labelWidth: 'auto',
+          //   events: {keydown: enterQueryGrid1}, width: 250
+          // },
           {
             xtype: 'textbox',
             label: '姓名/电话',
@@ -126,42 +161,61 @@ define(function (require) {
             onChange: function (value) {
               if (!isNotNullOrEmpty(value)) {
                 $form.formSet({
-                  unitId: ''
+                  unitId: 0
                 })
               }
+              var unitId = $form.formGet().unitId;
+              getList($form.formGet().unitId);
               queryGrid1();
             },
+          },
+          {
+            xtype: 'combobox',
+            label: '二级部门',
+            name: 'departmentId',
+            labelWidth: 'auto',
+            width: 280,
+            value: '',
+            data: getList(),
+            onRender: function () {
+              $coma = $(this);
+            },
+            onValue: function (data) {
+            },
+            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;
-          //      }*/
-          //   }
-          // }
+          {
+            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;
+               }*/
+            }
+          }
         ]]
       };
 
@@ -180,7 +234,7 @@ define(function (require) {
 
       return {
         north: {
-          height: 88,
+          height: 132,
           /* split: true,
            border: false,*///底框是否可变动
           items: [
@@ -209,10 +263,7 @@ define(function (require) {
                     // {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: 'departmentName', title: '二级部门', maxWidth: 200, align: 'left',},
                     {
                       field: 'linkman',
                       title: '用户名',
@@ -222,49 +273,22 @@ define(function (require) {
                       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: 'doorplate',
+                      title: '工号', maxWidth: 200,
                     },
+                    // {
+                    //   field: 'doorName',
+                    //   title: '出入大门',
+                    //   align: 'left',
+                    // },
                     {
-                      field: 'errorInfo',
-                      title: '禁止提示',
+                      field: 'dateStr',
+                      title: '签到时间',
                       align: 'left',
                     },
-                    {field: 'longitude', title: '经度', maxWidth: 200, align: 'left',},
-                    {field: 'latitude', title: '纬度', maxWidth: 200, align: 'left',},
-                    {field: 'address', title: '详细地址', maxWidth: 200, align: 'left',},
+                    // {field: 'longitude', title: '经度', maxWidth: 200, align: 'left',},
+                    // {field: 'latitude', title: '纬度', maxWidth: 200, align: 'left',},
+                    // {field: 'address', title: '详细地址', maxWidth: 200, align: 'left',},
                   ]
                 ]
             }

+ 1 - 1
admin-ui/app/whepi/mock/menu.json

@@ -77,7 +77,7 @@
         {
           "id": "ENT101002",
           "text": "凌云签到信息",
-          "href": "/app/whepi/daka/dakaLY.js",
+          "href": "/app/whepi/clock/clock.js",
           "iconCls": "icon-blank fa fa-align-justify",
           "state": "close",
           "children": []

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

@@ -21,7 +21,7 @@
     {
       "id": "ENT10003",
       "text": "凌云签到信息",
-      "href": "/app/whepi/daka/dakaLY2.js",
+      "href": "/app/whepi/clock/clock.js",
       "iconCls": "icon-blank fa fa-align-justify",
       "state": "close",
       "children": []

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

@@ -1,5 +1,6 @@
 package com.bofeng.dao;
 
+import com.bofeng.entity.OutScanClock;
 import com.bofeng.entity.SysUptownHouse;
 import com.bofeng.entity.SysUptownHouseLY;
 import com.yvan.PageDb;
@@ -21,4 +22,7 @@ public interface SweepCodeMapper {
 
     List<SysUptownHouseLY> selectCodeHC(PageDb pageDb, Map<String, Object> queryParam);
     List<SysUptownHouseLY> exportHC(Map<String, Object> queryParam);
+
+    List<OutScanClock> selectClockLY(PageDb pageDb, Map<String, Object> queryParam);
+    List<OutScanClock> exSelectClockLY(Map<String, Object> queryParam);
 }

+ 105 - 0
whepi-web/src/main/java/com/bofeng/entity/OutScanClock.java

@@ -0,0 +1,105 @@
+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.Getter;
+import lombok.Setter;
+import org.joda.time.DateTime;
+
+import java.util.Date;
+
+/**
+ * 用户外出扫码信息
+ */
+@Getter
+@Setter
+@TableName("out_scan")
+public class OutScanClock {
+
+    @ApiModelProperty("扫码ID")
+    @TableId("scan_id")
+    private Long scanId;
+
+    @ApiModelProperty("用户ID")
+    @TableField("user_id")
+    private Long userId;
+
+    @ApiModelProperty("小区ID")
+    @TableField("uptown_id")
+    private Long uptownId;
+
+    @ApiModelProperty("小区大门ID")
+    @TableField("door_id")
+    private Long doorId;
+
+    @ApiModelProperty("进出状态:1进,2出")
+    @TableField("in_type")
+    private Integer inType;
+
+    @ApiModelProperty("当天时间")
+    @TableField("day_date")
+    private Date dayDate;
+
+    @ApiModelProperty("进出时间")
+    @TableField("date")
+    private DateTime date;
+
+    @ApiModelProperty("经度")
+    @TableField("longitude")
+    private String longitude;
+
+    @ApiModelProperty("纬度")
+    @TableField("latitude")
+    private String latitude;
+
+    @ApiModelProperty("详细地址")
+    @TableField("address")
+    private String address;
+
+    @ApiModelProperty("通行状态:1允许,-1禁止")
+    @TableField("go_status")
+    private Integer goStatus;
+
+    @ApiModelProperty("错误信息")
+    @TableField("error_info")
+    private String errorInfo;
+
+    @TableField("user_create")
+    private Long userCreate;
+
+    @TableField(exist = false)
+    private DateTime timeCreate;
+
+    @TableField("user_update")
+    private Long userUpdate;
+
+    @TableField(exist = false)
+    private DateTime timeUpdate;
+
+    @ExcelProperty(value = "部门", index = 0)
+    @TableField(exist = false)
+    private String unit;
+
+    @ExcelProperty(value = "二级部门", index = 1)
+    @TableField(exist = false)
+    private String departmentName;
+
+    @ExcelProperty(value = "用户名", index = 2)
+    @TableField(exist = false)
+    private String linkman;
+
+    @ExcelProperty(value = "电话", index = 3)
+    @TableField(exist = false)
+    private String phone;
+
+    @ExcelProperty(value = "工号", index = 4)
+    @TableField(exist = false)
+    private String doorplate;
+
+    @ExcelProperty(value = "签到时间", index = 5)
+    @TableField(exist = false)
+    private String dateStr;
+}

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

@@ -297,6 +297,18 @@ public class SweepCodeService {
         return sysUptownHouses;
     }
 
+    public List<OutScanClock> selectClockLY(PageDb pageDb, Map<String, Object> queryParam) {
+        queryParam.put("uptownId", 1238790987234L);
+        List<OutScanClock> list = sweepCodeMapper.selectClockLY(pageDb,queryParam);
+        return list;
+    }
+
+    public List<OutScanClock> exSelectClockLY(Map<String, Object> queryParam) {
+        queryParam.put("uptownId", 1238790987234L);
+        List<OutScanClock> list = sweepCodeMapper.exSelectClockLY(queryParam);
+        return list;
+    }
+
     public List<OutScanEstate> selectXunJian(PageDb pageDb, Map<String, Object> queryParam) {
         List<OutScanEstate> outScanEstates = outScanEstateMapper.selectXunJian(pageDb,queryParam);
         return outScanEstates;

+ 16 - 0
whepi-web/src/main/java/com/bofeng/wx/controller/ScanAdminController.java

@@ -514,6 +514,22 @@ public class ScanAdminController {
         ExcelUtils.writeSheet(ReturnWorkLy.class, list).export(resp,"凌云集团正常复工员工" + sdf.format(new Date()));
     }
 
+    @ApiOperation("凌云签到")
+    @PostMapping("/whepi/clock/selectClockLY")
+    public Model<List<OutScanClock>> selectClockLY(PageDb pageDb,HttpParameterParser parser) {
+        List<OutScanClock> sysUptownHouses = sweepCodeService.selectClockLY(pageDb,parser.getMap());
+        return Model.newSuccess(pageDb,sysUptownHouses);
+    }
+
+    @ApiOperation("凌云签到导出")
+    @PostMapping("/whepi/clock/exSelectClockLY")
+    @SneakyThrows
+    public void exSelectClockLY(HttpParameterParser parser,HttpServletResponse resp) {
+        List<OutScanClock> list = sweepCodeService.exSelectClockLY(parser.getMap());
+        ExcelUtils.writeSheet(OutScanClock.class, list).export(resp,"出入管理");
+    }
+
+
     // 获取code
     private static final String oauth2 = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=";
     private static final String moreUrl = "&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect";

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

@@ -185,7 +185,7 @@ public class ScanController {
                     }
                     Boolean ly2 = false;
                     String startDate = "";
-                    Integer intSize = 4;
+                    Integer intSize = 3;
                     SimpleDateFormat s = new SimpleDateFormat("yyyy-MM-dd");
                     OutUser outUser2 = outUserMapper.getOutUserByPhoneNotTime(5, uptownHomes.get(0).getLinkman(), Long.parseLong(uptownHomes.get(0).getPhone()));
                     if (outUser2 != null) {
@@ -252,7 +252,7 @@ public class ScanController {
                         model.put("collor", "red");
                         model.put("collor2", "red");
                         model.put("into", "不许进入");
-                        model.put("errorMsg", "由于您今日和前3日未连续报告日报,不许进入,如有疑问请联系直管领导。");
+                        model.put("errorMsg", "由于您前3日未连续报告日报,不许进入,如有疑问请联系直管领导。");
                         scanService.saveOutScan(userOpen.getUserId(), inType, coord, address, uptownDoor.getUptownId(), uptownDoor.getDoorId(), -1, model.get("errorMsg").toString());
                         return new ModelAndView("/user/scan.ftl", model);
                     }
@@ -373,7 +373,7 @@ public class ScanController {
                         model.put("collor", "red");
                         model.put("collor2", "red");
                         model.put("into", "不许进入");
-                        model.put("errorMsg", "由于您今日和前3日未连续报告日报,不许进入,如有疑问请联系直管领导。");
+                        model.put("errorMsg", "由于您前3日未连续报告日报,不许进入,如有疑问请联系直管领导。");
                         scanService.saveOutScan(userOpen.getUserId(), inType, coord, address, uptownDoor.getUptownId(), uptownDoor.getDoorId(), -1, model.get("errorMsg").toString());
                         return new ModelAndView("/user/scanHC.ftl", model);
                     }
@@ -668,7 +668,7 @@ public class ScanController {
             }
             Boolean ly2 = false;
             String startDate = "";
-            int intSize = 4;
+            int intSize = 3;
             OutUser outUser2 = outUserMapper.getOutUserByPhoneNotTime(5, uptownHomes.get(0).getLinkman(), Long.parseLong(uptownHomes.get(0).getPhone()));
             if (outUser2 != null) {
                 ly2 = true;
@@ -721,7 +721,7 @@ public class ScanController {
                 model.put("collor", "red");
                 model.put("collor2", "red");
                 model.put("into", "不可复工");
-                model.put("errorMsg", "由于您今日和前3日未连续报告日报,不可复工,如有疑问请联系直管领导。");
+                model.put("errorMsg", "由于您前3日未连续报告日报,不可复工,如有疑问请联系直管领导。");
                 return new ModelAndView("/user/returnWork.ftl", model);
             }
             List<MsReport> msReports2 = msReportMapper.selectMsReportThereError(userId, startDate);
@@ -821,7 +821,7 @@ public class ScanController {
                 model.put("collor", "red");
                 model.put("collor2", "red");
                 model.put("into", "不可复工");
-                model.put("errorMsg", "由于您今日和前3日未连续报告日报,不可复工,如有疑问请联系直管领导。");
+                model.put("errorMsg", "由于您前3日未连续报告日报,不可复工,如有疑问请联系直管领导。");
                 return new ModelAndView("/user/returnWorkHC.ftl", model);
             }
             List<MsReport> msReports2 = msReportMapper.selectMsReportThereError(userId,"");

+ 7 - 8
whepi-web/src/main/java/com/bofeng/wx/controller/UserOpenController.java

@@ -68,17 +68,16 @@ public class UserOpenController {
                              @RequestParam(value = "userType", required = false, defaultValue = "0") Integer userType) throws JsonProcessingException {
         List<UserRole> list = new ArrayList<>();
         if (userId == 0) {
-//            UserOpen userOpen = homeService.getUserOpen();
-//            if (userOpen == null) {
-//                return null;
-//            }
-//            list = userRoleMapper.getUserRoleByUserId(userOpen.getUserId());
-            list = userRoleMapper.getUserRoleByUserId(1228565481837944834L);
-            UserOpen userOpen = userOpenMapper.selectByUserId(1228565481837944834L);
+            UserOpen userOpen = homeService.getUserOpen();
+            if (userOpen == null) {
+                return null;
+            }
+            list = userRoleMapper.getUserRoleByUserId(userOpen.getUserId());
+//            list = userRoleMapper.getUserRoleByUserId(1228565481837944834L);
+//            UserOpen userOpen = userOpenMapper.selectByUserId(1228565481837944834L);
             userId = userOpen.getUserId();
             model.put("user", userOpen);
             model.put("user_id", "\"" + userOpen.getUserId() + "\"");
-
             List<Uptown> uptowns = rbMapper.selectUptown(userId);
             if (uptowns != null && uptowns.size() > 0) {
                 Long uptown_id = uptowns.get(0).getUptownId();

+ 32 - 6
whepi-web/src/main/resources/mapper/MsReport.xml

@@ -71,6 +71,21 @@
         </where>
     </select>
 
+
+<!--    select * from (-->
+<!--    select * from ms_report where report_status=1 and report_date=date_sub(curdate(),interval 1 day) and user_create=#{userId}-->
+<!--    union-->
+<!--    select * from ms_report where report_status=1 and report_date=date_sub(curdate(),interval 2 day) and user_create=#{userId}-->
+<!--    union-->
+<!--    select * from ms_report where report_status=1 and report_date=date_sub(curdate(),interval 3 day) and user_create=#{userId}-->
+<!--    union-->
+<!--    select * from ms_report where report_status=1 and report_date=curdate() and user_create=#{userId}-->
+<!--    ) aa-->
+<!--    <where>-->
+<!--        <if test="reportDate!=null and reportDate!=''">-->
+<!--            aa.report_date > #{reportDate}-->
+<!--        </if>-->
+<!--    </where>-->
     <select id="selectMsReportLate" resultType="com.bofeng.entity.MsReport">
         select * from (
             select * from ms_report where report_status=1 and report_date=date_sub(curdate(),interval 1 day) and user_create=#{userId}
@@ -78,8 +93,6 @@
             select * from ms_report where report_status=1 and report_date=date_sub(curdate(),interval 2 day) and user_create=#{userId}
             union
             select * from ms_report where report_status=1 and report_date=date_sub(curdate(),interval 3 day) and user_create=#{userId}
-            union
-            select * from ms_report where report_status=1 and report_date=curdate() and user_create=#{userId}
         ) aa
         <where>
             <if test="reportDate!=null and reportDate!=''">
@@ -88,11 +101,24 @@
         </where>
     </select>
 
+<!--    select * from (-->
+<!--    select * from ms_report where report_status=1 and report_date=date_sub(curdate(),interval 1 day) and user_create=#{userId}-->
+<!--    union select * from ms_report where report_status=1 and report_date=date_sub(curdate(),interval 2 day) and user_create=#{userId}-->
+<!--    union select * from ms_report where report_status=1 and report_date=date_sub(curdate(),interval 3 day) and user_create=#{userId}-->
+<!--    union select * from ms_report where report_status=1 and report_date=curdate() and user_create=#{userId}-->
+<!--    ) aa-->
+<!--    <where>-->
+<!--        aa.ms_status = 2-->
+<!--        <if test="reportDate!=null and reportDate!=''">-->
+<!--            and aa.report_date > #{reportDate}-->
+<!--        </if>-->
+<!--    </where>-->
     <select id="selectMsReportThereError" resultType="com.bofeng.entity.MsReport">
-        select * from (select * from ms_report where report_status=1 and report_date=date_sub(curdate(),interval 1 day) and user_create=#{userId}
-        union select * from ms_report where report_status=1 and report_date=date_sub(curdate(),interval 2 day) and user_create=#{userId}
-        union select * from ms_report where report_status=1 and report_date=date_sub(curdate(),interval 3 day) and user_create=#{userId}
-        union select * from ms_report where report_status=1 and report_date=curdate() and user_create=#{userId}) aa
+        select * from (
+           select * from ms_report where report_status=1 and report_date=date_sub(curdate(),interval 1 day) and user_create=#{userId}
+           union select * from ms_report where report_status=1 and report_date=date_sub(curdate(),interval 2 day) and user_create=#{userId}
+           union select * from ms_report where report_status=1 and report_date=date_sub(curdate(),interval 3 day) and user_create=#{userId}
+        ) aa
         <where>
             aa.ms_status = 2
             <if test="reportDate!=null and reportDate!=''">

+ 85 - 0
whepi-web/src/main/resources/mapper/SweepCodeMapper.xml

@@ -339,4 +339,89 @@
         order by c.time_update desc
     </select>
 
+    <select id="selectClockLY" resultType="com.bofeng.entity.OutScanClock">
+        SELECT DISTINCT
+        a.uptown_name,
+        CONCAT( d.ridgepole, d.unit ) AS unit,
+        e.doorplate,
+        DATE_FORMAT( c.dateStr, '%Y-%m-%d %H:%i:%s' ) AS dateStr,
+        g.linkman,
+        g.phone,
+        de.department_name AS departmentName
+        FROM
+            (select user_id,min(cast(date as datetime)) as dateStr
+            from out_scan
+            where uptown_id = #{uptownId} and go_status = 1 and in_type = 1
+            <if test="dateSta != null and dateSta !=''">
+                and date >= #{dateSta}
+            </if>
+            <if test="dateEnd != null and dateEnd !=''">
+                and date &lt; #{dateEnd}
+            </if>
+            group by user_id,cast(date as date)
+            ) 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 a.uptown_id = #{uptownId}
+        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
+        LEFT JOIN sys_department de ON de.department_id = e.department_id
+        <where>
+            <if test="phone != null and phone != ''">
+                and (g.linkman like concat('%',#{phone},'%')
+                or g.phone = #{phone} )
+            </if>
+            <if test="unitId != null and unitId != ''">
+                and d.unit_id = #{unitId}
+            </if>
+            <if test="departmentId != null and departmentId != ''">
+                and de.department_id = #{departmentId}
+            </if>
+        </where>
+        ORDER BY dateStr DESC
+    </select>
+    <select id="exSelectClockLY" resultType="com.bofeng.entity.OutScanClock">
+        SELECT DISTINCT
+        a.uptown_name,
+        CONCAT( d.ridgepole, d.unit ) AS unit,
+        e.doorplate,
+        DATE_FORMAT( c.dateStr, '%Y-%m-%d %H:%i:%s' ) AS dateStr,
+        g.linkman,
+        g.phone,
+        de.department_name AS departmentName
+        FROM
+        (select user_id,min(cast(date as datetime)) as dateStr
+        from out_scan
+        where uptown_id = #{uptownId} and go_status = 1 and in_type = 1
+        <if test="dateSta != null and dateSta !=''">
+            and date >= #{dateSta}
+        </if>
+        <if test="dateEnd != null and dateEnd !=''">
+            and date &lt; #{dateEnd}
+        </if>
+        group by user_id,cast(date as date)
+        ) 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 a.uptown_id = #{uptownId}
+        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
+        LEFT JOIN sys_department de ON de.department_id = e.department_id
+        <where>
+            <if test="phone != null and phone != ''">
+                and (g.linkman like concat('%',#{phone},'%')
+                or g.phone = #{phone} )
+            </if>
+            <if test="unitId != null and unitId != ''">
+                and d.unit_id = #{unitId}
+            </if>
+            <if test="departmentId != null and departmentId != ''">
+                and de.department_id = #{departmentId}
+            </if>
+        </where>
+        ORDER BY dateStr DESC
+    </select>
+
 </mapper>