基于javaweb+mysql的ssm药品进货销售管理系统(java+ssm+js+jsp+mysql)
运行环境
Java≥8、MySQL≥5.7、Tomcat≥8
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
基于javaweb+mysql的SSM药品进货销售管理系统(java+ssm+js+jsp+mysql)
项目介绍
管理员角色包含以下功能: 管理员登录,角色权限管理,职工管理,药品销售管理,供应商管理,进货管理,药品信息管理,过期药品处理等功能。
环境需要
1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。 2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA; 3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可 4.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS; 5.数据库:MySql 5.7版本;
技术栈
- 后端:Spring+SpringMVC+Mybatis 2. 前端:HTML+CSS+JavaScript+jsp
使用说明
- 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven; 若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行; 3. 将项目中application.yml配置文件中的数据库配置改为自己的配置; 4. 运行项目,输入localhost:8080/ 登录
/**!
* @param userdao The userdao to set.
*/
public void setUserdao(userDao userdao) {
this.userdao = userdao;
}
}
public class Jinhuo {
public int id;
public String yaopinid;
public String yaopinname;
public String jinhuodate;
public String gongyingshang;
public String pici;
public String shengchandate;
public String guoqidate;
public String shuliang;
public String danwei;
public String danjia;
public String zongjia;
public int status;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getYaopinid() {
return yaopinid;
}
public void setYaopinid(String yaopinid) {
this.yaopinid = yaopinid;
}
public String getYaopinname() {
return yaopinname;
}
public void setYaopinname(String yaopinname) {
this.yaopinname = yaopinname;
}
public String getJinhuodate() {
public int resetPass(userInfo user);
public int caozuo(userInfo user);
public List<Juese> jueseList();
public int editjuese(userInfo user);
public List<Juese> searchJuese();
public int editcaidan(Caidan caidan);
public int delcaidan(Caidan caidan);
public List<Caidan> searchCaidan(userInfo info);
public int addjuese(Caidan caidan);
public int deljuese(Juese juese);
public int delyonghujuese(Juese juese);
}
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
//获得当前协议+服务器名称+端口名
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base href="<%=basePath%>">
<meta charset="UTF-8">
<title>用户管理</title>
<link rel="stylesheet" type="text/css" href="css/common.css"/>
<link rel="stylesheet" type="text/css" href="css/main.css"/>
<link rel="stylesheet" type="text/css" href="css/toastr.css"/>
<link rel="stylesheet" type="text/css" href="css/darktooltip.css"/>
</head>
<body>
<div class="admin_login_wrap">
<div class="adming_login_border">
<h1 align="center">药品进货销售管理系统</h1>
<div class="admin_input">
<form action="ypgl/userManagerAction!login" method="post">
<ul class="admin_items">
<li>
<label for="user">账号:
<input type="text" name="info.username" value="" id="user" size="20" class="admin_input_style" />
</label>
</li>
<li>
<label for="pwd">密码:
<input type="password" name="info.password" value="" id="pwd" size="20" class="admin_input_style" />
</label>
</li>
<li >
<input type="submit" tabindex="3" value="提交" class="btn btn-primary" />
</li>
</ul>
</form>
</div>
</div>
</div>
</body>
</html>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.qdu.dao.yaopinDao">
<select id="searchYaopinInfo" parameterType="Page" resultMap="resultYaopinInfo">
select * from yaopininfo where 1=1
<if test="keyword != null and keyword != ''">
and name like CONCAT('%',#{keyword},'%')
</if>
and status=0 order by id desc
<if test="startnum != null and startnum != ''">
limit #{startnum},#{pagelistnum}
</if>
</select>
<select id="searchGongyingshang" resultMap="resultGYS">
select * from gongyingshang where status=0 order by id desc
</select>
<insert id="addJinhuo" parameterType="Jinhuo">
insert into jinhuo values(default,#{yaopinid},#{yaopinname},#{jinhuodate},#{gongyingshang},#{pici},#{shengchandate},#{guoqidate},#{shuliang},#{danwei},#{danjia},#{zongjia},0)
</insert>
<select id="searchKucun" parameterType="Jinhuo" resultType="Yaopinkucun">
select * from yaopinkucun where yaopinname=#{yaopinname}
</select>
<insert id="addYaopinKucun" parameterType="Jinhuo">
/**!
* //TODO 添加类/接口功能描述
*/
@SuppressWarnings("serial")
public class gongyingshangAction extends ActionSupport{
public gongyingshangService gongyingshangservice=null;
public String state=null;
public Page page;
public Gongyingshang gongyingshang;
public List<Gongyingshang> gongyingshangList;
public String searchGYS(){
state = "";
page.setListnum(gongyingshangservice.listnum(page));
page=pageInfo(page);
gongyingshangList = gongyingshangservice.gongyingshangList(page);
gongyingshang = null;
return "gongyingshang";
}
public String addGYS(){
int i = gongyingshangservice.addGYS(gongyingshang);
page.setListnum(gongyingshangservice.listnum(page));
page=pageInfo(page);
public int addYaopinKucun(Jinhuo jinhuo);
public int updateYaopinKucun(Jinhuo jinhuo);
public Yaopininfo jinhuoxinxi(Yaopininfo yaopininfo);
public int jinhuodanListnum(Page page);
public List<Jinhuo> jinhuodan(Page page);
public int yaopininfoListnum(Page page);
public List<Yaopininfo> yaopininfo(Page page);
public int addyaopininfo(Yaopininfo yaopininfo);
public int delinfo(Yaopininfo yaopininfo);
public int updateInfo(Yaopininfo yaopininfo);
public int addXiaoshou(Xiaoshou xiaoshou);
public int jianYaopinKucun(Xiaoshou xiaoshou);
public int xiaoshouListnum(Page page);
public List<Xiaoshou> xiaoshoudan(Page page);
public List<Yaopinkucun> searchYaopinKucun();
public int chuli(Yaopinchuli yaopinchuli);
public int jian(Yaopinchuli yaopinchuli);
}
/*
*
page.setPagenum(page.getListnum()/page.getPagelistnum()+1);
}
else{
page.setPagenum(page.getListnum()/page.getPagelistnum());
}
return page;
}
/**!
*
*/
public userManagerAction() {
// TODO Auto-generated constructor stub
}
public Caidan getCaidan() {
return caidan;
}
public void setCaidan(Caidan caidan) {
this.caidan = caidan;
}
public List<Caidan> getCaidanList() {
return caidanList;
}
public void setCaidanList(List<Caidan> caidanList) {
this.caidanList = caidanList;
}
public Juese getJuese() {
return juese;
}
public void setJuese(Juese juese) {
this.juese = juese;
}
public List<Juese> getJueseList() {
return jueseList;
}
public void setJueseList(List<Juese> jueseList) {
this.jueseList = jueseList;
}
public userInfo getUser() {
return user;
}
public void setUser(userInfo user) {
this.user = user;
}
public Page getPage() {
<div class="list-page"> 共 ${page.listnum} 条结果
<s:if test="page.currpage != 1"><a href="user/userManagerAction!searchUser?page.newpage=1&page.pagelistnum=${page.pagelistnum}&page.keyword=${page.keyword}">首页</a></s:if>
<s:if test="page.currpage == 1"><a ><font color="#aaaaaa">首页</font></a></s:if>
<s:if test="page.currpage != 1"><a href="user/userManagerAction!searchUser?page.pagelistnum=${page.pagelistnum}&page.keyword=${page.keyword}&page.newpage=${page.currpage-1}">上一页</a></s:if>
<s:if test="page.currpage == 1"><a ><font color="#aaaaaa">上一页</font></a></s:if>
<s:if test="page.currpage != page.pagenum"><a href="user/userManagerAction!searchUser?page.pagelistnum=${page.pagelistnum}&page.keyword=${page.keyword}&page.newpage=${page.currpage+1}">下一页</a></s:if>
<s:if test="page.currpage == page.pagenum"><a><font color="#aaaaaa">下一页</font></a></s:if>
<s:if test="page.currpage != page.pagenum"><a href="user/userManagerAction!searchUser?page.pagelistnum=${page.pagelistnum}&page.keyword=${page.keyword}&page.newpage=${page.pagenum}">末页</a></s:if>
<s:if test="page.currpage == page.pagenum"><a><font color="#aaaaaa">末页</font></a></s:if>
第 ${page.currpage} 页/共 <font id="pagenum">${page.pagenum }</font> 页
<a id="pagelianjie" href="user/userManagerAction!searchUser?page.pagelistnum=${page.pagelistnum}&page.keyword=${page.keyword}" style="float: right;">跳转</a><input id="tiaopage" style="float: right;" type="text">
</div>
</div>
</form>
</div>
</div>
<!--/main-->
</div>
</body>
</html>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
String path=request.getContextPath();
//获得当前协议+服务器名称+端口名
String basePath=request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>主页面</title>
<link rel="stylesheet" type="text/css" href="css/common.css"/>
<link rel="stylesheet" type="text/css" href="css/main.css"/>
</head>
<body>
<div class="topbar-wrap white">
<div class="topbar-inner clearfix">
<div class="topbar-logo-wrap clearfix">
<result property="status" column="status" />
</resultMap>
<resultMap type="Yaopininfo" id="resultYaopinInfo">
<id property="id" column="id" />
<result property="name" column="name" />
<result property="changjia" column="changjia" />
<result property="leibie" column="leibie" />
<result property="danwei" column="danwei" />
<result property="jhdanjia" column="jhdanjia" />
<result property="lsdanjia" column="lsdanjia" />
<result property="status" column="status" />
</resultMap>
<resultMap type="Jinhuo" id="resultJinhuo">
<id property="id" column="id" />
<result property="yaopinid" column="yaopinid" />
<result property="yaopinname" column="yaopinname" />
<result property="jinhuodate" column="jinhuodate" />
<result property="gongyingshang" column="gongyingshang" />
<result property="pici" column="pici" />
<result property="shengchandate" column="shengchandate" />
<result property="shuliang" column="shuliang" />
<result property="danwei" column="danwei" />
<result property="danjia" column="danjia" />
<result property="zongjia" column="zongjia" />
<result property="status" column="status" />
<result property="guoqidate" column="guoqidate" />
</resultMap>
<resultMap type="Yaopinkucun" id="resultKucun">
<id property="id" column="id" />
<result property="yaopinid" column="yaopinid" />
<result property="yaopinname" column="yaopinname" />
<result property="shuliang" column="shuliang" />
<result property="jhzongjia" column="jhzongjia" />
<result property="lszongjia" column="lszongjia" />
<result property="status" column="status" />
</resultMap>
<resultMap type="Gongyingshang" id="resultGYS">
<id property="id" column="id" />
<result property="name" column="name" />
<result property="fuzeren" column="fuzeren" />
<result property="phone" column="phone" />
<result property="dizhi" column="dizhi" />
<result property="status" column="status" />
</resultMap>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<delete id="deljuese" parameterType="Juese">
delete from juese where id=#{id}
</delete>
<update id="resetPass" parameterType="userInfo">
update userinfo set
<if test="realname!='admin'">
password='password'
</if>
<if test="realname=='admin'">
type=1
</if>
where id=#{id}
</update>
<update id="caozuo" parameterType="userInfo">
update userinfo set
<if test="status==0">
status=1
</if>
<if test="status==1">
status=0
</if>
where id=#{id}
</update>
<select id="jueseList" resultMap="resultJuese">
select * from juese
</select>
<update id="editjuese" parameterType="userInfo">
update userinfo set type=#{type} where id=#{id}
</update>
<select id="searchJuese" resultMap="resultJuese">
select * from juese
</select>
<insert id="editcaidan" parameterType="Caidan">
insert into caidan values(default,#{juese},#{caidan})
</insert>
<delete id="delcaidan" parameterType="Caidan">
delete from caidan where juese=#{juese}
</delete>
<select id="searchCaidan" parameterType="userInfo" resultMap="resultCaidan">
select * from caidan where juese=#{type}
</select>
<resultMap type="userInfo" id="resultUser">
<id property="id" column="id" />
<result property="username" column="username" />
<result property="password" column="password" />
<result property="email" column="email" />
<result property="sex" column="sex" />
<result property="phone" column="phone" />
<result property="status" column="status" />
<result property="type" column="type" />
</resultMap>
<resultMap type="Juese" id="resultJuese">
<id property="id" column="id" />
<result property="juese" column="juese" />
<div class="crumb-wrap">
<div class="crumb-list"><i class="icon-font"></i><a href="index.jsp">首页</a><span class="crumb-step">></span><span class="crumb-name">用户管理</span></div>
</div>
<div class="search-wrap">
<div class="search-content">
<form action="user/userManagerAction!searchUser?page.newpage=1" method="post">
<table class="search-tab">
<tr>
<th width="70">关键字:</th>
<td><input class="common-text" placeholder="关键字" name="page.keyword" value="${page.keyword}" id="" type="text"></td>
<td><input class="btn btn-primary btn2" name="sub" value="查询" type="submit"></td>
<td>每页显示:</td>
<td><select id="meiye">
<option value="10" <s:if test="page.pagelistnum==10">selected</s:if>>10条</option>
<option value="20" <s:if test="page.pagelistnum==20">selected</s:if>>20条</option>
<option value="30" <s:if test="page.pagelistnum==30">selected</s:if>>30条</option>
</select> </td>
</tr>
</table>
</form>
</div>
</div>
<div class="result-wrap">
<form name="myform" id="myform" method="post">
<div class="result-title">
<div class="result-list">
</div>
</div>
<div class="result-content">
<table class="result-tab" width="100%">
<tr>
<th class="tc" width="5%">编号</th>
<th>用户名</th>
<th>电话</th>
<th>真实姓名</th>
<th>电子邮箱</th>
<th>用户状态</th>
<th>用户类型</th>
<th>重置密码</th>
<th>禁用/解禁</th>
</tr>
<s:iterator value="userList" var="us" status="st">
<tr>
<td class="tc">${(page.currpage-1)*page.pagelistnum+st.index+1}
<input name="id" value="${us.id}" type="hidden">
</td>
<td>
${us.username}
<resultMap type="Jinhuo" id="resultJinhuo">
<id property="id" column="id" />
<result property="yaopinid" column="yaopinid" />
<result property="yaopinname" column="yaopinname" />
<result property="jinhuodate" column="jinhuodate" />
<result property="gongyingshang" column="gongyingshang" />
<result property="pici" column="pici" />
<result property="shengchandate" column="shengchandate" />
<result property="shuliang" column="shuliang" />
<result property="danwei" column="danwei" />
<result property="danjia" column="danjia" />
<result property="zongjia" column="zongjia" />
<result property="status" column="status" />
<result property="guoqidate" column="guoqidate" />
</resultMap>
<resultMap type="Yaopinkucun" id="resultKucun">
<id property="id" column="id" />
<result property="yaopinid" column="yaopinid" />
<result property="yaopinname" column="yaopinname" />
<result property="shuliang" column="shuliang" />
<result property="jhzongjia" column="jhzongjia" />
<result property="lszongjia" column="lszongjia" />
<result property="status" column="status" />
</resultMap>
<resultMap type="Gongyingshang" id="resultGYS">
<id property="id" column="id" />
<result property="name" column="name" />
<result property="fuzeren" column="fuzeren" />
<result property="phone" column="phone" />
<result property="dizhi" column="dizhi" />
<result property="status" column="status" />
</resultMap>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.qdu.dao.userDao">
<!-- 用户登录 -->
<select id="login" parameterType="userInfo" resultType="userInfo">
SELECT * FROM userinfo WHERE username=#{username} AND
password=#{password} and status=0
</select>
}
public int jinhuodanListnum(Page page){
return yaopindao.jinhuodanListnum(page);
}
public List<Jinhuo> jinhuodan(Page page){
return yaopindao.jinhuodan(page);
}
public int yaopininfoListnum(Page page){
return yaopindao.yaopininfoListnum(page);
}
public List<Yaopininfo> yaopininfo(Page page){
return yaopindao.yaopininfo(page);
}
public int addyaopininfo(Yaopininfo yaopininfo){
return yaopindao.addyaopininfo(yaopininfo);
}
public int delinfo(Yaopininfo yaopininfo){
return yaopindao.delinfo(yaopininfo);
}
public int updateInfo(Yaopininfo yaopininfo){
return yaopindao.updateInfo(yaopininfo);
}
public int addXiaoshou(Xiaoshou xiaoshou){
return yaopindao.addXiaoshou(xiaoshou);
}
public int jianYaopinKucun(Xiaoshou xiaoshou){
return yaopindao.jianYaopinKucun(xiaoshou);
}
public int xiaoshouListnum(Page page){
return yaopindao.xiaoshouListnum(page);
}
public List<Xiaoshou> xiaoshoudan(Page page){
return yaopindao.xiaoshoudan(page);
}
public List<Yaopinkucun> searchYaopinKucun(){
return yaopindao.searchYaopinKucun();
}
public int chuli(Yaopinchuli yaopinchuli){
return yaopindao.chuli(yaopinchuli);
}
public int jian(Yaopinchuli yaopinchuli){
return yaopindao.jian(yaopinchuli);
}
}
/*
*
* 修改历史 :
*/
<s:if test="page.currpage == page.pagenum"><a><font color="#aaaaaa">末页</font></a></s:if>
第 ${page.currpage} 页/共 <font id="pagenum">${page.pagenum }</font> 页
<a id="pagelianjie" href="user/userManagerAction!searchUser?page.pagelistnum=${page.pagelistnum}&page.keyword=${page.keyword}" style="float: right;">跳转</a><input id="tiaopage" style="float: right;" type="text">
</div>
</div>
</form>
</div>
</div>
<!--/main-->
</div>
</body>
</html>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
String path=request.getContextPath();
//获得当前协议+服务器名称+端口名
String basePath=request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>主页面</title>
<link rel="stylesheet" type="text/css" href="css/common.css"/>
<link rel="stylesheet" type="text/css" href="css/main.css"/>
</head>
<body>
<div class="topbar-wrap white">
<div class="topbar-inner clearfix">
<div class="topbar-logo-wrap clearfix">
<h1 class="topbar-logo none"><a href="index.jsp" class="navbar-brand">后台管理</a></h1>
<ul class="navbar-list clearfix">
<li><a class="on" href="index.jsp">首页</a></li>
</ul>
</div>
return yaopindao.xiaoshoudan(page);
}
public List<Yaopinkucun> searchYaopinKucun(){
return yaopindao.searchYaopinKucun();
}
public int chuli(Yaopinchuli yaopinchuli){
return yaopindao.chuli(yaopinchuli);
}
public int jian(Yaopinchuli yaopinchuli){
return yaopindao.jian(yaopinchuli);
}
}
/*
*
* 修改历史 :
*/
/**!
* //TODO 添加类/接口功能描述
*/
public class userServiceImpl implements userService{
public userDao userdao=null;
@Override
public userInfo login(userInfo info) {
return userdao.login(info);
}
public int listnum(Page page){
return userdao.listnum(page);
<th>电子邮箱</th>
<th>用户状态</th>
<th>用户类型</th>
<th>重置密码</th>
<th>禁用/解禁</th>
</tr>
<s:iterator value="userList" var="us" status="st">
<tr>
<td class="tc">${(page.currpage-1)*page.pagelistnum+st.index+1}
<input name="id" value="${us.id}" type="hidden">
</td>
<td>
${us.username}
</td>
<td>${us.phone}</td>
<td>${us.realname}</td>
<td>${us.email}</td>
<td><s:if test="#us.status==0"><font color="green">正常使用中</font></s:if> <s:if test="#us.status==1"><font color="red">禁用中</font></s:if></td>
<td class="type"><span>${us.type}</span>
<select id="${us.id}" class="se" style="display:none;">
<s:iterator value="jueseList" var="js" status="st">
<option value="${js.juese}" <s:if test="#js.juese == #us.type">selected = "selected"</s:if>>${js.juese}</option>
</s:iterator>
</select>
</td>
<td>
<a class="chongzhi" name="${us.id}" href="">重置密码</a></td>
<td>
<s:if test="#us.status==0">
<a name="${us.id}" href="user/userManagerAction!caozuo?user.id=${us.id}&user.status=${us.status}&page.keyword=${page.keyword}&page.newpage=${page.currpage }"><font color="red">禁用</font></a>
</s:if><s:if test="#us.status==1">
<a name="${us.id}" href="user/userManagerAction!caozuo?user.id=${us.id}&user.status=${us.status}&page.keyword=${page.keyword}&page.newpage=${page.currpage }"><font color="green">解禁</font></a>
</s:if></td>
</tr>
</s:iterator>
</table>
<div class="list-page"> 共 ${page.listnum} 条结果
<s:if test="page.currpage != 1"><a href="user/userManagerAction!searchUser?page.newpage=1&page.pagelistnum=${page.pagelistnum}&page.keyword=${page.keyword}">首页</a></s:if>
<s:if test="page.currpage == 1"><a ><font color="#aaaaaa">首页</font></a></s:if>
<s:if test="page.currpage != 1"><a href="user/userManagerAction!searchUser?page.pagelistnum=${page.pagelistnum}&page.keyword=${page.keyword}&page.newpage=${page.currpage-1}">上一页</a></s:if>
update yaopininfo set
<if test="name!=null">
name=#{name}
</if>
<if test="changjia!=null">
changjia=#{changjia}
</if>
<if test="leibie!=null">
leibie=#{leibie}
</if>
<if test="danwei!=null">
danwei=#{danwei}
</if>
<if test="jhdanjia!=null">
jhdanjia=#{jhdanjia}
</if>
<if test="lsdanjia!=null">
lsdanjia=#{lsdanjia}
</if>
where id=#{id}
</update>
<insert id="addXiaoshou" parameterType="Xiaoshou">
insert into xiaoshou values(default,#{yaopinid},#{yaopinname},#{shuliang},#{danjia},#{zongjia},#{date},0)
</insert>
<update id="jianYaopinKucun" parameterType="Xiaoshou">
update yaopinkucun set shuliang=shuliang-#{shuliang} where yaopinname=#{yaopinname}
</update>
<select id="xiaoshouListnum" parameterType="Page" resultType="int">
select count(id) from xiaoshou where 1=1
<if test="keyword != null and keyword != ''">
and yaopinname like CONCAT('%',#{keyword},'%')
</if>
and status=0
</select>
<select id="xiaoshoudan" parameterType="Page" resultMap="resultXiaoshou">
select * from xiaoshou where 1=1
<if test="keyword != null and keyword != ''">
and yaopinname like CONCAT('%',#{keyword},'%')
</if>
and status=0 order by id desc limit #{startnum},#{pagelistnum}
</select>
return "zhigong";
}
//页面的方法
public Page pageInfo(Page page){
if(page.getNewpage()!=0){
page.setCurrpage(page.getNewpage());
}
if(page.getPagelistnum()==0){
page.setPagelistnum(10);
}
page.setStartnum((page.getCurrpage()-1)*page.getPagelistnum());
if(page.getListnum()%page.getPagelistnum()!=0){
page.setPagenum(page.getListnum()/page.getPagelistnum()+1);
}
else{
page.setPagenum(page.getListnum()/page.getPagelistnum());
}
return page;
}
/**!
*
*/
public zhigongAction() {
// TODO Auto-generated constructor stub
}
public zhigongService getZhigongservice() {
return zhigongservice;
}
public void setZhigongservice(zhigongService zhigongservice) {
this.zhigongservice = zhigongservice;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public Page getPage() {
return page;
}
return yaopindao.searchGongyingshang();
}
public int addJinhuo(Jinhuo jinhuo){
return yaopindao.addJinhuo(jinhuo);
}
public Yaopinkucun searchKucun(Jinhuo jinhuo){
return yaopindao.searchKucun(jinhuo);
}
public int addYaopinKucun(Jinhuo jinhuo){
return yaopindao.addYaopinKucun(jinhuo);
}
public int updateYaopinKucun(Jinhuo jinhuo){
return yaopindao.updateYaopinKucun(jinhuo);
}
public Yaopininfo jinhuoxinxi(Yaopininfo yaopininfo){
return yaopindao.jinhuoxinxi(yaopininfo);
}
public int jinhuodanListnum(Page page){
return yaopindao.jinhuodanListnum(page);
}
public List<Jinhuo> jinhuodan(Page page){
return yaopindao.jinhuodan(page);
}
public int yaopininfoListnum(Page page){
return yaopindao.yaopininfoListnum(page);
}
public List<Yaopininfo> yaopininfo(Page page){
return yaopindao.yaopininfo(page);
}
public int addyaopininfo(Yaopininfo yaopininfo){
return yaopindao.addyaopininfo(yaopininfo);
}
public int delinfo(Yaopininfo yaopininfo){
return yaopindao.delinfo(yaopininfo);
}
public int updateInfo(Yaopininfo yaopininfo){
return yaopindao.updateInfo(yaopininfo);
}
public int addXiaoshou(Xiaoshou xiaoshou){
return yaopindao.addXiaoshou(xiaoshou);
}
public int jianYaopinKucun(Xiaoshou xiaoshou){
return yaopindao.jianYaopinKucun(xiaoshou);
}
public int xiaoshouListnum(Page page){
return yaopindao.xiaoshouListnum(page);
}
public List<Xiaoshou> xiaoshoudan(Page page){
return yaopindao.xiaoshoudan(page);
}
public List<Yaopinkucun> searchYaopinKucun(){