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

修改分页不生效

parent 3c415f35
...@@ -205,7 +205,7 @@ ...@@ -205,7 +205,7 @@
FROM FROM
mcb_warning_question_info question, mcb_warning_question_info question,
mcb_warning_warning_info warning mcb_warning_warning_info warning
<where> where
question.NUM IS NOT NULL question.NUM IS NOT NULL
AND question.NUM = warning.QUESTION_NUM AND question.NUM = warning.QUESTION_NUM
AND question.COMPLETION_STATUS != '1' AND question.COMPLETION_STATUS != '1'
...@@ -222,8 +222,32 @@ ...@@ -222,8 +222,32 @@
#{item} #{item}
</foreach> </foreach>
</if> </if>
</where> ORDER BY question.CREATE_DATE DESC Limit #{offset}, #{size}
ORDER BY question.CREATE_DATE DESC </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'
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>
</select> </select>
<select id="queryQuestionList" resultType="java.util.Map"> <select id="queryQuestionList" resultType="java.util.Map">
......
...@@ -49,9 +49,17 @@ public interface McbWarningMapper extends BaseMapper { ...@@ -49,9 +49,17 @@ public interface McbWarningMapper extends BaseMapper {
List<OverviewQuestionDto> overviewQuestionList( List<OverviewQuestionDto> overviewQuestionList(
@Param("projectOrgCodes") List<String> projectOrgCodes, Integer offset,
@Param("startTime") String startTime, Integer size,
@Param("endTime") String endTime 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 { ...@@ -104,15 +104,13 @@ public class McbWarningServiceImpl implements IMcbWarningService {
endTime+= " 23:59:59"; endTime+= " 23:59:59";
} }
List<OverviewQuestionDto> list = mcbWarningMapper.overviewQuestionList( (current -1) * size, size ,projectOrgCodes, startTime, endTime);
PageHelper.startPage(current, size); Integer total = mcbWarningMapper.overviewQuestionListTotal(projectOrgCodes, startTime, endTime);
List<OverviewQuestionDto> list = mcbWarningMapper.overviewQuestionList(projectOrgCodes, startTime, endTime);
PageInfo<OverviewQuestionDto> page = new PageInfo(list);
Page<OverviewQuestionDto> pagenew = new Page<>(); Page<OverviewQuestionDto> pagenew = new Page<>();
pagenew.setCurrent(current); pagenew.setCurrent(current);
pagenew.setTotal(page.getTotal()); pagenew.setTotal(total);
pagenew.setSize(size); pagenew.setSize(size);
pagenew.setRecords(page.getList()); pagenew.setRecords(list);
return pagenew; 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