修改分页序号
This commit is contained in:
@ -6,7 +6,7 @@ import java.util.Date;
|
|||||||
* @author yangdawei 2020-09-28 10:29:12
|
* @author yangdawei 2020-09-28 10:29:12
|
||||||
*/
|
*/
|
||||||
public class RobotMonitorManagement {
|
public class RobotMonitorManagement {
|
||||||
|
|
||||||
private int id;
|
private int id;
|
||||||
/**
|
/**
|
||||||
* 所属项目
|
* 所属项目
|
||||||
@ -101,6 +101,7 @@ public class RobotMonitorManagement {
|
|||||||
*/
|
*/
|
||||||
private Date lastExecutorTime;
|
private Date lastExecutorTime;
|
||||||
|
|
||||||
|
private String rankno;
|
||||||
|
|
||||||
public int getId() {
|
public int getId() {
|
||||||
return id;
|
return id;
|
||||||
@ -267,4 +268,12 @@ public class RobotMonitorManagement {
|
|||||||
public void setLastExecutorTime(Date lastExecutorTime) {
|
public void setLastExecutorTime(Date lastExecutorTime) {
|
||||||
this.lastExecutorTime = lastExecutorTime;
|
this.lastExecutorTime = lastExecutorTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getRankno() {
|
||||||
|
return rankno;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRankno(String rankno) {
|
||||||
|
this.rankno = rankno;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
<result column="offline_time" property="offlineTime" />
|
<result column="offline_time" property="offlineTime" />
|
||||||
<result column="robot_id" property="robotId" />
|
<result column="robot_id" property="robotId" />
|
||||||
<result column="last_executor_time" property="lastExecutorTime" />
|
<result column="last_executor_time" property="lastExecutorTime" />
|
||||||
|
<result column="rankno" property="rankno" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="Base_Column_List">
|
<sql id="Base_Column_List">
|
||||||
@ -57,12 +58,14 @@
|
|||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="pageList" parameterType="java.util.HashMap" resultMap="RobotMonitorManagement">
|
<select id="pageList" parameterType="java.util.HashMap" resultMap="RobotMonitorManagement">
|
||||||
SELECT <include refid="Base_Column_List" />
|
SELECT a.*,@rank:=@rank + 1 AS rankno FROM
|
||||||
FROM robot_monitor_management AS t
|
(
|
||||||
WHERE 1=1
|
SELECT <include refid="Base_Column_List" />
|
||||||
<if test="forbidden != null">
|
FROM robot_monitor_management AS t
|
||||||
AND t.forbidden = #{forbidden}
|
WHERE 1=1
|
||||||
</if>
|
<if test="forbidden != null">
|
||||||
|
AND t.forbidden = #{forbidden}
|
||||||
|
</if>
|
||||||
<if test="status != null">
|
<if test="status != null">
|
||||||
AND t.status = #{status}
|
AND t.status = #{status}
|
||||||
</if>
|
</if>
|
||||||
@ -84,8 +87,12 @@
|
|||||||
<if test="project != null and project != ''">
|
<if test="project != null and project != ''">
|
||||||
AND t.project like CONCAT(CONCAT('%', #{project}), '%')
|
AND t.project like CONCAT(CONCAT('%', #{project}), '%')
|
||||||
</if>
|
</if>
|
||||||
ORDER BY id ASC
|
ORDER BY offline_time DESC,create_time DESC
|
||||||
LIMIT #{offset}, #{pagesize}
|
LIMIT #{offset}, #{pagesize}
|
||||||
|
) a, (SELECT @rank:= 0) b
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="pageListCount" parameterType="java.util.HashMap" resultType="int">
|
<select id="pageListCount" parameterType="java.util.HashMap" resultType="int">
|
||||||
|
@ -28,10 +28,17 @@ $(function() {
|
|||||||
//"scrollX": true, // scroll x,close self-adaption
|
//"scrollX": true, // scroll x,close self-adaption
|
||||||
"columns": [
|
"columns": [
|
||||||
{
|
{
|
||||||
"data": 'id',
|
"data": 'rankno',
|
||||||
// "bSortable": false,
|
// "bSortable": false,
|
||||||
"visible" : true,
|
"visible" : true,
|
||||||
"width":'3%'
|
"width":'3%',
|
||||||
|
"render": function ( data, type, row ) {
|
||||||
|
if (row.rankno.indexOf(".")>-1) {
|
||||||
|
return row.rankno.substring(0,row.rankno.indexOf("."));
|
||||||
|
} else {
|
||||||
|
return row.rankno;
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"data": 'project',
|
"data": 'project',
|
||||||
|
Reference in New Issue
Block a user