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);
        }
  • 相关阅读:
    python 产生token及token验证
    Django中间件
    docker学习笔记16:Dockerfile 指令 ADD 和 COPY介绍
    Docker 容器镜像删除
    linux查找nginx所在目录
    nginx启动访问
    nginx安装【linux下安装】
    QPS计算
    Jmeter压测问题_Non HTTP response code: org.apache.http.conn.ConnectTimeoutException
    Jmeter压测问题_Non HTTP response code: java.net.ConnectException
  • 原文地址:https://www.cnblogs.com/wuaili/p/8565766.html
Copyright © 2011-2022 走看看