关注JEECG发展历程 关注最新动态和版本, 记录JEECG成长点滴 更新日志 - 技术支持 - 招聘英才

JEECG最新版本下载 JEECG智能开发平台 - 显著提高开发效率 常见问题 - 入门视频 - 参与开源团队

商务QQ: 69893005、418799587 商务热线(5*8小时): 010-64808099 官方邮箱: jeecgos@163.com

查看: 32287|回复: 11

[Minidao] 排序无效

[复制链接]
发表于 2018-5-21 16:43:14 | 显示全部楼层 |阅读模式
本帖最后由 Wayne 于 2018-5-21 16:53 编辑

版本:3.72
我用minidao在最后加以下语句
Screenshot from 2018-05-21 16-40-39.png
数据没问题,但没有排序效果!!!
Controller是这样写的
@RequestMapping(params = "minidaoDatagrid")
    public void minidaoDatagrid(NrdMaterielEntity nrdMateriel,Integer status,String applyPurchaseNo,HttpServletRequest request, HttpServletResponse response, DataGrid dataGrid) {
//        String authSql = JeecgDataAutorUtils.loadDataSearchConditonSQLString();
        //获取当前登录人信息
        TSUser currentUser = ResourceUtil.getSessionUser();
        String purchaseUser = null;
        if(!"admin".equals(currentUser.getUserName())){
            if(status!=null){
                if(status==1){
                    nrdMateriel.setUpdateBy(currentUser.getUserName());
                }
                if(status==5){
                    purchaseUser = currentUser.getUserName();
                }
                if(status==0){
                    nrdMateriel.setCreateBy(currentUser.getUserName());
                }
            }else{
                nrdMateriel.setCreateBy(currentUser.getUserName());
            }
        }
        MiniDaoPage<Map<String, Object>> list = nrdApplyPurchaseMinidaoDao.getAll(nrdMateriel,status,purchaseUser,applyPurchaseNo, dataGrid.getPage(), dataGrid.getRows());
        dataGrid.setTotal(list.getTotal());
        dataGrid.setResults(list.getResults());
        TagUtil.datagrid(response, dataGrid);
    }
应该如何写才能排序?

发表于 2018-5-22 10:08:13 | 显示全部楼层
不会啊,你确定下新写的sql文件编译到class目录下了没
 楼主| 发表于 2018-6-7 17:04:18 | 显示全部楼层
admin 发表于 2018-5-22 10:08
不会啊,你确定下新写的sql文件编译到class目录下了没

已确认过,已经编译到class,还是没有排序的效果!!
发表于 2018-6-7 17:12:39 | 显示全部楼层
把日志打出来看看
 楼主| 发表于 2018-6-7 17:15:00 | 显示全部楼层
admin 发表于 2018-6-7 17:12
把日志打出来看看

没报错信息。。。。
发表于 2018-6-7 22:36:11 | 显示全部楼层
把minidao输出sql的日志解开,看看执行的sql是什么
 楼主| 发表于 2018-6-8 08:35:12 | 显示全部楼层
admin 发表于 2018-6-7 22:36
把minidao输出sql的日志解开,看看执行的sql是什么

请问这个sql输出日志怎么解开,找了很久。。。
 楼主| 发表于 2018-6-8 09:57:17 | 显示全部楼层
admin 发表于 2018-6-7 22:36
把minidao输出sql的日志解开,看看执行的sql是什么

Hibernate:
    select
        count(*)
    from
        t_s_function
    where
        functiontype = 0
        and functionurl = 'nrdInvResultController.do?minidaoDatagrid'
Hibernate:
    select
        this_.ID as ID100_3_,
        this_.parentfunctionid as parentf15_100_3_,
        this_.iconid as iconid100_3_,
        this_.desk_iconid as desk17_100_3_,
        this_.create_by as create2_100_3_,
        this_.create_date as create3_100_3_,
        this_.create_name as create4_100_3_,
        this_.function_icon_style as function5_100_3_,
        this_.functioniframe as function6_100_3_,
        this_.functionlevel as function7_100_3_,
        this_.functionname as function8_100_3_,
        this_.functionorder as function9_100_3_,
        this_.functiontype as functio10_100_3_,
        this_.functionurl as functio11_100_3_,
        this_.update_by as update12_100_3_,
        this_.update_date as update13_100_3_,
        this_.update_name as update14_100_3_,
        tsfunction2_.ID as ID100_0_,
        tsfunction2_.parentfunctionid as parentf15_100_0_,
        tsfunction2_.iconid as iconid100_0_,
        tsfunction2_.desk_iconid as desk17_100_0_,
        tsfunction2_.create_by as create2_100_0_,
        tsfunction2_.create_date as create3_100_0_,
        tsfunction2_.create_name as create4_100_0_,
        tsfunction2_.function_icon_style as function5_100_0_,
        tsfunction2_.functioniframe as function6_100_0_,
        tsfunction2_.functionlevel as function7_100_0_,
        tsfunction2_.functionname as function8_100_0_,
        tsfunction2_.functionorder as function9_100_0_,
        tsfunction2_.functiontype as functio10_100_0_,
        tsfunction2_.functionurl as functio11_100_0_,
        tsfunction2_.update_by as update12_100_0_,
        tsfunction2_.update_date as update13_100_0_,
        tsfunction2_.update_name as update14_100_0_,
        tsicon3_.ID as ID101_1_,
        tsicon3_.extend as extend101_1_,
        tsicon3_.iconclas as iconclas101_1_,
        tsicon3_.content as content101_1_,
        tsicon3_.name as name101_1_,
        tsicon3_.path as path101_1_,
        tsicon3_.type as type101_1_,
        tsicon4_.ID as ID101_2_,
        tsicon4_.extend as extend101_2_,
        tsicon4_.iconclas as iconclas101_2_,
        tsicon4_.content as content101_2_,
        tsicon4_.name as name101_2_,
        tsicon4_.path as path101_2_,
        tsicon4_.type as type101_2_
    from
        t_s_function this_
    left outer join
        t_s_function tsfunction2_
            on this_.parentfunctionid=tsfunction2_.ID
    left outer join
        t_s_icon tsicon3_
            on tsfunction2_.iconid=tsicon3_.ID
    left outer join
        t_s_icon tsicon4_
            on tsfunction2_.desk_iconid=tsicon4_.ID
    where
        this_.functionurl=?
 楼主| 发表于 2018-6-8 10:27:28 | 显示全部楼层
admin 发表于 2018-6-7 22:36
把minidao输出sql的日志解开,看看执行的sql是什么

MiniDao-SQL:

select nir.id,nir.inv_stor_num as invStorNum,nir.ma_name_code as maNameCode, nm.materiel_name as materielName,nm.classify_id as classifyId, nm.model_no as modelNo,nm.scd,nm.version_id as versionId,nm.unit from nrd_inv_result as nir left join nrd_materiel as nm on nir.materiel_id=nm.id where nir.flag=1 ORDER BY nir.create_date DESC
 楼主| 发表于 2018-6-11 08:03:59 | 显示全部楼层
大佬们,这个怎么处理啊????
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表