工单模块

This commit is contained in:
2025-12-19 11:11:51 +08:00
parent 41cbe2bd54
commit 409e33abb6
49 changed files with 1934 additions and 323 deletions

View File

@@ -0,0 +1,130 @@
<?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="org.xyzh.workcase.mapper.TbWorkcaseProcessMapper">
<resultMap id="BaseResultMap" type="org.xyzh.api.workcase.dto.TbWorkcaseProcessDTO">
<id column="process_id" property="processId" jdbcType="VARCHAR"/>
<result column="optsn" property="optsn" jdbcType="VARCHAR"/>
<result column="workcase_id" property="workcaseId" jdbcType="VARCHAR"/>
<result column="action" property="action" jdbcType="VARCHAR"/>
<result column="message" property="message" jdbcType="VARCHAR"/>
<result column="files" property="files" jdbcType="ARRAY" typeHandler="org.xyzh.common.jdbc.handler.StringArrayTypeHandler"/>
<result column="processor" property="processor" jdbcType="VARCHAR"/>
<result column="remark" property="remark" jdbcType="VARCHAR"/>
<result column="creator" property="creator" jdbcType="VARCHAR"/>
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
</resultMap>
<sql id="Base_Column_List">
process_id, optsn, workcase_id, action, message, files, processor, remark, creator, create_time
</sql>
<insert id="insertWorkcaseProcess" parameterType="org.xyzh.api.workcase.dto.TbWorkcaseProcessDTO">
INSERT INTO workcase.tb_workcase_process (
optsn, workcase_id, process_id, action, creator
<if test="message != null">, message</if>
<if test="files != null">, files</if>
<if test="processor != null">, processor</if>
<if test="remark != null">, remark</if>
) VALUES (
#{optsn}, #{workcaseId}, #{processId}, #{action}, #{creator}
<if test="message != null">, #{message}</if>
<if test="files != null">, #{files, typeHandler=org.xyzh.common.jdbc.handler.StringArrayTypeHandler}</if>
<if test="processor != null">, #{processor}</if>
<if test="remark != null">, #{remark}</if>
)
</insert>
<update id="updateWorkcaseProcess" parameterType="org.xyzh.api.workcase.dto.TbWorkcaseProcessDTO">
UPDATE workcase.tb_workcase_process
<set>
<if test="action != null and action != ''">action = #{action},</if>
<if test="message != null">message = #{message},</if>
<if test="files != null">files = #{files, typeHandler=org.xyzh.common.jdbc.handler.StringArrayTypeHandler},</if>
<if test="processor != null">processor = #{processor},</if>
<if test="remark != null">remark = #{remark},</if>
</set>
WHERE process_id = #{processId}
</update>
<delete id="deleteWorkcaseProcess">
DELETE FROM workcase.tb_workcase_process
WHERE process_id = #{processId}
</delete>
<select id="selectWorkcaseProcessById" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"/>
FROM workcase.tb_workcase_process
WHERE process_id = #{processId}
</select>
<select id="selectWorkcaseProcessList" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"/>
FROM workcase.tb_workcase_process
<where>
<if test="filter.processId != null and filter.processId != ''">
AND process_id = #{filter.processId}
</if>
<if test="filter.workcaseId != null and filter.workcaseId != ''">
AND workcase_id = #{filter.workcaseId}
</if>
<if test="filter.action != null and filter.action != ''">
AND action = #{filter.action}
</if>
<if test="filter.processor != null and filter.processor != ''">
AND processor = #{filter.processor}
</if>
<if test="filter.creator != null and filter.creator != ''">
AND creator = #{filter.creator}
</if>
</where>
ORDER BY create_time ASC
</select>
<select id="selectWorkcaseProcessPage" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"/>
FROM workcase.tb_workcase_process
<where>
<if test="filter.processId != null and filter.processId != ''">
AND process_id = #{filter.processId}
</if>
<if test="filter.workcaseId != null and filter.workcaseId != ''">
AND workcase_id = #{filter.workcaseId}
</if>
<if test="filter.action != null and filter.action != ''">
AND action = #{filter.action}
</if>
<if test="filter.processor != null and filter.processor != ''">
AND processor = #{filter.processor}
</if>
<if test="filter.creator != null and filter.creator != ''">
AND creator = #{filter.creator}
</if>
</where>
ORDER BY create_time ASC
LIMIT #{pageParam.pageSize} OFFSET #{pageParam.offset}
</select>
<select id="countWorkcaseProcesses" resultType="long">
SELECT COUNT(*)
FROM workcase.tb_workcase_process
<where>
<if test="filter.processId != null and filter.processId != ''">
AND process_id = #{filter.processId}
</if>
<if test="filter.workcaseId != null and filter.workcaseId != ''">
AND workcase_id = #{filter.workcaseId}
</if>
<if test="filter.action != null and filter.action != ''">
AND action = #{filter.action}
</if>
<if test="filter.processor != null and filter.processor != ''">
AND processor = #{filter.processor}
</if>
<if test="filter.creator != null and filter.creator != ''">
AND creator = #{filter.creator}
</if>
</where>
</select>
</mapper>