Przeglądaj źródła

SAI开项管理 - “各班组当年至今的提交数量”SQL优化

wangggziwen 2 miesięcy temu
rodzic
commit
c08d203dad

+ 4 - 4
master/src/main/resources/mybatis/production/TSaiApplyMapper.xml

@@ -50,11 +50,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <select id="selectTeamAnalysis" resultMap="TSaiApplyResult">
-        select d.DICT_LABEL as applicant_team, b.act as team_count
-        from (select a.APPLICANT_TEAM at, count(a.APPLICANT_TEAM) act from T_SAI_APPLY a
+        select d.DICT_LABEL as applicant_team, b.act as team_count, b.del_flag
+        from (select a.APPLICANT_TEAM at, count(a.APPLICANT_TEAM) act, del_flag from T_SAI_APPLY a
         where extract(year from a.apply_date) = extract(year from sysdate)
-        group by a.APPLICANT_TEAM order by a.APPLICANT_TEAM) b
-        left join SYS_DICT_DATA d on d.DICT_VALUE=b.at where d.DICT_TYPE='TEAM_DIVIDE' and d.DICT_LABEL &lt;&gt; 'W'
+        group by a.APPLICANT_TEAM, a.del_flag order by a.APPLICANT_TEAM) b
+        left join SYS_DICT_DATA d on d.DICT_VALUE=b.at where d.DICT_TYPE='TEAM_DIVIDE' and d.DICT_LABEL &lt;&gt; 'W' and b.del_flag=0
     </select>
 
     <select id="selectPersonalAnalysis" resultMap="TSaiApplyResult">