Browse Source

库存调整用户查询

Eric 2 years ago
parent
commit
1322fc8337

+ 11 - 0
cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/io/request/coupon/CouponInventoryVO.java

@@ -13,6 +13,7 @@ import lombok.AllArgsConstructor;
 import lombok.Builder;
 import lombok.Data;
 import lombok.NoArgsConstructor;
+import org.apache.commons.lang3.StringUtils;
 import org.joda.time.DateTime;
 import org.springframework.format.annotation.DateTimeFormat;
 
@@ -43,6 +44,9 @@ public class CouponInventoryVO {
         @ApiModelProperty("操作人")
         private Long userId;
 
+        @ApiModelProperty("用户昵称或名称匹配")
+        private String keyword;
+
         @ApiModelProperty("数据类型: ADDITION(添加) REDUCE(减少)")
         private CouponInventoryEnum dataType;
 
@@ -93,6 +97,13 @@ public class CouponInventoryVO {
             }
             return endTime;
         }
+
+        public String getKeyword() {
+            if (StringUtils.isNotEmpty(this.keyword)) {
+                return keyword;
+            }
+            return null;
+        }
     }
 
     /**

+ 2 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/queryInfo/CouponInventoryQuery.java

@@ -23,6 +23,8 @@ public class CouponInventoryQuery implements Serializable {
     private Long couponId;
     // 操作人ID
     private Long userId;
+    // 用户名称匹配
+    private String keyword;
     // 调整类型
     private CouponInventoryEnum dataType;
     // 按用户分组

+ 3 - 0
cooleshow-user/user-biz/src/main/resources/config/mybatis/CouponInfoMapper.xml

@@ -94,6 +94,9 @@
             <if test="record.userId != null">
                 AND t1.user_id_ = #{record.userId}
             </if>
+            <if test="record.keyword != null">
+                AND (t2.username_ LIKE '%${record.keyword}%' OR t2.real_name_ LIKE '%${record.keyword}%')
+            </if>
             <if test="record.startTime != null and record.endTime != null">
                 AND (#{record.startTime} &lt;= UNIX_TIMESTAMP(t1.created_time_) AND UNIX_TIMESTAMP(t1.created_time_) &lt;= #{record.endTime})
             </if>