浏览代码

条件加括号

xuefy 3 年之前
父节点
当前提交
ac54f6747b

+ 10 - 8
sc-service/src/main/java/com/huyi/service/repayment/controller/repaymentController.java

@@ -135,14 +135,16 @@ public class repaymentController extends BaseController {
         Map map = new HashMap(16);
         map.put("zfrId",zfrId);
         List<Map> result = ownRepaymentService.selectById(map);
-        String fileId =CommonUtil.objToString(result.get(0).get("fileId"));
-        if(CommonUtil.isNotEmpty(fileId)){
-            PubFileInf fileInf = fileInfService.getById(fileId);
-            String url = fileInf.getPfiUrl();
-            String fileName = fileInf.getPfiFileName();
-            Map fileMap = result.get(0);
-            fileMap.put("fileUrl",url);
-            fileMap.put("fileName",fileName);
+        if(result.size() > 0){
+            String fileId =CommonUtil.objToString(result.get(0).get("fileId"));
+            if(CommonUtil.isNotEmpty(fileId)){
+                PubFileInf fileInf = fileInfService.getById(fileId);
+                String url = fileInf.getPfiUrl();
+                String fileName = fileInf.getPfiFileName();
+                Map fileMap = result.get(0);
+                fileMap.put("fileUrl",url);
+                fileMap.put("fileName",fileName);
+            }
         }
         return AjaxResult.success(result);
     }

+ 2 - 2
sc-service/src/main/resources/mapper/credit/OwnCreditMapper.xml

@@ -250,7 +250,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 <!--                and b.zbi_id  NOT IN (${paramMap.billIdList})-->
 <!--            </if>-->
             <if test="paramMap.idList != null  and paramMap.idList != ''">
-                and b.zbi_id  IN (${paramMap.idList}) or  b.zbi_id  NOT IN (${paramMap.billIdList})
+                and (b.zbi_id  IN (${paramMap.idList}) or  b.zbi_id  NOT IN (${paramMap.billIdList}))
             </if>
             <if test="paramMap.idList == null  and paramMap.idList == ''">
                 <if test="paramMap.billIdList != null  and paramMap.billIdList != ''">
@@ -300,7 +300,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 <!--                and b.zbi_id  NOT IN (${paramMap.billIdList})-->
 <!--            </if>-->
             <if test="paramMap.idList != null  and paramMap.idList != ''">
-                and b.zbi_id  IN (${paramMap.idList}) or  b.zbi_id  NOT IN (${paramMap.billIdList})
+                and (b.zbi_id  IN (${paramMap.idList}) or  b.zbi_id  NOT IN (${paramMap.billIdList}))
             </if>
             <if test="paramMap.idList == null  or paramMap.idList == ''">
                 <if test="paramMap.billIdList != null  and paramMap.billIdList != ''">