| @@ -40,4 +40,10 @@ public interface RemoteStaffService { | |||
| @PostMapping(value = "/staff/inner-api/new-staff") | |||
| @ResponseBody | |||
| public com.alibaba.fastjson2.JSONObject addStaff(@RequestBody DmStaffCommonDto commonDto,@RequestHeader(SecurityConstants.ENTERPRISE_ID) Long enterpriseId, @RequestHeader(SecurityConstants.SOURCE_NAME) String sourceName, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); | |||
| @GetMapping("/staff/api/broadcast-staff-count") | |||
| JSONObject queryStaffCount(@RequestHeader(SecurityConstants.ENTERPRISE_ID) Long enterpriseId, @RequestHeader(SecurityConstants.SOURCE_NAME) String sourceName, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); | |||
| @GetMapping("/staff/api/staff-count") | |||
| JSONObject staffCount(); | |||
| } | |||
| @@ -48,6 +48,10 @@ public class RedisUtil { | |||
| return redisTemplate.opsForList().range(key, 0, -1); | |||
| } | |||
| public static List<Object> getObjectList(String key) { | |||
| return redisTemplate.opsForHash().values(key); | |||
| } | |||
| public static Long getListCount(String key) { | |||
| return redisTemplate.opsForList().size(key); | |||
| } | |||
| @@ -89,4 +93,8 @@ public class RedisUtil { | |||
| } | |||
| public static Object getHashChildItem(String key, String childKey){ | |||
| return redisTemplate.opsForHash().get(key, childKey); | |||
| } | |||
| } | |||
| @@ -44,6 +44,7 @@ import org.springframework.web.bind.annotation.RequestParam; | |||
| import org.springframework.web.bind.annotation.ResponseBody; | |||
| import org.springframework.web.bind.annotation.RestController; | |||
| import javax.servlet.http.HttpServletRequest; | |||
| import javax.servlet.http.HttpServletResponse; | |||
| import java.util.ArrayList; | |||
| import java.util.Arrays; | |||
| @@ -293,15 +294,15 @@ public class ApiController { | |||
| return AjaxResult.success(System.currentTimeMillis() - Long.parseLong(timestamp) > 10 * 60 * 1000 ? InitConstants.DEVICE_ACTIVATE_STATUS_OFFLINE : InitConstants.DEVICE_ACTIVATE_STATUS_ONLINE); | |||
| } | |||
| @RequestMapping(value = "/test", method = {RequestMethod.GET} ) | |||
| @ResponseBody | |||
| public R<JSONObject> test(HttpServletRequest request) { | |||
| return mansInfo(); | |||
| } | |||
| public R<JSONObject> mansInfo() { | |||
| Long serviceTimeCount = 0L; | |||
| /*List<DmManDeviceDto> dtos = dmManDeviceService.selectList(new DmManDeviceQuery()); | |||
| List<DmManDeviceDto> dtos2 = dtos.stream().filter(dto -> StringUtils.isNotEmpty(dto.getDeviceId())).collect(Collectors.toList());;*/ | |||
| //当前时间和activateTime时间的差值,activateTime类型是Date,差值返回的单位是小时 | |||
| /*for (DmManDeviceDto dto : dtos2) { | |||
| serviceTimeCount += (System.currentTimeMillis() - dto.getActivateTime().getTime())/3600000; | |||
| }*/ | |||
| Integer meetingServiceCount = RedisUtil.getNumberVal("dashboard:meeting"); | |||
| Integer serverTimes = RedisUtil.getNumberVal("dashboard:server"); | |||
| @@ -331,13 +332,20 @@ public class ApiController { | |||
| //取值后清除缓存list,5秒后过期 | |||
| // RedisUtil.expire("dashboard:skill-consume", 5); | |||
| } | |||
| Long onlineCount = 4L; | |||
| /*if (RedisUtil.existed(MessageConstants.REDIS_GROUP_DEVICE_HEADER)) { | |||
| List<Object> manDeviceDtos = (List<Object>)redisTemplate.opsForHash().values(MessageConstants.REDIS_GROUP_DEVICE_HEADER); | |||
| onlineCount = manDeviceDtos.stream().filter(item->(!((DmManDeviceDto)item).getOnlineStatus().isEmpty()) && | |||
| ((DmManDeviceDto)item).getOnlineStatus().equalsIgnoreCase("1")).count(); | |||
| log.info("devs:{}, onlineCount:{}",manDeviceDtos.size(), onlineCount); | |||
| }*/ | |||
| Long onlineCount = 0L; | |||
| if (RedisUtil.existed(MessageConstants.REDIS_GROUP_DEVICE_HEADER)) { | |||
| List<Object> hashVals = RedisUtil.getObjectList(MessageConstants.REDIS_GROUP_DEVICE_HEADER); | |||
| List<DmManDeviceDto> dtos = hashVals.stream().map(item->(DmManDeviceDto)item).collect(Collectors.toList()); | |||
| onlineCount = dtos.stream().filter(item->(!item.getOnlineStatus().isEmpty()) && | |||
| item.getOnlineStatus().equalsIgnoreCase("1")).count(); | |||
| List<DmManDeviceDto> dtos2 = dtos.stream().filter(item->item.getActivateTime() != null).collect(Collectors.toList()); | |||
| for(DmManDeviceDto item:dtos2) { | |||
| serviceTimeCount += (System.currentTimeMillis() - item.getActivateTime().getTime())/3600000; | |||
| } | |||
| log.info("devs:{}, onlineCount:{}",dtos.size(), onlineCount); | |||
| } | |||
| JSONArray jsonArray = new JSONArray(); | |||
| // 最近三十天的数据,服务人次,知识库增量 | |||
| @@ -356,7 +364,7 @@ public class ApiController { | |||
| json.put("manOnlineCount",onlineCount);//数字人数 | |||
| json.put("recognizedPersonCount", recognition);//注册人员总数 | |||
| json.put("serviceTimeCount",serviceTimeCount);//总服务时间 | |||
| json.put("staffTotalCount",1062);//总服务时间 | |||
| json.put("staffTotalCount",remoteStaffService.staffCount().getLongValue("data"));//总服务时间 | |||
| json.put("chatTimes",conversationTimes);//对话次数 | |||
| json.put("chatDurationCount",conversationDuration);//对话时长 | |||
| @@ -1,6 +1,5 @@ | |||
| package com.xueyi.system.digitalmans.controller; | |||
| import com.alibaba.fastjson2.JSONArray; | |||
| import com.alibaba.fastjson2.JSONObject; | |||
| import com.baomidou.mybatisplus.core.toolkit.StringUtils; | |||
| import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||
| @@ -12,10 +11,8 @@ import com.xueyi.common.core.web.result.AjaxResult; | |||
| import com.xueyi.common.core.web.result.R; | |||
| import com.xueyi.common.core.web.validate.V_A; | |||
| import com.xueyi.common.core.web.validate.V_E; | |||
| import com.xueyi.common.datasource.annotation.Master; | |||
| import com.xueyi.common.log.annotation.Log; | |||
| import com.xueyi.common.log.enums.BusinessType; | |||
| import com.xueyi.common.redis.utils.RedisUtil; | |||
| import com.xueyi.common.security.annotation.InnerAuth; | |||
| import com.xueyi.common.security.annotation.RequiresPermissions; | |||
| import com.xueyi.common.web.entity.controller.BaseController; | |||
| @@ -35,7 +32,6 @@ import com.xueyi.system.digitalmans.domain.dto.DmDigitalmanExtDto; | |||
| import com.xueyi.system.digitalmans.domain.model.DmDigitalmanExtConverter; | |||
| import com.xueyi.system.digitalmans.domain.query.DmDigitalmanExtQuery; | |||
| import com.xueyi.system.digitalmans.domain.query.DmDigitalmanQuery; | |||
| import com.xueyi.system.digitalmans.domain.query.DmManDeviceQuery; | |||
| import com.xueyi.system.digitalmans.mapper.DmManDeviceMapper; | |||
| import com.xueyi.system.digitalmans.service.IDmDigitalmanExtService; | |||
| import com.xueyi.system.digitalmans.service.IDmDigitalmanService; | |||
| @@ -67,10 +63,7 @@ import org.springframework.web.bind.annotation.RestController; | |||
| import java.io.Serializable; | |||
| import java.text.ParseException; | |||
| import java.time.Duration; | |||
| import java.util.ArrayList; | |||
| import java.util.Date; | |||
| import java.util.List; | |||
| import java.util.stream.Collectors; | |||
| /** | |||
| * 数字人基础管理 业务处理 | |||
| @@ -395,86 +388,6 @@ public class DmDigitalmanController extends BaseController<DmDigitalmanQuery, Dm | |||
| DmManDeviceServiceImpl dmManDeviceService; | |||
| @GetMapping("/api/mansInfo") | |||
| @Master | |||
| public R<JSONObject> mansInfo() { | |||
| List<DmManDeviceDto> dtos = dmManDeviceService.selectList(new DmManDeviceQuery()); | |||
| List<DmManDeviceDto> dtos2 = dtos.stream().filter(dto -> StringUtils.isNotEmpty(dto.getDeviceId())).collect(Collectors.toList());; | |||
| Long serviceTimeCount = 0L; | |||
| //当前时间和activateTime时间的差值,activateTime类型是Date,差值返回的单位是小时 | |||
| for (DmManDeviceDto dto : dtos2) { | |||
| serviceTimeCount += (System.currentTimeMillis() - dto.getActivateTime().getTime())/3600000; | |||
| } | |||
| Integer meetingServiceCount = RedisUtil.getNumberVal("dashboard:meeting"); | |||
| Integer serverTimes = RedisUtil.getNumberVal("dashboard:server"); | |||
| Integer recognition = RedisUtil.getNumberVal("dashboard:recognition"); | |||
| Integer receptionCount = RedisUtil.getNumberVal("dashboard:create_visitor_info"); | |||
| Integer visitorCount = RedisUtil.getNumberVal("dashboard:register_visitor"); | |||
| Integer attendanceCount = RedisUtil.getNumberVal("dashboard:attendance"); | |||
| Integer openDoorCount = RedisUtil.getNumberVal("dashboard:open_door"); | |||
| Integer conversationDuration = RedisUtil.getNumberVal("dashboard:conversation-duration"); | |||
| Integer conversationTimes = RedisUtil.getNumberVal("dashboard:conversation-times"); | |||
| Integer broadcastCount = RedisUtil.getNumberVal("dashboard:broadcast-count"); | |||
| List<JSONObject> knowledgeList = new ArrayList<>(); | |||
| if (RedisUtil.existed("dashboard:knowledge-consume")) { | |||
| knowledgeList = RedisUtil.getJsonList("dashboard:knowledge-consume"); | |||
| //取值后清除缓存list,5秒后过期 | |||
| // RedisUtil.expire("dashboard:knowledge-consume", 5); | |||
| } | |||
| List<JSONObject> skillList = new ArrayList<>(); | |||
| if (RedisUtil.existed("dashboard:skill-consume")) { | |||
| skillList = RedisUtil.getJsonList("dashboard:skill-consume"); | |||
| //取值后清除缓存list,5秒后过期 | |||
| // RedisUtil.expire("dashboard:skill-consume", 5); | |||
| } | |||
| Long onlineCount = 0L; | |||
| if (RedisUtil.existed(MessageConstants.REDIS_GROUP_DEVICE_HEADER)) { | |||
| List<Object> manDeviceDtos = (List<Object>)redisTemplate.opsForHash().values(MessageConstants.REDIS_GROUP_DEVICE_HEADER); | |||
| onlineCount = manDeviceDtos.stream().filter(item->(!((DmManDeviceDto)item).getOnlineStatus().isEmpty()) && | |||
| ((DmManDeviceDto)item).getOnlineStatus().equalsIgnoreCase("1")).count(); | |||
| log.info("devs:{}, onlineCount:{}",manDeviceDtos.size(), onlineCount); | |||
| } | |||
| JSONArray jsonArray = new JSONArray(); | |||
| // 最近三十天的数据,服务人次,知识库增量 | |||
| for (int i = 0; i < 30; i++) { | |||
| Date date = DateUtils.addDays(new Date(), -i); | |||
| String dateStr2 = DateUtils.formatDate(date, "yyyy-MM-dd"); | |||
| JSONObject json2 = new JSONObject(); | |||
| json2.put("date", dateStr2); | |||
| json2.put("serviceTimes", RedisUtil.getNumberVal("dashboard:server-chart:"+dateStr2)); | |||
| json2.put("knowledgeNums", RedisUtil.getNumberVal("dashboard:server-chart:"+dateStr2)); | |||
| jsonArray.add(json2); | |||
| } | |||
| JSONObject json = new JSONObject(); | |||
| json.put("manCount",dtos2.size());//数字人数 | |||
| json.put("manOnlineCount",onlineCount);//数字人数 | |||
| json.put("recognizedPersonCount", recognition);//注册人员总数 | |||
| json.put("serviceTimeCount",serviceTimeCount);//总服务时间 | |||
| json.put("chatTimes",conversationTimes);//对话次数 | |||
| json.put("chatDurationCount",conversationDuration);//对话时长 | |||
| json.put("servicePerCount",serverTimes);//用户使用频次?改成服务人次 | |||
| json.put("serviceTotal",meetingServiceCount+receptionCount+visitorCount+attendanceCount+openDoorCount+broadcastCount); | |||
| json.put("meetingServiceCount", meetingServiceCount);//会议 | |||
| json.put("receptionCount",receptionCount);//接待 | |||
| json.put("visitorCount",visitorCount);//访客 | |||
| json.put("attendanceCount",attendanceCount);//考勤 | |||
| json.put("openDoorCount",openDoorCount);//门禁 | |||
| json.put("broadcastCount",broadcastCount);//播报 | |||
| json.put("knowledgeConsume",knowledgeList);//实时知识库调用 | |||
| json.put("skillConsume",skillList);//实时技能调用 | |||
| json.put("serverCharts",jsonArray);// | |||
| log.info(json.toJSONString()); | |||
| return R.ok(json); | |||
| } | |||
| @GetMapping("/api/devInfo/{devId}") | |||
| public R<DmDigitalmanExtPo> devInfo(@PathVariable(required = true) String devId) { | |||
| if (StringUtils.isNotEmpty(devId)){ | |||
| @@ -1,11 +1,22 @@ | |||
| package com.xueyi.system.staff.controller.api; | |||
| import com.alibaba.fastjson2.JSONObject; | |||
| import com.xueyi.common.cache.utils.SourceUtil; | |||
| import com.xueyi.common.core.constant.basic.SecurityConstants; | |||
| import com.xueyi.common.core.context.SecurityContextHolder; | |||
| import com.xueyi.common.core.web.result.R; | |||
| import com.xueyi.common.redis.utils.RedisUtil; | |||
| import com.xueyi.common.web.annotation.TenantIgnore; | |||
| import com.xueyi.system.api.device.domain.vo.DeviceTenantSourceMergeVo; | |||
| import com.xueyi.system.api.model.Source; | |||
| import com.xueyi.system.api.staff.domain.dto.DmStaffCommonDto; | |||
| import com.xueyi.system.api.staff.feign.RemoteStaffService; | |||
| import com.xueyi.system.resource.controller.api.BaseApiController; | |||
| import com.xueyi.system.staff.service.impl.DmStaffServiceImpl; | |||
| import com.xueyi.tenant.api.tenant.domain.dto.TeTenantDto; | |||
| import com.xueyi.tenant.api.tenant.feign.RemoteTenantService; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.GetMapping; | |||
| import org.springframework.web.bind.annotation.PathVariable; | |||
| @@ -15,6 +26,8 @@ import org.springframework.web.bind.annotation.RequestMapping; | |||
| import org.springframework.web.bind.annotation.ResponseBody; | |||
| import org.springframework.web.bind.annotation.RestController; | |||
| import java.util.List; | |||
| /** | |||
| * 员工管理 API业务处理 | |||
| * | |||
| @@ -24,9 +37,17 @@ import org.springframework.web.bind.annotation.RestController; | |||
| @RequestMapping("/staff/api") | |||
| public class DmStaffApiController extends BaseApiController { | |||
| private static final Logger log = LoggerFactory.getLogger(DmStaffApiController.class); | |||
| @Autowired | |||
| private RemoteStaffService staffService; | |||
| @Autowired | |||
| private DmStaffServiceImpl dmStaffService; | |||
| @Autowired | |||
| private RemoteTenantService tenantService; | |||
| @GetMapping(value = "fetchOne/{devId}/{staffId}") | |||
| @ResponseBody | |||
| public JSONObject fetchStaff(@PathVariable("devId") String devId, @PathVariable("staffId") String staffId){ | |||
| @@ -41,4 +62,40 @@ public class DmStaffApiController extends BaseApiController { | |||
| DeviceTenantSourceMergeVo vo = super.getDeviceTenantSourceMergeVo(commonDto.getDevId()); | |||
| return staffService.addStaff(commonDto, vo.getTenantId(), vo.getSourceSlave(), SecurityConstants.INNER); | |||
| } | |||
| @GetMapping(value = "broadcast-staff-count") | |||
| @ResponseBody | |||
| @TenantIgnore(tenantLine = true) | |||
| public JSONObject queryStaff(){ | |||
| SecurityContextHolder.set("sourceName", "slave"); | |||
| Long count = dmStaffService.selectStaffAndVisitorCount(); | |||
| return outputSuccess(count).toJSON(); | |||
| } | |||
| @GetMapping(value = "staff-count") | |||
| @ResponseBody | |||
| public JSONObject staffCount(){ | |||
| if (RedisUtil.existed("saas:staff:totalCountAndVisitor")){ | |||
| String str = RedisUtil.getVal("saas:staff:totalCountAndVisitor").toString(); | |||
| log.info("staff-count res:{}", str); | |||
| return JSONObject.parse(str); | |||
| } | |||
| R<List<TeTenantDto>> listR = tenantService.tenantList(); | |||
| if (listR.isFail()) { | |||
| System.out.println("租户列表获取失败"); | |||
| return null; | |||
| } | |||
| List<TeTenantDto> res = listR.getData(); | |||
| TeTenantDto teTenantDto = res.get(0); | |||
| if (teTenantDto != null) { | |||
| Source source = SourceUtil.getSourceCache(teTenantDto.getStrategyId()); | |||
| JSONObject countJson = staffService.queryStaffCount(teTenantDto.getId(), source.getMaster(), SecurityConstants.INNER); | |||
| RedisUtil.setVal("saas:staff:totalCountAndVisitor", countJson.toJSONString(), 60); | |||
| return countJson; | |||
| } | |||
| return outputSuccess().toJSON(); | |||
| } | |||
| } | |||
| @@ -18,6 +18,7 @@ import com.xueyi.system.resource.service.impl.DmResourcesServiceImpl; | |||
| import com.xueyi.system.resource.service.impl.FaceServiceImpl; | |||
| import com.xueyi.system.staff.mapper.DmStaffMapper; | |||
| import com.xueyi.system.staff.mapper.DmVisitorsMapper; | |||
| import com.xueyi.system.staff.service.impl.DmStaffServiceImpl; | |||
| import com.xueyi.system.utils.common.ImageUtil; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.GetMapping; | |||
| @@ -58,6 +59,9 @@ public class DmStaffInnerApiController extends BaseApiController { | |||
| @Autowired | |||
| private DmStaffMapper staffMapper; | |||
| @Autowired | |||
| private DmStaffServiceImpl dmStaffService; | |||
| @InnerAuth | |||
| @GetMapping(value = "selectOne/{staffId}") | |||
| @ResponseBody | |||
| @@ -120,4 +124,12 @@ public class DmStaffInnerApiController extends BaseApiController { | |||
| return outputSuccess().toJSON(); | |||
| } | |||
| @InnerAuth | |||
| @GetMapping(value = "broadcast-staff-count") | |||
| @ResponseBody | |||
| public JSONObject queryStaff(){ | |||
| Long count = dmStaffService.selectStaffAndVisitorCount(); | |||
| return outputSuccess(count).toJSON(); | |||
| } | |||
| } | |||
| @@ -1,11 +1,11 @@ | |||
| package com.xueyi.system.staff.mapper; | |||
| import com.xueyi.common.datasource.annotation.Isolate; | |||
| import com.xueyi.common.web.entity.mapper.BaseMapper; | |||
| import com.xueyi.system.api.staff.domain.dto.DmStaffDto; | |||
| import com.xueyi.system.api.staff.domain.po.DmStaffPo; | |||
| import com.xueyi.system.staff.domain.query.DmStaffQuery; | |||
| import com.xueyi.common.web.entity.mapper.BaseMapper; | |||
| import com.xueyi.common.datasource.annotation.Isolate; | |||
| import com.xueyi.system.api.staff.domain.vo.DmStaffFeature; | |||
| import com.xueyi.system.staff.domain.query.DmStaffQuery; | |||
| import org.apache.ibatis.annotations.Param; | |||
| import java.util.List; | |||
| @@ -21,4 +21,8 @@ public interface DmStaffMapper extends BaseMapper<DmStaffQuery, DmStaffDto, DmSt | |||
| public List<DmStaffFeature> selectStaffFeaturesList(@Param("devId")String devId,@Param("timestamp") String timestamp); | |||
| public List<DmStaffFeature> selectVisitorFeaturesList(@Param("devId")String devId,@Param("timestamp") String timestamp); | |||
| public Integer getStaffCount(); | |||
| public Integer getVisitorCount(); | |||
| } | |||
| @@ -20,4 +20,6 @@ public interface IDmStaffService extends IBaseService<DmStaffQuery, DmStaffDto> | |||
| Long selectTenantId(DmStaffPo staff); | |||
| List<DmStaffFeature> selectStaffListByTimestamp(String devId,String tempstamp); | |||
| Long selectStaffAndVisitorCount(); | |||
| } | |||
| @@ -3,18 +3,18 @@ package com.xueyi.system.staff.service.impl; | |||
| import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | |||
| import com.baomidou.mybatisplus.core.toolkit.StringUtils; | |||
| import com.xueyi.common.web.annotation.TenantIgnore; | |||
| import com.xueyi.common.web.entity.service.impl.BaseServiceImpl; | |||
| import com.xueyi.common.web.utils.DateUtils; | |||
| import com.xueyi.system.api.pass.domain.po.DmRecognizedRecordsPo; | |||
| import com.xueyi.system.api.staff.domain.dto.DmStaffDto; | |||
| import com.xueyi.system.api.staff.domain.po.DmStaffPo; | |||
| import com.xueyi.system.api.staff.domain.vo.DmStaffFeature; | |||
| import com.xueyi.system.staff.domain.po.DmEmpAttendancePo; | |||
| import com.xueyi.system.staff.mapper.DmEmpAttendanceMapper; | |||
| import com.xueyi.system.staff.domain.query.DmStaffQuery; | |||
| import com.xueyi.system.api.staff.domain.vo.DmStaffFeature; | |||
| import com.xueyi.system.staff.manager.IDmStaffManager; | |||
| import com.xueyi.system.staff.mapper.DmEmpAttendanceMapper; | |||
| import com.xueyi.system.staff.mapper.DmStaffMapper; | |||
| import com.xueyi.system.staff.service.IDmStaffService; | |||
| import com.xueyi.common.web.entity.service.impl.BaseServiceImpl; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Service; | |||
| @@ -49,6 +49,8 @@ public class DmStaffServiceImpl extends BaseServiceImpl<DmStaffQuery, DmStaffDto | |||
| return baseManager.selectList(dmStaff); | |||
| } | |||
| @Override | |||
| @TenantIgnore(tenantLine = true) | |||
| public List<DmStaffPo> selectStaffList(DmStaffPo staff) { | |||
| @@ -76,6 +78,16 @@ public class DmStaffServiceImpl extends BaseServiceImpl<DmStaffQuery, DmStaffDto | |||
| return staffFeatures; | |||
| } | |||
| @Override | |||
| @TenantIgnore(tenantLine = true) | |||
| public Long selectStaffAndVisitorCount() { | |||
| Integer staffCount = staffMapper.getStaffCount(); | |||
| Integer visitorCount = staffMapper.getStaffCount(); | |||
| Integer totalCount = staffCount + visitorCount; | |||
| return totalCount.longValue(); | |||
| } | |||
| public void updateOrInsertAttendance(DmRecognizedRecordsPo checkRecords) { | |||
| if (null == checkRecords.getUserId()) { | |||
| @@ -33,4 +33,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |||
| select s.id, s.name ,s.type as user_type, s.update_time,s.nickname as nick_name, s.del_flag, r.feature from dm_visitors s left join dm_resources as r on s.resource_id = r.id | |||
| where (UNIX_TIMESTAMP(s.update_time) * 1000 > #{timestamp} or UNIX_TIMESTAMP(s.create_time) * 1000 > #{timestamp} )and r.feature is not null | |||
| </select> | |||
| <select id="getStaffCount" resultType="java.lang.Integer"> | |||
| select count(*) from dm_staff where del_flag = 0 | |||
| </select> | |||
| <select id="getVisitorCount" resultType="java.lang.Integer"> | |||
| select count(*) from dm_visitors where del_flag = 0 | |||
| </select> | |||
| </mapper> | |||