|
@@ -207,12 +207,12 @@
|
|
|
<if test="excelTab.name!=null and excelTab.name!=''">
|
|
|
AND x.name like concat(concat('%', #{excelTab.name}),'%')
|
|
|
</if>
|
|
|
- <if test="param2.parentId == null or param2.parentId == 0">
|
|
|
- <if test="param2.tabType != null">
|
|
|
- AND x.tab_type = #{param2.tabType}
|
|
|
+ <if test="excelTab.parentId == null or excelTab.parentId == 0">
|
|
|
+ <if test="excelTab.tabType != null">
|
|
|
+ AND x.tab_type = #{excelTab.tabType}
|
|
|
</if>
|
|
|
<if test="param2.tableTemplateType != null">
|
|
|
- AND x.table_template_type = #{param2.tableTemplateType}
|
|
|
+ AND x.table_template_type = #{excelTab.tableTemplateType}
|
|
|
</if>
|
|
|
</if>
|
|
|
order by x.sort
|
|
@@ -229,32 +229,67 @@
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
</select>
|
|
|
+<!-- <select id="selectRootExcelTab" resultType="org.springblade.manager.vo.ExcelTabVO">-->
|
|
|
+<!-- SELECT-->
|
|
|
+<!-- t.project_id as projectId,-->
|
|
|
+<!-- p.project_name as projectName,-->
|
|
|
+<!-- t.root_id as id-->
|
|
|
+<!-- FROM (-->
|
|
|
+<!-- SELECT-->
|
|
|
+<!-- project_id,-->
|
|
|
+<!-- SUBSTRING_INDEX(alias, ',', 1) as root_id-->
|
|
|
+<!-- FROM m_wbs_tree_private a-->
|
|
|
+<!-- LEFT JOIN m_excel_tab b ON a.excel_id = b.id-->
|
|
|
+<!-- WHERE a.type = 2-->
|
|
|
+<!-- AND a.is_deleted = 0-->
|
|
|
+<!-- AND a.excel_id IS NOT NULL-->
|
|
|
+<!-- <if test="vo != null ">-->
|
|
|
+<!-- <if test="vo.projectId != null">-->
|
|
|
+<!-- AND a.project_id = #{vo.projectId}-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- GROUP BY project_id, root_id-->
|
|
|
+<!-- <if test="rootIds != null and rootIds.size() > 0">-->
|
|
|
+<!-- HAVING root_id IN-->
|
|
|
+<!-- <foreach collection="rootIds" item="item" open="(" separator="," close=")">-->
|
|
|
+<!-- #{item}-->
|
|
|
+<!-- </foreach>-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- ) t-->
|
|
|
+<!-- INNER JOIN m_project_info p ON p.id = t.project_id where project_id is not null-->
|
|
|
+<!-- </select>-->
|
|
|
<select id="selectRootExcelTab" resultType="org.springblade.manager.vo.ExcelTabVO">
|
|
|
- SELECT
|
|
|
- t.project_id as projectId,
|
|
|
- p.project_name as projectName,
|
|
|
- t.root_id as id
|
|
|
- FROM (
|
|
|
- SELECT
|
|
|
- project_id,
|
|
|
- SUBSTRING_INDEX(alias, ',', 1) as root_id
|
|
|
+ SELECT distinct
|
|
|
+ a.project_id as projectId,
|
|
|
+ b.project_name as projectName,
|
|
|
+ d.id as id
|
|
|
FROM m_wbs_tree_private a
|
|
|
- LEFT JOIN m_excel_tab b ON a.excel_id = b.id
|
|
|
- WHERE a.type = 2
|
|
|
- AND a.is_deleted = 0
|
|
|
- AND a.excel_id IS NOT NULL
|
|
|
- <if test="projectId != null and projectId > 0">
|
|
|
- AND project_id = #{projectId}
|
|
|
+ inner join m_project_info b on b.id = a.project_id
|
|
|
+ inner join m_excel_tab c on c.id = a.excel_id
|
|
|
+ inner join m_excel_tab d on d.id = SUBSTRING_INDEX(c.alias, ',', 1)
|
|
|
+ WHERE a.type = 2 AND a.is_deleted = 0 AND a.excel_id IS NOT NULL
|
|
|
+ <if test="vo != null ">
|
|
|
+ <if test="vo.projectId != null">
|
|
|
+ AND a.project_id = #{vo.projectId}
|
|
|
+ </if>
|
|
|
+ <if test="vo.name!=null and vo.name!=''">
|
|
|
+ AND d.name like concat(concat('%', #{vo.name}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="vo.parentId == null or vo.parentId == 0">
|
|
|
+ <if test="vo.tabType != null">
|
|
|
+ AND d.tab_type = #{vo.tabType}
|
|
|
+ </if>
|
|
|
+ <if test="vo.tableTemplateType != null">
|
|
|
+ AND d.table_template_type = #{vo.tableTemplateType}
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
</if>
|
|
|
- GROUP BY project_id, root_id
|
|
|
<if test="rootIds != null and rootIds.size() > 0">
|
|
|
- HAVING root_id IN
|
|
|
+ and d.id IN
|
|
|
<foreach collection="rootIds" item="item" open="(" separator="," close=")">
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
</if>
|
|
|
- ) t
|
|
|
- INNER JOIN m_project_info p ON p.id = t.project_id where project_id is not null
|
|
|
</select>
|
|
|
<select id="getByIds" resultType="org.springblade.manager.vo.ExcelTabVO">
|
|
|
select *, (select name from blade_user where id = a.create_user) as createUserName, (SELECT bdb.dict_value from blade_dict_biz bdb WHERE code = 'table_template_type' AND dict_key = a.table_template_type) as tableTemplateTypeName
|