chenrj-PC\chenrj hace 8 años
padre
commit
771dac6711

+ 8 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/bean/StatisticsBean.java

@@ -68,6 +68,14 @@ public class StatisticsBean {
     
     private List<Integer> seq_checked_score = new ArrayList<>() ;
     
+    private List<Organ> dept_list  ;
+    
     private String start_score;
     private String end_score;
+    
+    // 查询标记
+    private Integer queryType ;
+    
+    // 月份
+    private String mth ;
 }

+ 11 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/controller/StatisticsController.java

@@ -54,4 +54,15 @@ public class StatisticsController extends BaseController {
     	List<StatisticsBean> lists=  statisticsService.getFeeStationCheckItemScore(obj);
     	return super.returnSuccessResult(lists);
     }
+    
+    /**
+     * 12个月考核等分总体
+     */
+    @RequestMapping(value = "/score/year/info")
+    public String selectYearScoreChange(@RequestBody StatisticsBean obj){
+    	List<StatisticsBean> lists=  statisticsService.getYearScoreChange(obj);
+    	return super.returnSuccessResult(lists);
+    }
+    
+    
 }

+ 2 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/dao/master/StatisticsDao.java

@@ -22,4 +22,6 @@ public interface StatisticsDao  {
 	public List<StatisticsBean> selectFeeStationCheckedScore(StatisticsBean obj);
    
 	public List<StatisticsBean> selectFeeStationCheckedPersonScoreDetail(StatisticsBean obj);
+	
+	public List<StatisticsBean> selectYearScoreInfo(StatisticsBean obj);
 }

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

@@ -62,5 +62,71 @@
 			</if> )
 			u LEFT JOIN check_item s ON u.parent_id = s.id GROUP  BY dept_id,item_id
     </select>
-       
+      
+     <sql id="selectAllCheckedInfo">
+		 SELECT
+			check_num_t.checked_num , checked_score_t.mth, checked_score_t.checkd_all_score , checked_score_t.checked_person,checked_score_t.checked_dept
+		FROM
+			(
+				SELECT
+					monthfunc (t.start_time) AS mth,
+					sum(m.check_item_score) AS checkd_all_score,
+					t.*
+				FROM
+					check_task t,
+					check_score m
+				WHERE
+					t.id = m.task_id
+				AND t.check_status != 23
+				AND t.checked_person IS NOT NULL
+				<if test="start_date !=null">
+					AND t.start_time >= #{start_date}
+				</if>
+				<if test="end_date !=null">
+					AND t.end_time &lt;= #{end_date}
+				</if>
+				GROUP BY
+					mth,
+					t.checked_person
+			) checked_score_t
+		LEFT JOIN (
+			SELECT
+				COUNT(t.checked_person) AS checked_num,
+				t.checked_person,
+				monthfunc (t.start_time) AS mth,
+				t.id
+			FROM
+				check_task t
+			WHERE
+				t.checked_person IS NOT NULL
+			AND t.check_status != 23
+			<if test="start_date !=null">
+				AND t.start_time >= #{start_date}
+			</if>
+			<if test="end_date !=null">
+				AND t.end_time &lt;= #{end_date}
+			</if>
+			GROUP BY
+				t.checked_person,
+				mth
+		) check_num_t ON checked_score_t.checked_person = check_num_t.checked_person
+		AND check_num_t.mth = checked_score_t.mth
+     </sql>
+    
+    <select id="selectYearScoreInfo" parameterType="com.xintong.visualinspection.bean.StatisticsBean" resultType="com.xintong.visualinspection.bean.StatisticsBean">
+    	SELECT sum(tab.checkd_all_score) AS all_check_score  , sum(tab.checked_num) AS checked_num  , tab.mth FROM ( <include refid="selectAllCheckedInfo" />  ) tab 
+    	WHERE 1=1 
+    	<if test="dept_list!=null and queryType == 2 ">
+    		AND	tab.checked_dept IN
+		    	<foreach item="obj"  collection="dept_list" open="("
+		            separator="," close=")">
+		            #{obj.id}  
+		         </foreach>
+    	</if>
+    	<if test="dept_id!=null and queryType ==3">
+    		AND tab.checked_dept=#{dept_id}
+    	</if>
+    	GROUP BY tab.mth
+    </select>
+      
 </mapper>

+ 2 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/service/StatisticsService.java

@@ -34,4 +34,6 @@ public interface StatisticsService {
 	
 	public void getFeeStationCheckItemScore(StatisticsBean obj,HttpServletRequest req,HttpServletResponse resp);
 	
+	public List<StatisticsBean> getYearScoreChange(StatisticsBean obj);
+	
 }

+ 17 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/service/impl/StatisticsServiceImpl.java

@@ -23,6 +23,7 @@ import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import com.xintong.visualinspection.bean.Organ;
 import com.xintong.visualinspection.bean.StatisticsBean;
 import com.xintong.visualinspection.bean.StatisticsBo;
 import com.xintong.visualinspection.bean.User;
@@ -403,4 +404,20 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
 			logger.error(e.toString());
 		}
 	}
+
+	@Override
+	public List<StatisticsBean> getYearScoreChange(StatisticsBean obj) {
+		// 导管中心
+		if(obj.getQueryType()!=null && obj.getQueryType() == 2){
+			// 检索当前导管中心下的deptid
+			Organ organ =new Organ();
+			organ.setParentid(obj.getDept_id().intValue());
+			List<Organ> list = departmentDao.getOrgan(organ);
+			// 将导管中心下的收费站部门id 列表放入到list中
+			obj.setDept_list(list);
+		}
+		
+		List<StatisticsBean> lists = statisticsDao.selectYearScoreInfo(obj);
+		return lists;
+	}
 }