Commit 25db61b2 authored by 赵啸非's avatar 赵啸非

添加海康门禁设备管理

parent c5a15917
......@@ -139,6 +139,8 @@ const router = new Router({
...restBuilder("staff/perform/summary", "staff/perform/summary"), //员工绩效统计汇总
...restBuilder("door", "door"), //门禁设备管理
// 360评估
...restBuilder("homeCharts/record", "homeCharts/record"),
//以下为基础路由配置
......
<template>
<!-- 弹出框表单 -->
<el-drawer
:title="title"
:visible.sync="open"
:direction="direction"
:destroy-on-close="true"
size="50%">
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row>
<Field label="设备名称" prop="deviceName" v-model="form.deviceName" placeholder="请输入设备名称"/>
<Field label="设备编码" prop="deviceCode" v-model="form.deviceCode" placeholder="请输入设备编码"/>
<Field label="Ip地址" prop="ip" v-model="form.ip" placeholder="请输入Ip地址"/>
<Field label="用户名" prop="username" v-model="form.username" placeholder="请输入用户名"/>
<Field label="密码" prop="password" v-model="form.password" placeholder="请输入密码"/>
</el-row>
<form-buttons @submit='submitForm' v-if="pageInfo.type!='view'" noCancelBtn />
</el-form>
</el-drawer>
</template>
<script>
import form from "@/assets/mixins/formdialog";
export default {
name: "DoorDetail",
mixins: [form],
components: {
},
created() {
this.changePath("door")
},
data() {
return {
// 遮罩层
loading: true,
// 弹出层标题
title: "门禁设备",
// 是否显示弹出层
open: false,
direction:"rtl",
toString:[
],
toDate:[
],
// 表单校验
rules: {
}
};
},
methods: {
/** 编辑 */
edit(row) {
this.reset()
this.query = { id: row.id };
this.urls.currUrl ="door/edit";
this.getData();
this.pageInfo.type="edit"
this.title = "修改门禁设备";
},
/** 新增 */
add(row) {
this.reset()
this.urls.currUrl = "door/add";
this.getData();
this.pageInfo.type="add"
this.title = "新增门禁设备";
},
/** 查看*/
view(row) {
this.reset()
this.query = { id: row.id };
this.urls.currUrl ="door/view";
this.getData();
this.pageInfo.type="view"
this.title = "门禁设备详细";
},
/**取消按钮 */
cancel() {
this.open = false;
},
/**获取数据后弹框 */
afterRender(data) {
this.open = true;
},
afterSubmit(data) {
this.open = false;
this.$emit("ok");
},
// 表单重置
reset() {
this.form = {
deviceName : "",
deviceCode : "",
ip : "",
username : "",
password : "",
};
this.resetForm("form");
},
resetForm(refName) {
if (this.$refs[refName]) {
this.$refs[refName].resetFields();
}
},
},
};
</script>
<template>
<div class="page">
<LayoutTable :data="tableData" :config="tableConfig">
</LayoutTable>
<drawer-show ref="drawerform" @ok="getData" />
</div>
</template>
<script>
/** 表单弹出框模式需引入 */
import drawerShow from "./drawershow";
import table from "@/assets/mixins/table";
export default {
name: "DoorList",
components: {
drawerShow
},
mixins: [table],
created() {
},
methods: {
/** 重写新增方法 */
toAdd(row) {
this.$refs.drawerform.add(row);
},
/** 重写编辑方法 */
toEdit(row) {
this.$refs.drawerform.edit(row);
},
/** 重写查看方法 */
toView(row) {
this.$refs.drawerform.view(row);
},
},
data() {
return {
config: {
isshowTabPane:true,
search: [
{
name: "deviceCode",
type: "text",
label: "设备编码",
fuzzy: true
},
],
columns: [
{type: "selection", width: 60},
{type: "index",label: "序号",width: 50},
{label: "设备名称", prop: "deviceName"},
{label: "设备编码", prop: "deviceCode"},
{label: "Ip地址", prop: "ip"},
{label: "用户名", prop: "username"},
{label: "密码", prop: "password"},
{label: "创建时间", prop: "createTime", formatter: this.formatterDate},
{
label: "操作",
width: 240,
formatter: row => {
return (
<table-buttons noAdd row={row} onEdit={this.toEdit} onView={this.toView} onDel={this.toDel} />
);
}
}
]
}
};
}
};
</script>
\ No newline at end of file
<template>
<layout-view>
<el-descriptions :title="title" :column="column" :size="size" :colon="false" border>
<template slot="title">
<i class="el-icon-tickets"></i>
基本详细信息
</template>
<template slot="extra">
<el-button type="primary" @click="$router.go(-1)" size="small">返回</el-button>
</template>
<el-descriptions-item label="设备名称" label-class-name="labelClass" content-class-name="contentClass">
{{form.deviceName}}
</el-descriptions-item>
<el-descriptions-item label="设备编码" label-class-name="labelClass" content-class-name="contentClass">
{{form.deviceCode}}
</el-descriptions-item>
<el-descriptions-item label="Ip地址" label-class-name="labelClass" content-class-name="contentClass">
{{form.ip}}
</el-descriptions-item>
<el-descriptions-item label="用户名" label-class-name="labelClass" content-class-name="contentClass">
{{form.username}}
</el-descriptions-item>
<el-descriptions-item label="密码" label-class-name="labelClass" content-class-name="contentClass">
{{form.password}}
</el-descriptions-item>
</el-descriptions>
</layout-view>
</template>
<script>
import view from "@/assets/mixins/view";
export default {
mixins: [view],
components: {
},
methods: {
},
data() {
return {
size:"small",
column:2,
toString:[
],
toArrays: [
],
toDate: [
]
}
}
}
</script>
<style lang="less">
.labelClass{
width: 200px;
}
.el-descriptions__body{
margin-left: 5px;
margin-right: 5px;
color: #606266;
background-color: #FFF;
}
.contentClass{
width: 600px;
}
</style>
\ No newline at end of file
package com.mortals.xhx.module.door.dao;
import com.mortals.framework.dao.ICRUDDao;
import com.mortals.xhx.module.door.model.DoorEntity;
import java.util.List;
/**
* 门禁设备Dao
* 门禁设备 DAO接口
*
* @author zxfei
* @date 2023-11-22
*/
public interface DoorDao extends ICRUDDao<DoorEntity,Long>{
}
package com.mortals.xhx.module.door.dao.ibatis;
import org.springframework.stereotype.Repository;
import com.mortals.xhx.module.door.dao.DoorDao;
import com.mortals.xhx.module.door.model.DoorEntity;
import java.util.Date;
import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis;
import java.util.List;
/**
* 门禁设备DaoImpl DAO接口
*
* @author zxfei
* @date 2023-11-22
*/
@Repository("doorDao")
public class DoorDaoImpl extends BaseCRUDDaoMybatis<DoorEntity,Long> implements DoorDao {
}
package com.mortals.xhx.module.door.model;
import java.util.List;
import java.util.ArrayList;
import java.math.BigDecimal;
import cn.hutool.core.date.DateUtil;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.door.model.vo.DoorVo;
import lombok.Data;
/**
* 门禁设备实体对象
*
* @author zxfei
* @date 2023-11-22
*/
@Data
public class DoorEntity extends DoorVo {
private static final long serialVersionUID = 1L;
/**
* 设备名称
*/
private String deviceName;
/**
* 设备编码
*/
private String deviceCode;
/**
* Ip地址
*/
private String ip;
/**
* 用户名
*/
private String username;
/**
* 密码
*/
private String password;
@Override
public int hashCode() {
return this.getId().hashCode();
}
@Override
public boolean equals(Object obj) {
if (obj == null) return false;
if (obj instanceof DoorEntity) {
DoorEntity tmp = (DoorEntity) obj;
if (this.getId() == tmp.getId()) {
return true;
}
}
return false;
}
public void initAttrValue(){
this.deviceName = "";
this.deviceCode = "";
this.ip = "";
this.username = "";
this.password = "";
}
}
\ No newline at end of file
package com.mortals.xhx.module.door.model;
import java.util.List;
import com.mortals.xhx.module.door.model.DoorEntity;
/**
* 门禁设备查询对象
*
* @author zxfei
* @date 2023-11-22
*/
public class DoorQuery extends DoorEntity {
/** 开始 序号,主键,自增长 */
private Long idStart;
/** 结束 序号,主键,自增长 */
private Long idEnd;
/** 增加 序号,主键,自增长 */
private Long idIncrement;
/** 序号,主键,自增长列表 */
private List <Long> idList;
/** 序号,主键,自增长排除列表 */
private List <Long> idNotList;
/** 设备名称 */
private List<String> deviceNameList;
/** 设备名称排除列表 */
private List <String> deviceNameNotList;
/** 设备编码 */
private List<String> deviceCodeList;
/** 设备编码排除列表 */
private List <String> deviceCodeNotList;
/** Ip地址 */
private List<String> ipList;
/** Ip地址排除列表 */
private List <String> ipNotList;
/** 用户名 */
private List<String> usernameList;
/** 用户名排除列表 */
private List <String> usernameNotList;
/** 密码 */
private List<String> passwordList;
/** 密码排除列表 */
private List <String> passwordNotList;
/** 开始 创建时间 */
private String createTimeStart;
/** 结束 创建时间 */
private String createTimeEnd;
/** 开始 创建用户 */
private Long createUserIdStart;
/** 结束 创建用户 */
private Long createUserIdEnd;
/** 增加 创建用户 */
private Long createUserIdIncrement;
/** 创建用户列表 */
private List <Long> createUserIdList;
/** 创建用户排除列表 */
private List <Long> createUserIdNotList;
/** 开始 更新用户 */
private Long updateUserIdStart;
/** 结束 更新用户 */
private Long updateUserIdEnd;
/** 增加 更新用户 */
private Long updateUserIdIncrement;
/** 更新用户列表 */
private List <Long> updateUserIdList;
/** 更新用户排除列表 */
private List <Long> updateUserIdNotList;
/** 开始 修改时间 */
private String updateTimeStart;
/** 结束 修改时间 */
private String updateTimeEnd;
/** OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) */
private List<DoorQuery> orConditionList;
/** AND条件集合,列表项之间是AND,项内容之间是OR,如:(list[0].1 or list[0].2) and (list[1].3 or list[1].4) */
private List<DoorQuery> andConditionList;
public DoorQuery(){}
/**
* 获取 开始 序号,主键,自增长
* @return idStart
*/
public Long getIdStart(){
return this.idStart;
}
/**
* 设置 开始 序号,主键,自增长
* @param idStart
*/
public void setIdStart(Long idStart){
this.idStart = idStart;
}
/**
* 获取 结束 序号,主键,自增长
* @return $idEnd
*/
public Long getIdEnd(){
return this.idEnd;
}
/**
* 设置 结束 序号,主键,自增长
* @param idEnd
*/
public void setIdEnd(Long idEnd){
this.idEnd = idEnd;
}
/**
* 获取 增加 序号,主键,自增长
* @return idIncrement
*/
public Long getIdIncrement(){
return this.idIncrement;
}
/**
* 设置 增加 序号,主键,自增长
* @param idIncrement
*/
public void setIdIncrement(Long idIncrement){
this.idIncrement = idIncrement;
}
/**
* 获取 序号,主键,自增长
* @return idList
*/
public List<Long> getIdList(){
return this.idList;
}
/**
* 设置 序号,主键,自增长
* @param idList
*/
public void setIdList(List<Long> idList){
this.idList = idList;
}
/**
* 获取 序号,主键,自增长
* @return idNotList
*/
public List<Long> getIdNotList(){
return this.idNotList;
}
/**
* 设置 序号,主键,自增长
* @param idNotList
*/
public void setIdNotList(List<Long> idNotList){
this.idNotList = idNotList;
}
/**
* 获取 设备名称
* @return deviceNameList
*/
public List<String> getDeviceNameList(){
return this.deviceNameList;
}
/**
* 设置 设备名称
* @param deviceNameList
*/
public void setDeviceNameList(List<String> deviceNameList){
this.deviceNameList = deviceNameList;
}
/**
* 获取 设备名称
* @return deviceNameNotList
*/
public List<String> getDeviceNameNotList(){
return this.deviceNameNotList;
}
/**
* 设置 设备名称
* @param deviceNameNotList
*/
public void setDeviceNameNotList(List<String> deviceNameNotList){
this.deviceNameNotList = deviceNameNotList;
}
/**
* 获取 设备编码
* @return deviceCodeList
*/
public List<String> getDeviceCodeList(){
return this.deviceCodeList;
}
/**
* 设置 设备编码
* @param deviceCodeList
*/
public void setDeviceCodeList(List<String> deviceCodeList){
this.deviceCodeList = deviceCodeList;
}
/**
* 获取 设备编码
* @return deviceCodeNotList
*/
public List<String> getDeviceCodeNotList(){
return this.deviceCodeNotList;
}
/**
* 设置 设备编码
* @param deviceCodeNotList
*/
public void setDeviceCodeNotList(List<String> deviceCodeNotList){
this.deviceCodeNotList = deviceCodeNotList;
}
/**
* 获取 Ip地址
* @return ipList
*/
public List<String> getIpList(){
return this.ipList;
}
/**
* 设置 Ip地址
* @param ipList
*/
public void setIpList(List<String> ipList){
this.ipList = ipList;
}
/**
* 获取 Ip地址
* @return ipNotList
*/
public List<String> getIpNotList(){
return this.ipNotList;
}
/**
* 设置 Ip地址
* @param ipNotList
*/
public void setIpNotList(List<String> ipNotList){
this.ipNotList = ipNotList;
}
/**
* 获取 用户名
* @return usernameList
*/
public List<String> getUsernameList(){
return this.usernameList;
}
/**
* 设置 用户名
* @param usernameList
*/
public void setUsernameList(List<String> usernameList){
this.usernameList = usernameList;
}
/**
* 获取 用户名
* @return usernameNotList
*/
public List<String> getUsernameNotList(){
return this.usernameNotList;
}
/**
* 设置 用户名
* @param usernameNotList
*/
public void setUsernameNotList(List<String> usernameNotList){
this.usernameNotList = usernameNotList;
}
/**
* 获取 密码
* @return passwordList
*/
public List<String> getPasswordList(){
return this.passwordList;
}
/**
* 设置 密码
* @param passwordList
*/
public void setPasswordList(List<String> passwordList){
this.passwordList = passwordList;
}
/**
* 获取 密码
* @return passwordNotList
*/
public List<String> getPasswordNotList(){
return this.passwordNotList;
}
/**
* 设置 密码
* @param passwordNotList
*/
public void setPasswordNotList(List<String> passwordNotList){
this.passwordNotList = passwordNotList;
}
/**
* 获取 开始 创建时间
* @return createTimeStart
*/
public String getCreateTimeStart(){
return this.createTimeStart;
}
/**
* 设置 开始 创建时间
* @param createTimeStart
*/
public void setCreateTimeStart(String createTimeStart){
this.createTimeStart = createTimeStart;
}
/**
* 获取 结束 创建时间
* @return createTimeEnd
*/
public String getCreateTimeEnd(){
return this.createTimeEnd;
}
/**
* 设置 结束 创建时间
* @param createTimeEnd
*/
public void setCreateTimeEnd(String createTimeEnd){
this.createTimeEnd = createTimeEnd;
}
/**
* 获取 开始 创建用户
* @return createUserIdStart
*/
public Long getCreateUserIdStart(){
return this.createUserIdStart;
}
/**
* 设置 开始 创建用户
* @param createUserIdStart
*/
public void setCreateUserIdStart(Long createUserIdStart){
this.createUserIdStart = createUserIdStart;
}
/**
* 获取 结束 创建用户
* @return $createUserIdEnd
*/
public Long getCreateUserIdEnd(){
return this.createUserIdEnd;
}
/**
* 设置 结束 创建用户
* @param createUserIdEnd
*/
public void setCreateUserIdEnd(Long createUserIdEnd){
this.createUserIdEnd = createUserIdEnd;
}
/**
* 获取 增加 创建用户
* @return createUserIdIncrement
*/
public Long getCreateUserIdIncrement(){
return this.createUserIdIncrement;
}
/**
* 设置 增加 创建用户
* @param createUserIdIncrement
*/
public void setCreateUserIdIncrement(Long createUserIdIncrement){
this.createUserIdIncrement = createUserIdIncrement;
}
/**
* 获取 创建用户
* @return createUserIdList
*/
public List<Long> getCreateUserIdList(){
return this.createUserIdList;
}
/**
* 设置 创建用户
* @param createUserIdList
*/
public void setCreateUserIdList(List<Long> createUserIdList){
this.createUserIdList = createUserIdList;
}
/**
* 获取 创建用户
* @return createUserIdNotList
*/
public List<Long> getCreateUserIdNotList(){
return this.createUserIdNotList;
}
/**
* 设置 创建用户
* @param createUserIdNotList
*/
public void setCreateUserIdNotList(List<Long> createUserIdNotList){
this.createUserIdNotList = createUserIdNotList;
}
/**
* 获取 开始 更新用户
* @return updateUserIdStart
*/
public Long getUpdateUserIdStart(){
return this.updateUserIdStart;
}
/**
* 设置 开始 更新用户
* @param updateUserIdStart
*/
public void setUpdateUserIdStart(Long updateUserIdStart){
this.updateUserIdStart = updateUserIdStart;
}
/**
* 获取 结束 更新用户
* @return $updateUserIdEnd
*/
public Long getUpdateUserIdEnd(){
return this.updateUserIdEnd;
}
/**
* 设置 结束 更新用户
* @param updateUserIdEnd
*/
public void setUpdateUserIdEnd(Long updateUserIdEnd){
this.updateUserIdEnd = updateUserIdEnd;
}
/**
* 获取 增加 更新用户
* @return updateUserIdIncrement
*/
public Long getUpdateUserIdIncrement(){
return this.updateUserIdIncrement;
}
/**
* 设置 增加 更新用户
* @param updateUserIdIncrement
*/
public void setUpdateUserIdIncrement(Long updateUserIdIncrement){
this.updateUserIdIncrement = updateUserIdIncrement;
}
/**
* 获取 更新用户
* @return updateUserIdList
*/
public List<Long> getUpdateUserIdList(){
return this.updateUserIdList;
}
/**
* 设置 更新用户
* @param updateUserIdList
*/
public void setUpdateUserIdList(List<Long> updateUserIdList){
this.updateUserIdList = updateUserIdList;
}
/**
* 获取 更新用户
* @return updateUserIdNotList
*/
public List<Long> getUpdateUserIdNotList(){
return this.updateUserIdNotList;
}
/**
* 设置 更新用户
* @param updateUserIdNotList
*/
public void setUpdateUserIdNotList(List<Long> updateUserIdNotList){
this.updateUserIdNotList = updateUserIdNotList;
}
/**
* 获取 开始 修改时间
* @return updateTimeStart
*/
public String getUpdateTimeStart(){
return this.updateTimeStart;
}
/**
* 设置 开始 修改时间
* @param updateTimeStart
*/
public void setUpdateTimeStart(String updateTimeStart){
this.updateTimeStart = updateTimeStart;
}
/**
* 获取 结束 修改时间
* @return updateTimeEnd
*/
public String getUpdateTimeEnd(){
return this.updateTimeEnd;
}
/**
* 设置 结束 修改时间
* @param updateTimeEnd
*/
public void setUpdateTimeEnd(String updateTimeEnd){
this.updateTimeEnd = updateTimeEnd;
}
/**
* 设置 序号,主键,自增长
* @param id
*/
public DoorQuery id(Long id){
setId(id);
return this;
}
/**
* 设置 开始 序号,主键,自增长
* @param idStart
*/
public DoorQuery idStart(Long idStart){
this.idStart = idStart;
return this;
}
/**
* 设置 结束 序号,主键,自增长
* @param idEnd
*/
public DoorQuery idEnd(Long idEnd){
this.idEnd = idEnd;
return this;
}
/**
* 设置 增加 序号,主键,自增长
* @param idIncrement
*/
public DoorQuery idIncrement(Long idIncrement){
this.idIncrement = idIncrement;
return this;
}
/**
* 设置 序号,主键,自增长
* @param idList
*/
public DoorQuery idList(List<Long> idList){
this.idList = idList;
return this;
}
/**
* 设置 序号,主键,自增长
* @param idNotList
*/
public DoorQuery idNotList(List<Long> idNotList){
this.idNotList = idNotList;
return this;
}
/**
* 设置 设备名称
* @param deviceName
*/
public DoorQuery deviceName(String deviceName){
setDeviceName(deviceName);
return this;
}
/**
* 设置 设备名称
* @param deviceNameList
*/
public DoorQuery deviceNameList(List<String> deviceNameList){
this.deviceNameList = deviceNameList;
return this;
}
/**
* 设置 设备编码
* @param deviceCode
*/
public DoorQuery deviceCode(String deviceCode){
setDeviceCode(deviceCode);
return this;
}
/**
* 设置 设备编码
* @param deviceCodeList
*/
public DoorQuery deviceCodeList(List<String> deviceCodeList){
this.deviceCodeList = deviceCodeList;
return this;
}
/**
* 设置 Ip地址
* @param ip
*/
public DoorQuery ip(String ip){
setIp(ip);
return this;
}
/**
* 设置 Ip地址
* @param ipList
*/
public DoorQuery ipList(List<String> ipList){
this.ipList = ipList;
return this;
}
/**
* 设置 用户名
* @param username
*/
public DoorQuery username(String username){
setUsername(username);
return this;
}
/**
* 设置 用户名
* @param usernameList
*/
public DoorQuery usernameList(List<String> usernameList){
this.usernameList = usernameList;
return this;
}
/**
* 设置 密码
* @param password
*/
public DoorQuery password(String password){
setPassword(password);
return this;
}
/**
* 设置 密码
* @param passwordList
*/
public DoorQuery passwordList(List<String> passwordList){
this.passwordList = passwordList;
return this;
}
/**
* 设置 创建用户
* @param createUserId
*/
public DoorQuery createUserId(Long createUserId){
setCreateUserId(createUserId);
return this;
}
/**
* 设置 开始 创建用户
* @param createUserIdStart
*/
public DoorQuery createUserIdStart(Long createUserIdStart){
this.createUserIdStart = createUserIdStart;
return this;
}
/**
* 设置 结束 创建用户
* @param createUserIdEnd
*/
public DoorQuery createUserIdEnd(Long createUserIdEnd){
this.createUserIdEnd = createUserIdEnd;
return this;
}
/**
* 设置 增加 创建用户
* @param createUserIdIncrement
*/
public DoorQuery createUserIdIncrement(Long createUserIdIncrement){
this.createUserIdIncrement = createUserIdIncrement;
return this;
}
/**
* 设置 创建用户
* @param createUserIdList
*/
public DoorQuery createUserIdList(List<Long> createUserIdList){
this.createUserIdList = createUserIdList;
return this;
}
/**
* 设置 创建用户
* @param createUserIdNotList
*/
public DoorQuery createUserIdNotList(List<Long> createUserIdNotList){
this.createUserIdNotList = createUserIdNotList;
return this;
}
/**
* 设置 更新用户
* @param updateUserId
*/
public DoorQuery updateUserId(Long updateUserId){
setUpdateUserId(updateUserId);
return this;
}
/**
* 设置 开始 更新用户
* @param updateUserIdStart
*/
public DoorQuery updateUserIdStart(Long updateUserIdStart){
this.updateUserIdStart = updateUserIdStart;
return this;
}
/**
* 设置 结束 更新用户
* @param updateUserIdEnd
*/
public DoorQuery updateUserIdEnd(Long updateUserIdEnd){
this.updateUserIdEnd = updateUserIdEnd;
return this;
}
/**
* 设置 增加 更新用户
* @param updateUserIdIncrement
*/
public DoorQuery updateUserIdIncrement(Long updateUserIdIncrement){
this.updateUserIdIncrement = updateUserIdIncrement;
return this;
}
/**
* 设置 更新用户
* @param updateUserIdList
*/
public DoorQuery updateUserIdList(List<Long> updateUserIdList){
this.updateUserIdList = updateUserIdList;
return this;
}
/**
* 设置 更新用户
* @param updateUserIdNotList
*/
public DoorQuery updateUserIdNotList(List<Long> updateUserIdNotList){
this.updateUserIdNotList = updateUserIdNotList;
return this;
}
/**
* 获取 OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4)
* @return orConditionList
*/
public List<DoorQuery> getOrConditionList(){
return this.orConditionList;
}
/**
* 设置 OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4)
* @param orConditionList
*/
public void setOrConditionList(List<DoorQuery> orConditionList){
this.orConditionList = orConditionList;
}
/**
* 获取 AND条件集合,列表项之间是AND,项内容之间是OR,如:(list[0].1 or list[0].2) and (list[1].3 or list[1].4)
* @return andConditionList
*/
public List<DoorQuery> getAndConditionList(){
return this.andConditionList;
}
/**
* 设置 AND条件集合,列表项之间是AND,项内容之间是OR,如:(list[0].1 or list[0].2) and (list[1].3 or list[1].4)
* @param andConditionList
*/
public void setAndConditionList(List<DoorQuery> andConditionList){
this.andConditionList = andConditionList;
}
}
\ No newline at end of file
package com.mortals.xhx.module.door.model.vo;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.door.model.DoorEntity;
import java.util.ArrayList;
import java.util.List;
import lombok.Data;
import com.mortals.framework.annotation.Excel;
import java.math.BigDecimal;
import java.util.Date;
/**
* 门禁设备视图对象
*
* @author zxfei
* @date 2023-11-22
*/
@Data
public class DoorVo extends BaseEntityLong {
/** 序号,主键,自增长列表 */
private List <Long> idList;
}
\ No newline at end of file
package com.mortals.xhx.module.door.service;
import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.door.model.DoorEntity;
import com.mortals.xhx.module.door.dao.DoorDao;
/**
* DoorService
*
* 门禁设备 service接口
*
* @author zxfei
* @date 2023-11-22
*/
public interface DoorService extends ICRUDService<DoorEntity,Long>{
DoorDao getDao();
}
\ No newline at end of file
package com.mortals.xhx.module.door.service.impl;
import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.xhx.module.door.dao.DoorDao;
import com.mortals.xhx.module.door.model.DoorEntity;
import com.mortals.xhx.module.door.service.DoorService;
import lombok.extern.slf4j.Slf4j;
/**
* DoorService
* 门禁设备 service实现
*
* @author zxfei
* @date 2023-11-22
*/
@Service("doorService")
@Slf4j
public class DoorServiceImpl extends AbstractCRUDServiceImpl<DoorDao, DoorEntity, Long> implements DoorService {
}
\ No newline at end of file
package com.mortals.xhx.module.door.web;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.mortals.framework.model.Context;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.module.door.model.DoorEntity;
import com.mortals.xhx.module.door.service.DoorService;
import org.apache.commons.lang3.ArrayUtils;
import com.mortals.framework.util.StringUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject;
import java.util.Arrays;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import static com.mortals.framework.ap.SysConstains.*;
import com.mortals.xhx.common.code.*;
/**
*
* 门禁设备
*
* @author zxfei
* @date 2023-11-22
*/
@RestController
@RequestMapping("door")
public class DoorController extends BaseCRUDJsonBodyMappingController<DoorService,DoorEntity,Long> {
@Autowired
private ParamService paramService;
public DoorController(){
super.setModuleDesc( "门禁设备");
}
@Override
protected void init(Map<String, Object> model, Context context) {
super.init(model, context);
}
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"mybatis-3-mapper.dtd">
<mapper namespace="com.mortals.xhx.module.door.dao.ibatis.DoorDaoImpl">
<!-- 字段和属性映射 -->
<resultMap type="DoorEntity" id="DoorEntity-Map">
<id property="id" column="id" />
<result property="deviceName" column="deviceName" />
<result property="deviceCode" column="deviceCode" />
<result property="ip" column="ip" />
<result property="username" column="username" />
<result property="password" column="password" />
<result property="createTime" column="createTime" />
<result property="createUserId" column="createUserId" />
<result property="updateUserId" column="updateUserId" />
<result property="updateTime" column="updateTime" />
</resultMap>
<!-- 表所有列 -->
<sql id="_columns">
<trim suffixOverrides="," suffix="">
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('id') or colPickMode == 1 and data.containsKey('id')))">
a.id,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('deviceName') or colPickMode == 1 and data.containsKey('deviceName')))">
a.deviceName,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('deviceCode') or colPickMode == 1 and data.containsKey('deviceCode')))">
a.deviceCode,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('ip') or colPickMode == 1 and data.containsKey('ip')))">
a.ip,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('username') or colPickMode == 1 and data.containsKey('username')))">
a.username,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('password') or colPickMode == 1 and data.containsKey('password')))">
a.password,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('createTime') or colPickMode == 1 and data.containsKey('createTime')))">
a.createTime,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('createUserId') or colPickMode == 1 and data.containsKey('createUserId')))">
a.createUserId,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('updateUserId') or colPickMode == 1 and data.containsKey('updateUserId')))">
a.updateUserId,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('updateTime') or colPickMode == 1 and data.containsKey('updateTime')))">
a.updateTime,
</if>
</trim>
</sql>
<!-- 新增 区分主键自增加还是业务插入 -->
<insert id="insert" parameterType="DoorEntity" useGeneratedKeys="true" keyProperty="id">
insert into mortals_xhx_door
(deviceName,deviceCode,ip,username,password,createTime,createUserId,updateUserId,updateTime)
VALUES
(#{deviceName},#{deviceCode},#{ip},#{username},#{password},#{createTime},#{createUserId},#{updateUserId},#{updateTime})
</insert>
<!-- 批量新增 -->
<insert id="insertBatch" parameterType="paramDto">
insert into mortals_xhx_door
(deviceName,deviceCode,ip,username,password,createTime,createUserId,updateUserId,updateTime)
VALUES
<foreach collection="data.dataList" item="item" index="index" separator="," >
(#{item.deviceName},#{item.deviceCode},#{item.ip},#{item.username},#{item.password},#{item.createTime},#{item.createUserId},#{item.updateUserId},#{item.updateTime})
</foreach>
</insert>
<!-- 根据ParamDto更新 -->
<update id="update" parameterType="paramDto">
update mortals_xhx_door as a
set
<trim suffixOverrides="," suffix="">
<if test="(colPickMode==0 and data.containsKey('deviceName')) or (colPickMode==1 and !data.containsKey('deviceName'))">
a.deviceName=#{data.deviceName},
</if>
<if test="(colPickMode==0 and data.containsKey('deviceCode')) or (colPickMode==1 and !data.containsKey('deviceCode'))">
a.deviceCode=#{data.deviceCode},
</if>
<if test="(colPickMode==0 and data.containsKey('ip')) or (colPickMode==1 and !data.containsKey('ip'))">
a.ip=#{data.ip},
</if>
<if test="(colPickMode==0 and data.containsKey('username')) or (colPickMode==1 and !data.containsKey('username'))">
a.username=#{data.username},
</if>
<if test="(colPickMode==0 and data.containsKey('password')) or (colPickMode==1 and !data.containsKey('password'))">
a.password=#{data.password},
</if>
<if test="(colPickMode==0 and data.containsKey('createTime')) or (colPickMode==1 and !data.containsKey('createTime'))">
a.createTime=#{data.createTime},
</if>
<if test="(colPickMode==0 and data.containsKey('createUserId')) or (colPickMode==1 and !data.containsKey('createUserId'))">
a.createUserId=#{data.createUserId},
</if>
<if test="(colPickMode==0 and data.containsKey('createUserIdIncrement')) or (colPickMode==1 and !data.containsKey('createUserIdIncrement'))">
a.createUserId=ifnull(a.createUserId,0) + #{data.createUserIdIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('updateUserId')) or (colPickMode==1 and !data.containsKey('updateUserId'))">
a.updateUserId=#{data.updateUserId},
</if>
<if test="(colPickMode==0 and data.containsKey('updateUserIdIncrement')) or (colPickMode==1 and !data.containsKey('updateUserIdIncrement'))">
a.updateUserId=ifnull(a.updateUserId,0) + #{data.updateUserIdIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('updateTime')) or (colPickMode==1 and !data.containsKey('updateTime'))">
a.updateTime=#{data.updateTime},
</if>
</trim>
<trim suffixOverrides="where" suffix="">
where
<trim prefixOverrides="and" prefix="">
<include refid="_condition_"/>
</trim>
</trim>
</update>
<!-- 批量更新 -->
<update id="updateBatch" parameterType="paramDto">
update mortals_xhx_door as a
<trim prefix="set" suffixOverrides=",">
<trim prefix="deviceName=(case" suffix="ELSE deviceName end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('deviceName')) or (colPickMode==1 and !item.containsKey('deviceName'))">
when a.id=#{item.id} then #{item.deviceName}
</if>
</foreach>
</trim>
<trim prefix="deviceCode=(case" suffix="ELSE deviceCode end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('deviceCode')) or (colPickMode==1 and !item.containsKey('deviceCode'))">
when a.id=#{item.id} then #{item.deviceCode}
</if>
</foreach>
</trim>
<trim prefix="ip=(case" suffix="ELSE ip end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('ip')) or (colPickMode==1 and !item.containsKey('ip'))">
when a.id=#{item.id} then #{item.ip}
</if>
</foreach>
</trim>
<trim prefix="username=(case" suffix="ELSE username end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('username')) or (colPickMode==1 and !item.containsKey('username'))">
when a.id=#{item.id} then #{item.username}
</if>
</foreach>
</trim>
<trim prefix="password=(case" suffix="ELSE password end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('password')) or (colPickMode==1 and !item.containsKey('password'))">
when a.id=#{item.id} then #{item.password}
</if>
</foreach>
</trim>
<trim prefix="createTime=(case" suffix="ELSE createTime end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('createTime')) or (colPickMode==1 and !item.containsKey('createTime'))">
when a.id=#{item.id} then #{item.createTime}
</if>
</foreach>
</trim>
<trim prefix="createUserId=(case" suffix="ELSE createUserId end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('createUserId')) or (colPickMode==1 and !item.containsKey('createUserId'))">
when a.id=#{item.id} then #{item.createUserId}
</when>
<when test="(colPickMode==0 and item.containsKey('createUserIdIncrement')) or (colPickMode==1 and !item.containsKey('createUserIdIncrement'))">
when a.id=#{item.id} then ifnull(a.createUserId,0) + #{item.createUserIdIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="updateUserId=(case" suffix="ELSE updateUserId end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('updateUserId')) or (colPickMode==1 and !item.containsKey('updateUserId'))">
when a.id=#{item.id} then #{item.updateUserId}
</when>
<when test="(colPickMode==0 and item.containsKey('updateUserIdIncrement')) or (colPickMode==1 and !item.containsKey('updateUserIdIncrement'))">
when a.id=#{item.id} then ifnull(a.updateUserId,0) + #{item.updateUserIdIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="updateTime=(case" suffix="ELSE updateTime end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('updateTime')) or (colPickMode==1 and !item.containsKey('updateTime'))">
when a.id=#{item.id} then #{item.updateTime}
</if>
</foreach>
</trim>
</trim>
where id in
<foreach collection="data.dataList" item="item" index="index" open="(" separator="," close=")">
#{item.id}
</foreach>
</update>
<!-- 根据主健查询 -->
<select id="getByKey" parameterType="paramDto" resultMap="DoorEntity-Map">
select <include refid="_columns"/>
from mortals_xhx_door as a
where a.id=#{condition.id}
</select>
<!-- 根据主健删除 -->
<delete id="deleteByKey" parameterType="paramDto">
delete a.* from mortals_xhx_door as a where a.id=#{condition.id}
</delete>
<!-- 根据主健删除一批,针对单一主健有效 -->
<delete id="deleteByKeys">
delete from mortals_xhx_door where id in
<foreach collection="array" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
</delete>
<!-- 根据主健列表删除一批,针对单一主健有效 -->
<delete id="deleteByKeyList">
delete from mortals_xhx_door where id in
<foreach collection="list" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
</delete>
<!-- 根据对象列表删除一批,针对单一主健有效 -->
<delete id="deleteByEntityList">
delete from mortals_xhx_door where id in
<foreach collection="list" item="item" index="index" open="(" separator="," close=")">
#{item.id}
</foreach>
</delete>
<!-- 根据paramDto删除一批 -->
<delete id="deleteByMap" parameterType="paramDto">
delete a.* from mortals_xhx_door as a
<trim suffixOverrides="where" suffix="">
where
<trim prefixOverrides="and" prefix="">
<include refid="_condition_"/>
</trim>
</trim>
</delete>
<!-- 获取列表 -->
<select id="getList" parameterType="paramDto" resultMap="DoorEntity-Map">
select <include refid="_columns"/>
from mortals_xhx_door as a
<trim suffixOverrides="where" suffix="">
where
<trim prefixOverrides="and" prefix="">
<include refid="_condition_"/>
</trim>
</trim>
<include refid="_orderCols_"/>
</select>
<!-- 获取 -->
<select id="getListCount" parameterType="paramDto" resultType="int">
select count(1)
from mortals_xhx_door as a
<trim suffixOverrides="where" suffix="">
where
<trim prefixOverrides="and" prefix="">
<include refid="_condition_"/>
</trim>
</trim>
</select>
<!-- 条件映射 -->
<sql id="_condition_">
<if test="condition != null and !condition.isEmpty()">
<!-- 条件映射-普通条件 -->
<include refid="_condition_param_">
<property name="_conditionParam_" value="condition"/>
<property name="_conditionType_" value="and"/>
</include>
<!-- 条件映射-集合之间使用AND,集合中元素使用OR-(list[0].1 or list[0].2) and (list[1].3 or list[1].4) -->
<if test="condition.containsKey('andConditionList') and !condition.andConditionList.isEmpty()">
and
<foreach collection="condition.andConditionList" open="(" close=")" index="index" item="andCondition" separator=" and ">
<trim prefixOverrides="or" prefix="(" suffix=")">
<include refid="_condition_param_">
<property name="_conditionParam_" value="andCondition"/>
<property name="_conditionType_" value="or"/>
</include>
</trim>
</foreach>
</if>
<!-- 条件映射-集合之间使用OR,集合中元素使用AND-(list[0].1 and list[0].2) or (list[1].3 and list[1].4) -->
<if test="condition.containsKey('orConditionList') and !condition.orConditionList.isEmpty()">
and
<foreach collection="condition.orConditionList" open="(" close=")" index="index" item="orCondition" separator=" or ">
<trim prefixOverrides="and" prefix="(" suffix=")">
<include refid="_condition_param_">
<property name="_conditionParam_" value="orCondition"/>
<property name="_conditionType_" value="and"/>
</include>
</trim>
</foreach>
</if>
</if>
</sql>
<!-- 条件映射-代参数 -->
<sql id="_condition_param_">
<bind name="conditionParamRef" value="${_conditionParam_}"/>
<if test="conditionParamRef.containsKey('id')">
<if test="conditionParamRef.id != null">
${_conditionType_} a.id=#{${_conditionParam_}.id}
</if>
</if>
<if test="conditionParamRef.containsKey('id')">
<if test="conditionParamRef.id != null ">
${_conditionType_} a.id = #{${_conditionParam_}.id}
</if>
<if test="conditionParamRef.id == null">
${_conditionType_} a.id is null
</if>
</if>
<if test="conditionParamRef.containsKey('idList') and conditionParamRef.idList.size() > 0">
${_conditionType_} a.id in
<foreach collection="conditionParamRef.idList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('idNotList') and conditionParamRef.idNotList.size() > 0">
${_conditionType_} a.id not in
<foreach collection="conditionParamRef.idNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('idStart') and conditionParamRef.idStart != null">
${_conditionType_} a.id <![CDATA[ >= ]]> #{${_conditionParam_}.idStart}
</if>
<if test="conditionParamRef.containsKey('idEnd') and conditionParamRef.idEnd != null">
${_conditionType_} a.id <![CDATA[ <= ]]> #{${_conditionParam_}.idEnd}
</if>
<if test="conditionParamRef.containsKey('deviceName')">
<if test="conditionParamRef.deviceName != null and conditionParamRef.deviceName != ''">
${_conditionType_} a.deviceName like #{${_conditionParam_}.deviceName}
</if>
<if test="conditionParamRef.deviceName == null">
${_conditionType_} a.deviceName is null
</if>
</if>
<if test="conditionParamRef.containsKey('deviceNameList') and conditionParamRef.deviceNameList.size() > 0">
${_conditionType_} a.deviceName in
<foreach collection="conditionParamRef.deviceNameList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('deviceNameNotList') and conditionParamRef.deviceNameNotList.size() > 0">
${_conditionType_} a.deviceName not in
<foreach collection="conditionParamRef.deviceNameNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('deviceCode')">
<if test="conditionParamRef.deviceCode != null and conditionParamRef.deviceCode != ''">
${_conditionType_} a.deviceCode like #{${_conditionParam_}.deviceCode}
</if>
<if test="conditionParamRef.deviceCode == null">
${_conditionType_} a.deviceCode is null
</if>
</if>
<if test="conditionParamRef.containsKey('deviceCodeList') and conditionParamRef.deviceCodeList.size() > 0">
${_conditionType_} a.deviceCode in
<foreach collection="conditionParamRef.deviceCodeList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('deviceCodeNotList') and conditionParamRef.deviceCodeNotList.size() > 0">
${_conditionType_} a.deviceCode not in
<foreach collection="conditionParamRef.deviceCodeNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('ip')">
<if test="conditionParamRef.ip != null and conditionParamRef.ip != ''">
${_conditionType_} a.ip like #{${_conditionParam_}.ip}
</if>
<if test="conditionParamRef.ip == null">
${_conditionType_} a.ip is null
</if>
</if>
<if test="conditionParamRef.containsKey('ipList') and conditionParamRef.ipList.size() > 0">
${_conditionType_} a.ip in
<foreach collection="conditionParamRef.ipList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('ipNotList') and conditionParamRef.ipNotList.size() > 0">
${_conditionType_} a.ip not in
<foreach collection="conditionParamRef.ipNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('username')">
<if test="conditionParamRef.username != null and conditionParamRef.username != ''">
${_conditionType_} a.username like #{${_conditionParam_}.username}
</if>
<if test="conditionParamRef.username == null">
${_conditionType_} a.username is null
</if>
</if>
<if test="conditionParamRef.containsKey('usernameList') and conditionParamRef.usernameList.size() > 0">
${_conditionType_} a.username in
<foreach collection="conditionParamRef.usernameList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('usernameNotList') and conditionParamRef.usernameNotList.size() > 0">
${_conditionType_} a.username not in
<foreach collection="conditionParamRef.usernameNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('password')">
<if test="conditionParamRef.password != null and conditionParamRef.password != ''">
${_conditionType_} a.password like #{${_conditionParam_}.password}
</if>
<if test="conditionParamRef.password == null">
${_conditionType_} a.password is null
</if>
</if>
<if test="conditionParamRef.containsKey('passwordList') and conditionParamRef.passwordList.size() > 0">
${_conditionType_} a.password in
<foreach collection="conditionParamRef.passwordList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('passwordNotList') and conditionParamRef.passwordNotList.size() > 0">
${_conditionType_} a.password not in
<foreach collection="conditionParamRef.passwordNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('createTime')">
<if test="conditionParamRef.createTime != null ">
${_conditionType_} a.createTime = #{${_conditionParam_}.createTime}
</if>
<if test="conditionParamRef.createTime == null">
${_conditionType_} a.createTime is null
</if>
</if>
<if test="conditionParamRef.containsKey('createTimeStart') and conditionParamRef.createTimeStart != null and conditionParamRef.createTimeStart!=''">
${_conditionType_} a.createTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.createTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s')
</if>
<if test="conditionParamRef.containsKey('createTimeEnd') and conditionParamRef.createTimeEnd != null and conditionParamRef.createTimeEnd!=''">
${_conditionType_} a.createTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.createTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
</if>
<if test="conditionParamRef.containsKey('createUserId')">
<if test="conditionParamRef.createUserId != null ">
${_conditionType_} a.createUserId = #{${_conditionParam_}.createUserId}
</if>
<if test="conditionParamRef.createUserId == null">
${_conditionType_} a.createUserId is null
</if>
</if>
<if test="conditionParamRef.containsKey('createUserIdList') and conditionParamRef.createUserIdList.size() > 0">
${_conditionType_} a.createUserId in
<foreach collection="conditionParamRef.createUserIdList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('createUserIdNotList') and conditionParamRef.createUserIdNotList.size() > 0">
${_conditionType_} a.createUserId not in
<foreach collection="conditionParamRef.createUserIdNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('createUserIdStart') and conditionParamRef.createUserIdStart != null">
${_conditionType_} a.createUserId <![CDATA[ >= ]]> #{${_conditionParam_}.createUserIdStart}
</if>
<if test="conditionParamRef.containsKey('createUserIdEnd') and conditionParamRef.createUserIdEnd != null">
${_conditionType_} a.createUserId <![CDATA[ <= ]]> #{${_conditionParam_}.createUserIdEnd}
</if>
<if test="conditionParamRef.containsKey('updateUserId')">
<if test="conditionParamRef.updateUserId != null ">
${_conditionType_} a.updateUserId = #{${_conditionParam_}.updateUserId}
</if>
<if test="conditionParamRef.updateUserId == null">
${_conditionType_} a.updateUserId is null
</if>
</if>
<if test="conditionParamRef.containsKey('updateUserIdList') and conditionParamRef.updateUserIdList.size() > 0">
${_conditionType_} a.updateUserId in
<foreach collection="conditionParamRef.updateUserIdList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('updateUserIdNotList') and conditionParamRef.updateUserIdNotList.size() > 0">
${_conditionType_} a.updateUserId not in
<foreach collection="conditionParamRef.updateUserIdNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('updateUserIdStart') and conditionParamRef.updateUserIdStart != null">
${_conditionType_} a.updateUserId <![CDATA[ >= ]]> #{${_conditionParam_}.updateUserIdStart}
</if>
<if test="conditionParamRef.containsKey('updateUserIdEnd') and conditionParamRef.updateUserIdEnd != null">
${_conditionType_} a.updateUserId <![CDATA[ <= ]]> #{${_conditionParam_}.updateUserIdEnd}
</if>
<if test="conditionParamRef.containsKey('updateTime')">
<if test="conditionParamRef.updateTime != null ">
${_conditionType_} a.updateTime = #{${_conditionParam_}.updateTime}
</if>
<if test="conditionParamRef.updateTime == null">
${_conditionType_} a.updateTime is null
</if>
</if>
<if test="conditionParamRef.containsKey('updateTimeStart') and conditionParamRef.updateTimeStart != null and conditionParamRef.updateTimeStart!=''">
${_conditionType_} a.updateTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.updateTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s')
</if>
<if test="conditionParamRef.containsKey('updateTimeEnd') and conditionParamRef.updateTimeEnd != null and conditionParamRef.updateTimeEnd!=''">
${_conditionType_} a.updateTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.updateTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
</if>
</sql>
<sql id="_orderCols_">
<if test="orderColList != null and !orderColList.isEmpty()">
order by
<if test="conditionParamRef.containsKey('idList') and conditionParamRef.idList.size() > 0">
field(a.id,
<foreach collection="conditionParamRef.idList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('createUserIdList') and conditionParamRef.createUserIdList.size() > 0">
field(a.createUserId,
<foreach collection="conditionParamRef.createUserIdList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('updateUserIdList') and conditionParamRef.updateUserIdList.size() > 0">
field(a.updateUserId,
<foreach collection="conditionParamRef.updateUserIdList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<trim suffixOverrides="," suffix="">
<foreach collection="orderColList" open="" close="" index="index" item="item" separator=",">
a.${item.colName} ${item.sortKind}
</foreach>
</trim>
</if>
<if test="(orderColList == null or orderColList.isEmpty()) and orderCol != null and !orderCol.isEmpty()">
order by
<if test="conditionParamRef.containsKey('idList') and conditionParamRef.idList.size() > 0">
field(a.id,
<foreach collection="conditionParamRef.idList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('createUserIdList') and conditionParamRef.createUserIdList.size() > 0">
field(a.createUserId,
<foreach collection="conditionParamRef.createUserIdList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('updateUserIdList') and conditionParamRef.updateUserIdList.size() > 0">
field(a.updateUserId,
<foreach collection="conditionParamRef.updateUserIdList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<trim suffixOverrides="," suffix="">
<if test="orderCol.containsKey('id')">
a.id
<if test='orderCol.id != null and "DESC".equalsIgnoreCase(orderCol.id)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('deviceName')">
a.deviceName
<if test='orderCol.deviceName != null and "DESC".equalsIgnoreCase(orderCol.deviceName)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('deviceCode')">
a.deviceCode
<if test='orderCol.deviceCode != null and "DESC".equalsIgnoreCase(orderCol.deviceCode)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('ip')">
a.ip
<if test='orderCol.ip != null and "DESC".equalsIgnoreCase(orderCol.ip)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('username')">
a.username
<if test='orderCol.username != null and "DESC".equalsIgnoreCase(orderCol.username)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('password')">
a.password
<if test='orderCol.password != null and "DESC".equalsIgnoreCase(orderCol.password)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('createTime')">
a.createTime
<if test='orderCol.createTime != null and "DESC".equalsIgnoreCase(orderCol.createTime)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('createUserId')">
a.createUserId
<if test='orderCol.createUserId != null and "DESC".equalsIgnoreCase(orderCol.createUserId)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('updateUserId')">
a.updateUserId
<if test='orderCol.updateUserId != null and "DESC".equalsIgnoreCase(orderCol.updateUserId)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('updateTime')">
a.updateTime
<if test='orderCol.updateTime != null and "DESC".equalsIgnoreCase(orderCol.updateTime)'>DESC</if>
,
</if>
</trim>
</if>
</sql>
<sql id="_group_by_">
<if test="groupList != null and !groupList.isEmpty()">
GROUP BY
<trim suffixOverrides="," suffix="">
<foreach collection="groupList" open="" close="" index="index" item="item" separator=",">
${item}
</foreach>
</trim>
</if>
</sql>
</mapper>
\ No newline at end of file
###登录
POST {{baseUrl}}/login/login
Content-Type: application/json
{
"loginName":"admin",
"password":"admin",
"securityCode":"8888"
}
> {%
client.global.set("SmsSet_id", JSON.parse(response.body).data.id);
client.global.set("authToken", JSON.parse(response.body).data.token);
%}
###门禁设备列表
POST {{baseUrl}}/door/list
Content-Type: application/json
{
"deviceCode":"9ci6cz",
"page":1,
"size":10
}
###门禁设备更新与保存
POST {{baseUrl}}/door/save
Authorization: {{authToken}}
Content-Type: application/json
{
"deviceName":"r1vf4o",
"deviceCode":"a74fjp",
"ip":"nu6vgw",
"username":"ufxpy5",
"password":"9d2qwd",
}
> {%
client.global.set("Door_id", JSON.parse(response.body).data.id);
%}
###门禁设备查看
GET {{baseUrl}}/door/info?id={{Door_id}}
Accept: application/json
###门禁设备编辑
GET {{baseUrl}}/door/edit?id={{Door_id}}
Accept: application/json
###门禁设备删除
GET {{baseUrl}}/door/delete?id={{Door_id}}
Authorization: {{authToken}}
Accept: application/json
......@@ -880,3 +880,25 @@ CREATE TABLE `mortals_sys_holiday`
PRIMARY KEY (`id`)
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '节假日表' ROW_FORMAT = Dynamic;
-- ----------------------------
2023-11-22
-- ----------------------------
-- ----------------------------
-- 门禁设备表
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_door`;
CREATE TABLE mortals_xhx_door(
`id` bigint(20) AUTO_INCREMENT COMMENT '序号,主键,自增长',
`deviceName` varchar(64) COMMENT '设备名称',
`deviceCode` varchar(64) COMMENT '设备编码',
`ip` varchar(64) COMMENT 'Ip地址',
`username` varchar(64) COMMENT '用户名',
`password` varchar(64) COMMENT '密码',
`createTime` datetime COMMENT '创建时间',
`createUserId` bigint(20) COMMENT '创建用户',
`updateUserId` bigint(20) COMMENT '更新用户',
`updateTime` datetime COMMENT '修改时间',
PRIMARY KEY (`id`)
,KEY `deviceCode` (`deviceCode`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='门禁设备';
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment