Commit a00169aeffc9b0a078553643369b36560e03490c
1 parent
0b2bc2ef
fix: 可视化大屏-》查看详情
Showing
9 changed files
with
220 additions
and
92 deletions
Bsth-admin/src/main/java/com/ruoyi/controller/BigViewController.java
| ... | ... | @@ -2,14 +2,12 @@ package com.ruoyi.controller; |
| 2 | 2 | |
| 3 | 3 | import com.ruoyi.common.global.Result; |
| 4 | 4 | import com.ruoyi.pojo.vo.bigViewVo.FleetInfoVo; |
| 5 | +import com.ruoyi.pojo.vo.bigViewVo.SignInfoVo; | |
| 5 | 6 | import com.ruoyi.service.BigViewService; |
| 6 | 7 | import io.swagger.annotations.Api; |
| 7 | 8 | import io.swagger.annotations.ApiOperation; |
| 8 | 9 | import org.springframework.beans.factory.annotation.Autowired; |
| 9 | -import org.springframework.web.bind.annotation.GetMapping; | |
| 10 | -import org.springframework.web.bind.annotation.PathVariable; | |
| 11 | -import org.springframework.web.bind.annotation.RequestMapping; | |
| 12 | -import org.springframework.web.bind.annotation.RestController; | |
| 10 | +import org.springframework.web.bind.annotation.*; | |
| 13 | 11 | |
| 14 | 12 | import java.util.List; |
| 15 | 13 | |
| ... | ... | @@ -33,15 +31,22 @@ public class BigViewController { |
| 33 | 31 | * @return |
| 34 | 32 | */ |
| 35 | 33 | @ApiOperation("根据类型获取数值") |
| 36 | - @GetMapping("/queryNumberByType/{type}") | |
| 37 | - public Result<Integer> queryNumberByType(@PathVariable("type") String type){ | |
| 38 | - return Result.OK(bigViewService.queryNumberByType(type)); | |
| 34 | + @GetMapping("/queryNumberByType") | |
| 35 | + public Result<Integer> queryNumberByType(@RequestParam("type") String type,@RequestParam("dateKey")String dateKey){ | |
| 36 | + return Result.OK(bigViewService.queryNumberByType(type,dateKey)); | |
| 39 | 37 | } |
| 40 | 38 | |
| 41 | 39 | @ApiOperation("获取车队信息") |
| 42 | - @GetMapping("/queryLineInfo") | |
| 43 | - public Result<List<FleetInfoVo>> queryFleetInfoByFleetName(){ | |
| 44 | - return Result.OK(bigViewService.queryFleetInfoByFleetName()); | |
| 40 | + @GetMapping("/queryLineInfo/{dateKey}") | |
| 41 | + public Result<List<FleetInfoVo>> queryFleetInfoByFleetName(@PathVariable("dateKey") String dateKey){ | |
| 42 | + return Result.OK(bigViewService.queryFleetInfoByFleetName(dateKey)); | |
| 43 | + } | |
| 44 | + | |
| 45 | + | |
| 46 | + @ApiOperation("获取签到详情") | |
| 47 | + @GetMapping("/querySignDetails") | |
| 48 | + public Result<SignInfoVo> querySignDetails(@RequestParam("date") String date,@RequestParam("jobCode") String jobCode){ | |
| 49 | + return Result.OK(bigViewService.querySignDetails(date,jobCode)); | |
| 45 | 50 | } |
| 46 | 51 | |
| 47 | 52 | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/in/mapper/SignInMapper.java
Bsth-admin/src/main/java/com/ruoyi/in/service/ISignInService.java
Bsth-admin/src/main/java/com/ruoyi/in/service/impl/SignInServiceImpl.java
| ... | ... | @@ -285,6 +285,14 @@ public class SignInServiceImpl implements ISignInService { |
| 285 | 285 | return AjaxResult.success("补签成功"); |
| 286 | 286 | } |
| 287 | 287 | |
| 288 | + @Override | |
| 289 | + public List<SignInResponseVo> selectSignInByIds(List<Long> collect) { | |
| 290 | + if (CollectionUtil.isEmpty(collect)){ | |
| 291 | + return new ArrayList<>(); | |
| 292 | + } | |
| 293 | + return signInMapper.selectSignInByIds(collect); | |
| 294 | + } | |
| 295 | + | |
| 288 | 296 | private String handleDate(String dateString) { |
| 289 | 297 | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd"); |
| 290 | 298 | // 解析字符串日期为 LocalDate 对象 | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/pojo/vo/bigViewVo/SignInfoVo.java
0 → 100644
| 1 | +package com.ruoyi.pojo.vo.bigViewVo; | |
| 2 | + | |
| 3 | +import com.fasterxml.jackson.annotation.JsonFormat; | |
| 4 | +import lombok.Data; | |
| 5 | +import org.springframework.format.annotation.DateTimeFormat; | |
| 6 | + | |
| 7 | +import java.util.Date; | |
| 8 | +import java.util.List; | |
| 9 | + | |
| 10 | +/** | |
| 11 | + * @author 20412 | |
| 12 | + */ | |
| 13 | +@Data | |
| 14 | +public class SignInfoVo { | |
| 15 | + private String name; | |
| 16 | + private String jobCode; | |
| 17 | + private String lpName; | |
| 18 | + private String fleetName; | |
| 19 | + private List<SignInfo> signInfos; | |
| 20 | + @Data | |
| 21 | + public static class SignInfo{ | |
| 22 | + @JsonFormat(timezone = "GMT+8",pattern = "MM-dd HH:mm:ss") | |
| 23 | + @DateTimeFormat(pattern = "MM-dd HH:mm:ss") | |
| 24 | + private Date signDate; | |
| 25 | + @JsonFormat(timezone = "GMT+8",pattern = "MM-dd HH:mm:ss") | |
| 26 | + @DateTimeFormat(pattern = "MM-dd HH:mm:ss") | |
| 27 | + private Date planDate; | |
| 28 | + private String address; | |
| 29 | + private String result; | |
| 30 | + } | |
| 31 | +} | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/scheduling/controller/RuleSchedulingController.java
| ... | ... | @@ -51,7 +51,6 @@ public class RuleSchedulingController extends BaseController { |
| 51 | 51 | /** |
| 52 | 52 | * 查询排版规则列表 |
| 53 | 53 | */ |
| 54 | - @PreAuthorize("@ss.hasPermi('scheduling:scheduling:list')") | |
| 55 | 54 | @GetMapping("/list/all") |
| 56 | 55 | public AjaxResult listAll(RuleScheduling ruleScheduling) { |
| 57 | 56 | return AjaxResult.success(ruleSchedulingService.selectRuleSchedulingListVo(ruleScheduling)); | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/service/BigViewService.java
| 1 | 1 | package com.ruoyi.service; |
| 2 | 2 | |
| 3 | 3 | import com.ruoyi.pojo.vo.bigViewVo.FleetInfoVo; |
| 4 | +import com.ruoyi.pojo.vo.bigViewVo.SignInfoVo; | |
| 4 | 5 | |
| 5 | 6 | import java.util.List; |
| 6 | 7 | |
| ... | ... | @@ -13,14 +14,23 @@ public interface BigViewService { |
| 13 | 14 | /** |
| 14 | 15 | * 根据类型获取数量 |
| 15 | 16 | * @param type |
| 16 | - * @return | |
| 17 | + * @param dateKey | |
| 18 | + * @return Integer | |
| 17 | 19 | */ |
| 18 | - Integer queryNumberByType(String type); | |
| 20 | + Integer queryNumberByType(String type,String dateKey); | |
| 19 | 21 | |
| 20 | 22 | /** |
| 21 | 23 | * 获取车队信息 |
| 22 | - * @return | |
| 24 | + * @param dateKey | |
| 25 | + * @return List<FleetInfoVo> | |
| 23 | 26 | */ |
| 24 | - List<FleetInfoVo> queryFleetInfoByFleetName(); | |
| 27 | + List<FleetInfoVo> queryFleetInfoByFleetName(String dateKey); | |
| 25 | 28 | |
| 29 | + /** | |
| 30 | + * 查询签到详情 | |
| 31 | + * @param date 日期 | |
| 32 | + * @param jobCode 工号 | |
| 33 | + * @return SignInfoVo | |
| 34 | + */ | |
| 35 | + SignInfoVo querySignDetails(String date,String jobCode); | |
| 26 | 36 | } | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/service/impl/BigViewServiceImpl.java
| 1 | 1 | package com.ruoyi.service.impl; |
| 2 | 2 | |
| 3 | 3 | import cn.hutool.core.collection.CollectionUtil; |
| 4 | -import com.ruoyi.common.SignStatusEnum; | |
| 5 | 4 | import com.ruoyi.common.cache.NowSchedulingCache; |
| 5 | +import com.ruoyi.common.utils.StringUtils; | |
| 6 | 6 | import com.ruoyi.domain.DriverScheduling; |
| 7 | 7 | import com.ruoyi.driver.mapper.DriverMapper; |
| 8 | 8 | import com.ruoyi.driver.mapper.DriverSchedulingMapper; |
| 9 | +import com.ruoyi.in.service.ISignInService; | |
| 10 | +import com.ruoyi.pojo.response.SignInResponseVo; | |
| 9 | 11 | import com.ruoyi.pojo.vo.bigViewVo.FleetInfoVo; |
| 10 | 12 | import com.ruoyi.pojo.vo.bigViewVo.LineInfo; |
| 13 | +import com.ruoyi.pojo.vo.bigViewVo.SignInfoVo; | |
| 11 | 14 | import com.ruoyi.service.BigViewService; |
| 12 | 15 | import com.ruoyi.service.ThreadJobService; |
| 13 | 16 | import com.ruoyi.utils.ConstDateUtil; |
| ... | ... | @@ -22,6 +25,7 @@ import java.util.stream.Collectors; |
| 22 | 25 | |
| 23 | 26 | import static com.ruoyi.common.ConstDriverProperties.BC_TYPE_OUT; |
| 24 | 27 | import static com.ruoyi.common.ConstSignInConstSignInProperties.*; |
| 28 | +import static com.ruoyi.common.SignStatusEnum.*; | |
| 25 | 29 | |
| 26 | 30 | /** |
| 27 | 31 | * @author 20412 |
| ... | ... | @@ -37,22 +41,25 @@ public class BigViewServiceImpl implements BigViewService { |
| 37 | 41 | private DriverSchedulingMapper schedulingMapper; |
| 38 | 42 | |
| 39 | 43 | @Autowired |
| 44 | + private ISignInService iSignInService; | |
| 45 | + | |
| 46 | + @Autowired | |
| 40 | 47 | private DriverMapper driverMapper; |
| 41 | 48 | |
| 42 | 49 | @Resource |
| 43 | 50 | private NowSchedulingCache cache; |
| 44 | 51 | |
| 45 | 52 | @Override |
| 46 | - public Integer queryNumberByType(String type) { | |
| 47 | - Integer x = handleType(type); | |
| 53 | + public Integer queryNumberByType(String type,String dateKey) { | |
| 54 | + Integer x = handleType(type,dateKey); | |
| 48 | 55 | if (x != null) return x; |
| 49 | 56 | return 0; |
| 50 | 57 | } |
| 51 | 58 | |
| 52 | 59 | @Override |
| 53 | - public List<FleetInfoVo> queryFleetInfoByFleetName() { | |
| 60 | + public List<FleetInfoVo> queryFleetInfoByFleetName(String dateKey) { | |
| 54 | 61 | // 从缓存中读取数据,但是调度表中还好包含飞司售人员信息 需要过滤一下 非司售人员nbbm不会存在 |
| 55 | - String key = ConstDateUtil.getStringNowLocalDate("-"); | |
| 62 | + String key = dateKey.replaceAll("-",""); | |
| 56 | 63 | Map<String, List<DriverScheduling>> map = cache.getCacheScheduling(key); |
| 57 | 64 | |
| 58 | 65 | Map<String, LineInfo> matchMap = transformMapByMacheList(map); |
| ... | ... | @@ -66,6 +73,38 @@ public class BigViewServiceImpl implements BigViewService { |
| 66 | 73 | return fleetInfoVos; |
| 67 | 74 | } |
| 68 | 75 | |
| 76 | + @Override | |
| 77 | + public SignInfoVo querySignDetails(String date, String jobCode) { | |
| 78 | + SignInfoVo vo = null; | |
| 79 | + Map<String, List<DriverScheduling>> map = cache.getCacheScheduling(date.replaceAll("-","")); | |
| 80 | + List<DriverScheduling> list = map.get(jobCode); | |
| 81 | + if (CollectionUtil.isNotEmpty(list)) { | |
| 82 | + vo = new SignInfoVo(); | |
| 83 | + vo.setName(list.get(0).getName()); | |
| 84 | + vo.setJobCode(jobCode); | |
| 85 | + vo.setFleetName(list.get(0).getFleetName()); | |
| 86 | + vo.setSignInfos(new ArrayList<>()); | |
| 87 | + list = list.stream().filter(item -> BC_TYPE_OUT.equals(item.getBcType())).collect(Collectors.toList()); | |
| 88 | + List<SignInResponseVo> signInList = iSignInService.selectSignInByIds(list.stream().map(DriverScheduling::getSignInId).filter(item -> !Objects.isNull(item)).collect(Collectors.toList())); | |
| 89 | + Map<String, Object> lpNameMap = new HashMap<>(list.size()); | |
| 90 | + for (DriverScheduling scheduling : list) { | |
| 91 | + lpNameMap.put(scheduling.getLpName(), ""); | |
| 92 | + SignInfoVo.SignInfo info = new SignInfoVo.SignInfo(); | |
| 93 | + info.setPlanDate(new Date(scheduling.getFcsjT())); | |
| 94 | + info.setSignDate(scheduling.getSignTime()); | |
| 95 | + for (SignInResponseVo sign : signInList) { | |
| 96 | + if (sign.getId().equals(scheduling.getId())) { | |
| 97 | + info.setAddress(sign.getAddress()); | |
| 98 | + } | |
| 99 | + } | |
| 100 | + info.setResult(Objects.isNull(scheduling.getRemark()) ? "未签" : scheduling.getRemark()); | |
| 101 | + vo.getSignInfos().add(info); | |
| 102 | + } | |
| 103 | + vo.setLpName(StringUtils.join(lpNameMap.keySet(),"/")); | |
| 104 | + } | |
| 105 | + return vo; | |
| 106 | + } | |
| 107 | + | |
| 69 | 108 | private List<FleetInfoVo> handleFleetWithLinePersonInfo(Map<String, LineInfo> map, Map<String, Map<String, List<String>>> mapVo) { |
| 70 | 109 | List<FleetInfoVo> vos = new ArrayList<>(4); |
| 71 | 110 | for (Map.Entry<String, Map<String, List<String>>> entry : mapVo.entrySet()) { |
| ... | ... | @@ -203,7 +242,7 @@ public class BigViewServiceImpl implements BigViewService { |
| 203 | 242 | if (!Objects.isNull(driverInfoVo) && time - scheduling.getFcsjT() < 0) { |
| 204 | 243 | return; |
| 205 | 244 | } |
| 206 | - matchMap.get(nbbm).setDriverInfoVo(personInfoVo); | |
| 245 | + matchMap.get(nbbm).setDriverInfoVo(personInfoVo); | |
| 207 | 246 | } else { |
| 208 | 247 | LineInfo.PersonInfoVo saleInfoVo = matchMap.get(nbbm).getSaleInfoVo(); |
| 209 | 248 | // 第二次签到时间未到不记录状态 |
| ... | ... | @@ -217,20 +256,22 @@ public class BigViewServiceImpl implements BigViewService { |
| 217 | 256 | private LineInfo.PersonInfoVo getPersonInfoVo(DriverScheduling scheduling) { |
| 218 | 257 | LineInfo.PersonInfoVo personInfoVo = new LineInfo.PersonInfoVo(); |
| 219 | 258 | if (Objects.isNull(scheduling.getExType())) { |
| 220 | - personInfoVo.setSignStatus(SignStatusEnum.SIGN_STATUS_EMPTY_ENUM); | |
| 259 | + personInfoVo.setSignStatus(SIGN_STATUS_EMPTY_ENUM); | |
| 221 | 260 | } else { |
| 222 | 261 | switch (scheduling.getExType()) { |
| 223 | 262 | case 0: |
| 224 | - personInfoVo.setSignStatus(SignStatusEnum.SIGN_STATUS_ZONE_ENUM); | |
| 263 | + personInfoVo.setSignStatus(SIGN_STATUS_ZONE_ENUM); | |
| 225 | 264 | break; |
| 226 | 265 | case 1: |
| 227 | 266 | // 不在规定范围内 早签不算迟到 |
| 228 | 267 | if (EARLY.equals(scheduling.getRemark())) { |
| 229 | - personInfoVo.setSignStatus(SignStatusEnum.SIGN_STATUS_DELAY_ENUM); | |
| 268 | + personInfoVo.setSignStatus(SIGN_STATUS_ZONE_ENUM); | |
| 269 | + } else { | |
| 270 | + personInfoVo.setSignStatus(SIGN_STATUS_DELAY_ENUM); | |
| 230 | 271 | } |
| 231 | 272 | break; |
| 232 | 273 | case 3: |
| 233 | - personInfoVo.setSignStatus(SignStatusEnum.SIGN_STATUS_WINE_ENUM); | |
| 274 | + personInfoVo.setSignStatus(SIGN_STATUS_WINE_ENUM); | |
| 234 | 275 | break; |
| 235 | 276 | } |
| 236 | 277 | } |
| ... | ... | @@ -239,8 +280,8 @@ public class BigViewServiceImpl implements BigViewService { |
| 239 | 280 | return personInfoVo; |
| 240 | 281 | } |
| 241 | 282 | |
| 242 | - private Integer handleType(String type) { | |
| 243 | - String key = ConstDateUtil.getStringNowLocalDate("-"); | |
| 283 | + private Integer handleType(String type, String dateKey) { | |
| 284 | + String key = dateKey.replaceAll("-",""); | |
| 244 | 285 | Map<String, List<DriverScheduling>> map = cache.getCacheScheduling(key); |
| 245 | 286 | Map<String, Object> typeMap = new HashMap<>(map.size()); |
| 246 | 287 | switch (type) { |
| ... | ... | @@ -281,7 +322,7 @@ public class BigViewServiceImpl implements BigViewService { |
| 281 | 322 | case "auxiliary": |
| 282 | 323 | for (Map.Entry<String, List<DriverScheduling>> entry : map.entrySet()) { |
| 283 | 324 | for (DriverScheduling scheduling : entry.getValue()) { |
| 284 | - if (Objects.isNull(scheduling.getNbbm()) && BC_TYPE_OUT.equals(scheduling.getBcType())) { | |
| 325 | + if (Objects.isNull(scheduling.getNbbm()) && BC_TYPE_OUT.equals(scheduling.getBcType()) && !Objects.isNull(scheduling.getSignInId())) { | |
| 285 | 326 | typeMap.put(scheduling.getJobCode() + scheduling.getBcType(), ""); |
| 286 | 327 | } |
| 287 | 328 | } | ... | ... |
Bsth-admin/src/main/resources/mapper/in/SignInMapper.xml
| 1 | 1 | <?xml version="1.0" encoding="UTF-8" ?> |
| 2 | 2 | <!DOCTYPE mapper |
| 3 | -PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |
| 4 | -"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |
| 3 | + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |
| 4 | + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |
| 5 | 5 | <mapper namespace="com.ruoyi.in.mapper.SignInMapper"> |
| 6 | 6 | <resultMap type="com.ruoyi.pojo.response.SignInResponseVo" id="SignInResultVO"> |
| 7 | - <result property="id" column="id" /> | |
| 8 | - <result property="createTime" column="create_time" /> | |
| 9 | - <result property="jobCode" column="jobCode" /> | |
| 10 | - <result property="deviceId" column="device_id" /> | |
| 11 | - <result property="ip" column="ip" /> | |
| 12 | - <result property="image" column="image" /> | |
| 13 | - <result property="status" column="status" /> | |
| 14 | - <result property="updateBy" column="update_by" /> | |
| 15 | - <result property="singnIn" column="singn_in" /> | |
| 16 | - <result property="alcoholFlag" column="alcohol_flag" /> | |
| 17 | - <result property="type" column="type" /> | |
| 18 | - <result property="updateTime" column="update_time" /> | |
| 19 | - <result property="alcoholIntake" column="alcohol_intake" /> | |
| 20 | - <result property="remark" column="remark" /> | |
| 21 | - <result property="posts" column="posts" /> | |
| 22 | - <result property="name" column="personnel_name" /> | |
| 7 | + <result property="id" column="id"/> | |
| 8 | + <result property="createTime" column="create_time"/> | |
| 9 | + <result property="jobCode" column="jobCode"/> | |
| 10 | + <result property="deviceId" column="device_id"/> | |
| 11 | + <result property="ip" column="ip"/> | |
| 12 | + <result property="image" column="image"/> | |
| 13 | + <result property="status" column="status"/> | |
| 14 | + <result property="updateBy" column="update_by"/> | |
| 15 | + <result property="singnIn" column="singn_in"/> | |
| 16 | + <result property="alcoholFlag" column="alcohol_flag"/> | |
| 17 | + <result property="type" column="type"/> | |
| 18 | + <result property="updateTime" column="update_time"/> | |
| 19 | + <result property="alcoholIntake" column="alcohol_intake"/> | |
| 20 | + <result property="remark" column="remark"/> | |
| 21 | + <result property="posts" column="posts"/> | |
| 22 | + <result property="name" column="personnel_name"/> | |
| 23 | 23 | </resultMap> |
| 24 | 24 | <resultMap type="SignIn" id="SignInResult"> |
| 25 | - <result property="id" column="id" /> | |
| 26 | - <result property="createTime" column="create_time" /> | |
| 27 | - <result property="jobCode" column="jobCode" /> | |
| 28 | - <result property="deviceId" column="device_id" /> | |
| 29 | - <result property="ip" column="ip" /> | |
| 30 | - <result property="image" column="image" /> | |
| 31 | - <result property="status" column="status" /> | |
| 32 | - <result property="updateBy" column="update_by" /> | |
| 33 | - <result property="singnIn" column="singn_in" /> | |
| 34 | - <result property="alcoholFlag" column="alcohol_flag" /> | |
| 35 | - <result property="type" column="type" /> | |
| 36 | - <result property="updateTime" column="update_time" /> | |
| 37 | - <result property="alcoholIntake" column="alcohol_intake" /> | |
| 38 | - <result property="remark" column="remark" /> | |
| 25 | + <result property="id" column="id"/> | |
| 26 | + <result property="createTime" column="create_time"/> | |
| 27 | + <result property="jobCode" column="jobCode"/> | |
| 28 | + <result property="deviceId" column="device_id"/> | |
| 29 | + <result property="ip" column="ip"/> | |
| 30 | + <result property="image" column="image"/> | |
| 31 | + <result property="status" column="status"/> | |
| 32 | + <result property="updateBy" column="update_by"/> | |
| 33 | + <result property="singnIn" column="singn_in"/> | |
| 34 | + <result property="alcoholFlag" column="alcohol_flag"/> | |
| 35 | + <result property="type" column="type"/> | |
| 36 | + <result property="updateTime" column="update_time"/> | |
| 37 | + <result property="alcoholIntake" column="alcohol_intake"/> | |
| 38 | + <result property="remark" column="remark"/> | |
| 39 | 39 | </resultMap> |
| 40 | 40 | |
| 41 | 41 | <sql id="selectSignInVo"> |
| 42 | - select id, create_time, jobCode, device_id,ip,image, status, update_by, singn_in, alcohol_flag, type, update_time, alcohol_intake, remark from sign_in | |
| 42 | + select id, | |
| 43 | + create_time, | |
| 44 | + jobCode, | |
| 45 | + device_id, | |
| 46 | + ip, | |
| 47 | + image, | |
| 48 | + status, | |
| 49 | + update_by, | |
| 50 | + singn_in, | |
| 51 | + alcohol_flag, | |
| 52 | + type, | |
| 53 | + update_time, | |
| 54 | + alcohol_intake, | |
| 55 | + remark | |
| 56 | + from sign_in | |
| 43 | 57 | </sql> |
| 44 | 58 | |
| 45 | 59 | <select id="selectSignInList" parameterType="com.ruoyi.pojo.response.SignInResponseVo" resultMap="SignInResultVO"> |
| ... | ... | @@ -47,19 +61,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| 47 | 61 | from sign_in,driver,equipment |
| 48 | 62 | WHERE |
| 49 | 63 | driver.job_code = sign_in.jobCode and equipment.device_id = sign_in.device_id |
| 50 | - <if test="jobCode != null and jobCode != ''"> and jobCode = #{jobCode}</if> | |
| 51 | - <if test="ip != null and ip != ''"> and ip = #{ip}</if> | |
| 52 | - <if test="image != null and image != ''"> and image = #{image}</if> | |
| 53 | - <if test="status != null "> and sign_in.status = #{status}</if> | |
| 54 | - <if test="singnIn != null and singnIn != ''"> and singn_in = #{singnIn}</if> | |
| 55 | - <if test="alcoholFlag != null "> and alcohol_flag = #{alcoholFlag}</if> | |
| 56 | - <if test="type != null "> and type = #{type}</if> | |
| 57 | - <if test="alcoholIntake != null "> and alcohol_intake = #{alcoholIntake}</if> | |
| 58 | - <if test="siteName != null "> and site_name = #{siteName}</if> | |
| 59 | - <if test="date != null "> and sign_in.create_time LIKE concat(#{date},'%')</if> | |
| 64 | + <if test="jobCode != null and jobCode != ''">and jobCode = #{jobCode}</if> | |
| 65 | + <if test="ip != null and ip != ''">and ip = #{ip}</if> | |
| 66 | + <if test="image != null and image != ''">and image = #{image}</if> | |
| 67 | + <if test="status != null ">and sign_in.status = #{status}</if> | |
| 68 | + <if test="singnIn != null and singnIn != ''">and singn_in = #{singnIn}</if> | |
| 69 | + <if test="alcoholFlag != null ">and alcohol_flag = #{alcoholFlag}</if> | |
| 70 | + <if test="type != null ">and type = #{type}</if> | |
| 71 | + <if test="alcoholIntake != null ">and alcohol_intake = #{alcoholIntake}</if> | |
| 72 | + <if test="siteName != null ">and site_name = #{siteName}</if> | |
| 73 | + <if test="date != null ">and sign_in.create_time LIKE concat(#{date},'%')</if> | |
| 60 | 74 | order by create_time desc |
| 61 | 75 | </select> |
| 62 | - | |
| 76 | + | |
| 63 | 77 | <select id="selectSignInById" parameterType="Long" resultMap="SignInResult"> |
| 64 | 78 | <include refid="selectSignInVo"/> |
| 65 | 79 | where id = #{id} |
| ... | ... | @@ -67,7 +81,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| 67 | 81 | <select id="getReportScrollViewTable" resultType="com.ruoyi.pojo.response.ReportViewResponseVo"> |
| 68 | 82 | |
| 69 | 83 | <if test="jobCode != '' and jobCode != null"> |
| 70 | - and sign_in.jobCode = #{jobCode} | |
| 84 | + and sign_in.jobCode = #{jobCode} | |
| 71 | 85 | </if> |
| 72 | 86 | <if test="startTime != '' and startTime != null"> |
| 73 | 87 | and DATE_FORMAT(sign_in.create_time,'%Y-%m-%d') >= #{startTime} |
| ... | ... | @@ -81,9 +95,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| 81 | 95 | </if> |
| 82 | 96 | <if test="ids != null and ids.size() > 0"> |
| 83 | 97 | and sign_in.id in |
| 84 | - <foreach collection="ids" item="id" open="(" close=")" separator=","> | |
| 85 | - #{id} | |
| 86 | - </foreach> | |
| 98 | + <foreach collection="ids" item="id" open="(" close=")" separator=","> | |
| 99 | + #{id} | |
| 100 | + </foreach> | |
| 87 | 101 | </if> |
| 88 | 102 | order by sign_in.create_time desc |
| 89 | 103 | </select> |
| ... | ... | @@ -102,21 +116,35 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| 102 | 116 | <select id="queryOutBcType" resultType="com.ruoyi.domain.DriverScheduling"> |
| 103 | 117 | SELECT s1.* |
| 104 | 118 | FROM scheduling s1 |
| 105 | - INNER JOIN ( | |
| 106 | - SELECT job_code, schedule_date, MIN(fcsj_t) AS min_fcsj_t | |
| 107 | - FROM scheduling | |
| 108 | - WHERE bc_type = 'out' AND schedule_date = DATE_FORMAT(NOW(), '%Y-%m-%d') | |
| 109 | - GROUP BY job_code, schedule_date | |
| 110 | - ) s2 ON s1.job_code = s2.job_code AND s1.schedule_date = s2.schedule_date AND s1.fcsj_t = s2.min_fcsj_t; | |
| 119 | + INNER JOIN (SELECT job_code, schedule_date, MIN(fcsj_t) AS min_fcsj_t | |
| 120 | + FROM scheduling | |
| 121 | + WHERE bc_type = 'out' | |
| 122 | + AND schedule_date = DATE_FORMAT(NOW(), '%Y-%m-%d') | |
| 123 | + GROUP BY job_code, schedule_date) s2 | |
| 124 | + ON s1.job_code = s2.job_code AND s1.schedule_date = s2.schedule_date AND | |
| 125 | + s1.fcsj_t = s2.min_fcsj_t; | |
| 111 | 126 | |
| 112 | 127 | </select> |
| 113 | 128 | <select id="querySignInData" resultType="com.ruoyi.in.domain.SignIn"> |
| 114 | - SELECT * FROM sign_in s1 JOIN ( | |
| 115 | - SELECT jobCode AS job_code, MIN(create_time) AS min_create_time | |
| 116 | - FROM sign_in | |
| 117 | - WHERE create_time LIKE CONCAT(DATE_FORMAT(NOW(), "%Y-%m-%d"), "%") | |
| 118 | - GROUP BY job_code, DATE(create_time) | |
| 119 | - ) s2 on s1.jobCode = s2.job_code and s1.create_time = s2.min_create_time | |
| 129 | + SELECT * | |
| 130 | + FROM sign_in s1 | |
| 131 | + JOIN (SELECT jobCode AS job_code, MIN(create_time) AS min_create_time | |
| 132 | + FROM sign_in | |
| 133 | + WHERE create_time LIKE CONCAT(DATE_FORMAT(NOW(), "%Y-%m-%d"), "%") | |
| 134 | + GROUP BY job_code, DATE (create_time) ) s2 | |
| 135 | + on s1.jobCode = s2.job_code and s1.create_time = s2.min_create_time | |
| 136 | + </select> | |
| 137 | + <select id="selectSignInByIds" parameterType="com.ruoyi.pojo.response.SignInResponseVo" resultMap="SignInResultVO"> | |
| 138 | + select sign_in.id,equipment.site_name | |
| 139 | + from sign_in,equipment | |
| 140 | + where equipment.device_id = sign_in.device_id | |
| 141 | + <if test="list != null and list.size >0"> | |
| 142 | + and sign_in.id in | |
| 143 | + <foreach collection="list" item="item" open="(" close=")" separator=","> | |
| 144 | + #{item} | |
| 145 | + </foreach> | |
| 146 | + </if> | |
| 147 | + | |
| 120 | 148 | </select> |
| 121 | 149 | |
| 122 | 150 | <insert id="insertSignIn" parameterType="SignIn" useGeneratedKeys="true" keyProperty="id"> |
| ... | ... | @@ -136,7 +164,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| 136 | 164 | <if test="alcoholIntake != null">alcohol_intake,</if> |
| 137 | 165 | <if test="remark != null">remark,</if> |
| 138 | 166 | <if test="exType != null">ex_type,</if> |
| 139 | - </trim> | |
| 167 | + </trim> | |
| 140 | 168 | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| 141 | 169 | <if test="createTime != null">#{createTime},</if> |
| 142 | 170 | <if test="jobCode != null">#{jobCode},</if> |
| ... | ... | @@ -152,7 +180,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| 152 | 180 | <if test="alcoholIntake != null">#{alcoholIntake},</if> |
| 153 | 181 | <if test="remark != null">#{remark},</if> |
| 154 | 182 | <if test="exType != null">#{exType},</if> |
| 155 | - </trim> | |
| 183 | + </trim> | |
| 156 | 184 | </insert> |
| 157 | 185 | |
| 158 | 186 | <update id="updateSignIn" parameterType="SignIn"> |
| ... | ... | @@ -177,11 +205,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| 177 | 205 | </update> |
| 178 | 206 | |
| 179 | 207 | <delete id="deleteSignInById" parameterType="Long"> |
| 180 | - delete from sign_in where id = #{id} | |
| 208 | + delete | |
| 209 | + from sign_in | |
| 210 | + where id = #{id} | |
| 181 | 211 | </delete> |
| 182 | 212 | |
| 183 | 213 | <delete id="deleteSignInByIds" parameterType="String"> |
| 184 | - delete from sign_in where id in | |
| 214 | + delete from sign_in where id in | |
| 185 | 215 | <foreach item="id" collection="array" open="(" separator="," close=")"> |
| 186 | 216 | #{id} |
| 187 | 217 | </foreach> | ... | ... |