Selaa lähdekoodia

charts statistics

chenrj-PC\chenrj 8 vuotta sitten
vanhempi
commit
917a3c3583

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

@@ -137,4 +137,23 @@ public class StatisticsController extends BaseController {
     	List<StatisticsBean> returnList=  statisticsService.getFSUp5Person(obj);
     	return super.returnSuccessResult(returnList);
     }
+    
+    /**
+     * 获取收费站中人的12月情况
+     */
+    @RequestMapping(value = "/one/person/year/info")
+    public String getFsOnePersonInfo(@RequestBody StatisticsBean obj){
+    	List<StatisticsBean> returnList=  statisticsService.getOneFSCheckedInfo(obj);
+    	return super.returnSuccessResult(returnList);
+    }
+    
+    /**
+     * 获取收费站各项扣分情况
+     */
+    @RequestMapping(value = "/one/person/checkedItem/info")
+    public String getFsOnePersonCheckedItemInfo(@RequestBody StatisticsBean obj){
+    	List<StatisticsBean> returnList=  statisticsService.getOneCheckedItemInfo(obj);
+    	return super.returnSuccessResult(returnList);
+    }
+    
 }

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

@@ -30,4 +30,8 @@ public interface StatisticsDao  {
 	public List<StatisticsBean> selectCheckedScoreList(StatisticsBean obj);
 	
 	public List<StatisticsBean> selectCheckedItemScoreInfo(StatisticsBean obj);
+	
+	public List<StatisticsBean> selectOneCheckedInfo(StatisticsBean obj);
+	
+	public List<StatisticsBean> selectOneCheckedItemInfo(StatisticsBean obj);
 }

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

@@ -188,4 +188,83 @@
 		GROUP BY m.parent_id
      </select>
      
+     
+     <sql id="selectOneCheckedInfo">
+		 SELECT
+			check_num_t.checked_num , checked_score_t.mth, checked_score_t.checkd_all_score AS all_check_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 != 22
+				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>
+				<if test="user_id !=null ">
+					AND t.checked_person = #{user_id}
+				</if>
+				GROUP BY mth
+			) 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 != 22
+			<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>
+			<if test="user_id !=null ">
+				AND t.checked_person = #{user_id}
+			</if>
+			GROUP BY 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="selectOneCheckedInfo" parameterType="com.xintong.visualinspection.bean.StatisticsBean" resultType="com.xintong.visualinspection.bean.StatisticsBean">
+     	SELECT * FROM ( <include refid="selectOneCheckedInfo"/> ) t
+     </select>
+     
+     <select id="selectOneCheckedItemInfo" 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
+				AND checked_person = #{user_id}
+			 ) t 
+			LEFT JOIN check_item ci ON t.parent_id = ci.id
+			) m ON t.id = m.task_id
+			where t.check_status !=22
+			<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 m.parent_id
+     
+     </select>
+     
 </mapper>

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

@@ -57,4 +57,10 @@ public interface StatisticsService {
 	
 	// 收费站进步前5
 	public List<StatisticsBean> getFSUp5Person(StatisticsBean obj);
+	
+	// 个人收费员的一年得分情况
+	public List<StatisticsBean> getOneFSCheckedInfo(StatisticsBean obj);
+	
+	// 个人各项扣分情况
+	public List<StatisticsBean> getOneCheckedItemInfo(StatisticsBean obj);
 }

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

@@ -872,5 +872,16 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
 		}
 		return t_mthList;
 	}
+
+	@Override
+	public List<StatisticsBean> getOneFSCheckedInfo(StatisticsBean obj) {
+		return  statisticsDao.selectOneCheckedInfo(obj);
+	}
+
+	@Override
+	public List<StatisticsBean> getOneCheckedItemInfo(StatisticsBean obj) {
+		
+		return statisticsDao.selectOneCheckedItemInfo(obj);
+	}
 	
 }