Quellcode durchsuchen

1、oa申请分页接口模糊查询信息:请假、出差、公务外出

dongpo vor 4 Monaten
Ursprung
Commit
6ddeb17771

+ 2 - 1
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/business/vo/OaBusinessPageReqVO.java

@@ -8,7 +8,6 @@ import lombok.EqualsAndHashCode;
 import lombok.ToString;
 import org.springframework.format.annotation.DateTimeFormat;
 
-import java.math.BigDecimal;
 import java.time.LocalDateTime;
 
 import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@@ -58,5 +57,7 @@ public class OaBusinessPageReqVO extends PageParam {
     @Schema(description = "用户id")
     private Long userId;
 
+    @Schema(description = "模糊查询字符串,主要用于移动端")
+    private String str;
 
 }

+ 2 - 0
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/leave/vo/OaLeavePageReqVO.java

@@ -51,5 +51,7 @@ public class OaLeavePageReqVO extends PageParam {
     @Schema(description = "用户id")
     private Long userId;
 
+    @Schema(description = "模糊查询字符串,主要用于移动端")
+    private String str;
 
 }

+ 2 - 0
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/out/vo/OaOutPageReqVO.java

@@ -57,4 +57,6 @@ public class OaOutPageReqVO extends PageParam {
     @Schema(description = "用户id")
     private Long userId;
 
+    @Schema(description = "模糊查询字符串,主要用于移动端")
+    private String str;
 }

+ 11 - 0
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/dal/mysql/oa/business/OaBusinessMapper.java

@@ -7,6 +7,7 @@ import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
 import cn.iocoder.yudao.module.bpm.controller.admin.oa.business.vo.OaBusinessPageReqVO;
 import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.business.OaBusinessDO;
 import cn.iocoder.yudao.module.system.api.permission.dto.DeptDataPermissionRespDTO;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.ibatis.annotations.Mapper;
 
 /**
@@ -31,6 +32,16 @@ public interface OaBusinessMapper extends BaseMapperX<OaBusinessDO> {
                 .likeIfPresent(OaBusinessDO::getApplyEmployeeName, reqVO.getApplyEmployeeName())
                 .betweenIfPresent(OaBusinessDO::getCreateTime, reqVO.getCreateTime())
                 .orderByDesc(OaBusinessDO::getId);
+        // 模糊查询信息:申请人applyEmployeeName、出差人employeeName、出差目的地destination
+        String str = reqVO.getStr();
+        if (StringUtils.isNotBlank(str)) {
+            lambdaQueryWrapperX.and(wrapper ->
+                    wrapper.like(OaBusinessDO::getApplyEmployeeName, str)
+                            .or()
+                            .like(OaBusinessDO::getEmployeeName, str)
+                            .or()
+                            .like(OaBusinessDO::getDestination, str));
+        }
         // 数据权限
         DeptDataPermissionRespDTO deptDataPermission = reqVO.getDeptDataPermission();
         if (deptDataPermission != null) {

+ 11 - 0
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/dal/mysql/oa/leave/OaLeaveMapper.java

@@ -7,6 +7,7 @@ import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
 import cn.iocoder.yudao.module.bpm.controller.admin.oa.leave.vo.OaLeavePageReqVO;
 import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.leave.OaLeaveDO;
 import cn.iocoder.yudao.module.system.api.permission.dto.DeptDataPermissionRespDTO;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.ibatis.annotations.Mapper;
 
 /**
@@ -29,6 +30,16 @@ public interface OaLeaveMapper extends BaseMapperX<OaLeaveDO> {
                 .eqIfPresent(OaLeaveDO::getAuditStatus, reqVO.getAuditStatus())
                 .betweenIfPresent(OaLeaveDO::getCreateTime, reqVO.getCreateTime())
                 .orderByDesc(OaLeaveDO::getId);
+        // 模糊查询信息:申请人applyEmployeeName、请假人employeeName、请假天数day
+        String str = reqVO.getStr();
+        if (StringUtils.isNotBlank(str)) {
+            lambdaQueryWrapperX.and(wrapper ->
+                    wrapper.like(OaLeaveDO::getApplyEmployeeName, str)
+                            .or()
+                            .like(OaLeaveDO::getEmployeeName, str)
+                            .or()
+                            .like(OaLeaveDO::getDay, str));
+        }
         // 数据权限
         DeptDataPermissionRespDTO deptDataPermission = reqVO.getDeptDataPermission();
         if (deptDataPermission != null) {

+ 11 - 0
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/dal/mysql/oa/out/OaOutMapper.java

@@ -7,6 +7,7 @@ import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
 import cn.iocoder.yudao.module.bpm.controller.admin.oa.out.vo.OaOutPageReqVO;
 import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.out.OaOutDO;
 import cn.iocoder.yudao.module.system.api.permission.dto.DeptDataPermissionRespDTO;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.ibatis.annotations.Mapper;
 
 /**
@@ -30,6 +31,16 @@ public interface OaOutMapper extends BaseMapperX<OaOutDO> {
                 .likeIfPresent(OaOutDO::getApplyEmployeeName, reqVO.getApplyEmployeeName())
                 .betweenIfPresent(OaOutDO::getCreateTime, reqVO.getCreateTime())
                 .orderByDesc(OaOutDO::getId);
+        // 模糊查询字段:申请人applyEmployeeName、外出人employeeName、外出地点destination
+        String str = reqVO.getStr();
+        if (StringUtils.isNotBlank(str)) {
+            lambdaQueryWrapperX.and(wrapper ->
+                    wrapper.like(OaOutDO::getApplyEmployeeName, str)
+                            .or()
+                            .like(OaOutDO::getEmployeeName, str)
+                            .or()
+                            .like(OaOutDO::getDestination, str));
+        }
         // 数据权限
         DeptDataPermissionRespDTO deptDataPermission = reqVO.getDeptDataPermission();
         if (deptDataPermission != null) {