工单表结构修改

This commit is contained in:
2025-12-24 17:12:29 +08:00
parent 812109fcab
commit 6109bc2505
5 changed files with 58 additions and 6 deletions

View File

@@ -232,8 +232,12 @@ CREATE TABLE workcase.tb_workcase(
username VARCHAR(200) NOT NULL, -- 来客姓名
phone VARCHAR(20) NOT NULL, -- 来客电话
type VARCHAR(50) NOT NULL, -- 故障类型
device VARCHAR(50) NOT NULL, -- 设备名称
device_code VARCHAR(50) NOT NULL, -- 设备代码
device VARCHAR(50) DEFAULT NULL, -- 设备名称
device_code VARCHAR(50) DEFAULT NULL, -- 设备代码
device_name_plate VARCHAR(50) DEFAULT NULL, -- 设备名称牌
device_name_plate_img VARCHAR(50) NOT NULL, -- 设备名称牌图片
address VARCHAR(1000) DEFAULT NULL, -- 现场地址
description VARCHAR(1000) DEFAULT NULL, -- 故障描述
imgs VARCHAR(50)[] DEFAULT '{}', -- 工单图片id
emergency VARCHAR(50) NOT NULL DEFAULT 'normal', -- 紧急程度 normal-普通 emergency-紧急
status VARCHAR(50) NOT NULL DEFAULT 'pending', -- 状态 pending-待处理 processing-处理中 done-已完成

View File

@@ -37,9 +37,21 @@ public class TbWorkcaseDTO extends BaseDTO{
@Schema(description = "设备名称")
private String device;
@Schema(description = "设备名称牌")
private String deviceNamePlate;
@Schema(description = "设备名称牌图片")
private String deviceNamePlateImg;
@Schema(description = "设备代码")
private String deviceCode;
@Schema(description = "地址")
private String address;
@Schema(description = "故障描述")
private String description;
@Schema(description = "工单图片列表")
private List<String> imgs;
@@ -52,4 +64,6 @@ public class TbWorkcaseDTO extends BaseDTO{
@Schema(description = "处理人ID")
private String processor;
@Schema(description = "处理人姓名")
private String processorName;
}

View File

@@ -11,6 +11,10 @@
<result column="type" property="type" jdbcType="VARCHAR"/>
<result column="device" property="device" jdbcType="VARCHAR"/>
<result column="device_code" property="deviceCode" jdbcType="VARCHAR"/>
<result column="device_name_plate" property="deviceNamePlate" jdbcType="VARCHAR"/>
<result column="device_name_plate_img" property="deviceNamePlateImg" jdbcType="VARCHAR"/>
<result column="address" property="address" jdbcType="VARCHAR"/>
<result column="description" property="description" jdbcType="VARCHAR"/>
<result column="imgs" property="imgs" jdbcType="ARRAY" typeHandler="org.xyzh.common.jdbc.handler.StringArrayTypeHandler"/>
<result column="emergency" property="emergency" jdbcType="VARCHAR"/>
<result column="status" property="status" jdbcType="VARCHAR"/>
@@ -23,19 +27,29 @@
</resultMap>
<sql id="Base_Column_List">
workcase_id, optsn, user_id, username, phone, type, device, device_code, imgs,
emergency, status, processor, creator, create_time, update_time, delete_time, deleted
workcase_id, optsn, user_id, username, phone, type, device, device_code, device_name_plate, device_name_plate_img,
address, description, imgs, emergency, status, processor, creator, create_time, update_time, delete_time, deleted
</sql>
<insert id="insertWorkcase" parameterType="org.xyzh.api.workcase.dto.TbWorkcaseDTO">
INSERT INTO workcase.tb_workcase (
optsn, workcase_id, user_id, username, phone, type, device, device_code, creator
optsn, workcase_id, user_id, username, phone, type, device_name_plate_img, creator
<if test="device != null">, device</if>
<if test="deviceCode != null">, device_code</if>
<if test="deviceNamePlate != null">, device_name_plate</if>
<if test="address != null">, address</if>
<if test="description != null">, description</if>
<if test="imgs != null">, imgs</if>
<if test="emergency != null">, emergency</if>
<if test="status != null">, status</if>
<if test="processor != null">, processor</if>
) VALUES (
#{optsn}, #{workcaseId}, #{userId}, #{username}, #{phone}, #{type}, #{device}, #{deviceCode}, #{creator}
#{optsn}, #{workcaseId}, #{userId}, #{username}, #{phone}, #{type}, #{deviceNamePlateImg}, #{creator}
<if test="device != null">, #{device}</if>
<if test="deviceCode != null">, #{deviceCode}</if>
<if test="deviceNamePlate != null">, #{deviceNamePlate}</if>
<if test="address != null">, #{address}</if>
<if test="description != null">, #{description}</if>
<if test="imgs != null">, #{imgs, typeHandler=org.xyzh.common.jdbc.handler.StringArrayTypeHandler}</if>
<if test="emergency != null">, #{emergency}</if>
<if test="status != null">, #{status}</if>
@@ -52,6 +66,10 @@
<if test="type != null and type != ''">type = #{type},</if>
<if test="device != null and device != ''">device = #{device},</if>
<if test="deviceCode != null and deviceCode != ''">device_code = #{deviceCode},</if>
<if test="deviceNamePlate != null and deviceNamePlate != ''">device_name_plate = #{deviceNamePlate},</if>
<if test="deviceNamePlateImg != null and deviceNamePlateImg != ''">device_name_plate_img = #{deviceNamePlateImg},</if>
<if test="address != null and address != ''">address = #{address},</if>
<if test="description != null and description != ''">description = #{description},</if>
<if test="imgs != null">imgs = #{imgs, typeHandler=org.xyzh.common.jdbc.handler.StringArrayTypeHandler},</if>
<if test="emergency != null and emergency != ''">emergency = #{emergency},</if>
<if test="status != null and status != ''">status = #{status},</if>

View File

@@ -18,6 +18,12 @@ export interface TbWorkcaseDTO extends BaseDTO {
device?: string
/** 设备代码 */
deviceCode?: string
deviceNamePlate?: string
deviceNamePlateImg: string
/** 地址 */
address?: string
/** 故障描述 */
description?: string
/** 工单图片列表 */
imgs?: string[]
/** 紧急程度 normal-普通 emergency-紧急 */
@@ -26,6 +32,7 @@ export interface TbWorkcaseDTO extends BaseDTO {
status?: 'pending' | 'processing' | 'done'
/** 处理人ID */
processor?: string
processorName?: string
}
/**

View File

@@ -18,6 +18,14 @@ export interface TbWorkcaseDTO extends BaseDTO {
device?: string
/** 设备代码 */
deviceCode?: string
/** 设备名称牌 */
deviceNamePlate?: string
/** 设备名称牌图片 */
deviceNamePlateImg?: string
/** 地址 */
address?: string
/** 故障描述 */
description?: string
/** 工单图片列表 */
imgs?: string[]
/** 紧急程度 normal-普通 emergency-紧急 */
@@ -26,6 +34,7 @@ export interface TbWorkcaseDTO extends BaseDTO {
status?: 'pending' | 'processing' | 'done'
/** 处理人ID */
processor?: string
processorName?: string
}
/**