add: 内外部会议模块排序功能
This commit is contained in:
+2
-2
@@ -63,9 +63,9 @@ public class InsideOutsideMeetingVO extends BasePage {
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date modifyTime;
|
||||
|
||||
private String sortField;
|
||||
private String sortField = "ID";
|
||||
|
||||
private String sortMode;
|
||||
private String sortMode = "asc";
|
||||
|
||||
private String meetingTimeOperator = "=";
|
||||
}
|
||||
|
||||
+10
@@ -9,6 +9,7 @@ import com.adc.da.slrs.InsideOntSideMeeting.service.MeetingTopicService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.apache.commons.lang.WordUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -106,6 +107,15 @@ public class InsideOutsideMeetingServiceImpl extends ServiceImpl<InsideOutsideMe
|
||||
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");
|
||||
}
|
||||
Integer rowCount = this.baseMapper.queryByPageCount(page);
|
||||
page.getPager().setRowCount(rowCount);
|
||||
return this.baseMapper.queryByPage(page);
|
||||
|
||||
+9
-1
@@ -102,7 +102,15 @@
|
||||
where iom.VALID_FLAG = 0
|
||||
<include refid="Base_Where_Clause" />
|
||||
<include refid="MeetingTopic_where" />
|
||||
order by #{sortField} #{sortMode}
|
||||
order by
|
||||
<choose>
|
||||
<when test="sortField == 'AGENDA_NAME'">
|
||||
mt.${sortField} ${sortMode}
|
||||
</when>
|
||||
<otherwise>
|
||||
iom.${sortField} ${sortMode}
|
||||
</otherwise>
|
||||
</choose>
|
||||
limit ${pager.startIndex-1},${pageSize}
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user