zoukankan      html  css  js  c++  java
  • 时间差值

    alter procedure Asset_spQueryAlertInfomation
    (
     @pi_Action VARCHAR(100),
     @pi_InfoId BIGINT,
     @pi_pageIndex INT,
     @pi_pageSize INT,
     @po_recordCount BIGINT OUTPUT
    )
    as
     DECLARE @pt_StartRowIndex INT
     DECLARE @pt_EndRowIndex INT
     
     SET @pt_StartRowIndex = (@pi_pageIndex - 1) * @pi_pageSize + 1
     SET @pt_EndRowIndex = @pi_pageIndex * @pi_PageSize

    IF @pi_Action = 'getlist'
     BEGIN
    SELECT * FROM
      (
    SELECT   Asset_ReceiptDetail.InfoId,  Asset_Subject.SubjectCode, Asset_Subject.SubjectName, Asset_Contract_ChargePlan.CostStartDate, Asset_Contract_ChargePlan.CostEndDate,
             Asset_Contract_ChargePlan.ShouldGetDate, Asset_Contract_ChargePlan.SumMoney, Asset_ReceiptMain.ContractCode,
             Asset_Contract_ChargePlan.ChargePlanCode, Asset_ReceiptDetail.IsReceipt,
    ROW_NUMBER() OVER (ORDER BY Asset_Contract_ChargePlan.InfoId DESC) AS RowIndex,
    'IsReceipts' = (
       CASE
       WHEN IsReceipt = 0 THEN '否'
                            when IsReceipt is null then '否'
       ELSE
        '是'
       End)
    FROM     Asset_ChargedItems INNER JOIN
             Asset_Contract_ChargePlan ON Asset_ChargedItems.ChargedItemCode = Asset_Contract_ChargePlan.ChargedItemCode INNER JOIN
             Asset_Subject ON Asset_ChargedItems.SubjectCode = Asset_Subject.SubjectCode INNER JOIN
             Asset_ReceiptMain ON Asset_Contract_ChargePlan.ContractCode = Asset_ReceiptMain.ContractCode LEFT JOIN
             Asset_ReceiptDetail ON Asset_Contract_ChargePlan.ChargePlanCode = Asset_ReceiptDetail.ChagePlanCode
    WHERE datediff(day,getdate(),Asset_Contract_ChargePlan.ShouldGetDate)<=30 and  datediff(day,getdate(),Asset_Contract_ChargePlan.ShouldGetDate)>=0

    --应收日期与当前日期差值小于30天的记录同时是正值

    )tba
      WHERE RowIndex BETWEEN @pt_StartRowIndex AND @pt_EndRowIndex

    SELECT @po_recordCount = COUNT(*)
    FROM     Asset_ChargedItems INNER JOIN
             Asset_Contract_ChargePlan ON Asset_ChargedItems.ChargedItemCode = Asset_Contract_ChargePlan.ChargedItemCode INNER JOIN
             Asset_Subject ON Asset_ChargedItems.SubjectCode = Asset_Subject.SubjectCode INNER JOIN
             Asset_ReceiptMain ON Asset_Contract_ChargePlan.ContractCode = Asset_ReceiptMain.ContractCode LEFT JOIN
             Asset_ReceiptDetail ON Asset_Contract_ChargePlan.ChargePlanCode = Asset_ReceiptDetail.ChagePlanCode
    WHERE datediff(day,getdate(),Asset_Contract_ChargePlan.ShouldGetDate)<=30 and  datediff(day,getdate(),Asset_Contract_ChargePlan.ShouldGetDate)>=0

    end

  • 相关阅读:
    tensorflow RNN和简单例子
    推荐系统理论及实战(转)附个人的理解和实战
    mysql 中 case when then .... else end 的简单使用
    动态规划最常见的习题 (最长公共子串、最长公共子序列、最短编辑距离)
    神经网络中 梯度消失、梯度爆炸的问题分析
    深度学习基础(转)
    用户兴趣的模型 浅析
    20190317 A
    pkuwc2019游记
    练习题16
  • 原文地址:https://www.cnblogs.com/howie/p/2471396.html
Copyright © 2011-2022 走看看