Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
onionZunyi
beauty_ssm
提交
82f1b9b6
B
beauty_ssm
项目概览
onionZunyi
/
beauty_ssm
与 Fork 源项目一致
Fork自
爱吃血肠 / beauty_ssm
通知
6
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
B
beauty_ssm
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
82f1b9b6
编写于
3月 25, 2018
作者:
爱吃血肠
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
管理员登录模块...
上级
54bc8ca7
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
768 addition
and
4 deletion
+768
-4
src/main/java/com/yingjun/ssm/aop/BindingResultAop.java
src/main/java/com/yingjun/ssm/aop/BindingResultAop.java
+1
-1
src/main/java/com/yingjun/ssm/dao/TOpreatorUserDao.java
src/main/java/com/yingjun/ssm/dao/TOpreatorUserDao.java
+74
-0
src/main/java/com/yingjun/ssm/entity/TOpreatorUser.java
src/main/java/com/yingjun/ssm/entity/TOpreatorUser.java
+144
-0
src/main/java/com/yingjun/ssm/service/TOpreatorUserService.java
...in/java/com/yingjun/ssm/service/TOpreatorUserService.java
+73
-0
src/main/java/com/yingjun/ssm/service/impl/TOpreatorUserServiceImpl.java
...om/yingjun/ssm/service/impl/TOpreatorUserServiceImpl.java
+93
-0
src/main/java/com/yingjun/ssm/util/CodeUtil.java
src/main/java/com/yingjun/ssm/util/CodeUtil.java
+1
-3
src/main/java/com/yingjun/ssm/web/AdminLoginController.java
src/main/java/com/yingjun/ssm/web/AdminLoginController.java
+73
-0
src/main/resources/mapper/TOpreatorUserMapper.xml
src/main/resources/mapper/TOpreatorUserMapper.xml
+180
-0
src/main/webapp/WEB-INF/jsp/admin/adminLogin.jsp
src/main/webapp/WEB-INF/jsp/admin/adminLogin.jsp
+105
-0
src/main/webapp/WEB-INF/jsp/admin/success.jsp
src/main/webapp/WEB-INF/jsp/admin/success.jsp
+24
-0
未找到文件。
src/main/java/com/yingjun/ssm/aop/BindingResultAop.java
浏览文件 @
82f1b9b6
...
@@ -25,7 +25,7 @@ public class BindingResultAop {
...
@@ -25,7 +25,7 @@ public class BindingResultAop {
@Around
(
"aopMethod()"
)
@Around
(
"aopMethod()"
)
public
Object
around
(
ProceedingJoinPoint
joinPoint
)
throws
Throwable
{
public
Object
around
(
ProceedingJoinPoint
joinPoint
)
throws
Throwable
{
LOG
.
info
(
"采用AOP的方式检查用户是否登录"
);
//
LOG.info("采用AOP的方式检查用户是否登录");
return
joinPoint
.
proceed
();
return
joinPoint
.
proceed
();
}
}
...
...
src/main/java/com/yingjun/ssm/dao/TOpreatorUserDao.java
0 → 100644
浏览文件 @
82f1b9b6
package
com.yingjun.ssm.dao
;
import
com.yingjun.ssm.entity.TOpreatorUser
;
import
java.util.List
;
/**
* 管理员
* @author liyunfeng
*/
public
interface
TOpreatorUserDao
{
/**
* 获得TOpreatorUser数据的总行数
* @return
*/
public
long
getTOpreatorUserRowCount
();
/**
* 获得TOpreatorUser数据集合
* @return
*/
public
List
<
TOpreatorUser
>
selectTOpreatorUser
();
/**
* 获得一个TOpreatorUser对象,以参数TOpreatorUser对象中不为空的属性作为条件进行查询
* @param obj
* @return
*/
public
TOpreatorUser
selectTOpreatorUserByObj
(
TOpreatorUser
obj
);
/**
* 通过TOpreatorUser的id获得TOpreatorUser对象
* @param id
* @return
*/
public
TOpreatorUser
selectTOpreatorUserById
(
Long
id
);
/**
* 插入TOpreatorUser到数据库,包括null值
* @param value
* @return
*/
public
int
insertTOpreatorUser
(
TOpreatorUser
value
);
/**
* 插入TOpreatorUser中属性值不为null的数据到数据库
* @param value
* @return
*/
public
int
insertNonEmptyTOpreatorUser
(
TOpreatorUser
value
);
/**
* 批量插入TOpreatorUser到数据库,包括null值
* @param value
* @return
*/
public
int
insertTOpreatorUserByBatch
(
List
<
TOpreatorUser
>
value
);
/**
* 通过TOpreatorUser的id删除TOpreatorUser
* @param id
* @return
*/
public
int
deleteTOpreatorUserById
(
Long
id
);
/**
* 通过TOpreatorUser的id更新TOpreatorUser中的数据,包括null值
* @param enti
* @return
*/
public
int
updateTOpreatorUserById
(
TOpreatorUser
enti
);
/**
* 通过TOpreatorUser的id更新TOpreatorUser中属性不为null的数据
* @param enti
* @return
*/
public
int
updateNonEmptyTOpreatorUserById
(
TOpreatorUser
enti
);
/**
* 根据邮箱以及密码查询管理员信息
* @param opreatorUser
* @return
*/
public
TOpreatorUser
queryAdminInfo
(
TOpreatorUser
opreatorUser
);
}
\ No newline at end of file
src/main/java/com/yingjun/ssm/entity/TOpreatorUser.java
0 → 100644
浏览文件 @
82f1b9b6
package
com.yingjun.ssm.entity
;
/**
* @author liyunfeng
*/
public
class
TOpreatorUser
{
/**
* id
*/
private
Long
id
;
/**
* 有效性
*/
private
Integer
valid
;
/**
* 运维名称
*/
private
String
operatorName
;
/**
* 手机号
*/
private
String
phoneNo
;
/**
* 更新时间
*/
private
java
.
util
.
Date
updateTime
;
/**
* 创建时间
*/
private
java
.
util
.
Date
createTime
;
/**
* 角色(1:管理员;2:运维)
*/
private
Integer
roleId
;
/**
* 运维密码
*/
private
String
operatorPassword
;
/**
* 运维Id
*/
private
String
operatorAccount
;
/**
* 邮件
*/
private
String
email
;
public
TOpreatorUser
()
{
super
();
}
public
TOpreatorUser
(
Long
id
,
Integer
valid
,
String
operatorName
,
String
phoneNo
,
java
.
util
.
Date
updateTime
,
java
.
util
.
Date
createTime
,
Integer
roleId
,
String
operatorPassword
,
String
operatorAccount
,
String
email
)
{
super
();
this
.
id
=
id
;
this
.
valid
=
valid
;
this
.
operatorName
=
operatorName
;
this
.
phoneNo
=
phoneNo
;
this
.
updateTime
=
updateTime
;
this
.
createTime
=
createTime
;
this
.
roleId
=
roleId
;
this
.
operatorPassword
=
operatorPassword
;
this
.
operatorAccount
=
operatorAccount
;
this
.
email
=
email
;
}
public
Long
getId
()
{
return
this
.
id
;
}
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
}
public
Integer
getValid
()
{
return
this
.
valid
;
}
public
void
setValid
(
Integer
valid
)
{
this
.
valid
=
valid
;
}
public
String
getOperatorName
()
{
return
this
.
operatorName
;
}
public
void
setOperatorName
(
String
operatorName
)
{
this
.
operatorName
=
operatorName
;
}
public
String
getPhoneNo
()
{
return
this
.
phoneNo
;
}
public
void
setPhoneNo
(
String
phoneNo
)
{
this
.
phoneNo
=
phoneNo
;
}
public
java
.
util
.
Date
getUpdateTime
()
{
return
this
.
updateTime
;
}
public
void
setUpdateTime
(
java
.
util
.
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
public
java
.
util
.
Date
getCreateTime
()
{
return
this
.
createTime
;
}
public
void
setCreateTime
(
java
.
util
.
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
public
Integer
getRoleId
()
{
return
this
.
roleId
;
}
public
void
setRoleId
(
Integer
roleId
)
{
this
.
roleId
=
roleId
;
}
public
String
getOperatorPassword
()
{
return
this
.
operatorPassword
;
}
public
void
setOperatorPassword
(
String
operatorPassword
)
{
this
.
operatorPassword
=
operatorPassword
;
}
public
String
getOperatorAccount
()
{
return
this
.
operatorAccount
;
}
public
void
setOperatorAccount
(
String
operatorAccount
)
{
this
.
operatorAccount
=
operatorAccount
;
}
public
String
getEmail
()
{
return
this
.
email
;
}
public
void
setEmail
(
String
email
)
{
this
.
email
=
email
;
}
}
src/main/java/com/yingjun/ssm/service/TOpreatorUserService.java
0 → 100644
浏览文件 @
82f1b9b6
package
com.yingjun.ssm.service
;
import
java.util.List
;
import
com.yingjun.ssm.entity.TOpreatorUser
;
/**
* 管理员
* @author liyunfeng
*/
public
interface
TOpreatorUserService
{
/**
* 获得TOpreatorUser数据的总行数
* @return
*/
public
long
getTOpreatorUserRowCount
();
/**
* 获得TOpreatorUser数据集合
* @return
*/
public
List
<
TOpreatorUser
>
selectTOpreatorUser
();
/**
* 获得一个TOpreatorUser对象,以参数TOpreatorUser对象中不为空的属性作为条件进行查询
* @param obj
* @return
*/
public
TOpreatorUser
selectTOpreatorUserByObj
(
TOpreatorUser
obj
);
/**
* 通过TOpreatorUser的id获得TOpreatorUser对象
* @param id
* @return
*/
public
TOpreatorUser
selectTOpreatorUserById
(
Long
id
);
/**
* 插入TOpreatorUser到数据库,包括null值
* @param value
* @return
*/
public
int
insertTOpreatorUser
(
TOpreatorUser
value
);
/**
* 插入TOpreatorUser中属性值不为null的数据到数据库
* @param value
* @return
*/
public
int
insertNonEmptyTOpreatorUser
(
TOpreatorUser
value
);
/**
* 批量插入TOpreatorUser到数据库
* @param value
* @return
*/
public
int
insertTOpreatorUserByBatch
(
List
<
TOpreatorUser
>
value
);
/**
* 通过TOpreatorUser的id删除TOpreatorUser
* @param id
* @return
*/
public
int
deleteTOpreatorUserById
(
Long
id
);
/**
* 通过TOpreatorUser的id更新TOpreatorUser中的数据,包括null值
* @param enti
* @return
*/
public
int
updateTOpreatorUserById
(
TOpreatorUser
enti
);
/**
* 通过TOpreatorUser的id更新TOpreatorUser中属性不为null的数据
* @param enti
* @return
*/
public
int
updateNonEmptyTOpreatorUserById
(
TOpreatorUser
enti
);
/**
* 处理管理员登录
* @param opreatorUser
*/
public
TOpreatorUser
checkAdminLogin
(
TOpreatorUser
opreatorUser
);
}
\ No newline at end of file
src/main/java/com/yingjun/ssm/service/impl/TOpreatorUserServiceImpl.java
0 → 100644
浏览文件 @
82f1b9b6
package
com.yingjun.ssm.service.impl
;
import
java.util.List
;
import
com.yingjun.ssm.dao.TOpreatorUserDao
;
import
com.yingjun.ssm.entity.TOpreatorUser
;
import
com.yingjun.ssm.entity.User
;
import
com.yingjun.ssm.exception.BizException
;
import
com.yingjun.ssm.service.TOpreatorUserService
;
import
com.yingjun.ssm.util.Md5Util
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
/**
* 管理员
* @author liyunfeng
*/
@Service
public
class
TOpreatorUserServiceImpl
implements
TOpreatorUserService
{
private
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
this
.
getClass
());
@Autowired
private
TOpreatorUserDao
tOpreatorUserDao
;
@Override
public
long
getTOpreatorUserRowCount
(){
return
tOpreatorUserDao
.
getTOpreatorUserRowCount
();
}
@Override
public
List
<
TOpreatorUser
>
selectTOpreatorUser
(){
return
tOpreatorUserDao
.
selectTOpreatorUser
();
}
@Override
public
TOpreatorUser
selectTOpreatorUserByObj
(
TOpreatorUser
obj
){
return
tOpreatorUserDao
.
selectTOpreatorUserByObj
(
obj
);
}
@Override
public
TOpreatorUser
selectTOpreatorUserById
(
Long
id
){
return
tOpreatorUserDao
.
selectTOpreatorUserById
(
id
);
}
@Override
public
int
insertTOpreatorUser
(
TOpreatorUser
value
){
return
tOpreatorUserDao
.
insertTOpreatorUser
(
value
);
}
@Override
public
int
insertNonEmptyTOpreatorUser
(
TOpreatorUser
value
){
return
tOpreatorUserDao
.
insertNonEmptyTOpreatorUser
(
value
);
}
@Override
public
int
insertTOpreatorUserByBatch
(
List
<
TOpreatorUser
>
value
){
return
tOpreatorUserDao
.
insertTOpreatorUserByBatch
(
value
);
}
@Override
public
int
deleteTOpreatorUserById
(
Long
id
){
return
tOpreatorUserDao
.
deleteTOpreatorUserById
(
id
);
}
@Override
public
int
updateTOpreatorUserById
(
TOpreatorUser
enti
){
return
tOpreatorUserDao
.
updateTOpreatorUserById
(
enti
);
}
@Override
public
int
updateNonEmptyTOpreatorUserById
(
TOpreatorUser
enti
){
return
tOpreatorUserDao
.
updateNonEmptyTOpreatorUserById
(
enti
);
}
/**
* 处理管理员登录
* @param opreatorUser 管理员登录相关信息
*/
@Override
public
TOpreatorUser
checkAdminLogin
(
TOpreatorUser
opreatorUser
)
{
try
{
//加密密码
opreatorUser
.
setOperatorPassword
(
Md5Util
.
md5Password
(
opreatorUser
.
getOperatorPassword
()));
TOpreatorUser
tOpreatorUser
=
tOpreatorUserDao
.
queryAdminInfo
(
opreatorUser
);
if
(
tOpreatorUser
==
null
){
throw
new
BizException
(
"邮箱或密码错误"
);
}
return
tOpreatorUser
;
}
catch
(
BizException
biz
){
throw
new
BizException
(
"邮箱或密码错误"
,
biz
);
}
catch
(
Exception
e
){
throw
new
RuntimeException
(
"登录出现异常"
,
e
);
}
}
public
TOpreatorUserDao
getTOpreatorUserDao
()
{
return
this
.
tOpreatorUserDao
;
}
public
void
setTOpreatorUserDao
(
TOpreatorUserDao
tOpreatorUserDao
)
{
this
.
tOpreatorUserDao
=
tOpreatorUserDao
;
}
}
\ No newline at end of file
src/main/java/com/yingjun/ssm/util/CodeUtil.java
浏览文件 @
82f1b9b6
...
@@ -14,7 +14,5 @@ public class CodeUtil {
...
@@ -14,7 +14,5 @@ public class CodeUtil {
public
static
String
rand
(){
public
static
String
rand
(){
return
getRandNum
(
100000
,
999999
).
toString
().
trim
();
return
getRandNum
(
100000
,
999999
).
toString
().
trim
();
}
}
public
static
void
main
(
String
[]
args
){
public
static
void
main
(
String
[]
args
){
rand
();}
rand
();
}
}
}
src/main/java/com/yingjun/ssm/web/AdminLoginController.java
0 → 100644
浏览文件 @
82f1b9b6
package
com.yingjun.ssm.web
;
import
com.google.gson.Gson
;
import
com.yingjun.ssm.dto.BaseResult
;
import
com.yingjun.ssm.entity.TOpreatorUser
;
import
com.yingjun.ssm.entity.User
;
import
com.yingjun.ssm.enums.ResultEnum
;
import
com.yingjun.ssm.exception.BizException
;
import
com.yingjun.ssm.service.TOpreatorUserService
;
import
com.yingjun.ssm.service.UserService
;
import
com.yingjun.ssm.util.CodeUtil
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
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
javax.servlet.http.HttpSession
;
/**
* 管理员
* @author liyunfeng
*/
@Controller
@RequestMapping
(
"/admin"
)
public
class
AdminLoginController
{
private
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
this
.
getClass
());
@Autowired
private
TOpreatorUserService
tOpreatorUserService
;
/**
* 到达管理员登录页面
* @return
*/
@RequestMapping
(
value
=
"/login"
)
public
String
login
()
{
return
"/admin/adminLogin"
;
}
/**
* 用户登录
* @return
*/
@ResponseBody
@RequestMapping
(
value
=
"/adminLogin"
,
produces
=
{
"application/json;charset=UTF-8"
})
public
BaseResult
<
Object
>
adminLogin
(
TOpreatorUser
opreatorUser
,
HttpSession
session
)
{
try
{
tOpreatorUserService
.
checkAdminLogin
(
opreatorUser
);
session
.
setAttribute
(
"email"
,
opreatorUser
.
getEmail
());
}
catch
(
BizException
e
)
{
return
new
BaseResult
<>(
false
,
e
.
getMessage
());
}
catch
(
Exception
e
)
{
return
new
BaseResult
<>(
false
,
ResultEnum
.
INVALID_USER
.
getMsg
());
}
return
new
BaseResult
<>(
true
,
"登陆成功"
);
}
/**
* 管理员登录成功
* @return
*/
@RequestMapping
(
value
=
"/adminLoginSuccess"
)
public
String
adminLoginSuccess
()
{
return
"/admin/success"
;
}
}
src/main/resources/mapper/TOpreatorUserMapper.xml
0 → 100644
浏览文件 @
82f1b9b6
<?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.yingjun.ssm.dao.TOpreatorUserDao"
>
<!-- TOpreatorUser的resultMap,column是给数据库列起的别名,它对应property类的属性-->
<resultMap
id=
"result_TOpreatorUser_Map"
type=
"com.yingjun.ssm.entity.TOpreatorUser"
>
<id
column=
"id"
property=
"id"
/>
<result
column=
"valid"
property=
"valid"
/>
<result
column=
"operator_name"
property=
"operatorName"
/>
<result
column=
"phone_no"
property=
"phoneNo"
/>
<result
column=
"update_time"
property=
"updateTime"
/>
<result
column=
"create_time"
property=
"createTime"
/>
<result
column=
"role_id"
property=
"roleId"
/>
<result
column=
"operator_password"
property=
"operatorPassword"
/>
<result
column=
"operator_account"
property=
"operatorAccount"
/>
<result
column=
"email"
property=
"email"
/>
</resultMap>
<!-- 数据库中表名为:t_opreator_user的列名,as前是数据库的列明,as后是列的别名用于映射成实体类中的属性,需要注意的是别名必须与resultMap中的column别名一致 -->
<sql
id=
"t_opreator_user_Column"
>
t_opreator_user.id as id
,t_opreator_user.valid as valid
,t_opreator_user.operator_name as operator_name
,t_opreator_user.phone_no as phone_no
,t_opreator_user.update_time as update_time
,t_opreator_user.create_time as create_time
,t_opreator_user.role_id as role_id
,t_opreator_user.operator_password as operator_password
,t_opreator_user.operator_account as operator_account
,t_opreator_user.email as email
</sql>
<!--获得类名为:TOpreatorUser对应的数据库表的数据总行数 -->
<select
id=
"getTOpreatorUserRowCount"
resultType=
"java.lang.Long"
>
select count(id) from t_opreator_user
</select>
<!-- 获得类名为:TOpreatorUser对应数据库中表的数据集合 -->
<select
id=
"selectTOpreatorUser"
resultMap=
"result_TOpreatorUser_Map"
>
select
<include
refid=
"t_opreator_user_Column"
/>
from t_opreator_user
</select>
<!-- 获得一个TOpreatorUser对象,以参数TOpreatorUser对象中不为空的属性作为条件进行查询-->
<select
id=
"selectTOpreatorUserByObj"
parameterType=
"com.yingjun.ssm.entity.TOpreatorUser"
resultMap=
"result_TOpreatorUser_Map"
>
select
<include
refid=
"t_opreator_user_Column"
/>
from t_opreator_user
<where>
<if
test=
"email != null "
>
and t_opreator_user.email = #{email}
</if>
<if
test=
"operatorAccount != null "
>
and t_opreator_user.operator_account = #{operatorAccount}
</if>
<if
test=
"operatorPassword != null "
>
and t_opreator_user.operator_password = #{operatorPassword}
</if>
<if
test=
"roleId != null "
>
and t_opreator_user.role_id = #{roleId}
</if>
<if
test=
"createTime != null "
>
and t_opreator_user.create_time = #{createTime}
</if>
<if
test=
"updateTime != null "
>
and t_opreator_user.update_time = #{updateTime}
</if>
<if
test=
"phoneNo != null "
>
and t_opreator_user.phone_no = #{phoneNo}
</if>
<if
test=
"operatorName != null "
>
and t_opreator_user.operator_name = #{operatorName}
</if>
<if
test=
"valid != null "
>
and t_opreator_user.valid = #{valid}
</if>
<if
test=
"id != null "
>
and t_opreator_user.id = #{id}
</if>
</where>
</select>
<!-- 通过TOpreatorUser的id获得对应数据库中表的数据对象-->
<select
id=
"selectTOpreatorUserById"
parameterType=
"java.lang.Long"
resultMap=
"result_TOpreatorUser_Map"
>
select
<include
refid=
"t_opreator_user_Column"
/>
from t_opreator_user
where t_opreator_user.id = #{id}
</select>
<!-- 将TOpreatorUser插入到对应数据库的表中,包括属性值为null的数据-->
<insert
id=
"insertTOpreatorUser"
parameterType=
"com.yingjun.ssm.entity.TOpreatorUser"
>
insert into t_opreator_user(id,valid,operator_name,phone_no,update_time,create_time,role_id,operator_password,operator_account,email)
values(#{id},#{valid},#{operatorName},#{phoneNo},#{updateTime},#{createTime},#{roleId},#{operatorPassword},#{operatorAccount},#{email})
</insert>
<!-- 将TOpreatorUser中属性值不为null的数据,插入到对应数据库的表中-->
<insert
id=
"insertNonEmptyTOpreatorUser"
parameterType=
"com.yingjun.ssm.entity.TOpreatorUser"
>
insert into t_opreator_user
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
id,
</if>
<if
test=
"valid != null"
>
valid,
</if>
<if
test=
"operatorName != null"
>
operator_name,
</if>
<if
test=
"phoneNo != null"
>
phone_no,
</if>
<if
test=
"updateTime != null"
>
update_time,
</if>
<if
test=
"createTime != null"
>
create_time,
</if>
<if
test=
"roleId != null"
>
role_id,
</if>
<if
test=
"operatorPassword != null"
>
operator_password,
</if>
<if
test=
"operatorAccount != null"
>
operator_account,
</if>
<if
test=
"email != null"
>
email,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
#{id},
</if>
<if
test=
"valid != null"
>
#{valid},
</if>
<if
test=
"operatorName != null"
>
#{operatorName},
</if>
<if
test=
"phoneNo != null"
>
#{phoneNo},
</if>
<if
test=
"updateTime != null"
>
#{updateTime},
</if>
<if
test=
"createTime != null"
>
#{createTime},
</if>
<if
test=
"roleId != null"
>
#{roleId},
</if>
<if
test=
"operatorPassword != null"
>
#{operatorPassword},
</if>
<if
test=
"operatorAccount != null"
>
#{operatorAccount},
</if>
<if
test=
"email != null"
>
#{email},
</if>
</trim>
</insert>
<!-- 将TOpreatorUser批量插入到对应数据库的表中-->
<insert
id=
"insertTOpreatorUserByBatch"
parameterType=
"ArrayList"
>
insert into t_opreator_user(id,valid,operator_name,phone_no,update_time,create_time,role_id,operator_password,operator_account,email) values
<foreach
collection=
"list"
item=
"item"
index=
"index"
separator=
","
>
(#{item.id},#{item.valid},#{item.operatorName},#{item.phoneNo},#{item.updateTime},#{item.createTime},#{item.roleId},#{item.operatorPassword},#{item.operatorAccount},#{item.email})
</foreach>
</insert>
<!-- 通过TOpreatorUser的id将数据库表中对应的数据删除-->
<delete
id=
"deleteTOpreatorUserById"
parameterType=
"java.lang.Long"
>
delete from t_opreator_user
where id = #{id}
</delete>
<!-- 通过TOpreatorUser的id将TOpreatorUser的数据更新到数据库中对应的表,包括值null的数据-->
<update
id=
"updateTOpreatorUserById"
parameterType=
"com.yingjun.ssm.entity.TOpreatorUser"
>
update t_opreator_user set
valid=#{valid}
,operator_name=#{operatorName}
,phone_no=#{phoneNo}
,update_time=#{updateTime}
,create_time=#{createTime}
,role_id=#{roleId}
,operator_password=#{operatorPassword}
,operator_account=#{operatorAccount}
,email=#{email}
where id=#{id}
</update>
<!-- 通过TOpreatorUser的id将TOpreatorUser中属性值不为null的数据更新到数据库对应的表中-->
<update
id=
"updateNonEmptyTOpreatorUserById"
parameterType=
"com.yingjun.ssm.entity.TOpreatorUser"
>
update t_opreator_user
<set>
<if
test=
"valid != null"
>
valid=#{valid},
</if>
<if
test=
"operatorName != null"
>
operator_name=#{operatorName},
</if>
<if
test=
"phoneNo != null"
>
phone_no=#{phoneNo},
</if>
<if
test=
"updateTime != null"
>
update_time=#{updateTime},
</if>
<if
test=
"createTime != null"
>
create_time=#{createTime},
</if>
<if
test=
"roleId != null"
>
role_id=#{roleId},
</if>
<if
test=
"operatorPassword != null"
>
operator_password=#{operatorPassword},
</if>
<if
test=
"operatorAccount != null"
>
operator_account=#{operatorAccount},
</if>
<if
test=
"email != null"
>
email=#{email},
</if>
</set>
where id=#{id}
</update>
<!-- 根据邮箱以及密码查询当前管理员信息 -->
<select
id=
"queryAdminInfo"
parameterType=
"com.yingjun.ssm.entity.TOpreatorUser"
resultType=
"com.yingjun.ssm.entity.TOpreatorUser"
>
select
<include
refid=
"t_opreator_user_Column"
/>
from t_opreator_user
where t_opreator_user.email = #{email}
and t_opreator_user.operator_password = #{operatorPassword}
</select>
</mapper>
\ No newline at end of file
src/main/webapp/WEB-INF/jsp/admin/adminLogin.jsp
0 → 100644
浏览文件 @
82f1b9b6
<%@ page
contentType=
"text/html;charset=UTF-8"
language=
"java"
%>
<!DOCTYPE html>
<html>
<head>
<meta
charset=
"UTF-8"
>
<title>
用户登录
</title>
<!--其他样式-->
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/resource/css/safety.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/resource/css/enterpriseInfo.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/resource/css/proprietorship.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/resource/css/buyService.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/resource/css/home.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/resource/css/news.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/resource/css/registration.css"
/>
<!--自己的-->
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/resource/css/contactUs.css"
/>
<script
src=
"/resource/script/jquery.min.js"
type=
"text/javascript"
charset=
"utf-8"
></script>
<script
src=
"/resource/script/secretaryLogin.js"
type=
"text/javascript"
charset=
"utf-8"
></script>
<script
src=
"/resource/script/function.js"
type=
"text/javascript"
charset=
"utf-8"
></script>
</head>
<body>
<header>
<div
class=
"header-content"
>
<div
class=
"logo"
><span
class=
"logo-img"
>
益世集群注册平台
</span></div>
<div
class=
"header-menu"
>
<ul>
<li><a
href=
"home.html"
>
首页
</a></li>
<li><a
href=
"registration.html"
>
工商注册
</a></li>
<li
class=
"active"
><a
href=
"#"
>
个人中心
</a></li>
<li><a
href=
"enterprise.html"
>
企业中心
</a></li>
<li><a
href=
"/contactUs/connection"
>
联系我们
</a></li>
</ul>
</div>
</div>
</header>
<div
class=
"contactBg"
>
<img
class=
"bgImg"
src=
"/resource/img/userLogin.png"
/>
<div
class=
"logincontent userHeight"
>
<div
class=
"header"
>
<h3>
管理员登录
</h3>
</div>
<form
id=
"adminLogin"
action=
""
method=
"post"
>
<div
class=
"detail"
>
<ul>
<li>
<input
class=
"input telNum"
type=
"text"
name=
"email"
id=
"email"
value=
""
placeholder=
"请输入邮箱"
/>
</li>
<li>
<input
class=
"input pwd"
type=
"password"
name=
"operatorPassword"
id=
"password"
value=
""
placeholder=
"请输入密码"
/>
</li>
</ul>
<div
class=
"forgatPwd"
>
<a
href=
"/user/userRegister"
></a>
<a
href=
"/find/toFindPwd"
></a>
</div>
<div
id=
"loginBtn"
class=
"myBtn mar-t-30"
style=
""
>
<a>
立即登录
</a>
</div>
</div>
</form>
</div>
</div>
<footer>
<div
class=
"footer-menu"
>
<ul>
<li><a
href=
"#"
>
关于我们
</a></li>
<li><a
href=
"#"
>
工商注册
</a></li>
<li><a
href=
"#"
>
企业中心
</a></li>
<li><a
href=
"#"
>
个人中心
</a></li>
<li><a
href=
"#"
>
技术支持
</a></li>
<li><a
href=
"#"
>
免费热线
</a></li>
</ul>
<div
class=
"tel"
>
<div
class=
"telphone"
>
400-624-2001
</div>
<div
class=
"time"
>
周一至周日 8:00-22:00
</div>
</div>
</div>
<div
class=
"footer-right"
>
<span>
Copyright © 2004-2016
<strong>
SQYiShi.com
</strong>
ALL Rights Reserved 苏ICP备15048094号-2
</span>
</div>
</footer>
</body>
<script>
//用户登录异步提交表单
$
(
'
#loginBtn
'
).
bind
(
"
click
"
,
function
(){
alert
(
"
2123
"
);
$
.
ajax
({
type
:
'
POST
'
,
data
:
$
(
'
#adminLogin
'
).
serialize
(),
dataType
:
"
json
"
,
url
:
'
/admin/adminLogin
'
,
success
:
function
(
data
)
{
if
(
data
.
success
){
alert
(
data
.
error
);
window
.
location
.
href
=
"
/admin/adminLoginSuccess
"
;
}
else
{
alert
(
data
.
error
);
}
}
});
});
</script>
</html>
src/main/webapp/WEB-INF/jsp/admin/success.jsp
0 → 100644
浏览文件 @
82f1b9b6
<%@ page
contentType=
"text/html;charset=UTF-8"
language=
"java"
%>
<!DOCTYPE html>
<html>
<head>
<meta
charset=
"UTF-8"
>
<title>
用户登录
</title>
<!--其他样式-->
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/resource/css/safety.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/resource/css/enterpriseInfo.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/resource/css/proprietorship.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/resource/css/buyService.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/resource/css/home.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/resource/css/news.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/resource/css/registration.css"
/>
<!--自己的-->
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/resource/css/contactUs.css"
/>
<script
src=
"/resource/script/jquery.min.js"
type=
"text/javascript"
charset=
"utf-8"
></script>
<script
src=
"/resource/script/secretaryLogin.js"
type=
"text/javascript"
charset=
"utf-8"
></script>
<script
src=
"/resource/script/function.js"
type=
"text/javascript"
charset=
"utf-8"
></script>
</head>
<body>
管理员登录成功
</body>
</html>
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录