yonge 3 năm trước cách đây
mục cha
commit
8a964ee914

+ 2 - 2
mec-biz/src/main/resources/config/mybatis/CloudTeacherOrderMapper.xml

@@ -403,10 +403,10 @@
             <if test="orderNo != null and orderNo != ''">
                 AND tor.order_no_ LIKE CONCAT('%', #{orderNo}, '%')
             </if>
-            <if test="startTime != null and startTime != ''">
+            <if test="startTime != null">
                 <![CDATA[ AND tor.created_time_ >= #{startTime} ]]>
             </if>
-            <if test="endTime != null and startTime != ''">
+            <if test="endTime != null">
                 <![CDATA[ AND tor.created_time_ <= #{endTime} ]]>
             </if>
         </where>

+ 5 - 0
mec-common/common-core/src/main/java/com/ym/mec/common/controller/BaseController.java

@@ -6,12 +6,14 @@ import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.exception.BizException;
 import com.ym.mec.thirdparty.exception.ThirdpartyException;
 import com.ym.mec.util.http.HttpUtil;
+
 import org.apache.commons.codec.binary.Base64;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.exception.ExceptionUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.context.support.DefaultMessageSourceResolvable;
+import org.springframework.dao.DataIntegrityViolationException;
 import org.springframework.http.HttpStatus;
 import org.springframework.security.access.AccessDeniedException;
 import org.springframework.validation.BindException;
@@ -23,6 +25,7 @@ import org.springframework.web.bind.annotation.ExceptionHandler;
 import javax.crypto.Mac;
 import javax.crypto.spec.SecretKeySpec;
 import javax.servlet.http.HttpServletRequest;
+
 import java.net.URLEncoder;
 import java.util.HashMap;
 import java.util.Map;
@@ -108,6 +111,8 @@ public class BaseController {
                     .map(FieldError::getDefaultMessage)
                     .collect(Collectors.joining());
             return failed(errorMsg);
+        } else if(e instanceof DataIntegrityViolationException){
+        	return failed("数据库异常:" + e.getMessage());
         }
 		try {
 			Map<String,Object> paramMap = new HashMap<>(2);