javaÊ÷Ðνṹ
×î½ü¿´µ½Ò»¸öÓÐÒâ˼µÄÊ÷Ðνṹ£¬ÎªÃ¿¸ö½ÚµãÌí¼ÓÁËlftºÍrgtÁ½¸öÊôÐÔ¡£ÕâÑù²éÕҸýڵãµÄ×ӽڵ㡢²éÕҸýڵãËùÓи¸½Úµã£¬¾Í²»ÓÃÈ¥µÝ¹é²éѯ£¬Ö»ÐèÒªÓÃbetween¡¢andÓï¾ä¾Í¿ÉÒÔʵÏÖ¡£ÏÂÃæÒÔ´´½¨Ò»¸öÀ¸Ä¿Ê÷ΪÀý£¬ÒÔÏÂÊÇÎÒµÄÀí½â¡£
¡¡¡¡Ò»°ãÀ´½²£¬ÎÒÃÇ´´½¨À¸Ä¿Ê÷µÄʱºò£¬´ó¶àÖ»ÐèÒªÒ»¸öÍâ¼üparentidÀ´Çø·Ö¸Ã½ÚµãÊôÓÚÄĸö¸¸½Úµã¡£Êý¾Ý¿âµÄÉè¼ÆÈçÏÂͼ£º
ÕâÑùÒ»À´£¬
1.²éÕҸýڵãµÄËùÓÐ×ӽڵ㣬ÔòÐèÒª²ÉÓÃsqlµÄµÝ¹éÓï¾ä£º
Sql´úÂë
select * from tableName connect by prior id=sj_parent_id start with id=1
select * from tableName connect by prior id=sj_parent_id start with id=1
(oracle д·¨£¬mysqlÄ¿Ç°²»Ö§³Ö£¬Èç¹ûmysqlÏë²éÕÒÊ÷ÐΣ¬¿ÉÒÔÀûÓô洢¹ý³Ì).
2.²éÕҸýڵãµÄ¸¸½ÚµãµÄsqlµÝ¹éÓï¾ä£º
Sql´úÂë
select * from tableName connect by prior sj_parent_id =id start with id=1
select * from tableName connect by prior sj_parent_id =id start with id=1
¡¡Èç¹ûÊý¾ÝÁ¿¹ý´ó»òÕß²ã´ÎÌ«¶à£¬ÄÇôÕâÑù²Ù×÷ÊÇ»áÓ°ÏìÐÔÄܵġ£
¡¡¡¡“ÈκÎÊ÷Ðνṹ¶¼¿ÉÒÔÓöþ²æÊ÷À´±íʾ”¡£ÆäʵÎÒÃÇ´´½¨µÄÀ¸Ä¿Ê÷¾ÍÊÇÒ»¸ö¼òÐ͵Ķþ²æÊ÷¡£¸ù¾ÝÊý¾Ý½á¹¹ÀïÃæ¶þ²æÊ÷µÄ±éÀú£¬ÔÙÉÔ΢ÐÞ¸ÄÏ£¬½«Êý¾Ý¿âÉè¼ÆÈçÏÂͼËùʾ£º
ÕâÑùÎÒÃDzéÕҸýڵãµÄËùÓÐ×ӽڵ㣬ÔòÖ»ÐèÒª²éÕÒidÔÚlftºÍrgtÖ®¼äµÄËùÓнڵ㼴¿É¡£
<!--EndFragment-->
Sql´úÂë
select * from tb_subject s,tb_subject t where s.lft between t.lft and t.rgt and t.id=1
select * from tb_subject s,tb_subject t where s.lft between t.lft and t.rgt and t.id=1
2.²éÕҸýڵãµÄËùÓи¸½ÚµãµÄsqlÓï¾äΪ£º
<!--EndFragment-->
Sql´úÂë
select s.* from tb_subject s,tb_subject t where s.lft<t.lft and (s.rgt-s.lft)>1 and s.rgt>t.rgt and t.id=1
select s.* from tb_subject s,tb_subject t where s.lft<t.lft and (s.rgt-s.lft)>1 and s.rgt>t.rgt and t.id=1
¡¡ÏÂÃæÀ
Ïà¹ØÎĵµ£º
ÔÚDWRÖÐÐèÒªÓõ½session,requestµÈÕâЩ¶«Î÷µÄʱºò£¬¿ÉÒÔÓÃÒÔÏ·½·¨»ñÈ¡:
1. ʹÓÃDWRµÄAPI (ºÜ¶àÈ˶¼²»ÍƼöÕâÖÖ×ö·¨,¾²âÊÔ,ʹÓÃÆðÀ´¿Ï¶¨Ã»ÎÊÌâ)
import uk.ltd.getahead.dwr.WebContext;
import uk.ltd.getahead.dwr.WebContextFactory;
WebContext ctx = WebContextFactory.get();
ctx.getSession()
ctx.getHttp ......
< type="text/javascript">
document.body.oncopy = function() {
if (window.clipboardData) {
setTimeout(function() {
......
DWRÊÇÒ»¸ö¿ò¼Ü£¬¼òµ¥µÄ˵¾ÍÊÇÄܹ»ÔÚjavascriptÖ±½Óµ÷ÓÃjava·½·¨£¬¶ø²»±Øȥдһ´ó¶ÑµÄjavascript´úÂë¡£ËüµÄʵÏÖÊÇ»ùÓÚajaxµÄ£¬¿ÉÒÔʵÏÖÎÞË¢ÐÂЧ¹û¡£
ÍøÉÏÓв»ÉÙDWRµÄÀý×Ó£¬µ«´ó¶¼Ö»ÊÇijÖÖ·½·¨µÄµ÷Ó㬱¾ÎÄÖ»ÔÚʹÓòãÃæÉϽéÉÜDWR£¬²¢²»Éæ¸ü¶àµÄ¼¼ÊõÓëÉè¼Æ£¬ÆäÄ¿µÄÊÇÈóõѧÕßÄܹ»ºÜ¿ìµÄѧ»á¸÷ÖÖjava·½·¨ÔÚjavascriptÖÐÊÇÈçºÎµ ......
×÷ΪJava³ÌÐòÔ±À´Ëµ£¬×îÍ´¿àµÄÊÂÇéĪ¹ýÓÚ¿ÉÒÔÑ¡ÔñµÄ·¶Î§Ì«¹ã£¬¿ÉÒÔ¶ÁµÄÊéÌ«¶à£¬ÍùÍùÈÝÒ×ÎÞËùÊÊ´Ó¡£ÎÒÏë¾ÍÎÒ×Ô¼º¶Á¹ýµÄ¼¼ÊõÊé¼®ÖÐÌôÑ¡³öÀ´Ò»Ð©£¬
°´ÕÕѧϰµÄÏȺó˳Ðò£¬ÍƼö¸ø´ó¼Ò£¬ÌرðÊÇÄÇЩÏë²»¶ÏÌá¸ß×Ô¼º¼¼ÊõˮƽµÄJava³ÌÐòÔ±ÃÇ¡£
Ò»¡¢Java±à³ÌÈëÃÅÀà
¶ÔÓÚûÓÐJava±à³Ì¾ÑéµÄJava³ÌÐòÔ±ÒªÈëÃÅ£¬Ëæ±ã¶ÁʲôÈëÃÅÊé¼®¶¼Ò» ......