feat:设备状态字段调整,删除状态字段,改为json字段保存

This commit is contained in:
FCL
2026-02-28 09:08:10 +08:00
parent e32af8bd77
commit aecc3d5eda
11 changed files with 287 additions and 260 deletions

View File

@@ -9,6 +9,97 @@
文档可见https://www.iocoder.cn/MyBatis/x-plugins/
-->
<resultMap id="deviceMap" type="com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceInfomationDO">
<id property="id" column="ID" />
<result property="productId" column="PDT_ID" />
<result property="deviceName" column="DEV_NAME" />
<result property="alias" column="ALS" />
<result property="deviceStatus" column="DEV_STS" />
<result property="inUseFlag" column="IN_USE_FLG" />
<result property="gradeCategory" column="GRD_CTGR" />
<result property="deviceNumber" column="DEV_NUM" />
<result property="deviceCode" column="DEV_CD" />
<result property="assetCode" column="AST_CD" />
<result property="factoryCode" column="FACT_CD" />
<result property="position" column="POS" />
<result property="purchasePrice" column="PRCH_PRC" />
<result property="purchaseDate" column="PRCH_DT" />
<result property="productiveDate" column="PDTV_DT" />
<result property="deployDate" column="DPLY_DT" />
<result property="deployEngineer" column="DPLY_ENGR" />
<result property="deployLocation" column="DPLY_LOC" />
<result property="acceptanceUserId" column="ACPT_USER_ID" />
<result property="acceptanceUserName" column="ACPT_USER_NAME" />
<result property="managerUserId" column="MNGR_USER_ID" />
<result property="managerUserName" column="MNGR_USER_NAME" />
<result property="customFormData" column="CST_FORM_DAT" />
<result property="photo" column="PHTO" />
<result property="deviceParameter" column="DEV_PRM" />
<result property="stateShow" column="STA_SHW" />
<result property="stateStack" column="STA_STK" />
<result property="systemDepartmentCode" column="SYS_DEPT_CD" />
<result property="remark" column="RMK" />
<result property="isConnect" column="IS_CONN" />
<result property="lastConnectTime" column="LST_CONN_TM" />
<result property="collectDeviceType" column="COLT_DEV_TP" />
<result property="companyId" column="COMPANY_ID" />
<result property="companyName" column="COMPANY_NAME" />
<result property="deptId" column="DEPT_ID" />
<result property="deptName" column="DEPT_NAME" />
<result property="postId" column="POST_ID" />
<result property="creatorName" column="CREATOR_NAME" />
<result property="creator" column="CREATOR" />
<result property="updaterName" column="UPDATER_NAME" />
<result property="updater" column="UPDATER" />
<result property="tenantId" column="TENANT_ID" />
<result property="createTime" column="CREATE_TIME" />
<result property="updateTime" column="UPDATE_TIME" />
</resultMap>
<select id="selectPage" resultMap="deviceMap">
SELECT d.* from
T_DEV_INF d
<where>
<if test="param.productId != null">
and d.PDT_ID = #{param.productId}
</if>
<if test="param.deviceName != null and param.deviceName != ''">
and d.DEV_NAME like concat('%',#{param.deviceName},'%')
</if>
<if test="param.alias != null and param.alias != ''">
and d.ALIAS like concat('%',#{param.alias},'%')
</if>
<if test="param.deviceCode != null and param.deviceCode != ''">
and d.DEV_CD like concat('%',#{param.deviceCode},'%')
</if>
<if test="param.position != null and param.position != ''">
and d.POS like concat('%',#{param.position},'%')
</if>
<if test="param.deployLocation != null and param.deployLocation != ''">
and d.DPLY_LOC like concat('%',#{param.deployLocation},'%')
</if>
<if test="param.deviceStatusJson != null and param.deviceStatusJson.Accept != null">
and JSON_VALUE(d.DEV_STS, '$.Accept') = #{param.deviceStatusJson.Accept}
</if>
<if test="param.deviceStatusJson != null and param.deviceStatusJson.Repair != null">
and JSON_VALUE(d.DEV_STS, '$.Repair') = #{param.deviceStatusJson.Repair}
</if>
<if test="param.deviceStatusJson != null and param.deviceStatusJson.Demote != null">
and JSON_VALUE(d.DEV_STS, '$.Demote') = #{param.deviceStatusJson.Demote}
</if>
<if test="param.deviceStatusJson != null and param.deviceStatusJson.Scrap != null">
and JSON_VALUE(d.DEV_STS, '$.Scrap') = #{param.deviceStatusJson.Scrap}
</if>
<if test="param.deviceStatusJson != null and param.deviceStatusJson.Enable != null">
and JSON_VALUE(d.DEV_STS, '$.Enable') = #{param.deviceStatusJson.Enable}
</if>
<if test="param.deviceStatusJson != null and param.deviceStatusJson.Borrow != null">
and JSON_VALUE(d.DEV_STS, '$.Borrow') = #{param.deviceStatusJson.Borrow}
</if>
and d.DELETED = 0
</where>
</select>
<select id="getListNeedByRule" resultType="com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceInfoWithBizConfigVO">
select
d.*,