feat: There is no way the, TO optimize the query

This commit is contained in:
super_liu
2021-10-22 17:53:11 +08:00
parent 48c3da1bae
commit 3cd41c45d7
@@ -503,7 +503,7 @@
and SAR_STANDARDS_INFO.STAND_YEAR = #{standYear}
</if>
<if test="issueTime != null and issueTime != ''">
and SAR_STANDARDS_INFO.ISSUE_TIME = #{issueTime}
and DATE_FORMAT(SAR_STANDARDS_INFO.ISSUE_TIME ,'%Y-%m-%d') = #{issueTime}
</if>
<!--内容摘要-->
<if test="synopsis != null and synopsis != ''" >
@@ -664,7 +664,7 @@
and SAR_STANDARDS_INFO.STAND_YEAR = #{standYear}
</if>
<if test="issueTime != null and issueTime != ''">
and SAR_STANDARDS_INFO.ISSUE_TIME = #{issueTime}
and DATE_FORMAT(SAR_STANDARDS_INFO.ISSUE_TIME ,'%Y-%m-%d') = #{issueTime}
</if>
<!--内容摘要-->
<if test="synopsis != null and synopsis != ''" >
@@ -698,10 +698,6 @@
<if test="applyArctic != null and applyArctic != ''">
and SAR_STAND_ATTR_INFO.CLLX = #{applyArctic}
</if>
<if test="advanceSearchStr != null and advanceSearchStr != ''">
and (${advanceSearchStr})
</if>
</trim>
</sql>
<sql id="SarStandardsInfo_out_left">
@@ -713,6 +709,12 @@
AND dicstandTextStatus.valid_flag = 0
)
left join SAR_STAND_ATTR_INFO on (SAR_STAND_ATTR_INFO.stand_id = a.id and SAR_STAND_ATTR_INFO.valid_flag=0)
where 1=1
<trim suffixOverrides=",">
<if test="advanceSearchStr != null and advanceSearchStr != ''">
and (${advanceSearchStr})
</if>
</trim>
</sql>
@@ -777,6 +779,7 @@
<select id="getSarStandardsInfoCount" resultType="java.lang.Integer"
parameterType="com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfoEOPage">
select count(1) from (select count(*) from SAR_STANDARDS_INFO
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)
<include refid="SarStandardsInfo_in_left"/>
GROUP BY SAR_STANDARDS_INFO.id) a
</select>