浏览代码

大中型查询修改

wucl 3 周之前
父节点
当前提交
93791dd4cc
共有 2 个文件被更改,包括 2 次插入2 次删除
  1. 1 1
      dao/src/main/resources/mapper/MajorMapper.xml
  2. 1 1
      dao/src/main/resources/mapper/MajorTargetMapper.xml

+ 1 - 1
dao/src/main/resources/mapper/MajorMapper.xml

@@ -701,7 +701,7 @@
             and m.business_object_type = #{major.businessObjectType}
         </if>
         <if test="major!=null and major.userIds!=null and major.userIds.size!=0">
-            or
+            and
             m.client_manager_id  in
             <foreach collection="
             major.userIds" open="(" close=")" separator="," item="userId">#{userId}

+ 1 - 1
dao/src/main/resources/mapper/MajorTargetMapper.xml

@@ -93,7 +93,7 @@
     </select>
 
     <select id="getEvaluateAmountByTargetId" parameterType="java.util.List" resultType="java.math.BigDecimal">
-        select sum(evaluate_value) from major_target where evaluate_value is not null and deleted = 0 and id in (
+        select ifnull(sum(evaluate_value),0) from major_target where evaluate_value is not null and deleted = 0 and id in (
             <foreach collection="targetIds" item="item" separator="," index="index">
                 #{item}
             </foreach>