基于javaweb+jsp的药店医药信息管理系统(JavaWeb JSP MySQL Servlet SSM SpringBoot Bootstrap)
JavaWeb JavaBean JSP MVC MySQL Tomcat JavaScript Bootstrap
基础JSP+Servlet或JSP+SSM(Spring、SpringMVC、MyBatis)框架或JSP+SSM+Maven(pom.xml)框架或SpringBoot…均可
开发工具:eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
</update>
<!--获取-->
<select id="findById" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" /> FROM `t_notice` WHERE `id` = #{id}
</select>
<!--列表-->
<select id="findAllSplit" parameterType="java.util.Map" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" /> FROM `t_notice`
<where>
<if test="searchColumn != null and searchColumn != '' and keyword != null and keyword != ''">
${searchColumn} LIKE CONCAT('%',#{keyword},'%') AND
</if>
1=1
</where>
ORDER BY id ASC
<if test="startIndex != null and pageSize != null">
LIMIT #{startIndex},#{pageSize};
<update id="doUpdate" parameterType="com.demo.vo.Income">
UPDATE `t_income`
<set>
<if test ='id != null'>`id` = #{id},</if>
<if test ='incomeName != null'>`income_name` = #{incomeName},</if>
<if test ='incomeType != null'>`income_type` = #{incomeType},</if>
<if test ='incomeCount != null'>`income_count` = #{incomeCount},</if>
<if test ='incomeUnit != null'>`income_unit` = #{incomeUnit},</if>
<if test ='incomeInprice != null'>`income_inprice` = #{incomeInprice},</if>
<if test ='incomeIntime != null'>`income_intime` = #{incomeIntime},</if>
<if test ='incomeText != null'>`income_text` = #{incomeText}</if>
</set>
WHERE `id` = #{id}
</update>
<!--获取-->
<select id="findById" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" /> FROM `t_income` WHERE `id` = #{id}
</select>
<!--列表-->
<select id="findAllSplit" parameterType="java.util.Map" resultMap="BaseResultMap">
/**
* 根据条件查询进货的列表并跳转回页面
*
* @param response
* @param request
* @throws IOException
*/
@RequestMapping("incomeList")
public void list(HttpServletResponse response, HttpServletRequest request) throws IOException {
this.redirectList(request, response);
}
/**
* 跳转到列表页面
*
* @param request
this.redirectList(request, response);
}
/**
* 跳转到列表页面
*
* @param request
* @param response
*/
private void redirectList(HttpServletRequest request, HttpServletResponse response) throws IOException {
//查询列和关键字
String searchColumn = Util.decode(request, "searchColumn");
String keyword = Util.decode(request, "keyword");
Map<String, Object> params = new HashMap();//用来保存控制层传进来的参数(查询条件)
params.put("searchColumn", searchColumn);//要查询的列
params.put("keyword", keyword);//查询的关键字
Map<String, Object> map = userService.list(params);
request.getSession().setAttribute("list", map.get("list"));
<div class="col-sm-5">
<input name="userSex" type="radio" value="男" ${vo.userSex=='男'?'checked':''}/> 男
<input name="userSex" type="radio" value="女" ${vo.userSex=='女'?'checked':''}/> 女
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">手机:</label>
<div class="col-sm-5">
<input type="text" class="form-control" id="userPhone" name="userPhone" value="${vo.userPhone}">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">备注:</label>
<div class="col-sm-5">
<textarea rows="3" class="form-control" id="userText" name="userText" placeholder="请输入内容......">${vo.userText}</textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">类型:</label>
<div class="col-sm-5">
<input <c:if test="${loginUser.userType != '管理员'}">disabled="disabled" title="没有权限!!!"</c:if> name="userType" type="radio" value="管理员" ${vo.userType=='管理员'?'checked':''}/> 管理员
<input name="userType" type="radio" value="普通用户" ${vo.userType=='普通用户'?'checked':''}/> 普通用户
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label"></label>
<div class="col-sm-5">
return false;
}
if (document.getElementById("medicineAvliabledate").value.trim().length == 0) {
alert("保质期不能为空!");
return false;
}
if (document.getElementById("medicineProducer").value.trim().length == 0) {
alert("生产商不能为空!");
return false;
}
return true;
}
</script>
</html>
<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>用户编辑</title>
<%@ include file="include/head.jsp" %>
</head>
<body>
if (document.getElementById("employeeNo").value.trim().length == 0) {
alert("工号不能为空!");
return false;
}
if (document.getElementById("employeeAge").value.trim().length == 0) {
alert("年龄不能为空!");
return false;
}
if (document.getElementById("employeePhone").value.trim().length == 0) {
alert("联系号码不能为空!");
return false;
}
if (document.getElementById("employeeIdno").value.trim().length == 0) {
alert("身份证不能为空!");
return false;
}
if (document.getElementById("employeePosition").value.trim().length == 0) {
alert("职位不能为空!");
return false;
}
if (document.getElementById("employeeIntime").value.trim().length == 0) {
alert("入职时间不能为空!");
params.put("searchColumn", searchColumn);//要查询的列
params.put("keyword", keyword);//查询的关键字
Map<String, Object> map = noticeService.list(params);
request.getSession().setAttribute("list", map.get("list"));
Integer totalRecord = (Integer) map.get("totalCount");//根据查询条件取出对应的总记录数,用于分页
String pageNum = Util.decode(request, "pageNum");//封装分页参数
com.demo.util.PageBean<Object> pb = new com.demo.util.PageBean(Integer.valueOf(pageNum != null ? pageNum : "1"), totalRecord);
params.put("startIndex", pb.getStartIndex());
params.put("pageSize", pb.getPageSize());
List list = (List) noticeService.list(params).get("list");//根据分页参数startIndex、pageSize查询出来的最终结果list
pb.setServlet("noticeList");
pb.setSearchColumn(searchColumn);
pb.setKeyword(keyword);
vo.setMedicineNo(Util.decode(request, "medicineNo"));
vo.setMedicinePrice(Util.decode(request, "medicinePrice"));
vo.setMedicineProducedate(Util.decode(request, "medicineProducedate"));
vo.setMedicineAvliabledate(Util.decode(request, "medicineAvliabledate"));
vo.setMedicineProducer(Util.decode(request, "medicineProducer"));
vo.setMedicineText(Util.decode(request, "medicineText"));
medicineService.update(vo);
this.redirectList(request, response);
}
/**
* 获取药品的详细信息(详情页面与编辑页面要显示该药品的详情)并跳转回页面
*
* @param response
* @param request
* @throws IOException
*/
@RequestMapping({"medicineGet", "medicineEditPre"})
public void get(HttpServletResponse response, HttpServletRequest request) throws IOException {
Serializable id = Util.decode(request, "id");//取出主键id
Medicine vo = medicineService.get(id);
request.getSession().setAttribute("vo", vo);
private String keyword;//待模糊查询的关键字
//通过pageNum,pageSize,totalRecord计算得来tatalPage和startIndex,构造方法中将pageNum,pageSize,totalRecord获得
public PageBean(int pageNum, int totalRecord) {
this.pageNum = (pageNum = Math.max(pageNum, 1));
this.pageSize = 10;//默认为10
this.totalRecord = totalRecord;
//totalPage 总页数
if (totalRecord % pageSize == 0) {
//说明整除,正好每页显示pageSize条数据,没有多余一页要显示少于pageSize条数据的
this.totalPage = totalRecord / pageSize;
} else {
//不整除,就要在加一页,来显示多余的数据。
this.totalPage = totalRecord / pageSize + 1;
}
//开始索引
this.startIndex = (pageNum - 1) * pageSize;
//显示5页,这里自己可以设置,想显示几页就自己通过下面算法修改
this.start = 1;
this.end = 5;
//显示页数的算法
if (totalPage <= 5) {
运行环境
Java≥6、Tomcat≥7.0、MySQL≥5.5
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
技术框架
JavaWeb JavaBean JSP MVC MySQL Tomcat JavaScript Bootstrap
基础JSP+Servlet或JSP+SSM(Spring、SpringMVC、MyBatis)框架或JSP+SSM+Maven(pom.xml)框架或SpringBoot…均可
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
登录、注册、退出、用户模块、公告模块、员工模块、进货模块、药品模块的增删改查管理