浏览代码

Merge branch 'master' of http://git_xt.jsxt.jsjtyxt.com/wenhongquan/VisualInspection

minitiger 8 年之前
父节点
当前提交
484e3ffb5a

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

@@ -150,7 +150,7 @@
      </sql>
      </sql>
      
      
      <select id="selectCheckedScoreList" parameterType="com.xintong.visualinspection.bean.StatisticsBean" resultType="com.xintong.visualinspection.bean.StatisticsBean">
      <select id="selectCheckedScoreList" parameterType="com.xintong.visualinspection.bean.StatisticsBean" resultType="com.xintong.visualinspection.bean.StatisticsBean">
-     	SELECT tab.checkd_all_score AS all_check_score,tab.checked_person AS user_id , tab.checked_dept AS dept_id   FROM (  <include refid="selectEveryCheckedInfo"/> ) tab 
+     	SELECT tab.checkd_all_score AS all_check_score,tab.checked_person AS user_id , tab.checked_dept AS dept_id ,tab.checked_num  FROM (  <include refid="selectAllCheckedInfo"/> ) tab 
      	WHERE 1=1 
      	WHERE 1=1 
      	<if test="dept_list!=null and queryType == 1 and dept_list.size()>0 ">
      	<if test="dept_list!=null and queryType == 1 and dept_list.size()>0 ">
     		AND	tab.checked_dept IN
     		AND	tab.checked_dept IN
@@ -162,7 +162,31 @@
     	<if test="dept_id!=null and queryType ==2">
     	<if test="dept_id!=null and queryType ==2">
     		AND tab.checked_dept=#{dept_id}
     		AND tab.checked_dept=#{dept_id}
     	</if>
     	</if>
-     	
      </select>
      </select>
      
      
+     <select id="selectCheckedItemScoreInfo" parameterType="com.xintong.visualinspection.bean.StatisticsBean" resultType="com.xintong.visualinspection.bean.StatisticsBean">
+     	SELECT count(m.check_item_score) AS checked_num , sum(m.check_item_score) AS all_check_score , m.parent_id,m.check_item_name AS name FROM check_task t INNER JOIN
+		(
+			select ci.name AS check_item_name , t.* FROM
+			(  SELECT ci.parent_id, t.* from check_score t LEFT JOIN check_item  ci ON t.check_item_id = ci.id
+				WHERE 1=1
+				<if test="dept_list!=null and queryType == 1 and dept_list.size()>0 ">
+		    		AND	t.checked_dept IN
+				    	<foreach item="obj"  collection="dept_list" open="("
+				            separator="," close=")">
+				            #{obj.id}  
+				         </foreach>
+		    	</if>
+		    	<if test="dept_id!=null and queryType ==2">
+		    		AND t.checked_dept=#{dept_id}
+		    	</if>
+			 ) t 
+			LEFT JOIN check_item ci ON t.parent_id = ci.id
+			) m ON t.id = m.task_id
+			where t.check_status !=23
+			AND monthfunc( t.start_time ) = #{mth}
+		GROUP BY m.parent_id
+     </select>
+     
+     
 </mapper>
 </mapper>

+ 12 - 3
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.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
+import com.xintong.visualinspection.bean.Constant;
 import com.xintong.visualinspection.bean.FeeStation;
 import com.xintong.visualinspection.bean.FeeStation;
 import com.xintong.visualinspection.bean.Organ;
 import com.xintong.visualinspection.bean.Organ;
 import com.xintong.visualinspection.bean.StatisticsBean;
 import com.xintong.visualinspection.bean.StatisticsBean;
@@ -34,6 +35,7 @@ import com.xintong.visualinspection.dao.master.StatisticsDao;
 import com.xintong.visualinspection.service.BaseService;
 import com.xintong.visualinspection.service.BaseService;
 import com.xintong.visualinspection.service.StatisticsService;
 import com.xintong.visualinspection.service.StatisticsService;
 import com.xintong.visualinspection.util.CacheUtil;
 import com.xintong.visualinspection.util.CacheUtil;
+import com.xintong.visualinspection.util.CodeUtil;
 
 
 /**
 /**
  * 文件名:StatisticsServiceImpl 版本信息:日期:2017/3/30 Copyright 江苏省交通规划设计院 Corporation
  * 文件名:StatisticsServiceImpl 版本信息:日期:2017/3/30 Copyright 江苏省交通规划设计院 Corporation
@@ -64,12 +66,19 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
 
 
 		Map<Long, StatisticsBo> statisticBoMap = new HashMap<Long, StatisticsBo>();
 		Map<Long, StatisticsBo> statisticBoMap = new HashMap<Long, StatisticsBo>();
 
 
+		Constant t =  CodeUtil.getCodeByFlagAndValue("feestation_check_jobs", "1");
+		
+		String[] postions = t.getCode_name().split(",");
+		
 		User user = new User();
 		User user = new User();
 		List<Integer> positionList = new ArrayList<Integer>();
 		List<Integer> positionList = new ArrayList<Integer>();
-		positionList.add(1);
-		positionList.add(6);
+		for(int i =0 ;i<postions.length;i++){
+			positionList.add(Integer.parseInt(postions[i]));
+		}
+//		positionList.add(1);
+//		positionList.add(6);
 		user.setPosition_ids(positionList);
 		user.setPosition_ids(positionList);
-//		user.setPositionid(1);
+
 		if (obj.getDept_id() != null)
 		if (obj.getDept_id() != null)
 			user.setOrganid(obj.getDept_id().intValue());
 			user.setOrganid(obj.getDept_id().intValue());
 		List<User> listUserts = userInfoDao.getUsers(user);
 		List<User> listUserts = userInfoDao.getUsers(user);