add(base): 增加机柜旋转功能

- 在 BaseCabinetInfo 模型中添加 isRotate 和 rotateAngle 字段
- 更新 BaseCabinetInfoMapper.xml 中的 SQL 语句,支持旋转相关字段
- 在前端页面中添加旋转相关的表单和表格列
- 更新数据字典,增加旋转状态的选项
IOT
zch 2 months ago
parent 4b01d9acd2
commit 396a28f926

@ -56,8 +56,13 @@ public class BaseCabinetInfo extends BaseEntity
@Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date updatedTime;
/** 是否旋转:1-是;0-否 */
@Excel(name = "是否旋转:1-是;0-否")
private Long isRotate;
/** 旋转角度 */
@Excel(name = "旋转角度")
private BigDecimal rotateAngle;
public void setObjId(Long objId)
{
@ -140,7 +145,24 @@ public class BaseCabinetInfo extends BaseEntity
{
return updatedTime;
}
public void setIsRotate(Long isRotate)
{
this.isRotate = isRotate;
}
public Long getIsRotate()
{
return isRotate;
}
public void setRotateAngle(BigDecimal rotateAngle)
{
this.rotateAngle = rotateAngle;
}
public BigDecimal getRotateAngle()
{
return rotateAngle;
}
@Override
public String toString() {
@ -155,6 +177,8 @@ public class BaseCabinetInfo extends BaseEntity
.append("createdTime", getCreatedTime())
.append("updatedBy", getUpdatedBy())
.append("updatedTime", getUpdatedTime())
.append("isRotate", getIsRotate())
.append("rotateAngle", getRotateAngle())
.toString();
}
}

@ -15,45 +15,35 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="createdTime" column="created_time" />
<result property="updatedBy" column="updated_by" />
<result property="updatedTime" column="updated_time" />
<result property="isRotate" column="is_rotate" />
<result property="rotateAngle" column="rotate_angle" />
</resultMap>
<sql id="selectBaseCabinetInfoVo">
select bci.obj_id,
bci.cabinet_code,
bci.cabinet_alias,
bci.is_checked,
bci.is_flag,
bci.remark,
bci.created_by,
bci.created_time,
bci.updated_by,
bci.updated_time
from base_cabinet_info bci
select obj_id, cabinet_code, cabinet_alias, is_checked, is_flag, remark, created_by, created_time, updated_by, updated_time, is_rotate, rotate_angle from base_cabinet_info
</sql>
<select id="selectBaseCabinetInfoList" parameterType="BaseCabinetInfo" resultMap="BaseCabinetInfoResult">
<include refid="selectBaseCabinetInfoVo"/>
<where>
<if test="objId != null "> and bci.obj_id = #{objId}</if>
<if test="cabinetCode != null "> and bci.cabinet_code = #{cabinetCode}</if>
<if test="cabinetAlias != null and cabinetAlias != ''"> and bci.cabinet_alias like concat('%', #{cabinetAlias}, '%')</if>
<if test="isChecked != null "> and bci.is_checked = #{isChecked}</if>
<if test="isFlag != null "> and bci.is_flag = #{isFlag}</if>
<if test="remark != null and remark != ''"> and bci.remark = #{remark}</if>
<if test="createdBy != null and createdBy != ''"> and bci.created_by = #{createdBy}</if>
<if test="params.beginCreatedTime != null and params.beginCreatedTime != '' and params.endCreatedTime != null and params.endCreatedTime != ''"> and bci.created_time between #{params.beginCreatedTime} and #{params.endCreatedTime}</if>
<if test="updatedBy != null and updatedBy != ''"> and bci.updated_by = #{updatedBy}</if>
<if test="params.beginUpdatedTime != null and params.beginUpdatedTime != '' and params.endUpdatedTime != null and params.endUpdatedTime != ''"> and bci.updated_time between #{params.beginUpdatedTime} and #{params.endUpdatedTime}</if>
<if test="objId != null "> and obj_id = #{objId}</if>
<if test="cabinetCode != null "> and cabinet_code = #{cabinetCode}</if>
<if test="cabinetAlias != null and cabinetAlias != ''"> and cabinet_alias = #{cabinetAlias}</if>
<if test="isChecked != null "> and is_checked = #{isChecked}</if>
<if test="isFlag != null "> and is_flag = #{isFlag}</if>
<if test="remark != null and remark != ''"> and remark = #{remark}</if>
<if test="createdBy != null and createdBy != ''"> and created_by = #{createdBy}</if>
<if test="params.beginCreatedTime != null and params.beginCreatedTime != '' and params.endCreatedTime != null and params.endCreatedTime != ''"> and created_time between #{params.beginCreatedTime} and #{params.endCreatedTime}</if>
<if test="updatedBy != null and updatedBy != ''"> and updated_by = #{updatedBy}</if>
<if test="params.beginUpdatedTime != null and params.beginUpdatedTime != '' and params.endUpdatedTime != null and params.endUpdatedTime != ''"> and updated_time between #{params.beginUpdatedTime} and #{params.endUpdatedTime}</if>
<if test="isRotate != null "> and is_rotate = #{isRotate}</if>
<if test="rotateAngle != null "> and rotate_angle = #{rotateAngle}</if>
</where>
</select>
<select id="selectBaseCabinetInfoByObjId" parameterType="Long" resultMap="BaseCabinetInfoResult">
<include refid="selectBaseCabinetInfoVo"/>
where bci.obj_id = #{objId}
where obj_id = #{objId}
</select>
<insert id="insertBaseCabinetInfo" parameterType="BaseCabinetInfo" useGeneratedKeys="true" keyProperty="objId">
@ -68,6 +58,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createdTime != null">created_time,</if>
<if test="updatedBy != null">updated_by,</if>
<if test="updatedTime != null">updated_time,</if>
<if test="isRotate != null">is_rotate,</if>
<if test="rotateAngle != null">rotate_angle,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="cabinetCode != null">#{cabinetCode},</if>
@ -79,6 +71,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createdTime != null">#{createdTime},</if>
<if test="updatedBy != null">#{updatedBy},</if>
<if test="updatedTime != null">#{updatedTime},</if>
<if test="isRotate != null">#{isRotate},</if>
<if test="rotateAngle != null">#{rotateAngle},</if>
</trim>
</insert>
@ -94,6 +88,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createdTime != null">created_time = #{createdTime},</if>
<if test="updatedBy != null">updated_by = #{updatedBy},</if>
<if test="updatedTime != null">updated_time = #{updatedTime},</if>
<if test="isRotate != null">is_rotate = #{isRotate},</if>
<if test="rotateAngle != null">rotate_angle = #{rotateAngle},</if>
</trim>
where obj_id = #{objId}
</update>

@ -91,6 +91,24 @@
end-placeholder="结束日期"
></el-date-picker>
</el-form-item>-->
<el-form-item label="是否旋转" prop="isRotate">
<el-select v-model="queryParams.isRotate" placeholder="请选择是否旋转" clearable>
<el-option
v-for="dict in dict.type.is_rotate"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<!-- <el-form-item label="旋转角度" prop="rotateAngle">
<el-input
v-model="queryParams.rotateAngle"
placeholder="请输入旋转角度"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>-->
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
@ -171,6 +189,12 @@
<span>{{ parseTime(scope.row.updatedTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>-->
<el-table-column label="是否旋转" align="center" prop="isRotate">
<template slot-scope="scope">
<dict-tag :options="dict.type.is_rotate" :value="scope.row.isRotate"/>
</template>
</el-table-column>
<el-table-column label="旋转角度" align="center" prop="rotateAngle" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
@ -251,6 +275,18 @@
placeholder="请选择更新时间">
</el-date-picker>
</el-form-item>-->
<el-form-item label="是否旋转" prop="isRotate">
<el-radio-group v-model="form.isRotate">
<el-radio
v-for="dict in dict.type.is_rotate"
:key="dict.value"
:label="parseInt(dict.value)"
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="旋转角度" prop="rotateAngle">
<el-input v-model="form.rotateAngle" placeholder="请输入旋转角度" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
@ -265,7 +301,7 @@ import { listBaseCabinetInfo, getBaseCabinetInfo, delBaseCabinetInfo, addBaseCab
export default {
name: "BaseCabinetInfo",
dicts: ['cabinet_is_flag', 'cabinet_is_checked'],
dicts: ['cabinet_is_flag', 'is_rotate', 'cabinet_is_checked'],
data() {
return {
//
@ -304,7 +340,8 @@ export default {
createdTime: null,
updatedBy: null,
updatedTime: null,
isRotate: null,
rotateAngle: null
},
//
form: {},
@ -356,7 +393,8 @@ export default {
createdTime: null,
updatedBy: null,
updatedTime: null,
isRotate: null,
rotateAngle: null
};
this.resetForm("form");
},

Loading…
Cancel
Save