sql优化,保留标准类别 standSortShow
This commit is contained in:
+21
-5
@@ -60,7 +60,8 @@
|
||||
SAR_STANDARDS_INFO.stand_number, SAR_STANDARDS_INFO.stand_year, SAR_STANDARDS_INFO.stand_name, SAR_STANDARDS_INFO.stand_en_name,
|
||||
SAR_STANDARDS_INFO.stand_state, SAR_STANDARDS_INFO.stand_nature, SAR_STANDARDS_INFO.issue_time, SAR_STANDARDS_INFO.put_time,
|
||||
concat(SAR_STANDARDS_INFO.synopsis, '') as synopsis, concat(replace_stand_num, '') as replace_stand_num, replaced_stand_num, SAR_STANDARDS_INFO.creation_user, SAR_STANDARDS_INFO.valid_flag,
|
||||
SAR_STANDARDS_INFO.creation_time, SAR_STANDARDS_INFO.modify_time,dicstandTextStatus.DIC_TYPE_NAME as standTextStatusShow,is_relate_access,cite_stand,cited_stand,SAR_STANDARDS_INFO.text_status,SAR_STANDARDS_INFO.STAND_SYSTEM
|
||||
SAR_STANDARDS_INFO.creation_time, SAR_STANDARDS_INFO.modify_time, dicstandSort.DIC_TYPE_NAME as standSortShow,
|
||||
dicstandTextStatus.DIC_TYPE_NAME as standTextStatusShow,is_relate_access,cite_stand,cited_stand,SAR_STANDARDS_INFO.text_status,SAR_STANDARDS_INFO.STAND_SYSTEM
|
||||
</sql>
|
||||
|
||||
<sql id="Group_Column_List_Show">
|
||||
@@ -68,7 +69,8 @@
|
||||
SAR_STANDARDS_INFO.stand_number, SAR_STANDARDS_INFO.stand_year, SAR_STANDARDS_INFO.stand_name, SAR_STANDARDS_INFO.stand_en_name,
|
||||
SAR_STANDARDS_INFO.stand_state, SAR_STANDARDS_INFO.stand_nature, SAR_STANDARDS_INFO.issue_time, SAR_STANDARDS_INFO.put_time,
|
||||
concat(SAR_STANDARDS_INFO.synopsis, ''), concat(replace_stand_num, ''), replaced_stand_num, SAR_STANDARDS_INFO.creation_user, SAR_STANDARDS_INFO.valid_flag,
|
||||
SAR_STANDARDS_INFO.creation_time, SAR_STANDARDS_INFO.modify_time,dicstandTextStatus.DIC_TYPE_NAME,is_relate_access,cite_stand,cited_stand,SAR_STANDARDS_INFO.text_status,SAR_STANDARDS_INFO.STAND_SYSTEM
|
||||
SAR_STANDARDS_INFO.creation_time, SAR_STANDARDS_INFO.modify_time, dicstandSort.DIC_TYPE_NAME,
|
||||
dicstandTextStatus.DIC_TYPE_NAME,is_relate_access,cite_stand,cited_stand,SAR_STANDARDS_INFO.text_status,SAR_STANDARDS_INFO.STAND_SYSTEM
|
||||
</sql>
|
||||
|
||||
<!-- 查询条件 -->
|
||||
@@ -321,8 +323,8 @@
|
||||
<if test="textStatus != null" >
|
||||
text_status = #{textStatus},
|
||||
</if>
|
||||
<if test="standSystem != null" >
|
||||
stand_system = #{standSystem},
|
||||
<if test="standSystem != null" >
|
||||
stand_system = #{standSystem},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
@@ -370,6 +372,10 @@
|
||||
</select>
|
||||
|
||||
<sql id="SarStandardsInfo_Where_Clause">
|
||||
|
||||
left join TS_DICTYPE dicstandSort on (dicstandSort.dic_type_code = SAR_STANDARDS_INFO.stand_sort and
|
||||
dicstandSort.dic_id is not null and dicstandSort.valid_flag = 0 and dicstandSort.PARENT_ID is null)
|
||||
|
||||
LEFT JOIN TS_DICTYPE dicstandTextStatus ON (
|
||||
dicstandTextStatus.dic_type_code = SAR_STANDARDS_INFO.text_status
|
||||
AND dicstandTextStatus.dic_id IS NOT NULL
|
||||
@@ -492,7 +498,7 @@
|
||||
<if test="standSort != null and standSort != ''" >
|
||||
and SAR_STANDARDS_INFO.stand_sort = #{standSort}
|
||||
</if>
|
||||
<!--标准年份-->
|
||||
<!--标准年份-->
|
||||
<if test="standYear != null and standYear != ''">
|
||||
and SAR_STANDARDS_INFO.STAND_YEAR = #{standYear}
|
||||
</if>
|
||||
@@ -545,6 +551,7 @@
|
||||
(select tmp_tb.* from
|
||||
(select
|
||||
<include refid="Base_Column_List_Show"/>,SAR_STAND_ATTR_INFO.CHJL AS CHJL,
|
||||
|
||||
(
|
||||
CASE
|
||||
WHEN ZCCSSRQ = 'TBD' THEN '6999-01-01'
|
||||
@@ -723,6 +730,10 @@
|
||||
select
|
||||
<include refid="Base_Column_List_Show"/>
|
||||
from SAR_STANDARDS_INFO
|
||||
|
||||
left join TS_DICTYPE dicstandSort on (dicstandSort.dic_type_code = SAR_STANDARDS_INFO.stand_sort and
|
||||
dicstandSort.dic_id is not null and dicstandSort.valid_flag = 0 and dicstandSort.PARENT_ID is null)
|
||||
|
||||
LEFT JOIN TS_DICTYPE dicstandTextStatus ON (
|
||||
dicstandTextStatus.dic_type_code = SAR_STANDARDS_INFO.text_status
|
||||
AND dicstandTextStatus.dic_id IS NOT NULL
|
||||
@@ -838,6 +849,11 @@
|
||||
(select
|
||||
<include refid="Base_Column_List_Show"/>,SAR_STAND_ATTR_INFO.CHJL AS CHJL
|
||||
from SAR_STANDARDS_INFO
|
||||
|
||||
left join TS_DICTYPE dicstandSort on (dicstandSort.dic_type_code = SAR_STANDARDS_INFO.stand_sort and
|
||||
dicstandSort.dic_id is not null and dicstandSort.valid_flag = 0 and dicstandSort.PARENT_ID is null)
|
||||
|
||||
|
||||
left join SAR_STAND_MENU ON SAR_STANDARDS_INFO.id = SAR_STAND_MENU.stand_id
|
||||
left join TS_RESOURCE on SAR_STAND_MENU.menu_id = TS_RESOURCE.id
|
||||
left join SAR_STAND_ATTR_INFO on (SAR_STAND_ATTR_INFO.stand_id = SAR_STANDARDS_INFO.id and SAR_STAND_ATTR_INFO.valid_flag=0)
|
||||
|
||||
Reference in New Issue
Block a user