标准查询没有total问题修复

This commit is contained in:
yuezhihang
2021-12-20 13:51:57 +08:00
parent 545e5bba72
commit 09e7e2ffee
3 changed files with 126 additions and 1 deletions
@@ -25,6 +25,8 @@ public interface SarStandardsInfoDao extends BaseMapper<SarStandardsInfo> {
int getSarStandardsInfoCount(SarStandardsInfoEOPage page);
int getSarStandardsInfoCountWk1(SarStandardsInfoEOPage page);
int insertSelective(SarStandardsInfo page);
SarStandardsInfo selectByPrimaryKeyAndModifyTime(SarStandardsInfo page);
@@ -342,7 +342,7 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
}
}
}
Integer rowCount = dao.getSarStandardsInfoCount(page);
Integer rowCount = dao.getSarStandardsInfoCountWk1(page);
page.getPager().setRowCount(rowCount);
List<SarStandardsInfo> sarlist = dao.getSarStandardsInfoPage(page,"996");
attrInfoCollect(sarlist);
@@ -987,6 +987,121 @@
</if>
</trim>
</sql>
<sql id="SarStandardsInfo_in_left_wk">
left join SAR_STAND_MENU ON SAR_STANDARDS_INFO.id = SAR_STAND_MENU.stand_id
where 1=1 and SAR_STANDARDS_INFO.valid_flag=0
<trim suffixOverrides=",">
<!-- 标准分类 国内标准,国外标准 必要搜索项 -->
<if test='standType != null and standType != "ALL"'>
and stand_type = #{standType}
</if>
<!-- 基本搜索项 -->
<!-- 国家、地区 -->
<if test="country != null and country != ''">
and country = #{country}
</if>
<!-- 标准编号111 -->
<if test="standNumber != null and standNumber != ''">
and (
(trim(replace(concat(SAR_STANDARDS_INFO.STAND_SORT,' ',SAR_STANDARDS_INFO.STAND_NUMBER,'-',
SAR_STANDARDS_INFO.STAND_YEAR),' ','')) like trim(replace(concat(concat('%',#{standNumber}),'%'),
' ','')) and SAR_STANDARDS_INFO.STAND_YEAR != '')
or (trim(replace(concat(SAR_STANDARDS_INFO.STAND_SORT,' ',SAR_STANDARDS_INFO.STAND_NUMBER),' ','')) like
trim(replace(concat(concat('%',#{standNumber}),'%'),' ',''))
)
or (trim(replace(stand_name,' ','')) like trim(replace(concat(concat('%',#{standNumber}),'%'),' ','')) )
)
</if>
<!-- 标准名称 -->
<if test="standName != null and standName != ''">
and stand_name like concat(concat('%',#{standName}),'%')
</if>
<if test="standEnName != null and standEnName != ''">
and stand_en_name like concat(concat('%',#{standEnName}),'%')
</if>
<!-- 标准状态 -->
<if test="standState != null and standState != ''">
and stand_state = #{standState}
</if>
<!-- 高级检索项 -->
<!-- 标准性质 -->
<if test="standNature != null and standNature != ''">
and stand_nature = #{standNature}
</if>
<!-- 代替标准 允许输入的时候输入多个-->
<if test="replaceStandNum != null and replaceStandNum != ''">
and replace_stand_num like concat(concat('%',#{replaceStandNum}),'%')
</if>
<!-- 被代替标准 -->
<if test="replacedStandNum != null and replacedStandNum != ''">
and replaced_stand_num like concat(concat('%',#{replacedStandNum}),'%')
</if>
<if test="isRelateAccess != null and isRelateAccess != ''" >
and is_relate_access = #{isRelateAccess}
</if>
<!-- 目录判断 -->
<if test="menuId != null and menuId !='nomenu' and menuAllChildrenIdList != null">
and SAR_STAND_MENU.MENU_ID in
<foreach collection="menuAllChildrenIdList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<!-- 新修改需求,根据角色查询有权限的菜单数据-->
<if test="menuRoleList != null">
and SAR_STAND_MENU.MENU_ID in
<foreach collection="menuRoleList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<!-- <if test="(menuId == null or menuId =='') and standType =='FOREIGN'">-->
<!-- and SAR_STAND_MENU.MENU_ID in (-->
<!-- select TS_RESOURCE.id from TS_RESOURCE start with id=(select TS_RESOURCE.id from TS_RESOURCE WHERE parent_id is null-->
<!-- and sor_divide-->
<!-- ='FOREIGN_STAND') connect by prior id= parent_id-->
<!-- )-->
<!-- </if>-->
<!-- 导出数据过程中,选择的id -->
<if test="idlist != null">
and SAR_STANDARDS_INFO.id in
<foreach collection="idlist" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<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>
<if test="issueTime != null and issueTime != ''">
and DATE_FORMAT(SAR_STANDARDS_INFO.ISSUE_TIME ,'%Y-%m-%d') = #{issueTime}
</if>
<!--内容摘要-->
<if test="synopsis != null and synopsis != ''" >
AND dbms_lob.instr(SYNOPSIS, #{synopsis} ,1,1) > 0
</if>
<!--文本状态-->
<if test="textStatus != null and textStatus != ''" >
and SAR_STANDARDS_INFO.TEXT_STATUS = #{textStatus}
</if>
<!--是否纳入法规清单-->
<if test="isRelateAccess != null and isRelateAccess != ''" >
and SAR_STANDARDS_INFO.IS_RELATE_ACCESS = #{isRelateAccess}
</if>
<if test="collectMenuId != null and collectMenuId != ''">
and SAR_STANDARDS_INFO.id in (
select COLLECT_RES_ID from TS_PERSON_COLLECT where TS_PERSON_COLLECT.VALID_FLAG=0
and (collect_type='INLAND_STAND' or collect_type='FOREIGN_STAND')
and TS_PERSON_COLLECT.user_id=#{userId}
)
</if>
</trim>
</sql>
<sql id="SarStandardsInfo_out_left">
</sql>
@@ -1019,6 +1134,14 @@
GROUP BY SAR_STANDARDS_INFO.id) a
</select>
<select id="getSarStandardsInfoCountWk1" 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_wk"/>
GROUP BY SAR_STANDARDS_INFO.id) a
</select>
<select id="selectByPrimaryKeyAndModifyTime" resultMap="BaseResultMap" parameterType="com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo">
select
<include refid="Base_Column_List"/>