一、新建设备表(t_base_device)

SET FOREIGN_KEY_CHECKS=0;

-- ----------------------------
-- Table structure for t_base_device
-- ----------------------------
DROP TABLE IF EXISTS `t_base_device`;
CREATE TABLE `t_base_device` (
`deviceid` int(10) NOT NULL,
`devicecode` varchar(50) DEFAULT NULL,
`devicename` varchar(50) DEFAULT NULL,
`deviceclassno` varchar(10) DEFAULT NULL,
`status` varchar(10) DEFAULT NULL,
`username` varchar(50) DEFAULT NULL,
`userdept` varchar(200) DEFAULT NULL,
PRIMARY KEY (`deviceid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ----------------------------
-- Records of t_base_device
-- ----------------------------
INSERT INTO `t_base_device` VALUES ('', 'STPC201711001', '华硕X550', '', '使用中', '谢红卫', '软件研发部');
INSERT INTO `t_base_device` VALUES ('', 'STPC201711002', '联想T440P', '', '库存', null, null);

二、实体类(BaseDevice.java)

package net.xhw.device.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table; @SuppressWarnings("serial")
@Entity
@Table(name = "t_base_device")
public class BaseDevice implements java.io.Serializable{ private int deviceid;
private String devicecode;
private String devicename;
private String deviceclassno;
private String status;
private String username;
private String userdept; @Id
@Column(name = "deviceid", length = 10)
public int getDeviceid() {
return deviceid;
} @Column(name = "devicecode", length = 50)
public String getDevicecode() {
return devicecode;
} @Column(name = "devicename", length = 50)
public String getDevicename() {
return devicename;
} @Column(name = "deviceclassno", length = 10)
public String getDeviceclassno() {
return deviceclassno;
} @Column(name = "status", length = 10)
public String getStatus() {
return status;
} @Column(name = "username", length = 50)
public String getUsername() {
return username;
} @Column(name = "userdept", length = 200)
public String getUserdept() {
return userdept;
} public void setDeviceid(int deviceid) {
this.deviceid = deviceid;
} public void setDevicecode(String devicecode) {
this.devicecode = devicecode;
} public void setDevicename(String devicename) {
this.devicename = devicename;
} public void setDeviceclassno(String deviceclassno) {
this.deviceclassno = deviceclassno;
} public void setStatus(String status) {
this.status = status;
} public void setUsername(String username) {
this.username = username;
} public void setUserdept(String userdept) {
this.userdept = userdept;
} }

三、action控制类(DeviceController.java)

package net.xhw.device.ctrl;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.jeecgframework.core.common.controller.BaseController;
import org.jeecgframework.core.common.hibernate.qbc.CriteriaQuery;
import org.jeecgframework.core.common.model.json.DataGrid;
import org.jeecgframework.tag.core.easyui.TagUtil;
import org.jeecgframework.web.system.service.SystemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import net.xhw.device.entity.BaseDevice; @Controller
@RequestMapping("/deviceController")
public class DeviceController extends BaseController { private SystemService systemService; @Autowired
public void setSystemService(SystemService systemService) {
this.systemService = systemService;
} @RequestMapping(params = "deviceList")
public ModelAndView deviceList(HttpServletRequest request) {
return new ModelAndView("device/deviceList");
} @RequestMapping(params = "datagrid")
public void datagrid(BaseDevice basedevice, HttpServletRequest request, HttpServletResponse response, DataGrid dataGrid) {
CriteriaQuery cq = new CriteriaQuery(BaseDevice.class, dataGrid);
this.systemService.getDataGridReturn(cq, true);
TagUtil.datagrid(response, dataGrid);
} }

四、页面文件(deviceList.jsp)

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<t:base type="jquery,easyui,tools,DatePicker"></t:base> <t:datagrid name="deviceList" title="设备信息列表" actionUrl="deviceController.do?datagrid"
fit="true" fitColumns="true" idField="deviceid" queryMode="group">
<t:dgCol title="设备ID" field="deviceid" hidden="true"></t:dgCol>
<t:dgCol title="设备编码" field="devicecode" query="false" width="100"></t:dgCol>
<t:dgCol title="设备名称" field="devicename" query="false" width="100"></t:dgCol>
<t:dgCol title="状态" field="status" query="false" width="100"></t:dgCol>
<t:dgCol title="使用人" field="username" query="false" width="100"></t:dgCol>
</t:datagrid>

五、修改配置文件

  1、修改spring-mvc.xml,添加扫描控制类包    

<context:component-scan base-package="org.jeecgframework.web.*,com.jeecg.*,net.xhw.*">
  <context:exclude-filter type="annotation"
  expression="org.springframework.stereotype.Service" />
</context:component-scan>

  2、修改spring-mvc-hibernate.xml,添加注解方式配置

<!-- 注解方式配置 -->
<property name="packagesToScan">
  <list>
  <value>org.jeecgframework.web.system.pojo.*</value>
  <value>org.jeecgframework.web.test.entity.*</value>
    <value>org.jeecgframework.web.autoform.*</value>
    <value>org.jeecgframework.web.cgform.entity.*</value>
    <value>org.jeecgframework.web.cgreport.entity.*</value>
    <value>org.jeecgframework.web.cgdynamgraph.entity.*</value>
    <value>org.jeecgframework.web.graphreport.entity.*</value>
    <value>org.jeecgframework.web.system.sms.*</value>
    <value>com.jeecg.*</value>
    <value>net.xhw.*</value>
</list>
</property>

六、菜单配置及结果

JEECG开发第一个菜单显示设备列表的更多相关文章

  1. wxPython制作跑monkey工具(python3)-带显示设备列表界面

    一. wxPython制作跑monkey工具(python3)-带显示设备列表界面  源代码 Run Monkey.py #!/usr/bin/env python import wx import ...

  2. 解决Genymotion无法创建新设备或无法显示设备列表问题

    准备工作: 链接: https://pan.baidu.com/s/1i5v4IBN 密码: jc3m 用2.8的和最新VirtualBox-5.1.10-112026-Win 注意事项: 1.笔记本 ...

  3. Winform开发主界面菜单的动态树形列表展示

    我在之前很多文章里面,介绍过Winform主界面的开发,基本上都是标准的界面,在顶部放置工具栏,中间区域则放置多文档的内容,但是在顶部菜单比较多的时候,就需要把菜单分为几级处理,如可以在顶部菜单放置一 ...

  4. (android 地图实战开发)2 创建MapActivity,根据设备当前位置,显示地图

    (android 地图实战开发)2 创建MapActivity,根据设备当前位置,显示地图 http://www.cnblogs.com/macroxu-1982/archive/2011/09/13 ...

  5. odoo开发笔记--一个模块显示两个一级菜单

    场景描述: 在已启动开发的模块中,odoo顶部一级菜单只有一个“会员管理”,需求是:在同一级顶部菜单,增加新菜单“产品管理”.举例如图:       处理方式: 按照odoo的机制,实现这种效果,可以 ...

  6. dedecms 列表 用分页标签 判断 当第一页则显示,第二页以上不显示 土办法!

    arc.listview.class.php function GetPageListST($list_len,$listitem="index,end,pre,next,pageno,sp ...

  7. XE7 & IOS开发之开发账号(1):开发证书、AppID、设备、开发授权profile的申请使用,附Debug真机调试演示(XCode所有版本通用,有图有真相)

    网上能找到的关于Delphi XE系列的移动开发的相关文章甚少,本文尽量以详细的图文内容.傻瓜式的表达来告诉你想要的答案. 原创作品,请尊重作者劳动成果,转载请注明出处!!! 注意,以下讨论都是以&q ...

  8. 【React Native开发】React Native应用设备执行(Running)以及调试(Debugging)(3)

    ),React Native技术交流4群(458982758),请不要反复加群.欢迎各位大牛,React Native技术爱好者加入交流!同一时候博客左側欢迎微信扫描关注订阅号,移动技术干货,精彩文章 ...

  9. HoloLens开发手记 - 使用Windows设备控制台 Using Windows Device Portal

    Windows设备控制台允许你通过Wi-Fi或USB来远程控制你的HoloLens设备.设备控制台是HoloLens上的一个Web Server,你可以通过PC的浏览器来连接到它.设备控制台包含了很多 ...

随机推荐

  1. 打开一个网站,加载顺序是什么?先加载HTML然后JS然后CSS?还是什么?

    HTML页面加载和解析流程 : 1. 用户输入网址(假设是个html页面,并且是第一次访问),浏览器向服务器发出请求,服务器返回html文件. 2. 浏览器开始载入html代码,发现<head& ...

  2. AE 打开Shp文件

    using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; usin ...

  3. 微信小程序中的左右联动

    微信小程序端的左右联动-滚动效果插件: 效果图如下:                                                                          ...

  4. detach() 使用和.detach()和.data的区别 、cpu()函数的作用

    detach() 使用和.detach()和.data的区别 .cpu()函数的作用 待办 detach使用 https://blog.csdn.net/qq_27825451/article/det ...

  5. EF CodeFirst 一对一、一对多、多对多关系

    一对一关系 如图,无需专门指定,系统会默认在Person表中生成字段Pet_Id为Pet表的外键(一对一). Require:必要的(一对一)  Optional:可选的(一对零)  Principa ...

  6. EF的预先加载--Eager Loading

    预先加载 在对一种类型的实体进行查询时,将相关的实体作为查询的一部分一起加载.预先加载可以使用Include()方法实现. 在此需要说明的是:EF中有两种表关联的方法,一种是Join()方法,一种是I ...

  7. jsp中 EL表达式 ${}

    原文位置:https://zhidao.baidu.com/question/711232806155434565.html jsp标签中的 ${表达式}用来输出或者计算一个表达式的内容,比如${3+ ...

  8. Mysql高级操作

    多数据插入 insert into 表名 [(字段名)] values(值列表1),(值列表2),... 主键冲突 主键冲突更新 主键冲突时,更新数据 insert into 表名 [(字段列表)] ...

  9. 滑动窗口-洛谷T1866(单调队列)

    咕咕咕 单调队列板子题 一.基本 1.单调队列: 特殊的双端队列,内部元素.分为最大队列(单调递增)和最小队列(单调递减)两种 二.应用 本题中:大部分单调队列优化的动态规划问题都和定长连续子区间的最 ...

  10. 第三十四篇 玩转数据结构——哈希表(HashTable)

    1.. 整型哈希函数的设计 小范围正整数直接使用 小范围负整数整体进行偏移 大整数,通常做法是"模一个素数"   2.. 浮点型哈希函数的设计 转成整型进行处理   3.. 字符串 ...