|
@@ -714,6 +714,33 @@
|
|
|
order by b.order_no, a.order_no;
|
|
|
</select>
|
|
|
|
|
|
+ <!--获取同期管理人员实际工作月数明细-->
|
|
|
+ <select id="getManageMouth" parameterType="com.diagbot.vo.FilterVO" resultType="java.util.Map">
|
|
|
+ select
|
|
|
+ sum(case when b.department = 1 or b.department = 2 then IFNULL(firDate,0)+ IFNULL(secDate,0)+ IFNULL(thrcDate,0)+
|
|
|
+ IFNULL(fouDate,0) end)/30 as firNum,
|
|
|
+ sum(case when b.department = 0 or b.department = 2 then IFNULL(firDate,0)+ IFNULL(secDate,0)+ IFNULL(thrcDate,0)+
|
|
|
+ IFNULL(fouDate,0) end)/30 as secNum,
|
|
|
+ sum(case when b.position = 2 then IFNULL(firDate,0)+ IFNULL(secDate,0)+ IFNULL(thrcDate,0)+ IFNULL(fouDate,0) end)
|
|
|
+ /30 as thrNum
|
|
|
+ from (
|
|
|
+ SELECT
|
|
|
+ a.department,
|
|
|
+ a.position,
|
|
|
+ sum(case when <![CDATA[a.hire_date>#{startDate}]]> and <![CDATA[a.resignation_time<#{endDate}]]>
|
|
|
+ THEN TIMESTAMPDIFF(day,a.hire_date,a.resignation_time) END) as firDate,
|
|
|
+ sum( case when <![CDATA[a.hire_date<#{startDate}]]> and <![CDATA[a.resignation_time<#{endDate}]]>
|
|
|
+ THEN TIMESTAMPDIFF(day,#{startDate},a.resignation_time) END) as secDate,
|
|
|
+ sum(case when <![CDATA[a.hire_date>#{startDate}]]> and <![CDATA[a.resignation_time>#{endDate}]]>
|
|
|
+ THEN TIMESTAMPDIFF(day,a.hire_date,#{endDate}) END) as thrcDate,
|
|
|
+ sum(case when <![CDATA[a.hire_date<#{startDate}]]> and <![CDATA[a.resignation_time>#{endDate}]]>
|
|
|
+ THEN TIMESTAMPDIFF(day,#{startDate},#{endDate}) END) as fouDate
|
|
|
+ FROM `med_management_info` a
|
|
|
+ where a.is_deleted = 'N'
|
|
|
+ group by a.department,a.position
|
|
|
+ )b
|
|
|
+ </select>
|
|
|
+
|
|
|
<!-- 各科室缺陷占比-全院-首页 -->
|
|
|
<select id="entryByDept" parameterType="com.diagbot.vo.FilterVO"
|
|
|
resultType="com.diagbot.dto.NumDTO">
|