1,強類型沒有的屬性,如果數(shù)據(jù)庫有,直接使用set方法,set(col_name, value);可以不適用弱類型!!!
2,兼容不同數(shù)據(jù)庫:SqlConditionUtil sqlConditionUtil = new SqlConditionUtil();sqlConditionUtil.ge("time", starttime);String patchSql = new SQLManageUtil().buildPatchSql(sqlConditionUtil.getMap());
3,請求參數(shù)末尾追加“:”jquery配置加上:contentType: "application/json",
4,返回數(shù)據(jù)規(guī)范
// 返回數(shù)據(jù)
public MapreturnDate(Listdata){
??? int httpCode = 200;
??? int serviceCode = 0; String text = "沒有查到數(shù)據(jù)!";
??? if(data.size() > 0){
??????? serviceCode = 1; text = "";
??? }
??? MapresultMap = new HashMap<>();
??? // custom ---- 數(shù)據(jù)和業(yè)務狀態(tài)
??? MapcustomMap = new HashMap<>();
??? customMap.put("code", String.valueOf(serviceCode));
??? customMap.put("text", text);
??? for(Object o : data){
??????? customMap.put("dataList", o);
??? }
??? // status ---- 請求狀態(tài)信息
??? Map statusMap = new HashMap<>();
? ? ? ? statusMap.put("code", String.valueOf(httpCode));
? ? ? ? statusMap.put("text", "請求成功");
? ? ? ? resultMap.put("custom", customMap);
? ? ? ? resultMap.put("status", statusMap);
? ? ? ? return resultMap;
? ? }