parent
d03da57f92
commit
527345a864
@ -0,0 +1,5 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="WEB_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/temp" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/tmp" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
@ -0,0 +1,10 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0">
|
||||
<option name="myName" value="Project Default" />
|
||||
<inspection_tool class="SpellCheckingInspection" enabled="false" level="TYPO" enabled_by_default="false">
|
||||
<option name="processCode" value="true" />
|
||||
<option name="processLiterals" value="true" />
|
||||
<option name="processComments" value="true" />
|
||||
</inspection_tool>
|
||||
</profile>
|
||||
</component>
|
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="JavaScriptSettings">
|
||||
<option name="languageLevel" value="ES6" />
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/front.iml" filepath="$PROJECT_DIR$/.idea/front.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
"code": 1,
|
||||
"msg": "服务端清理缓存成功"
|
||||
}
|
@ -0,0 +1,234 @@
|
||||
[
|
||||
{
|
||||
"title": "常规管理",
|
||||
"icon": "fa fa-address-book",
|
||||
"href": "",
|
||||
"target": "_self",
|
||||
"child": [
|
||||
{
|
||||
"title": "主页模板",
|
||||
"href": "",
|
||||
"icon": "fa fa-home",
|
||||
"target": "_self",
|
||||
"child": [
|
||||
{
|
||||
"title": "主页一",
|
||||
"href": "page/welcome-1.html",
|
||||
"icon": "fa fa-tachometer",
|
||||
"target": "_self"
|
||||
},
|
||||
{
|
||||
"title": "主页二",
|
||||
"href": "page/welcome-2.html",
|
||||
"icon": "fa fa-tachometer",
|
||||
"target": "_self"
|
||||
},
|
||||
{
|
||||
"title": "主页三",
|
||||
"href": "page/welcome-3.html",
|
||||
"icon": "fa fa-tachometer",
|
||||
"target": "_self"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "菜单管理",
|
||||
"href": "page/menu.html",
|
||||
"icon": "fa fa-window-maximize",
|
||||
"target": "_self"
|
||||
},
|
||||
{
|
||||
"title": "系统设置",
|
||||
"href": "page/setting.html",
|
||||
"icon": "fa fa-gears",
|
||||
"target": "_self"
|
||||
},
|
||||
{
|
||||
"title": "表格示例",
|
||||
"href": "page/table.html",
|
||||
"icon": "fa fa-file-text",
|
||||
"target": "_self"
|
||||
},
|
||||
{
|
||||
"title": "表单示例",
|
||||
"href": "",
|
||||
"icon": "fa fa-calendar",
|
||||
"target": "_self",
|
||||
"child": [
|
||||
{
|
||||
"title": "普通表单",
|
||||
"href": "page/form.html",
|
||||
"icon": "fa fa-list-alt",
|
||||
"target": "_self"
|
||||
},
|
||||
{
|
||||
"title": "分步表单",
|
||||
"href": "page/form-step.html",
|
||||
"icon": "fa fa-navicon",
|
||||
"target": "_self"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "登录模板",
|
||||
"href": "",
|
||||
"icon": "fa fa-flag-o",
|
||||
"target": "_self",
|
||||
"child": [
|
||||
{
|
||||
"title": "登录-1",
|
||||
"href": "page/login-1.html",
|
||||
"icon": "fa fa-stumbleupon-circle",
|
||||
"target": "_blank"
|
||||
},
|
||||
{
|
||||
"title": "登录-2",
|
||||
"href": "page/login-2.html",
|
||||
"icon": "fa fa-viacoin",
|
||||
"target": "_blank"
|
||||
},
|
||||
{
|
||||
"title": "登录-3",
|
||||
"href": "page/login-3.html",
|
||||
"icon": "fa fa-tags",
|
||||
"target": "_blank"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "异常页面",
|
||||
"href": "",
|
||||
"icon": "fa fa-home",
|
||||
"target": "_self",
|
||||
"child": [
|
||||
{
|
||||
"title": "404页面",
|
||||
"href": "page/404.html",
|
||||
"icon": "fa fa-hourglass-end",
|
||||
"target": "_self"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "其它界面",
|
||||
"href": "",
|
||||
"icon": "fa fa-snowflake-o",
|
||||
"target": "",
|
||||
"child": [
|
||||
{
|
||||
"title": "按钮示例",
|
||||
"href": "page/button.html",
|
||||
"icon": "fa fa-snowflake-o",
|
||||
"target": "_self"
|
||||
},
|
||||
{
|
||||
"title": "弹出层",
|
||||
"href": "page/layer.html",
|
||||
"icon": "fa fa-shield",
|
||||
"target": "_self"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "组件管理",
|
||||
"icon": "fa fa-lemon-o",
|
||||
"href": "",
|
||||
"target": "_self",
|
||||
"child": [
|
||||
{
|
||||
"title": "图标列表",
|
||||
"href": "page/icon.html",
|
||||
"icon": "fa fa-dot-circle-o",
|
||||
"target": "_self"
|
||||
},
|
||||
{
|
||||
"title": "图标选择",
|
||||
"href": "page/icon-picker.html",
|
||||
"icon": "fa fa-adn",
|
||||
"target": "_self"
|
||||
},
|
||||
{
|
||||
"title": "颜色选择",
|
||||
"href": "page/color-select.html",
|
||||
"icon": "fa fa-dashboard",
|
||||
"target": "_self"
|
||||
},
|
||||
{
|
||||
"title": "下拉选择",
|
||||
"href": "page/table-select.html",
|
||||
"icon": "fa fa-angle-double-down",
|
||||
"target": "_self"
|
||||
},
|
||||
{
|
||||
"title": "文件上传",
|
||||
"href": "page/upload.html",
|
||||
"icon": "fa fa-arrow-up",
|
||||
"target": "_self"
|
||||
},
|
||||
{
|
||||
"title": "富文本编辑器",
|
||||
"href": "page/editor.html",
|
||||
"icon": "fa fa-edit",
|
||||
"target": "_self"
|
||||
},
|
||||
{
|
||||
"title": "省市县区选择器",
|
||||
"href": "page/area.html",
|
||||
"icon": "fa fa-rocket",
|
||||
"target": "_self"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "其它管理",
|
||||
"icon": "fa fa-slideshare",
|
||||
"href": "",
|
||||
"target": "_self",
|
||||
"child": [
|
||||
{
|
||||
"title": "多级菜单",
|
||||
"href": "",
|
||||
"icon": "fa fa-meetup",
|
||||
"target": "",
|
||||
"child": [
|
||||
{
|
||||
"title": "按钮1",
|
||||
"href": "page/button.html?v=1",
|
||||
"icon": "fa fa-calendar",
|
||||
"target": "_self",
|
||||
"child": [
|
||||
{
|
||||
"title": "按钮2",
|
||||
"href": "page/button.html?v=2",
|
||||
"icon": "fa fa-snowflake-o",
|
||||
"target": "_self",
|
||||
"child": [
|
||||
{
|
||||
"title": "按钮3",
|
||||
"href": "page/button.html?v=3",
|
||||
"icon": "fa fa-snowflake-o",
|
||||
"target": "_self"
|
||||
},
|
||||
{
|
||||
"title": "表单4",
|
||||
"href": "page/form.html?v=1",
|
||||
"icon": "fa fa-calendar",
|
||||
"target": "_self"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "失效菜单",
|
||||
"href": "page/error.html",
|
||||
"icon": "fa fa-superpowers",
|
||||
"target": "_self"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
@ -0,0 +1,254 @@
|
||||
{
|
||||
"code": 0,
|
||||
"msg": "",
|
||||
"count": 19,
|
||||
"data": [
|
||||
{
|
||||
"authorityId": 1,
|
||||
"authorityName": "系统管理",
|
||||
"orderNumber": 1,
|
||||
"menuUrl": null,
|
||||
"menuIcon": "layui-icon-set",
|
||||
"createTime": "2018/06/29 11:05:41",
|
||||
"authority": null,
|
||||
"checked": 0,
|
||||
"updateTime": "2018/07/13 09:13:42",
|
||||
"isMenu": 0,
|
||||
"parentId": -1
|
||||
},
|
||||
{
|
||||
"authorityId": 2,
|
||||
"authorityName": "用户管理",
|
||||
"orderNumber": 2,
|
||||
"menuUrl": "system/user",
|
||||
"menuIcon": null,
|
||||
"createTime": "2018/06/29 11:05:41",
|
||||
"authority": null,
|
||||
"checked": 0,
|
||||
"updateTime": "2018/07/13 09:13:42",
|
||||
"isMenu": 0,
|
||||
"parentId": 1
|
||||
},
|
||||
{
|
||||
"authorityId": 3,
|
||||
"authorityName": "查询用户",
|
||||
"orderNumber": 3,
|
||||
"menuUrl": "",
|
||||
"menuIcon": "",
|
||||
"createTime": "2018/07/21 13:54:16",
|
||||
"authority": "user:view",
|
||||
"checked": 0,
|
||||
"updateTime": "2018/07/21 13:54:16",
|
||||
"isMenu": 1,
|
||||
"parentId": 2
|
||||
},
|
||||
{
|
||||
"authorityId": 4,
|
||||
"authorityName": "添加用户",
|
||||
"orderNumber": 4,
|
||||
"menuUrl": null,
|
||||
"menuIcon": null,
|
||||
"createTime": "2018/06/29 11:05:41",
|
||||
"authority": "user:add",
|
||||
"checked": 0,
|
||||
"updateTime": "2018/07/13 09:13:42",
|
||||
"isMenu": 1,
|
||||
"parentId": 2
|
||||
},
|
||||
{
|
||||
"authorityId": 5,
|
||||
"authorityName": "修改用户",
|
||||
"orderNumber": 5,
|
||||
"menuUrl": null,
|
||||
"menuIcon": null,
|
||||
"createTime": "2018/06/29 11:05:41",
|
||||
"authority": "user:edit",
|
||||
"checked": 0,
|
||||
"updateTime": "2018/07/13 09:13:42",
|
||||
"isMenu": 1,
|
||||
"parentId": 2
|
||||
},
|
||||
{
|
||||
"authorityId": 6,
|
||||
"authorityName": "删除用户",
|
||||
"orderNumber": 6,
|
||||
"menuUrl": null,
|
||||
"menuIcon": null,
|
||||
"createTime": "2018/06/29 11:05:41",
|
||||
"authority": "user:delete",
|
||||
"checked": 0,
|
||||
"updateTime": "2018/07/13 09:13:42",
|
||||
"isMenu": 1,
|
||||
"parentId": 2
|
||||
},
|
||||
{
|
||||
"authorityId": 7,
|
||||
"authorityName": "角色管理",
|
||||
"orderNumber": 7,
|
||||
"menuUrl": "system/role",
|
||||
"menuIcon": null,
|
||||
"createTime": "2018/06/29 11:05:41",
|
||||
"authority": null,
|
||||
"checked": 0,
|
||||
"updateTime": "2018/07/13 09:13:42",
|
||||
"isMenu": 0,
|
||||
"parentId": 1
|
||||
},
|
||||
{
|
||||
"authorityId": 8,
|
||||
"authorityName": "查询角色",
|
||||
"orderNumber": 8,
|
||||
"menuUrl": "",
|
||||
"menuIcon": "",
|
||||
"createTime": "2018/07/21 13:54:59",
|
||||
"authority": "role:view",
|
||||
"checked": 0,
|
||||
"updateTime": "2018/07/21 13:54:58",
|
||||
"isMenu": 1,
|
||||
"parentId": 7
|
||||
},
|
||||
{
|
||||
"authorityId": 9,
|
||||
"authorityName": "添加角色",
|
||||
"orderNumber": 9,
|
||||
"menuUrl": "",
|
||||
"menuIcon": "",
|
||||
"createTime": "2018/06/29 11:05:41",
|
||||
"authority": "role:add",
|
||||
"checked": 0,
|
||||
"updateTime": "2018/07/13 09:13:42",
|
||||
"isMenu": 1,
|
||||
"parentId": 7
|
||||
},
|
||||
{
|
||||
"authorityId": 10,
|
||||
"authorityName": "修改角色",
|
||||
"orderNumber": 10,
|
||||
"menuUrl": "",
|
||||
"menuIcon": "",
|
||||
"createTime": "2018/06/29 11:05:41",
|
||||
"authority": "role:edit",
|
||||
"checked": 0,
|
||||
"updateTime": "2018/07/13 09:13:42",
|
||||
"isMenu": 1,
|
||||
"parentId": 7
|
||||
},
|
||||
{
|
||||
"authorityId": 11,
|
||||
"authorityName": "删除角色",
|
||||
"orderNumber": 11,
|
||||
"menuUrl": "",
|
||||
"menuIcon": "",
|
||||
"createTime": "2018/06/29 11:05:41",
|
||||
"authority": "role:delete",
|
||||
"checked": 0,
|
||||
"updateTime": "2018/07/13 09:13:42",
|
||||
"isMenu": 1,
|
||||
"parentId": 7
|
||||
},
|
||||
{
|
||||
"authorityId": 12,
|
||||
"authorityName": "角色权限管理",
|
||||
"orderNumber": 12,
|
||||
"menuUrl": "",
|
||||
"menuIcon": "",
|
||||
"createTime": "2018/06/29 11:05:41",
|
||||
"authority": "role:auth",
|
||||
"checked": 0,
|
||||
"updateTime": "2018/07/13 15:27:18",
|
||||
"isMenu": 1,
|
||||
"parentId": 7
|
||||
},
|
||||
{
|
||||
"authorityId": 13,
|
||||
"authorityName": "权限管理",
|
||||
"orderNumber": 13,
|
||||
"menuUrl": "system/authorities",
|
||||
"menuIcon": null,
|
||||
"createTime": "2018/06/29 11:05:41",
|
||||
"authority": null,
|
||||
"checked": 0,
|
||||
"updateTime": "2018/07/13 15:45:13",
|
||||
"isMenu": 0,
|
||||
"parentId": 1
|
||||
},
|
||||
{
|
||||
"authorityId": 14,
|
||||
"authorityName": "查询权限",
|
||||
"orderNumber": 14,
|
||||
"menuUrl": "",
|
||||
"menuIcon": "",
|
||||
"createTime": "2018/07/21 13:55:57",
|
||||
"authority": "authorities:view",
|
||||
"checked": 0,
|
||||
"updateTime": "2018/07/21 13:55:56",
|
||||
"isMenu": 1,
|
||||
"parentId": 13
|
||||
},
|
||||
{
|
||||
"authorityId": 15,
|
||||
"authorityName": "添加权限",
|
||||
"orderNumber": 15,
|
||||
"menuUrl": "",
|
||||
"menuIcon": "",
|
||||
"createTime": "2018/06/29 11:05:41",
|
||||
"authority": "authorities:add",
|
||||
"checked": 0,
|
||||
"updateTime": "2018/06/29 11:05:41",
|
||||
"isMenu": 1,
|
||||
"parentId": 13
|
||||
},
|
||||
{
|
||||
"authorityId": 16,
|
||||
"authorityName": "修改权限",
|
||||
"orderNumber": 16,
|
||||
"menuUrl": "",
|
||||
"menuIcon": "",
|
||||
"createTime": "2018/07/13 09:13:42",
|
||||
"authority": "authorities:edit",
|
||||
"checked": 0,
|
||||
"updateTime": "2018/07/13 09:13:42",
|
||||
"isMenu": 1,
|
||||
"parentId": 13
|
||||
},
|
||||
{
|
||||
"authorityId": 17,
|
||||
"authorityName": "删除权限",
|
||||
"orderNumber": 17,
|
||||
"menuUrl": "",
|
||||
"menuIcon": "",
|
||||
"createTime": "2018/06/29 11:05:41",
|
||||
"authority": "authorities:delete",
|
||||
"checked": 0,
|
||||
"updateTime": "2018/06/29 11:05:41",
|
||||
"isMenu": 1,
|
||||
"parentId": 13
|
||||
},
|
||||
{
|
||||
"authorityId": 18,
|
||||
"authorityName": "登录日志",
|
||||
"orderNumber": 18,
|
||||
"menuUrl": "system/loginRecord",
|
||||
"menuIcon": null,
|
||||
"createTime": "2018/06/29 11:05:41",
|
||||
"authority": null,
|
||||
"checked": 0,
|
||||
"updateTime": "2018/06/29 11:05:41",
|
||||
"isMenu": 0,
|
||||
"parentId": 1
|
||||
},
|
||||
{
|
||||
"authorityId": 19,
|
||||
"authorityName": "查询登录日志",
|
||||
"orderNumber": 19,
|
||||
"menuUrl": "",
|
||||
"menuIcon": "",
|
||||
"createTime": "2018/07/21 13:56:43",
|
||||
"authority": "loginRecord:view",
|
||||
"checked": 0,
|
||||
"updateTime": "2018/07/21 13:56:43",
|
||||
"isMenu": 1,
|
||||
"parentId": 18
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,127 @@
|
||||
{
|
||||
"code": 0,
|
||||
"msg": "",
|
||||
"count": 1000,
|
||||
"data": [
|
||||
{
|
||||
"id": 10000,
|
||||
"username": "user-0",
|
||||
"sex": "女",
|
||||
"city": "城市-0",
|
||||
"sign": "签名-0",
|
||||
"experience": 255,
|
||||
"logins": 24,
|
||||
"wealth": 82830700,
|
||||
"classify": "作家",
|
||||
"score": 57
|
||||
},
|
||||
{
|
||||
"id": 10001,
|
||||
"username": "user-1",
|
||||
"sex": "男",
|
||||
"city": "城市-1",
|
||||
"sign": "签名-1",
|
||||
"experience": 884,
|
||||
"logins": 58,
|
||||
"wealth": 64928690,
|
||||
"classify": "词人",
|
||||
"score": 27
|
||||
},
|
||||
{
|
||||
"id": 10002,
|
||||
"username": "user-2",
|
||||
"sex": "女",
|
||||
"city": "城市-2",
|
||||
"sign": "签名-2",
|
||||
"experience": 650,
|
||||
"logins": 77,
|
||||
"wealth": 6298078,
|
||||
"classify": "酱油",
|
||||
"score": 31
|
||||
},
|
||||
{
|
||||
"id": 10003,
|
||||
"username": "user-3",
|
||||
"sex": "女",
|
||||
"city": "城市-3",
|
||||
"sign": "签名-3",
|
||||
"experience": 362,
|
||||
"logins": 157,
|
||||
"wealth": 37117017,
|
||||
"classify": "诗人",
|
||||
"score": 68
|
||||
},
|
||||
{
|
||||
"id": 10004,
|
||||
"username": "user-4",
|
||||
"sex": "男",
|
||||
"city": "城市-4",
|
||||
"sign": "签名-4",
|
||||
"experience": 807,
|
||||
"logins": 51,
|
||||
"wealth": 76263262,
|
||||
"classify": "作家",
|
||||
"score": 6
|
||||
},
|
||||
{
|
||||
"id": 10005,
|
||||
"username": "user-5",
|
||||
"sex": "女",
|
||||
"city": "城市-5",
|
||||
"sign": "签名-5",
|
||||
"experience": 173,
|
||||
"logins": 68,
|
||||
"wealth": 60344147,
|
||||
"classify": "作家",
|
||||
"score": 87
|
||||
},
|
||||
{
|
||||
"id": 10006,
|
||||
"username": "user-6",
|
||||
"sex": "女",
|
||||
"city": "城市-6",
|
||||
"sign": "签名-6",
|
||||
"experience": 982,
|
||||
"logins": 37,
|
||||
"wealth": 57768166,
|
||||
"classify": "作家",
|
||||
"score": 34
|
||||
},
|
||||
{
|
||||
"id": 10007,
|
||||
"username": "user-7",
|
||||
"sex": "男",
|
||||
"city": "城市-7",
|
||||
"sign": "签名-7",
|
||||
"experience": 727,
|
||||
"logins": 150,
|
||||
"wealth": 82030578,
|
||||
"classify": "作家",
|
||||
"score": 28
|
||||
},
|
||||
{
|
||||
"id": 10008,
|
||||
"username": "user-8",
|
||||
"sex": "男",
|
||||
"city": "城市-8",
|
||||
"sign": "签名-8",
|
||||
"experience": 951,
|
||||
"logins": 133,
|
||||
"wealth": 16503371,
|
||||
"classify": "词人",
|
||||
"score": 14
|
||||
},
|
||||
{
|
||||
"id": 10009,
|
||||
"username": "user-9",
|
||||
"sex": "女",
|
||||
"city": "城市-9",
|
||||
"sign": "签名-9",
|
||||
"experience": 484,
|
||||
"logins": 25,
|
||||
"wealth": 86801934,
|
||||
"classify": "词人",
|
||||
"score": 75
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
{
|
||||
"code": 0,
|
||||
"msg": "",
|
||||
"count": 16,
|
||||
"data": [
|
||||
{ "id":"001", "username":"张玉林", "sex":"女" },
|
||||
{ "id":"002", "username":"刘晓军", "sex":"男" },
|
||||
{ "id":"003", "username":"张恒", "sex":"男" },
|
||||
{ "id":"004", "username":"朱一", "sex":"男" },
|
||||
{ "id":"005", "username":"刘佳能", "sex":"女" },
|
||||
{ "id":"006", "username":"晓梅", "sex":"女" },
|
||||
{ "id":"007", "username":"马冬梅", "sex":"女" },
|
||||
{ "id":"008", "username":"刘晓庆", "sex":"女" },
|
||||
{ "id":"009", "username":"刘晓庆", "sex":"女" },
|
||||
{ "id":"010", "username":"刘晓庆", "sex":"女" },
|
||||
{ "id":"011", "username":"刘晓庆", "sex":"女" },
|
||||
{ "id":"012", "username":"刘晓庆", "sex":"女" },
|
||||
{ "id":"013", "username":"刘晓庆", "sex":"女" },
|
||||
{ "id":"014", "username":"刘晓庆", "sex":"女" },
|
||||
{ "id":"015", "username":"刘晓庆", "sex":"女" },
|
||||
{ "id":"016", "username":"刘晓庆", "sex":"女" }
|
||||
]
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
{
|
||||
"code": 1,
|
||||
"msg": "上传成功",
|
||||
"data": {
|
||||
"url": [
|
||||
"../images/logo.png",
|
||||
"../images/captcha.jpg"
|
||||
]
|
||||
}
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
.layuimini-content-page{background-color:#f2f2f2!important;}
|
||||
.layuimini-container {border:1px solid #f2f2f2;border-radius:5px;background-color:#f2f2f2}
|
||||
.layuimini-main {margin:10px 10px 10px 10px;border:5px solid #ffffff;border-radius:5px;background-color:#ffffff}
|
||||
.layui-breadcrumb>* {font-size: 13px;!important;}
|
||||
|
||||
/**必填红点 */
|
||||
.layuimini-form>.layui-form-item>.required:after {content:'*';color:red;position:absolute;margin-left:4px;font-weight:bold;line-height:1.8em;top:6px;right:5px;}
|
||||
.layuimini-form>.layui-form-item>.layui-form-label {width:120px !important;}
|
||||
.layuimini-form>.layui-form-item>.layui-input-block {margin-left:150px !important;}
|
||||
.layuimini-form>.layui-form-item>.layui-input-block >tip {display:inline-block;margin-top:10px;line-height:10px;font-size:10px;color:#a29c9c;}
|
||||
|
||||
/**搜索框*/
|
||||
.layuimini-container .table-search-fieldset {margin: 0;border: 1px solid #e6e6e6;padding: 10px 20px 5px 20px;color: #6b6b6b;}
|
@ -0,0 +1,95 @@
|
||||
/*头部右侧背景色 headerRightBg */
|
||||
.layui-layout-admin .layui-header {
|
||||
background-color: #ffffff !important;
|
||||
}
|
||||
|
||||
/*头部右侧选中背景色 headerRightBgThis */
|
||||
.layui-layout-admin .layui-header .layuimini-header-content > ul > .layui-nav-item.layui-this, .layuimini-tool i:hover {
|
||||
background-color: #e4e4e4 !important;
|
||||
}
|
||||
|
||||
/*头部右侧字体颜色 headerRightColor */
|
||||
.layui-layout-admin .layui-header .layui-nav .layui-nav-item a {
|
||||
color: rgba(107, 107, 107, 0.7);
|
||||
}
|
||||
|
||||
/**头部右侧下拉字体颜色 headerRightChildColor */
|
||||
.layui-layout-admin .layui-header .layui-nav .layui-nav-item .layui-nav-child a {
|
||||
color: rgba(107, 107, 107, 0.7) !important;
|
||||
}
|
||||
|
||||
/*头部右侧鼠标选中 headerRightColorThis */
|
||||
.layui-header .layuimini-menu-header-pc.layui-nav .layui-nav-item a:hover, .layui-header .layuimini-header-menu.layuimini-pc-show.layui-nav .layui-this a {
|
||||
color: #565656 !important;
|
||||
}
|
||||
|
||||
/*头部右侧更多下拉颜色 headerRightNavMore */
|
||||
.layui-header .layui-nav .layui-nav-more {
|
||||
border-top-color: rgba(160, 160, 160, 0.7) !important;
|
||||
}
|
||||
|
||||
/*头部右侧更多下拉颜色 headerRightNavMore */
|
||||
.layui-header .layui-nav .layui-nav-mored, .layui-header .layui-nav-itemed > a .layui-nav-more {
|
||||
border-color: transparent transparent rgba(160, 160, 160, 0.7) !important;
|
||||
}
|
||||
|
||||
/**头部右侧更多下拉配置色 headerRightNavMoreBg headerRightNavMoreColor */
|
||||
.layui-header .layui-nav .layui-nav-child dd.layui-this a, .layui-header .layui-nav-child dd.layui-this, .layui-layout-admin .layui-header .layui-nav .layui-nav-item .layui-nav-child .layui-this a {
|
||||
background-color: #1E9FFF !important;
|
||||
color: #ffffff !important;
|
||||
}
|
||||
|
||||
/*头部缩放按钮样式 headerRightToolColor */
|
||||
.layui-layout-admin .layui-header .layuimini-tool i {
|
||||
color: #565656;
|
||||
}
|
||||
|
||||
/*logo背景颜色 headerLogoBg */
|
||||
.layui-layout-admin .layuimini-logo {
|
||||
background-color: #192027 !important;
|
||||
}
|
||||
|
||||
/*logo字体颜色 headerLogoColor */
|
||||
.layui-layout-admin .layuimini-logo h1 {
|
||||
color: rgb(191, 187, 187);
|
||||
}
|
||||
|
||||
/*左侧菜单更多下拉样式 leftMenuNavMore */
|
||||
.layuimini-menu-left .layui-nav .layui-nav-more, .layuimini-menu-left-zoom.layui-nav .layui-nav-more {
|
||||
border-top-color: rgb(191, 187, 187);
|
||||
}
|
||||
|
||||
/*左侧菜单更多下拉样式 leftMenuNavMore */
|
||||
.layuimini-menu-left .layui-nav .layui-nav-mored, .layuimini-menu-left .layui-nav-itemed > a .layui-nav-more, .layuimini-menu-left-zoom.layui-nav .layui-nav-mored, .layuimini-menu-left-zoom.layui-nav-itemed > a .layui-nav-more {
|
||||
border-color: transparent transparent rgb(191, 187, 187) !important;
|
||||
}
|
||||
|
||||
/*左侧菜单背景 leftMenuBg */
|
||||
.layui-side.layui-bg-black, .layui-side.layui-bg-black > .layuimini-menu-left > ul, .layuimini-menu-left-zoom > ul {
|
||||
background-color: #28333E !important;
|
||||
}
|
||||
|
||||
/*左侧菜单选中背景 leftMenuBgThis */
|
||||
.layuimini-menu-left .layui-nav-tree .layui-this, .layuimini-menu-left .layui-nav-tree .layui-this > a, .layuimini-menu-left .layui-nav-tree .layui-nav-child dd.layui-this, .layuimini-menu-left .layui-nav-tree .layui-nav-child dd.layui-this a, .layuimini-menu-left-zoom.layui-nav-tree .layui-this, .layuimini-menu-left-zoom.layui-nav-tree .layui-this > a, .layuimini-menu-left-zoom.layui-nav-tree .layui-nav-child dd.layui-this, .layuimini-menu-left-zoom.layui-nav-tree .layui-nav-child dd.layui-this a {
|
||||
background-color: #1E9FFF !important
|
||||
}
|
||||
|
||||
/*左侧菜单子菜单背景 leftMenuChildBg */
|
||||
.layuimini-menu-left .layui-nav-itemed > .layui-nav-child {
|
||||
background-color: #0c0f13 !important;
|
||||
}
|
||||
|
||||
/*左侧菜单字体颜色 leftMenuColor */
|
||||
.layuimini-menu-left .layui-nav .layui-nav-item a, .layuimini-menu-left-zoom.layui-nav .layui-nav-item a {
|
||||
color: rgb(191, 187, 187) !important;
|
||||
}
|
||||
|
||||
/*左侧菜单选中字体颜色 leftMenuColorThis */
|
||||
.layuimini-menu-left .layui-nav .layui-nav-item a:hover, .layuimini-menu-left .layui-nav .layui-this a, .layuimini-menu-left-zoom.layui-nav .layui-nav-item a:hover, .layuimini-menu-left-zoom.layui-nav .layui-this a {
|
||||
color: #ffffff !important;
|
||||
}
|
||||
|
||||
/**tab选项卡选中颜色 tabActiveColor */
|
||||
.layuimini-tab .layui-tab-title .layui-this .layuimini-tab-active {
|
||||
background-color: #1e9fff;
|
||||
}
|
@ -0,0 +1,149 @@
|
||||
<div class="layuimini-container layuimini-page-anim">
|
||||
<div class="layuimini-main">
|
||||
|
||||
<div style="margin: 10px 10px 10px 10px">
|
||||
<form class="layui-form layui-form-pane" action="">
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">名称</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="name" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<button type="submit" class="layui-btn layui-btn-primary" lay-submit lay-filter="data-search-btn"><i class="layui-icon"></i> 搜 索</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<script type="text/html" id="toolbarDemo">
|
||||
<div class="layui-btn-container">
|
||||
<button class="layui-btn layui-btn-normal layui-btn-sm data-add-btn" lay-event="add">
|
||||
<i class="layui-icon layui-icon-add-circle"></i>
|
||||
新增
|
||||
</button>
|
||||
<button class="layui-btn layui-btn-sm layui-btn-normal data-delete-btn" lay-event="update">
|
||||
<i class="layui-icon layui-icon-edit"></i>
|
||||
修改
|
||||
</button>
|
||||
<button class="layui-btn layui-btn-sm layui-btn-danger data-delete-btn" lay-event="delete">
|
||||
<i class="layui-icon layui-icon-delete"></i>
|
||||
删除
|
||||
</button>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<table class="layui-hide" id="currentTableId" lay-filter="currentTableFilter"></table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
layui.use(['form', 'table','miniPage','form','element','axios'], function () {
|
||||
let $ = layui.jquery,
|
||||
form = layui.form,
|
||||
table = layui.table,
|
||||
axios = layui.axios,
|
||||
miniPage = layui.miniPage;
|
||||
|
||||
table.render({
|
||||
elem: '#currentTableId',
|
||||
method:'post',
|
||||
url: 'grade/query',
|
||||
toolbar: '#toolbarDemo',
|
||||
defaultToolbar: ['filter', 'exports', 'print'],
|
||||
cols: [[
|
||||
{type: "checkbox", width: 50},
|
||||
{field: 'id', width: 80, title: 'ID'},
|
||||
{field: 'name',title: '名称'}
|
||||
]],
|
||||
page: true,
|
||||
skin: 'line'
|
||||
});
|
||||
|
||||
window.reload = function(){
|
||||
table.reload('currentTableId');
|
||||
}
|
||||
|
||||
// 监听搜索操作
|
||||
form.on('submit(data-search-btn)', function (data) {
|
||||
let result = JSON.stringify(data.field);
|
||||
//执行搜索重载
|
||||
table.reload('currentTableId', {
|
||||
where: data.field
|
||||
}, 'data');
|
||||
return false;
|
||||
});
|
||||
|
||||
/**
|
||||
* toolbar事件监听
|
||||
*/
|
||||
table.on('toolbar(currentTableFilter)', function (obj) {
|
||||
if (obj.event === 'add') { // 监听添加操作
|
||||
let content = miniPage.getHrefContent('grade/add.html');
|
||||
let openWH = miniPage.getOpenWidthHeight();
|
||||
let index = layer.open({
|
||||
title: '添加',
|
||||
type: 1,
|
||||
shade: 0.2,
|
||||
maxmin:true,
|
||||
shadeClose: true,
|
||||
area: [openWH[0] + 'px', openWH[1] + 'px'],
|
||||
offset: [openWH[2] + 'px', openWH[3] + 'px'],
|
||||
content: content
|
||||
});
|
||||
$(window).on("resize", function () {
|
||||
layer.full(index);
|
||||
});
|
||||
} else if (obj.event === 'update') { //修改操作
|
||||
let data = table.checkStatus('currentTableId').data;
|
||||
if(data.length!=1){
|
||||
layer.msg("请选择一条记录修改");
|
||||
}else{
|
||||
let content = miniPage.getHrefContent('grade/update.html');
|
||||
let openWH = miniPage.getOpenWidthHeight();
|
||||
let index = layer.open({
|
||||
title: '添加',
|
||||
type: 1,
|
||||
shade: 0.2,
|
||||
maxmin:true,
|
||||
shadeClose: true,
|
||||
area: [openWH[0] + 'px', openWH[1] + 'px'],
|
||||
offset: [openWH[2] + 'px', openWH[3] + 'px'],
|
||||
content: content
|
||||
});
|
||||
setFormValue(data[0]);
|
||||
$(window).on("resize", function () {
|
||||
layer.full(index);
|
||||
});
|
||||
}
|
||||
}else if (obj.event === 'delete') { //删除操作
|
||||
let data = table.checkStatus('currentTableId').data;
|
||||
if(data.length==0){
|
||||
layer.msg("请选择要删除的数据");
|
||||
}else{
|
||||
layer.confirm('真的删除行吗', function (index) {
|
||||
//异步删除 map\filter\some\every
|
||||
let arr = data.map(item=>item.id);
|
||||
axios.get('grade/delete?ids='+arr.join(",")).then(function (response) {
|
||||
table.reload('currentTableId');
|
||||
layer.msg(response.msg);
|
||||
}).catch(function (error) {
|
||||
layer.msg(error);
|
||||
});
|
||||
layer.close(index);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function setFormValue(data){
|
||||
form.val("updateForm",{
|
||||
id:data.id,
|
||||
name:data.name,
|
||||
})
|
||||
}
|
||||
|
||||
});
|
||||
</script>
|
@ -0,0 +1,155 @@
|
||||
<div class="layuimini-container layuimini-page-anim">
|
||||
<div class="layuimini-main">
|
||||
|
||||
<div style="margin: 10px 10px 10px 10px">
|
||||
<form class="layui-form layui-form-pane" action="">
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">标题</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="title" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<button type="submit" class="layui-btn layui-btn-primary" lay-submit lay-filter="data-search-btn"><i class="layui-icon"></i> 搜 索</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<script type="text/html" id="toolbarDemo">
|
||||
<div class="layui-btn-container">
|
||||
<button class="layui-btn layui-btn-normal layui-btn-sm data-add-btn" lay-event="add">
|
||||
<i class="layui-icon layui-icon-add-circle"></i>
|
||||
新增
|
||||
</button>
|
||||
<button class="layui-btn layui-btn-sm layui-btn-normal data-delete-btn" lay-event="update">
|
||||
<i class="layui-icon layui-icon-edit"></i>
|
||||
修改
|
||||
</button>
|
||||
<button class="layui-btn layui-btn-sm layui-btn-danger data-delete-btn" lay-event="delete">
|
||||
<i class="layui-icon layui-icon-delete"></i>
|
||||
删除
|
||||
</button>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<table class="layui-hide" id="currentTableId" lay-filter="currentTableFilter"></table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
layui.use(['form', 'table','miniPage','miniAdmin','form','element','axios'], function () {
|
||||
var $ = layui.jquery,
|
||||
form = layui.form,
|
||||
table = layui.table,
|
||||
axios = layui.axios,
|
||||
form = layui.form,
|
||||
miniAdmin = layui.miniAdmin,
|
||||
miniPage = layui.miniPage;
|
||||
|
||||
table.render({
|
||||
elem: '#currentTableId',
|
||||
method:'post',
|
||||
url: 'notice/query',
|
||||
toolbar: '#toolbarDemo',
|
||||
defaultToolbar: ['filter', 'exports', 'print'],
|
||||
cols: [[
|
||||
{type: "checkbox", width: 50},
|
||||
{field: 'id', width: 80, title: 'ID'},
|
||||
{field: 'title',title: '标题'},
|
||||
{field: 'userId',title: '发布者',templet:'<div>{{d.user.name}}</div>'},
|
||||
{field: 'createTime',title: '发布时间'},
|
||||
]],
|
||||
page: true,
|
||||
skin: 'line'
|
||||
});
|
||||
|
||||
window.reload = function(){
|
||||
table.reload('currentTableId');
|
||||
}
|
||||
|
||||
// 监听搜索操作
|
||||
form.on('submit(data-search-btn)', function (data) {
|
||||
var result = JSON.stringify(data.field);
|
||||
//执行搜索重载
|
||||
table.reload('currentTableId', {
|
||||
where: data.field
|
||||
}, 'data');
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
/**
|
||||
* toolbar事件监听
|
||||
*/
|
||||
table.on('toolbar(currentTableFilter)', function (obj) {
|
||||
if (obj.event === 'add') { // 监听添加操作
|
||||
let content = miniPage.getHrefContent('notice/add.html');
|
||||
let openWH = miniPage.getOpenWidthHeight();
|
||||
let index = layer.open({
|
||||
title: '添加',
|
||||
type: 1,
|
||||
shade: 0.2,
|
||||
maxmin:true,
|
||||
shadeClose: true,
|
||||
area: [openWH[0] + 'px', openWH[1] + 'px'],
|
||||
offset: [openWH[2] + 'px', openWH[3] + 'px'],
|
||||
content: content
|
||||
});
|
||||
$(window).on("resize", function () {
|
||||
layer.full(index);
|
||||
});
|
||||
} else if (obj.event === 'update') { //修改操作
|
||||
let data = table.checkStatus('currentTableId').data;
|
||||
if(data.length!=1){
|
||||
layer.msg("请选择一条记录修改");
|
||||
}else{
|
||||
let content = miniPage.getHrefContent('notice/update.html');
|
||||
let openWH = miniPage.getOpenWidthHeight();
|
||||
let index = layer.open({
|
||||
title: '添加',
|
||||
type: 1,
|
||||
shade: 0.2,
|
||||
maxmin:true,
|
||||
shadeClose: true,
|
||||
area: [openWH[0] + 'px', openWH[1] + 'px'],
|
||||
offset: [openWH[2] + 'px', openWH[3] + 'px'],
|
||||
content: content
|
||||
});
|
||||
setFormValue(data[0]);
|
||||
$(window).on("resize", function () {
|
||||
layer.full(index);
|
||||
});
|
||||
}
|
||||
}else if (obj.event === 'delete') { //删除操作
|
||||
let data = table.checkStatus('currentTableId').data;
|
||||
if(data.length==0){
|
||||
layer.msg("请选择要删除的数据");
|
||||
}else{
|
||||
layer.confirm('真的删除行吗', function (index) {
|
||||
//异步删除 map\filter\some\every
|
||||
let arr = data.map(item=>item.id);
|
||||
axios.get('notice/delete?ids='+arr.join(",")).then(function (response) {
|
||||
table.reload('currentTableId');
|
||||
layer.msg(response.msg);
|
||||
}).catch(function (error) {
|
||||
layer.msg(error);
|
||||
});
|
||||
layer.close(index);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function setFormValue(data){
|
||||
form.val("updateForm",{
|
||||
id:data.id,
|
||||
title:data.title,
|
||||
content:data.content,
|
||||
})
|
||||
}
|
||||
|
||||
});
|
||||
</script>
|
@ -0,0 +1,124 @@
|
||||
<div class="layuimini-container layuimini-page-anim">
|
||||
<div class="layuimini-main">
|
||||
<div class="layui-btn-container">
|
||||
<button class="layui-btn layui-btn-normal layui-btn-sm data-add-btn" lay-event="add">
|
||||
<i class="layui-icon layui-icon-add-circle"></i>
|
||||
新增
|
||||
</button>
|
||||
<button class="layui-btn layui-btn-sm layui-btn-normal data-update-btn" lay-event="update">
|
||||
<i class="layui-icon layui-icon-edit"></i>
|
||||
修改
|
||||
</button>
|
||||
<button class="layui-btn layui-btn-sm layui-btn-danger data-delete-btn" lay-event="delete">
|
||||
<i class="layui-icon layui-icon-delete"></i>
|
||||
删除
|
||||
</button>
|
||||
</div>
|
||||
<div class="ztree" id="ztree"></div>
|
||||
|
||||
<!--<input type="text" class="layui-input" id="demo">-->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
layui.use(['form','miniPage','element','axios','ztree','selectOrg'], function () {
|
||||
let $ = layui.jquery,
|
||||
form = layui.form,
|
||||
axios = layui.axios,
|
||||
ztree = layui.ztree,
|
||||
selectOrg = layui.selectOrg,
|
||||
miniPage = layui.miniPage;
|
||||
|
||||
let setting = {
|
||||
data: {
|
||||
simpleData: {
|
||||
enable: true
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function loadTree(){
|
||||
axios.get('org/tree').then(function (response) {
|
||||
ztree.init($("#ztree"), setting,response.data);
|
||||
}).catch(function (error) {
|
||||
console.log(error);
|
||||
});
|
||||
}
|
||||
|
||||
loadTree();
|
||||
window.reload = function(){
|
||||
loadTree();
|
||||
}
|
||||
|
||||
$('.data-add-btn').click(function () {
|
||||
let content = miniPage.getHrefContent('org/add.html');
|
||||
let openWH = miniPage.getOpenWidthHeight();
|
||||
let index = layer.open({
|
||||
title: '添加',
|
||||
type: 1,
|
||||
shade: 0.2,
|
||||
maxmin:true,
|
||||
shadeClose: true,
|
||||
area: [openWH[0] + 'px', openWH[1] + 'px'],
|
||||
offset: [openWH[2] + 'px', openWH[3] + 'px'],
|
||||
content: content
|
||||
});
|
||||
$(window).on("resize", function () {
|
||||
layer.full(index);
|
||||
});
|
||||
});
|
||||
$('.data-update-btn').click(function () {
|
||||
let content = miniPage.getHrefContent('org/update.html');
|
||||
let openWH = miniPage.getOpenWidthHeight();
|
||||
let index = layer.open({
|
||||
title: '修改',
|
||||
type: 1,
|
||||
shade: 0.2,
|
||||
maxmin:true,
|
||||
shadeClose: true,
|
||||
area: [openWH[0] + 'px', openWH[1] + 'px'],
|
||||
offset: [openWH[2] + 'px', openWH[3] + 'px'],
|
||||
content: content
|
||||
});
|
||||
|
||||
let treeObj = ztree.getZTreeObj("ztree");
|
||||
let node = treeObj.getSelectedNodes()[0];
|
||||
|
||||
|
||||
form.val('updateForm',{
|
||||
id:node.id,
|
||||
name:node.name,
|
||||
parentId:node.pId,
|
||||
})
|
||||
$('#parentName').val(node.getParentNode().name)
|
||||
|
||||
|
||||
$(window).on("resize", function () {
|
||||
layer.full(index);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$('.data-delete-btn').click(function () {
|
||||
let treeObj = ztree.getZTreeObj("ztree");
|
||||
let node = treeObj.getSelectedNodes()[0];
|
||||
if(node){
|
||||
layer.confirm('真的删除行吗', function (index) {
|
||||
axios.get('org/delete?id='+node.id).then(function (response) {
|
||||
loadTree();
|
||||
layer.msg(response.msg);
|
||||
}).catch(function (error) {
|
||||
layer.msg(error);
|
||||
});
|
||||
layer.close(index);
|
||||
});
|
||||
}else{
|
||||
layer.msg("请选择要删除的数据");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
});
|
||||
</script>
|
@ -0,0 +1,134 @@
|
||||
<div class="layuimini-container layuimini-page-anim">
|
||||
<div class="layuimini-main">
|
||||
|
||||
<div style="margin: 10px 10px 10px 10px">
|
||||
<form class="layui-form layui-form-pane" action="">
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">姓名</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="name" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<button type="submit" class="layui-btn layui-btn-primary" lay-submit lay-filter="data-search-btn"><i class="layui-icon"></i> 搜 索</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<script type="text/html" id="toolbarDemo">
|
||||
<div class="layui-btn-container">
|
||||
<button class="layui-btn layui-btn-normal layui-btn-sm data-add-btn" lay-event="update">
|
||||
<i class="layui-icon layui-icon-edit"></i>
|
||||
标记解决
|
||||
</button>
|
||||
<button class="layui-btn layui-btn-sm layui-btn-danger data-delete-btn" lay-event="delete">
|
||||
<i class="layui-icon layui-icon-delete"></i>
|
||||
删除
|
||||
</button>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<table class="layui-hide" id="currentTableId" lay-filter="currentTableFilter"></table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
layui.use(['form', 'table','miniPage','miniAdmin','form','element','axios'], function () {
|
||||
var $ = layui.jquery,
|
||||
form = layui.form,
|
||||
table = layui.table,
|
||||
axios = layui.axios,
|
||||
form = layui.form,
|
||||
miniAdmin = layui.miniAdmin,
|
||||
miniPage = layui.miniPage;
|
||||
|
||||
table.render({
|
||||
elem: '#currentTableId',
|
||||
method:'post',
|
||||
url: 'repair/query',
|
||||
toolbar: '#toolbarDemo',
|
||||
defaultToolbar: ['filter', 'exports', 'print'],
|
||||
cols: [[
|
||||
{type: "checkbox", width: 50},
|
||||
{field: 'id', width: 80, title: 'ID'},
|
||||
{field: 'studentId',title: '姓名',templet:'<div>{{d.student.name}}</div>'},
|
||||
{field: 'dormitoryId',title: '宿舍',templet:'<div>{{d.dormitory.no}}</div>'},
|
||||
{field: 'buildingId',title: '楼宇',templet:'<div>{{d.building.name}}</div>'},
|
||||
{field: 'description',title: '报修描述'},
|
||||
{field: 'createDate',title: '申请时间'},
|
||||
{field: 'status',title: '状态',templet: function (row) {
|
||||
if(row.status == 0){
|
||||
return '<span class="layui-badge layui-bg-orange">待解决</span>';
|
||||
}else{
|
||||
return '<span class="layui-badge layui-bg-green">已解决</span>';
|
||||
}
|
||||
}}
|
||||
]],
|
||||
page: true,
|
||||
skin: 'line'
|
||||
});
|
||||
|
||||
window.reload = function(){
|
||||
table.reload('currentTableId');
|
||||
}
|
||||
|
||||
// 监听搜索操作
|
||||
form.on('submit(data-search-btn)', function (data) {
|
||||
var result = JSON.stringify(data.field);
|
||||
//执行搜索重载
|
||||
table.reload('currentTableId', {
|
||||
where: data.field
|
||||
}, 'data');
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
/**
|
||||
* toolbar事件监听
|
||||
*/
|
||||
table.on('toolbar(currentTableFilter)', function (obj) {
|
||||
if (obj.event === 'update') { //修改操作
|
||||
let data = table.checkStatus('currentTableId').data;
|
||||
if(data.length!=1){
|
||||
layer.msg("请选择一条记录修改");
|
||||
}else{
|
||||
axios.post('repair/update',{id:data[0].id,status:1}).then(function (response) {
|
||||
layer.msg(response.msg);
|
||||
table.reload('currentTableId');
|
||||
});
|
||||
}
|
||||
}else if (obj.event === 'delete') { //删除操作
|
||||
let data = table.checkStatus('currentTableId').data;
|
||||
if(data.length==0){
|
||||
layer.msg("请选择要删除的数据");
|
||||
}else{
|
||||
layer.confirm('真的删除行吗', function (index) {
|
||||
//异步删除 map\filter\some\every
|
||||
let arr = data.map(item=>item.id);
|
||||
axios.get('repair/delete?ids='+arr.join(",")).then(function (response) {
|
||||
table.reload('currentTableId');
|
||||
layer.msg(response.msg);
|
||||
}).catch(function (error) {
|
||||
layer.msg(error);
|
||||
});
|
||||
layer.close(index);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function setFormValue(data){
|
||||
form.val("updateForm",{
|
||||
id:data.id,
|
||||
dormitoryId:data.dormitoryId,
|
||||
startTime:data.startTime,
|
||||
endTime:data.endTime,
|
||||
remark:data.remark,
|
||||
})
|
||||
}
|
||||
|
||||
});
|
||||
</script>
|
@ -0,0 +1,208 @@
|
||||
<div class="layuimini-container layuimini-page-anim">
|
||||
<div class="layuimini-main">
|
||||
|
||||
<div style="margin: 10px 10px 10px 10px">
|
||||
<form class="layui-form layui-form-pane" action="">
|
||||
<div class="layui-form-item">
|
||||
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">名称</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="name" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<button type="submit" class="layui-btn layui-btn-primary" lay-submit lay-filter="data-search-btn"><i class="layui-icon"></i> 搜 索</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<script type="text/html" id="toolbarDemo">
|
||||
<div class="layui-btn-container">
|
||||
<button class="layui-btn layui-btn-normal layui-btn-sm data-add-btn" lay-event="add">
|
||||
<i class="layui-icon layui-icon-add-circle"></i>
|
||||
新增
|
||||
</button>
|
||||
<button class="layui-btn layui-btn-sm layui-btn-normal data-delete-btn" lay-event="update">
|
||||
<i class="layui-icon layui-icon-edit"></i>
|
||||
修改
|
||||
</button>
|
||||
<button class="layui-btn layui-btn-sm layui-btn-danger data-delete-btn" lay-event="delete">
|
||||
<i class="layui-icon layui-icon-delete"></i>
|
||||
删除
|
||||
</button>
|
||||
<button class="layui-btn layui-btn-sm layui-btn-normal data-delete-btn" lay-event="distribute">
|
||||
<i class="layui-icon layui-icon-edit"></i>
|
||||
分配
|
||||
</button>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<table class="layui-hide" id="currentTableId" lay-filter="currentTableFilter"></table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
layui.use(['form', 'table','miniPage','miniAdmin','form','element','axios'], function () {
|
||||
var $ = layui.jquery,
|
||||
form = layui.form,
|
||||
table = layui.table,
|
||||
axios = layui.axios,
|
||||
form = layui.form,
|
||||
miniAdmin = layui.miniAdmin,
|
||||
miniPage = layui.miniPage;
|
||||
|
||||
table.render({
|
||||
elem: '#currentTableId',
|
||||
method:'post',
|
||||
url: 'selection/query',
|
||||
toolbar: '#toolbarDemo',
|
||||
defaultToolbar: ['filter', 'exports', 'print'],
|
||||
cols: [[
|
||||
{type: "checkbox", width: 50},
|
||||
{field: 'id', width: 80, title: 'ID'},
|
||||
{field: 'name',title: '名称'},
|
||||
{field: 'startTime', title: '开始时间'},
|
||||
{field: 'endTime', title: '结束时间'},
|
||||
{field: 'remark',title: '备注'}
|
||||
]],
|
||||
page: true,
|
||||
skin: 'line'
|
||||
});
|
||||
|
||||
window.reload = function(){
|
||||
table.reload('currentTableId');
|
||||
}
|
||||
|
||||
// 监听搜索操作
|
||||
form.on('submit(data-search-btn)', function (data) {
|
||||
let result = JSON.stringify(data.field);
|
||||
//执行搜索重载
|
||||
table.reload('currentTableId', {
|
||||
where: data.field
|
||||
}, 'data');
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
/**
|
||||
* toolbar事件监听
|
||||
*/
|
||||
table.on('toolbar(currentTableFilter)', function (obj) {
|
||||
if (obj.event === 'add') { // 监听添加操作
|
||||
let content = miniPage.getHrefContent('selection/add.html');
|
||||
let openWH = miniPage.getOpenWidthHeight();
|
||||
let index = layer.open({
|
||||
title: '添加',
|
||||
type: 1,
|
||||
shade: 0.2,
|
||||
maxmin:true,
|
||||
shadeClose: true,
|
||||
area: [openWH[0] + 'px', openWH[1] + 'px'],
|
||||
offset: [openWH[2] + 'px', openWH[3] + 'px'],
|
||||
content: content
|
||||
});
|
||||
$(window).on("resize", function () {
|
||||
layer.full(index);
|
||||
});
|
||||
} else if (obj.event === 'update') { //修改操作
|
||||
let data = table.checkStatus('currentTableId').data;
|
||||
if(data.length!=1){
|
||||
layer.msg("请选择一条记录修改");
|
||||
}else{
|
||||
let content = miniPage.getHrefContent('selection/update.html');
|
||||
let openWH = miniPage.getOpenWidthHeight();
|
||||
let index = layer.open({
|
||||
title: '添加',
|
||||
type: 1,
|
||||
shade: 0.2,
|
||||
maxmin:true,
|
||||
shadeClose: true,
|
||||
area: [openWH[0] + 'px', openWH[1] + 'px'],
|
||||
offset: [openWH[2] + 'px', openWH[3] + 'px'],
|
||||
content: content
|
||||
});
|
||||
setFormValue(data[0]);
|
||||
$('#userId2').val(data[0].userId)
|
||||
$(window).on("resize", function () {
|
||||
layer.full(index);
|
||||
});
|
||||
}
|
||||
}else if (obj.event === 'distribute') { //修改操作
|
||||
let data = table.checkStatus('currentTableId').data;
|
||||
if(data.length!=1){
|
||||
layer.msg("请选择一条记录修改");
|
||||
}else{
|
||||
let content = miniPage.getHrefContent('selection/distribute.html');
|
||||
let openWH = miniPage.getOpenWidthHeight();
|
||||
let index = layer.open({
|
||||
title: '分配',
|
||||
type: 1,
|
||||
shade: 0.2,
|
||||
maxmin:true,
|
||||
shadeClose: true,
|
||||
area: [openWH[0] + 'px', openWH[1] + 'px'],
|
||||
offset: [openWH[2] + 'px', openWH[3] + 'px'],
|
||||
content: content
|
||||
});
|
||||
/*let clazzIdArr = data.clazzes.map(item=>item.id);
|
||||
let clazzNameArr = data.clazzes.map(item=>item.name);*/
|
||||
window.clazzData = function(){
|
||||
return data[0];
|
||||
}
|
||||
/*data[0].clazzes.forEach(item=>{
|
||||
let html = `<li key="${item.id}">${item.name}</li>`;
|
||||
let htmlObj = $(html);
|
||||
console.log("xxxxxxxxxxxxxxxxxxxxxxxx");
|
||||
htmlObj.click(function () {
|
||||
$(this).siblings().removeClass('clazz-bg');
|
||||
$(this).addClass('clazz-bg');
|
||||
});
|
||||
$('.clazz').append(htmlObj);
|
||||
})*/
|
||||
|
||||
|
||||
|
||||
|
||||
$(window).on("resize", function () {
|
||||
layer.full(index);
|
||||
});
|
||||
}
|
||||
}else if (obj.event === 'delete') { //删除操作
|
||||
let data = table.checkStatus('currentTableId').data;
|
||||
if(data.length==0){
|
||||
layer.msg("请选择要删除的数据");
|
||||
}else{
|
||||
layer.confirm('真的删除行吗', function (index) {
|
||||
//异步删除 map\filter\some\every
|
||||
let arr = data.map(item=>item.id);
|
||||
axios.get('selection/delete?ids='+arr.join(",")).then(function (response) {
|
||||
table.reload('currentTableId');
|
||||
layer.msg(response.msg);
|
||||
}).catch(function (error) {
|
||||
layer.msg(error);
|
||||
});
|
||||
layer.close(index);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function setFormValue(data){
|
||||
let clazzIdArr = data.clazzes.map(item=>item.id);
|
||||
let clazzNameArr = data.clazzes.map(item=>item.name);
|
||||
form.val("updateForm",{
|
||||
id:data.id,
|
||||
name:data.name,
|
||||
startTime:data.startTime,
|
||||
endTime:data.endTime,
|
||||
remark:data.remark,
|
||||
clazzId:clazzIdArr.join(','),
|
||||
clazzName:clazzNameArr.join(','),
|
||||
})
|
||||
}
|
||||
|
||||
});
|
||||
</script>
|
@ -0,0 +1,37 @@
|
||||
package com.yanzhen.framework.mvc;
|
||||
|
||||
import com.yanzhen.framework.exception.MyException; // 导入自定义异常类
|
||||
import com.yanzhen.utils.Result; // 导入结果处理工具类
|
||||
import org.springframework.web.bind.annotation.ControllerAdvice; // 导入Spring MVC的ControllerAdvice注解
|
||||
import org.springframework.web.bind.annotation.ExceptionHandler; // 导入Spring MVC的ExceptionHandler注解
|
||||
import org.springframework.web.bind.annotation.RequestBody; // 导入Spring MVC的RequestBody注解
|
||||
import org.springframework.web.bind.annotation.ResponseBody; // 导入Spring MVC的ResponseBody注解
|
||||
|
||||
// 全局异常处理类
|
||||
@ControllerAdvice
|
||||
public class GlobalControllerAdvice {
|
||||
|
||||
// 处理所有RuntimeException类型的异常
|
||||
@ExceptionHandler(RuntimeException.class)
|
||||
@ResponseBody
|
||||
// 定义处理方法,参数为捕获到的异常
|
||||
public Result handle(RuntimeException exception){
|
||||
// 打印异常堆栈信息
|
||||
exception.printStackTrace();
|
||||
// 返回失败的结果对象,包含异常信息
|
||||
return Result.fail(exception.getMessage());
|
||||
}
|
||||
|
||||
// 处理所有MyException类型的异常
|
||||
@ExceptionHandler(MyException.class)
|
||||
// 将返回值作为HTTP响应体
|
||||
@ResponseBody
|
||||
// 定义处理方法,参数为捕获到的异常
|
||||
public Result handle(MyException exception){
|
||||
// 打印异常堆栈信息
|
||||
exception.printStackTrace();
|
||||
// 返回失败的结果对象,包含错误码和异常信息
|
||||
return Result.fail(Result.TOKEN_ERROR,exception.getMessage());
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,78 @@
|
||||
<?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.yanzhen.mapper.AbsenceMapper">
|
||||
|
||||
<resultMap type="com.yanzhen.entity.Absence" id="Absence">
|
||||
<id column="id" property="id"/>
|
||||
<result column="student_id" property="studentId"/>
|
||||
<result column="dormitory_id" property="dormitoryId"/>
|
||||
<result column="start_time" property="startTime"/>
|
||||
<result column="end_time" property="endTime"/>
|
||||
<result column="remark" property="remark"/>
|
||||
</resultMap>
|
||||
|
||||
<insert id="create" keyProperty="id" useGeneratedKeys="true" parameterType="com.yanzhen.entity.Absence">
|
||||
insert into tb_absence(
|
||||
student_id,
|
||||
dormitory_id,
|
||||
start_time,
|
||||
end_time,
|
||||
remark
|
||||
)values(
|
||||
#{studentId},
|
||||
#{dormitoryId},
|
||||
#{startTime},
|
||||
#{endTime},
|
||||
#{remark}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<select id="query" resultMap="Absence">
|
||||
select * from tb_absence
|
||||
<include refid="AbsenceFindCriteria"/>
|
||||
</select>
|
||||
|
||||
<select id="count" resultType="int">
|
||||
select count(1) from tb_absence
|
||||
<include refid="AbsenceFindCriteria"/>
|
||||
</select>
|
||||
|
||||
<select id="detail" resultMap="Absence">
|
||||
select * from tb_absence where id = #{id}
|
||||
</select>
|
||||
|
||||
<delete id="delete">
|
||||
delete from tb_absence where id = #{id}
|
||||
</delete>
|
||||
<update id="update">
|
||||
update tb_absence set
|
||||
student_id=#{studentId},
|
||||
dormitory_id=#{dormitoryId},
|
||||
start_time=#{startTime},
|
||||
end_time=#{endTime},
|
||||
remark=#{remark}
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="updateSelective">
|
||||
update tb_absence
|
||||
<set>
|
||||
<if test="studentId != null">student_id = #{studentId},</if>
|
||||
<if test="dormitoryId != null">dormitory_id = #{dormitoryId},</if>
|
||||
<if test="startTime != null"> start_time = #{startTime},</if>
|
||||
<if test="endTime != null"> end_time = #{endTime},</if>
|
||||
<if test="remark != null and remark != ''"> remark = #{remark},</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<sql id="AbsenceFindCriteria">
|
||||
<where>
|
||||
<if test="id != null">and id = #{id}</if>
|
||||
<if test="studentId != null">and student_id = #{studentId}</if>
|
||||
<if test="dormitoryId != null">and dormitory_id = #{dormitoryId}</if>
|
||||
<if test="remark != null and remark != ''">and remark = #{remark}</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,65 @@
|
||||
<?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.yanzhen.mapper.BedMapper">
|
||||
|
||||
<resultMap type="com.yanzhen.entity.Bed" id="Bed">
|
||||
<id column="id" property="id"/>
|
||||
<result column="bno" property="bno"/>
|
||||
<result column="dormitory_id" property="dormitoryId"/>
|
||||
</resultMap>
|
||||
|
||||
<insert id="create" keyProperty="id" useGeneratedKeys="true" parameterType="com.yanzhen.entity.Bed">
|
||||
insert into tb_bed(
|
||||
bno,
|
||||
dormitory_id
|
||||
)values(
|
||||
#{bno},
|
||||
#{dormitoryId}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<select id="query" resultMap="Bed">
|
||||
select * from tb_bed
|
||||
<include refid="BedFindCriteria"/>
|
||||
</select>
|
||||
|
||||
<select id="count" resultType="int">
|
||||
select count(1) from tb_bed
|
||||
<include refid="BedFindCriteria"/>
|
||||
</select>
|
||||
|
||||
<select id="detail" resultMap="Bed">
|
||||
select * from tb_bed where id = #{id}
|
||||
</select>
|
||||
|
||||
<delete id="delete">
|
||||
delete from tb_bed where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteByDormitoryId">
|
||||
delete from tb_bed where dormitory_id = #{dormitoryId}
|
||||
</delete>
|
||||
|
||||
<update id="update">
|
||||
update tb_bed set
|
||||
bno=#{bno},
|
||||
dormitory_id=#{dormitoryId}
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="updateSelective">
|
||||
update tb_bed set
|
||||
<if test="bno != null and bno != ''"> bno = #{bno}</if>,
|
||||
<if test="dormitoryId != null">dormitory_id = #{dormitoryId}</if>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<sql id="BedFindCriteria">
|
||||
<where>
|
||||
<if test="id != null">and id = #{id}</if>
|
||||
<if test="bno != null and bno != ''">and bno = #{bno}</if>
|
||||
<if test="dormitoryId != null">and dormitory_id = #{dormitoryId}</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,84 @@
|
||||
<?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.yanzhen.mapper.BuildingMapper">
|
||||
|
||||
<resultMap type="com.yanzhen.entity.Building" id="Building">
|
||||
<id column="id" property="id"/>
|
||||
<result column="name" property="name"/>
|
||||
<result column="type" property="type"/>
|
||||
<result column="storey_num" property="storeyNum"/>
|
||||
<result column="sex" property="sex"/>
|
||||
<result column="remark" property="remark"/>
|
||||
<result column="user_id" property="userId"/>
|
||||
</resultMap>
|
||||
|
||||
<insert id="create" keyProperty="id" useGeneratedKeys="true" parameterType="com.yanzhen.entity.Building">
|
||||
insert into tb_building(
|
||||
name,
|
||||
type,
|
||||
storey_num,
|
||||
sex,
|
||||
remark,
|
||||
user_id
|
||||
)values(
|
||||
#{name},
|
||||
#{type},
|
||||
#{storeyNum},
|
||||
#{sex},
|
||||
#{remark},
|
||||
#{userId}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<select id="query" resultMap="Building">
|
||||
select * from tb_building
|
||||
<include refid="BuildingFindCriteria"/>
|
||||
</select>
|
||||
|
||||
<select id="count" resultType="int">
|
||||
select count(1) from tb_building
|
||||
<include refid="BuildingFindCriteria"/>
|
||||
</select>
|
||||
|
||||
<select id="detail" resultMap="Building">
|
||||
select * from tb_building where id = #{id}
|
||||
</select>
|
||||
|
||||
<delete id="delete">
|
||||
delete from tb_building where id = #{id}
|
||||
</delete>
|
||||
<update id="update">
|
||||
update tb_building set
|
||||
name=#{name},
|
||||
type=#{type},
|
||||
storey_num=#{storeyNum},
|
||||
sex=#{sex},
|
||||
remark=#{remark},
|
||||
user_id=#{userId}
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="updateSelective">
|
||||
update tb_building set
|
||||
<if test="name != null and name != ''"> name = #{name}</if>,
|
||||
<if test="type != null">type = #{type}</if>,
|
||||
<if test="storeyNum != null">storey_num = #{storeyNum}</if>,
|
||||
<if test="sex != null">sex = #{sex}</if>,
|
||||
<if test="remark != null and remark != ''"> remark = #{remark}</if>,
|
||||
<if test="userId != null">user_id = #{userId}</if>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<sql id="BuildingFindCriteria">
|
||||
<where>
|
||||
<if test="id != null">and id = #{id}</if>
|
||||
<if test="name != null and name != ''">and name like concat('%',#{name},'%')</if>
|
||||
<if test="type != null">and type = #{type}</if>
|
||||
<if test="storeyNum != null">and storey_num = #{storeyNum}</if>
|
||||
<if test="sex != null">and sex = #{sex}</if>
|
||||
<if test="remark != null and remark != ''">and remark = #{remark}</if>
|
||||
<if test="userId != null">and user_id = #{userId}</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,90 @@
|
||||
<?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.yanzhen.mapper.DormitoryMapper">
|
||||
|
||||
<resultMap type="com.yanzhen.entity.Dormitory" id="Dormitory">
|
||||
<id column="id" property="id"/>
|
||||
<result column="no" property="no"/>
|
||||
<result column="sex" property="sex"/>
|
||||
<result column="type" property="type"/>
|
||||
<result column="capacity" property="capacity"/>
|
||||
<result column="storey_id" property="storeyId"/>
|
||||
<result column="building_id" property="buildingId"/>
|
||||
</resultMap>
|
||||
|
||||
<insert id="create" keyProperty="id" useGeneratedKeys="true" parameterType="com.yanzhen.entity.Dormitory">
|
||||
insert into tb_dormitory(
|
||||
no,
|
||||
sex,
|
||||
type,
|
||||
capacity,
|
||||
storey_id,
|
||||
building_id
|
||||
)values(
|
||||
#{no},
|
||||
#{sex},
|
||||
#{type},
|
||||
#{capacity},
|
||||
#{storeyId},
|
||||
#{buildingId}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<select id="query" resultMap="Dormitory">
|
||||
select * from tb_dormitory
|
||||
<include refid="DormitoryFindCriteria"/>
|
||||
</select>
|
||||
|
||||
<select id="count" resultType="int">
|
||||
select count(1) from tb_dormitory
|
||||
<include refid="DormitoryFindCriteria"/>
|
||||
</select>
|
||||
|
||||
<select id="detail" resultMap="Dormitory">
|
||||
select * from tb_dormitory where id = #{id}
|
||||
</select>
|
||||
|
||||
<delete id="delete">
|
||||
delete from tb_dormitory where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteByBuildingIdAndStoryId">
|
||||
delete from tb_dormitory where building_id = #{buildingId} and storey_id = #{storeyId}
|
||||
</delete>
|
||||
|
||||
|
||||
<update id="update">
|
||||
update tb_dormitory set
|
||||
no=#{no},
|
||||
sex=#{sex},
|
||||
type=#{type},
|
||||
capacity=#{capacity},
|
||||
storey_id=#{storeyId},
|
||||
building_id=#{buildingId}
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="updateSelective">
|
||||
update tb_dormitory set
|
||||
<if test="no != null and no != ''"> no = #{no}</if>,
|
||||
<if test="sex != null">sex = #{sex}</if>,
|
||||
<if test="type != null">type = #{type}</if>,
|
||||
<if test="capacity != null">capacity = #{capacity}</if>,
|
||||
<if test="storeyId != null">storey_id = #{storeyId}</if>,
|
||||
<if test="buildingId != null">building_id = #{buildingId}</if>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<sql id="DormitoryFindCriteria">
|
||||
<where>
|
||||
<if test="id != null">and id = #{id}</if>
|
||||
<if test="no != null and no != ''">and no = #{no}</if>
|
||||
<if test="sex != null">and sex = #{sex}</if>
|
||||
<if test="type != null">and type = #{type}</if>
|
||||
<if test="capacity != null">and capacity = #{capacity}</if>
|
||||
<if test="storeyId != null">and storey_id = #{storeyId}</if>
|
||||
<if test="buildingId != null">and building_id = #{buildingId}</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,84 @@
|
||||
<?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.yanzhen.mapper.DormitorySetMapper">
|
||||
|
||||
<resultMap type="com.yanzhen.entity.DormitorySet" id="DormitorySet">
|
||||
<id column="id" property="id"/>
|
||||
<result column="prefix" property="prefix"/>
|
||||
<result column="start" property="start"/>
|
||||
<result column="end" property="end"/>
|
||||
<result column="building_id" property="buildingId"/>
|
||||
<result column="storey_id" property="storeyId"/>
|
||||
<result column="capacity" property="capacity"/>
|
||||
</resultMap>
|
||||
|
||||
<insert id="create" keyProperty="id" useGeneratedKeys="true" parameterType="com.yanzhen.entity.DormitorySet">
|
||||
insert into tb_dormitory_set(
|
||||
prefix,
|
||||
start,
|
||||
end,
|
||||
building_id,
|
||||
storey_id,
|
||||
capacity
|
||||
)values(
|
||||
#{prefix},
|
||||
#{start},
|
||||
#{end},
|
||||
#{buildingId},
|
||||
#{storeyId},
|
||||
#{capacity}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<select id="query" resultMap="DormitorySet">
|
||||
select * from tb_dormitory_set
|
||||
<include refid="DormitorySetFindCriteria"/>
|
||||
</select>
|
||||
|
||||
<select id="count" resultType="int">
|
||||
select count(1) from tb_dormitory_set
|
||||
<include refid="DormitorySetFindCriteria"/>
|
||||
</select>
|
||||
|
||||
<select id="detail" resultMap="DormitorySet">
|
||||
select * from tb_dormitory_set where id = #{id}
|
||||
</select>
|
||||
|
||||
<delete id="delete">
|
||||
delete from tb_dormitory_set where id = #{id}
|
||||
</delete>
|
||||
<update id="update">
|
||||
update tb_dormitory_set set
|
||||
prefix=#{prefix},
|
||||
start=#{start},
|
||||
end=#{end},
|
||||
building_id=#{buildingId},
|
||||
storey_id=#{storeyId},
|
||||
capacity=#{capacity}
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="updateSelective">
|
||||
update tb_dormitory_set set
|
||||
<if test="prefix != null and prefix != ''"> prefix = #{prefix}</if>,
|
||||
<if test="start != null">start = #{start}</if>,
|
||||
<if test="end != null">end = #{end}</if>,
|
||||
<if test="buildingId != null">building_id = #{buildingId}</if>,
|
||||
<if test="storeyId != null">storey_id = #{storeyId}</if>,
|
||||
<if test="capacity != null">capacity = #{capacity}</if>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<sql id="DormitorySetFindCriteria">
|
||||
<where>
|
||||
<if test="id != null">and id = #{id}</if>
|
||||
<if test="prefix != null and prefix != ''">and prefix = #{prefix}</if>
|
||||
<if test="start != null">and start = #{start}</if>
|
||||
<if test="end != null">and end = #{end}</if>
|
||||
<if test="buildingId != null">and building_id = #{buildingId}</if>
|
||||
<if test="storeyId != null">and storey_id = #{storeyId}</if>
|
||||
<if test="capacity != null">and capacity = #{capacity}</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,95 @@
|
||||
<?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.yanzhen.mapper.DormitoryStudentMapper">
|
||||
|
||||
<resultMap type="com.yanzhen.entity.DormitoryStudent" id="DormitoryStudent">
|
||||
<id column="id" property="id"/>
|
||||
<result column="dormitory_id" property="dormitoryId"/>
|
||||
<result column="bed_id" property="bedId"/>
|
||||
<result column="student_id" property="studentId"/>
|
||||
<result column="checkin" property="checkin"/>
|
||||
<result column="status" property="status"/>
|
||||
</resultMap>
|
||||
|
||||
<insert id="create" keyProperty="id" useGeneratedKeys="true" parameterType="com.yanzhen.entity.DormitoryStudent">
|
||||
insert into tb_dormitory_student(
|
||||
dormitory_id,
|
||||
bed_id,
|
||||
student_id,
|
||||
checkin,
|
||||
status
|
||||
)values(
|
||||
#{dormitoryId},
|
||||
#{bedId},
|
||||
#{studentId},
|
||||
#{checkin},
|
||||
#{status}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<select id="query" resultMap="DormitoryStudent">
|
||||
select * from tb_dormitory_student
|
||||
<include refid="DormitoryStudentFindCriteria"/>
|
||||
</select>
|
||||
|
||||
<select id="count" resultType="int">
|
||||
select count(1) from tb_dormitory_student
|
||||
<include refid="DormitoryStudentFindCriteria"/>
|
||||
</select>
|
||||
|
||||
<select id="detail" resultMap="DormitoryStudent">
|
||||
select * from tb_dormitory_student where id = #{id}
|
||||
</select>
|
||||
|
||||
<delete id="delete">
|
||||
delete from tb_dormitory_student where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteByCond">
|
||||
delete from tb_dormitory_student where student_id = #{studentId}
|
||||
</delete>
|
||||
|
||||
|
||||
<update id="update">
|
||||
update tb_dormitory_student set
|
||||
dormitory_id=#{dormitoryId},
|
||||
bed_id=#{bedId},
|
||||
student_id=#{studentId},
|
||||
checkin=#{checkin},
|
||||
status=#{status}
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="updateSelective">
|
||||
update tb_dormitory_student set
|
||||
<if test="dormitoryId != null">dormitory_id = #{dormitoryId}</if>,
|
||||
<if test="bedId != null">bed_id = #{bedId}</if>,
|
||||
<if test="studentId != null">student_id = #{studentId}</if>,
|
||||
<if test="checkin != null and checkin != ''"> checkin = #{checkin}</if>,
|
||||
<if test="status != null">status = #{status}</if>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<sql id="DormitoryStudentFindCriteria">
|
||||
<where>
|
||||
<if test="id != null">and id = #{id}</if>
|
||||
<if test="dormitoryId != null">and dormitory_id = #{dormitoryId}</if>
|
||||
<if test="bedId != null">and bed_id = #{bedId}</if>
|
||||
<if test="studentId != null">and student_id = #{studentId}</if>
|
||||
<if test="status != null">and status = #{status}</if>
|
||||
</where>
|
||||
</sql>
|
||||
<!--查询楼宇入住数量-->
|
||||
<select id="countByBuildingId" resultType="int">
|
||||
select count(distinct student_id) cnt from tb_dormitory_student,tb_dormitory where tb_dormitory_student.dormitory_id = tb_dormitory.id
|
||||
and building_id = #{buildingId}
|
||||
</select>
|
||||
|
||||
<!--查询床位对应的学生-->
|
||||
<select id="queryStudentByBedId" resultType="java.util.HashMap">
|
||||
select student_id,tb_student.name from tb_dormitory_student ,tb_student where
|
||||
tb_dormitory_student.student_id = tb_student.id and bed_id = #{bedId} limit 1
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
@ -0,0 +1,54 @@
|
||||
<?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.yanzhen.mapper.GradeMapper">
|
||||
|
||||
<resultMap type="com.yanzhen.entity.Grade" id="Grade">
|
||||
<id column="id" property="id"/>
|
||||
<result column="name" property="name"/>
|
||||
</resultMap>
|
||||
|
||||
<insert id="create" keyProperty="id" useGeneratedKeys="true" parameterType="com.yanzhen.entity.Grade">
|
||||
insert into tb_grade(
|
||||
name
|
||||
)values(
|
||||
#{name}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<select id="query" resultMap="Grade">
|
||||
select * from tb_grade
|
||||
<include refid="GradeFindCriteria"/>
|
||||
</select>
|
||||
|
||||
<select id="count" resultType="int">
|
||||
select count(1) from tb_grade
|
||||
<include refid="GradeFindCriteria"/>
|
||||
</select>
|
||||
|
||||
<select id="detail" resultMap="Grade">
|
||||
select * from tb_grade where id = #{id}
|
||||
</select>
|
||||
|
||||
<delete id="delete">
|
||||
delete from tb_grade where id = #{id}
|
||||
</delete>
|
||||
<update id="update">
|
||||
update tb_grade set
|
||||
name=#{name}
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="updateSelective">
|
||||
update tb_grade set
|
||||
<if test="name != null and name != ''"> name = #{name}</if>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<sql id="GradeFindCriteria">
|
||||
<where>
|
||||
<if test="id != null">and id = #{id}</if>
|
||||
<if test="name != null and name != ''">and name = #{name}</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,41 @@
|
||||
<?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.yanzhen.mapper.MenuMapper">
|
||||
|
||||
|
||||
<resultMap id="Menu" type="com.yanzhen.entity.Menu">
|
||||
<id column="id" property="id"/>
|
||||
<result column="title" property="title"/>
|
||||
<result column="icon" property="icon"/>
|
||||
<result column="href" property="href"/>
|
||||
<result column="target" property="target"/>
|
||||
<result column="parent_id" property="parentId"/>
|
||||
<result column="type" property="type"/>
|
||||
</resultMap>
|
||||
|
||||
<insert id="deleteUserMenu">
|
||||
delete from tb_user_menu where user_id = #{userId}
|
||||
</insert>
|
||||
|
||||
<insert id="createUserMenu">
|
||||
insert into tb_user_menu(user_id,menu_id) values(#{userId},#{menuId})
|
||||
</insert>
|
||||
|
||||
<select id="query" resultMap="Menu">
|
||||
select tb_menu.* from tb_menu,tb_user_menu where tb_menu.id=tb_user_menu.menu_id
|
||||
and user_id = #{userId} and tb_menu.type = 0
|
||||
</select>
|
||||
|
||||
<select id="queryByType" resultMap="Menu">
|
||||
select tb_menu.* from tb_menu where type = 1
|
||||
</select>
|
||||
|
||||
<select id="queryCheckMenuId" resultType="int">
|
||||
select menu_id from tb_user_menu where user_id = #{userId}
|
||||
</select>
|
||||
|
||||
<select id="list" resultMap="Menu">
|
||||
select tb_menu.* from tb_menu where type = 0
|
||||
</select>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,85 @@
|
||||
<?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.yanzhen.mapper.NoticeMapper">
|
||||
|
||||
<resultMap type="com.yanzhen.entity.Notice" id="Notice">
|
||||
<id column="id" property="id"/>
|
||||
<result column="title" property="title"/>
|
||||
<result column="content" property="content"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="user_id" property="userId"/>
|
||||
<result column="filepath" property="filepath"/>
|
||||
</resultMap>
|
||||
|
||||
<insert id="create" keyProperty="id" useGeneratedKeys="true" parameterType="com.yanzhen.entity.Notice">
|
||||
insert into tb_notice(
|
||||
title,
|
||||
content,
|
||||
create_time,
|
||||
user_id,
|
||||
filepath
|
||||
)values(
|
||||
#{title},
|
||||
#{content},
|
||||
now(),
|
||||
#{userId},
|
||||
#{filepath}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<select id="query" resultMap="Notice">
|
||||
select * from tb_notice
|
||||
<include refid="NoticeFindCriteria"/>
|
||||
</select>
|
||||
|
||||
<select id="count" resultType="int">
|
||||
select count(1) from tb_notice
|
||||
<include refid="NoticeFindCriteria"/>
|
||||
</select>
|
||||
|
||||
<select id="detail" resultMap="Notice">
|
||||
select * from tb_notice where id = #{id}
|
||||
</select>
|
||||
|
||||
<delete id="delete">
|
||||
delete from tb_notice where id = #{id}
|
||||
</delete>
|
||||
<update id="update">
|
||||
update tb_notice set
|
||||
title=#{title},
|
||||
content=#{content},
|
||||
create_time=#{createTime},
|
||||
user_id=#{userId},
|
||||
filepath=#{filepath}
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="updateSelective">
|
||||
update tb_notice
|
||||
<set>
|
||||
<if test="title != null and title != ''"> title = #{title},</if>
|
||||
<if test="content != null and content != ''"> content = #{content},</if>
|
||||
<if test="createTime != null and createTime != ''"> create_time = #{createTime},</if>
|
||||
<if test="userId != null">user_id = #{userId},</if>
|
||||
<if test="filepath != null and filepath != ''"> filepath = #{filepath},</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<sql id="NoticeFindCriteria">
|
||||
<where>
|
||||
<if test="id != null">and id = #{id}</if>
|
||||
<if test="title != null and title != ''">and title = #{title}</if>
|
||||
<if test="content != null and content != ''">and content = #{content}</if>
|
||||
<if test="userId != null">and user_id = #{userId}</if>
|
||||
<if test="filepath != null and filepath != ''">and filepath = #{filepath}</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
|
||||
<select id="queryByBuildingId" resultMap="Notice">
|
||||
select tb_notice.* from tb_notice,tb_notice_receive where tb_notice.id = tb_notice_receive.notice_id and building_id = #{buildingId}
|
||||
<include refid="NoticeFindCriteria"/>
|
||||
</select>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,26 @@
|
||||
// 定义包名
|
||||
package com.yanzhen.mapper;
|
||||
|
||||
import java.util.List; // 导入List集合类
|
||||
import java.util.Map; // 导入Map集合类
|
||||
|
||||
import com.yanzhen.entity.NoticeReceive; // 导入NoticeReceive实体类
|
||||
// 定义NoticeReceiveMapper接口
|
||||
public interface NoticeReceiveMapper {
|
||||
// 创建记录的方法
|
||||
public int create(NoticeReceive noticeReceive);
|
||||
// 根据ID删除记录的方法
|
||||
public int delete(Integer id);
|
||||
// 根据通知ID删除记录的方法并返回
|
||||
public int deleteByNoticeId(Integer noticeId);
|
||||
// 更新记录的方法
|
||||
public int update(NoticeReceive noticeReceive);
|
||||
// 选择性更新记录的方法
|
||||
public int updateSelective(NoticeReceive noticeReceive);
|
||||
// 查询记录列表的方法
|
||||
public List<NoticeReceive> query(NoticeReceive noticeReceive);
|
||||
// 根据ID获取NoticeReceive详情的方法
|
||||
public NoticeReceive detail(Integer id);
|
||||
// 统计NoticeReceive记录数量的方法
|
||||
public int count(NoticeReceive noticeReceive);
|
||||
}
|
@ -0,0 +1,65 @@
|
||||
<?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.yanzhen.mapper.NoticeReceiveMapper">
|
||||
|
||||
<resultMap type="com.yanzhen.entity.NoticeReceive" id="NoticeReceive">
|
||||
<id column="id" property="id"/>
|
||||
<result column="notice_id" property="noticeId"/>
|
||||
<result column="building_id" property="buildingId"/>
|
||||
</resultMap>
|
||||
|
||||
<insert id="create" keyProperty="id" useGeneratedKeys="true" parameterType="com.yanzhen.entity.NoticeReceive">
|
||||
insert into tb_notice_receive(
|
||||
notice_id,
|
||||
building_id
|
||||
)values(
|
||||
#{noticeId},
|
||||
#{buildingId}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<select id="query" resultMap="NoticeReceive">
|
||||
select * from tb_notice_receive
|
||||
<include refid="NoticeReceiveFindCriteria"/>
|
||||
</select>
|
||||
|
||||
<select id="count" resultType="int">
|
||||
select count(1) from tb_notice_receive
|
||||
<include refid="NoticeReceiveFindCriteria"/>
|
||||
</select>
|
||||
|
||||
<select id="detail" resultMap="NoticeReceive">
|
||||
select * from tb_notice_receive where id = #{id}
|
||||
</select>
|
||||
|
||||
<delete id="delete">
|
||||
delete from tb_notice_receive where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteByNoticeId">
|
||||
delete from tb_notice_receive where notice_id = #{noticeId}
|
||||
</delete>
|
||||
|
||||
<update id="update">
|
||||
update tb_notice_receive set
|
||||
notice_id=#{noticeId},
|
||||
building_id=#{buildingId}
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="updateSelective">
|
||||
update tb_notice_receive set
|
||||
<if test="noticeId != null">notice_id = #{noticeId}</if>,
|
||||
<if test="buildingId != null">building_id = #{buildingId}</if>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<sql id="NoticeReceiveFindCriteria">
|
||||
<where>
|
||||
<if test="id != null">and id = #{id}</if>
|
||||
<if test="noticeId != null">and notice_id = #{noticeId}</if>
|
||||
<if test="buildingId != null">and building_id = #{buildingId}</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,82 @@
|
||||
<?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.yanzhen.mapper.OrgMapper">
|
||||
|
||||
<resultMap type="com.yanzhen.entity.Org" id="Org">
|
||||
<id column="id" property="id"/>
|
||||
<result column="name" property="name"/>
|
||||
<result column="type" property="type"/>
|
||||
<result column="grade_id" property="gradeId"/>
|
||||
<result column="parent_id" property="parentId"/>
|
||||
<result column="remark" property="remark"/>
|
||||
</resultMap>
|
||||
|
||||
<insert id="create" keyProperty="id" useGeneratedKeys="true" parameterType="com.yanzhen.entity.Org">
|
||||
insert into tb_org(
|
||||
name,
|
||||
type,
|
||||
grade_id,
|
||||
parent_id,
|
||||
remark
|
||||
)values(
|
||||
#{name},
|
||||
#{type},
|
||||
#{gradeId},
|
||||
#{parentId},
|
||||
#{remark}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<select id="query" resultMap="Org">
|
||||
select * from tb_org
|
||||
<include refid="OrgFindCriteria"/>
|
||||
</select>
|
||||
|
||||
<select id="count" resultType="int">
|
||||
select count(1) from tb_org
|
||||
<include refid="OrgFindCriteria"/>
|
||||
</select>
|
||||
|
||||
<select id="detail" resultMap="Org">
|
||||
select * from tb_org where id = #{id}
|
||||
</select>
|
||||
|
||||
<delete id="delete">
|
||||
delete from tb_org where id = #{id}
|
||||
</delete>
|
||||
<update id="update">
|
||||
update tb_org set
|
||||
name=#{name},
|
||||
type=#{type},
|
||||
grade_id=#{gradeId},
|
||||
parent_id=#{parentId},
|
||||
remark=#{remark}
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="updateSelective">
|
||||
update tb_org set
|
||||
<if test="name != null and name != ''"> name = #{name}</if>,
|
||||
<if test="type != null">type = #{type}</if>,
|
||||
<if test="gradeId != null">grade_id = #{gradeId}</if>,
|
||||
<if test="parentId != null">parent_id = #{parentId}</if>,
|
||||
<if test="remark != null and remark != ''"> remark = #{remark}</if>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<sql id="OrgFindCriteria">
|
||||
<where>
|
||||
<if test="id != null">and id = #{id}</if>
|
||||
<if test="name != null and name != ''">and name = #{name}</if>
|
||||
<if test="type != null">and type = #{type}</if>
|
||||
<if test="gradeId != null">and grade_id = #{gradeId}</if>
|
||||
<if test="parentId != null">and parent_id = #{parentId}</if>
|
||||
<if test="remark != null and remark != ''">and remark = #{remark}</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<select id="queryOrgBySelectionId" resultMap="Org">
|
||||
select tb_org.* from tb_org,tb_selection_joiner where tb_selection_joiner.clazz_id = tb_org.id and selection_id = #{selectionId}
|
||||
</select>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,77 @@
|
||||
<?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.yanzhen.mapper.RecordMapper">
|
||||
|
||||
<resultMap type="com.yanzhen.entity.Record" id="Record">
|
||||
<id column="id" property="id"/>
|
||||
<result column="student_id" property="studentId"/>
|
||||
<result column="dormitory_id" property="dormitoryId"/>
|
||||
<result column="bed_id" property="bedId"/>
|
||||
<result column="status" property="status"/>
|
||||
<result column="create_date" property="createDate"/>
|
||||
</resultMap>
|
||||
|
||||
<insert id="create" keyProperty="id" useGeneratedKeys="true" parameterType="com.yanzhen.entity.Record">
|
||||
insert into tb_record(
|
||||
student_id,
|
||||
dormitory_id,
|
||||
bed_id,
|
||||
status,
|
||||
create_date
|
||||
)values(
|
||||
#{studentId},
|
||||
#{dormitoryId},
|
||||
#{bedId},
|
||||
#{status},
|
||||
#{createDate}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<select id="query" resultMap="Record">
|
||||
select * from tb_record
|
||||
<include refid="RecordFindCriteria"/>
|
||||
</select>
|
||||
|
||||
<select id="count" resultType="int">
|
||||
select count(1) from tb_record
|
||||
<include refid="RecordFindCriteria"/>
|
||||
</select>
|
||||
|
||||
<select id="detail" resultMap="Record">
|
||||
select * from tb_record where id = #{id}
|
||||
</select>
|
||||
|
||||
<delete id="delete">
|
||||
delete from tb_record where id = #{id}
|
||||
</delete>
|
||||
<update id="update">
|
||||
update tb_record set
|
||||
student_id=#{studentId},
|
||||
dormitory_id=#{dormitoryId},
|
||||
bed_id=#{bedId},
|
||||
status=#{status},
|
||||
create_date=#{createDate}
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="updateSelective">
|
||||
update tb_record set
|
||||
<if test="studentId != null">student_id = #{studentId}</if>,
|
||||
<if test="dormitoryId != null">dormitory_id = #{dormitoryId}</if>,
|
||||
<if test="bedId != null">bed_id = #{bedId}</if>,
|
||||
<if test="status != null">status = #{status}</if>,
|
||||
<if test="createDate != null and createDate != ''"> create_date = #{createDate}</if>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<sql id="RecordFindCriteria">
|
||||
<where>
|
||||
<if test="id != null">and id = #{id}</if>
|
||||
<if test="studentId != null">and student_id = #{studentId}</if>
|
||||
<if test="dormitoryId != null">and dormitory_id = #{dormitoryId}</if>
|
||||
<if test="bedId != null">and bed_id = #{bedId}</if>
|
||||
<if test="status != null">and status = #{status}</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,85 @@
|
||||
<?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.yanzhen.mapper.RepairMapper">
|
||||
|
||||
<resultMap type="com.yanzhen.entity.Repair" id="Repair">
|
||||
<id column="id" property="id"/>
|
||||
<result column="student_id" property="studentId"/>
|
||||
<result column="dormitory_id" property="dormitoryId"/>
|
||||
<result column="building_id" property="buildingId"/>
|
||||
<result column="description" property="description"/>
|
||||
<result column="create_date" property="createDate"/>
|
||||
<result column="status" property="status"/>
|
||||
</resultMap>
|
||||
|
||||
<insert id="create" keyProperty="id" useGeneratedKeys="true" parameterType="com.yanzhen.entity.Repair">
|
||||
insert into tb_repair(
|
||||
student_id,
|
||||
dormitory_id,
|
||||
building_id,
|
||||
description,
|
||||
create_date,
|
||||
status
|
||||
)values(
|
||||
#{studentId},
|
||||
#{dormitoryId},
|
||||
#{buildingId},
|
||||
#{description},
|
||||
#{createDate},
|
||||
#{status}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<select id="query" resultMap="Repair">
|
||||
select * from tb_repair
|
||||
<include refid="RepairFindCriteria"/>
|
||||
</select>
|
||||
|
||||
<select id="count" resultType="int">
|
||||
select count(1) from tb_repair
|
||||
<include refid="RepairFindCriteria"/>
|
||||
</select>
|
||||
|
||||
<select id="detail" resultMap="Repair">
|
||||
select * from tb_repair where id = #{id}
|
||||
</select>
|
||||
|
||||
<delete id="delete">
|
||||
delete from tb_repair where id = #{id}
|
||||
</delete>
|
||||
<update id="update">
|
||||
update tb_repair set
|
||||
student_id=#{studentId},
|
||||
dormitory_id=#{dormitoryId},
|
||||
building_id=#{buildingId},
|
||||
description=#{description},
|
||||
create_date=#{createDate},
|
||||
status=#{status}
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="updateSelective">
|
||||
update tb_repair
|
||||
<set>
|
||||
<if test="studentId != null">student_id = #{studentId},</if>
|
||||
<if test="dormitoryId != null">dormitory_id = #{dormitoryId},</if>
|
||||
<if test="buildingId != null">building_id = #{buildingId},</if>
|
||||
<if test="description != null and description != ''"> description = #{description},</if>
|
||||
<if test="createDate != null and createDate != ''"> create_date = #{createDate},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<sql id="RepairFindCriteria">
|
||||
<where>
|
||||
<if test="id != null">and id = #{id}</if>
|
||||
<if test="studentId != null">and student_id = #{studentId}</if>
|
||||
<if test="dormitoryId != null">and dormitory_id = #{dormitoryId}</if>
|
||||
<if test="buildingId != null">and building_id = #{buildingId}</if>
|
||||
<if test="description != null and description != ''">and description = #{description}</if>
|
||||
<if test="status != null">and status = #{status}</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,64 @@
|
||||
<?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.yanzhen.mapper.SelectionDormitoryMapper">
|
||||
|
||||
<resultMap type="com.yanzhen.entity.SelectionDormitory" id="SelectionDormitory">
|
||||
<id column="id" property="id"/>
|
||||
<result column="dormitory_id" property="dormitoryId"/>
|
||||
<result column="clazz_id" property="clazzId"/>
|
||||
</resultMap>
|
||||
|
||||
<insert id="create" keyProperty="id" useGeneratedKeys="true" parameterType="com.yanzhen.entity.SelectionDormitory">
|
||||
insert into tb_selection_dormitory(
|
||||
dormitory_id,
|
||||
clazz_id
|
||||
)values(
|
||||
#{dormitoryId},
|
||||
#{clazzId}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<select id="query" resultMap="SelectionDormitory">
|
||||
select * from tb_selection_dormitory
|
||||
<include refid="SelectionDormitoryFindCriteria"/>
|
||||
</select>
|
||||
|
||||
<select id="count" resultType="int">
|
||||
select count(1) from tb_selection_dormitory
|
||||
<include refid="SelectionDormitoryFindCriteria"/>
|
||||
</select>
|
||||
|
||||
<select id="detail" resultMap="SelectionDormitory">
|
||||
select * from tb_selection_dormitory where id = #{id}
|
||||
</select>
|
||||
|
||||
<delete id="delete">
|
||||
delete from tb_selection_dormitory where id = #{id}
|
||||
</delete>
|
||||
<update id="update">
|
||||
update tb_selection_dormitory set
|
||||
dormitory_id=#{dormitoryId},
|
||||
clazz_id=#{clazzId}
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="updateSelective">
|
||||
update tb_selection_dormitory set
|
||||
<if test="dormitoryId != null">dormitory_id = #{dormitoryId}</if>,
|
||||
<if test="clazzId != null">clazz_id = #{clazzId}</if>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<sql id="SelectionDormitoryFindCriteria">
|
||||
<where>
|
||||
<if test="id != null">and id = #{id}</if>
|
||||
<if test="dormitoryId != null">and dormitory_id = #{dormitoryId}</if>
|
||||
<if test="clazzId != null">and clazz_id = #{clazzId}</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<delete id="deleteByClazzId">
|
||||
delete from tb_selection_dormitory where clazz_id = #{clazzId}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,65 @@
|
||||
<?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.yanzhen.mapper.SelectionJoinerMapper">
|
||||
|
||||
<resultMap type="com.yanzhen.entity.SelectionJoiner" id="SelectionJoiner">
|
||||
<id column="id" property="id"/>
|
||||
<result column="selection_id" property="selectionId"/>
|
||||
<result column="clazz_id" property="clazzId"/>
|
||||
</resultMap>
|
||||
|
||||
<insert id="create" keyProperty="id" useGeneratedKeys="true" parameterType="com.yanzhen.entity.SelectionJoiner">
|
||||
insert into tb_selection_joiner(
|
||||
selection_id,
|
||||
clazz_id
|
||||
)values(
|
||||
#{selectionId},
|
||||
#{clazzId}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<select id="query" resultMap="SelectionJoiner">
|
||||
select * from tb_selection_joiner
|
||||
<include refid="SelectionJoinerFindCriteria"/>
|
||||
</select>
|
||||
|
||||
<select id="count" resultType="int">
|
||||
select count(1) from tb_selection_joiner
|
||||
<include refid="SelectionJoinerFindCriteria"/>
|
||||
</select>
|
||||
|
||||
<select id="detail" resultMap="SelectionJoiner">
|
||||
select * from tb_selection_joiner where id = #{id}
|
||||
</select>
|
||||
|
||||
<delete id="delete">
|
||||
delete from tb_selection_joiner where id = #{id}
|
||||
</delete>
|
||||
<update id="update">
|
||||
update tb_selection_joiner set
|
||||
selection_id=#{selectionId},
|
||||
clazz_id=#{clazzId}
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="updateSelective">
|
||||
update tb_selection_joiner set
|
||||
<if test="selectionId != null">selection_id = #{selectionId}</if>,
|
||||
<if test="clazzId != null">clazz_id = #{clazzId}</if>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<sql id="SelectionJoinerFindCriteria">
|
||||
<where>
|
||||
<if test="id != null">and id = #{id}</if>
|
||||
<if test="selectionId != null">and selection_id = #{selectionId}</if>
|
||||
<if test="clazzId != null">and clazz_id = #{clazzId}</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<delete id="deleteBySelectionId">
|
||||
delete from tb_selection_joiner where selection_id = #{selectionId}
|
||||
</delete>
|
||||
|
||||
|
||||
</mapper>
|
@ -0,0 +1,75 @@
|
||||
<?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.yanzhen.mapper.SelectionMapper">
|
||||
|
||||
<resultMap type="com.yanzhen.entity.Selection" id="Selection">
|
||||
<id column="id" property="id"/>
|
||||
<result column="name" property="name"/>
|
||||
<result column="start_time" property="startTime"/>
|
||||
<result column="end_time" property="endTime"/>
|
||||
<result column="remark" property="remark"/>
|
||||
</resultMap>
|
||||
|
||||
<insert id="create" keyProperty="id" useGeneratedKeys="true" parameterType="com.yanzhen.entity.Selection">
|
||||
insert into tb_selection(
|
||||
name,
|
||||
start_time,
|
||||
end_time,
|
||||
remark
|
||||
)values(
|
||||
#{name},
|
||||
#{startTime},
|
||||
#{endTime},
|
||||
#{remark}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<select id="query" resultMap="Selection">
|
||||
select * from tb_selection
|
||||
<include refid="SelectionFindCriteria"/>
|
||||
</select>
|
||||
|
||||
<select id="count" resultType="int">
|
||||
select count(1) from tb_selection
|
||||
<include refid="SelectionFindCriteria"/>
|
||||
</select>
|
||||
|
||||
<select id="detail" resultMap="Selection">
|
||||
select * from tb_selection where id = #{id}
|
||||
</select>
|
||||
|
||||
<delete id="delete">
|
||||
delete from tb_selection where id = #{id}
|
||||
</delete>
|
||||
<update id="update">
|
||||
update tb_selection set
|
||||
name=#{name},
|
||||
start_time=#{startTime},
|
||||
end_time=#{endTime},
|
||||
remark=#{remark}
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="updateSelective">
|
||||
update tb_selection set
|
||||
<if test="name != null and name != ''"> name = #{name}</if>,
|
||||
<if test="startTime != null and startTime != ''"> start_time = #{startTime}</if>,
|
||||
<if test="endTime != null and endTime != ''"> end_time = #{endTime}</if>,
|
||||
<if test="remark != null and remark != ''"> remark = #{remark}</if>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<sql id="SelectionFindCriteria">
|
||||
<where>
|
||||
<if test="id != null">and id = #{id}</if>
|
||||
<if test="name != null and name != ''">and name = #{name}</if>
|
||||
<if test="remark != null and remark != ''">and remark = #{remark}</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<select id="queryByClazzId" resultMap="Selection">
|
||||
select tb_selection.* from tb_selection,tb_selection_joiner where tb_selection.id = tb_selection_joiner.selection_id
|
||||
and clazz_id = #{clazzId} order by start_time desc limit 1
|
||||
</select>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,66 @@
|
||||
<?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.yanzhen.mapper.StoreyMapper">
|
||||
|
||||
<resultMap type="com.yanzhen.entity.Storey" id="Storey">
|
||||
<id column="id" property="id"/>
|
||||
<result column="name" property="name"/>
|
||||
<result column="building_id" property="buildingId"/>
|
||||
<result column="remark" property="remark"/>
|
||||
</resultMap>
|
||||
|
||||
<insert id="create" keyProperty="id" useGeneratedKeys="true" parameterType="com.yanzhen.entity.Storey">
|
||||
insert into tb_storey(
|
||||
name,
|
||||
building_id,
|
||||
remark
|
||||
)values(
|
||||
#{name},
|
||||
#{buildingId},
|
||||
#{remark}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<select id="query" resultMap="Storey">
|
||||
select * from tb_storey
|
||||
<include refid="StoreyFindCriteria"/>
|
||||
</select>
|
||||
|
||||
<select id="count" resultType="int">
|
||||
select count(1) from tb_storey
|
||||
<include refid="StoreyFindCriteria"/>
|
||||
</select>
|
||||
|
||||
<select id="detail" resultMap="Storey">
|
||||
select * from tb_storey where id = #{id}
|
||||
</select>
|
||||
|
||||
<delete id="delete">
|
||||
delete from tb_storey where id = #{id}
|
||||
</delete>
|
||||
<update id="update">
|
||||
update tb_storey set
|
||||
name=#{name},
|
||||
building_id=#{buildingId},
|
||||
remark=#{remark}
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="updateSelective">
|
||||
update tb_storey set
|
||||
<if test="name != null and name != ''"> name = #{name}</if>,
|
||||
<if test="buildingId != null">building_id = #{buildingId}</if>,
|
||||
<if test="remark != null and remark != ''"> remark = #{remark}</if>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<sql id="StoreyFindCriteria">
|
||||
<where>
|
||||
<if test="id != null">and id = #{id}</if>
|
||||
<if test="name != null and name != ''">and name = #{name}</if>
|
||||
<if test="buildingId != null">and building_id = #{buildingId}</if>
|
||||
<if test="remark != null and remark != ''">and remark = #{remark}</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,106 @@
|
||||
<?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.yanzhen.mapper.StudentMapper">
|
||||
|
||||
<resultMap type="com.yanzhen.entity.Student" id="Student">
|
||||
<id column="id" property="id"/>
|
||||
<result column="stu_no" property="stuNo"/>
|
||||
<result column="name" property="name"/>
|
||||
<result column="idcard" property="idcard"/>
|
||||
<result column="grade_id" property="gradeId"/>
|
||||
<result column="sex" property="sex"/>
|
||||
<result column="phone" property="phone"/>
|
||||
<result column="password" property="password"/>
|
||||
<result column="clazz_id" property="clazzId"/>
|
||||
</resultMap>
|
||||
|
||||
<insert id="create" keyProperty="id" useGeneratedKeys="true" parameterType="com.yanzhen.entity.Student">
|
||||
insert into tb_student(
|
||||
stu_no,
|
||||
name,
|
||||
idcard,
|
||||
grade_id,
|
||||
sex,
|
||||
phone,
|
||||
password,
|
||||
clazz_id
|
||||
)values(
|
||||
#{stuNo},
|
||||
#{name},
|
||||
#{idcard},
|
||||
#{gradeId},
|
||||
#{sex},
|
||||
#{phone},
|
||||
'123456',
|
||||
#{clazzId}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<select id="query" resultMap="Student">
|
||||
select * from tb_student
|
||||
<include refid="StudentFindCriteria"/>
|
||||
</select>
|
||||
|
||||
<select id="count" resultType="int">
|
||||
select count(1) from tb_student
|
||||
<include refid="StudentFindCriteria"/>
|
||||
</select>
|
||||
|
||||
<select id="detail" resultMap="Student">
|
||||
select * from tb_student where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="detailByName" resultMap="Student">
|
||||
select * from tb_student where name = #{name}
|
||||
</select>
|
||||
|
||||
<delete id="delete">
|
||||
delete from tb_student where id = #{id}
|
||||
</delete>
|
||||
<update id="update">
|
||||
update tb_student set
|
||||
stu_no=#{stuNo},
|
||||
name=#{name},
|
||||
idcard=#{idcard},
|
||||
grade_id=#{gradeId},
|
||||
sex=#{sex},
|
||||
phone=#{phone},
|
||||
password=#{password},
|
||||
clazz_id=#{clazzId}
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="updateSelective">
|
||||
update tb_student
|
||||
<set>
|
||||
<if test="stuNo != null and stuNo != ''"> stu_no = #{stuNo},</if>
|
||||
<if test="name != null and name != ''"> name = #{name},</if>
|
||||
<if test="idcard != null and idcard != ''"> idcard = #{idcard},</if>
|
||||
<if test="gradeId != null">grade_id = #{gradeId},</if>
|
||||
<if test="sex != null">sex = #{sex},</if>
|
||||
<if test="phone != null and phone != ''"> phone = #{phone},</if>
|
||||
<if test="password != null and password != ''"> password = #{password},</if>
|
||||
<if test="clazzId != null">clazz_id = #{clazzId},</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<sql id="StudentFindCriteria">
|
||||
<where>
|
||||
<if test="id != null">and id = #{id}</if>
|
||||
<if test="stuNo != null and stuNo != ''">and stu_no = #{stuNo}</if>
|
||||
<if test="name != null and name != ''">and name like concat('%',#{name},'%') </if>
|
||||
<if test="idcard != null and idcard != ''">and idcard = #{idcard}</if>
|
||||
<if test="gradeId != null">and grade_id = #{gradeId}</if>
|
||||
<if test="sex != null">and sex = #{sex}</if>
|
||||
<if test="phone != null and phone != ''">and phone = #{phone}</if>
|
||||
<if test="password != null and password != ''">and password = #{password}</if>
|
||||
<if test="clazzId != null">and clazz_id = #{clazzId}</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<select id="login" resultMap="Student">
|
||||
select * from tb_student where stu_no = #{userName} and password = #{password}
|
||||
</select>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,90 @@
|
||||
<?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.yanzhen.mapper.UserMapper">
|
||||
|
||||
<resultMap type="com.yanzhen.entity.User" id="User">
|
||||
<id column="id" property="id"/>
|
||||
<result column="user_name" property="userName"/>
|
||||
<result column="password" property="password"/>
|
||||
<result column="name" property="name"/>
|
||||
<result column="phone" property="phone"/>
|
||||
<result column="type" property="type"/>
|
||||
<result column="remark" property="remark"/>
|
||||
</resultMap>
|
||||
|
||||
<insert id="create" keyProperty="id" useGeneratedKeys="true" parameterType="com.yanzhen.entity.User">
|
||||
insert into tb_user(
|
||||
user_name,
|
||||
password,
|
||||
name,
|
||||
phone,
|
||||
type,
|
||||
remark
|
||||
)values(
|
||||
#{userName},
|
||||
#{password},
|
||||
#{name},
|
||||
#{phone},
|
||||
#{type},
|
||||
#{remark}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<select id="query" resultMap="User">
|
||||
select * from tb_user
|
||||
<include refid="UserFindCriteria"/>
|
||||
</select>
|
||||
|
||||
<select id="count" resultType="int">
|
||||
select count(1) from tb_user
|
||||
<include refid="UserFindCriteria"/>
|
||||
</select>
|
||||
|
||||
<select id="detail" resultMap="User">
|
||||
select * from tb_user where id = #{id}
|
||||
</select>
|
||||
|
||||
<delete id="delete">
|
||||
delete from tb_user where id = #{id}
|
||||
</delete>
|
||||
<update id="update">
|
||||
update tb_user set
|
||||
user_name=#{userName},
|
||||
password=#{password},
|
||||
name=#{name},
|
||||
phone=#{phone},
|
||||
type=#{type},
|
||||
remark=#{remark}
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="updateSelective">
|
||||
update tb_user
|
||||
<set>
|
||||
<if test="userName != null and userName != ''"> user_name = #{userName},</if>
|
||||
<if test="password != null and password != ''"> password = #{password},</if>
|
||||
<if test="name != null and name != ''"> name = #{name},</if>
|
||||
<if test="phone != null and phone != ''"> phone = #{phone},</if>
|
||||
<if test="type != null">type = #{type},</if>
|
||||
<if test="remark != null and remark != ''"> remark = #{remark},</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<sql id="UserFindCriteria">
|
||||
<where>
|
||||
<if test="id != null">and id = #{id}</if>
|
||||
<if test="userName != null and userName != ''">and user_name like concat('%',#{userName},'%') </if>
|
||||
<if test="password != null and password != ''">and password = #{password}</if>
|
||||
<if test="name != null and name != ''">and name like concat('%',#{name},'%')</if>
|
||||
<if test="phone != null and phone != ''">and phone = #{phone}</if>
|
||||
<if test="type != null">and type = #{type}</if>
|
||||
<if test="remark != null and remark != ''">and remark = #{remark}</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<select id="login" resultMap="User">
|
||||
select * from tb_user where user_name = #{userName} and password=#{password}
|
||||
</select>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,24 @@
|
||||
package com.yanzhen.mapper;
|
||||
|
||||
import java.util.List; // 导入Java标准库中的List类
|
||||
import java.util.Map; // 导入Java标准库中的Map类
|
||||
|
||||
import com.yanzhen.entity.Visit; // 导入自定义的Visit实体类
|
||||
// 定义一个VisitMapper公共接口
|
||||
public interface VisitMapper {
|
||||
// 创建访问记录
|
||||
public int create(Visit visit);
|
||||
// 定义一个删除访问记录的方法
|
||||
public int delete(Integer id);
|
||||
// 定义一个更新访问记录的方法
|
||||
public int update(Visit visit);
|
||||
// 定义一个选择性更新访问记录的方法
|
||||
public int updateSelective(Visit visit);
|
||||
// 定义一个查询访问记录的方法
|
||||
public List<Visit> query(Visit visit);
|
||||
// 定义一个获取访问记录详情的方法
|
||||
public Visit detail(Integer id);
|
||||
// 定义一个统计访问记录数量的方法
|
||||
public int count(Visit visit);
|
||||
|
||||
}
|
@ -0,0 +1,96 @@
|
||||
<?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.yanzhen.mapper.VisitMapper">
|
||||
|
||||
<resultMap type="com.yanzhen.entity.Visit" id="Visit">
|
||||
<id column="id" property="id"/>
|
||||
<result column="visitor" property="visitor"/>
|
||||
<result column="phone" property="phone"/>
|
||||
<result column="sex" property="sex"/>
|
||||
<result column="idcard" property="idcard"/>
|
||||
<result column="student_id" property="studentId"/>
|
||||
<result column="visit_time" property="visitTime"/>
|
||||
<result column="leave_time" property="leaveTime"/>
|
||||
<result column="remark" property="remark"/>
|
||||
</resultMap>
|
||||
|
||||
<insert id="create" keyProperty="id" useGeneratedKeys="true" parameterType="com.yanzhen.entity.Visit">
|
||||
insert into tb_visit(
|
||||
visitor,
|
||||
phone,
|
||||
sex,
|
||||
idcard,
|
||||
student_id,
|
||||
visit_time,
|
||||
leave_time,
|
||||
remark
|
||||
)values(
|
||||
#{visitor},
|
||||
#{phone},
|
||||
#{sex},
|
||||
#{idcard},
|
||||
#{studentId},
|
||||
#{visitTime},
|
||||
#{leaveTime},
|
||||
#{remark}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<select id="query" resultMap="Visit">
|
||||
select * from tb_visit
|
||||
<include refid="VisitFindCriteria"/>
|
||||
</select>
|
||||
|
||||
<select id="count" resultType="int">
|
||||
select count(1) from tb_visit
|
||||
<include refid="VisitFindCriteria"/>
|
||||
</select>
|
||||
|
||||
<select id="detail" resultMap="Visit">
|
||||
select * from tb_visit where id = #{id}
|
||||
</select>
|
||||
|
||||
<delete id="delete">
|
||||
delete from tb_visit where id = #{id}
|
||||
</delete>
|
||||
<update id="update">
|
||||
update tb_visit set
|
||||
visitor=#{visitor},
|
||||
phone=#{phone},
|
||||
sex=#{sex},
|
||||
idcard=#{idcard},
|
||||
student_id=#{studentId},
|
||||
visit_time=#{visitTime},
|
||||
leave_time=#{leaveTime},
|
||||
remark=#{remark}
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="updateSelective">
|
||||
update tb_visit
|
||||
<set>
|
||||
<if test="visitor != null and visitor != ''"> visitor = #{visitor},</if>
|
||||
<if test="phone != null and phone != ''"> phone = #{phone},</if>
|
||||
<if test="sex != null">sex = #{sex},</if>
|
||||
<if test="idcard != null and idcard != ''"> idcard = #{idcard},</if>
|
||||
<if test="studentId != null">student_id = #{studentId},</if>
|
||||
<if test="visitTime != null"> visit_time = #{visitTime},</if>
|
||||
<if test="leaveTime != null"> leave_time = #{leaveTime},</if>
|
||||
<if test="remark != null and remark != ''"> remark = #{remark},</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<sql id="VisitFindCriteria">
|
||||
<where>
|
||||
<if test="id != null">and id = #{id}</if>
|
||||
<if test="visitor != null and visitor != ''">and visitor = #{visitor}</if>
|
||||
<if test="phone != null and phone != ''">and phone = #{phone}</if>
|
||||
<if test="sex != null">and sex = #{sex}</if>
|
||||
<if test="idcard != null and idcard != ''">and idcard = #{idcard}</if>
|
||||
<if test="studentId != null">and student_id = #{studentId}</if>
|
||||
<if test="remark != null and remark != ''">and remark = #{remark}</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
</mapper>
|
Loading…
Reference in new issue