# `Sp_mes_TimeActivationMonth_Team` (procedure)

> @author:zhucx
                @date:20210621 封存
                @describe: 班组稼动率月度分析


- **Type:** PROCEDURE
- **Deterministic:** NO
- **SQL data access:** CONTAINS SQL

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | `psMonth` | `varchar(100)` |
| 2 | IN | `psTeamId` | `varchar(100)` |
| 3 | IN | `sBrId` | `varchar(100)` |
| 4 | IN | `sSuId` | `varchar(100)` |
| 5 | IN | `sLoginId` | `varchar(100)` |
| 6 | IN | `bFilter` | `varchar(5000)` |
| 7 | IN | `pageNum` | `int` |
| 8 | IN | `pageSize` | `int` |
| 9 | OUT | `totalCount` | `int` |
| 10 | IN | `countCloumn` | `varchar(5000)` |
| 11 | OUT | `countMapJson` | `longtext` |
| 12 | IN | `sFilterOrderBy` | `varchar(5000)` |
| 13 | IN | `sGroupby_select_sql` | `varchar(5000)` |
| 14 | IN | `sGroupby_group_sql` | `varchar(5000)` |

## Body

_Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW CREATE PROCEDURE `Sp_mes_TimeActivationMonth_Team`'`._

## Narrative

**Business context:** 生产管理 → 生产执行 → 数据采集与设备控制 — month-window twin of `Sp_mes_TimeActivation_Team`: 班组稼动率月度分析. Same调试/生产中/异常/保养 breakdown but rolled up over the full `psMonth` for the supplied (or all) 班组.

**What it does:** Derives the month's start/end datetime from `psMonth`, populates `p_bd_Tm`/`p_machinedata` from `plc_machinedata` and `mftproductionreport*`, aggregates by `sTeamId` with the same JSON_ARRAY `sTimeStatus` and `dErroHourRate`/`dValidTimeRate`/`dAdjustHourRate`/`dmaintainHourRate`/`dOee` columns. Pagination handled inline.

**Invocation:** Status: appears orphaned. No `gdsmodule`/`gdsconfigformmaster` reference, no caller proc, no xly-src hit. Likely deprecated alongside its 设备 counterpart when the 月度 dashboard was rewritten. Candidate for maintainer audit. Body marked 封存.
