前端传来的排序依据 与 数据库中的字段名不同
前台 排序传来的 依据 sort: menuId在数据库中字段名为“menu_id”
报错:Unknown column 'menuId' in 'order clause'
<id column="menu_id" jdbcType="BIGINT" property="menuId" />
这个用什么方法解决
columns: [
{
field: 'menuId',
title: '序号',
程序代码:<choose>
<when test="sort != null and sort != ''">
<choose>
<when test="sort == 'menuId'">
order by menu_id ${order}
</when>
<when test="sort == 'orderNum'">
order by order_num ${order}
</when>
<otherwise>
order by ${sort} ${order}
</otherwise>
</choose>
</when>
</choose>[此贴子已经被作者于2019-1-8 19:38编辑过]