Commit 49fbd32a by 吴迪

【修改】显示排序修改

parent 6e779e46
......@@ -140,6 +140,7 @@ public class MedicalController extends AbstractController {
queryWrapper.select("top 10 id,title ");
queryWrapper.gt("level", "0");
queryWrapper.eq("status", "1");
queryWrapper.orderByDesc("level");
if (StringUtils.isBlank(medical.getType())) {
return R.error("请输入分类");
}
......
package io.office.modules.manage.controller;
import java.util.AbstractCollection;
import java.util.Arrays;
import java.util.Date;
import java.util.Map;
......@@ -12,7 +12,6 @@ import io.office.modules.manage.vo.request.NewtopicEntityVo;
import io.office.modules.sys.controller.AbstractController;
import io.office.modules.sys.entity.SysUserEntity;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
......
......@@ -11,4 +11,6 @@ import lombok.Data;
public class PageParams {
private int page;
private int limit;
private String sidx;
private String order;
}
......@@ -29,6 +29,18 @@ public class LogisticsServiceImpl extends ServiceImpl<LogisticsDao, LogisticsEnt
if(!StringUtils.isNullOrEmpty(String.valueOf(params.get("type")))){
logisticsEntityQueryWrapper.eq("type",params.get("type"));
}
if (params.get("sidx") == null || org.apache.commons.lang3.StringUtils.isBlank(params.get("sidx").toString())) {
logisticsEntityQueryWrapper.orderByDesc("id");
} else {
if (params.get("order") != null && org.apache.commons.lang3.StringUtils.isBlank(params.get("order").toString())) {
if (params.get("order").toString().equalsIgnoreCase("asc")) {
logisticsEntityQueryWrapper.orderByAsc(params.get("sidx").toString());
} else {
logisticsEntityQueryWrapper.orderByDesc(params.get("sidx").toString());
}
}
}
IPage<LogisticsEntity> page = this.page(
new Query<LogisticsEntity>().getPage(params),
logisticsEntityQueryWrapper
......
......@@ -32,6 +32,11 @@ public class MedicalServiceImpl extends ServiceImpl<MedicalDao, MedicalEntity> i
if(!StringUtil.isNullOrEmpty(String.valueOf(params.get("type")))){
medicalEntityQueryWrapper.eq("type",params.get("type"));
}
if(!StringUtil.isNullOrEmpty(String.valueOf(params.get("level")))){
medicalEntityQueryWrapper.eq("level",params.get("level"));
} else {
medicalEntityQueryWrapper.ge("level",0);
}
IPage<MedicalEntity> page = this.page(
new Query<MedicalEntity>().getPage(params),
medicalEntityQueryWrapper
......
......@@ -28,14 +28,27 @@ public class NewtopicServiceImpl extends ServiceImpl<NewtopicDao, NewtopicEntity
@Override
public PageUtils queryPage(Map<String, Object> params) {
QueryWrapper queryWrapper = new QueryWrapper<NewtopicEntity>();
queryWrapper.orderByDesc("ClassId");
if (params.get("sidx") == null || StringUtils.isBlank(params.get("sidx").toString())) {
queryWrapper.orderByDesc("ClassId");
} else {
if (params.get("order") != null && StringUtils.isBlank(params.get("order").toString())) {
if (params.get("order").toString().equalsIgnoreCase("asc")) {
queryWrapper.orderByAsc(params.get("sidx").toString());
} else {
queryWrapper.orderByDesc(params.get("sidx").toString());
}
}
}
queryWrapper.eq("parentid",0);
if(params.containsKey("levels")) {
if(params.get("levels") !=null){
queryWrapper.eq("levels",params.get("levels"));
if (params.containsKey("levels")) {
if (params.get("levels") != null && StringUtils.isNotBlank(String.valueOf(params.get("levels")))) {
queryWrapper.eq("levels", params.get("levels"));
} else {
queryWrapper.gt("levels", 0);
}
} else{
queryWrapper.gt("levels",0);
} else {
queryWrapper.gt("levels", 0);
}
if(params.containsKey("status")) {
if(StringUtils.isNotBlank(String.valueOf(params.get("status")))) {
......
......@@ -26,7 +26,17 @@ public class PlanBranchServiceImpl extends ServiceImpl<PlanBranchDao, PlanBranch
planBranchEntityQueryWrapper.eq(params.get("classnum")!=null && StringUtils.isNotBlank(params.get("classnum").toString()),"classnum",params.get("classnum"));
planBranchEntityQueryWrapper.eq(params.get("checkflag")!=null && StringUtils.isNotBlank(params.get("checkflag").toString()),"checkflag",params.get("checkflag"));
planBranchEntityQueryWrapper.like(params.get("name")!=null && StringUtils.isNotBlank(params.get("name").toString()),"name",params.get("name"));
planBranchEntityQueryWrapper.orderByAsc("id");
if (params.get("sidx") == null || org.apache.commons.lang3.StringUtils.isBlank(params.get("sidx").toString())) {
planBranchEntityQueryWrapper.orderByAsc("id");
} else {
if (params.get("order") != null && org.apache.commons.lang3.StringUtils.isBlank(params.get("order").toString())) {
if (params.get("order").toString().equalsIgnoreCase("asc")) {
planBranchEntityQueryWrapper.orderByAsc(params.get("sidx").toString());
} else {
planBranchEntityQueryWrapper.orderByDesc(params.get("sidx").toString());
}
}
}
IPage<PlanBranchEntity> page = this.page(
new Query<PlanBranchEntity>().getPage(params),
planBranchEntityQueryWrapper
......
......@@ -56,7 +56,13 @@
<if test="newsParams.type !=null and newsParams.type !=''">
and a.announcetype =#{newsParams.type}
</if>
ORDER BY
a.id DESC
<choose>
<when test="newsParams.sidx!=null and newsParams.sidx!=''">
ORDER BY a.${newsParams.sidx} ${newsParams.order},
</when>
<otherwise>
ORDER BY a.id DESC
</otherwise>
</choose>
</select>
</mapper>
\ No newline at end of file
......@@ -50,7 +50,13 @@
<if test="newsParams.service !=null and newsParams.service !=''">
and t.service = #{newsParams.service}
</if>
ORDER BY
t.id DESC
<choose>
<when test="newsParams.sidx!=null and newsParams.sidx!=''">
ORDER BY t.${newsParams.sidx} ${newsParams.order},
</when>
<otherwise>
ORDER BY t.id DESC
</otherwise>
</choose>
</select>
</mapper>
\ No newline at end of file
......@@ -43,7 +43,13 @@
AND levels > 0
</otherwise>
</choose>
ORDER BY
id DESC
<choose>
<when test="newsParams.sidx!=null and newsParams.sidx!=''">
ORDER BY ${newsParams.sidx} ${newsParams.order},
</when>
<otherwise>
order by id desc
</otherwise>
</choose>
</select>
</mapper>
\ No newline at end of file
......@@ -32,6 +32,13 @@
</otherwise>
</choose>
</if>
order by id desc
<choose>
<when test="params.sidx!=null and params.sidx!=''">
ORDER BY t.${params.sidx} ${params.order},
</when>
<otherwise>
order by id desc
</otherwise>
</choose>
</select>
</mapper>
\ No newline at end of file
......@@ -53,8 +53,15 @@
AND t.levels > 0
</otherwise>
</choose>
ORDER BY
t.levels desc,t.starttime_index DESC,t.id desc
<choose>
<when test="indexCarouselManage.sidx!=null and indexCarouselManage.sidx!=''">
ORDER BY ${indexCarouselManage.sidx} ${indexCarouselManage.order},
</when>
<otherwise>
ORDER BY t.levels desc,t.starttime_index DESC,t.id desc
</otherwise>
</choose>
</select>
<select id="indexCarouselManageList" resultMap="indexCarouselManageMap">
......
......@@ -53,8 +53,15 @@
<if test="newsParams.categoryId !=null and newsParams.categoryId !=''">
and b.knowledgeCategoryID = #{newsParams.categoryId}
</if>
ORDER BY
<choose>
<when test="newsParams.sidx!=null and newsParams.sidx!=''">
ORDER BY ${newsParams.sidx} ${newsParams.order},
</when>
<otherwise>
ORDER BY
inputdate DESC
</otherwise>
</choose>
</select>
......
......@@ -123,8 +123,14 @@
<if test="newsParams.auditor !=null and newsParams.auditor !=''">
and auditor =#{newsParams.auditor}
</if>
ORDER BY
id desc ,releasedate DESC
<choose>
<when test="newsParams.sidx!=null and newsParams.sidx!=''">
ORDER BY ${newsParams.sidx} ${newsParams.order},
</when>
<otherwise>
ORDER BY id desc
</otherwise>
</choose>
</select>
......
......@@ -85,6 +85,13 @@
AND levels > 0
</otherwise>
</choose>
ORDER BY releasedate desc
<choose>
<when test="params.sidx!=null and params.sidx!=''">
ORDER BY ${params.sidx} ${params.order},
</when>
<otherwise>
ORDER BY releasedate desc
</otherwise>
</choose>
</select>
</mapper>
\ No newline at end of file
......@@ -35,9 +35,9 @@
AND levels > 0
</otherwise>
</choose>
<if test="newsParams.firmname !=null and newsParams.firmname !=''">
and firmname like concat('%',#{newsParams.firmname},'%')
</if>
<if test="newsParams.firmname !=null and newsParams.firmname !=''">
and firmname like concat('%',#{newsParams.firmname},'%')
</if>
<if test="newsParams.editor !=null and newsParams.editor !=''">
and editor = #{newsParams.editor}
</if>
......@@ -56,6 +56,13 @@
<if test="newsParams.updateTimeStart !=null and newsParams.updateTimeEnd !=null">
and updatedate BETWEEN #{newsParams.updateTimeStart} AND #{newsParams.updateTimeEnd}
</if>
order by id desc
<choose>
<when test="newsParams.sidx!=null and newsParams.sidx!=''">
ORDER BY ${newsParams.sidx} ${newsParams.order},
</when>
<otherwise>
order by id desc
</otherwise>
</choose>
</select>
</mapper>
\ No newline at end of file
......@@ -67,8 +67,14 @@
AND PicLevel > 0
</otherwise>
</choose>
ORDER BY
pictureID DESC
<choose>
<when test="params.sidx!=null and params.sidx!=''">
ORDER BY ${params.sidx} ${params.order},
</when>
<otherwise>
ORDER BY pictureID DESC
</otherwise>
</choose>
</select>
<select id="selectPictureNewList" resultMap="pictureMap" parameterType="io.office.modules.manage.entity.dto.NewsParams">
SELECT *
......
......@@ -52,8 +52,14 @@
AND levels > 0
</otherwise>
</choose>
ORDER BY
id DESC
<choose>
<when test="newsParams.sidx!=null and newsParams.sidx!=''">
ORDER BY ${newsParams.sidx} ${newsParams.order},
</when>
<otherwise>
order by id desc
</otherwise>
</choose>
</select>
<select id="selectPolicyNewList" resultMap="policyMap" parameterType="io.office.modules.manage.entity.dto.PolicyParams">
......
......@@ -55,7 +55,14 @@
<if test="params.categoryid !='' and params.categoryid !=null">
and a.categoryid =#{params.categoryid}
</if>
order by a.id desc
<choose>
<when test="params.sidx!=null and params.sidx!=''">
ORDER BY a.${params.sidx} ${params.order},
</when>
<otherwise>
order by a.id desc
</otherwise>
</choose>
</select>
<select id="findPage" resultType="io.office.modules.manage.entity.ProductEntity" parameterType="string">
select * from product where levels > 0 and categoryid=1
......
......@@ -68,8 +68,15 @@
AND PicLevel > 0
</otherwise>
</choose>
ORDER BY
pictureID DESC
<choose>
<when test="params.sidx!=null and params.sidx!=''">
ORDER BY ${params.sidx} ${params.order},
</when>
<otherwise>
ORDER BY
pictureID DESC
</otherwise>
</choose>
</select>
<select id="selectPictureNewList" resultMap="retailpictureMap" parameterType="io.office.modules.manage.entity.dto.NewsParams">
SELECT *
......
......@@ -63,7 +63,14 @@
AND b.levels > 0
</otherwise>
</choose>
order by b.levels desc,b.releasedate desc
<choose>
<when test="newsParams.sidx!=null and newsParams.sidx!=''">
ORDER BY b.${newsParams.sidx} ${newsParams.order},
</when>
<otherwise>
order by b.levels desc,b.releasedate desc
</otherwise>
</choose>
</select>
......
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