|
|
|
@ -148,53 +148,51 @@ |
|
|
|
|
</select>--> |
|
|
|
|
<select id="getsTheSubColumn" resultType="com.huoran.iasf.entity.SysColumn"> |
|
|
|
|
SELECT *, |
|
|
|
|
(SELECT u.username FROM sys_user u WHERE u.id = s.founder_id) AS creteUser, |
|
|
|
|
(SELECT u.username FROM sys_user u WHERE u.id = s.editor_id) AS editorUser, |
|
|
|
|
(SELECT t.template_type FROM sys_template t WHERE t.id = s.template_id) AS templateName, |
|
|
|
|
(SELECT sty.style FROM sys_template_style sty WHERE sty.id = s.list_style_id) AS listStyle, |
|
|
|
|
(SELECT sty.style FROM sys_template_style sty WHERE sty.id = s.detail_style_id) AS detailStyle, |
|
|
|
|
(SELECT sty.path FROM sys_template_style sty WHERE sty.id = s.list_style_id) AS path |
|
|
|
|
(SELECT u.username FROM sys_user u WHERE u.id = s.founder_id) AS creteUser, |
|
|
|
|
(SELECT u.username FROM sys_user u WHERE u.id = s.editor_id) AS editorUser, |
|
|
|
|
(SELECT t.template_type FROM sys_template t WHERE t.id = s.template_id) AS templateName, |
|
|
|
|
(SELECT sty.style FROM sys_template_style sty WHERE sty.id = s.list_style_id) AS listStyle, |
|
|
|
|
(SELECT sty.style FROM sys_template_style sty WHERE sty.id = s.detail_style_id) AS detailStyle, |
|
|
|
|
(SELECT sty.path FROM sys_template_style sty WHERE sty.id = s.list_style_id) AS path |
|
|
|
|
FROM sys_column s |
|
|
|
|
WHERE deleted = 1 |
|
|
|
|
AND site_id = 1 |
|
|
|
|
AND site_id = 1 |
|
|
|
|
<if test="ids != '' and ids!= null"> |
|
|
|
|
and FIND_IN_SET(s.id, #{ids}) |
|
|
|
|
and FIND_IN_SET(s.id, #{ids}) |
|
|
|
|
</if> |
|
|
|
|
|
|
|
|
|
ORDER BY |
|
|
|
|
s.create_time asc |
|
|
|
|
|
|
|
|
|
<if test="isSort== 1"> |
|
|
|
|
ORDER BY |
|
|
|
|
s.sort ASC |
|
|
|
|
</if> |
|
|
|
|
<if test="isSort=='' and isSort == null"> |
|
|
|
|
ORDER BY |
|
|
|
|
s.create_time asc |
|
|
|
|
</if> |
|
|
|
|
</select> |
|
|
|
|
<select id="oneLevelChecksThemAll" resultType="java.lang.Integer"> |
|
|
|
|
SELECT |
|
|
|
|
id |
|
|
|
|
FROM |
|
|
|
|
( |
|
|
|
|
SELECT |
|
|
|
|
@r AS _id, |
|
|
|
|
SELECT id |
|
|
|
|
FROM (SELECT @r AS _id, |
|
|
|
|
( SELECT @r := father_id FROM sys_column WHERE id = _id ) AS fatherId, |
|
|
|
|
@l := @l + 1 AS lvl |
|
|
|
|
FROM |
|
|
|
|
( SELECT @r := #{theChildId}, @l := 0 ) vars, |
|
|
|
|
sys_column h |
|
|
|
|
WHERE |
|
|
|
|
@r != 0 |
|
|
|
|
) T1 |
|
|
|
|
JOIN sys_column T2 ON T1._id = T2.id |
|
|
|
|
FROM |
|
|
|
|
( SELECT @r := #{theChildId}, @l := 0 ) vars, sys_column h |
|
|
|
|
WHERE |
|
|
|
|
@r != 0) T1 |
|
|
|
|
JOIN sys_column T2 ON T1._id = T2.id |
|
|
|
|
WHERE |
|
|
|
|
deleted = 1 |
|
|
|
|
ORDER BY |
|
|
|
|
T1.lvl DESC limit 0,1 |
|
|
|
|
T1.lvl DESC limit 0, 1 |
|
|
|
|
</select> |
|
|
|
|
<select id="queryByColumnType" resultType="com.huoran.iasf.entity.SysColumn"> |
|
|
|
|
SELECT |
|
|
|
|
id, |
|
|
|
|
father_id, |
|
|
|
|
column_name, |
|
|
|
|
list_style_id |
|
|
|
|
FROM |
|
|
|
|
sys_column s |
|
|
|
|
WHERE |
|
|
|
|
FIND_IN_SET( s.id, #{ids} ) |
|
|
|
|
SELECT id, |
|
|
|
|
father_id, |
|
|
|
|
column_name, |
|
|
|
|
list_style_id |
|
|
|
|
FROM sys_column s |
|
|
|
|
WHERE FIND_IN_SET(s.id, #{ids}) |
|
|
|
|
GROUP BY list_style_id |
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
|