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);
        }
  • 相关阅读:
    堆和栈 的区别
    equals == 区别
    【知识点】Filter、Servlet、Listener区别与联系
    白盒测试相关的一些知识
    紧急情况下压缩了测试周期应该怎么办?
    软件性能测试与可靠性测试
    软件测试概念
    web测试方法总结
    结对测试探讨
    八种状态增加测试用例状态的精确度
  • 原文地址:https://www.cnblogs.com/wuaili/p/8565766.html
Copyright © 2011-2022 走看看