一、新建设备表(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. SpringBoot学习- 7、问题Could not autowire. No beans of 'xxxx' type found处理

    SpringBoot学习足迹 这个问题网上有好多同学都提到这个问题,代码可以运行,但是就是有红线,强迫症不能忍 自己试验下 1.增加一个final编译一下,再删掉就不会出红线了 public clas ...

  2. opencv3.2.0+opencv_contrib-3.2.0+vs2015相关文件的配置

    包含目录:E:\opencvcontrib\opencv\sources\build\install\include\opencv E:\opencvcontrib\opencv\sources\bu ...

  3. PHP csv文件30w+数据导入mysql数据库

    <?php class Add { public function data() { ini_set('memory_limit', '-1'); //PHP内存设置 $handle=fopen ...

  4. 09 部署nginx web服务器(转发uwsgi请求)

    1 配置nginx转发 $ whereis nginx $ cd /usr/local/nginx/conf $ vi nginx.conf 注释掉原来的html请求,增加uwsgi请求. locat ...

  5. 洛谷P1583 魔法照片

    https://www.luogu.org/problem/P1583 话不多说,其实就是模拟,然后,各种繁琐 #include<bits/stdc++.h> using namespac ...

  6. Keep-Alive 以及服务器心跳

    Keep-Alive 来源 :http://www.nowamagic.net/academy/detail/23350305 服务器心跳  来源 :http://www.cnblogs.com/lw ...

  7. 生成器和迭代器_python

    一.生成器简介(generator) 在进行较大数据的存储,如果直接存储在列表之中,则会可能造成内存的不够与速度的减慢,因为列表创建完是立即创建并存在的,而在python中生成器(generator) ...

  8. 题解【AcWing178】第K短路

    题面 经典的 \(\text{A*}\) 算法例题. 我们可以把估价函数 \(f(i)\) 设置成当前点 \(i\) 到终点 \(t\) 的最短距离,这可以建反图使用 \(\text{Dijkstra ...

  9. 微信公众号h5页面alert去掉域名

    h5页面内嵌到微信公众号提示信息alert的时候会显示域名,去掉域名显示重写alert方法: window.alert = function(name){ var iframe = document. ...

  10. Mike and strings

    Mike has n strings s1, s2, ..., sn each consisting of lowercase English letters. In one move he can ...