Commit 26a57bcf authored by tangwei's avatar tangwei

修改 bug

parent d71b080b
......@@ -60,7 +60,7 @@ GROUP BY
<select id="getFireTeamTypeTree" resultType="com.yeejoin.amos.boot.biz.common.entity.DataDictionary">
SELECT
cdd.*,getParentListCode(cdd.sequence_nbr) treeCode, case when fire.count is null then 0 else fire.count end as count
cdd.*,getChildLstCode(cdd.sequence_nbr) treeCode, case when fire.count is null then 0 else fire.count end as count
FROM
cb_data_dictionary cdd
LEFT JOIN (
......@@ -81,7 +81,7 @@ GROUP BY
<select id ="getFirefightersJobTitle" resultType="com.yeejoin.amos.boot.biz.common.entity.DataDictionary">
SELECT
*,getParentListCode(sequence_nbr) treeCode
cbb.*,getChildLstCode(cbb.sequence_nbr) treeCode
FROM
cb_data_dictionary cbb
......
......@@ -2793,5 +2793,29 @@
END#
</sql>
</changeSet>
<changeSet author="tw" id="20220217-2" runAlways="true">
<comment>`getChildLstCode`</comment>
<sql endDelimiter="#">
DROP FUNCTION IF EXISTS `getChildLstCode`#
CREATE DEFINER=`root`@`%` FUNCTION `getChildLstCode`(rootId varchar(100)) RETURNS varchar(2000) CHARSET latin1
BEGIN
DECLARE i varchar(2000) default '';
DECLARE j varchar(1000) default rootId;
WHILE rootId is not null do
SET i =(SELECT group_concat(sequence_nbr) FROM cb_data_dictionary WHERE parent in ( rootId) );
IF i is not null THEN
SET j = concat(i, ',', j);
SET rootId = i;
ELSE
SET rootId = i;
END IF;
END WHILE;
return j;
END#
</sql>
</changeSet>
</databaseChangeLog>
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