diff --git a/ym-baisc/src/main/java/com/cnbm/basic/mapper/ProductTypeMapper.java b/ym-baisc/src/main/java/com/cnbm/basic/mapper/ProductTypeMapper.java index 9248037..66832f2 100644 --- a/ym-baisc/src/main/java/com/cnbm/basic/mapper/ProductTypeMapper.java +++ b/ym-baisc/src/main/java/com/cnbm/basic/mapper/ProductTypeMapper.java @@ -1,8 +1,14 @@ package com.cnbm.basic.mapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.cnbm.basic.dto.ProductTypeDTO; import com.cnbm.common.dao.BaseDao; import com.cnbm.basic.entity.ProductType; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.Map; /** * 产品类型 表 @@ -12,5 +18,5 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface ProductTypeMapper extends BaseDao { - + IPage page(Page objectPage, @Param("param") Map params); } \ No newline at end of file diff --git a/ym-baisc/src/main/java/com/cnbm/basic/service/IProductTypeService.java b/ym-baisc/src/main/java/com/cnbm/basic/service/IProductTypeService.java index dcd5add..8530388 100644 --- a/ym-baisc/src/main/java/com/cnbm/basic/service/IProductTypeService.java +++ b/ym-baisc/src/main/java/com/cnbm/basic/service/IProductTypeService.java @@ -1,9 +1,12 @@ package com.cnbm.basic.service; +import com.cnbm.common.page.PageData; import com.cnbm.common.service.CrudService; import com.cnbm.basic.dto.ProductTypeDTO; import com.cnbm.basic.entity.ProductType; +import java.util.Map; + /** * 产品类型 表 * @@ -11,5 +14,5 @@ import com.cnbm.basic.entity.ProductType; * @since 2022-06-30 */ public interface IProductTypeService extends CrudService { - + PageData page (Map params); } \ No newline at end of file diff --git a/ym-baisc/src/main/java/com/cnbm/basic/service/impl/ProductTypeServiceImpl.java b/ym-baisc/src/main/java/com/cnbm/basic/service/impl/ProductTypeServiceImpl.java index f552426..ee04f68 100644 --- a/ym-baisc/src/main/java/com/cnbm/basic/service/impl/ProductTypeServiceImpl.java +++ b/ym-baisc/src/main/java/com/cnbm/basic/service/impl/ProductTypeServiceImpl.java @@ -1,12 +1,16 @@ package com.cnbm.basic.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.cnbm.common.page.PageData; import com.cnbm.common.service.impl.CrudServiceImpl; import com.cnbm.basic.dto.ProductTypeDTO; import com.cnbm.basic.entity.ProductType; import com.cnbm.basic.mapper.ProductTypeMapper; import com.cnbm.basic.service.IProductTypeService; import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.Map; @@ -20,6 +24,10 @@ import java.util.Map; @Service public class ProductTypeServiceImpl extends CrudServiceImpl implements IProductTypeService { + + @Autowired + private ProductTypeMapper productTypeMapper; + @Override public QueryWrapper getWrapper(Map params){ String id = (String)params.get("id"); @@ -30,5 +38,13 @@ public class ProductTypeServiceImpl extends CrudServiceImpl page (Map params){ + PageData data = null; + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("id",params.get("id")); + IPage page = productTypeMapper.page(new Page<>((Long) params.get("current"),(Long)params.get("size")), params); + return data; + } } \ No newline at end of file diff --git a/ym-baisc/src/main/resources/ProductTypeMapper.xml b/ym-baisc/src/main/resources/ProductTypeMapper.xml new file mode 100644 index 0000000..515981f --- /dev/null +++ b/ym-baisc/src/main/resources/ProductTypeMapper.xml @@ -0,0 +1,12 @@ + + + + + +