Sql server中是select * from (select top 15 * from (select top (30) * from table order by id desc) order by available asc) order by id desc Oracle是(oracle中的row从1开始):select * from (select a.*,rownum from (select * from tablet order by id desc) a ) b where b.rownum between 16 and 30
<div data-ng-controller="QuestionCtrl" class="container" style="width: 1900px;">
<br>
<table class="table table-bordered table-hover ">
<thead>
<tr>
<th class="text-center"><input type="checkbox"
data-ng-model="allChecked" data-ng-change="checkAll(allChecked)" /></th>
<th class="text-center">序号</th>
<th class="text-center">题目</th>
<th class="text-center">A</th>
<th class="text-center">B</th>
<th class="text-center">C</th>
<th class="text-center">D</th>
<th class="text-center">答案</th>
<th class="text-center">答题数</th>
<th class="text-center">正确数</th>
<th class="text-center">正确率</th>
</tr>
</thead>
<tbody>
<tr data-ng-repeat="item in items">
<td class="text-center"><input type="checkbox"
data-ng-model="item.$checked" data-ng-changed="checkedChange(item.id,item.$checked)"/></td>
<td class="text-center"><span data-ng-bind="$index+1"></span></td>
<td class="text-center"
data-ng-bind="item.test"></td>
<td class="text-center" data-ng-bind="item.op1"></td>
<td class="text-center" data-ng-bind="item.op2"></td>
<td class="text-center" data-ng-bind="item.op3"></td>
<td class="text-center" data-ng-bind="item.op4"></td>
<td class="text-center" data-ng-bind="item.answer"></td>
<td class="text-center" data-ng-bind="item.total"></td>
<td class="text-center" data-ng-bind="item.totalCorrect"></td>
<td class="text-center">
<span data-ng-if="item.total!=0" data-ng-bind="item.totalCorrect / item.total * 100 | number:2 "></span>
<span data-ng-if="item.total==0" data-ng-bind="0"></span>
%</td>
</tr>
</tbody>
</table>
<div class="text-right">
<button class="btn btn-defualt" style="float: left" data-ng-click="deleteItems()">删除</button>
<span style="color:#ff0000;"><uib-pagination total-items="TotalItems" ng-model="currentPage" items-per-page = "numPerPage" max-size="maxSize" class="pagination" first-text="首页" previous-text="上一页" next-text="下一页" last-text="末页" boundary-links="true" ng-change="pageChanged()" force-ellipses="false"></uib-pagination></span>
</div>
</div>
var app = angular.module("APP",['ui.bootstrap', 'ngAnimate']);
app.controller('QuestionCtrl', function($scope, $uibModal, $http) {
<span style="color:#ff0000;">$scope.currentPage = 1;//当前页
$scope.numPerPage = 15;
$scope.maxSize = 5;
$http({
url : '/getExamsByPage',
method : 'post',
params : {
'currentPage' : $scope.currentPage - 1,
'numPerPage' : $scope.numPerPage
}
}).success(function(response) {
$scope.TotalItems = response.totalElements;
$scope.items = response.content;
});
$scope.pageChanged = function() {
$http({
url : '/getExamsByPage',
method : 'post',
params : {
'currentPage' : $scope.currentPage - 1,
'numPerPage' : $scope.numPerPage
}
}).success(function(response) {
$scope.TotalItems = response.totalElements;
$scope.items = response.content;
});
}</span>
$scope.checkAll = function(checked) {
angular.forEach($scope.items, function(item) {
item.$checked = checked;
});
};
$scope.deleteExam = function(id) {
$http({
url : '/deleteexam',
method : 'post',
params : {
'id' : id,
'currentPage' : $scope.currentPage - 1,
'numPerPage' : $scope.numPerPage
}
}).success(function(response) {
$scope.TotalItems = response.totalElements;
$scope.items = response.content;
});
}
$scope.deleteItems = function() {
var checkedlist = new Array();
angular.forEach($scope.items, function(item) {
if (item.$checked == true)
checkedlist.push(item.id);
});
$http({
url : "/deleteexams",
method : "post",
params : {
'ids' : checkedlist,
'currentPage' : $scope.currentPage - 1,
'numPerPage' : $scope.numPerPage
}
}).success(function(response) {
$scope.TotalItems = response.totalElements;
$scope.items = response.content;
});
};
});
{"content":[{"id":225,"test":"办公自动化是计算机的一项应用,按计算机应用分类,它属于____。","op1":"数据处理","op2":"科学计算","op3":"实时控制","op4":"辅助设计","answer":"A","total":2,"totalCorrect":1},{"id":224,"test":"软件由___和文档两部分组成。","op1":"数据","op2":"指令","op3":"程序","op4":"工具","answer":"C","total":2,"totalCorrect":1},{"id":223,"test":"为达到某一目的而编写的计算机指令序列称为____。","op1":"软件","op2":"字符串","op3":"程序","op4":"命令","answer":"C","total":2,"totalCorrect":1},{"id":222,"test":"办公自动化是计算机的一项应用,按计算机应用分类,它属于____。","op1":"数据处理","op2":"科学计算","op3":"实时控制","op4":"辅助设计","answer":"A","total":2,"totalCorrect":1},{"id":220,"test":"为达到某一目的而编写的计算机指令序列称为____。","op1":"软件","op2":"字符串","op3":"程序","op4":"命令","answer":"C","total":2,"totalCorrect":1},{"id":219,"test":"办公自动化是计算机的一项应用,按计算机应用分类,它属于____。","op1":"数据处理","op2":"科学计算","op3":"实时控制","op4":"辅助设计","answer":"A","total":2,"totalCorrect":1},{"id":218,"test":"软件由___和文档两部分组成。","op1":"数据","op2":"指令","op3":"程序","op4":"工具","answer":"C","total":2,"totalCorrect":1},{"id":217,"test":"为达到某一目的而编写的计算机指令序列称为____。","op1":"软件","op2":"字符串","op3":"程序","op4":"命令","answer":"C","total":2,"totalCorrect":1},{"id":216,"test":"办公自动化是计算机的一项应用,按计算机应用分类,它属于____。","op1":"数据处理","op2":"科学计算","op3":"实时控制","op4":"辅助设计","answer":"A","total":2,"totalCorrect":1},{"id":215,"test":"软件由___和文档两部分组成。","op1":"数据","op2":"指令","op3":"程序","op4":"工具","answer":"C","total":2,"totalCorrect":1}],"last":false,"totalPages":9,"totalElements":86,"number":0,"size":10,"sort":[{"direction":"DESC","property":"id","ignoreCase":false,"nullHandling":"NATIVE","ascending":false}],"numberOfElements":10,"first":true}
@RequestMapping(value = "/getExamsByPage")
@ResponseBody
public Page<Exam> getExamsByPage(@RequestParam(value = "currentPage",defaultValue = "0") Integer page,
@RequestParam(value = "numPerPage",defaultValue = "10") Integer pageSize) {
Sort sort = new Sort(Direction.DESC, "id");//设置排序方式
Pageable pageable = new PageRequest(page, pageSize, sort);//构建Pageable对象,改分页查询是通过jpa的PagingAndSortingRepository接口完成的
Page<Exam> Exams = examrepository.findAll(pageable);
return Exams;
}
@Transactional
public interface ExamRepository extends JpaRepository<Exam, Integer> {
}
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有