select
g.create_date createDate,
g.uid uid,
g.name name,
g.py_all pyAll,
g.py_head pyHead,
g.outer_id outerId,
g.outer_code outerCode,
g.mnemonic_code mnemonicCode,
g.enabled_flag enabledFlag,
g.remark remark,
g.parent_uid parentUid,
g.tenement_id tenementId,
x.isconfig isconfig
from
goods_type g
LEFT JOIN
(SELECT CASE WHEN
COUNT(id)>0
THEN
'true'
ELSE
'false'
END
isconfig,brand_uid from brand_config GROUP BY brand_uid ) x ON x.brand_uid = g.uid
where
tenement_id = #{tenementId}
and
parent_uid IS NULL
and
del_flag = 0AND
name like '%' #{name} '%'
AND outer_code = #{outerCode}