bug: 内外部会议分页bug修改

This commit is contained in:
wxyclub
2023-11-22 15:56:27 +08:00
parent d65a5da9b5
commit 9c1e8b45fd
4 changed files with 29 additions and 27 deletions
@@ -16,7 +16,7 @@ import java.util.List;
@Mapper
public interface InsideOutsideMeetingDao extends BaseMapper<InsideOutsideMeeting> {
List<Integer> queryByPageCount(InsideOutsideMeetingVO page);
Integer queryByPageCount(InsideOutsideMeetingVO page);
List<InsideOutsideMeetingVO> queryByPage(InsideOutsideMeetingVO page);
@@ -40,9 +40,10 @@ public class InsideOutsideMeetingVO extends BasePage {
@Excel(name = "会议地点", needMerge = true)
private String meetingAddress;
private String agendaNameStr;
@Excel(name = "参会人员", needMerge = true)
private String participants;
private List<String> participantsList;
private String meetingMinutes;
@@ -82,9 +83,9 @@ public class InsideOutsideMeetingVO extends BasePage {
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
private Date modifyTime;
private String sortField = "ID";
private String sortField = "meetingTime";
private String sortMode = "asc";
private String sortMode = "desc";
// 会议时间查询字段
private String meetingTimeBegin;
@@ -176,19 +176,16 @@ public class InsideOutsideMeetingServiceImpl extends ServiceImpl<InsideOutsideMe
@Override
public List<InsideOutsideMeetingVO> queryByPage(InsideOutsideMeetingVO page){
if (StringUtils.isNotBlank(page.getParticipants())) {
page.setParticipantsList(Arrays.asList(page.getParticipants().split(",")));
}
// 设置排序字段
if (StringUtils.isNotBlank(page.getSortField())) {
// 小驼峰变成 ABC_DEF
String sortField = StringUtils.join(StringUtils.splitByCharacterTypeCamelCase(page.getSortField()),"_").toUpperCase();
page.setSortField(sortField);
} else {
page.setSortField("ID");
page.setSortMode("asc");
page.setSortField("MEETING_TIME");
page.setSortMode("desc");
}
int rowCount = this.baseMapper.queryByPageCount(page).size();
int rowCount = this.baseMapper.queryByPageCount(page);
page.getPager().setRowCount(rowCount);
List<InsideOutsideMeetingVO> insideOutsideMeetingVOList = this.baseMapper.queryByPage(page);
for (InsideOutsideMeetingVO insideOutsideMeeting : insideOutsideMeetingVOList) {
@@ -10,6 +10,7 @@
<result column="MEETING_ORGANIZER" property="meetingOrganizer" />
<result column="MEETING_TIME" property="meetingTime" />
<result column="MEETING_ADDRESS" property="meetingAddress" />
<result column="agendaNameStr" property="agendaNameStr" />
<result column="PARTICIPANTS" property="participants" />
<result column="MEETING_MINUTES" property="meetingMinutes" />
<result column="MEETING_CONTENT" property="meetingContent" />
@@ -39,7 +40,8 @@
iom.PARTICIPANTS,iom.MEETING_MINUTES,iom.MEETING_CONTENT,iom.FIRST_MEETING_TYPE,iom.SECOND_MEETING_TYPE,
mt.ID as mtId,mt.MEETING_ID,mt.AGENDA_NAME,mt.AGENDA_MATERIALS,mt.REPORTER,mt.REPORTING_UNIT,
mt.AGENDA_CONTENT,
iom.VALID_FLAG,iom.CREATE_TIME,iom.MODIFY_TIME
iom.VALID_FLAG,iom.CREATE_TIME,iom.MODIFY_TIME,
iom.agendaNameStr
</sql>
<sql id="Base_Where_Clause">
<trim suffixOverrides="," >
@@ -58,11 +60,8 @@
<if test="meetingAddress != null and meetingAddress != ''" >
and MEETING_ADDRESS like concat('%',#{meetingAddress},'%')
</if>
<if test="participantsList != null and participantsList.size() > 0" >
and PARTICIPANTS in
<foreach collection="participantsList" separator="," open="(" close=")" item="participant">
#{participant}
</foreach>
<if test="participants != null and participants != ''">
and PARTICIPANTS like concat('%',#{participants},'%')
</if>
<if test="meetingContent != null" >
and MEETING_CONTENT like concat('%',#{meetingContent},'%')
@@ -90,30 +89,35 @@
</if>
</sql>
<select id="queryByPageCount" resultType="java.lang.Integer">
select count(iom.ID) from inside_outside_meeting iom join meeting_topic mt on iom.ID = mt.MEETING_ID
where iom.VALID_FLAG = 0
<include refid="Base_Where_Clause"/>
<include refid="MeetingTopic_where" />
group by iom.ID
select count(1) from (
select count(1) from inside_outside_meeting iom join meeting_topic mt on iom.ID = mt.MEETING_ID
where iom.VALID_FLAG = 0
<include refid="Base_Where_Clause"/>
<include refid="MeetingTopic_where" />
group by iom.ID
) subquery
</select>
<select id="queryByPage" resultMap="BaseResultMap" parameterType="com.adc.da.slrs.InsideOntSideMeeting.entity.InsideOutsideMeetingVO">
select <include refid="Base_Column_Join_MeetingTopic_List" />
from inside_outside_meeting iom join meeting_topic mt on iom.ID = mt.MEETING_ID
from (select <include refid="Base_Column_List" />,(
select GROUP_CONCAT(AGENDA_NAME SEPARATOR ',') from meeting_topic where inside_outside_meeting.ID = meeting_topic.MEETING_ID
) as agendaNameStr from inside_outside_meeting where VALID_FLAG = 0
<if test="sortField != 'AGENDA_NAME'">
order by ${sortField} ${sortMode}
</if>
limit ${pager.startIndex-1},${pageSize}) iom left join meeting_topic mt on iom.ID = mt.MEETING_ID
where iom.VALID_FLAG = 0
<include refid="Base_Where_Clause" />
<include refid="MeetingTopic_where" />
order by
<choose>
<when test="sortField == 'AGENDA_NAME'">
mt.${sortField} ${sortMode},
mt.AGENDA_NAME asc
mt.${sortField} ${sortMode}
</when>
<otherwise>
iom.${sortField} ${sortMode},
mt.AGENDA_NAME asc
iom.${sortField} ${sortMode}
</otherwise>
</choose>
limit ${pager.startIndex-1},${pageSize}
</select>
<select id="queryMeetingById" resultMap="BaseResultMap">
select <include refid="Base_Column_Join_MeetingTopic_List" />