mybatis 的mapper文件解析规律,只会解析出一层你申明好的参数类型,如果就是map一层解析出来后就是字符串k-v,
表达式中直接用key,若果map中套map解析出来的就是内层param,后面用的时候用key在点入一层渠道具体常用类型数据
返回结果是 resultType="java.util.HashMap" 可以不用建立特意的实体,去承接
例如:
@Override
@Transactional(rollbackFor=Exception.class)
public void updateUser(Map
param.remove("CUSTOMER_ID1");
Map
TbCusFirmAffix record = new TbCusFirmAffix();
record.setCustomerKey(BigDecimal.valueOf(Long.valueOf((String)param.get("CUSTOMER_KEY"))) );
tbCusFirmAffixMapper.delete(record);
Map
Map
if("Y".equals(param.get("COMP_TYPE"))){
//if(param.get("LANGUAGE")==null||param.get("LANGUAGE").toString().equals("")){
//param.put("LANGUAGE", "CN");
//}
param.put("CUSTOMER_NAME", param.get("CHINESE_NAME"));
fileMap = new HashMap();
List
Map
paramCodeGN.put("code", "TB_CUS_FIRM_AFFIX.AFFIX_KIND.QY.GN");
GN=tbCusFirmChgMapper.getCodeMap(paramCodeGN);
for(Map gn: GN){
String key="";
for(Object k: gn.keySet()){
key=(String) k;
break;
}
if((!"".equals(param.get("fjCode_N_"+gn.get(key)))&¶m.get("fjCode_N_"+gn.get(key))!=null)||(param.get("zjInfo_N_"+gn.get(key))!=null&&!"".equals(param.get("zjInfo_N_"+gn.get(key))))){
Map
paramTableKey.put("P_KEYMGR_KEY", Integer.valueOf(41));
paramTableKey.put("P_GETNUM", Integer.valueOf(1));
String tk1= tbCusFirmChgMapper.getTableKey(paramTableKey);
Integer X_CURVAL1=0;
if(paramTableKey.get("X_CURVAL")!=null){
X_CURVAL1=(Integer) paramTableKey.get("X_CURVAL")+1;
}
fileMap.put("CUSAFFIX_KEY", X_CURVAL1);
fileMap.put("CUSTOMER_KEY", param.get("CUSTOMER_KEY"));
fileMap.put("AFFIX_KIND", gn.get(key));
if(gn.get(key)==null){
fileMap.put("FJNAME", "");
}else{
fileMap.put("FJNAME", gn.get(key));
}
if(param.get("fjCode_N_"+gn.get(key))==null){
fileMap.put("PAPERS_NUM", "");
}else{
fileMap.put("PAPERS_NUM", param.get("fjCode_N_"+gn.get(key)));
}
String filePath="";
if(gn.get(key)!=null){
filePath=(String) param.get("zjInfo_N_"+gn.get(key));
}
if(filePath==null){
filePath="";
}
fileMap.put("AFFIX_PATH", filePath);
if(getFileExt(filePath).contains("/")){
fileMap.put("AFFIX_TYPE", getFileExt(filePath).substring(0, getFileExt(filePath).indexOf("/")));
}else{
fileMap.put("AFFIX_TYPE", getFileExt(filePath));
}
fileMap.put("AFFIX_DATE", new Date());
Map
filem.put("param", fileMap);
//tbCusFirmChgMapper.saveDataMapAFFIX2(filem);
tbCusFirmWebMapper.saveDataMapWeb(filem);
}
INSERT INTO TB_CUS_FIRM_AFFIX_CHG
${k}
VALUES
#{param[${k}]}
@RequestMapping("/account/tbCusFirmWeb/autio")
public String autio(@RequestParam(value = "customerKey", required = false) String customerKey,@RequestParam Map
List
tbBasBedList2 = tbBasBedService.list();
if(!"".equals(customerKey)&&null!=customerKey){
TbConFirmFeeVo tbConFirmFee = new TbConFirmFeeVo();
tbConFirmFee.setWareKey(BigDecimal.valueOf(Long.valueOf(customerKey)));
Map
param.put("customerKey", customerKey);
if(tbConFeeService.getTbConFeeVoListVO(param)!=null&&tbConFeeService.getTbConFeeVoListVO(param).size()>0){
tbConFirmFee= tbCusFirmChgService.getTbConFirmFeeListVO(param).size()==0?null:tbCusFirmChgService.getTbConFirmFeeListVO(param).get(0);
}
model.addAttribute("vo", tbConFirmFee);
model.addAttribute("flag", "1");
}else{
model.addAttribute("flag", "0");
}
Map
List
sp= tbBasFeeService.getTbBasFeeListNoPage(param);
List
tbBasBedSrtList= tbBasBedSrtService.list();
model.addAttribute("fq", sp);
List
model.addAttribute("gj", gj);
List
model.addAttribute("shen", tbBasAreas);
List
List
Map
Map
GN1.put("lookup_type", "1");
GN1.put("lookup_name", "2,2y");
GW1.put("lookup_type", "1");
GW1.put("lookup_name", "2");
GN.add(GN1);
GW.add(GW1);
Map
paramCodeGW.put("code", "TB_CUS_FIRM_AFFIX.AFFIX_KIND.QY.GW");
Map
paramCodeGN.put("code", "TB_CUS_FIRM_AFFIX.AFFIX_KIND.QY.GN");
Map
paramCodeZJ.put("code", "TB_CUS_FIRM_WEB.CARD_TYPE");
GN=tbCusFirmChgService.getCodeMap(paramCodeGN);
GW=tbCusFirmChgService.getCodeMap(paramCodeGW);
model.addAttribute("mapGN", GN);
model.addAttribute("mapGW", GW);
String customerID= tbCusFirmChgService.createCustomerID();
model.addAttribute("CUSTOMER_ID", customerID);
List
model.addAttribute("companyType", companyType);
model.addAttribute("CUS_RANK_NUM", tbCusFirmChgService.getCusRankList());
model.addAttribute("CREDIT_RANK_NUM", tbCusFirmChgService.getCreditRank());
model.addAttribute("TRADE_RANK_NUM", tbCusFirmChgService.getTradeRank());
model.addAttribute("CARD_TYPE", tbCusFirmChgService.getCodeMap(paramCodeZJ));
model.addAttribute("customerKey", customerKey);
Map
if(!"".equals(customerKey)&&customerKey!=null){
Map
paramEdit.put("CUSTOMER_KEY", Integer.valueOf(customerKey));
if(tbCusFirmWebService.getUserInfoWeb(customerKey)!=null&&tbCusFirmWebService.getUserInfoWeb(customerKey).size()>0){
userInfo =tbCusFirmWebService.getUserInfoWeb(customerKey).get(0);
}
if(userInfo!=null){
userInfo.put("zjInfo", tbCusFirmWebService.getZjInfoWeb(paramEdit));
}
if(userInfo!=null){
List list = tbCusFirmWebService.getJypzInfoList(customerKey);
userInfo.put("jypzInfoList", list);
if(list!=null&&list.size()>0){
Map jypzInfoMap1 = new HashMap();
for(int i=0;i Map pzDate = (Map) list.get(i); jypzInfoMap1.put(pzDate.get("WAREKIND_KEY")+"-"+pzDate.get("CURRENCY_TYPE"), pzDate.get("WAREKIND_KEY")+"-"+pzDate.get("CURRENCY_TYPE")); } userInfo.put("jypzInfoMap", jypzInfoMap1); Map jypzInfoMap = null; jypzInfoMap=(Map) userInfo.get("jypzInfoMap"); List model.addAttribute("codeLibraryjypzList", codeLibraryjypzList); } } List model.addAttribute("regUser", userInfo); model.addAttribute("tbBasShis", tbBasShis); model.addAttribute("operateuserList", tbCusFirmChgService.getOperateUserByCustomerKey(paramEdit)); } return "/account/tbCusFirmWeb/autio"; } SELECT t.*,FC_GET_AREANAME(t.CITY_AREA_KEY) AREA_NAME FROM TB_CUS_FIRM_WEB t WHERE CUSTOMER_KEY=#{CUSTOMER_KEY}