Commit e9339239 by 吴迪

【修改】商品预览

parent 69ee1a6c
......@@ -120,7 +120,7 @@ public class ProductController extends AbstractController {
public R findPage(@RequestBody Map<String,String> param){
Page<ProductEntity> pag = this.productService.findPage(
new Page(Integer.valueOf(param.get("page")),
Integer.valueOf(param.get("size"))));
Integer.valueOf(param.get("size"))),param.get("id"));
PageUtils pageUtils = new PageUtils(pag);
return R.ok().put("page", pageUtils);
}
......
......@@ -19,5 +19,5 @@ import java.util.Map;
public interface ProductDao extends BaseMapper<ProductEntity> {
List<ProductEntity> selectProductList(@Param("params") Map<String, Object> params, Page page);
List<ProductEntity> findPage(Page page);
List<ProductEntity> findPage(Page page,@Param("id") Object id);
}
......@@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
......
......@@ -28,6 +28,6 @@ public interface ProductService extends IService<ProductEntity> {
Page<ProductEntity> selectProductList(Map<String, Object> params, Page page);
Page<ProductEntity> findPage(Page page);
Page<ProductEntity> findPage(Page page,Object id);
}
......@@ -81,8 +81,8 @@ public class ProductServiceImpl extends ServiceImpl<ProductDao, ProductEntity> i
}
@Override
public Page<ProductEntity> findPage(Page page) {
List<ProductEntity> list =this.productDao.findPage(page);
public Page<ProductEntity> findPage(Page page,Object id) {
List<ProductEntity> list =this.productDao.findPage(page,id);
page.setRecords(list);
return page;
}
......
......@@ -57,7 +57,11 @@
</if>
order by a.id desc
</select>
<select id="findPage" resultType="io.office.modules.manage.entity.ProductEntity">
select * from product where levels > 0 and categoryid=1 ORDER BY levels DESC, adddate DESC
<select id="findPage" resultType="io.office.modules.manage.entity.ProductEntity" parameterType="string">
select * from product where levels > 0 and categoryid=1
<if test="">
and id =#{id}
</if>>
ORDER BY levels DESC, adddate DESC
</select>
</mapper>
\ No newline at end of file
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