change 4 anni fa
parent
commit
d9db5d0d8f

+ 6 - 3
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/impl/OrderServiceImpl.java

@@ -5,6 +5,7 @@ import cn.hutool.core.convert.Convert;
 import cn.hutool.core.lang.Validator;
 import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.zhongzheng.common.exception.CustomException;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.modules.activity.domain.ActivityConfiguration;
@@ -264,9 +265,11 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
         lqw.eq(bo.getUserId() != null, Order::getUserId, bo.getUserId());
         lqw.eq(Order::getOrderStatus, 1);
         List<Order> list = this.list(lqw);
-        BigDecimal price = new BigDecimal("0");
-        for (Order order : list) {
-            price = price.add(order.getOrderPrice());
+        if(!CollectionUtils.isEmpty(list)) {
+            BigDecimal price = new BigDecimal("0");
+            for (Order order : list) {
+                price = price.add(order.getOrderPrice());
+            }
         }
         List<CouponVo> couponVos=iCouponService.listUserOrder(bo.getUserId(),0);
         List<CouponVo> couponDiscounts=iCouponService.listUserOrder(bo.getUserId(),1);

+ 5 - 4
zhongzheng-system/src/main/resources/mapper/modules/exam/ExamArrangementMapper.xml

@@ -72,12 +72,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         WHERE 1=1
           AND s.status != 0
         <if test="startTime != null and startTime != ''">
-            and exists(select * from exam_arrangement_time where start_time BETWEEN #{startTime} and #{endTime})
-            or exists(select * from exam_arrangement_time where end_time BETWEEN #{startTime} and #{endTime})
+            and exists(select * from exam_arrangement_time where start_time BETWEEN #{startTime} and #{endTime}
+            or  end_time BETWEEN #{startTime} and #{endTime})
         </if>
         <if test="signStartTime != null and signStartTime != ''">
-            and exists(select * from exam_arrangement where sign_start_time BETWEEN #{signStartTime} and #{signEndTime})
-            or exists(select * from exam_arrangement where sign_end_time BETWEEN #{signStartTime} and #{signEndTime})
+            and exists(select * from exam_arrangement where sign_start_time BETWEEN #{signStartTime} and #{signEndTime}
+        or sign_end_time BETWEEN #{signStartTime} and #{signEndTime})
+
         </if>
         <if test="examPeriod != null and examPeriod != ''">
             and s.exam_period like concat('%',#{examPeriod},'%')

+ 4 - 4
zhongzheng-system/src/main/resources/mapper/modules/exam/ExamArrangementStudentMapper.xml

@@ -135,8 +135,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         WHERE 1=1
           AND e.status != 0
         <if test="startTime != null and startTime != ''">
-            and exists(select * from exam_arrangement_time where start_time BETWEEN #{startTime} and #{endTime})
-            or exists(select * from exam_arrangement_time where end_time BETWEEN #{startTime} and #{endTime})
+            and exists(select * from exam_arrangement_time where start_time BETWEEN #{startTime} and #{endTime}
+            or  end_time BETWEEN #{startTime} and #{endTime})
         </if>
         <if test="examTypeId != null and examTypeId != ''">
             AND e.exam_type_id = #{examTypeId}
@@ -145,10 +145,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             and e.exam_period like concat('%',#{examPeriod},'%')
         </if>
         <if test="idCard != null and idCard != ''">
-            AND u.id_card = #{idCard}
+            AND u.id_card like concat('%',#{idCard},'%')
         </if>
         <if test="realname != null and realname != ''">
-            AND u.realname = #{realname}
+            AND u.realname like concat('%',#{realname},'%')
         </if>
     </select>