Commit 3a7fd0a4 by rongkailun

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

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