Commit 3bff563f authored by 朱晨阳's avatar 朱晨阳

修改分页不生效

parent 3c415f35
......@@ -205,7 +205,33 @@
FROM
mcb_warning_question_info question,
mcb_warning_warning_info warning
<where>
where
question.NUM IS NOT NULL
AND question.NUM = warning.QUESTION_NUM
AND question.COMPLETION_STATUS != '1'
AND warning.WARNING_SOURCE_TYPE in (select mcb_data_dictionary.name from mcb_data_dictionary WHERE mcb_data_dictionary.remark = 'OVERVIEW' )
<if test="startTime != null and startTime != ''">
AND question.CREATE_DATE >= #{startTime}
</if>
<if test="endTime != null and endTime != ''">
AND question.CREATE_DATE &lt;= #{endTime}
</if>
<if test="projectOrgCodes != null and projectOrgCodes.size() > 0">
AND question.SOURCE_ATTRIBUTION IN
<foreach collection="projectOrgCodes" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
ORDER BY question.CREATE_DATE DESC Limit #{offset}, #{size}
</select>
<select id="overviewQuestionListTotal" resultType="int">
SELECT
count(1)
FROM
mcb_warning_question_info question,
mcb_warning_warning_info warning
where
question.NUM IS NOT NULL
AND question.NUM = warning.QUESTION_NUM
AND question.COMPLETION_STATUS != '1'
......@@ -222,8 +248,6 @@
#{item}
</foreach>
</if>
</where>
ORDER BY question.CREATE_DATE DESC
</select>
<select id="queryQuestionList" resultType="java.util.Map">
......
......@@ -49,9 +49,17 @@ public interface McbWarningMapper extends BaseMapper {
List<OverviewQuestionDto> overviewQuestionList(
@Param("projectOrgCodes") List<String> projectOrgCodes,
@Param("startTime") String startTime,
@Param("endTime") String endTime
Integer offset,
Integer size,
List<String> projectOrgCodes,
String startTime,
String endTime
);
Integer overviewQuestionListTotal(
List<String> projectOrgCodes,
String startTime,
String endTime
);
/**
......
......@@ -104,15 +104,13 @@ public class McbWarningServiceImpl implements IMcbWarningService {
endTime+= " 23:59:59";
}
PageHelper.startPage(current, size);
List<OverviewQuestionDto> list = mcbWarningMapper.overviewQuestionList(projectOrgCodes, startTime, endTime);
PageInfo<OverviewQuestionDto> page = new PageInfo(list);
List<OverviewQuestionDto> list = mcbWarningMapper.overviewQuestionList( (current -1) * size, size ,projectOrgCodes, startTime, endTime);
Integer total = mcbWarningMapper.overviewQuestionListTotal(projectOrgCodes, startTime, endTime);
Page<OverviewQuestionDto> pagenew = new Page<>();
pagenew.setCurrent(current);
pagenew.setTotal(page.getTotal());
pagenew.setTotal(total);
pagenew.setSize(size);
pagenew.setRecords(page.getList());
pagenew.setRecords(list);
return pagenew;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment