|
@@ -0,0 +1,49 @@
|
|
|
|
|
+package com.lc.ibps.business.service.impl;
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+import com.lc.ibps.base.framework.table.ICommonDao;
|
|
|
|
|
+import com.lc.ibps.business.service.StatisticService;
|
|
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
|
|
+
|
|
|
|
|
+import javax.annotation.Resource;
|
|
|
|
|
+import java.util.List;
|
|
|
|
|
+import java.util.Map;
|
|
|
|
|
+
|
|
|
|
|
+@Service
|
|
|
|
|
+public class StatisticServiceImpl implements StatisticService {
|
|
|
|
|
+
|
|
|
|
|
+ @Resource
|
|
|
|
|
+ private ICommonDao<?> commonDao;
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public List<Map<String, Object>> getRiskReport(String riskId, String type) {
|
|
|
|
|
+
|
|
|
|
|
+ String typeSql = getFetchSqlForRiskReport(type);
|
|
|
|
|
+ return (List<Map<String, Object>>) commonDao.query(typeSql,new String[]{riskId});
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private String getFetchSqlForRiskReport(String type){
|
|
|
|
|
+ String fetchSql = "";
|
|
|
|
|
+ if(type.equalsIgnoreCase("FXDJ")){
|
|
|
|
|
+ fetchSql = "SELECT c.feng_xian_deng_ji,COUNT(1) AS total FROM t_fxssb a,t_fxsbpgb b,t_fxsbpgbzb c " +
|
|
|
|
|
+ " WHERE a.shi_fou_guo_shen_ = '已完成' AND a.zong_id_=#{p0}" +
|
|
|
|
|
+ " AND a.zong_id_=b.zong_id_ AND b.id_=c.parent_id_ GROUP BY c.feng_xian_deng_ji";
|
|
|
|
|
+ } else if(type.equalsIgnoreCase("ZRBM")){
|
|
|
|
|
+ fetchSql = "SELECT d.name_,COUNT(1) AS total FROM t_fxssb a,t_fxsbpgb b,t_fxsbpgbzb c ,ibps_party_position d" +
|
|
|
|
|
+ " WHERE a.shi_fou_guo_shen_ = '已完成' AND a.zong_id_=#{p0} AND b.bian_zhi_bu_men_ = d.id_" +
|
|
|
|
|
+ " AND a.zong_id_=b.zong_id_ AND b.id_=c.parent_id_ GROUP BY d.name_";
|
|
|
|
|
+ }else if(type.equalsIgnoreCase("SJTK")){
|
|
|
|
|
+ fetchSql = "SELECT c.yao_su_tiao_kuan_,COUNT(1) AS total FROM t_fxssb a,t_fxsbpgb b,t_fxsbpgbzb c " +
|
|
|
|
|
+ " WHERE a.shi_fou_guo_shen_ = '已完成' AND a.zong_id_=#{p0}" +
|
|
|
|
|
+ " AND a.zong_id_=b.zong_id_ AND b.id_=c.parent_id_ GROUP BY c.yao_su_tiao_kuan_";
|
|
|
|
|
+ }else if(type.equalsIgnoreCase("YDCS")){
|
|
|
|
|
+ fetchSql = "SELECT c.feng_xian_ying_du,COUNT(1) AS total FROM t_fxssb a,t_fxsbpgb b,t_fxsbpgbzb c " +
|
|
|
|
|
+ " WHERE a.shi_fou_guo_shen_ = '已完成' AND a.zong_id_=#{p0}" +
|
|
|
|
|
+ " AND a.zong_id_=b.zong_id_ AND b.id_=c.parent_id_ GROUP BY c.feng_xian_ying_du";
|
|
|
|
|
+ } else{
|
|
|
|
|
+ throw new IllegalArgumentException("type not match!");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return fetchSql;
|
|
|
|
|
+ }
|
|
|
|
|
+}
|