注释代码3

xuyang_branch
徐扬 5 months ago
parent 797aef41bd
commit 9e55697190

@ -1,16 +1,33 @@
/* 定义自定义字体 */
@font-face {
font-family: 'iconfont';
/* 定义字体的名称 */
src: url('../fonts/iconfont.eot');
/* 指定eot格式的字体文件路径 */
src: url('../fonts/iconfont.eot?#iefix') format('embedded-opentype'),
/* 兼容IE的eot格式字体文件路径 */
url('../fonts/iconfont.woff') format('woff'),
/* 指定woff格式的字体文件路径 */
url('../fonts/iconfont.ttf') format('truetype'),
/* 指定ttf格式的字体文件路径 */
url('../fonts/iconfont.svg#iconfont') format('svg');
/* 指定svg格式的字体文件路径 */
}
.iconfont{
font-family:"iconfont" !important;
font-size:16px;font-style:normal;
/* 使用自定义字体的样式 */
.iconfont {
font-family: "iconfont" !important;
/* 使用定义的字体名称,并标记为重要,以确保优先级 */
font-size: 16px;
/* 设置字体大小为16像素 */
font-style: normal;
/* 设置字体样式为正常,覆盖默认的斜体样式 */
-webkit-font-smoothing: antialiased;
/* 在Webkit浏览器中开启字体平滑提高字体渲染效果 */
-webkit-text-stroke-width: 0.2px;
/* 设置文本描边的宽度,用于提高字体清晰度 */
-moz-osx-font-smoothing: grayscale;
/* 在Mac OS X系统中开启灰度平滑提高字体渲染效果 */
}

@ -1,29 +1,42 @@
/* 设置字符集为UTF-8确保页面可以正确显示中文等字符 */
@charset "utf-8";
/* 导入layui框架的CSS文件layui是一个前端UI框架 */
@import url(../lib/layui/css/layui.css);
*{
/* 全局样式重置,移除所有元素的默认外边距和内边距,并设置默认字体 */
* {
margin: 0px;
padding: 0px;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
a{
/* 移除所有链接的下划线 */
a {
text-decoration: none;
}
html{
/* 设置HTML元素的宽高为100%,并隐藏水平滚动条,允许垂直滚动条 */
html {
width: 100%;
height: 100%;
overflow-x:hidden;
overflow-y:auto;
overflow-x: hidden;
overflow-y: auto;
}
body{
/* 设置body元素的宽度和最小高度确保内容可以填满整个视口 */
body {
width: 100%;
min-height: 100%;
}
.x-body{
/* 容器样式,为页面内容提供内边距 */
.x-body {
padding: 20px;
}
.x-nav{
/* 导航栏样式设置内边距、相对定位、z-index、边框、行高和高度 */
.x-nav {
padding: 0 20px;
position: relative;
z-index: 99;
@ -32,395 +45,726 @@ body{
height: 39px;
overflow: hidden;
}
xblock{
/* 错误xblock应该是 .x-block块级元素样式设置显示类型、外边距、内边距、行高、边框和背景颜色 */
.x-block {
display: block;
margin-bottom: 10px;
padding: 5px;
line-height: 22px;
/* border-left: 5px solid #009688; */
/* border-left: 5px solid #009688; */ /* 注释掉的边框样式 */
border-radius: 0 2px 2px 0;
background-color: #f2f2f2;
}
.x-right{
float: right;
/* 右浮动样式,用于将元素向右浮动 */
.x-right {
float: right;
}
.x-so{
/*text-align: center;*/
/*background: #f2f2f2 url() 0 0 no-repeat;*/
/* 搜索栏样式,设置下外边距 */
.x-so {
margin-bottom: 20px;
/*text-align: center;*/ /* 注释掉的文本居中样式 */
/*background: #f2f2f2 url() 0 0 no-repeat;*/ /* 注释掉的背景样式 */
}
.x-so input.layui-input{
/* 搜索栏中的layui输入框样式设置宽度 */
.x-so input.layui-input {
width: 150px;
}
.x-so .layui-form-label{
/* 搜索栏中的layui表单标签样式设置显示类型为行内块级元素 */
.x-so .layui-form-label {
display: inline-block;
}
.x-so input.layui-input,.x-so input.layui-btn{
/* 搜索栏中的layui输入框和按钮样式设置显示类型为行内块级元素 */
.x-so input.layui-input, .x-so input.layui-btn {
display: inline-block;
}
.x-red{
/* 红色文本样式 */
.x-red {
color: red;
}
.x-a{
/* 链接文本颜色样式 */
.x-a {
color: #1AA093;
}
.x-a:hover{
/* 链接悬停时的文本颜色样式 */
.x-a:hover {
color: #127F74;
}
.x-sort{
/* 排序操作的高度样式 */
.x-sort {
height: 30px;
}
.x-show{
/* 显示操作的可点击样式 */
.x-show {
cursor: pointer;
}
.layui-form-switch{
/* layui表单开关的顶部外边距样式 */
.layui-form-switch {
margin-top: 0px;
}
/* layui输入框和文本域获得焦点时的边框颜色样式 */
.layui-input:focus, .layui-textarea:focus {
border-color: #189f92!important;
}
.page{
/* 分页容器的样式 */
.page {
margin-top: 20px;
/* 上外边距 */
text-align: center;
/* 文本居中 */
}
.page a{
/* 分页链接的样式 */
.page a {
display: inline-block;
/* 显示为行内块级元素 */
background: #fff url(#) 0 0 no-repeat;
/* 背景图片,这里没有指定图片,所以不会显示 */
color: #888;
/* 文本颜色 */
padding: 10px;
/* 内边距 */
min-width: 15px;
/* 最小宽度 */
border: 1px solid #E2E2E2;
/* 边框样式 */
}
.page span{
/* 分页数字的样式 */
.page span {
display: inline-block;
/* 显示为行内块级元素 */
padding: 10px;
/* 内边距 */
min-width: 15px;
/* 最小宽度 */
border: 1px solid #E2E2E2;
/* 边框样式 */
}
.page span.current{
/* 当前页码的样式 */
.page span.current {
display: inline-block;
/* 显示为行内块级元素 */
background: #009688 url(#) 0 0 no-repeat;
/* 背景颜色和图片 */
color: #fff;
/* 文本颜色 */
padding: 10px;
/* 内边距 */
min-width: 15px;
/* 最小宽度 */
border: 1px solid #009688;
/* 边框样式 */
}
.page .pagination li{
/* 分页器列表项的样式 */
.page .pagination li {
display: inline-block;
/* 显示为行内块级元素 */
margin-right: 5px;
/* 右外边距 */
text-align: center;
/* 文本居中 */
}
.page .pagination li.active span{
/* 激活状态下的分页器列表项的样式 */
.page .pagination li.active span {
background: #009688 url(#) 0 0 no-repeat;
/* 背景颜色和图片 */
color: #fff;
/* 文本颜色 */
border: 1px solid #009688;
/* 边框样式 */
}
/*登录样式*/
/*头部*/
.container{
/* 容器样式,通常用于页面的顶部导航 */
.container {
width: 100%;
/* 设置容器宽度为100% */
height: 45px;
/* 设置容器高度为45像素 */
background-color: #222;
/* 设置容器背景颜色为深灰色 */
border-bottom: 1px solid rgba(255, 255, 255, 0.2);
/* 设置容器底部边框为半透明的白色 */
}
.container .logo a{
/* 容器内logo链接的样式 */
.container .logo a {
float: left;
/* 设置元素左浮动 */
color: #fff;
/* 设置文本颜色为白色 */
font-size: 18px;
/* 设置字体大小为18像素 */
padding-left: 20px;
/* 设置左侧内边距为20像素 */
line-height: 45px;
/* 设置行高为45像素与容器高度一致实现垂直居中 */
width: 200px;
/* 设置元素宽度为200像素 */
}
.container .right{
background-color:rgba(0,0,0,0);
float: right;
/* 容器右侧内容的样式 */
.container .right {
background-color: rgba(0, 0, 0, 0);
/* 设置背景颜色为透明 */
float: right;
/* 设置元素右浮动 */
}
.container .left_open{
/* 容器左侧打开按钮的样式 */
.container .left_open {
height: 45px;
/* 设置高度为45像素 */
float: left;
/* 设置元素左浮动 */
}
.container .left_open i{
/* 容器左侧打开按钮图标的样式 */
.container .left_open i {
display: block;
background: rgba(255,255,255,0.1) url(#) 0 0 no-repeat;
/* 设置为块级元素 */
background: rgba(255, 255, 255, 0.1) url(#) 0 0 no-repeat;
/* 设置背景颜色和图片,这里没有指定图片,所以不会显示 */
color: #fff;
/* 设置文本颜色为白色 */
width: 32px;
/* 设置宽度为32像素 */
height: 32px;
/* 设置高度为32像素 */
line-height: 32px;
/* 设置行高为32像素实现垂直居中 */
border-radius: 3px;
/* 设置边框圆角 */
text-align: center;
/* 设置文本居中 */
margin-top: 7px;
/* 设置顶部外边距为7像素 */
cursor: pointer;
/* 设置鼠标悬停时为指针形状 */
}
.container .left_open i:hover{
background: rgba(255,255,255,0.3) url(#) 0 0 no-repeat;
/* 容器左侧打开按钮图标悬停时的样式 */
.container .left_open i:hover {
background: rgba(255, 255, 255, 0.3) url(#) 0 0 no-repeat;
/* 设置悬停时的背景颜色和图片 */
}
.container .left{
background-color:rgba(0,0,0,0);
/* 容器左侧内容的样式 */
.container .left {
background-color: rgba(0, 0, 0, 0);
/* 设置背景颜色为透明 */
float: left;
/* 设置元素左浮动 */
}
.container .layui-nav-item{
/* 容器导航项的样式 */
.container .layui-nav-item {
line-height: 45px;
/* 设置行高为45像素与容器高度一致实现垂直居中 */
}
.container .layui-nav-more{
/* 容器导航项下拉三角的样式 */
.container .layui-nav-more {
top: 20px;
/* 设置下拉三角的顶部位置 */
}
.container .layui-nav-child{
/* 容器导航子菜单的样式 */
.container .layui-nav-child {
top: 50px;
/* 设置子菜单的顶部位置 */
}
.container .layui-nav-child i{
/* 容器导航子菜单项图标的样式 */
.container .layui-nav-child i {
margin-right: 10px;
/* 设置图标右侧外边距为10像素 */
}
.layui-nav .layui-nav-item a{
/* layui导航项链接的样式 */
.layui-nav .layui-nav-item a {
color: #fff;
/* 设置文本颜色为白色 */
cursor: pointer;
/* 设置鼠标悬停时为指针形状 */
}
.layui-nav .layui-nav-child a{
/* layui导航子菜单链接的样式 */
.layui-nav .layui-nav-child a {
color: #333;
/* 设置文本颜色为深灰色 */
cursor: pointer;
/* 设置鼠标悬停时为指针形状 */
}
.left-nav{
/* 左侧导航栏的样式 */
.left-nav {
position: absolute;
/* 绝对定位 */
top: 46px;
/* 顶部距离为46像素 */
bottom: 42px;
/* 底部距离为42像素 */
left: 0;
/* 左侧距离为0 */
z-index: 2;
/* 设置堆叠顺序为2 */
padding-top: 10px;
/* 顶部内边距为10像素 */
background-color: #EEEEEE;
/* 设置背景颜色为浅灰色 */
width: 220px;
/* 设置宽度为220像素 */
max-width: 220px;
/* 设置最大宽度为220像素 */
overflow: auto;
overflow-x:hidden;
/* 当内容超出时显示滚动条 */
overflow-x: hidden;
/* 隐藏水平滚动条 */
border-right: 1px solid #e5e5e5;
/*width: 0px;*/
/* 设置右侧边框为浅灰色 */
}
.left-nav #nav li{
/* 左侧导航栏列表项的样式 */
.left-nav #nav li {
border-bottom: 1px solid #e5e5e5;
/* 设置底部边框为浅灰色 */
}
.left-nav #nav li:hover > a{
/*color: blue;*/
/* 左侧导航栏列表项悬停时的样式(注释掉的部分) */
.left-nav #nav li:hover > a {
/*color: blue;*/ /* 设置悬停时文本颜色为蓝色(注释掉) */
}
.left-nav #nav .current{
/* 当前激活的左侧导航栏列表项的样式 */
.left-nav #nav .current {
background-color: rgba(0, 0, 0, 0.3);
/* 设置背景颜色为半透明的黑色 */
}
.left-nav #nav li a{
/* 左侧导航栏列表项链接的样式 */
.left-nav #nav li a {
font-size: 14px;
/* 设置字体大小为14像素 */
padding: 10px 15px 10px 20px;
/* 设置内边距 */
display: block;
/* 显示为块级元素 */
cursor: pointer;
/* 设置鼠标悬停时为指针形状 */
}
.left-nav #nav li a cite{
/* 左侧导航栏列表项链接的标题样式 */
.left-nav #nav li a cite {
font-size: 14px;
/* 设置字体大小为14像素 */
}
.left-nav #nav li .sub-menu{
/* 左侧导航栏子菜单的默认样式(隐藏) */
.left-nav #nav li .sub-menu {
display: none;
/* 隐藏子菜单 */
}
.left-nav #nav li .opened{
/* 左侧导航栏展开的子菜单样式 */
.left-nav #nav li .opened {
display: block;
/* 显示子菜单 */
}
.left-nav #nav li .opened:hover{
/* 左侧导航栏展开的子菜单悬停时的样式(注释掉的部分) */
.left-nav #nav li .opened:hover {
/*background: #fff url() 0 0 no-repeat;*/
/* 设置悬停时背景颜色和图片(注释掉) */
}
.left-nav #nav li .opened .current{
}
.left-nav #nav li .sub-menu li:hover{
/*color: blue;*/
/*background: #fff url() 0 0 no-repeat;*/
/* 左侧导航栏展开的子菜单中当前激活的列表项样式(未设置样式) */
/* 左侧导航栏子菜单列表项悬停时的样式(注释掉的部分) */
.left-nav #nav li .sub-menu li:hover {
/*color: blue;*/ /* 设置悬停时文本颜色为蓝色(注释掉) */
/*background: #fff url() 0 0 no-repeat;*/
/* 设置悬停时背景颜色和图片(注释掉) */
}
.left-nav #nav li .sub-menu li a{
/* 左侧导航栏子菜单列表项链接的样式 */
.left-nav #nav li .sub-menu li a {
padding: 12px 15px 12px 30px;
/* 设置内边距 */
font-size: 14px;
/* 设置字体大小为14像素 */
cursor: pointer;
/* 设置鼠标悬停时为指针形状 */
}
.left-nav #nav li .sub-menu li .sub-menu li a{
/* 左侧导航栏更深层次的子菜单列表项链接的样式 */
.left-nav #nav li .sub-menu li .sub-menu li a {
padding-left: 45px;
/* 设置左侧内边距为45像素 */
}
.left-nav #nav li .sub-menu li a:hover{
/* 左侧导航栏子菜单列表项链接悬停时的样式 */
.left-nav #nav li .sub-menu li a:hover {
color: #148cf1;
/* 设置悬停时文本颜色为蓝色 */
}
.left-nav #nav li .sub-menu li a i{
/* 左侧导航栏子菜单列表项链接图标的样式 */
.left-nav #nav li .sub-menu li a i {
font-size: 12px;
/* 设置图标字体大小为12像素 */
}
.left-nav #nav li a i{
/* 左侧导航栏列表项链接图标的样式 */
.left-nav #nav li a i {
padding-right: 10px;
/* 设置图标右侧外边距为10像素 */
line-height: 14px;
/* 设置图标行高为14像素 */
}
.left-nav #nav li .nav_right{
/* 左侧导航栏列表项右侧内容的样式 */
.left-nav #nav li .nav_right {
float: right;
/* 设置内容浮动到右侧 */
font-size: 16px;
/* 设置字体大小为16像素 */
}
/* 左侧滑动按钮的样式 */
.x-slide_left {
width: 17px;
/* 设置宽度为17像素 */
height: 61px;
/* 设置高度为61像素 */
background: url(#) 0 0 no-repeat;
/* 设置背景图片,目前为空 */
position: absolute;
/* 绝对定位 */
top: 200px;
/* 顶部距离为200像素 */
left: 221px;
/* 左侧距离为221像素 */
cursor: pointer;
/* 设置鼠标悬停时为指针形状 */
z-index: 3;
/* 设置堆叠顺序为3 */
}
.page-content{
/* 页面内容的样式 */
.page-content {
position: absolute;
/* 绝对定位 */
top: 46px;
/* 顶部距离为46像素 */
right: 0;
/* 右侧距离为0 */
bottom: 42px;
/* 底部距离为42像素 */
left: 221px;
/* 左侧距离为221像素 */
overflow: hidden;
/* 隐藏溢出的内容 */
z-index: 1;
/* 设置堆叠顺序为1 */
}
.page-content-bg{
/* 页面内容背景的样式 */
.page-content-bg {
position: absolute;
/* 绝对定位 */
top: 46px;
/* 顶部距离为46像素 */
right: 0;
/* 右侧距离为0 */
bottom: 42px;
/* 底部距离为42像素 */
left: 221px;
background: rgba(0,0,0,0.5); url() 0 0 no-repeat;
/* 左侧距离为221像素 */
background: rgba(0,0,0,0.5);
/* 设置半透明的黑色背景 */
url() 0 0 no-repeat;
/* 设置背景图片,目前为空 */
overflow: hidden;
/* 隐藏溢出的内容 */
z-index: 100;
/* 设置堆叠顺序为100 */
display: none;
/* 默认不显示 */
}
.page-content .tab{
/* 页面内容中标签页的样式 */
.page-content .tab {
height: 100%;
/* 设置高度为100% */
width: 100%;
/* 设置宽度为100% */
background: #EFEEF0 url(#) 0 0 no-repeat;
/* 设置背景颜色和图片,目前为空 */
margin: 0px;
/* 移除默认外边距 */
}
.page-content .layui-tab-title{
/* 页面内容中标签页标题的样式 */
.page-content .layui-tab-title {
/*padding-top: 5px;*/
/* 注释掉的顶部内边距 */
height: 35px;
/* 设置高度为35像素 */
background: #EFEEF0 url(#) 0 0 no-repeat;
/* 设置背景颜色和图片,目前为空 */
position: relative;
/* 相对定位 */
z-index: 100;
/* 设置堆叠顺序为100 */
}
.page-content .layui-tab-title li.home i{
/* 页面内容中标签页标题的首页图标样式 */
.page-content .layui-tab-title li.home i {
padding-right: 5px;
/* 设置图标右侧外边距为5像素 */
}
.page-content .layui-tab-title li.home .layui-tab-close{
/* 页面内容中标签页标题的首页关闭按钮样式 */
.page-content .layui-tab-title li.home .layui-tab-close {
display: none;
/* 不显示关闭按钮 */
}
.page-content .layui-tab-title li{
/* 页面内容中标签页标题列表项的样式 */
.page-content .layui-tab-title li {
line-height: 35px;
/* 设置行高为35像素确保文本垂直居中 */
}
.page-content .layui-tab-title .layui-this:after{
/* 页面内容中当前激活标签页标题的下划线样式 */
.page-content .layui-tab-title .layui-this:after {
height: 36px;
/* 设置下划线高度为36像素 */
}
.page-content .layui-tab-title li .layui-tab-close{
/* 页面内容中标签页标题的关闭按钮样式 */
.page-content .layui-tab-title li .layui-tab-close {
border-radius: 50%;
/* 设置关闭按钮为圆形 */
}
.page-content .layui-tab-title .layui-this{
/* 页面内容中当前激活标签页标题的样式 */
.page-content .layui-tab-title .layui-this {
background: #fff url(#) 0 0 no-repeat;
/* 设置背景颜色和图片,目前为空 */
}
.page-content .layui-tab-bar{
height:34px;
/* 页面内容中标签页标题的水平滚动条样式 */
.page-content .layui-tab-bar {
height: 34px;
/* 设置高度为34像素 */
line-height: 35px;
/* 设置行高为35像素确保滚动条垂直居中 */
}
.page-content .layui-tab-content{
/* 页面内容中标签页内容的样式 */
.page-content .layui-tab-content {
position: absolute;
/* 绝对定位 */
top: 36px;
/* 顶部距离为36像素 */
bottom: 0px;
/* 底部距离为0像素 */
width: 100%;
/* 宽度为100% */
background: #fff url(#) 0 0 no-repeat;
/* 设置背景颜色和图片,目前为空 */
padding: 0px;
/* 移除内边距 */
overflow: hidden;
/* 隐藏溢出的内容 */
}
.page-content .layui-tab-content .layui-tab-item{
/* 页面内容中单个标签页项的样式 */
.page-content .layui-tab-content .layui-tab-item {
width: 100%;
/* 宽度为100% */
height: 100%;
/* 高度为100% */
}
.page-content .layui-tab-content .layui-tab-item iframe{
/* 页面内容中单个标签页项内iframe的样式 */
.page-content .layui-tab-content .layui-tab-item iframe {
width: 100%;
/* 宽度为100% */
height: 100%;
/* 高度为100% */
}
.x-admin-carousel,.layui-carousel,.x-admin-carousel>[carousel-item]>* {
background-color:#fff
/* 设置轮播图及其子项的背景颜色 */
.x-admin-carousel, .layui-carousel, .x-admin-carousel>[carousel-item]>* {
background-color: #fff;
/* 白色背景 */
}
/* 设置后台管理面板中待办事项的样式 */
.x-admin-backlog .x-admin-backlog-body {
display:block;
padding:10px 15px;
background-color:#f8f8f8;
color:#999;
border-radius:2px;
transition:all .3s;
-webkit-transition:all .3s
display: block;
/* 块级显示 */
padding: 10px 15px;
/* 内边距 */
background-color: #f8f8f8;
/* 浅灰色背景 */
color: #999;
/* 深灰色文本 */
border-radius: 2px;
/* 边框圆角 */
transition: all .3s;
/* 过渡效果所有属性变化在0.3秒内完成 */
-webkit-transition: all .3s;
/* 兼容旧版Webkit浏览器所有属性变化在0.3秒内完成 */
}
/* 待办事项标题样式 */
.x-admin-backlog-body h3 {
padding-bottom:10px;
font-size:12px
padding-bottom: 10px;
/* 底部内边距 */
font-size: 12px;
/* 字体大小 */
}
/* 待办事项数字样式 */
.x-admin-backlog-body p cite {
font-style:normal;
font-size:30px;
font-weight:300;
color:#009688
font-style: normal;
/* 正常字体样式 */
font-size: 30px;
/* 字体大小 */
font-weight: 300;
/* 字体粗细 */
color: #009688;
/* 绿色文本 */
}
/* 待办事项鼠标悬停时的样式 */
.x-admin-backlog-body:hover {
background-color:#CFCFCF;
color:#888
background-color: #CFCFCF;
/* 悬停时背景颜色 */
color: #888;
/* 悬停时文本颜色 */
}
/* 页脚样式 */
.welcome-footer {
padding: 30px 0;
/* 顶部和底部内边距 */
line-height: 30px;
/* 行高 */
text-align: center;
/* 文本居中 */
background-color: #eee;
/* 浅灰色背景 */
color: #666;
/* 深灰色文本 */
font-weight: 300;
/* 字体粗细 */
}
.welcome-footer{padding: 30px 0; line-height: 30px; text-align: center; background-color: #eee; color: #666; font-weight: 300;}
body .layui-layout-admin .footer-demo{height: auto; padding: 15px 0; line-height: 26px;}
.welcome-footer a{padding: 0 5px;}
/* 后台管理布局页脚的样式 */
body .layui-layout-admin .footer-demo {
height: auto;
/* 高度自适应 */
padding: 15px 0;
/* 顶部和底部内边距 */
line-height: 26px;
/* 行高 */
}
/* 页脚链接样式 */
.welcome-footer a {
padding: 0 5px;
/* 左右内边距 */
}
/* 表格单元格样式,确保内容不会超出单元格 */
table th, table td {
word-break: break-all;
/* 允许在单词内部进行断行 */
}
.footer{
/* 页脚样式 */
.footer {
position: fixed;
/* 固定定位,相对于视口 */
bottom: 0px;
/* 距离视口底部0像素 */
width: 100%;
/* 宽度为100% */
background-color: #222;
/* 深灰色背景 */
border-top: 1px solid rgba(255, 255, 255, 0.2);
/* 上边框为半透明白色 */
line-height: 41px;
/* 行高为41像素 */
color: #fff;
/* 文本颜色为白色 */
/*padding-left: 10px;*/
/* 左侧内边距,已注释掉 */
}
.footer .copyright{
.footer .copyright {
margin-left: 10px;
/* 左侧外边距为10像素 */
}
@media screen and (max-width: 768px){
.fast-add{
/* 响应式设计针对屏幕宽度小于或等于768像素的设备 */
@media screen and (max-width: 768px) {
.fast-add {
display: none;
/* 隐藏快速添加按钮 */
}
.layui-nav .to-index{
.layui-nav .to-index {
display: none;
/* 隐藏返回首页的导航项 */
}
.container .logo a{
.container .logo a {
width: 140px;
/* 调整logo宽度 */
}
.container .left_open {
/*float: right;*/
/*float: right;*/ /* 已注释掉,可能用于调整左侧菜单按钮位置 */
}
.left-nav{
.left-nav {
left: -221px;
/* 将左侧导航栏隐藏在视口左侧 */
}
.page-content{
.page-content {
left: 0px;
/* 将页面内容区域左对齐 */
}
.page-content .layui-tab-content .layui-tab-item{
-webkit-overflow-scrolling: touch;
overflow-y: scroll;
.page-content .layui-tab-content .layui-tab-item {
-webkit-overflow-scrolling: touch;
/* 在iOS设备上启用硬件加速滚动 */
overflow-y: scroll;
/* 启用垂直滚动条 */
}
.x-so input.layui-input{
.x-so input.layui-input {
width: 100%;
/* 搜索输入框宽度为100% */
margin: 10px;
/* 搜索输入框的外边距 */
}
}

@ -3,93 +3,114 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.itheima.dao.AdminDao" >
<!--登陆查询-->
<!-- 管理员登录查询 -->
<select id="findAdmin" parameterType="Admin" resultType="Admin">
select * from d_admin
where
<!-- 如果用户名不为空且不为空字符串,则按用户名查询 -->
<if test="a_username!=null and a_username!='' ">
a_username = #{a_username}
a_username = #{a_username}
</if>
<!-- 如果密码不为空且不为空字符串,则按密码查询,并与用户名查询结果进行交集 -->
<if test="a_password!=null and a_password!='' ">
and a_password = #{a_password}
and a_password = #{a_password}
</if>
</select>
<!--分页查询-->
<!-- 分页查询管理员列表 -->
<select id="getAdminList" parameterType="Admin" resultType="Admin">
select * from d_admin
<where>
<!-- 如果用户名不为空且不为空字符串,则按用户名模糊查询 -->
<if test="a_username!=null and a_username!='' ">
and a_username like '%${a_username}%'
and a_username like '%${a_username}%'
</if>
<!-- 如果描述不为空且不为空字符串,则按描述模糊查询 -->
<if test="a_describe!=null and a_describe!=''">
and a_describe like '%${a_describe}%'
and a_describe like '%${a_describe}%'
</if>
<!-- 如果ID不为空且不为0则按ID模糊查询 -->
<if test="a_id!=null and a_id!=0">
and a_id like '%${a_id}%'
and a_id like '%${a_id}%'
</if>
</where>
ORDER BY a_id asc
<!-- 按ID升序排序 -->
ORDER BY a_id asc
<!-- 分页参数 -->
limit #{currentPage},#{pageSize}
</select>
<!--查询数据总数-->
<select id="totalCount" resultType="Integer">
<!-- 查询管理员总数 -->
<select id="totalCount" resultType="Integer">
select count(a_id) from d_admin
<where>
<!-- 如果用户名不为空且不为空字符串,则按用户名模糊查询 -->
<if test="a_username!=null and a_username!='' ">
and a_username like '%${a_username}%'
and a_username like '%${a_username}%'
</if>
<!-- 如果描述不为空且不为空字符串,则按描述模糊查询 -->
<if test="a_describe!=null and a_describe!=''">
and a_describe like '%${a_describe}%'
and a_describe like '%${a_describe}%'
</if>
<!-- 如果ID不为空且不为0则按ID模糊查询 -->
<if test="a_id!=null and a_id!=0">
and a_id like '%${a_id}%'
and a_id like '%${a_id}%'
</if>
</where>
</select>
<!--添加管理员信息-->
<!-- 添加管理员信息 -->
<insert id="addAdmin" parameterType="Admin" keyProperty="a_id" useGeneratedKeys="true">
insert into d_admin (a_username,a_password,a_name,a_phone,a_power,a_describe)
values(#{a_username},#{a_password},#{a_name},#{a_phone},#{a_power},#{a_describe})
</insert>
<!--通过id删除管理员信息-->
<delete id="deleteAdmin" parameterType="Integer" >
<!-- 通过ID删除管理员信息 -->
<delete id="deleteAdmin" parameterType="Integer">
delete from d_admin where a_id=#{a_id}
</delete>
<select id="findAdminById" parameterType="Integer" resultType="Admin" >
<!-- 通过ID查询管理员信息 -->
<select id="findAdminById" parameterType="Integer" resultType="Admin">
select * from d_admin where a_id=#{a_id}
</select>
<!-- 获取所有管理员信息 -->
<select id="getAll" resultType="Admin">
select * from d_admin;
</select>
<!--修改管理员信息-->
<!-- 修改管理员信息 -->
<update id="updateAdmin" parameterType="Admin">
update d_admin
<set>
<!-- 如果用户名不为空且不为空字符串,则更新用户名 -->
<if test="a_username!=null and a_username !=''">
a_username=#{a_username},
</if>
<!-- 如果密码不为空且不为空字符串,则更新密码 -->
<if test="a_password !=null and a_password !=''">
a_password=#{a_password},
</if>
<!-- 如果姓名不为空且不为空字符串,则更新姓名 -->
<if test="a_name !=null and a_name !=''">
a_name=#{a_name},
</if>
<!-- 如果电话不为空且不为0则更新电话 -->
<if test="a_phone !=null and a_phone !=0">
a_phone=#{a_phone},
</if>
<!-- 如果权限不为空且不为空字符串,则更新权限 -->
<if test="a_power !=null and a_power !=''">
a_power=#{a_power},
</if>
<!-- 如果描述不为空且不为空字符串,则更新描述 -->
<if test="a_describe!=null and a_describe!=''">
a_describe=#{a_describe},
</if>
</set>
where a_id = #{a_id}
</update>
</mapper>

@ -3,62 +3,78 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.itheima.dao.ClassDao" >
<!--分页查询-->
<!-- 分页查询班级列表 -->
<select id="getClassList" parameterType="Class" resultType="Class">
select *from d_class
select * from d_class
<where>
<!-- 如果班级名称不为空且不为空字符串,则按班级名称模糊查询 -->
<if test="c_classname!=null and c_classname!='' ">
and c_classname like '%${c_classname}%'
and c_classname like '%${c_classname}%'
</if>
<!-- 如果辅导员不为空且不为空字符串,则按辅导员模糊查询 -->
<if test="c_counsellor!=null and c_counsellor!=''">
and c_counsellor like '%${c_counsellor}%'
and c_counsellor like '%${c_counsellor}%'
</if>
<!-- 如果班级ID不为空且不为0则按班级ID模糊查询 -->
<if test="c_classid!=null and c_classid!=0">
and c_classid like '%${c_classid}%'
and c_classid like '%${c_classid}%'
</if>
</where>
ORDER BY c_id asc
<!-- 按ID升序排序 -->
ORDER BY c_id asc
<!-- 分页参数 -->
limit #{currentPage},#{pageSize}
</select>
<!--查询数据总数-->
<select id="totalCount" resultType="Integer">
<!-- 查询班级总数 -->
<select id="totalCount" resultType="Integer">
select count(c_id) from d_class
<where>
<!-- 如果班级名称不为空且不为空字符串,则按班级名称模糊查询 -->
<if test="c_classname!=null and c_classname!='' ">
and c_classname like '%${c_classname}%'
and c_classname like '%${c_classname}%'
</if>
<!-- 如果辅导员不为空且不为空字符串,则按辅导员模糊查询 -->
<if test="c_counsellor!=null and c_counsellor!=''">
and c_counsellor like '%${c_counsellor}%'
and c_counsellor like '%${c_counsellor}%'
</if>
<!-- 如果班级ID不为空且不为0则按班级ID模糊查询 -->
<if test="c_classid!=null and c_classid!=0">
and c_classid like '%${c_classid}%'
and c_classid like '%${c_classid}%'
</if>
</where>
</where>
</select>
<!--通过id删除班级信息-->
<delete id="deleteClass" parameterType="Integer" >
<!-- 通过ID删除班级信息 -->
<delete id="deleteClass" parameterType="Integer">
delete from d_class where c_id=#{c_id}
</delete>
<!--添加班级信息-->
<!-- 添加班级信息 -->
<insert id="addClass" parameterType="Class" keyProperty="c_id" useGeneratedKeys="true">
insert into d_class (c_classid,c_classname,c_counsellor)
values(#{c_classid},#{c_classname},#{c_counsellor})
insert into d_class (c_classid, c_classname, c_counsellor)
values(#{c_classid}, #{c_classname}, #{c_counsellor})
</insert>
<select id="findClassById" parameterType="Integer" resultType="Class" >
<!-- 通过ID查询班级信息 -->
<select id="findClassById" parameterType="Integer" resultType="Class">
select * from d_class where c_id=#{c_id}
</select>
<!--修改班级信息-->
<!-- 修改班级信息 -->
<update id="updateClass" parameterType="Class">
update d_class
<set>
<!-- 如果班级ID不为空且不为0则更新班级ID -->
<if test="c_classid!=null and c_classid!=0">
c_classid=#{c_classid},
</if>
<!-- 如果班级名称不为空且不为空字符串,则更新班级名称 -->
<if test="c_classname !=null and c_classname !=''">
c_classname=#{c_classname},
</if>
<!-- 如果辅导员不为空且不为空字符串,则更新辅导员 -->
<if test="c_counsellor !=null and c_counsellor !=''">
c_counsellor=#{c_counsellor},
</if>
@ -66,6 +82,7 @@
where c_id = #{c_id}
</update>
<!--Mybatis使用Collection进行表关联查询关联一对多数据类型(class为一student为多)且需要有id-->
<!--Association关联一对一类型-->
<!--班级人员信息查询信息-->

@ -3,78 +3,93 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.itheima.dao.DormCleanDao" >
<!--分页查询-->
<!-- 分页查询宿舍卫生列表 -->
<select id="getDormCleanList" parameterType="DormClean" resultType="DormClean">
select *from d_dormgrade
select * from d_dormgrade
<where>
<!-- 如果宿舍ID不为空且不为0则按宿舍ID模糊查询 -->
<if test="d_id!=null and d_id!=0">
and d_id like '%${d_id}%'
and d_id like '%${d_id}%'
</if>
<!-- 如果宿舍楼不为空且不为空字符串,则按宿舍楼模糊查询 -->
<if test="d_dormbuilding !=null and d_dormbuilding !=''">
and d_dormbuilding like '%${d_dormbuilding}%'
and d_dormbuilding like '%${d_dormbuilding}%'
</if>
</where>
ORDER BY g_id asc
<!-- 按ID升序排序 -->
ORDER BY g_id asc
<!-- 分页参数 -->
limit #{currentPage},#{pageSize}
</select>
<!--查询数据总数-->
<select id="totalCount" resultType="Integer">
<!-- 查询宿舍卫生信息总数 -->
<select id="totalCount" resultType="Integer">
select count(g_id) from d_dormgrade
<where>
<!-- 如果宿舍ID不为空且不为0则按宿舍ID模糊查询 -->
<if test="d_id!=null and d_id!=0">
and d_id like '%${d_id}%'
and d_id like '%${d_id}%'
</if>
<!-- 如果宿舍楼不为空且不为空字符串,则按宿舍楼模糊查询 -->
<if test="d_dormbuilding !=null and d_dormbuilding !=''">
and d_dormbuilding like '%${d_dormbuilding}%'
and d_dormbuilding like '%${d_dormbuilding}%'
</if>
</where>
</select>
<!--添加宿舍卫生信息-->
<!-- 添加宿舍卫生信息 -->
<insert id="addDormClean" parameterType="DormClean" keyProperty="g_id" useGeneratedKeys="true">
insert into d_dormgrade (d_id,d_dormbuilding,d_grade,create_time,update_time)
values(#{d_id},#{d_dormbuilding},#{d_grade},now(),now())
insert into d_dormgrade (d_id, d_dormbuilding, d_grade, create_time, update_time)
values(#{d_id}, #{d_dormbuilding}, #{d_grade}, now(), now())
</insert>
<!--通过id删除宿舍卫生信息-->
<delete id="deleteDormClean" parameterType="Integer" >
<!-- 通过ID删除宿舍卫生信息 -->
<delete id="deleteDormClean" parameterType="Integer">
delete from d_dormgrade where g_id=#{g_id}
</delete>
<select id="findDormCleanById" parameterType="Integer" resultType="DormClean" >
<!-- 通过ID查询宿舍卫生信息 -->
<select id="findDormCleanById" parameterType="Integer" resultType="DormClean">
select * from d_dormgrade where g_id=#{g_id}
</select>
<!--修改宿舍卫生信息-->
<!-- 修改宿舍卫生信息 -->
<update id="updateDormClean" parameterType="DormClean">
update d_dormgrade
<set>
<!-- 如果宿舍ID不为空且不为0则更新宿舍ID -->
<if test="d_id!=null and d_id!=0">
d_id=#{d_id},
</if>
<!-- 如果宿舍楼不为空且不为空字符串,则更新宿舍楼 -->
<if test="d_dormbuilding !=null and d_dormbuilding !=''">
d_dormbuilding=#{d_dormbuilding},
</if>
<!-- 如果卫生评分不为空且不为0则更新卫生评分 -->
<if test="d_grade!=null and d_grade!=0">
d_grade=#{d_grade},
</if>
<if test="update_time != null" >
<!-- 如果更新时间不为空,则更新时间为当前时间 -->
<if test="update_time != null">
update_time = now(),
</if>
</set>
where g_id = #{g_id}
</update>
<!-- 查询所有宿舍卫生信息 -->
<select id="getAll" resultType="DormClean">
select * from d_dormgrade;
</select>
<!--宿舍卫生信息查询信息-->
<!-- 宿舍卫生信息查询结果映射 -->
<resultMap type="com.itheima.po.DormClean" id="cardAndInfo2">
<!-- 宿舍ID映射 -->
<id property="d_id" column="d_id"/>
<!-- 宿舍楼映射 -->
<result property="d_dormbuilding" column="d_dormbuilding" />
</resultMap>
</mapper>

@ -3,68 +3,82 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.itheima.dao.DormRepairDao" >
<!--分页查询-->
<!-- 分页查询宿舍维修列表 -->
<select id="getDormRepairList" parameterType="DormRepair" resultType="DormRepair">
select *from d_dormrepair
select * from d_dormrepair
<where>
<!-- 如果宿舍ID不为空且不为0则按宿舍ID模糊查询 -->
<if test="d_id!=null and d_id!=0">
and d_id like '%${d_id}%'
and d_id like '%${d_id}%'
</if>
<!-- 如果宿舍楼不为空且不为空字符串,则按宿舍楼模糊查询 -->
<if test="d_dormbuilding !=null and d_dormbuilding !=''">
and d_dormbuilding like '%${d_dormbuilding}%'
and d_dormbuilding like '%${d_dormbuilding}%'
</if>
</where>
ORDER BY r_id asc
<!-- 按维修ID升序排序 -->
ORDER BY r_id asc
<!-- 分页参数 -->
limit #{currentPage},#{pageSize}
</select>
<!--查询数据总数-->
<select id="totalCount" resultType="Integer">
<!-- 查询宿舍维修信息总数 -->
<select id="totalCount" resultType="Integer">
select count(r_id) from d_dormrepair
<where>
<!-- 如果宿舍ID不为空且不为0则按宿舍ID模糊查询 -->
<if test="d_id!=null and d_id!=0">
and d_id like '%${d_id}%'
and d_id like '%${d_id}%'
</if>
<!-- 如果宿舍楼不为空且不为空字符串,则按宿舍楼模糊查询 -->
<if test="d_dormbuilding !=null and d_dormbuilding !=''">
and d_dormbuilding like '%${d_dormbuilding}%'
and d_dormbuilding like '%${d_dormbuilding}%'
</if>
</where>
</select>
<!--添加宿舍信息-->
<!-- 添加宿舍维修信息 -->
<insert id="addDormRepair" parameterType="DormRepair" keyProperty="r_id" useGeneratedKeys="true">
insert into d_dormrepair (d_id,d_dormbuilding,r_name,reason,create_time,update_time)
values(#{d_id},#{d_dormbuilding},#{r_name},#{reason},now(),now())
insert into d_dormrepair (d_id, d_dormbuilding, r_name, reason, create_time, update_time)
values(#{d_id}, #{d_dormbuilding}, #{r_name}, #{reason}, now(), now())
</insert>
<!--通过id删除宿舍信息-->
<delete id="deleteDormRepair" parameterType="Integer" >
<!-- 通过ID删除宿舍维修信息 -->
<delete id="deleteDormRepair" parameterType="Integer">
delete from d_dormrepair where r_id=#{r_id}
</delete>
<select id="findDormRepairById" parameterType="Integer" resultType="DormRepair" >
<!-- 通过ID查询宿舍维修信息 -->
<select id="findDormRepairById" parameterType="Integer" resultType="DormRepair">
select * from d_dormrepair where r_id=#{r_id}
</select>
<!-- 获取所有宿舍维修信息 -->
<select id="getAll" resultType="DormRepair">
select * from d_dormrepair;
</select>
<!--修改宿舍信息-->
<!-- 修改宿舍维修信息 -->
<update id="updateDormRepair" parameterType="DormRepair">
update d_dormrepair
<set>
<!-- 如果宿舍ID不为空且不为0则更新宿舍ID -->
<if test="d_id!=null and d_id!=0">
d_id=#{d_id},
</if>
<!-- 如果宿舍楼不为空且不为空字符串,则更新宿舍楼 -->
<if test="d_dormbuilding !=null and d_dormbuilding !=''">
d_dormbuilding=#{d_dormbuilding},
</if>
<!-- 如果维修人姓名不为空且不为空字符串,则更新维修人姓名 -->
<if test="r_name !=null and r_name !=''">
r_name=#{r_name},
</if>
<!-- 如果维修原因不为空且不为空字符串,则更新维修原因 -->
<if test="reason !=null and reason !=''">
reason=#{reason},
</if>
<!-- 如果更新时间不为空,则更新时间为当前时间 -->
<if test="update_time !=null ">
update_time=now(),
</if>
@ -72,6 +86,7 @@
where r_id = #{r_id}
</update>
<!--宿舍人员信息查询信息-->
<resultMap type="com.itheima.po.DormRepair" id="cardAndInfo2">
<id property="r_id" column="r_id"/>

@ -3,70 +3,85 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.itheima.dao.DormitoryDao" >
<!--分页查询-->
<!-- 分页查询宿舍列表 -->
<select id="getDormitoryList" parameterType="Dormitory" resultType="Dormitory">
select *from d_dormitoryinfo
select * from d_dormitoryinfo
<where>
<!-- 如果管理员姓名不为空且不为空字符串,则按管理员姓名模糊查询 -->
<if test="a_name!=null and a_name!=''">
and a_name like '%${a_name}%'
and a_name like '%${a_name}%'
</if>
<!-- 如果宿舍ID不为空且不为0则按宿舍ID模糊查询 -->
<if test="s_dormitoryid!=null and s_dormitoryid!=0">
and s_dormitoryid like '%${s_dormitoryid}%'
and s_dormitoryid like '%${s_dormitoryid}%'
</if>
<!-- 如果宿舍楼不为空且不为空字符串,则按宿舍楼模糊查询 -->
<if test="d_dormbuilding !=null and d_dormbuilding !=''">
and d_dormbuilding like '%${d_dormbuilding}%'
and d_dormbuilding like '%${d_dormbuilding}%'
</if>
</where>
ORDER BY d_id asc
<!-- 按ID升序排序 -->
ORDER BY d_id asc
<!-- 分页参数 -->
limit #{currentPage},#{pageSize}
</select>
<!--查询数据总数-->
<select id="totalCount" resultType="Integer">
<!-- 查询宿舍信息总数 -->
<select id="totalCount" resultType="Integer">
select count(s_dormitoryid) from d_dormitoryinfo
<where>
<!-- 如果管理员姓名不为空且不为空字符串,则按管理员姓名模糊查询 -->
<if test="a_name!=null and a_name!=''">
and a_name like '%${a_name}%'
and a_name like '%${a_name}%'
</if>
<!-- 如果宿舍ID不为空且不为0则按宿舍ID模糊查询 -->
<if test="s_dormitoryid!=null and s_dormitoryid!=0">
and s_dormitoryid like '%${s_dormitoryid}%'
and s_dormitoryid like '%${s_dormitoryid}%'
</if>
<!-- 如果宿舍楼不为空且不为空字符串,则按宿舍楼模糊查询 -->
<if test="d_dormbuilding !=null and d_dormbuilding !=''">
and d_dormbuilding like '%${d_dormbuilding}%'
and d_dormbuilding like '%${d_dormbuilding}%'
</if>
</where>
</where>
</select>
<!--添加宿舍信息-->
<!-- 添加宿舍信息 -->
<insert id="addDormitory" parameterType="Dormitory" keyProperty="d_id" useGeneratedKeys="true">
insert into d_dormitoryinfo (s_dormitoryid,d_dormbuilding,d_bedtotal,d_bed,a_name)
values(#{s_dormitoryid},#{d_dormbuilding},#{d_bedtotal},#{d_bed},#{a_name})
insert into d_dormitoryinfo (s_dormitoryid, d_dormbuilding, d_bedtotal, d_bed, a_name)
values(#{s_dormitoryid}, #{d_dormbuilding}, #{d_bedtotal}, #{d_bed}, #{a_name})
</insert>
<!--通过id删除宿舍信息-->
<delete id="deleteDormitory" parameterType="Integer" >
<!-- 通过ID删除宿舍信息 -->
<delete id="deleteDormitory" parameterType="Integer">
delete from d_dormitoryinfo where d_id=#{d_id}
</delete>
<select id="findDormitoryById" parameterType="Integer" resultType="Dormitory" >
<!-- 通过ID查询宿舍信息 -->
<select id="findDormitoryById" parameterType="Integer" resultType="Dormitory">
select * from d_dormitoryinfo where d_id=#{d_id}
</select>
<!--修改宿舍信息-->
<!-- 修改宿舍信息 -->
<update id="updateDormitory" parameterType="Dormitory">
update d_dormitoryinfo
<set>
<!-- 如果宿舍ID不为空且不为0则更新宿舍ID -->
<if test="s_dormitoryid!=null and s_dormitoryid!=0">
s_dormitoryid=#{s_dormitoryid},
</if>
<!-- 如果宿舍楼不为空且不为空字符串,则更新宿舍楼 -->
<if test="d_dormbuilding !=null and d_dormbuilding !=''">
d_dormbuilding=#{d_dormbuilding},
</if>
<!-- 如果床位数不为空且不为空字符串,则更新床位数 -->
<if test="d_bedtotal !=null and d_bedtotal !=''">
d_bedtotal=#{d_bedtotal},
</if>
<!-- 如果床位不为空且不为空字符串,则更新床位 -->
<if test="d_bed !=null and d_bed !=''">
d_bed=#{d_bed},
</if>
<!-- 如果管理员姓名不为空且不为空字符串,则更新管理员姓名 -->
<if test="a_name !=null and a_name !=''">
a_name=#{a_name},
</if>
@ -74,6 +89,7 @@
where d_id = #{d_id}
</update>
<!--宿舍人员信息查询信息-->
<resultMap type="com.itheima.po.Dormitory" id="cardAndInfo2">
<id property="d_id" column="d_id"/>

@ -3,85 +3,102 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.itheima.dao.StudentCleanDao" >
<!--分页查询-->
<!-- 分页查询学生卫生列表 -->
<select id="getStudentCleanList" parameterType="StudentClean" resultType="StudentClean">
select *from d_stgrade
select * from d_stgrade
<where>
<!-- 如果学生ID不为空且不为0则按学生ID模糊查询 -->
<if test="s_studentid!=null and s_studentid!=0">
and s_studentid like '%${s_studentid}%'
and s_studentid like '%${s_studentid}%'
</if>
<!-- 如果学生姓名不为空且不为空字符串,则按学生姓名模糊查询 -->
<if test="s_name !=null and s_name !=''">
and s_name like '%${s_name}%'
and s_name like '%${s_name}%'
</if>
<!-- 如果宿舍ID不为空且不为0则按宿舍ID模糊查询 -->
<if test="s_dormitoryid!=null and s_dormitoryid!=0">
and s_dormitoryid like '%${s_dormitoryid}%'
and s_dormitoryid like '%${s_dormitoryid}%'
</if>
</where>
ORDER BY g_id asc
<!-- 按卫生评分ID升序排序 -->
ORDER BY g_id asc
<!-- 分页参数 -->
limit #{currentPage},#{pageSize}
</select>
<!--查询数据总数-->
<select id="totalCount" resultType="Integer">
<!-- 查询学生卫生信息总数 -->
<select id="totalCount" resultType="Integer">
select count(g_id) from d_stgrade
<where>
<!-- 如果学生ID不为空且不为0则按学生ID模糊查询 -->
<if test="s_studentid!=null and s_studentid!=0">
and s_studentid like '%${s_studentid}%'
and s_studentid like '%${s_studentid}%'
</if>
<!-- 如果学生姓名不为空且不为空字符串,则按学生姓名模糊查询 -->
<if test="s_name !=null and s_name !=''">
and s_name like '%${s_name}%'
and s_name like '%${s_name}%'
</if>
<!-- 如果宿舍ID不为空且不为0则按宿舍ID模糊查询 -->
<if test="s_dormitoryid!=null and s_dormitoryid!=0">
and s_dormitoryid like '%${s_dormitoryid}%'
and s_dormitoryid like '%${s_dormitoryid}%'
</if>
</where>
</select>
<!--添加宿舍卫生信息-->
<!-- 添加学生卫生信息 -->
<insert id="addStudentClean" parameterType="StudentClean" keyProperty="g_id" useGeneratedKeys="true">
insert into d_stgrade (s_studentid,s_name,s_grade,s_classid,s_dormitoryid,create_time,update_time)
values(#{s_studentid},#{s_name},#{s_grade},#{s_classid},#{s_dormitoryid},now(),now())
insert into d_stgrade (s_studentid, s_name, s_grade, s_classid, s_dormitoryid, create_time, update_time)
values(#{s_studentid}, #{s_name}, #{s_grade}, #{s_classid}, #{s_dormitoryid}, now(), now())
</insert>
<!--通过id删除宿舍卫生信息-->
<delete id="deleteStudentClean" parameterType="Integer" >
<!-- 通过ID删除学生卫生信息 -->
<delete id="deleteStudentClean" parameterType="Integer">
delete from d_stgrade where g_id=#{g_id}
</delete>
<select id="findStudentCleanById" parameterType="Integer" resultType="StudentClean" >
<!-- 通过ID查询学生卫生信息 -->
<select id="findStudentCleanById" parameterType="Integer" resultType="StudentClean">
select * from d_stgrade where g_id=#{g_id}
</select>
<!-- 获取所有学生卫生信息 -->
<select id="getAll" resultType="StudentClean">
select * from d_stgrade;
</select>
<!--修改宿舍卫生信息-->
<!-- 修改学生卫生信息 -->
<update id="updateStudentClean" parameterType="StudentClean">
update d_stgrade
<set>
<!-- 如果学生ID不为空且不为0则更新学生ID -->
<if test="s_studentid!=null and s_studentid!=0">
s_studentid=#{s_studentid},
</if>
<!-- 如果学生姓名不为空且不为空字符串,则更新学生姓名 -->
<if test="s_name !=null and s_name !=''">
s_name=#{s_name},
</if>
<!-- 如果卫生评分不为空且不为0则更新卫生评分 -->
<if test="s_grade!=null and s_grade!=0">
s_grade=#{s_grade},
</if>
<!-- 如果班级ID不为空且不为0则更新班级ID -->
<if test="s_classid!=null and s_classid!=0">
s_classid=#{s_classid},
</if>
<!-- 如果宿舍ID不为空且不为0则更新宿舍ID -->
<if test="s_dormitoryid!=null and s_dormitoryid!=0">
s_dormitoryid=#{s_dormitoryid},
</if>
<if test="update_time != null" >
<!-- 如果更新时间不为空,则更新时间为当前时间 -->
<if test="update_time != null">
update_time = now(),
</if>
</set>
where g_id = #{g_id}
</update>
<!--宿舍卫生信息查询信息-->
<resultMap type="com.itheima.po.StudentClean" id="cardAndInfo2">
<id property="g_id" column="g_id"/>

@ -3,83 +3,105 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.itheima.dao.StudentDao" >
<!--分页查询-->
<!-- 分页查询学生列表 -->
<select id="getStudentList" parameterType="Student" resultType="Student">
select *from d_student
select * from d_student
<where>
<!-- 如果学生姓名不为空且不为空字符串,则按学生姓名模糊查询 -->
<if test="s_name!=null and s_name!='' ">
and s_name like '%${s_name}%'
and s_name like '%${s_name}%'
</if>
<!-- 如果学生ID不为空且不为0则按学生ID模糊查询 -->
<if test="s_studentid!=null and s_studentid!=0">
and s_studentid like '%${s_studentid}%'
and s_studentid like '%${s_studentid}%'
</if>
<!-- 如果班级ID不为空且不为0则按班级ID模糊查询 -->
<if test="s_classid!=null and s_classid!=0">
and s_classid like '%${s_classid}%'
and s_classid like '%${s_classid}%'
</if>
<!-- 如果班级名称不为空且不为空字符串,则按班级名称模糊查询 -->
<if test="s_classname!=null and s_classname!='' ">
and s_classname like '%${s_classname}%'
and s_classname like '%${s_classname}%'
</if>
</where>
ORDER BY s_id asc
<!-- 按学生ID升序排序 -->
ORDER BY s_id asc
<!-- 分页参数 -->
limit #{currentPage},#{pageSize}
</select>
<!--查询数据总数-->
<select id="totalCount" resultType="Integer">
<!-- 查询学生总数 -->
<select id="totalCount" resultType="Integer">
select count(s_studentid) from d_student
<where>
<if test="s_name!=null and s_name!='' ">
and s_name like '%${s_name}%'
</if>
<if test="s_studentid!=null and s_studentid!=0">
and s_studentid like '%${s_studentid}%'
</if>
<if test="s_classid!=null and s_classid!=0">
and s_classid like '%${s_classid}%'
</if>
<if test="s_classname!=null and s_classname!='' ">
and s_classname like '%${s_classname}%'
</if>
</where>
<!-- 如果学生姓名不为空且不为空字符串,则按学生姓名模糊查询 -->
<if test="s_name!=null and s_name!='' ">
and s_name like '%${s_name}%'
</if>
<!-- 如果学生ID不为空且不为0则按学生ID模糊查询 -->
<if test="s_studentid!=null and s_studentid!=0">
and s_studentid like '%${s_studentid}%'
</if>
<!-- 如果班级ID不为空且不为0则按班级ID模糊查询 -->
<if test="s_classid!=null and s_classid!=0">
and s_classid like '%${s_classid}%'
</if>
<!-- 如果班级名称不为空且不为空字符串,则按班级名称模糊查询 -->
<if test="s_classname!=null and s_classname!='' ">
and s_classname like '%${s_classname}%'
</if>
</where>
</select>
<!--通过id删除学生信息-->
<delete id="deleteStudent" parameterType="Integer" >
<!-- 通过ID删除学生信息 -->
<delete id="deleteStudent" parameterType="Integer">
delete from d_student where s_id=#{s_id}
</delete>
<!--添加学生信息-->
<!-- 添加学生信息 -->
<insert id="addStudent" parameterType="Student" keyProperty="s_id" useGeneratedKeys="true">
insert into d_student (s_studentid,s_name,s_sex,s_age,s_phone,s_classid,s_classname,s_dormitoryid)
values(#{s_studentid},#{s_name},#{s_sex},#{s_age},#{s_phone},#{s_classid},#{s_classname},#{s_dormitoryid})
insert into d_student (s_studentid, s_name, s_sex, s_age, s_phone, s_classid, s_classname, s_dormitoryid)
values(#{s_studentid}, #{s_name}, #{s_sex}, #{s_age}, #{s_phone}, #{s_classid}, #{s_classname}, #{s_dormitoryid})
</insert>
<select id="findStudentById" parameterType="Integer" resultType="Student" >
select * from d_student where s_id=#{s_id}
<!-- 通过ID查询学生信息 -->
<select id="findStudentById" parameterType="Integer" resultType="Student">
select * from d_student where s_id=#{s_id}
</select>
<!--修改学生信息-->
<!-- 修改学生信息 -->
<update id="updateStudent" parameterType="Student">
update d_student
<set>
<!-- 如果学生ID不为空且不为0则更新学生ID -->
<if test="s_studentid!=null and s_studentid!=0">
s_studentid=#{s_studentid},
</if>
<!-- 如果学生姓名不为空且不为空字符串,则更新学生姓名 -->
<if test="s_name !=null and s_name !=''">
s_name=#{s_name},
</if>
<!-- 如果学生性别不为空且不为空字符串,则更新学生性别 -->
<if test="s_sex !=null and s_sex !=''">
s_sex=#{s_sex},
</if>
<!-- 如果学生年龄不为空且不为0则更新学生年龄 -->
<if test="s_age !=null and s_age !=0">
s_age=#{s_age},
</if>
<!-- 如果学生电话不为空且不为0则更新学生电话 -->
<if test="s_phone !=null and s_phone !=0">
s_phone=#{s_phone},
</if>
<!-- 如果班级ID不为空且不为0则更新班级ID -->
<if test="s_classid!=null and s_classid!=0">
s_classid=#{s_classid},
</if>
<!-- 如果班级名称不为空且不为空字符串,则更新班级名称 -->
<if test="s_classname !=null and s_classname !=''">
s_classname=#{s_classname},
</if>
<!-- 如果宿舍ID不为空且不为0则更新宿舍ID -->
<if test="s_dormitoryid!=null and s_dormitoryid!=0">
s_dormitoryid=#{s_dormitoryid},
</if>
@ -87,6 +109,7 @@
where s_id = #{s_id}
</update>
<!-- 获取所有学生信息 -->
<select id="getAll" resultType="Student">
select * from d_student;
</select>

@ -3,42 +3,50 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.itheima.dao.VisitorDao" >
<!--分页查询-->
<!-- 分页查询访客列表 -->
<select id="getVisitorList" parameterType="Visitor" resultType="Visitor">
select * from d_visitor
<where>
<!-- 如果访客姓名不为空且不为空字符串,则按访客姓名模糊查询 -->
<if test="v_name!=null and v_name!='' ">
and v_name like '%${v_name}%'
and v_name like '%${v_name}%'
</if>
<!-- 如果访客电话不为空且不为0则按访客电话模糊查询 -->
<if test="v_phone!=null and v_phone!=0">
and v_phone like '%${v_phone}%'
and v_phone like '%${v_phone}%'
</if>
</where>
ORDER BY v_id asc
<!-- 按访客ID升序排序 -->
ORDER BY v_id asc
<!-- 分页参数,限制返回的记录数 -->
limit #{currentPage},#{pageSize}
</select>
<!--查询数据总数-->
<select id="totalCount" resultType="Integer">
<!-- 查询访客总数 -->
<select id="totalCount" resultType="Integer">
select count(v_id) from d_visitor
<where>
<!-- 如果访客姓名不为空且不为空字符串,则按访客姓名模糊查询 -->
<if test="v_name!=null and v_name!='' ">
and v_name like '%${v_name}%'
and v_name like '%${v_name}%'
</if>
<!-- 如果访客电话不为空且不为0则按访客电话模糊查询 -->
<if test="v_phone!=null and v_phone!=0">
and v_phone like '%${v_phone}%'
and v_phone like '%${v_phone}%'
</if>
</where>
</select>
<!--添加学生信息-->
<!-- 添加访客信息 -->
<insert id="addVisitor" parameterType="Visitor" keyProperty="v_id" useGeneratedKeys="true">
insert into d_visitor (v_name,v_phone,v_dormitoryid,v_dormbuilding,create_time)
values(#{v_name},#{v_phone},#{v_dormitoryid},#{v_dormbuilding},now())
insert into d_visitor (v_name, v_phone, v_dormitoryid, v_dormbuilding, create_time)
values(#{v_name}, #{v_phone}, #{v_dormitoryid}, #{v_dormbuilding}, now())
</insert>
<!-- 获取所有访客信息 -->
<select id="getAll" resultType="Visitor">
select * from d_visitor;
</select>
</mapper>

Loading…
Cancel
Save