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