chenrj-PC\chenrj 9 лет назад
Родитель
Сommit
217eeed823

+ 4 - 4
VisualInspection_server/src/main/java/com/xintong/visualinspection/mapper/master/StatisticsMapper.xml

@@ -4,7 +4,7 @@
     
     <select id="selectStatistics" parameterType="com.xintong.visualinspection.bean.StatisticsBean" resultType="com.xintong.visualinspection.bean.StatisticsBean">
     	SELECT  u.checked_person AS user_id , u.checked_dept AS dept_id ,u.parent_id AS item_id ,sum(u.score) AS score ,s.name  FROM (
-			SELECT t.checked_person , t.checked_dept,ci.parent_id, t.score  FROM check_score t 
+			SELECT t.checked_person , t.checked_dept,ci.parent_id, ci.score  FROM check_score t 
 			LEFT JOIN check_item ci ON t.check_item_id = ci.id
 			WHERE 1=1 
 			<if test="start_date!=null and end_date != null">
@@ -39,8 +39,8 @@
     </select>
     
     <select id="selectFeeStationCheckedScore" parameterType="com.xintong.visualinspection.bean.StatisticsBean" resultType="com.xintong.visualinspection.bean.StatisticsBean">
-    	SELECT sum(t.score) AS score ,t.checked_dept AS dept_id 
-    		FROM check_score t 
+    	SELECT sum(c.score) AS score ,t.checked_dept AS dept_id 
+    		FROM check_score t LEFT JOIN check_item c ON t.check_item_id = c.id
     		WHERE 1=1
     		<if test="start_date!=null and end_date != null">
 		        AND	 t.update_time &gt;= #{start_date} AND t.update_time &lt;= #{end_date} 
@@ -50,7 +50,7 @@
     
     <select id="selectFeeStationCheckedPersonScoreDetail" parameterType="com.xintong.visualinspection.bean.StatisticsBean" resultType="com.xintong.visualinspection.bean.StatisticsBean">
     	    SELECT  u.checked_dept AS dept_id ,u.parent_id AS item_id ,sum(u.score) AS score ,s.name  FROM (
-			SELECT  t.checked_dept,ci.parent_id, t.score  FROM check_score t 
+			SELECT  t.checked_dept,ci.parent_id, ci.score  FROM check_score t 
 			LEFT JOIN check_item ci ON t.check_item_id = ci.id
 			WHERE 1=1
 			<if test="start_date!=null and end_date != null">