-- 拼接接口访问路径:
-- select * from java_code_script
-- select * from caogao_stu_teacher_to_create_table;
-- 拼接访问路径:
select
t2.model_name,
t2.table_comment2,
-- t2.xml_select_id,
concat(
t2.path_name,
t2.xml_select_id
) as access_path
from
(
select distinct
t1.model_name,
t1.table_comment2,
t1.xml_select_id,
case when t1.model_name like '%xxxx%' then '\/teacherxxxx\/'
when t1.model_name like '%xxxx%' then '\/studentxxxx\/'
when t1.model_name like '%xxxx%' then '\/schoolxxxx\/'
else '-- ' end as path_name
from java_code_script t1
) t2
查看生成的代码:
select
cast(replace(replace(left(t1.table_comment2, 2), ',',''),'-','') as DECIMAL)as xuhao,
t1.*
from java_code_script t1
-- where model_name = 'xxxx'
order by model_name, xuhao
;