栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

java网上图书商城(2)Category模块

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

java网上图书商城(2)Category模块

本文实例为大家分享了java网上图书商城Category模块代码,供大家参考,具体内容如下

sql

CREATE TABLE `t_category` (
 `cid` char(32) NOT NULL,
 `cname` varchar(50) DEFAULT NULL,
 `pid` char(32) DEFAULT NULL,
 `desc` varchar(100) DEFAULT NULL,
 `orderBy` int(11) NOT NULL AUTO_INCREMENT,
 PRIMARY KEY (`cid`),
 UNIQUE KEY `cname` (`cname`),
 KEY `FK_t_category_t_category` (`pid`),
 KEY `orderBy` (`orderBy`),
 ConSTRAINT `FK_t_category_t_category` FOREIGN KEY (`pid`) REFERENCES `t_category` (`cid`)
) ENGINE=InnoDB AUTO_INCREMENT=48 DEFAULT CHARSET=utf8; 

Dao

public List findAll() throws SQLException {
 
 String sql = "select * from t_category where pid is null order by orderBy";
 List> mapList = qr.query(sql, new MapListHandler());
  
 List parents = toCategoryList(mapList);
  
 
 for(Category parent : parents) {
  // 查询出当前父分类的所有子分类
  List children = findByParent(parent.getCid());
  // 设置给父分类
  parent.setChildren(children);
 }
 return parents;
}

left.jsp

Q6MenuBar组件显示手风琴式下拉菜单


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持考高分网。

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/148494.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号