spring boot+mybatis-plus+SQL server调用有返回值的存储过程

1.在mapper.xml中

2.在mapper.java中

List> checkXkEnable(Map map);

3.在controller中

@ApiOperation("校验申请按钮")
@ApiImplicitParams({@ApiImplicitParam(value = "车牌号",name = "cphOrYyZh",dataType = "String",paramType = "query"),
        @ApiImplicitParam(value = "",name = "xkWh",dataType = "String",paramType = "query"),
        @ApiImplicitParam(value = "czr",name = "czr",dataType = "String",paramType = "query")})
@PostMapping("/checkXkEnable")
public ResultInfo checkXkEnable(String cphOrYyZh, String xkWh,String czr) {
    try {
        Map params = new HashMap<>();
        params.put("CphOrYyZh",cphOrYyZh);
        params.put("XkWh",xkWh);
        params.put("Czr",czr);
        xkSqMapper.checkXkEnable(params);
        String sRet = (String) params.get("sRet");
        if ("succeed".equals(sRet)) {
            return ResultInfo.ok("数据查询成功!");
        } else {
            return ResultInfo.fail(902, sRet);
        }
    } catch (Exception e) {
        return ResultInfo.fail(901,"数据查询失败!");
    }
}

 

你可能感兴趣的:(springboot,Mybatis,SQL,server)