Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

对象中多个属性使用 @Join 且 关联同一张表时数据查询异常 #50

Closed
wu9007 opened this issue Apr 20, 2019 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@wu9007
Copy link
Owner

wu9007 commented Apr 20, 2019

  • SQL
SELECT
	TBL_DIC_BASIC.UUID,
	TBL_DIC_BASIC.TYPE_ID,
	TBL_DIC_BASIC.PARENT_UUID,
	TBL_DIC_BASIC.NAME,
	TBL_DIC_BASIC.SPELL,
	TBL_DIC_BASIC.CODE,
	TBL_DIC_BASIC.SYSTEM_CODE,
	TBL_DIC_BASIC.OPERATOR,
	TBL_DIC_BASIC.OPERATE_TIME,
	TBL_DIC_BASIC.MEMO,
	TBL_DIC_BASIC.SORT,
	TBL_DIC_BASIC.IS_LEAF,
	TBL_DIC_STATIC.NAME AS IS_LEAF,
	TBL_DIC_BASIC.IS_NEED_CHECK,
	TBL_DIC_STATIC.NAME AS IS_NEED_CHECK,
	TBL_DIC_BASIC.WARNING_DAYS,
	TBL_DIC_BASIC.IS_ENABLE,SELECT
	TBL_DIC_BASIC.UUID,
	TBL_DIC_BASIC.TYPE_ID,
	TBL_DIC_BASIC.PARENT_UUID,
	TBL_DIC_BASIC.NAME,
	TBL_DIC_BASIC.SPELL,
	TBL_DIC_BASIC.CODE,
	TBL_DIC_BASIC.SYSTEM_CODE,
	TBL_DIC_BASIC.OPERATOR,
	TBL_DIC_BASIC.OPERATE_TIME,
	TBL_DIC_BASIC.MEMO,
	TBL_DIC_BASIC.SORT,
	TBL_DIC_BASIC.IS_LEAF,
	TBL_DIC_STATIC.NAME AS IS_LEAF,
	TBL_DIC_BASIC.IS_NEED_CHECK,
	TBL_DIC_STATIC.NAME AS IS_NEED_CHECK,
	TBL_DIC_BASIC.WARNING_DAYS,
	TBL_DIC_BASIC.IS_ENABLE,
	TBL_DIC_STATIC.NAME AS IS_ENABLE,
	TBL_DIC_BASIC.IS_QUALIFIED,
	TBL_DIC_STATIC.NAME AS IS_QUALIFIED,
	TBL_DIC_BASIC.IS_DELETED 
FROM
	TBL_DIC_BASIC
	LEFT JOIN TBL_DIC_STATIC ON TBL_DIC_BASIC.IS_LEAF = TBL_DIC_STATIC.UUID
	LEFT JOIN TBL_DIC_STATIC ON TBL_DIC_BASIC.IS_NEED_CHECK = TBL_DIC_STATIC.UUID
	LEFT JOIN TBL_DIC_STATIC ON TBL_DIC_BASIC.IS_ENABLE = TBL_DIC_STATIC.UUID
	LEFT JOIN TBL_DIC_STATIC ON TBL_DIC_BASIC.IS_QUALIFIED = TBL_DIC_STATIC.UUID 
WHERE 1=1
	TBL_DIC_BASIC.IS_DELETED = ? 
	AND TBL_DIC_BASIC.TYPE_ID = ? 
	LIMIT 0,
	13
	TBL_DIC_STATIC.NAME AS IS_ENABLE,
	TBL_DIC_BASIC.IS_QUALIFIED,
	TBL_DIC_STATIC.NAME AS IS_QUALIFIED,
	TBL_DIC_BASIC.IS_DELETED 
FROM
	TBL_DIC_BASIC
	LEFT JOIN TBL_DIC_STATIC ON TBL_DIC_BASIC.IS_LEAF = TBL_DIC_STATIC.UUID
	LEFT JOIN TBL_DIC_STATIC ON TBL_DIC_BASIC.IS_NEED_CHECK = TBL_DIC_STATIC.UUID
	LEFT JOIN TBL_DIC_STATIC ON TBL_DIC_BASIC.IS_ENABLE = TBL_DIC_STATIC.UUID
	LEFT JOIN TBL_DIC_STATIC ON TBL_DIC_BASIC.IS_QUALIFIED = TBL_DIC_STATIC.UUID 
@wu9007
Copy link
Owner Author

wu9007 commented Apr 20, 2019

#52 添加关联别名。

@wu9007 wu9007 closed this as completed Apr 20, 2019
@wu9007 wu9007 added good first issue Good for newcomers help wanted Extra attention is needed and removed help wanted Extra attention is needed good first issue Good for newcomers labels May 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant