按照入参排序

select * from users where extern_uid in ('24311', '169942', '157193', '103420', '183078') order by instr(',24311,169942,157193,103420,183078,', concat(',', extern_uid, ','));

原始SQL,用instr;

public static String getOrderByInstr(String value, String field) {
    return String.format("INSTR(',%s,', CONCAT(',', %s, ','))", value, field);
}

在java中封装成一个方法。

Forbid body drag

HTML

JS

document.body.ondrag = function () { return false; }

see some **document.body**'s **drag*** attributes.

CSS

.unselectable {
   -moz-user-select: -moz-none;
   -khtml-user-select: none;
   -webkit-user-select: none;

   /*
     Introduced in IE 10.
     See http://ie.microsoft.com/testdrive/HTML5/msUserSelect/
   */
   -ms-user-select: none;
   user-select: none;
}