# `Sp_Task_Send_Elecustomer_Birthday` (procedure)

> 定时过程执行(发送客户生日)


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

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | OUT | `sCode` | `int` |
| 2 | OUT | `sReturn` | `longtext` |
| 3 | OUT | `sUserList` | `longtext` |
| 4 | OUT | `sUserData` | `longtext` |

## Body

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

## Narrative

**Business context:** 小ai保驾护航 — scheduled push of customer-contact birthday reminders. Member of the `Sp_Task_*` quartz-scheduled message family; mirror of `Sp_Task_Send_Eleemployee_Birthday` (employee side).

**What it does:** Defaults `sBrId/sSuId/sCode`, declares `p_tBirthday=NOW()` (advance-day shift commented out) and a static card-background `sPicPath`. Drops/creates temp table `Sp_Task_SendBirthday` with `(sUserId, sUserName, tBirthday, sPicPath, title)`, then `INSERT … SELECT` from `elecustomercontacts` where `DATE_FORMAT(tBirthday,'%Y-%m-%d')=DATE_FORMAT(NOW(),'%Y-%m-%d')`. Emits the temp table, builds `sUserList=["sId1","sId2",…]` (JSON-string of contact ids) for downstream dynamic recipients.

**Invocation:** Dispatched by the Quartz scheduler — `QuartzTask`/`TaskServiceImpl.doProOne()` runs the procedure named in the scheduler-job config; `sendMsgDoNew(...)` consumes the OUT `sUserList` to resolve recipients via `viw_msguser` (微信/邮件/登录ID) and renders via the configured `sMestemplateId`. No `gdsmodule`/form-master binding; not in xly-src 30100101 install scripts — DB-only.
