1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
| BEGIN
INSERT INTO `domo_cal_1m` (
`domo_date`,
`domo_cal_1m_wh`,
`domo_cal_1m_t_ext`,
`domo_cal_1m_t_rdc`,
`domo_cal_1m_t_etg`,
`domo_cal_1m_t_p`
)
VALUES (
NEW.`domo_rel_date`,
getDelta_wh_1m(NEW.`domo_rel_date`, NEW.`domo_rel_wh`),
NEW.`domo_rel_t_ext`,
NEW.`domo_rel_t_rdc`,
NEW.`domo_rel_t_etg`,
null
);
IF (SELECT (MINUTE(NEW.`domo_rel_date`) IN (0, 15, 30, 45)) > 0) THEN
INSERT INTO `domo_cal_15m` (
`domo_date`,
`domo_cal_15m_wh`,
`domo_cal_15m_t_ext`,
`domo_cal_15m_t_rdc`,
`domo_cal_15m_t_etg`,
`domo_cal_15m_t_p`
) VALUES (
NEW.`domo_rel_date`,
getDelta_wh_15m(NEW.`domo_rel_date`, NEW.`domo_rel_wh`),
getMoy_T_ext(NEW.`domo_rel_date`, MAKETIME( 00,14,59 )),
null,
null,
null
);
END IF;
IF (SELECT (HOUR(NEW.`domo_rel_date`) IN (0) AND MINUTE(NEW.`domo_rel_date`) IN (0)) > 0) THEN
INSERT INTO `domo_cal_1j` (
`domo_date`,
`domo_cal_1j_wh`,
`domo_cal_1j_t_ext`,
`domo_cal_1j_t_rdc`,
`domo_cal_1j_t_etg`,
`domo_cal_1j_t_p`
) VALUES (
NEW.`domo_rel_date`,
getDelta_wh_1j(NEW.`domo_rel_date`, NEW.`domo_rel_wh`),
getMoy_T_ext(NEW.`domo_rel_date`, MAKETIME( 23,59,59 )),
null,
null,
null
);
END IF;
END |