紫月飞星繁花
2021-05-20 10:15
采纳率: 60%
浏览 155
已采纳

Spring boot 中使用Java对象分装数据,返回前台json数据字段不全

一、实体类

public class ReceptionExpense extends  BaseModel<ReceptionExpense>
{
   private String  bicG0hangbs;
   
   private String  bicG0ywrq;
   
   private String  bicG0belong;
  
   private String  bicG0rfssdw;
  
   private String  bicG0sqrbm;
   //略get\set方法
}

二、controller层

@Controller
@RequestMapping("receptionExpense")
public class ReceptionExpenseController extends SysBaseController{
    @Resource
    private ReceptionExpenseService receptionExpenseService;

    @RequestMapping("/lists")
    @ResponseBody
    public Object list(HttpServletRequest request) {
        QueryFilter queryFilter = new QueryFilter(request, true);
        //分页数据
        List<ReceptionExpense> pageDatas =   receptionExpenseService.queryList(queryFilter);
        
        return success(pageDatas);
    }
        
}

三、map.xml 中数据库与实体映射

<resultMap type="com.ccp.dev.dias.model.ReceptionExpense" id="receptionExpense">
        <result property="bicG0hangbs" column="/BIC/G0HANGBS" jdbcType="VARCHAR"/>
        <result property="bicG0ywrq" column="/BIC/G0YWRQ" jdbcType="VARCHAR"/>
        <result property="bicG0belong" column="/BIC/G0BELONG" jdbcType="VARCHAR"/>
        <result property="bicG0rfssdw" column="/BIC/G0RFSSDW" jdbcType="VARCHAR"/>
        <result property="bicG0sqrbm" column="/BIC/G0SQRBM" jdbcType="VARCHAR"/>
</resultMap>

四、后台结果完整的

五、浏览器访问缺失字段

求大佬解答

 

 

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

9条回答 默认 最新

相关推荐 更多相似问题