|
@ -409,10 +409,10 @@ public class StatisticsService extends BaseService {
|
|
redisNum = "";
|
|
redisNum = "";
|
|
}
|
|
}
|
|
if (StringUtils.isEmpty(redisNum)) {
|
|
if (StringUtils.isEmpty(redisNum)) {
|
|
if(org.springframework.util.StringUtils.isEmpty(year)){
|
|
|
|
year= Constant.getNowYear();
|
|
|
|
|
|
if (org.springframework.util.StringUtils.isEmpty(year)) {
|
|
|
|
year = Constant.getNowYear();
|
|
}
|
|
}
|
|
PopulationBase peopleNum = peopleNumDao.findByCodeAndYear(map.get("code").toString(),Integer.valueOf(year));
|
|
|
|
|
|
PopulationBase peopleNum = peopleNumDao.findByCodeAndYear(map.get("code").toString(), Integer.valueOf(year));
|
|
if (peopleNum != null) {
|
|
if (peopleNum != null) {
|
|
map.put("rate", df.format(((long) map.get("amount") * 1.0000) / peopleNum.getNum() * 100));
|
|
map.put("rate", df.format(((long) map.get("amount") * 1.0000) / peopleNum.getNum() * 100));
|
|
map.put("rateString", map.get("amount") + "/" + peopleNum.getNum());
|
|
map.put("rateString", map.get("amount") + "/" + peopleNum.getNum());
|
|
@ -1778,9 +1778,9 @@ public class StatisticsService extends BaseService {
|
|
" wlyy_consult_team c,wlyy_evaluate_score s " +
|
|
" wlyy_consult_team c,wlyy_evaluate_score s " +
|
|
" WHERE " +
|
|
" WHERE " +
|
|
" c.consult = s.consult " +
|
|
" c.consult = s.consult " +
|
|
" AND c.czrq >= '"+startDate+"' " +
|
|
|
|
" AND c.czrq <= '"+endDate+"' " +
|
|
|
|
" AND c.admin_team_code ="+id;
|
|
|
|
|
|
" AND c.czrq >= '" + startDate + "' " +
|
|
|
|
" AND c.czrq <= '" + endDate + "' " +
|
|
|
|
" AND c.admin_team_code =" + id;
|
|
|
|
|
|
//计算签约表记录
|
|
//计算签约表记录
|
|
Map<String, Object> signCount = jdbcTemplate.queryForMap(sign_sql);
|
|
Map<String, Object> signCount = jdbcTemplate.queryForMap(sign_sql);
|
|
@ -1849,7 +1849,7 @@ public class StatisticsService extends BaseService {
|
|
" GROUP BY left(f.apply_date,10)";
|
|
" GROUP BY left(f.apply_date,10)";
|
|
//按月
|
|
//按月
|
|
} else {
|
|
} else {
|
|
sql = "SELECT (DATE_FORMAT(f.apply_date,'%v')-DATE_FORMAT('" +startDate + "','%v')+1) as weekOfMonth,count(1) as signCount " +
|
|
|
|
|
|
sql = "SELECT (DATE_FORMAT(f.apply_date,'%v')-DATE_FORMAT('" + DateUtil.getFristDayOfMonth() + "','%v')+1) as weekOfMonth,count(1) as signCount " +
|
|
" FROM wlyy_sign_family f " +
|
|
" FROM wlyy_sign_family f " +
|
|
" where f.apply_date >='" + startDate + " 00:00:00' " +
|
|
" where f.apply_date >='" + startDate + " 00:00:00' " +
|
|
" AND f.apply_date<='" + endDate + " 23:59:59' " +
|
|
" AND f.apply_date<='" + endDate + " 23:59:59' " +
|
|
@ -1889,24 +1889,22 @@ public class StatisticsService extends BaseService {
|
|
" FROM " +
|
|
" FROM " +
|
|
" wlyy_sign_family_renew_log f " +
|
|
" wlyy_sign_family_renew_log f " +
|
|
" WHERE " +
|
|
" WHERE " +
|
|
" f.apply_date >= '"+startDate+"' " +
|
|
|
|
" AND f.apply_date <= '"+endDate+"' " +
|
|
|
|
" AND f.admin_team_id = " +id+
|
|
|
|
" AND f.old_admin_team_id = f.admin_team_id"+
|
|
|
|
|
|
" f.apply_date >= '" + startDate + "' " +
|
|
|
|
" AND f.apply_date <= '" + endDate + "' " +
|
|
|
|
" AND f.admin_team_id = " + id +
|
|
" GROUP BY " +
|
|
" GROUP BY " +
|
|
" LEFT (f.apply_date, 10)";
|
|
" LEFT (f.apply_date, 10)";
|
|
//按月
|
|
//按月
|
|
} else {
|
|
} else {
|
|
sql = "SELECT " +
|
|
sql = "SELECT " +
|
|
" (DATE_FORMAT(f.apply_date,'%v')-DATE_FORMAT('"+startDate+"','%v')+1) AS weekOfMonth, " +
|
|
|
|
|
|
" (DATE_FORMAT(f.apply_date,'%v')-DATE_FORMAT('" + startDate + "','%v')+1) AS weekOfMonth, " +
|
|
" count(1) AS signCount " +
|
|
" count(1) AS signCount " +
|
|
" FROM " +
|
|
" FROM " +
|
|
" wlyy_sign_family_renew_log f " +
|
|
" wlyy_sign_family_renew_log f " +
|
|
" WHERE " +
|
|
" WHERE " +
|
|
" f.apply_date >= '"+startDate+"' " +
|
|
|
|
" AND f.apply_date <= '"+endDate+"' " +
|
|
|
|
" AND f.admin_team_id = " +id+
|
|
|
|
" AND f.old_admin_team_id = f.admin_team_id"+
|
|
|
|
|
|
" f.apply_date >= '" + startDate + "' " +
|
|
|
|
" AND f.apply_date <= '" + endDate + "' " +
|
|
|
|
" AND f.admin_team_id = " + id +
|
|
" GROUP BY " +
|
|
" GROUP BY " +
|
|
" DATE_FORMAT(f.apply_date, '%m %v')";
|
|
" DATE_FORMAT(f.apply_date, '%m %v')";
|
|
}
|
|
}
|
|
@ -1915,7 +1913,8 @@ public class StatisticsService extends BaseService {
|
|
JSONArray rsJs = new JSONArray(rs);
|
|
JSONArray rsJs = new JSONArray(rs);
|
|
return rsJs;
|
|
return rsJs;
|
|
}
|
|
}
|
|
public JSONObject getReyStatbyTeamNow(String doctor, String startDate, String endDate, String isNow){
|
|
|
|
|
|
|
|
|
|
public JSONObject getReyStatbyTeamNow(String doctor, String startDate, String endDate, String isNow) {
|
|
AdminTeam admin = adminTeamDao.findByLeaderCode(doctor);
|
|
AdminTeam admin = adminTeamDao.findByLeaderCode(doctor);
|
|
if (admin == null) {
|
|
if (admin == null) {
|
|
throw new RuntimeException("未找到团队信息");
|
|
throw new RuntimeException("未找到团队信息");
|
|
@ -1927,52 +1926,52 @@ public class StatisticsService extends BaseService {
|
|
String totalSql = "SELECT " +
|
|
String totalSql = "SELECT " +
|
|
" COUNT(1) total " +
|
|
" COUNT(1) total " +
|
|
" FROM " +
|
|
" FROM " +
|
|
" "+imDataBaseName+".Topics t, " +
|
|
|
|
" "+imDataBaseName+".Participants p, " +
|
|
|
|
" "+imDataBaseName+".Doctors d, " +
|
|
|
|
|
|
" " + imDataBaseName + ".Topics t, " +
|
|
|
|
" " + imDataBaseName + ".Participants p, " +
|
|
|
|
" " + imDataBaseName + ".Doctors d, " +
|
|
" Wlyy_Consult_Team c, " +
|
|
" Wlyy_Consult_Team c, " +
|
|
" "+imDataBaseName+".Patients s " +
|
|
|
|
|
|
" " + imDataBaseName + ".Patients s " +
|
|
" WHERE " +
|
|
" WHERE " +
|
|
" d.id = p.participant_id " +
|
|
" d.id = p.participant_id " +
|
|
" AND c.consult = t.id " +
|
|
" AND c.consult = t.id " +
|
|
" AND c.patient = s.id " +
|
|
" AND c.patient = s.id " +
|
|
" AND p.session_id = t.session_id " +
|
|
" AND p.session_id = t.session_id " +
|
|
" AND c.admin_team_code =" +id +
|
|
|
|
" AND t.create_time >= '"+startDate+"' " +
|
|
|
|
" AND t.create_time <= '"+endDate+"'";
|
|
|
|
List<Map<String,Object>> totalList = jdbcTemplate.queryForList(totalSql);
|
|
|
|
|
|
" AND c.admin_team_code =" + id +
|
|
|
|
" AND t.create_time >= '" + startDate + "' " +
|
|
|
|
" AND t.create_time <= '" + endDate + "'";
|
|
|
|
List<Map<String, Object>> totalList = jdbcTemplate.queryForList(totalSql);
|
|
Long totalCount = 0L;
|
|
Long totalCount = 0L;
|
|
if(totalList!=null&&totalList.size()>0){
|
|
|
|
Map<String,Object> total = totalList.get(0);
|
|
|
|
totalCount = (Long)total.get("total");
|
|
|
|
|
|
if (totalList != null && totalList.size() > 0) {
|
|
|
|
Map<String, Object> total = totalList.get(0);
|
|
|
|
totalCount = (Long) total.get("total");
|
|
}
|
|
}
|
|
String noReySql = "SELECT " +
|
|
String noReySql = "SELECT " +
|
|
" COUNT(1) noRey " +
|
|
" COUNT(1) noRey " +
|
|
" FROM " +
|
|
" FROM " +
|
|
" "+imDataBaseName+".Topics t, " +
|
|
|
|
" "+imDataBaseName+".Participants p, " +
|
|
|
|
" "+imDataBaseName+".Doctors d, " +
|
|
|
|
|
|
" " + imDataBaseName + ".Topics t, " +
|
|
|
|
" " + imDataBaseName + ".Participants p, " +
|
|
|
|
" " + imDataBaseName + ".Doctors d, " +
|
|
" Wlyy_Consult_Team c, " +
|
|
" Wlyy_Consult_Team c, " +
|
|
" "+imDataBaseName+".Patients s " +
|
|
|
|
|
|
" " + imDataBaseName + ".Patients s " +
|
|
" WHERE " +
|
|
" WHERE " +
|
|
" d.id = p.participant_id " +
|
|
" d.id = p.participant_id " +
|
|
" AND c.consult = t.id " +
|
|
" AND c.consult = t.id " +
|
|
" AND c.patient = s.id " +
|
|
" AND c.patient = s.id " +
|
|
" AND t. STATUS <> 10 " +
|
|
" AND t. STATUS <> 10 " +
|
|
" AND t.`reply` = 0 "+
|
|
|
|
|
|
" AND t.`reply` = 0 " +
|
|
" AND p.session_id = t.session_id " +
|
|
" AND p.session_id = t.session_id " +
|
|
" AND c.admin_team_code =" +id +
|
|
|
|
" AND t.create_time >= '"+startDate+"' " +
|
|
|
|
" AND t.create_time <= '"+endDate+"'";
|
|
|
|
List<Map<String,Object>> noReyList = jdbcTemplate.queryForList(noReySql);
|
|
|
|
|
|
" AND c.admin_team_code =" + id +
|
|
|
|
" AND t.create_time >= '" + startDate + "' " +
|
|
|
|
" AND t.create_time <= '" + endDate + "'";
|
|
|
|
List<Map<String, Object>> noReyList = jdbcTemplate.queryForList(noReySql);
|
|
Long noReyCount = 0L;
|
|
Long noReyCount = 0L;
|
|
if(noReyList!=null&&noReyList.size()>0){
|
|
|
|
Map<String,Object> noRey = noReyList.get(0);
|
|
|
|
noReyCount = (Long)noRey.get("noRey");
|
|
|
|
|
|
if (noReyList != null && noReyList.size() > 0) {
|
|
|
|
Map<String, Object> noRey = noReyList.get(0);
|
|
|
|
noReyCount = (Long) noRey.get("noRey");
|
|
}
|
|
}
|
|
JSONObject rs = new JSONObject();
|
|
JSONObject rs = new JSONObject();
|
|
rs.put("onReyCount", noReyCount);
|
|
rs.put("onReyCount", noReyCount);
|
|
rs.put("totalCount",totalCount);
|
|
|
|
|
|
rs.put("totalCount", totalCount);
|
|
return rs;
|
|
return rs;
|
|
}
|
|
}
|
|
|
|
|
|
@ -2206,26 +2205,26 @@ public class StatisticsService extends BaseService {
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
public Map<String, Object> getConsultByteam(Long id, String startDate, String endDate) {
|
|
public Map<String, Object> getConsultByteam(Long id, String startDate, String endDate) {
|
|
String imDataBaseName = SystemConf.getInstance().getImDataBaseName();
|
|
|
|
|
|
String imDataBaseName = SystemConf.getInstance().getImDataBaseName();
|
|
// startDate = startDate + " 00:00:00";
|
|
// startDate = startDate + " 00:00:00";
|
|
// endDate = endDate + " 23:59:59";
|
|
// endDate = endDate + " 23:59:59";
|
|
//咨询量
|
|
//咨询量
|
|
String consult_sql = "SELECT " +
|
|
String consult_sql = "SELECT " +
|
|
" COUNT(1) consultCount " +
|
|
" COUNT(1) consultCount " +
|
|
" FROM " +
|
|
" FROM " +
|
|
" "+imDataBaseName+".Topics t, " +
|
|
|
|
" "+imDataBaseName+".Participants p, " +
|
|
|
|
" "+imDataBaseName+".Doctors d, " +
|
|
|
|
|
|
" " + imDataBaseName + ".Topics t, " +
|
|
|
|
" " + imDataBaseName + ".Participants p, " +
|
|
|
|
" " + imDataBaseName + ".Doctors d, " +
|
|
" Wlyy_Consult_Team c, " +
|
|
" Wlyy_Consult_Team c, " +
|
|
" "+imDataBaseName+".Patients s " +
|
|
|
|
|
|
" " + imDataBaseName + ".Patients s " +
|
|
" WHERE " +
|
|
" WHERE " +
|
|
" d.id = p.participant_id " +
|
|
" d.id = p.participant_id " +
|
|
" AND c.consult = t.id " +
|
|
" AND c.consult = t.id " +
|
|
" AND c.patient = s.id " +
|
|
" AND c.patient = s.id " +
|
|
" AND p.session_id = t.session_id " +
|
|
" AND p.session_id = t.session_id " +
|
|
" AND c.admin_team_code =" +id+
|
|
|
|
" AND t.create_time >= '"+startDate+"' " +
|
|
|
|
" AND t.create_time <= '"+endDate+"'";
|
|
|
|
|
|
" AND c.admin_team_code =" + id +
|
|
|
|
" AND t.create_time >= '" + startDate + "' " +
|
|
|
|
" AND t.create_time <= '" + endDate + "'";
|
|
//获取咨詢數
|
|
//获取咨詢數
|
|
Map<String, Object> consultCout = jdbcTemplate.queryForMap(consult_sql);
|
|
Map<String, Object> consultCout = jdbcTemplate.queryForMap(consult_sql);
|
|
if (consultCout.get("consultCount") == null) {
|
|
if (consultCout.get("consultCount") == null) {
|
|
@ -2316,22 +2315,22 @@ public class StatisticsService extends BaseService {
|
|
" WHERE " +
|
|
" WHERE " +
|
|
" s.consult = t.consult " +
|
|
" s.consult = t.consult " +
|
|
" AND " +
|
|
" AND " +
|
|
" t.czrq <= '"+endDate+"' " +
|
|
|
|
" AND t.czrq >= '"+startDate+"' " +
|
|
|
|
" AND t.admin_team_code = " +id+
|
|
|
|
|
|
" t.czrq <= '" + endDate + "' " +
|
|
|
|
" AND t.czrq >= '" + startDate + "' " +
|
|
|
|
" AND t.admin_team_code = " + id +
|
|
" GROUP BY dateNo";
|
|
" GROUP BY dateNo";
|
|
} else {
|
|
} else {
|
|
sql = "SELECT " +
|
|
sql = "SELECT " +
|
|
" (DATE_FORMAT(t.czrq,'%v')-DATE_FORMAT('"+startDate+"','%v')+1) AS weekNo, " +
|
|
|
|
|
|
" (DATE_FORMAT(t.czrq,'%v')-DATE_FORMAT('" + startDate + "','%v')+1) AS weekNo, " +
|
|
" ifnull(ROUND(AVG(s.score), 1), 0) AS avgCount " +
|
|
" ifnull(ROUND(AVG(s.score), 1), 0) AS avgCount " +
|
|
" FROM " +
|
|
" FROM " +
|
|
" wlyy_evaluate_score s,wlyy_consult_team t " +
|
|
" wlyy_evaluate_score s,wlyy_consult_team t " +
|
|
" WHERE " +
|
|
" WHERE " +
|
|
" s.consult = t.consult " +
|
|
" s.consult = t.consult " +
|
|
" AND " +
|
|
" AND " +
|
|
" t.czrq <= '"+endDate+"' " +
|
|
|
|
" AND t.czrq >= '"+startDate+"' " +
|
|
|
|
" AND t.admin_team_code = " +id +
|
|
|
|
|
|
" t.czrq <= '" + endDate + "' " +
|
|
|
|
" AND t.czrq >= '" + startDate + "' " +
|
|
|
|
" AND t.admin_team_code = " + id +
|
|
" GROUP BY weekNo";
|
|
" GROUP BY weekNo";
|
|
}
|
|
}
|
|
|
|
|
|
@ -2368,11 +2367,11 @@ public class StatisticsService extends BaseService {
|
|
sql = "SELECT " +
|
|
sql = "SELECT " +
|
|
" left(t.create_time,10) AS dateNo, COUNT(1) AS noRely " +
|
|
" left(t.create_time,10) AS dateNo, COUNT(1) AS noRely " +
|
|
" FROM " +
|
|
" FROM " +
|
|
" "+ imDataBaseName +".Topics t, " +
|
|
|
|
" "+ imDataBaseName +".Participants p, " +
|
|
|
|
" "+ imDataBaseName +".Doctors d, " +
|
|
|
|
|
|
" " + imDataBaseName + ".Topics t, " +
|
|
|
|
" " + imDataBaseName + ".Participants p, " +
|
|
|
|
" " + imDataBaseName + ".Doctors d, " +
|
|
" Wlyy_Consult_Team c, " +
|
|
" Wlyy_Consult_Team c, " +
|
|
" "+ imDataBaseName +".Patients s " +
|
|
|
|
|
|
" " + imDataBaseName + ".Patients s " +
|
|
" WHERE " +
|
|
" WHERE " +
|
|
" d.id = p.participant_id " +
|
|
" d.id = p.participant_id " +
|
|
" AND c.consult = t.id " +
|
|
" AND c.consult = t.id " +
|
|
@ -2380,67 +2379,67 @@ public class StatisticsService extends BaseService {
|
|
" AND t. STATUS <> 10 " +
|
|
" AND t. STATUS <> 10 " +
|
|
" AND t.`reply` = 0 " +
|
|
" AND t.`reply` = 0 " +
|
|
" AND p.session_id = t.session_id " +
|
|
" AND p.session_id = t.session_id " +
|
|
" AND c.admin_team_code = " +teamCode+
|
|
|
|
" AND t.create_time >= '"+startDate+"' " +
|
|
|
|
" AND t.create_time <= '"+endDate+"' " +
|
|
|
|
|
|
" AND c.admin_team_code = " + teamCode +
|
|
|
|
" AND t.create_time >= '" + startDate + "' " +
|
|
|
|
" AND t.create_time <= '" + endDate + "' " +
|
|
" GROUP BY dateNo";
|
|
" GROUP BY dateNo";
|
|
|
|
|
|
totalSql = "SELECT " +
|
|
totalSql = "SELECT " +
|
|
" left(t.create_time,10) AS dateNo, COUNT(1) total " +
|
|
" left(t.create_time,10) AS dateNo, COUNT(1) total " +
|
|
" FROM " +
|
|
" FROM " +
|
|
" "+ imDataBaseName +".Topics t, " +
|
|
|
|
" "+ imDataBaseName +".Participants p, " +
|
|
|
|
" "+ imDataBaseName +".Doctors d, " +
|
|
|
|
|
|
" " + imDataBaseName + ".Topics t, " +
|
|
|
|
" " + imDataBaseName + ".Participants p, " +
|
|
|
|
" " + imDataBaseName + ".Doctors d, " +
|
|
" Wlyy_Consult_Team c, " +
|
|
" Wlyy_Consult_Team c, " +
|
|
" "+ imDataBaseName +".Patients s " +
|
|
|
|
|
|
" " + imDataBaseName + ".Patients s " +
|
|
" WHERE " +
|
|
" WHERE " +
|
|
" d.id = p.participant_id " +
|
|
" d.id = p.participant_id " +
|
|
" AND c.consult = t.id " +
|
|
" AND c.consult = t.id " +
|
|
" AND c.patient = s.id " +
|
|
" AND c.patient = s.id " +
|
|
" AND p.session_id = t.session_id " +
|
|
" AND p.session_id = t.session_id " +
|
|
" AND c.admin_team_code = " +teamCode+
|
|
|
|
" AND t.create_time >= '"+startDate+"' " +
|
|
|
|
" AND t.create_time <= '"+endDate+"' " +
|
|
|
|
|
|
" AND c.admin_team_code = " + teamCode +
|
|
|
|
" AND t.create_time >= '" + startDate + "' " +
|
|
|
|
" AND t.create_time <= '" + endDate + "' " +
|
|
" GROUP BY dateNo";
|
|
" GROUP BY dateNo";
|
|
} else {
|
|
} else {
|
|
//按月统计
|
|
//按月统计
|
|
sql ="SELECT " +
|
|
|
|
" (DATE_FORMAT(t.create_time, '%v') - DATE_FORMAT('"+startDate+"', '%v') + 1) AS weekOfMonth, " +
|
|
|
|
|
|
sql = "SELECT " +
|
|
|
|
" (DATE_FORMAT(t.create_time, '%v') - DATE_FORMAT('" + startDate + "', '%v') + 1) AS weekOfMonth, " +
|
|
" COUNT(1) AS noRely " +
|
|
" COUNT(1) AS noRely " +
|
|
" FROM " +
|
|
" FROM " +
|
|
" "+imDataBaseName+".Topics t, " +
|
|
|
|
" "+imDataBaseName+".Participants p, " +
|
|
|
|
" "+imDataBaseName+".Doctors d, " +
|
|
|
|
|
|
" " + imDataBaseName + ".Topics t, " +
|
|
|
|
" " + imDataBaseName + ".Participants p, " +
|
|
|
|
" " + imDataBaseName + ".Doctors d, " +
|
|
" Wlyy_Consult_Team c, " +
|
|
" Wlyy_Consult_Team c, " +
|
|
" "+imDataBaseName+".Patients s " +
|
|
|
|
|
|
" " + imDataBaseName + ".Patients s " +
|
|
" WHERE " +
|
|
" WHERE " +
|
|
" d.id = p.participant_id " +
|
|
" d.id = p.participant_id " +
|
|
" AND c.consult = t.id " +
|
|
" AND c.consult = t.id " +
|
|
" AND c.patient = s.id " +
|
|
" AND c.patient = s.id " +
|
|
" AND p.session_id = t.session_id " +
|
|
" AND p.session_id = t.session_id " +
|
|
" AND c.admin_team_code = " +teamCode+
|
|
|
|
|
|
" AND c.admin_team_code = " + teamCode +
|
|
" AND t. STATUS <> 10 " +
|
|
" AND t. STATUS <> 10 " +
|
|
" AND t.`reply` = 0 " +
|
|
" AND t.`reply` = 0 " +
|
|
" AND t.create_time >= '"+startDate+"' " +
|
|
|
|
" AND t.create_time <= '"+endDate+"' " +
|
|
|
|
|
|
" AND t.create_time >= '" + startDate + "' " +
|
|
|
|
" AND t.create_time <= '" + endDate + "' " +
|
|
" GROUP BY weekOfMonth";
|
|
" GROUP BY weekOfMonth";
|
|
totalSql ="SELECT " +
|
|
|
|
" (DATE_FORMAT(t.create_time, '%v') - DATE_FORMAT('"+startDate+"', '%v') + 1) AS weekOfMonth, " +
|
|
|
|
|
|
totalSql = "SELECT " +
|
|
|
|
" (DATE_FORMAT(t.create_time, '%v') - DATE_FORMAT('" + startDate + "', '%v') + 1) AS weekOfMonth, " +
|
|
" COUNT(1) AS total " +
|
|
" COUNT(1) AS total " +
|
|
" FROM " +
|
|
" FROM " +
|
|
" "+imDataBaseName+".Topics t, " +
|
|
|
|
" "+imDataBaseName+".Participants p, " +
|
|
|
|
" "+imDataBaseName+".Doctors d, " +
|
|
|
|
|
|
" " + imDataBaseName + ".Topics t, " +
|
|
|
|
" " + imDataBaseName + ".Participants p, " +
|
|
|
|
" " + imDataBaseName + ".Doctors d, " +
|
|
" Wlyy_Consult_Team c, " +
|
|
" Wlyy_Consult_Team c, " +
|
|
" "+imDataBaseName+".Patients s " +
|
|
|
|
|
|
" " + imDataBaseName + ".Patients s " +
|
|
" WHERE " +
|
|
" WHERE " +
|
|
" d.id = p.participant_id " +
|
|
" d.id = p.participant_id " +
|
|
" AND c.consult = t.id " +
|
|
" AND c.consult = t.id " +
|
|
" AND c.patient = s.id " +
|
|
" AND c.patient = s.id " +
|
|
" AND p.session_id = t.session_id " +
|
|
" AND p.session_id = t.session_id " +
|
|
" AND c.admin_team_code = " +teamCode+
|
|
|
|
" AND t.create_time >= '"+startDate+"' " +
|
|
|
|
" AND t.create_time <= '"+endDate+"' " +
|
|
|
|
|
|
" AND c.admin_team_code = " + teamCode +
|
|
|
|
" AND t.create_time >= '" + startDate + "' " +
|
|
|
|
" AND t.create_time <= '" + endDate + "' " +
|
|
" GROUP BY weekOfMonth";
|
|
" GROUP BY weekOfMonth";
|
|
}
|
|
}
|
|
|
|
|
|
@ -2473,11 +2472,11 @@ public class StatisticsService extends BaseService {
|
|
sql = "SELECT " +
|
|
sql = "SELECT " +
|
|
" left(t.create_time,10) AS dateNo, COUNT(1) AS noRely " +
|
|
" left(t.create_time,10) AS dateNo, COUNT(1) AS noRely " +
|
|
" FROM " +
|
|
" FROM " +
|
|
" "+ imDataBaseName +".Topics t, " +
|
|
|
|
" "+ imDataBaseName +".Participants p, " +
|
|
|
|
" "+ imDataBaseName +".Doctors d, " +
|
|
|
|
|
|
" " + imDataBaseName + ".Topics t, " +
|
|
|
|
" " + imDataBaseName + ".Participants p, " +
|
|
|
|
" " + imDataBaseName + ".Doctors d, " +
|
|
" Wlyy_Consult_Team c, " +
|
|
" Wlyy_Consult_Team c, " +
|
|
" "+ imDataBaseName +".Patients s " +
|
|
|
|
|
|
" " + imDataBaseName + ".Patients s " +
|
|
" WHERE " +
|
|
" WHERE " +
|
|
" d.id = p.participant_id " +
|
|
" d.id = p.participant_id " +
|
|
" AND c.consult = t.id " +
|
|
" AND c.consult = t.id " +
|
|
@ -2485,71 +2484,71 @@ public class StatisticsService extends BaseService {
|
|
" AND t. STATUS <> 10 " +
|
|
" AND t. STATUS <> 10 " +
|
|
" AND t.`reply` = 0 " +
|
|
" AND t.`reply` = 0 " +
|
|
" AND p.session_id = t.session_id " +
|
|
" AND p.session_id = t.session_id " +
|
|
" AND d.id ='"+doctor +"'"+
|
|
|
|
" AND c.admin_team_code = " +teamCode+
|
|
|
|
" AND t.create_time >= '"+startDate+"' " +
|
|
|
|
" AND t.create_time <= '"+endDate+"' " +
|
|
|
|
|
|
" AND d.id ='" + doctor + "'" +
|
|
|
|
" AND c.admin_team_code = " + teamCode +
|
|
|
|
" AND t.create_time >= '" + startDate + "' " +
|
|
|
|
" AND t.create_time <= '" + endDate + "' " +
|
|
" GROUP BY dateNo";
|
|
" GROUP BY dateNo";
|
|
|
|
|
|
totalSql = "SELECT " +
|
|
totalSql = "SELECT " +
|
|
" left(t.create_time,10) AS dateNo, COUNT(1) total " +
|
|
" left(t.create_time,10) AS dateNo, COUNT(1) total " +
|
|
" FROM " +
|
|
" FROM " +
|
|
" "+ imDataBaseName +".Topics t, " +
|
|
|
|
" "+ imDataBaseName +".Participants p, " +
|
|
|
|
" "+ imDataBaseName +".Doctors d, " +
|
|
|
|
|
|
" " + imDataBaseName + ".Topics t, " +
|
|
|
|
" " + imDataBaseName + ".Participants p, " +
|
|
|
|
" " + imDataBaseName + ".Doctors d, " +
|
|
" Wlyy_Consult_Team c, " +
|
|
" Wlyy_Consult_Team c, " +
|
|
" "+ imDataBaseName +".Patients s " +
|
|
|
|
|
|
" " + imDataBaseName + ".Patients s " +
|
|
" WHERE " +
|
|
" WHERE " +
|
|
" d.id = p.participant_id " +
|
|
" d.id = p.participant_id " +
|
|
" AND c.consult = t.id " +
|
|
" AND c.consult = t.id " +
|
|
" AND c.patient = s.id " +
|
|
" AND c.patient = s.id " +
|
|
" AND p.session_id = t.session_id " +
|
|
" AND p.session_id = t.session_id " +
|
|
" AND d.id ='"+doctor +"'"+
|
|
|
|
" AND c.admin_team_code = " +teamCode+
|
|
|
|
" AND t.create_time >= '"+startDate+"' " +
|
|
|
|
" AND t.create_time <= '"+endDate+"' " +
|
|
|
|
|
|
" AND d.id ='" + doctor + "'" +
|
|
|
|
" AND c.admin_team_code = " + teamCode +
|
|
|
|
" AND t.create_time >= '" + startDate + "' " +
|
|
|
|
" AND t.create_time <= '" + endDate + "' " +
|
|
" GROUP BY dateNo";
|
|
" GROUP BY dateNo";
|
|
} else {
|
|
} else {
|
|
//按月统计
|
|
//按月统计
|
|
sql ="SELECT " +
|
|
|
|
" (DATE_FORMAT(t.create_time, '%v') - DATE_FORMAT('"+startDate+"', '%v') + 1) AS weekOfMonth, " +
|
|
|
|
|
|
sql = "SELECT " +
|
|
|
|
" (DATE_FORMAT(t.create_time, '%v') - DATE_FORMAT('" + startDate + "', '%v') + 1) AS weekOfMonth, " +
|
|
" COUNT(1) AS noRely " +
|
|
" COUNT(1) AS noRely " +
|
|
" FROM " +
|
|
" FROM " +
|
|
" "+imDataBaseName+".Topics t, " +
|
|
|
|
" "+imDataBaseName+".Participants p, " +
|
|
|
|
" "+imDataBaseName+".Doctors d, " +
|
|
|
|
|
|
" " + imDataBaseName + ".Topics t, " +
|
|
|
|
" " + imDataBaseName + ".Participants p, " +
|
|
|
|
" " + imDataBaseName + ".Doctors d, " +
|
|
" Wlyy_Consult_Team c, " +
|
|
" Wlyy_Consult_Team c, " +
|
|
" "+imDataBaseName+".Patients s " +
|
|
|
|
|
|
" " + imDataBaseName + ".Patients s " +
|
|
" WHERE " +
|
|
" WHERE " +
|
|
" d.id = p.participant_id " +
|
|
" d.id = p.participant_id " +
|
|
" AND c.consult = t.id " +
|
|
" AND c.consult = t.id " +
|
|
" AND c.patient = s.id " +
|
|
" AND c.patient = s.id " +
|
|
" AND p.session_id = t.session_id " +
|
|
" AND p.session_id = t.session_id " +
|
|
" AND c.admin_team_code = " +teamCode+
|
|
|
|
" AND d.id ='"+doctor +"'"+
|
|
|
|
|
|
" AND c.admin_team_code = " + teamCode +
|
|
|
|
" AND d.id ='" + doctor + "'" +
|
|
" AND t. STATUS <> 10 " +
|
|
" AND t. STATUS <> 10 " +
|
|
" AND t.`reply` = 0 " +
|
|
" AND t.`reply` = 0 " +
|
|
" AND t.create_time >= '"+startDate+"' " +
|
|
|
|
" AND t.create_time <= '"+endDate+"' " +
|
|
|
|
|
|
" AND t.create_time >= '" + startDate + "' " +
|
|
|
|
" AND t.create_time <= '" + endDate + "' " +
|
|
" GROUP BY weekOfMonth";
|
|
" GROUP BY weekOfMonth";
|
|
totalSql ="SELECT " +
|
|
|
|
" (DATE_FORMAT(t.create_time, '%v') - DATE_FORMAT('"+startDate+"', '%v') + 1) AS weekOfMonth, " +
|
|
|
|
|
|
totalSql = "SELECT " +
|
|
|
|
" (DATE_FORMAT(t.create_time, '%v') - DATE_FORMAT('" + startDate + "', '%v') + 1) AS weekOfMonth, " +
|
|
" COUNT(1) AS total " +
|
|
" COUNT(1) AS total " +
|
|
" FROM " +
|
|
" FROM " +
|
|
" "+imDataBaseName+".Topics t, " +
|
|
|
|
" "+imDataBaseName+".Participants p, " +
|
|
|
|
" "+imDataBaseName+".Doctors d, " +
|
|
|
|
|
|
" " + imDataBaseName + ".Topics t, " +
|
|
|
|
" " + imDataBaseName + ".Participants p, " +
|
|
|
|
" " + imDataBaseName + ".Doctors d, " +
|
|
" Wlyy_Consult_Team c, " +
|
|
" Wlyy_Consult_Team c, " +
|
|
" "+imDataBaseName+".Patients s " +
|
|
|
|
|
|
" " + imDataBaseName + ".Patients s " +
|
|
" WHERE " +
|
|
" WHERE " +
|
|
" d.id = p.participant_id " +
|
|
" d.id = p.participant_id " +
|
|
" AND c.consult = t.id " +
|
|
" AND c.consult = t.id " +
|
|
" AND c.patient = s.id " +
|
|
" AND c.patient = s.id " +
|
|
" AND p.session_id = t.session_id " +
|
|
" AND p.session_id = t.session_id " +
|
|
" AND d.id ='"+doctor +"'"+
|
|
|
|
" AND c.admin_team_code = " +teamCode+
|
|
|
|
" AND t.create_time >= '"+startDate+"' " +
|
|
|
|
" AND t.create_time <= '"+endDate+"' " +
|
|
|
|
|
|
" AND d.id ='" + doctor + "'" +
|
|
|
|
" AND c.admin_team_code = " + teamCode +
|
|
|
|
" AND t.create_time >= '" + startDate + "' " +
|
|
|
|
" AND t.create_time <= '" + endDate + "' " +
|
|
" GROUP BY weekOfMonth";
|
|
" GROUP BY weekOfMonth";
|
|
}
|
|
}
|
|
|
|
|
|
@ -2589,27 +2588,27 @@ public class StatisticsService extends BaseService {
|
|
" d.`name`, " +
|
|
" d.`name`, " +
|
|
" d.id " +
|
|
" d.id " +
|
|
" FROM " +
|
|
" FROM " +
|
|
" "+imDataBaseName+".Topics t, " +
|
|
|
|
" "+imDataBaseName+".Participants p, " +
|
|
|
|
" "+imDataBaseName+".Doctors d, " +
|
|
|
|
|
|
" " + imDataBaseName + ".Topics t, " +
|
|
|
|
" " + imDataBaseName + ".Participants p, " +
|
|
|
|
" " + imDataBaseName + ".Doctors d, " +
|
|
" Wlyy_Consult_Team c, " +
|
|
" Wlyy_Consult_Team c, " +
|
|
" "+imDataBaseName+".Patients s " +
|
|
|
|
|
|
" " + imDataBaseName + ".Patients s " +
|
|
" WHERE " +
|
|
" WHERE " +
|
|
" d.id = p.participant_id " +
|
|
" d.id = p.participant_id " +
|
|
" AND c.consult = t.id " +
|
|
" AND c.consult = t.id " +
|
|
" AND c.patient = s.id " +
|
|
" AND c.patient = s.id " +
|
|
" AND p.session_id = t.session_id " +
|
|
" AND p.session_id = t.session_id " +
|
|
" AND c.admin_team_code = " +teamCode+
|
|
|
|
|
|
" AND c.admin_team_code = " + teamCode +
|
|
" AND t. STATUS <> 10 " +
|
|
" AND t. STATUS <> 10 " +
|
|
" AND t.`reply` = 0 " +
|
|
" AND t.`reply` = 0 " +
|
|
" AND t.create_time >= '"+startDate+"' " +
|
|
|
|
" AND t.create_time <= '"+endDate+"' " +
|
|
|
|
|
|
" AND t.create_time >= '" + startDate + "' " +
|
|
|
|
" AND t.create_time <= '" + endDate + "' " +
|
|
" GROUP BY " +
|
|
" GROUP BY " +
|
|
" id " +
|
|
" id " +
|
|
" ) c ON c.id = m.doctor_code " +
|
|
" ) c ON c.id = m.doctor_code " +
|
|
" WHERE " +
|
|
" WHERE " +
|
|
" m.doctor_code = d.`code` " +
|
|
" m.doctor_code = d.`code` " +
|
|
" AND m.team_id = "+teamCode;
|
|
|
|
|
|
" AND m.team_id = " + teamCode;
|
|
if ("0".equals(sort)) {
|
|
if ("0".equals(sort)) {
|
|
onReySQL = onReySQL + " ORDER BY noRely DESC";
|
|
onReySQL = onReySQL + " ORDER BY noRely DESC";
|
|
} else {
|
|
} else {
|
|
@ -2631,25 +2630,25 @@ public class StatisticsService extends BaseService {
|
|
" d.`name`, " +
|
|
" d.`name`, " +
|
|
" d.id " +
|
|
" d.id " +
|
|
" FROM " +
|
|
" FROM " +
|
|
" "+ imDataBaseName +".Topics t, " +
|
|
|
|
" "+ imDataBaseName +".Participants p, " +
|
|
|
|
" "+ imDataBaseName +".Doctors d, " +
|
|
|
|
|
|
" " + imDataBaseName + ".Topics t, " +
|
|
|
|
" " + imDataBaseName + ".Participants p, " +
|
|
|
|
" " + imDataBaseName + ".Doctors d, " +
|
|
" Wlyy_Consult_Team c, " +
|
|
" Wlyy_Consult_Team c, " +
|
|
" "+ imDataBaseName +".Patients s " +
|
|
|
|
|
|
" " + imDataBaseName + ".Patients s " +
|
|
" WHERE " +
|
|
" WHERE " +
|
|
" d.id = p.participant_id " +
|
|
" d.id = p.participant_id " +
|
|
" AND c.consult = t.id " +
|
|
" AND c.consult = t.id " +
|
|
" AND c.patient = s.id " +
|
|
" AND c.patient = s.id " +
|
|
" AND p.session_id = t.session_id " +
|
|
" AND p.session_id = t.session_id " +
|
|
" AND c.admin_team_code = " +teamCode+
|
|
|
|
" AND t.create_time >= '"+startDate+"' " +
|
|
|
|
" AND t.create_time <= '"+endDate+"' " +
|
|
|
|
|
|
" AND c.admin_team_code = " + teamCode +
|
|
|
|
" AND t.create_time >= '" + startDate + "' " +
|
|
|
|
" AND t.create_time <= '" + endDate + "' " +
|
|
" GROUP BY " +
|
|
" GROUP BY " +
|
|
" id " +
|
|
" id " +
|
|
" ) c ON c.id = m.doctor_code " +
|
|
" ) c ON c.id = m.doctor_code " +
|
|
" WHERE " +
|
|
" WHERE " +
|
|
" m.doctor_code = d.`code` " +
|
|
" m.doctor_code = d.`code` " +
|
|
" AND m.team_id = "+teamCode;
|
|
|
|
|
|
" AND m.team_id = " + teamCode;
|
|
if ("0".equals(sort)) {
|
|
if ("0".equals(sort)) {
|
|
totalSql = totalSql + " ORDER BY total DESC";
|
|
totalSql = totalSql + " ORDER BY total DESC";
|
|
} else {
|
|
} else {
|
|
@ -2671,26 +2670,26 @@ public class StatisticsService extends BaseService {
|
|
" d.`name`, " +
|
|
" d.`name`, " +
|
|
" d.id " +
|
|
" d.id " +
|
|
" FROM " +
|
|
" FROM " +
|
|
" "+ imDataBaseName +".Topics t, " +
|
|
|
|
" "+ imDataBaseName +".Participants p, " +
|
|
|
|
" "+ imDataBaseName +".Doctors d, " +
|
|
|
|
|
|
" " + imDataBaseName + ".Topics t, " +
|
|
|
|
" " + imDataBaseName + ".Participants p, " +
|
|
|
|
" " + imDataBaseName + ".Doctors d, " +
|
|
" Wlyy_Consult_Team c, " +
|
|
" Wlyy_Consult_Team c, " +
|
|
" "+ imDataBaseName +".Patients s " +
|
|
|
|
|
|
" " + imDataBaseName + ".Patients s " +
|
|
" WHERE " +
|
|
" WHERE " +
|
|
" d.id = p.participant_id " +
|
|
" d.id = p.participant_id " +
|
|
" AND c.consult = t.id " +
|
|
" AND c.consult = t.id " +
|
|
" AND c.patient = s.id " +
|
|
" AND c.patient = s.id " +
|
|
" AND p.session_id = t.session_id " +
|
|
" AND p.session_id = t.session_id " +
|
|
" AND c.admin_team_code = " +teamCode+
|
|
|
|
" AND t.create_time >= '"+startDate+"' " +
|
|
|
|
" AND t.create_time <= '"+endDate+"' " +
|
|
|
|
|
|
" AND c.admin_team_code = " + teamCode +
|
|
|
|
" AND t.create_time >= '" + startDate + "' " +
|
|
|
|
" AND t.create_time <= '" + endDate + "' " +
|
|
" AND t. STATUS = 10 " +
|
|
" AND t. STATUS = 10 " +
|
|
" GROUP BY " +
|
|
" GROUP BY " +
|
|
" id " +
|
|
" id " +
|
|
" ) c ON c.id = m.doctor_code " +
|
|
" ) c ON c.id = m.doctor_code " +
|
|
" WHERE " +
|
|
" WHERE " +
|
|
" m.doctor_code = d.`code` " +
|
|
" m.doctor_code = d.`code` " +
|
|
" AND m.team_id = "+teamCode;
|
|
|
|
|
|
" AND m.team_id = " + teamCode;
|
|
if ("0".equals(sort)) {
|
|
if ("0".equals(sort)) {
|
|
endConsultSql = endConsultSql + " ORDER BY endRey DESC";
|
|
endConsultSql = endConsultSql + " ORDER BY endRey DESC";
|
|
} else {
|
|
} else {
|
|
@ -2789,65 +2788,65 @@ public class StatisticsService extends BaseService {
|
|
String couTotalSQL = "SELECT " +
|
|
String couTotalSQL = "SELECT " +
|
|
" COUNT(1) total " +
|
|
" COUNT(1) total " +
|
|
" FROM " +
|
|
" FROM " +
|
|
" "+imDataBaseName+".Topics t, " +
|
|
|
|
" "+imDataBaseName+".Participants p, " +
|
|
|
|
" "+imDataBaseName+".Doctors d, " +
|
|
|
|
|
|
" " + imDataBaseName + ".Topics t, " +
|
|
|
|
" " + imDataBaseName + ".Participants p, " +
|
|
|
|
" " + imDataBaseName + ".Doctors d, " +
|
|
" Wlyy_Consult_Team c, " +
|
|
" Wlyy_Consult_Team c, " +
|
|
" "+imDataBaseName+".Patients s " +
|
|
|
|
|
|
" " + imDataBaseName + ".Patients s " +
|
|
" WHERE " +
|
|
" WHERE " +
|
|
" d.id = p.participant_id " +
|
|
" d.id = p.participant_id " +
|
|
" AND c.consult = t.id " +
|
|
" AND c.consult = t.id " +
|
|
" AND c.patient = s.id " +
|
|
" AND c.patient = s.id " +
|
|
" AND p.session_id = t.session_id " +
|
|
" AND p.session_id = t.session_id " +
|
|
" AND c.admin_team_code ="+teamCode+
|
|
|
|
" AND d.id='"+doctor+"'" +
|
|
|
|
" AND t.create_time <= '"+endDate+"'";
|
|
|
|
|
|
" AND c.admin_team_code =" + teamCode +
|
|
|
|
" AND d.id='" + doctor + "'" +
|
|
|
|
" AND t.create_time <= '" + endDate + "'";
|
|
//及时回复数
|
|
//及时回复数
|
|
String reyTotalSql = "SELECT " +
|
|
String reyTotalSql = "SELECT " +
|
|
" COUNT(1) total " +
|
|
" COUNT(1) total " +
|
|
" FROM " +
|
|
" FROM " +
|
|
" "+imDataBaseName+".Topics t, " +
|
|
|
|
" "+imDataBaseName+".Participants p, " +
|
|
|
|
" "+imDataBaseName+".Doctors d, " +
|
|
|
|
|
|
" " + imDataBaseName + ".Topics t, " +
|
|
|
|
" " + imDataBaseName + ".Participants p, " +
|
|
|
|
" " + imDataBaseName + ".Doctors d, " +
|
|
" Wlyy_Consult_Team c, " +
|
|
" Wlyy_Consult_Team c, " +
|
|
" "+imDataBaseName+".Patients s " +
|
|
|
|
|
|
" " + imDataBaseName + ".Patients s " +
|
|
" WHERE " +
|
|
" WHERE " +
|
|
" d.id = p.participant_id " +
|
|
" d.id = p.participant_id " +
|
|
" AND c.consult = t.id " +
|
|
" AND c.consult = t.id " +
|
|
" AND c.patient = s.id " +
|
|
" AND c.patient = s.id " +
|
|
" AND p.session_id = t.session_id " +
|
|
" AND p.session_id = t.session_id " +
|
|
" AND t.`reply`=1 " +
|
|
" AND t.`reply`=1 " +
|
|
" AND c.admin_team_code ="+teamCode+
|
|
|
|
" AND d.id='"+doctor+"'" +
|
|
|
|
|
|
" AND c.admin_team_code =" + teamCode +
|
|
|
|
" AND d.id='" + doctor + "'" +
|
|
" AND TIMESTAMPDIFF(SECOND ,t.create_time ,t.reply_time) <86400 AND TIMESTAMPDIFF(SECOND ,t.create_time,t.reply_time) >0 " +
|
|
" AND TIMESTAMPDIFF(SECOND ,t.create_time ,t.reply_time) <86400 AND TIMESTAMPDIFF(SECOND ,t.create_time,t.reply_time) >0 " +
|
|
" AND t.create_time <= '"+endDate+"'";
|
|
|
|
|
|
" AND t.create_time <= '" + endDate + "'";
|
|
//本周或月增量
|
|
//本周或月增量
|
|
String addTotalSql = "SELECT " +
|
|
String addTotalSql = "SELECT " +
|
|
" COUNT(1) total " +
|
|
" COUNT(1) total " +
|
|
" FROM " +
|
|
" FROM " +
|
|
" "+imDataBaseName+".Topics t, " +
|
|
|
|
" "+imDataBaseName+".Participants p, " +
|
|
|
|
" "+imDataBaseName+".Doctors d, " +
|
|
|
|
|
|
" " + imDataBaseName + ".Topics t, " +
|
|
|
|
" " + imDataBaseName + ".Participants p, " +
|
|
|
|
" " + imDataBaseName + ".Doctors d, " +
|
|
" Wlyy_Consult_Team c, " +
|
|
" Wlyy_Consult_Team c, " +
|
|
" "+imDataBaseName+".Patients s " +
|
|
|
|
|
|
" " + imDataBaseName + ".Patients s " +
|
|
" WHERE " +
|
|
" WHERE " +
|
|
" d.id = p.participant_id " +
|
|
" d.id = p.participant_id " +
|
|
" AND c.consult = t.id " +
|
|
" AND c.consult = t.id " +
|
|
" AND c.patient = s.id " +
|
|
" AND c.patient = s.id " +
|
|
" AND p.session_id = t.session_id " +
|
|
" AND p.session_id = t.session_id " +
|
|
" AND c.admin_team_code ="+teamCode+
|
|
|
|
" AND d.id='"+doctor+"'" +
|
|
|
|
" AND t.create_time >= '"+startDate+"' " +
|
|
|
|
" AND t.create_time <= '"+endDate+"'";
|
|
|
|
|
|
" AND c.admin_team_code =" + teamCode +
|
|
|
|
" AND d.id='" + doctor + "'" +
|
|
|
|
" AND t.create_time >= '" + startDate + "' " +
|
|
|
|
" AND t.create_time <= '" + endDate + "'";
|
|
//当前未回复咨询数
|
|
//当前未回复咨询数
|
|
String noRelySql = "SELECT " +
|
|
String noRelySql = "SELECT " +
|
|
" COUNT(1) total " +
|
|
" COUNT(1) total " +
|
|
" FROM " +
|
|
" FROM " +
|
|
" "+imDataBaseName+".Topics t, " +
|
|
|
|
" "+imDataBaseName+".Participants p, " +
|
|
|
|
" "+imDataBaseName+".Doctors d, " +
|
|
|
|
|
|
" " + imDataBaseName + ".Topics t, " +
|
|
|
|
" " + imDataBaseName + ".Participants p, " +
|
|
|
|
" " + imDataBaseName + ".Doctors d, " +
|
|
" Wlyy_Consult_Team c, " +
|
|
" Wlyy_Consult_Team c, " +
|
|
" "+imDataBaseName+".Patients s " +
|
|
|
|
|
|
" " + imDataBaseName + ".Patients s " +
|
|
" WHERE " +
|
|
" WHERE " +
|
|
" d.id = p.participant_id " +
|
|
" d.id = p.participant_id " +
|
|
" AND c.consult = t.id " +
|
|
" AND c.consult = t.id " +
|
|
@ -2855,10 +2854,10 @@ public class StatisticsService extends BaseService {
|
|
" AND p.session_id = t.session_id " +
|
|
" AND p.session_id = t.session_id " +
|
|
" AND t. STATUS <> 10 " +
|
|
" AND t. STATUS <> 10 " +
|
|
" AND t.`reply` = 0 " +
|
|
" AND t.`reply` = 0 " +
|
|
" AND c.admin_team_code ="+teamCode+
|
|
|
|
" AND d.id='"+doctor+"'" +
|
|
|
|
" AND t.create_time >= '"+startDate+"' " +
|
|
|
|
" AND t.create_time <= '"+endDate+"'";
|
|
|
|
|
|
" AND c.admin_team_code =" + teamCode +
|
|
|
|
" AND d.id='" + doctor + "'" +
|
|
|
|
" AND t.create_time >= '" + startDate + "' " +
|
|
|
|
" AND t.create_time <= '" + endDate + "'";
|
|
|
|
|
|
JSONObject rs = new JSONObject();
|
|
JSONObject rs = new JSONObject();
|
|
Long total = 0L;
|
|
Long total = 0L;
|
|
@ -3527,8 +3526,8 @@ public class StatisticsService extends BaseService {
|
|
" wlyy_patient_health_guidance w " +
|
|
" wlyy_patient_health_guidance w " +
|
|
" WHERE " +
|
|
" WHERE " +
|
|
" w.admin_team_code = " + teamCode +
|
|
" w.admin_team_code = " + teamCode +
|
|
" AND w.czrq <= '" +endDate+ "' " +
|
|
|
|
" AND w.czrq >= '" +startDate + "' " +
|
|
|
|
|
|
" AND w.czrq <= '" + endDate + "' " +
|
|
|
|
" AND w.czrq >= '" + startDate + "' " +
|
|
" GROUP BY dateNo";
|
|
" GROUP BY dateNo";
|
|
} else {
|
|
} else {
|
|
//按月统计
|
|
//按月统计
|
|
@ -3565,7 +3564,7 @@ public class StatisticsService extends BaseService {
|
|
" w.admin_team_code = " + teamCode +
|
|
" w.admin_team_code = " + teamCode +
|
|
" AND w.doctor ='" + doctor + "'" +
|
|
" AND w.doctor ='" + doctor + "'" +
|
|
" AND w.czrq <= '" + endDate + "' " +
|
|
" AND w.czrq <= '" + endDate + "' " +
|
|
" AND w.czrq >= '" +startDate + "' " +
|
|
|
|
|
|
" AND w.czrq >= '" + startDate + "' " +
|
|
" GROUP BY dateNo";
|
|
" GROUP BY dateNo";
|
|
} else {
|
|
} else {
|
|
//按月统计
|
|
//按月统计
|
|
@ -3716,8 +3715,8 @@ public class StatisticsService extends BaseService {
|
|
" WHERE " +
|
|
" WHERE " +
|
|
" w.admin_team_code = " + teamCode +
|
|
" w.admin_team_code = " + teamCode +
|
|
" AND w.doctor ='" + doctor + "'" +
|
|
" AND w.doctor ='" + doctor + "'" +
|
|
" AND w.czrq <= '" +endDate + "' " +
|
|
|
|
" AND w.czrq >= '" +startDate+ "'";
|
|
|
|
|
|
" AND w.czrq <= '" + endDate + "' " +
|
|
|
|
" AND w.czrq >= '" + startDate + "'";
|
|
JSONObject rs = new JSONObject();
|
|
JSONObject rs = new JSONObject();
|
|
Long guidanceCount = 0L;
|
|
Long guidanceCount = 0L;
|
|
Long addCount = 0L;
|
|
Long addCount = 0L;
|
|
@ -4013,6 +4012,7 @@ public class StatisticsService extends BaseService {
|
|
}
|
|
}
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
|
|
|
|
public List<WlyyQuotaResult> findQuotaResults(String date, int level, String index, String area) {
|
|
public List<WlyyQuotaResult> findQuotaResults(String date, int level, String index, String area) {
|
|
String sql = " select * from wlyy_quota_result w where w.quota_date ='" + date + "' and w.quato_code='" + index + "' and w.level1_type= " + level;
|
|
String sql = " select * from wlyy_quota_result w where w.quota_date ='" + date + "' and w.quato_code='" + index + "' and w.level1_type= " + level;
|
|
if (level == 4) {
|
|
if (level == 4) {
|
|
@ -4032,24 +4032,17 @@ public class StatisticsService extends BaseService {
|
|
return results;
|
|
return results;
|
|
}
|
|
}
|
|
|
|
|
|
public JSONObject getRenewPercentAndChangePercent(String level, String code, String year) {
|
|
|
|
String renewIndex="";
|
|
|
|
String switchIndex="";
|
|
|
|
if("2".equals(level)){
|
|
|
|
//团队的续签量
|
|
|
|
renewIndex="42";
|
|
|
|
|
|
public JSONObject getRenewPercentAndChangePercent(String renewIndex, String level, String code, String year) {
|
|
|
|
String switchIndex = "";
|
|
|
|
if ("2".equals(level)) {
|
|
//团队的转签
|
|
//团队的转签
|
|
switchIndex="35";
|
|
|
|
}else if("2".equals(level)){
|
|
|
|
//社区的续签量
|
|
|
|
renewIndex="43";
|
|
|
|
|
|
switchIndex = "35";
|
|
|
|
} else if ("3".equals(level)) {
|
|
//社区的转签
|
|
//社区的转签
|
|
switchIndex="35";
|
|
|
|
}else{
|
|
|
|
//区和市的续签量
|
|
|
|
renewIndex="44";
|
|
|
|
|
|
switchIndex = "35";
|
|
|
|
} else {
|
|
//区和市的转签
|
|
//区和市的转签
|
|
switchIndex="35";
|
|
|
|
|
|
switchIndex = "35";
|
|
}
|
|
}
|
|
|
|
|
|
JSONObject jo = new JSONObject();
|
|
JSONObject jo = new JSONObject();
|
|
@ -4077,7 +4070,7 @@ public class StatisticsService extends BaseService {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
public JSONObject getRenewAnalysis(String switchIndex,String switchIndexReson,String signIn,String signOut,String level, String code) {
|
|
|
|
|
|
public JSONObject getRenewAnalysis(String switchIndex, String switchIndexReson, String signIn, String signOut, String level, String code) {
|
|
|
|
|
|
JSONObject jo = new JSONObject();
|
|
JSONObject jo = new JSONObject();
|
|
String timeKey = redisTemplate.opsForValue().get("quota:timeKey");
|
|
String timeKey = redisTemplate.opsForValue().get("quota:timeKey");
|
|
@ -4094,25 +4087,25 @@ public class StatisticsService extends BaseService {
|
|
int changeTeam = getLevel1NumForRedis("31", level, code, timeKey);//夸团队的数目
|
|
int changeTeam = getLevel1NumForRedis("31", level, code, timeKey);//夸团队的数目
|
|
int changeHospital = getLevel1NumForRedis("32", level, code, timeKey);//夸社区的数目
|
|
int changeHospital = getLevel1NumForRedis("32", level, code, timeKey);//夸社区的数目
|
|
int changeTown = getLevel1NumForRedis("33", level, code, timeKey);//夸社区的数目
|
|
int changeTown = getLevel1NumForRedis("33", level, code, timeKey);//夸社区的数目
|
|
int allChangeCount=changeTeam+changeHospital+changeTown; //跨团队,跨社区 跨区的分母
|
|
|
|
|
|
int allChangeCount = changeTeam + changeHospital + changeTown; //跨团队,跨社区 跨区的分母
|
|
|
|
|
|
jo.put("inNum", inNum);//今年的签入量
|
|
jo.put("inNum", inNum);//今年的签入量
|
|
jo.put("outNum", outNum);//今年的签出量
|
|
jo.put("outNum", outNum);//今年的签出量
|
|
jo.put("thisYearSwithch", switchNum);//今年的转签量
|
|
jo.put("thisYearSwithch", switchNum);//今年的转签量
|
|
jo.put("switchHealth", switchJO);//今年的服务分布
|
|
jo.put("switchHealth", switchJO);//今年的服务分布
|
|
String changeTeamNum=getRangeNoLast(changeTeam, allChangeCount, 2);//跨团队转签率
|
|
|
|
String changeHospNum=getRangeNoLast(changeHospital, allChangeCount, 2);//跨社区转签率
|
|
|
|
String changeTownNum="";
|
|
|
|
|
|
String changeTeamNum = getRangeNoLast(changeTeam, allChangeCount, 2);//跨团队转签率
|
|
|
|
String changeHospNum = getRangeNoLast(changeHospital, allChangeCount, 2);//跨社区转签率
|
|
|
|
String changeTownNum = "";
|
|
|
|
|
|
if(changeTown==0){
|
|
|
|
changeTownNum="0";
|
|
|
|
}else{
|
|
|
|
changeTownNum=(100-Double.valueOf(changeTeamNum)-Double.valueOf(changeHospNum))+"";//跨区转签率,解决算出来可能不是100%的问题 用扣的
|
|
|
|
|
|
if (changeTown == 0) {
|
|
|
|
changeTownNum = "0";
|
|
|
|
} else {
|
|
|
|
changeTownNum = (100 - Double.valueOf(changeTeamNum) - Double.valueOf(changeHospNum)) + "";//跨区转签率,解决算出来可能不是100%的问题 用扣的
|
|
}
|
|
}
|
|
|
|
|
|
jo.put("switchTeam", changeTeamNum+"%");//今年的转签量
|
|
|
|
jo.put("switchHospital", changeHospNum+"%");//今年的转签量
|
|
|
|
jo.put("switchTown", changeTownNum+"%");//今年的转签量
|
|
|
|
|
|
jo.put("switchTeam", changeTeamNum + "%");//今年的转签量
|
|
|
|
jo.put("switchHospital", changeHospNum + "%");//今年的转签量
|
|
|
|
jo.put("switchTown", changeTownNum + "%");//今年的转签量
|
|
return jo;
|
|
return jo;
|
|
}
|
|
}
|
|
|
|
|
|
@ -4158,9 +4151,9 @@ public class StatisticsService extends BaseService {
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
public String getRange(int first, int second, int i) {
|
|
public String getRange(int first, int second, int i) {
|
|
if(second==0&&first>0){
|
|
|
|
|
|
if (second == 0 && first > 0) {
|
|
return "100%";
|
|
return "100%";
|
|
}else if(second==0&&first==0){
|
|
|
|
|
|
} else if (second == 0 && first == 0) {
|
|
return "0%";
|
|
return "0%";
|
|
}
|
|
}
|
|
float size = (float) (first * 100) / second;
|
|
float size = (float) (first * 100) / second;
|
|
@ -4170,15 +4163,15 @@ public class StatisticsService extends BaseService {
|
|
}
|
|
}
|
|
|
|
|
|
public String getRangeNoLast(int first, int second, int i) {
|
|
public String getRangeNoLast(int first, int second, int i) {
|
|
if(second==0&&first>0){
|
|
|
|
|
|
if (second == 0 && first > 0) {
|
|
return "100";
|
|
return "100";
|
|
}else if(second==0&&first==0){
|
|
|
|
|
|
} else if (second == 0 && first == 0) {
|
|
return "0";
|
|
return "0";
|
|
}
|
|
}
|
|
float size = (float) (first * 100) / second;
|
|
float size = (float) (first * 100) / second;
|
|
DecimalFormat df = new DecimalFormat("0.00");//格式化小数,不足的补0
|
|
DecimalFormat df = new DecimalFormat("0.00");//格式化小数,不足的补0
|
|
String filesize = df.format(size);
|
|
String filesize = df.format(size);
|
|
return filesize ;
|
|
|
|
|
|
return filesize;
|
|
}
|
|
}
|
|
|
|
|
|
public JSONObject getConsultingTitleAll(Integer level, String area, String year) {
|
|
public JSONObject getConsultingTitleAll(Integer level, String area, String year) {
|
|
@ -4282,9 +4275,9 @@ public class StatisticsService extends BaseService {
|
|
public JSONObject getCoutListByTimeYear(String level, String area, String year) {
|
|
public JSONObject getCoutListByTimeYear(String level, String area, String year) {
|
|
JSONObject result = new JSONObject();
|
|
JSONObject result = new JSONObject();
|
|
List<WlyyQuotaResult> wlyyQuotaResult = findQuotaResults((Integer.valueOf(year) + 1) + "-06-30", Integer.valueOf(level), "24", area);
|
|
List<WlyyQuotaResult> wlyyQuotaResult = findQuotaResults((Integer.valueOf(year) + 1) + "-06-30", Integer.valueOf(level), "24", area);
|
|
JSONArray jo=new JSONArray();
|
|
|
|
if (wlyyQuotaResult != null&&wlyyQuotaResult.size()>0) {
|
|
|
|
wlyyQuotaResult.stream().forEach(one->{
|
|
|
|
|
|
JSONArray jo = new JSONArray();
|
|
|
|
if (wlyyQuotaResult != null && wlyyQuotaResult.size() > 0) {
|
|
|
|
wlyyQuotaResult.stream().forEach(one -> {
|
|
JSONObject temp1 = new JSONObject();
|
|
JSONObject temp1 = new JSONObject();
|
|
temp1.put("name", one.getLevel2TypeName());
|
|
temp1.put("name", one.getLevel2TypeName());
|
|
temp1.put("code", getCodeByLevel(one, Integer.valueOf(level)));
|
|
temp1.put("code", getCodeByLevel(one, Integer.valueOf(level)));
|
|
@ -4430,21 +4423,21 @@ public class StatisticsService extends BaseService {
|
|
|
|
|
|
public JSONObject getConsultingStatisticsListYear(Integer level, String area, String lowlevel, String year) {
|
|
public JSONObject getConsultingStatisticsListYear(Integer level, String area, String lowlevel, String year) {
|
|
JSONObject result = new JSONObject();
|
|
JSONObject result = new JSONObject();
|
|
Integer coutYear = Integer.parseInt(year)+1;
|
|
|
|
|
|
Integer coutYear = Integer.parseInt(year) + 1;
|
|
|
|
|
|
//及时回复数
|
|
//及时回复数
|
|
JSONArray rely = getQuotaList(level,lowlevel,area,coutYear,23);
|
|
|
|
if(rely==null){
|
|
|
|
|
|
JSONArray rely = getQuotaList(level, lowlevel, area, coutYear, 23);
|
|
|
|
if (rely == null) {
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
//咨询总数
|
|
//咨询总数
|
|
JSONArray total = getQuotaList(level,lowlevel,area,coutYear,25);
|
|
|
|
if(total==null){
|
|
|
|
|
|
JSONArray total = getQuotaList(level, lowlevel, area, coutYear, 25);
|
|
|
|
if (total == null) {
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
//未回复数
|
|
//未回复数
|
|
JSONArray onRely =getQuotaList(level,lowlevel,area,coutYear,22);
|
|
|
|
if(total==null){
|
|
|
|
|
|
JSONArray onRely = getQuotaList(level, lowlevel, area, coutYear, 22);
|
|
|
|
if (total == null) {
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
result.put("resultList", getCoutList(rely, total, onRely));
|
|
result.put("resultList", getCoutList(rely, total, onRely));
|
|
@ -4471,7 +4464,7 @@ public class StatisticsService extends BaseService {
|
|
" GROUP BY dateNo ";
|
|
" GROUP BY dateNo ";
|
|
} else {
|
|
} else {
|
|
inSql = "SELECT ( " +
|
|
inSql = "SELECT ( " +
|
|
" DATE_FORMAT(r.apply_date, '%v') - DATE_FORMAT('"+startDate+"', '%v') + 1 " +
|
|
|
|
|
|
" DATE_FORMAT(r.apply_date, '%v') - DATE_FORMAT('2017-06-01', '%v') + 1 " +
|
|
" ) AS weekOfMonth,COUNT(1) AS inCount FROM wlyy_sign_family_renew_log r " +
|
|
" ) AS weekOfMonth,COUNT(1) AS inCount FROM wlyy_sign_family_renew_log r " +
|
|
" WHERE r.admin_team_id ='" + teamCode + "' " +
|
|
" WHERE r.admin_team_id ='" + teamCode + "' " +
|
|
" AND r.apply_date >= '" + startDate + "' " +
|
|
" AND r.apply_date >= '" + startDate + "' " +
|
|
@ -4479,7 +4472,7 @@ public class StatisticsService extends BaseService {
|
|
" AND r.old_admin_team_id <> r.admin_team_id " +
|
|
" AND r.old_admin_team_id <> r.admin_team_id " +
|
|
" GROUP BY weekOfMonth ";
|
|
" GROUP BY weekOfMonth ";
|
|
outSql = "SELECT ( " +
|
|
outSql = "SELECT ( " +
|
|
" DATE_FORMAT(r.apply_date, '%v') - DATE_FORMAT('"+startDate+"', '%v') + 1 " +
|
|
|
|
|
|
" DATE_FORMAT(r.apply_date, '%v') - DATE_FORMAT('2017-06-01', '%v') + 1 " +
|
|
" ) AS weekOfMonth,COUNT(1) AS outCount FROM wlyy_sign_family_renew_log r " +
|
|
" ) AS weekOfMonth,COUNT(1) AS outCount FROM wlyy_sign_family_renew_log r " +
|
|
" WHERE r.old_admin_team_id ='" + teamCode + "' " +
|
|
" WHERE r.old_admin_team_id ='" + teamCode + "' " +
|
|
" AND r.apply_date >= '" + startDate + "' " +
|
|
" AND r.apply_date >= '" + startDate + "' " +
|
|
@ -4576,6 +4569,7 @@ public class StatisticsService extends BaseService {
|
|
* 2.市级-机构
|
|
* 2.市级-机构
|
|
* 3.区级-机构
|
|
* 3.区级-机构
|
|
* 4.机构-团队
|
|
* 4.机构-团队
|
|
|
|
*
|
|
* @param level
|
|
* @param level
|
|
* @param lovlevel
|
|
* @param lovlevel
|
|
* @param area
|
|
* @param area
|
|
@ -4583,39 +4577,74 @@ public class StatisticsService extends BaseService {
|
|
* @param index
|
|
* @param index
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
public JSONArray getQuotaList(Integer level, String lovlevel, String area, Integer year, Integer index){
|
|
|
|
String sql ;
|
|
|
|
if(level==4){
|
|
|
|
if(StringUtils.isBlank(lovlevel)){
|
|
|
|
|
|
public JSONArray getQuotaList(Integer level, String lovlevel, String area, Integer year, Integer index) {
|
|
|
|
String sql;
|
|
|
|
if (level == 4) {
|
|
|
|
if (StringUtils.isBlank(lovlevel)) {
|
|
//市 区
|
|
//市 区
|
|
sql =" SELECT t.result As num,t.town_name AS name,t.town AS code,t.create_time AS date" +
|
|
|
|
|
|
sql = " SELECT t.result As num,t.town_name AS name,t.town AS code,t.create_time AS date" +
|
|
" FROM wlyy_quota_result t " +
|
|
" FROM wlyy_quota_result t " +
|
|
" WHERE t.city ='"+area+"' AND t.quato_code ='"+index+"' AND t.level1_type ='3'AND t.quota_date='"+year+"-06-30'";
|
|
|
|
}else{
|
|
|
|
|
|
" WHERE t.city ='" + area + "' AND t.quato_code ='" + index + "' AND t.level1_type ='3'AND t.quota_date='" + year + "-06-30'";
|
|
|
|
} else {
|
|
//市 机构
|
|
//市 机构
|
|
sql = "SELECT t.result As num,t.org_name AS name,t.org_code AS code,t.create_time AS date" +
|
|
sql = "SELECT t.result As num,t.org_name AS name,t.org_code AS code,t.create_time AS date" +
|
|
" FROM wlyy_quota_result t " +
|
|
" FROM wlyy_quota_result t " +
|
|
" WHERE t.city ='"+area+"' AND t.quato_code ='"+index+"' AND t.level1_type ='2' AND t.quota_date='"+year+"-06-30'";
|
|
|
|
|
|
" WHERE t.city ='" + area + "' AND t.quato_code ='" + index + "' AND t.level1_type ='2' AND t.quota_date='" + year + "-06-30'";
|
|
}
|
|
}
|
|
}else if (level ==3){
|
|
|
|
|
|
} else if (level == 3) {
|
|
//区 机构
|
|
//区 机构
|
|
sql = "SELECT t.result As num,t.org_name AS name,t.org_code AS code,t.create_time AS date " +
|
|
sql = "SELECT t.result As num,t.org_name AS name,t.org_code AS code,t.create_time AS date " +
|
|
"FROM wlyy_quota_result t " +
|
|
"FROM wlyy_quota_result t " +
|
|
"WHERE t.town ='"+area+"' AND t.quato_code ='"+index+"' AND t.level1_type ='2' AND t.quota_date='"+year+"-06-30'";
|
|
|
|
}else{
|
|
|
|
|
|
"WHERE t.town ='" + area + "' AND t.quato_code ='" + index + "' AND t.level1_type ='2' AND t.quota_date='" + year + "-06-30'";
|
|
|
|
} else {
|
|
//机构 团队
|
|
//机构 团队
|
|
sql ="SELECT t.result As num,t.qkdoctor_name AS name,t.qkdoctor_code AS code,t.create_time AS date " +
|
|
|
|
|
|
sql = "SELECT t.result As num,t.qkdoctor_name AS name,t.qkdoctor_code AS code,t.create_time AS date " +
|
|
" FROM wlyy_quota_result t " +
|
|
" FROM wlyy_quota_result t " +
|
|
" WHERE t.org_code ='"+area+"' AND t.quato_code ='"+index+"' AND t.level1_type ='1' AND t.quota_date='"+year+"-06-30'";
|
|
|
|
|
|
" WHERE t.org_code ='" + area + "' AND t.quato_code ='" + index + "' AND t.level1_type ='1' AND t.quota_date='" + year + "-06-30'";
|
|
}
|
|
}
|
|
List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
|
|
|
|
if(list!=null&&list.size()>0){
|
|
|
|
|
|
List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
|
|
|
|
if (list != null && list.size() > 0) {
|
|
return new JSONArray(list);
|
|
return new JSONArray(list);
|
|
}else{
|
|
|
|
|
|
} else {
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public JSONObject getRenewPercent(String level, String area, String year) {
|
|
|
|
String renewIndex = "";
|
|
|
|
if ("1".equals(level)) {
|
|
|
|
//团队的续签量
|
|
|
|
renewIndex = "42";
|
|
|
|
} else if ("2".equals(level)) {
|
|
|
|
//社区的续签量
|
|
|
|
renewIndex = "43";
|
|
|
|
} else if ("3".equals(level)) {
|
|
|
|
//区的续签量
|
|
|
|
renewIndex = "44";
|
|
|
|
} else {
|
|
|
|
//市的续签量
|
|
|
|
renewIndex = "29";
|
|
|
|
}
|
|
|
|
|
|
|
|
JSONObject jo = new JSONObject();
|
|
|
|
//获取时间戳
|
|
|
|
String timeKey = redisTemplate.opsForValue().get("quota:timeKey");
|
|
|
|
|
|
|
|
int renewNum = getLevel1NumForRedis(renewIndex, level, area, timeKey);
|
|
|
|
//根据年度获取去年的签约数 签约指标是1
|
|
|
|
String date = year + "-06-30";
|
|
|
|
String index = "1";
|
|
|
|
WlyyQuotaResult wlyyQuotaResult = findOneQuotaResult(date, Integer.valueOf(level), index, area);
|
|
|
|
int signNum = 0;
|
|
|
|
if (wlyyQuotaResult != null) {
|
|
|
|
signNum = Integer.valueOf(wlyyQuotaResult.getResult());
|
|
|
|
}
|
|
|
|
jo.put("yesterYearSign", signNum);//去年的签约量
|
|
|
|
jo.put("thisYearRenew", renewNum);//今年的续签量
|
|
|
|
jo.put("renewRange", getRange(renewNum, signNum, 2));//续签率 50.00%
|
|
|
|
|
|
|
|
return jo;
|
|
|
|
}
|
|
}
|
|
}
|
|
|
|
|