| | |
| | | package com.vci.web.service; |
| | | |
| | | import com.vci.corba.common.PLException; |
| | | import com.vci.corba.omd.data.BusinessObject; |
| | | import com.vci.starter.web.pagemodel.BaseQueryObject; |
| | | import com.vci.starter.web.pagemodel.DataGrid; |
| | | import com.vci.starter.web.pagemodel.PageHelper; |
| | |
| | | } |
| | | } |
| | | String baseSql = "select oid,to_char(ts,'yyyy-mm-dd hh24:mi:ss') as ts,creator,to_char(createTime,'yyyy-mm-dd hh24:mi:ss') as createTime,modifier,to_char(modifyTime,'yyyy-mm-dd hh24:mi:ss') as modifyTime,name,label," + |
| | | ("plenum".equalsIgnoreCase(tableName)?" '' as " :"") + "description from " + tableName |
| | | ("plenumtype".equalsIgnoreCase(tableName)?" '' as " :"") + "description from " + tableName |
| | | + (StringUtils.isNotBlank(whereSql)?(" where " + whereSql):""); |
| | | baseSql += " order by lower(name) asc "; |
| | | String sql = (StringUtils.isNotBlank(pageSql)?" select oid,ts,creator,createTime,modifier,modifyTime,name,label,description from (select A.* , rownum RN from (":"") |
| | | + baseSql+ pageSql ; |
| | | WebBoServiceI boService = ApplicationContextProvider.getApplicationContext().getBean(WebBoServiceI.class); |
| | | List<com.vci.client.bof.ClientBusinessObject> dataMap = boService.queryBySql(sql, null); |
| | | List<BusinessObject> dataMap = boService.queryBySql(sql, null); |
| | | DataGrid<T> dataGrid = new DataGrid<>(); |
| | | if(!CollectionUtils.isEmpty(dataMap)){ |
| | | List<T> dataList = new ArrayList<>(); |
| | |
| | | dataList.add(obj); |
| | | }); |
| | | dataGrid.setData(dataList); |
| | | List<Map> maps = boService.queryBySqlForMap("select count(oid) as total from plbtmtype " + (StringUtils.isNotBlank(whereSql)?(" where " + whereSql):""), null); |
| | | List<Map> maps = boService.queryBySqlForMap("select count(*) as total from "+ tableName + (StringUtils.isNotBlank(whereSql)?(" where " + whereSql):""), null); |
| | | dataGrid.setTotal(VciBaseUtil.getInt(maps.get(0).get("total").toString())); |
| | | } |
| | | return dataGrid; |
| | |
| | | pageHelper = new PageHelper(-1); |
| | | } |
| | | //有需要转换的属性 |
| | | pageHelper.addDefaultAsc("name"); |
| | | if(StringUtils.isBlank(pageHelper.getSort()) && StringUtils.isBlank(pageHelper.getOrder())) {//如果没有设置排序字段,则默认一个 |
| | | pageHelper.addDefaultAsc("name"); |
| | | } |
| | | VciQueryWrapperForDO queryWrapperForDO = new VciQueryWrapperForDO(baseQueryObject.getConditionMap(), tClass,pageHelper); |
| | | queryWrapperForDO.setConditionMap(queryWrapperForDO.switchConditionMap()); |
| | | queryWrapperForDO.wrapperSql(); |
| | |
| | | } |
| | | return dataGrid; |
| | | } |
| | | |
| | | |
| | | } |