Compare commits
2 Commits
8159ffc509
...
ylc
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1830bb64ea | ||
|
|
0dc10a669f |
@@ -1,8 +1,13 @@
|
|||||||
package com.cnbm.basic.mapper;
|
package com.cnbm.basic.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
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;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 产品类型 表
|
* 产品类型 表
|
||||||
@@ -12,5 +17,5 @@ import org.apache.ibatis.annotations.Mapper;
|
|||||||
*/
|
*/
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface ProductTypeMapper extends BaseDao<ProductType> {
|
public interface ProductTypeMapper extends BaseDao<ProductType> {
|
||||||
|
IPage<ProductTypeDTO> page(IPage<ProductType> objectPage, @Param("param") Map<String, Object> params);
|
||||||
}
|
}
|
||||||
@@ -1,9 +1,12 @@
|
|||||||
package com.cnbm.basic.service;
|
package com.cnbm.basic.service;
|
||||||
|
|
||||||
|
import com.cnbm.common.page.PageData;
|
||||||
import com.cnbm.common.service.CrudService;
|
import com.cnbm.common.service.CrudService;
|
||||||
import com.cnbm.basic.dto.ProductTypeDTO;
|
import com.cnbm.basic.dto.ProductTypeDTO;
|
||||||
import com.cnbm.basic.entity.ProductType;
|
import com.cnbm.basic.entity.ProductType;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 产品类型 表
|
* 产品类型 表
|
||||||
*
|
*
|
||||||
@@ -11,5 +14,5 @@ import com.cnbm.basic.entity.ProductType;
|
|||||||
* @since 2022-06-30
|
* @since 2022-06-30
|
||||||
*/
|
*/
|
||||||
public interface IProductTypeService extends CrudService<ProductType, ProductTypeDTO> {
|
public interface IProductTypeService extends CrudService<ProductType, ProductTypeDTO> {
|
||||||
|
PageData<ProductTypeDTO> page (Map<String, Object> params);
|
||||||
}
|
}
|
||||||
@@ -1,12 +1,17 @@
|
|||||||
package com.cnbm.basic.service.impl;
|
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.extension.plugins.pagination.Page;
|
||||||
|
import com.cnbm.common.constant.Constant;
|
||||||
|
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;
|
||||||
import com.cnbm.basic.entity.ProductType;
|
import com.cnbm.basic.entity.ProductType;
|
||||||
import com.cnbm.basic.mapper.ProductTypeMapper;
|
import com.cnbm.basic.mapper.ProductTypeMapper;
|
||||||
import com.cnbm.basic.service.IProductTypeService;
|
import com.cnbm.basic.service.IProductTypeService;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -20,6 +25,10 @@ import java.util.Map;
|
|||||||
@Service
|
@Service
|
||||||
public class ProductTypeServiceImpl extends CrudServiceImpl<ProductTypeMapper, ProductType, ProductTypeDTO> implements IProductTypeService {
|
public class ProductTypeServiceImpl extends CrudServiceImpl<ProductTypeMapper, ProductType, ProductTypeDTO> implements IProductTypeService {
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ProductTypeMapper productTypeMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public QueryWrapper<ProductType> getWrapper(Map<String, Object> params){
|
public QueryWrapper<ProductType> getWrapper(Map<String, Object> params){
|
||||||
String id = (String)params.get("id");
|
String id = (String)params.get("id");
|
||||||
@@ -30,5 +39,12 @@ public class ProductTypeServiceImpl extends CrudServiceImpl<ProductTypeMapper, P
|
|||||||
return wrapper;
|
return wrapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageData<ProductTypeDTO> page (Map<String, Object> params){
|
||||||
|
QueryWrapper<ProductTypeDTO> wrapper = new QueryWrapper<>();
|
||||||
|
wrapper.eq("id",params.get("id"));
|
||||||
|
IPage<ProductTypeDTO> page = productTypeMapper.page(getPage(params, Constant.CREATE_DATE, false), params);
|
||||||
|
return getPageData(page,ProductTypeDTO.class);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
12
ym-baisc/src/main/resources/ProductTypeMapper.xml
Normal file
12
ym-baisc/src/main/resources/ProductTypeMapper.xml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.cnbm.basic.mapper.ProductTypeMapper">
|
||||||
|
|
||||||
|
<select id="page" resultType="com.cnbm.basic.dto.ProductTypeDTO">
|
||||||
|
select *
|
||||||
|
from product_type
|
||||||
|
<where>
|
||||||
|
id = #{id)}
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
Reference in New Issue
Block a user