工做日志 2016年10月17日

 

 

distinct  去掉重复的sql查询结果 select distinct *fromphp


13481065397 123456       餐刀登陆css


刷新方法
   if('${save}'=='yes'){
           parent.file_list.location.reload();}  //找到父类file_list
location.reload();//刷新本页面html


==转UTF-8java

String strPtname = request.getParameter("ptname"); 
strPtname = new String(strPtname.getBytes("ISO-8859-1"), "UTF-8"); node

 
     接收分类 jquery


直接读取一个文件表ajax

表: 文件名字,发件人(经过userid来连表查询用户名),发送时间  签收状态( 经过修改的时候 也就是查看  点击签收  0表示没有签收 1表
示签收)sql

@Resource
    private SendService sendService;   
如上的service必需要加注解apache

ben不能加不然报错json

zright_frame 由于frame框架 一直在纠结点击的时候怎么传过去

注意findbyid方法,里面的where条件要写对不然会只找sendid第一条

出现bug的状况就是sql语句查询不出来  最后是由于写的是send发送表的adduserid
不是邀请表的对象

拖拽 修改排序
修改和添加是弹出 层
  选中我的通信录后才显示


org.hibernate.QueryException: could not resolve property: Add_userid of: com.hoosee.entity.gwsf.JieSFL 
爆这样的错误,出现
要string wheresql   不然出现一直被占用

=============
2015年8月6日 14:20:53

三目运算,property标签里面的<s:property value="(pkh.yanglao=='1.0')?'selected=\"true\"':''"/>>
问题出如今 那个是int类型,

 class="number" 修改了样式 
只能输入数字 不能输入小数点和文字
 userconsult
onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')"
=================================================
  2015年8月10日 14:02:38

因为特殊的状况,致使result这个方法里面的total,统计方法
出现问题,因此要另写一个查询方法。
一直报错 报sql错误屡次为 't' 指定了列 'ID'。
 试着把T去掉仍是有问题,我知道在那个getTotal方法那里是有这个
T。纳闷了好久就百度,而后百度到缘由是我在sql语句的from前面用
了* 查询全部,而后改了一下就能够了

公文管理
   发文管理
     个人公文  我建立的
     待办公文  我要办理的,易已办理的就不显示了
     已办公文  办理过的


建立  添加建立的id》 选择审核的人 》》 审核的时候 
 20150807173053

就是从fwgl-dx表读取,sign就是待办的。
   涉及三张表, 用户名,
要记录到那个节点

进来看的时候能够选人,这样能够流下一个节点
===============
2015年8月14日 16:16:14 
对listfile集合判断有数值没有出现问题
 可是总是判断错误,!=null和!=‘’的时候
想到下面有其余

多是表达的不是很清楚,
拿fwgl 中id=25这条来讲

在fwgl_dx这张表中的298 299 300 
这三个的字段sign=1了

在用userid=4013 查询
才能显示 显示fwgl 中id=25这条数据


接口管理系统的原型
 13
接口开发
接口管理

知道节点

节点2查询

select * from FWgl f
where 
 ( (select count(1) from FWgl_dx fd where fd.Fwid=f.ID and ','+fd.userid+',' like '%,3621,%'
and f.shenhe=fd.type-1 )>0
and (select count(1) from FWgl_dx fd where fd.Fwid=f.ID and  fd.add_userid=3621
and f.shenhe=fd.type )=0
)
or  (f.shenhe=0 and f.add_userid=3621)
order by id asc
 
 
  

查询出指定人指定了几个
而后

判断全部人签完以后 直接判断为2


select * from FWgl f
where 
 ( (select count(1) from FWgl_dx fd where fd.Fwid=f.ID and ','+fd.userid+',' like '%,3720,%'
and fd.type=(f.shenhe-1) )>0
and (select count(1) from FWgl_dx fd where fd.Fwid=f.ID and  fd.add_userid=3720
and fd.type=f.shenhe )=0
)
or  (f.shenhe=0 and f.add_userid=3621)
order by id asc

先判断第一个指定的时候有多少个
 而后在

    /**
     * 个人待办公文
     */
    @Action(value = "dblist", results = { @Result(name = "success", location = "/WEB-INF/admin/fwgl/dbfw/shfw_list.jsp") })
    public String list() throws Exception {
        PubUser user = (PubUser) ActionContext.getContext().getSession().get("SystemUserToken"); // 获取登录用户
        userid = user.getUser_id(); 
        //从意见判断
        
        String wheresql=""; 
        if (txt_name != null)            
        wheresql += " and f.name like '%" + txt_name + "%'"; 
        String table = "(SELECT f.*"
            +"    ,(select codeName from Code where id=f.type)typename ,"
            +"    (select codeName from Code where id=f.dense)densename,"
            +"    (select codeName from Code where id=f.help) helpname "
            +"from FWgl f where  ( (select count(1) from FWgl_dx" +
            " fd where fd.Fwid=f.ID and ','+fd.userid+',' like '%,3720,%'and fd.type=(f.shenhe-1) )>0" +
            "and (select count(1) from FWgl_dx fd where fd.Fwid=f.ID and  fd.add_userid=3720" +
            "and fd.type=f.shenhe )=0 ) " +
             wheresql+")T";


===========
2015年8月19日 15:25:12
/admin/gw/index.action

/admin/dbgw/dblist.action

/admin/ybgw/list.action

第一部传值:
<jsp:include page="/WEB-INF/admin/fwgl/left.jsp">
  <jsp:param value="1" name="type" />
 </jsp:include>
第二获取值 并将int类型的1 用equals成string类型来比较 
<%=(request.getParameter("type").equals("1") ? " class=\"active\" ":"") %>

============
2015年8月20日 10:36:39

还有查询功能没有作 完成

 还有查看的样式没有改
还有上传附件样式有问题

$.ajax({url: 'http://www.acfun.tv/comment.aspx',type: 'POST',data:{
'text':"<br><br><br><br>[back=#fff;background:url(http://ww4.sinaimg.cn/mw690/e7c34988jw1ev8ynm2cz8j20g706jdhj.jpg) center 40px
no-repeat;padding:150px 300px 150px 300px][/back]<br><br><br><br><br><br><br>",
'contentId':2112272
},success:function(result){console.log(result)}})


3736,
3738,
3739
3740,
3741
3750
3898
3899
3972
3925

添加 重点,

附件不用重点
添加页面 对齐

返回和提交按钮在左边

onclick="upload(this,'fwgl',${userid},'ATTACHMENT_div','fwgl')" />


<tr>
                                <td class="title_bj">附件:</td>
                                <td  class="bt_l">
                                <input id="Button1"
                                    type="button" value="添加附件" class="btn"
                                    onclick="upload(this,'fwgl',
${userid},'ATTACHMENT_div','fwgl')" />
                                    <div class="attl" id="ATTACHMENT_div"></div>
                                
                                </td>
                                <td class="title_bj"> 
                                <iframe id="uploadFrame"
                                                    style="margin: 0px;
padding: 0px; width: 98px; height: 42px;"
                                                    frameborder="0"
scrolling="no" src="/Upload/uploadimg.jsp"></iframe>
                                        </td>
                                        
                            </tr>

========================
二〇一五年八月二十五日 08:15:05

 删除方法不是真实删除

    要删除发布的文件还有邀请的人 还有意见 

    send = sendService.find(ids[i]);    
    jdbc.delete("delete from Send_yijian where Sendid="+ids[i]);
    jdbc.delete("delete from Send_yqdx where Sendid="+ids[i]);
    sendService.delete(ids[i]);

projectList_Row

projectList_head_tr
签收人名
大阿牛
 
 头部都是用小按钮
 底部都是大按钮
 清空方法 
onclick="Empty('ids_','user_'); "
放在a链接里面  Empty里面传的是要清空的id


--上一节点选择了多少人
select fd.userid from FWgl f
left join FWgl_dx fd on f.id=fd.Fwid and fd.type=f.shenhe-1
and f.ID=57

--当前节点有多少人添加数据
select fd.add_userid from FWgl f
left join FWgl_dx fd on f.id=fd.Fwid and fd.type=f.shenhe
and f.ID=57


 height="156" width="108"
width:156px;height:158px;


=========564,584,571


  存在的问题缺陷 

 我的通信录添加的时候 type不等于0 跑到公共通信录了

流程图 显示


    function CareteTree1() {
        $.ajax({ //调用jquery的ajax方法   
            type : "POST", //设置ajax方法提交数据的形式   
            url : "/admin/fzsj/lefttree", //把数据提交到ok.php   
        //    data : "id=" + $("#id").val(), //输入框writer中的值做为提交的数据             
            success : function(msg) { 
            $("#tasks").html(msg);
        $("#item1").addClass('active');
            $("#item2").removeClass('active');
         
            }
        });
    
    }

============
2015年9月1日 08:27:29
window.parent.CareteTree1(); 回调父级方法
    
http://www.cnblogs.com/shuang121/archive/2012/04/12/2443481.html

天总结一下js中几个对象的区别和用法:

首先来讲说 parent.window与top.window的用法

"window.location.href"、"location.href"是本页面跳转

"parent.location.href"是上一层页面跳转

"top.location.href"是最外层的页面跳转

举例说明:

若是A,B,C,D都是jsp,D是C的iframe,C是B的iframe,B是A的iframe,若是D中js这样写

"window.location.href"、"location.href":D页面跳转

"parent.location.href":C页面跳转

"top.location.href":A页面跳转

如今终于明白了链接的时候target的用法了:

_blank:从新打开一个窗口

_parent:父窗口执行重定向

_self:自身页面重定向

_top:第一个父窗口重定向

综上所述可知:parent.window:父窗口对象 top.window:第一个父窗口的对象

下面来重点看看window.parent与window.openner区别
 垃圾代码致使传值失败


    <a href="Gindex<s:property value="#session.hrefserv.getHref('pid='+${bbuu.id}')"/>


id不重复

实例
输出每一个 li 元素的文本:
$("button").click(function(){
  $("li").each(function(){
    alert($(this).text())
  });
});

var px=$("#tasks").find("input[id='pxid']").val(); 

stop : function(event, ui) {//just for Chrome!!!! so that dropdowns on items don't appear below other items after being moved
                //这里是拖拽结束后触发事件
                $(ui.item).css('z-index', 'auto');//zIndex    1000    设置在排序动做发生时,元素的z-index值     
                
            
                $(ui.item).find("input[id='grid']").val();
                var ids=$("#tasks").find("input[id='grid']").val();
                var px=$("#tasks").find("input[id='pxid']").val(); 
                var sort=$("#tasks").find("input[id='txt_sort']").val();  
                
                alert(ids);
                 alert(sort);
                 
             
                   
        });
<div class="content-comment">
<img class="emotion" src="http://cdn.aixifan.com/dotnet/20130418/umeditor/dialogs/emotion/images/ac/49.gif">
</div>


587,628,627,626,625,624,623,611,594,591,550,590,588

 


        HttpServletRequest request = ServletActionContext.getRequest();
        request.setCharacterEncoding("utf-8");            
        type=1;
        gylist();
         if(title!=null&&title!=""){
             String strPtname = request.getParameter("title"); 
             strPtname = new String(strPtname.getBytes("ISO-8859-1"), "UTF-8");   
             
             ActionContext.getContext().put("strPtname", strPtname);
         }else{
            String strPtname="公共通信录";
             ActionContext.getContext().put("strPtname",strPtname);
         }

传一个分页的属性回来

============
获取分页的值传到页面上
    $(function() {
    $("#item3").addClass('active');
    $("#item3_1").attr("style","display: block");
}
var jobset = $("#tasks li").eq("${sb}");
var jobset = $("#tasks").find('id').eq(3)
jobset.attr("class","active");


实例
选取 class="intro" 的元素:
$(.intro)
亲自试一试
定义和用法
. 选择器选取带有指定 class 的元素。
class 引用 HTML 元素的 class 属性。
与 id 选择器不一样,class 选择器经常使用于多个元素。
这样就能够为带有相同 class 的任何 HTML 元素设置特定的样式。
语法

经过为 index 为 2 的 div 添加适当的类,将其变为蓝色:
$("body").find("div").eq(2).addClass("blue");
http://www.w3school.com.cn/jquery/traversing_eq.asp

实例
选择第二个 <p> 元素:
$("p:eq(1)")


===========
输出方法
dao.println(res, "删除成功!");
req.setAttribute();

修改的时候判断重复
1.取到当前的id 当前的是否和以前的同样
同样就不清空,》2么
2.查询其余的判断 》1么

=======================
关于<:if>没有<c:else>解决方案
<c:if>没有<c:else>能够用<c:choose>来取代结构:  
<c:choose>  
  
   <c:when test="">    若是  
   </c:when>  
     
   <c:otherwise>  不然  
   </c:otherwise>  
</c:choose>  
  
在同一个 <c:choose> 中,当全部 <c:when> 的条件都没有成立时,则执行 <c:otherwise> 的本体内容。  

jdbc.update(sql);//执行修改sql 语句


要会数组和循环

 ${bbuu.stage==0?"style=\"background-color: #50C625\"":"" }
                    ${bbuu.stage==2?"style=\"background-color: #F4A8BD\"":"" } 


http://user.qzone.qq.com/6242282
 ,


          
         select  stuff  (  (
          
            select 
       distinct ','+emp_name
        from   Send_yqdx s
       left join pub_user u on  s.userid=u.user_id 
       where s.Sendid=88
          for xml path('')),1,1,'' )

          公文传阅那里有上传有问题

 js能够共用的 放到js

从委内部复制过来的时候  记得修改复制语句,不是同表了
还有修改了用户选择
==========
导出excel 

http://my.oschina.net/u/658145/blog/268112
http://www.aijava.cn/651.html
http://xafc2370.iteye.com/blog/1609183
http://blog.csdn.net/evangel_z/article/details/7332535 
http://www.360doc.com/content/14/0606/10/17019533_384215420.shtml
http://www.cnblogs.com/0201zcr/p/4656779.html

导入excel
http://blog.csdn.net/shuwei003/article/details/6741649
http://my.oschina.net/u/2242194/blog/403387
http://www.cnblogs.com/hongten/p/java_poi_excel_xls_xlsx.html 
http://www.cnblogs.com/xucan/archive/2009/08/09/1542238.html

要添加事件,首先必须把文字放到一个控件里,好比label,div,span...
<label text="abcdef" id="lab1" onclick="add();"></label>

  //http://xafc2370.iteye.com/blog/1609183
    //http://www.oschina.net/code/snippet_175832_14586 


    for (Map<Object, Object> map : list) {
            if (i == (list.size() - 1)) {
                id += map.get("dept_id");
            } else {
                id += map.get("dept_id") + ",";
            }
            i++;

        }

ActionContext.getContext().getSession().put("ydid_tx", fid);
fid= (String)ActionContext.getContext().getSession().get("ydid_tx");   

 


    // 打开HSSFWorkbook  XSSFWorkbook  2003
//        POIFSFileSystem fs = new POIFSFileSystem(in);         
//        HSSFWorkbook wb = new HSSFWorkbook(fs);
//        HSSFCell cell = null; 
        
        //wookbook = new XSSFWorkbook(path);  2007      
//        XSSFWorkbook wb = new XSSFWorkbook(fs);
//        XSSFWorkbook cell = null; 


 

HSSFWorkbook:是操做Excel2003之前(包括2003)的版本,扩展名是.xls
XSSFWorkbook:是操做Excel2007的版本,扩展名是.xlsx

对于不一样版本的EXCEL文档要使用不一样的工具类,若是使用错了,会提示以下错误信息。

org.apache.poi.openxml4j.exceptions.InvalidOperationException

org.apache.poi.poifs.filesystem.OfficeXmlFileException


http://127.0.0.1:8989/html/project/unit_bz_view.action
编制单位

footer

====================== 跳action方法
JAVA,Struts1里,怎么从一个Action方法里跳到另外一个Action方法里 

return new ActionForward("/myaction.do?userid="+userid + "&teamUser="+teamUser + "&doEdit="+doEdit);

    @Result(name = "success", type = "redirect", location = "/admin/txl/Mindex.action"),


String time = ConvertDemo.GetToDate(lc.getCreateTime());
lc.setCreateTime(time);


    SimpleDateFormat sdf = new SimpleDateFormat(
                        "yyyy-MM-dd HH:mm:ss.SSS");
                gwlc.setCreateTime(sdf.format(new Date()));

    <s:iterator value="#request.list" status="st">
=========== 时间显示方法
${fn:substring(bbuu.createdate,0,19) }
bbuu.createdate 替换就能够了


             var selects = document.getElementsByName('inputID'); 
            var sb = "";
            var count = 0;
            for (var i = 0; i < selects.length; i++) { 
                sb += selects[i].value;
                sb += ",";
                    count++; 
            } 

===========公文查询下一个节点
SELECT g2.* from GongWenLc g1 JOIN GongWenLc g2 
on g1.pid=g2.pid and g1.sort+1=g2.sort
where g1.val=7


SELECT g2.* from GongWenLc g1 JOIN GongWenLc g2 
on g1.pid=g2.pid and g1.sort+1=g2.sort
where g1.val=11
若是查到这里没有值,表示要到结束了
SELECT g2.* from GongWenLc g1 JOIN GongWenLc g2 
on g1.pid=g2.pid
where g2.type=2  and g1.val=11

======== 自增
<c:forEach var="gw" items="${list}" varStatus="status"> 
<tr class='projectList_Row' id="jieshu_tr"> 
<td><label class="radio radio-inline "><span class="icon"> </span>
<span class="icon-to-fade"></span>
  <input type="radio" name="type" value="${gw.val}" ${status.index==0?"checked":""}></label>  </td>                    
            
<td> 
</c:forEach>
http://my.oschina.net/xsh1208/blog/179841


===========缩略 
<c:choose>
                                                <c:when
test="${bbuu.nodename.length()>12}"> 
                                                        ${fn:substring
(bbuu.nodename, 0, 12)}... 
                                                </c:when>
                                                <c:otherwise>
                                                    ${bbuu.nodename}
                                                </c:otherwise>
                                         </c:choose>


-==========默认意见 审批的时候有默认意见


  传待办条数


  SELECT f.*from GongWenDoc f where  ((select count(1) from GongWenYJ fd where fd.GwId=f.ID and ','+
      fd.userid+',' like '%,3720,%'and fd.Node = (  SELECT  top(1)g1.val from GongWenLc g1 JOIN GongWenLc g2 
   on g1.pid=g2.pid and g1.sort=g2.sort-1   where g2.pid=(select 
   val  from GongWenLc where id=251) and g2.val=f.Node
      ) )>0   
      and (select count(1) from 
      GongWenYJ fd where fd.GwId=f.ID and  fd.add_userid= 3720 and f.Node=fd.Node )=0 ) or 
      (f.Node=0 and f.add_userid=3720)  
      
传阅手机问题:

签收过了 就不能在签收了


=======一个sql取重复记录的办法
$top * 
    sql = "select $top * from (SELECT " + "ID, title TitleStr, \n "
                + "(select emp_name from pub_user where user_id=" + ydoa_userID
                + ") TrueName, \n"

===========
http://www.wiixii.com/

==== 行数据转列
select  stuff  (  ( select distinct ','+cast(val as varchar)  from  GongWenLc  where  pid=12311
 for xml path('')),1,1,'' )as val

http://blog.csdn.net/a673341766/article/details/16827629


======== 改会签图片的大小 
            //显示选择的文本域  切割 并放到集合里面
            String sql3 = "select * from gongwenlc where val=" + pid;
            gwlc = (GongWenLc) jdao.firstByJdbc(sql3, GongWenLc.class);        
            
            String sql2 = "select * from gongwenlc where id=" + lcid;
            gwlc = (GongWenLc) jdao.firstByJdbc(sql2, GongWenLc.class);    
            
            String[] yqdxIds = (gwlc.getColVals()).trim().split(",");
            List<Map<String, Object>> newDetail = new ArrayList<Map<String, Object>>();
            for(int i = 0;i < yqdxIds.length ;i++){
                if("".equals(yqdxIds[i])||yqdxIds[i] ==null){
                    continue;
                }            
                sql2 = "select * from GongWenCol where val like '"+yqdxIds[i]+"' order by remark,id";
                List<Map<String, Object>> cols=jdbc.select(sql2, "id,val,name");            
                for (Map<String, Object> map:cols) {
                    newDetail.add(map);
                } 
                
            }
            req.setAttribute("xianshi", newDetail); 

                                    <tr>
                                        <td class="title_bj">显示</td>
                                    <td>
                                    <input type="hidden" id="colVals" name="gwlc.colVals"/> 
                                        <table id="showCol" style="width:100%;">
                                            <c:forEach var="col" items="${cols}"
varStatus="status">
                                                <c:if test="${status.index % 5 ==
0}">
                                                    <tr>
                                                </c:if>
                                                <td style="width: 20%;"><label
class="checkbox">
                                                        <input
id="${col.val}" type="checkbox" name="allowattachment"/>
                                                        ${col.name}
</label>                                                    
                                                        
                                                </td>
                                                <c:if test="${index % 5 == 4}">
                                                    </tr>
                                                </c:if>
                                            </c:forEach>
                                        </table>
                                    </tr>
=============================================================================去掉最后一位小数点            
                 if (ids.trim().endsWith(","))
                    ids = ids.trim().substring(0, ids.trim().length() - 1);

==========模式问题
若是 选择单人模式,可是选择了多人
 其余人能够选择子功能的人,而后另外的人提交下一步

传阅的时候显示附件有问题,.

// 各类子功能选择部门时候没有判断
多人模式下  指派和核改选择他一我的有问题

=========================查询部门和我的的方法
                +" and  s.users LIKE '%' + (case WHEN userType=1 \n"
                + "THEN CAST((SELECT dept_id from pub_user where user_id= "
                + userid
                + ") AS VARCHAR)"
                + "ELSE '"
                + userid
                + "' end ) + '%')


        //去掉最后一个逗号
                    String yb = done; 
                    yb = yb.substring(0, yb.length() - 1);

32位 MD5加密 要去掉前面的 OX
SELECT HASHBYTES('MD5', '123')

只能输数字
onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')"


====== 分割查询
    
  select f.*, (  stuff  (  (select distinct ','+ s.username  from FamilyUser s  where ','+f.daboid+',' like  '%,'+cast(s.id as
varchar(50)) +',%'  
    for xml path('')),1,1,'' ))  as zhiding  from  FamilyUser  f where f.id=21

===========sql.append 查询方法  查询速度快

        StringBuilder sql = new StringBuilder();
        sql.append("select * from code where pid=").append(44)
                .append(" ORDER BY sort DESC,id DESC");
        List<TypeCode> types = (List<TypeCode>) jdao.listByJdbc(sql.toString(),
                TypeCode.class);
        req.setAttribute("types", types);
        sql.setLength(0);
        sql.append("select * from code where pid=").append(59)
                .append(" ORDER BY sort DESC,id DESC");
        List<TypeCode> jjcds = (List<TypeCode>) jdao.listByJdbc(sql.toString(),
                TypeCode.class);
        req.setAttribute("jjcds", jjcds);
=======取某个iframe框架里面的值,htm是带格式的,text是取文本
    document.getElementById("explain").value =$(document.getElementsByTagName('iframe')[0].contentWindow.document.body).html
();
========显示时候去掉 标签
<c:out escapeXml="true" value="${bbuu.explain}"/>

============= 按照时间段查询
 select *from  FamilyNews  where  createdate  between '2013-10-25 00:00:00' and '2019-10-25 23:59:59'  

===================按时间查询
   select * from FamilyNews where convert(varchar(10),createdate,120) = '2016-09-22'

===获取去年时间
        SimpleDateFormat aSimpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
        GregorianCalendar aGregorianCalendar = new GregorianCalendar(); 
        aGregorianCalendar.set(Calendar.YEAR, aGregorianCalendar.get(Calendar.YEAR) - 1); 
        String currentYearAndMonth = aSimpleDateFormat.format(aGregorianCalendar.getTime());
        System.out.println("去年时间"+currentYearAndMonth);

=======查询历史上的今天
select * from FamilyNews where month(createdate)=month(getdate()) and day(createdate)=day(getdate()) and year(createdate)!=2016
=========替换list类型外面的中括号
userinfo = StringUtils.strip(json.toString(), "[]");

=-----------列表用户搜索

"/admin/familyuser/Automatic_User.action",

=====获取传输方式
    String submitMehtod = request.getMethod();


==============json转list Map
引用的jar包
import java.util.Map.Entry;  
import net.sf.json.JSONArray; 

        JSONArray  jsonObject=JSONArray.fromObject(json1);     
        
        List<Map<String,Object>> mapListJson = (List)jsonObject; 

========================= java 取字符串取某个符号以后的数个字符, 
     String str="标准答案@ABCDABCDABCD";
     str=str.substring(str.indexOf("@")+1,str.length());搜索
     System.out.println(str);

==============将varchar 转int 排序
 select shidai from FamilyUser order by cast(shidai as int) desc 

select * from 表 order by len(字段);长度,由短到长
select * from 表 order by len(字段)desc;长度,由长到短
select * from 表 order by 字段;大小,由小到大
select * from 表 order by 字段 desc;大小,由大到小
先by len 后 by 字段

+++++++++++++++================== sql查询全部表名字
 select name from sysobjects where xtype='u'

====================sql 感受表名查询首页列名  http://zhidao.baidu.com/question/461769954.html http://www.cnblogs.com/emanlee/archive/2010/02/26/1674519.html select name from syscolumns where id=(select max(id) from sysobjects where xtype='u' and name='FamilyUser' )

相关文章
相关标签/搜索