| 
					
				 | 
			
			
				@ -11,7 +11,6 @@ import com.yihu.jw.entity.patient.BaseDeviceRepairEntity; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.restmodel.web.PageEnvelop; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.util.date.DateUtil; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.mysql.query.BaseJpaService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import net.sf.json.JSONArray; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.apache.commons.lang3.StringUtils; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.springframework.beans.factory.annotation.Autowired; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.springframework.jdbc.core.BeanPropertyRowMapper; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -99,7 +98,8 @@ public class DeviceManageService extends BaseJpaService<BaseDeviceRepairEntity,B 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         " AND dr.device_sn = pd.device_sn" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         " AND pd. USER = ph.patient" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         " AND ph.doctor = '"+doctor+"'" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         " AND ph.del = '1'"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         " AND ph.del = '1'  " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         " AND dr.type is null "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 repairSql = "SELECT DISTINCT dr.order_id AS id,dr.bind_user_name AS patientName, pd.category_code as categoryCode," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        " dr.`status` AS `status`,dr.create_time AS createTime,dr.repair_peoper_name AS repairName,wd.device_name AS deviceName" + 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -117,6 +117,7 @@ public class DeviceManageService extends BaseJpaService<BaseDeviceRepairEntity,B 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        " AND dd.model = wd.device_model" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        " AND p.del = 1" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        " AND pd.device_sn = dr.device_sn" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        " AND dr.type is null " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        " and EXISTS (SELECT sr.patient from base_service_package_sign_record sr,base_service_package_record r,base_team_member m " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        " WHERE sr.patient = p.id and sr.status=1 and m.team_code = r.team_code and sr.id=r.sign_id AND dr.repair_peoper = m.doctor_code" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        " and m.doctor_code = '" + doctor + "' and m.del = '1')"; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -142,7 +143,7 @@ public class DeviceManageService extends BaseJpaService<BaseDeviceRepairEntity,B 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    /*报修详细信息*/ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public List<BaseDeviceRepairEntity> getRepairInfo(String orderId) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return jdbcTemplate.query("SELECT * from base_device_repair WHERE order_id = '" + orderId + "'", new BeanPropertyRowMapper<>(BaseDeviceRepairEntity.class)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return jdbcTemplate.query("SELECT * from base_device_repair WHERE type is null and order_id = '" + orderId + "'", new BeanPropertyRowMapper<>(BaseDeviceRepairEntity.class)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    /*报修*/ 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -185,7 +186,7 @@ public class DeviceManageService extends BaseJpaService<BaseDeviceRepairEntity,B 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " DATE_FORMAT( dr.create_time ,'%Y-%m-%d %H:%i:%S') createTime " ; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String countSql = " select count(distinct dr.id) "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String filterSql =  " FROM wlyy_patient_device pd,base_device_repair dr,base_patient p " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "WHERE p.id = pd.user AND pd.del = 0 AND dr.device_sn = pd.device_sn and p.del=1  "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "WHERE p.id = pd.user AND pd.del = 0 AND dr.device_sn = pd.device_sn and p.del=1 and dr.type is null  "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (StringUtils.isNotBlank(status)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            filterSql += " and dr.status='"+status+"' "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -205,7 +206,7 @@ public class DeviceManageService extends BaseJpaService<BaseDeviceRepairEntity,B 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " DATE_FORMAT( dr.create_time ,'%Y-%m-%d %H:%i:%S') createTime,  DATE_FORMAT( pd.czrq ,'%Y-%m-%d %H:%i:%S') czrq, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " dr.show_content,dr.img,dr.feedback " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "FROM wlyy_patient_device pd,base_device_repair dr,base_patient p " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "WHERE p.id = pd.user AND pd.del = 0 AND dr.device_sn = pd.device_sn and p.del=1 and dr.id='"+orderId+"' "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "WHERE p.id = pd.user AND pd.del = 0 AND dr.device_sn = pd.device_sn and dr.type is null and p.del=1 and dr.id='"+orderId+"' "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List <Map<String,Object>> list =  jdbcTemplate.queryForList(sql); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (list.size()>0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            result = list.get(0); 
			 |