Commit 6d62a21a authored by tangwei's avatar tangwei

修改函数

parent 9606e2b4
......@@ -426,4 +426,28 @@
REPLACE INTO `wl_equipment`(`id`, `name`, `code`, `category_id`, `country`, `maintenance_cycle`, `check_cycle`, `remark`, `management_style`, `reviser_id`, `date_updated`, `creater_id`, `unit_id`, `made_in`, `manufacturer`, `img`, `video`, `mark_specification`, `supplier_id`, `pref_quota`, `create_date`, `company_name`, `department_orgcode`, `department_name`, `inspection_spec`, `maintenance_spec`, `area`, `is_iot`, `clean_type`) VALUES (1463080224227856386, '天然水源', '93060300GJY44', 1438772459552665602, NULL, NULL, NULL, NULL, NULL, NULL, '2022-03-14 13:50:55', NULL, 55, NULL, NULL, 'upload/jcs/studio_normalapp_3157169/C8A1D43C46892D78B76315B4C2B67BC.png', NULL, NULL, NULL, NULL, '2021-11-23 17:41:23', NULL, NULL, NULL, NULL, NULL, NULL, '0', '0');
</sql>
</changeSet>
<changeSet author="tw" id="20221121-01" runAlways="true">
<comment>`getBuildingParentIds`</comment>
<sql endDelimiter="#">
DROP FUNCTION IF EXISTS `getBuildingParentIds`#
CREATE DEFINER=`root`@`%` FUNCTION `getBuildingParentIds`(rootId bigint) RETURNS varchar(1000) CHARSET utf8mb4
DETERMINISTIC
BEGIN
DECLARE fid bigint default 0;
DECLARE str varchar(1000) default concat(rootId, '');
WHILE rootId != 0 do
SET fid =(SELECT parentid FROM get_building_tree WHERE instanceId = rootId);
IF fid != 0 THEN
SET str = concat(str, ',', fid);
SET rootId = fid;
ELSE
SET rootId = fid;
END IF;
END WHILE;
return str;
END#
</sql>
</changeSet>
</databaseChangeLog>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment