Commit 3a7fd0a4 by rongkailun

【修改】提供商管理修改传参方式

parent 9c6088da
......@@ -8,6 +8,7 @@ import java.util.Map;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.office.modules.app.annotation.Login;
import io.office.modules.manage.entity.ProductEntity;
import io.office.modules.manage.entity.dto.NewsParams;
import io.office.modules.sys.controller.AbstractController;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
......@@ -38,12 +39,11 @@ public class PartnersController extends AbstractController {
/**
* 列表
*/
@RequestMapping("/list")
@PostMapping("/list")
// @RequiresPermissions("manage:partners:list")
public R list(@RequestParam Map<String, Object> params){
Page<PartnersEntity> page = this.partnersService.selectPartnersList(params,
new Page(Integer.valueOf(params.get("page").toString()),
Integer.valueOf(params.get("limit").toString())));
public R list(@RequestBody NewsParams newsParams){
Page<PartnersEntity> page = this.partnersService.selectPartnersList(newsParams,
new Page(newsParams.getPage(), newsParams.getLimit()));
PageUtils pageUtils = new PageUtils(page);
return R.ok().put("page", pageUtils);
}
......
......@@ -3,6 +3,7 @@ package io.office.modules.manage.dao;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.office.modules.manage.entity.PartnersEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import io.office.modules.manage.entity.dto.NewsParams;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
......@@ -20,7 +21,7 @@ import java.util.Map;
@Mapper
public interface PartnersDao extends BaseMapper<PartnersEntity> {
List<PartnersEntity> selectPartnersList(@Param("params") Map<String, Object> params, Page page);
List<PartnersEntity> selectPartnersList(@Param("newsParams") NewsParams params, Page page);
@Select("select * from Partners where status=#{status} and levels>#{levels} order by id desc")
List<PartnersEntity> selectByStatusAndLevels(@Param("status")String status, @Param("levels")String levels);
......
......@@ -34,4 +34,8 @@ public class NewsParams extends PageParams {
private String type;
private List list;
private String firmname;
private String technology;
private String service;
}
......@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import io.office.common.utils.PageUtils;
import io.office.common.utils.R;
import io.office.modules.manage.entity.PartnersEntity;
import io.office.modules.manage.entity.dto.NewsParams;
import io.office.modules.sys.entity.SysUserEntity;
import java.util.List;
......@@ -23,7 +24,7 @@ public interface PartnersService extends IService<PartnersEntity> {
R deletePartners(List<Long> ids, SysUserEntity user);
Page<PartnersEntity> selectPartnersList(Map<String, Object> params, Page page);
Page<PartnersEntity> selectPartnersList(NewsParams params, Page page);
R verifyPartners(PartnersEntity partnersEntity, SysUserEntity user);
......
......@@ -3,6 +3,7 @@ package io.office.modules.manage.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.office.common.utils.R;
import io.office.modules.manage.entity.CasesEntity;
import io.office.modules.manage.entity.dto.NewsParams;
import io.office.modules.sys.entity.SysUserEntity;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -56,7 +57,7 @@ public class PartnersServiceImpl extends ServiceImpl<PartnersDao, PartnersEntity
}
@Override
public Page<PartnersEntity> selectPartnersList(Map<String, Object> params, Page page) {
public Page<PartnersEntity> selectPartnersList(NewsParams params, Page page) {
List<PartnersEntity> list = this.partnersDao.selectPartnersList(params,page);
page.setRecords(list);
return page;
......
......@@ -25,39 +25,36 @@
<result property="checkdate" column="checkdate"/>
</resultMap>
<select id="selectPartnersList" resultMap="partnersMap" parameterType="java.util.Map">
<select id="selectPartnersList" resultMap="partnersMap">
select * from Partners where 1=1
<choose>
<when test="params.levels == 0">
AND levels = #{params.levels}
<when test="newsParams.levels !=null">
AND levels = #{newsParams.levels}
</when>
<otherwise>
AND levels > 0
</otherwise>
</choose>
<if test="params.firmname !=null and params.firmname !=''">
and firmname like concat('%',#{params.firmname},'%')
<if test="newsParams.firmname !=null and newsParams.firmname !=''">
and firmname like concat('%',#{newsParams.firmname},'%')
</if>
<if test="params.editor !=null and params.editor !=''">
and editor = #{params.editor}
<if test="newsParams.editor !=null and newsParams.editor !=''">
and editor = #{newsParams.editor}
</if>
<if test="params.status !=null and params.status !=''">
and status = #{params.status}
<if test="newsParams.status !=null and newsParams.status !=''">
and status = #{newsParams.status}
</if>
<if test="params.technology !=null and params.technology !=''">
and technology = #{params.technology}
<if test="newsParams.technology !=null and newsParams.technology !=''">
and technology = #{newsParams.technology}
</if>
<if test="params.service !=null and params.service !=''">
and service = #{params.service}
<if test="newsParams.service !=null and newsParams.service !=''">
and service = #{newsParams.service}
</if>
<if test="params.levels != null">
and levels = #{params.levels}
<if test="newsParams.releaseTimeStart !=null and newsParams.releaseTimeEnd !=null">
and registerdate BETWEEN #{newsParams.releaseTimeStart} AND #{newsParams.releaseTimeEnd}
</if>
<if test="params.releaseTimeStart !=null and params.releaseTimeEnd !=null">
and registerdate BETWEEN #{params.releaseTimeStart} AND #{params.releaseTimeEnd}
</if>
<if test="params.updateTimeStart !=null and params.updateTimeEnd !=null">
and updatedate BETWEEN #{params.updateTimeStart} AND #{params.updateTimeEnd}
<if test="newsParams.updateTimeStart !=null and newsParams.updateTimeEnd !=null">
and updatedate BETWEEN #{newsParams.updateTimeStart} AND #{newsParams.updateTimeEnd}
</if>
order by id desc
</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