Commit e9339239 by 吴迪

【修改】商品预览

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