|
@ -42,7 +42,7 @@ public class WechatService extends BaseService {
|
|
|
"t.NAME as patientname," +
|
|
|
"a.mobile," +
|
|
|
"t.openid_time," +
|
|
|
"a.idcard," +
|
|
|
"CONCAT(LEFT (a.idcard,6),'**********',RIGHT (a.idcard,2)) idcard," +
|
|
|
"a.doctor_name," +
|
|
|
"a.doctor_health_name," +
|
|
|
"t.sick_village_name," +
|
|
@ -58,12 +58,11 @@ public class WechatService extends BaseService {
|
|
|
"a.code as patientcode ," +
|
|
|
"a.NAME as patientname ," +
|
|
|
"a.openid_time," +
|
|
|
"a.idcard," +
|
|
|
"CONCAT(LEFT (a.idcard,6),'**********',RIGHT (a.idcard,2)) idcard," +
|
|
|
"b.doctor_name," +
|
|
|
"b.doctor_health_name," +
|
|
|
"b.hospital_name," +
|
|
|
"a.address," +
|
|
|
"a.address," +
|
|
|
"a.sick_village_name," +
|
|
|
"a.street_name FROM (" +
|
|
|
"SELECT t.CODE,t.NAME,t.address,t.sick_village_name,t.street_name,idcard,mobile,openid_time FROM wlyy_patient t WHERE t.`code` IN (" +
|
|
@ -91,10 +90,10 @@ public class WechatService extends BaseService {
|
|
|
"FROM wlyy_patient p,wlyy_sign_family sf WHERE p.idcard=sf.idcard AND sf.type=2 " +
|
|
|
"AND sf.STATUS> 0 AND LENGTH(sf.hospital)=10 " +
|
|
|
"AND sf.admin_team_code IS NOT NULL AND p.openid IS NOT NULL " +
|
|
|
"AND p.openid_time<= '"+ DateUtil.dateToStrShort(new Date())+"' AND sf.sign_year='2017' GROUP BY sf.hospital ORDER BY countdesc) a1," +
|
|
|
"AND p.openid_time<= '"+ DateUtil.dateToStrShort(new Date())+"' AND sf.sign_year='2017' GROUP BY sf.hospital ORDER BY count desc) a1," +
|
|
|
"(SELECT a.hospital hospital,count(a.id) count,a.hospital_name hospital_name " +
|
|
|
"FROM wlyy_sign_family a WHERE STATUS IN (1,2) AND a.type=2 AND expenses_status=1 " +
|
|
|
"AND a.expenses_time<= '"+ DateUtil.dateToStrShort(new Date())+"' AND a.sign_year='2017' GROUP BY a.hospital ORDER BY countdesc) a2 WHERE a1.hospital=a2.hospital";
|
|
|
"AND a.expenses_time<= '"+ DateUtil.dateToStrShort(new Date())+"' AND a.sign_year='2017' GROUP BY a.hospital ORDER BY count desc) a2 WHERE a1.hospital=a2.hospital";
|
|
|
|
|
|
list = jdbcTemplate.query(sql,new BeanPropertyRowMapper(WechatTotalVO.class));
|
|
|
return list ;
|
|
@ -108,14 +107,16 @@ public class WechatService extends BaseService {
|
|
|
public List<WechatTotalVO> townTotalData() {
|
|
|
List<WechatTotalVO> list = new ArrayList<>();
|
|
|
String sql = "SELECT " +
|
|
|
"a1.town_name," +
|
|
|
"(a1.count/a2.count)," +
|
|
|
"a1.count,a2.countfrom (" +
|
|
|
"a1.town_name as name," +
|
|
|
"(a1.count/a2.count) as attRate," +
|
|
|
"a1.count as attNumber," +
|
|
|
"a2.count as signNumber " +
|
|
|
"from (" +
|
|
|
"SELECT count(sf.id) count,h.town_name town_name,h.town town " +
|
|
|
"FROM wlyy_patient p,wlyy_sign_family sf,dm_hospital h WHERE p.idcard=sf.idcard " +
|
|
|
"AND sf.type=2 AND sf.STATUS> 0 AND LENGTH(sf.hospital)=10 AND sf.hospital=h.CODE " +
|
|
|
"AND sf.admin_team_code IS NOT NULL AND p.openid IS NOT NULL " +
|
|
|
"AND p.openid_time< '"+ DateUtil.dateToStrShort(new Date())+"' AND sf.sign_year='2017' GROUP BY h.town ORDER BY countdesc) a1,(" +
|
|
|
"AND p.openid_time< '"+ DateUtil.dateToStrShort(new Date())+"' AND sf.sign_year='2017' GROUP BY h.town ORDER BY count desc) a1,(" +
|
|
|
"SELECT count(a.id) count,h.town_name town_name,h.town town FROM wlyy_sign_family a,dm_hospital h" +
|
|
|
" WHERE STATUS IN (1,2) AND a.type=2 AND expenses_status=1 AND a.hospital=h.CODE " +
|
|
|
"AND a.expenses_time< '"+ DateUtil.dateToStrShort(new Date())+"' AND a.sign_year='2017' GROUP BY h.town) a2 WHERE a1.town=a2.town";
|