| | |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | |
| | | import java.awt.*; |
| | | import java.util.Iterator; |
| | | import java.util.LinkedHashMap; |
| | | import java.util.*; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | |
| | | public class attarSearchPanel extends VCIJPanel { |
| | | public class AttarSearchPanel extends VCIJPanel { |
| | | |
| | | private LinkedHashMap<String , VCIJTextField> attrInerNameValMap = new LinkedHashMap<String,VCIJTextField>(); |
| | | private UIFormRefer uiFormRefer; |
| | | public attarSearchPanel(UIFormRefer uiFormRefer){ |
| | | public AttarSearchPanel(UIFormRefer uiFormRefer){ |
| | | this.uiFormRefer = uiFormRefer; |
| | | init(); |
| | | } |
| | |
| | | * @time 2013-3-17 |
| | | * @return |
| | | */ |
| | | public String getAttrSearchFilterString(){ |
| | | public Map<String,String> getAttrSearchFilterString(){ |
| | | String result = ""; |
| | | StringBuilder sql = new StringBuilder(); |
| | | Map<String,String> customConditionMap=new HashMap<>(); |
| | | Set<String> keys = attrInerNameValMap.keySet(); |
| | | for (Iterator it = keys.iterator(); it.hasNext();) { |
| | | String key = (String)it.next(); |
| | |
| | | String message = textField.getText().replaceAll(" ", "").trim(); |
| | | if(message.equals("")) continue; |
| | | String text = getTextQueryVal(message); |
| | | sql.append(" "+key+" "); |
| | | sql.append(" like "); |
| | | sql.append("'"+text+"'"); |
| | | sql.append(" and"); |
| | | customConditionMap.put(key,text); |
| | | } |
| | | if(sql.length() != 0){ |
| | | result = sql.substring(0, sql.lastIndexOf("and")); |
| | | } |
| | | return result; |
| | | |
| | | return customConditionMap; |
| | | } |
| | | |
| | | /** |