Commit 83228dac authored by 廖旭伟's avatar 廖旭伟

异常分值分布情况

parent fb9f9950
...@@ -33,4 +33,22 @@ public interface StaffPerformStatDao extends ICRUDDao<StaffPerformStatEntity,Lo ...@@ -33,4 +33,22 @@ public interface StaffPerformStatDao extends ICRUDDao<StaffPerformStatEntity,Lo
* @return * @return
*/ */
List<StaffPerformStatEntity> getYearSummaryList(StaffSummaryTopQuery query); List<StaffPerformStatEntity> getYearSummaryList(StaffSummaryTopQuery query);
/**
* 按天异常分值统计
* @param query
* @return
*/
List<StaffPerformStatEntity> getDayExceptionList(StaffSummaryTopQuery query);
/**
* 按月异常分值统计
* @param query
* @return
*/
List<StaffPerformStatEntity> getMonthExceptionList(StaffSummaryTopQuery query);
/**
* 按年异常分值统计
* @param query
* @return
*/
List<StaffPerformStatEntity> getYearExceptionList(StaffSummaryTopQuery query);
} }
...@@ -32,4 +32,19 @@ public class StaffPerformStatDaoImpl extends BaseCRUDDaoMybatis<StaffPerformStat ...@@ -32,4 +32,19 @@ public class StaffPerformStatDaoImpl extends BaseCRUDDaoMybatis<StaffPerformStat
public List<StaffPerformStatEntity> getYearSummaryList(StaffSummaryTopQuery query) { public List<StaffPerformStatEntity> getYearSummaryList(StaffSummaryTopQuery query) {
return this.getSqlSession().selectList(this.getSqlId("getYearSummaryList"), query); return this.getSqlSession().selectList(this.getSqlId("getYearSummaryList"), query);
} }
@Override
public List<StaffPerformStatEntity> getDayExceptionList(StaffSummaryTopQuery query) {
return this.getSqlSession().selectList(this.getSqlId("getDayExceptionList"), query);
}
@Override
public List<StaffPerformStatEntity> getMonthExceptionList(StaffSummaryTopQuery query) {
return this.getSqlSession().selectList(this.getSqlId("getMonthExceptionList"), query);
}
@Override
public List<StaffPerformStatEntity> getYearExceptionList(StaffSummaryTopQuery query) {
return this.getSqlSession().selectList(this.getSqlId("getYearExceptionList"), query);
}
} }
...@@ -25,4 +25,11 @@ public interface StaffPerformStatService extends ICRUDService<StaffPerformStatEn ...@@ -25,4 +25,11 @@ public interface StaffPerformStatService extends ICRUDService<StaffPerformStatEn
* @return * @return
*/ */
List<StaffPerformStatEntity> getSummaryTopList(StaffSummaryTopQuery query) throws AppException; List<StaffPerformStatEntity> getSummaryTopList(StaffSummaryTopQuery query) throws AppException;
/**
* 获取异常分值统计
* @param query
* @return
*/
List<StaffPerformStatEntity> getExceptionList(StaffSummaryTopQuery query) throws AppException;
} }
\ No newline at end of file
...@@ -62,4 +62,42 @@ public class StaffPerformStatServiceImpl extends AbstractCRUDServiceImpl<StaffPe ...@@ -62,4 +62,42 @@ public class StaffPerformStatServiceImpl extends AbstractCRUDServiceImpl<StaffPe
return result; return result;
} }
@Override
public List<StaffPerformStatEntity> getExceptionList(StaffSummaryTopQuery query) throws AppException {
LocalDate now = LocalDate.now();
List<StaffPerformStatEntity> result = null;
if(query == null){
query = new StaffSummaryTopQuery();
query.setSummaryType(SummaryTopTypeEnum..getValue());
}
if(query.getSummaryType() == SummaryTopTypeEnum..getValue()){
if(query.getYear()==null){
query.setYear(now.getYear());
}
result = dao.getYearExceptionList(query);
}
if(query.getSummaryType() == SummaryTopTypeEnum..getValue()){
if(query.getYear()==null){
query.setYear(now.getYear());
}
if(query.getMonth()==null){
query.setMonth(now.getMonthValue());
}
result = dao.getMonthExceptionList(query);
}
if(query.getSummaryType() == SummaryTopTypeEnum..getValue()){
if(query.getYear()==null){
query.setYear(now.getYear());
}
if(query.getMonth()==null){
query.setMonth(now.getMonthValue());
}
if(query.getDay()==null){
query.setDay(now.getDayOfMonth());
}
result = dao.getDayExceptionList(query);
}
return result;
}
} }
\ No newline at end of file
...@@ -44,7 +44,7 @@ public class StaffPerformStatController extends BaseCRUDJsonBodyMappingControlle ...@@ -44,7 +44,7 @@ public class StaffPerformStatController extends BaseCRUDJsonBodyMappingControlle
} }
/** /**
* 部门绩效排行榜 * 个人绩效排行榜
* @param query * @param query
* @return * @return
*/ */
...@@ -74,4 +74,35 @@ public class StaffPerformStatController extends BaseCRUDJsonBodyMappingControlle ...@@ -74,4 +74,35 @@ public class StaffPerformStatController extends BaseCRUDJsonBodyMappingControlle
return ret; return ret;
} }
/**
* 异常分值统计
* @param query
* @return
*/
@PostMapping({"summary/exception"})
@UnAuth
public Rest<Object> getExceptionList(@RequestBody StaffSummaryTopQuery query) {
Rest<Object> ret = new Rest();
Map<String, Object> model = new HashMap();
Context context = this.getContext();
String busiDesc = "查询异常分值统计";
int code = 1;
try {
List<StaffPerformStatEntity> result = this.getService().getExceptionList(query);
model.put("data", result);
model.put("message_info", busiDesc + "成功");
if (!ObjectUtils.isEmpty(context) && !ObjectUtils.isEmpty(context.getUser())) {
this.recordSysLog(this.request, busiDesc + " 【成功】");
}
} catch (Exception var9) {
code = -1;
this.doException(this.request, busiDesc, model, var9);
}
this.init(model, context);
ret.setCode(code);
ret.setData(model.get("data"));
ret.setMsg(model.get("message_info") == null ? "" : model.remove("message_info").toString());
return ret;
}
} }
\ No newline at end of file
...@@ -76,4 +76,98 @@ ...@@ -76,4 +76,98 @@
`year` `year`
) AS a ORDER BY totalScore DESC LIMIT 10 ) AS a ORDER BY totalScore DESC LIMIT 10
</select> </select>
<!-- 按天异常分值统计 -->
<select id="getDayExceptionList" parameterType="com.mortals.xhx.module.staff.model.vo.StaffSummaryTopQuery" resultType="com.mortals.xhx.module.staff.model.StaffPerformStatEntity">
SELECT
`year`,
`month`,
`day`,
SUM(attendScoreAdd) AS attendScoreAdd,
SUM(attendScoreSub) AS attendScoreSub,
SUM(reviewScoreAdd) AS reviewScoreAdd,
SUM(reviewScoreSub) AS reviewScoreSub,
SUM(complainScoreAdd) AS complainScoreAdd,
SUM(complainScoreSub) AS complainScoreSub,
SUM(goworkScoreAdd) AS goworkScoreAdd,
SUM(goworkScoreSub) AS goworkScoreSub,
SUM(effectScoreAdd) AS effectScoreAdd,
SUM(effectScoreSub) AS effectScoreSub,
SUM(otherScoreAdd) AS otherScoreAdd,
SUM(otherScoreSub) AS otherScoreSub
FROM
mortals_xhx_staff_perform_stat
WHERE 1=1
<if test="year != null">
AND `year` = #{year}
</if>
<if test="month != null">
AND `month` = #{month}
</if>
<if test="day != null">
AND `day` = #{day}
</if>
GROUP BY
`year`,
`month`,
`day`
</select>
<!-- 按月异常分值统计 -->
<select id="getMonthExceptionList" parameterType="com.mortals.xhx.module.staff.model.vo.StaffSummaryTopQuery" resultType="com.mortals.xhx.module.staff.model.StaffPerformStatEntity">
SELECT
`year`,
`month`,
SUM(attendScoreAdd) AS attendScoreAdd,
SUM(attendScoreSub) AS attendScoreSub,
SUM(reviewScoreAdd) AS reviewScoreAdd,
SUM(reviewScoreSub) AS reviewScoreSub,
SUM(complainScoreAdd) AS complainScoreAdd,
SUM(complainScoreSub) AS complainScoreSub,
SUM(goworkScoreAdd) AS goworkScoreAdd,
SUM(goworkScoreSub) AS goworkScoreSub,
SUM(effectScoreAdd) AS effectScoreAdd,
SUM(effectScoreSub) AS effectScoreSub,
SUM(otherScoreAdd) AS otherScoreAdd,
SUM(otherScoreSub) AS otherScoreSub
FROM
mortals_xhx_staff_perform_stat
WHERE 1=1
<if test="year != null">
AND `year` = #{year}
</if>
<if test="month != null">
AND `month` = #{month}
</if>
GROUP BY
`year`,
`month`
</select>
<!-- 按年异常分值统计 -->
<select id="getYearExceptionList" parameterType="com.mortals.xhx.module.staff.model.vo.StaffSummaryTopQuery" resultType="com.mortals.xhx.module.staff.model.StaffPerformStatEntity">
SELECT
`year`,
SUM(attendScoreAdd) AS attendScoreAdd,
SUM(attendScoreSub) AS attendScoreSub,
SUM(reviewScoreAdd) AS reviewScoreAdd,
SUM(reviewScoreSub) AS reviewScoreSub,
SUM(complainScoreAdd) AS complainScoreAdd,
SUM(complainScoreSub) AS complainScoreSub,
SUM(goworkScoreAdd) AS goworkScoreAdd,
SUM(goworkScoreSub) AS goworkScoreSub,
SUM(effectScoreAdd) AS effectScoreAdd,
SUM(effectScoreSub) AS effectScoreSub,
SUM(otherScoreAdd) AS otherScoreAdd,
SUM(otherScoreSub) AS otherScoreSub
FROM
mortals_xhx_staff_perform_stat
WHERE 1=1
<if test="year != null">
AND `year` = #{year}
</if>
GROUP BY
`year`
</select>
</mapper> </mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment