哈哈哈哈
							parent
							
								
									4c5bec680b
								
							
						
					
					
						commit
						152772eb00
					
				| 
						 | 
					@ -2,6 +2,7 @@ package com.dev.energy.server.valuelist.adapter.hib3;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import java.lang.reflect.InvocationTargetException;
 | 
					import java.lang.reflect.InvocationTargetException;
 | 
				
			||||||
import java.text.ParseException;
 | 
					import java.text.ParseException;
 | 
				
			||||||
 | 
					import java.text.SimpleDateFormat;
 | 
				
			||||||
import java.util.ArrayList;
 | 
					import java.util.ArrayList;
 | 
				
			||||||
import java.util.Collection;
 | 
					import java.util.Collection;
 | 
				
			||||||
import java.util.Collections;
 | 
					import java.util.Collections;
 | 
				
			||||||
| 
						 | 
					@ -213,9 +214,20 @@ return translator.getSQLString();
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
         	Map mmpMap=info.getFilters();
 | 
					         	Map mmpMap=info.getFilters();
 | 
				
			||||||
        	for (Object  key : mmpMap.keySet()) {
 | 
					        	for (Object  key : mmpMap.keySet()) {
 | 
				
			||||||
 | 
					        		
 | 
				
			||||||
				String ketstr=(String)key;
 | 
									String ketstr=(String)key;
 | 
				
			||||||
				String parm= mmpMap.get(key).toString();
 | 
									Object parm= mmpMap.get(key);
 | 
				
			||||||
				hql=hql.replace("{"+ketstr+"}", parm.replaceAll(" ", ""));
 | 
									LOGGER.info(ketstr+"--"+parm.getClass().getName());
 | 
				
			||||||
 | 
									if("java.util.Date".endsWith(parm.getClass().getName())){
 | 
				
			||||||
 | 
									     SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");   
 | 
				
			||||||
 | 
									        // 格式化日期为字符串
 | 
				
			||||||
 | 
									       String dateString = sdf.format(parm);
 | 
				
			||||||
 | 
										hql=hql.replace("{"+ketstr+"}", dateString);
 | 
				
			||||||
 | 
									}else{
 | 
				
			||||||
 | 
										
 | 
				
			||||||
 | 
										hql=hql.replace("{"+ketstr+"}", parm.toString().replaceAll(" ", ""));
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
									
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
         	
 | 
					         	
 | 
				
			||||||
        	
 | 
					        	
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue