Explorar o código

fix 用户查找

he2802 %!s(int64=3) %!d(string=hai) anos
pai
achega
5c8a15481f

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/bo/UserQueryBo.java

@@ -172,4 +172,8 @@ public class UserQueryBo extends BaseEntity {
 	/** 开始时间 */
 	@ApiModelProperty("开始时间")
 	private Long endTime;
+
+	@ApiModelProperty("goodsSearchKey")
+	private String goodsSearchKey;
+
 }

+ 29 - 0
zhongzheng-system/src/main/resources/mapper/modules/user/UserMapper.xml

@@ -177,6 +177,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             </foreach>
         </if>
         <if test="businessId != null and businessId != ''">
+            and og.`status` = 1
+            and og.refund_status in (0,1,3)
+            and og.pay_status in (2,3,4))
             AND g.business_id = #{businessId}
         </if>
         <if test="startTime != null and startTime != ''">
@@ -206,6 +209,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="empty != null and empty != ''" >
            and u.realname is NOT NULL
         </if>
+        <if test="goodsSearchKey != null and goodsSearchKey != ''" >
+            and ( SELECT
+            count(og.*)
+            FROM
+            `order` o
+            LEFT JOIN order_goods og on o.order_sn = og.order_sn
+            where 1=1
+            and og.`status` = 1
+            and og.refund_status in (0,1,3)
+            and og.pay_status in (2,3,4))
+            and (g.goods_name like concat('%', #{goodsSearchKey}, '%') or g.code like concat('%', #{goodsSearchKey}, '%'))
+            and o.user_id = u.user_id)>0
+        </if>
+        <if test="goodsSearchKey != null and goodsSearchKey != ''" >
+            and ( SELECT
+            count(og.*)
+            FROM
+            `order` o
+            LEFT JOIN order_goods og on o.order_sn = og.order_sn
+            where 1=1
+            and og.`status` = 1
+            and og.refund_status in (0,1,3)
+            and og.pay_status in (2,3,4))
+            and (g.goods_name like concat('%', #{goodsSearchKey}, '%') or g.code like concat('%', #{goodsSearchKey}, '%'))
+            and o.user_id = u.user_id)>0
+        </if>
         <if test="gradePoint != null and gradePoint == 1" >
             AND (SELECT COUNT(u.user_id) FROM class_grade_user cgu where 1=1 AND u.status in (1) and cgu.user_id= u.user_id) > 0
         </if>