jinxia.mo 1 месяц назад
Родитель
Сommit
1a3f14bee9
1 измененных файлов с 7 добавлено и 7 удалено
  1. 7 7
      ie-system/src/main/resources/mapper/dz/DzCardsMapper.xml

+ 7 - 7
ie-system/src/main/resources/mapper/dz/DzCardsMapper.xml

@@ -60,7 +60,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 AND (dept_id = #{deptId} OR dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId}, ancestors) ))
             </if>
             <if test="agentId != null ">
-                AND (agent_id = #{agentId} OR agent_id IN ( SELECT t.agent_id FROM dz_agent t WHERE t.agent_id=#{agentId} ))
+                AND (agent_id = #{agentId} OR leaf_agent_id = #{agentId} )
             </if>
             <if test="leafAgentId != null "> and leaf_agent_id = #{leafAgentId}</if>
             <if test="campusId != null "> and campus_id = #{campusId}</if>
@@ -88,16 +88,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
             <!-- 根据统计类型添加条件 -->
             <if test="statisticsType != null and statisticsType == 'openCard'">
-                AND (status = 10 OR status = 20 OR status = 30)
+                AND distribute_status = 10 and type in (2,6,7)
             </if>
             <if test="statisticsType != null and statisticsType == 'closeCard'">
-                AND distribute_status = 30
+                AND distribute_status = 30 and type in (2,6,7)
             </if>
             <if test="statisticsType != null and statisticsType == 'payCard'">
-                AND pay_status = 20
+                AND pay_status = 20 and type in (2,6,7)
             </if>
             <if test="statisticsType != null and statisticsType == 'settlementCard'">
-                AND is_settlement = 1
+                AND is_settlement = 1 and type in (2,6,7)
             </if>
         </where>
         order by card_id desc
@@ -380,14 +380,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             T1.name AS agentName,
             T2.agent_id AS leafAgentId,
             T2.name AS leafAgentName,
-            SUM(CASE WHEN T0.status = 10 OR T0.status = 20 OR T0.status = 30 THEN 1 ELSE 0 END) AS openCard,
+            SUM(CASE WHEN T0.distribute_status = 10 THEN 1 ELSE 0 END) AS openCard,
             SUM(CASE WHEN T0.distribute_status = 30 THEN 1 ELSE 0 END) AS closeCard,
             SUM(CASE WHEN T0.pay_status = 20 THEN 1 ELSE 0 END) AS payCard,
             SUM(CASE WHEN T0.is_settlement = 1 THEN 1 ELSE 0 END) AS settlementCard
         FROM `dz_cards` T0
         LEFT JOIN `dz_agent` T2 ON T0.leaf_agent_id = T2.agent_id
         LEFT JOIN `dz_agent` T1 ON T0.agent_id = T1.agent_id
-        WHERE T0.leaf_agent_id IS NOT NULL
+        WHERE T0.leaf_agent_id IS NOT NULL and type in (2,6,7)
         <if test="deptId != null">
             AND T0.dept_id = #{deptId}
         </if>