开发工具:eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
<title>个人信息</title>
</head>
<!-- private String userName;//如果是用户 就是用户名 如果是社团就是社团名称
private String passWord;
private String nickName;
private String code;//学号
private String zy;//专业
private String nj;//年级
private Integer isDelete;//是否删除 0否 1 是
private Integer type;// 1老师 2 社团3.用户
private Integer roleId;
private String phone; -->
<body>
<form method="post" action="${ctx}/user/findByMap.do?type=3" id="listform">
<div class="panel admin-panel">
<div class="panel-head"><strong class="icon-reorder">用户列表</strong></div>
<div class="padding border-bottom">
<ul class="search">
<li>
<a class="button border-main icon-plus-square-o" href="${ctx }/user/add.do?type=3"> 添加</a>
</li>
}
if(!isEmpty(user.getType())){
params.put("type", user.getType());
}
//分页查询
Pager<User> pagers = userService.findByMap("findByNickName", params);
model.addAttribute("pagers", pagers);
//存储查询条件
model.addAttribute("obj", user);
if(user.getType() == 1){
return "user/user1";
}
if(user.getType() == 2){
return "user/user2";
}
return jsonObject.toString();
}
/**
* 单文件上传
* @param file
* @param request
* @param model
* @return
*/
@RequestMapping(value = "/saveFile")
public String saveFile(@RequestParam(value = "file", required = false) MultipartFile file, HttpServletRequest request, Model model) {
System.out.println("开始");
String path = request.getSession().getServletContext().getRealPath("/upload");
String fileName = file.getOriginalFilename();
System.out.println(path);
File targetFile = new File(path, fileName);
if(!targetFile.exists()){
targetFile.mkdirs();
}
return "";
}
// --------------------------------------- 华丽分割线 ------------------------------
}
package com.demo.controller;
import java.io.File;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.demo.entity.Notice;
import com.demo.service.GzService;
import com.demo.service.NoticeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.commons.CommonsMultipartFile;
var map = new BMap.Map("container"),marker,point,styleStr;
map.enableScrollWheelZoom();
map.enableContinuousZoom();
function doSearch(){
if (!document.getElementById('city').value) {
alert(lang.cityMsg);
return;
}
var search = new BMap.LocalSearch(document.getElementById('city').value, {
onSearchComplete: function (results){
if (results && results.getNumPois()) {
var points = [];
for (var i=0; i<results.getCurrentNumPois(); i++) {
points.push(results.getPoi(i).point);
}
if (points.length > 1) {
map.setViewport(points);
} else {
map.centerAndZoom(points[0], 13);
}
point = map.getCenter();
marker.setPoint(point);
<include refid="User_where" />
order by id desc limit #{pageOffset},#{pageSize}
</select>
<!--
1.方法描述:查询分页 非插件 总数 自定义
2.参数:map
-->
<select id="findBySqlId_count" resultMap="ResultMapUser" parameterType="map">
select count(*)
from user where 1=1
<include refid="User_where" />
</select>
<!--
1.方法描述:批量插入
2.参数:集合/数组
-->
<insert id="insertBatch" parameterType="java.util.List">
INSERT INTO user (
<include refid="User_field" />
) VALUES
<foreach collection="list" item="item" index="index"
separator=",">
(
#{item.id},
paramMap = (Map) parameterObject;
} else {
paramMap = new HashMap();
//动态sql时的判断条件不会出现在ParameterMapping中,但是必须有,所以这里需要收集所有的getter属性
//TypeHandlerRegistry可以直接处理的会作为一个直接使用的对象进行处理
boolean hasTypeHandler = ms.getConfiguration().getTypeHandlerRegistry().hasTypeHandler(parameterObject.getClass());
MetaObject metaObject = forObject(parameterObject);
//需要针对注解形式的MyProviderSqlSource保存原值
if (ms.getSqlSource() instanceof MyProviderSqlSource) {
paramMap.put(PROVIDER_OBJECT, parameterObject);
}
if (!hasTypeHandler) {
for (String name : metaObject.getGetterNames()) {
paramMap.put(name, metaObject.getValue(name));
}
}
order by id desc
</select>
<!--
1.方法描述:查询分页(自定义)
2.参数:map
-->
<select id="findByMapSqlId" resultMap="ResultMapSchoolInfo" parameterType="map">
select <include refid="SchoolInfo_field" />
from school_info where 1=1
<include refid="SchoolInfo_where" />
order by id desc
</select>
<!--
1.方法描述:查询分页 非插件
2.参数:map
-->
<select id="find" resultMap="ResultMapSchoolInfo" parameterType="map">
select <include refid="SchoolInfo_field" />
from school_info where 1=1
<include refid="SchoolInfo_where" />
order by id desc limit #{pageOffset},#{pageSize}
</select>
<!--
private Integer roleId;
private String phone; -->
<body>
<form method="post" action="${ctx}/user/findByMap.do?type=3" id="listform">
<div class="panel admin-panel">
<div class="panel-head"><strong class="icon-reorder">用户列表</strong></div>
<div class="padding border-bottom">
<ul class="search">
<li>
<a class="button border-main icon-plus-square-o" href="${ctx }/user/add.do?type=3"> 添加</a>
</li>
<li>
<input type="text" placeholder="请输入名称" name="nickName" value="${obj.nickName}" class="input" style="width:250px; line-height:17px;display:inline-block" />
<a href="javascript:void(0)" class="button border-main icon-search" onclick="changesearch()" > 搜索</a>
</li>
</ul>
</div>
<table class="table table-hover text-center">
<tr>
<th width="100" style="text-align:left; padding-left:20px;">ID</th>
<th width="">名称</th>
<th width="">昵称</th>
</sql>
<!-- 以下是sql执行语句
注意:1)参数类型和返回值类型,通用查询 xxBySqlId 注意将默认的 id修改为方法需要的。
2)非自定义的方法已经是basedao注明的。方法名一定要和id相同
3)自定义类的方法注意是否和共有方法重名id
4)执行sql出现顺序和baseDao方法一致,便于查询请勿随意添加,自定义的sql一律放在自定义sql区域
-->
<!--
1.方法描述:新增数据
2.参数:实体类
3.返回:主键
-->
<insert id="insert" parameterType="com.demo.entity.SchoolInfo" useGeneratedKeys="true" keyProperty="id">
INSERT INTO school_info (
<include refid="SchoolInfo_field" />
) VALUES (
运行环境
Java≥8、Tomcat≥7.0、MySQL≥5.7
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
技术框架
JavaBean MVC JSP SSM(Spring SpringMVC MyBatis) MySQL jQuery JavaScript CSS…
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
分为前台和后台
前台校园门户网站信息查看:学生
后台内容管理:管理员、教师、社团(角色不同,权限菜单不同)
前台
后台