zoukankan      html  css  js  c++  java
  • SQL语句(jiancai)

     
    /*
             * 保证金退款查询:包括招标方和投标方。通过status状态来区分,具体如下
             * 招标使用表中的status(2、4、10、11) ,投标使用自定义的status(-1、-3、-5)
             */
            String sql = "select t.id,t.projectId ,t.manageCompanyId ,t.tenderCautionMoney, t.tenderName,t.status "
                    + "from tender_document t  where (t.isRemove =1 or t.isRemove is null) and (t.isReturn is null or t.isReturn = 0) and t.tenderCautionMoney > 0 and t.`status` in (2,4,11) "
                    + " union all select t.id,t.projectId ,t.manageCompanyId ,t.tenderCautionMoney ,t.tenderName,t.status  from "
                    + "tender_document t  where (t.isRemove =1 or t.isRemove is null) and (t.isReturn is null or t.isReturn = 0) "
                    + "and t.tenderCautionMoney > 0 and t.`status` = 10  and NOT EXISTS (select d.id from tender_bid_document d where d.tenderId = t.id and d.signState !=1) "
                    + "union all select t.id,d.id as projectId ,d.companyId manageCompanyId ,t.bidCautionMoney tenderCautionMoney,t.tenderName,-1 as status "
                    + "from tender_document t ,tender_bid_document d where t.id = d.tenderId and (t.isRemove =1 or t.isRemove is null) and (d.isReturn is null or d.isReturn = 0) "
                    + "and t.bidCautionMoney > 0 and  t.status = 11 and (select count(*) from tender_bid_document d where d.tenderId = t.id and d.status = 2) = 0 "
                    + "union all select t.id,d.id as projectId ,d.companyId manageCompanyId ,t.bidCautionMoney tenderCautionMoney,t.tenderName, "
                    + " -3 as status  from tender_document t,tender_bid_document d  where t.id = d.tenderId and (t.isRemove =1 or t.isRemove is null)"
                    + " and (d.isReturn is null or d.isReturn = 0) and t.bidCautionMoney > 0  and   t.endDate < NOW() and d.`status` =1 and "
                    + "(select count(*) from tender_bid_document d where d.tenderId = t.id and d.status = 2) = 0 union all "
                    + "select t.id,d.id as projectId ,d.companyId manageCompanyId ,t.bidCautionMoney tenderCautionMoney,t.tenderName, "
                    + "-5 as status   from tender_document t,tender_bid_document d where  t.id = d.tenderId and (t.isRemove =1 or t.isRemove is null) "
                    + "and (d.isReturn is null or d.isReturn = 0) and t.bidCautionMoney > 0 and  d.signState = 1 and "
                    + "(select count(*) from tender_bid_document d where d.tenderId = t.id and d.status = 2) = 0 ";
    
            return find(sql);
        }
  • 相关阅读:
    div中嵌套div中使用margin-top失效问题
    thinkphp点击导航变色
    thinkphp I() 方法
    判断是手机端还是电脑端 isMobile()
    手机端H5 header定义样式
    AR.Drone 2.0四轴飞机体验:最好的玩具航拍器
    这是一个专注于电脑技术、软件应用、互联网、嵌入式,电子技术行业等的原创IT博客
    ul li列子
    [HTML]去除li前面的小黑点,和ul、LI部分属性
    Bad update sites
  • 原文地址:https://www.cnblogs.com/wuaili/p/8565766.html
Copyright © 2011-2022 走看看