SELECT
(
SELECT
group_concat(c.DEFINE_CODE)
FROM
epc_master_element c
WHERE
c.`CODE` = me.`CODE`
AND c.ALIAS = 'code'
) joinMd,
me.ID,
me.DEFINE_CODE,
me.CODE,
me.NAME,
me.TYPE,
me.LEN,
me.PREC,
me.MUST_FLAG,
me.DESCRIPTION,
me.ALIAS,
me.DEL_FLAG,
me.DEF1,
me.DEF2,
me.DEF3,
me.DEF4,
me.DEF5,
me.INS_P,
me.INS_T,
me.UPD_P,
me.UPD_T,
me.TENANT_ID,
me.DATA_START
FROM
epc_master_element me
WHERE
DEFINE_CODE = #{code}
ORDER BY
alias DESC,
joinMd DESC
select
CODE
, REPLACE(name,'code_','') NAME
, TYPE
from epc_master_element
where DEL_FLAG = 0
and DEFINE_CODE = #{code}
SELECT
CODE
FROM
epc_master_element
WHERE
DEFINE_CODE = #{code}
AND ALIAS = #{type}
delete from epc_master_element
UPDATE epc_master_element
SET
ALIAS = #{alias}
WHERE
DEFINE_CODE = #{defineCode}
AND `CODE` = #{eleCode}
delete from
epc_master_element
where
define_code=#{code}
SELECT
id,define_code,code,name,type,len,prec,alias,del_flag
from
epc_master_element
where
define_code=#{code}