|  | @ -11,6 +11,7 @@ import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
 | 
												
													
														
															|  | import com.yihu.jw.utils.hibernate.HibenateUtils;
 |  | import com.yihu.jw.utils.hibernate.HibenateUtils;
 | 
												
													
														
															|  | import com.yihu.mysql.query.BaseJpaService;
 |  | import com.yihu.mysql.query.BaseJpaService;
 | 
												
													
														
															|  | import com.yihu.utils.security.MD5;
 |  | import com.yihu.utils.security.MD5;
 | 
												
													
														
															|  | 
 |  | import net.sf.json.JSONArray;
 | 
												
													
														
															|  | import net.sf.json.JSONObject;
 |  | import net.sf.json.JSONObject;
 | 
												
													
														
															|  | import org.apache.commons.collections.map.HashedMap;
 |  | import org.apache.commons.collections.map.HashedMap;
 | 
												
													
														
															|  | import org.apache.commons.lang3.StringUtils;
 |  | import org.apache.commons.lang3.StringUtils;
 | 
												
											
												
													
														
															|  | @ -49,7 +50,7 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
 | 
												
													
														
															|  |      * @param page
 |  |      * @param page
 | 
												
													
														
															|  |      * @param pageSize
 |  |      * @param pageSize
 | 
												
													
														
															|  |      */
 |  |      */
 | 
												
													
														
															|  |     public Envelop queryList(String city, String hospital, String status, String name, String type,String typeCode, int page, int pageSize){
 |  | 
 | 
												
													
														
															|  | 
 |  |     public Envelop queryList(String city, String hospital, String status, String name, String type,String typeCode,String dept, int page, int pageSize){
 | 
												
													
														
															|  |         Map<String,Object> params = new HashedMap();
 |  |         Map<String,Object> params = new HashedMap();
 | 
												
													
														
															|  |         String sqlTotal ="SELECT " +
 |  |         String sqlTotal ="SELECT " +
 | 
												
													
														
															|  |                 " COUNT(1) AS \"total\" " +
 |  |                 " COUNT(1) AS \"total\" " +
 | 
												
											
												
													
														
															|  | @ -86,6 +87,11 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
 | 
												
													
														
															|  |             sqlTotal += " AND e.dept_type_code =:typeCode";
 |  |             sqlTotal += " AND e.dept_type_code =:typeCode";
 | 
												
													
														
															|  |             params.put("typeCode",typeCode);
 |  |             params.put("typeCode",typeCode);
 | 
												
													
														
															|  |         }
 |  |         }
 | 
												
													
														
															|  | 
 |  |         if(StringUtils.isNotBlank(dept)){
 | 
												
													
														
															|  | 
 |  |             sqlTotal += " AND b.dept_code =:dept";
 | 
												
													
														
															|  | 
 |  |             params.put("dept",dept);
 | 
												
													
														
															|  | 
 |  |         }
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |         Long count = 0L;
 |  |         Long count = 0L;
 | 
												
													
														
															|  |         List<Map<String,Object>> total = hibenateUtils.createSQLQuery(sqlTotal,params);
 |  |         List<Map<String,Object>> total = hibenateUtils.createSQLQuery(sqlTotal,params);
 | 
												
													
														
															|  |         if(count!=null){
 |  |         if(count!=null){
 | 
												
											
												
													
														
															|  | @ -125,6 +131,9 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
 | 
												
													
														
															|  |         if(StringUtils.isNotBlank(typeCode)){
 |  |         if(StringUtils.isNotBlank(typeCode)){
 | 
												
													
														
															|  |             sql += " AND e.dept_type_code =:typeCode";
 |  |             sql += " AND e.dept_type_code =:typeCode";
 | 
												
													
														
															|  |         }
 |  |         }
 | 
												
													
														
															|  | 
 |  |         if(StringUtils.isNotBlank(dept)){
 | 
												
													
														
															|  | 
 |  |             sql += " AND b.dept_code =:dept";
 | 
												
													
														
															|  | 
 |  |         }
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |         logger.info("queryList sql:"+sql);
 |  |         logger.info("queryList sql:"+sql);
 | 
												
													
														
															|  | 
 |  | 
 | 
												
											
												
													
														
															|  | @ -196,6 +205,19 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
 | 
												
													
														
															|  |         return null;
 |  |         return null;
 | 
												
													
														
															|  |     }
 |  |     }
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  |     public Boolean updateList(JSONArray jsonArray){
 | 
												
													
														
															|  | 
 |  |         if(jsonArray!=null&&jsonArray.size()>0){
 | 
												
													
														
															|  | 
 |  |             for(int i=0;i<jsonArray.size();i++){
 | 
												
													
														
															|  | 
 |  |                 JSONObject doctor = jsonArray.getJSONObject(i);
 | 
												
													
														
															|  | 
 |  |                 try {
 | 
												
													
														
															|  | 
 |  |                     update(doctor);
 | 
												
													
														
															|  | 
 |  |                 }catch (Exception e){
 | 
												
													
														
															|  | 
 |  |                     logger.info("update doctor error:"+e.toString());
 | 
												
													
														
															|  | 
 |  |                 }
 | 
												
													
														
															|  | 
 |  |             }
 | 
												
													
														
															|  | 
 |  |         }
 | 
												
													
														
															|  | 
 |  |         return true;
 | 
												
													
														
															|  | 
 |  |     }
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |     /**
 |  |     /**
 | 
												
													
														
															|  |      * 修改医生服务配置
 |  |      * 修改医生服务配置
 | 
												
											
												
													
														
															|  | @ -277,4 +299,12 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
 | 
												
													
														
															|  |         return buffer.toString();
 |  |         return buffer.toString();
 | 
												
													
														
															|  |     }
 |  |     }
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  | //    public static void main(String ag[]){
 | 
												
													
														
															|  | 
 |  | //        String str = "[{\"doctor\",\"1\"},{\"doctor\",\"2\"}]";
 | 
												
													
														
															|  | 
 |  | //        JSONArray json = JSONArray.fromObject(str);
 | 
												
													
														
															|  | 
 |  | //        for(int i=0;i<json.size();i++){
 | 
												
													
														
															|  | 
 |  | //            JSONObject doctor = json.getJSONObject(i);
 | 
												
													
														
															|  | 
 |  | //            doctor.getString("doctor");
 | 
												
													
														
															|  | 
 |  | //        }
 | 
												
													
														
															|  | 
 |  | //    }
 | 
												
													
														
															|  | }
 |  | }
 |