Sp_Sales_SalesAnalysiseOfMonth.md 2.67 KB

Sp_Sales_SalesAnalysiseOfMonth (procedure)

  • Type: PROCEDURE
  • Deterministic: NO
  • SQL data access: CONTAINS SQL

Parameters

# Mode Name Type
1 IN sStatistics varchar(100)
2 IN tStartDate datetime
3 IN tEndDate datetime
4 IN iBillType int
5 IN iClassifyType int
6 IN iSum int
7 IN iGetContent int
8 IN sLogin varchar(100)
9 IN sBrId varchar(100)
10 IN sSuId varchar(100)
11 IN bFilter varchar(5000)
12 IN pageNum int
13 IN pageSize int
14 OUT totalCount int
15 IN countCloumn varchar(5000)
16 OUT countMapJson longtext
17 IN sFilterOrderBy varchar(5000)
18 IN sGroupby_select_sql varchar(5000)
19 IN sGroupby_group_sql varchar(5000)

Body

Body is not pre-cached. To inspect: mysql --defaults-file=~/.my.cnf -e 'SHOW CREATE PROCEDURESpSales_SalesAnalysiseOfMonth'._

Narrative

Business context: Generic monthly sales-pivot template for the 销售分析 family — builds a 12-bucket (or N-month) horizontal cross-tab of money by month, parameterised by source bill (iBillType 0=Viw_MftWorkOrder / 1=SalSalesOrderMaster / 2=SalDeliverGoodsMaster / 3=SalSalesInvoiceMaster), classification axis (iClassifyType 0=sCustomerId / 1=sCustomerPropertyId / 2=sParentId (上级客户) / 3=sSaleManId) and detail vs sum mode (iSum). Twin/superseded by Sp_Sales_SalesAnalysiseOfMonthOfCustomer* family which is form-bound.

What it does: Walks tStartDatetEndDate month-by-month, splicing one correlated-subquery column per month (Select Sum(dTotalMoney) From <bill> Where date_format(tCreateDate,'%Y-%m-%d') between :StartDate and :EndDate AND :sKeyFieldName = ...) As YYYYMM onto the outer SELECT. The outer SELECT does the grouped roll-up of dProductMoney/dTotalMoney from the chosen source. Template placeholders (:sTableName/:sFieldName/:sJoin/:sGroupBy/:sStatistics/:sCheck) are filled by the iBillType/iClassifyType switches, then handed to Sp_Outstanding_Query for paging.

Invocation: Status: appears orphaned. No gdsconfigformmaster.sSqlStr / sConfigSqlStr / sSqlCondition binding for this exact name, no gdsmodule hook, no other-routine caller. Only references are install scripts (script/标版/30100101/). Likely either pre-dispatch helper called dynamically from BACK's JS, or a legacy form fixture replaced by per-axis procs (Sp_DaysaleCustomer, Sp_DaysaleSalesMan, Sp_DaysaleProduct, …). Candidate for maintainer audit.