yanyang #2

Merged
CaiXiang merged 5 commits from yanyang into master 2022-07-20 15:58:38 +08:00
3 changed files with 5 additions and 6 deletions
Showing only changes of commit 1830bb64ea - Show all commits

View File

@ -1,7 +1,6 @@
package com.cnbm.basic.mapper; package com.cnbm.basic.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cnbm.basic.dto.ProductTypeDTO; import com.cnbm.basic.dto.ProductTypeDTO;
import com.cnbm.common.dao.BaseDao; import com.cnbm.common.dao.BaseDao;
import com.cnbm.basic.entity.ProductType; import com.cnbm.basic.entity.ProductType;
@ -18,5 +17,5 @@ import java.util.Map;
*/ */
@Mapper @Mapper
public interface ProductTypeMapper extends BaseDao<ProductType> { public interface ProductTypeMapper extends BaseDao<ProductType> {
IPage<ProductTypeDTO> page(Page<Object> objectPage, @Param("param") Map<String, Object> params); IPage<ProductTypeDTO> page(IPage<ProductType> objectPage, @Param("param") Map<String, Object> params);
} }

View File

@ -3,6 +3,7 @@ package com.cnbm.basic.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cnbm.common.constant.Constant;
import com.cnbm.common.page.PageData; import com.cnbm.common.page.PageData;
import com.cnbm.common.service.impl.CrudServiceImpl; import com.cnbm.common.service.impl.CrudServiceImpl;
import com.cnbm.basic.dto.ProductTypeDTO; import com.cnbm.basic.dto.ProductTypeDTO;
@ -40,11 +41,10 @@ public class ProductTypeServiceImpl extends CrudServiceImpl<ProductTypeMapper, P
@Override @Override
public PageData<ProductTypeDTO> page (Map<String, Object> params){ public PageData<ProductTypeDTO> page (Map<String, Object> params){
PageData<ProductTypeDTO> data = null;
QueryWrapper<ProductTypeDTO> wrapper = new QueryWrapper<>(); QueryWrapper<ProductTypeDTO> wrapper = new QueryWrapper<>();
wrapper.eq("id",params.get("id")); wrapper.eq("id",params.get("id"));
IPage<ProductTypeDTO> page = productTypeMapper.page(new Page<>((Long) params.get("current"),(Long)params.get("size")), params); IPage<ProductTypeDTO> page = productTypeMapper.page(getPage(params, Constant.CREATE_DATE, false), params);
return data; return getPageData(page,ProductTypeDTO.class);
} }
} }

View File

@ -6,7 +6,7 @@
select * select *
from product_type from product_type
<where> <where>
id = #{params.get("id")} id = #{id)}
</where> </where>
</select> </select>
</mapper> </mapper>