2025-12-19 11:11:51 +08:00
|
|
|
<?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>
|
|
|
|
|
|
2025-12-31 12:45:26 +08:00
|
|
|
<resultMap id="VOResultMap" type="org.xyzh.api.workcase.vo.WorkcaseProcessVO">
|
|
|
|
|
<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="processor_name" property="processorName" jdbcType="VARCHAR"/>
|
|
|
|
|
<result column="remark" property="remark" jdbcType="VARCHAR"/>
|
|
|
|
|
<result column="creator" property="creator" jdbcType="VARCHAR"/>
|
|
|
|
|
<result column="creator_name" property="creatorName" jdbcType="VARCHAR"/>
|
|
|
|
|
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
2025-12-19 11:11:51 +08:00
|
|
|
<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>
|
|
|
|
|
|
2025-12-31 12:45:26 +08:00
|
|
|
<select id="selectWorkcaseProcessList" resultMap="VOResultMap">
|
|
|
|
|
SELECT p.process_id, p.optsn, p.workcase_id, p.action, p.message, p.files,
|
|
|
|
|
p.processor, p.remark, p.creator, p.create_time,
|
|
|
|
|
COALESCE(u1.username, g1.name) as creator_name,
|
|
|
|
|
COALESCE(u2.username, g2.name) as processor_name
|
|
|
|
|
FROM workcase.tb_workcase_process p
|
|
|
|
|
LEFT JOIN sys.tb_sys_user_info u1 ON p.creator = u1.user_id
|
|
|
|
|
LEFT JOIN sys.tb_guest g1 ON p.creator = g1.user_id
|
|
|
|
|
LEFT JOIN sys.tb_sys_user_info u2 ON p.processor = u2.user_id
|
|
|
|
|
LEFT JOIN sys.tb_guest g2 ON p.processor = g2.user_id
|
2025-12-19 11:11:51 +08:00
|
|
|
<where>
|
|
|
|
|
<if test="filter.processId != null and filter.processId != ''">
|
2025-12-31 12:45:26 +08:00
|
|
|
AND p.process_id = #{filter.processId}
|
2025-12-19 11:11:51 +08:00
|
|
|
</if>
|
|
|
|
|
<if test="filter.workcaseId != null and filter.workcaseId != ''">
|
2025-12-31 12:45:26 +08:00
|
|
|
AND p.workcase_id = #{filter.workcaseId}
|
2025-12-19 11:11:51 +08:00
|
|
|
</if>
|
|
|
|
|
<if test="filter.action != null and filter.action != ''">
|
2025-12-31 12:45:26 +08:00
|
|
|
AND p.action = #{filter.action}
|
2025-12-19 11:11:51 +08:00
|
|
|
</if>
|
|
|
|
|
<if test="filter.processor != null and filter.processor != ''">
|
2025-12-31 12:45:26 +08:00
|
|
|
AND p.processor = #{filter.processor}
|
2025-12-19 11:11:51 +08:00
|
|
|
</if>
|
|
|
|
|
<if test="filter.creator != null and filter.creator != ''">
|
2025-12-31 12:45:26 +08:00
|
|
|
AND p.creator = #{filter.creator}
|
2025-12-19 11:11:51 +08:00
|
|
|
</if>
|
|
|
|
|
</where>
|
2025-12-31 12:45:26 +08:00
|
|
|
ORDER BY p.create_time ASC
|
2025-12-19 11:11:51 +08:00
|
|
|
</select>
|
|
|
|
|
|
2025-12-31 12:45:26 +08:00
|
|
|
<select id="selectWorkcaseProcessPage" resultMap="VOResultMap">
|
|
|
|
|
SELECT p.process_id, p.optsn, p.workcase_id, p.action, p.message, p.files,
|
|
|
|
|
p.processor, p.remark, p.creator, p.create_time,
|
|
|
|
|
COALESCE(u1.username, g1.name) as creator_name,
|
|
|
|
|
COALESCE(u2.username, g2.name) as processor_name
|
|
|
|
|
FROM workcase.tb_workcase_process p
|
|
|
|
|
LEFT JOIN sys.tb_sys_user_info u1 ON p.creator = u1.user_id
|
|
|
|
|
LEFT JOIN sys.tb_guest g1 ON p.creator = g1.user_id
|
|
|
|
|
LEFT JOIN sys.tb_sys_user_info u2 ON p.processor = u2.user_id
|
|
|
|
|
LEFT JOIN sys.tb_guest g2 ON p.processor = g2.user_id
|
2025-12-19 11:11:51 +08:00
|
|
|
<where>
|
|
|
|
|
<if test="filter.processId != null and filter.processId != ''">
|
2025-12-31 12:45:26 +08:00
|
|
|
AND p.process_id = #{filter.processId}
|
2025-12-19 11:11:51 +08:00
|
|
|
</if>
|
|
|
|
|
<if test="filter.workcaseId != null and filter.workcaseId != ''">
|
2025-12-31 12:45:26 +08:00
|
|
|
AND p.workcase_id = #{filter.workcaseId}
|
2025-12-19 11:11:51 +08:00
|
|
|
</if>
|
|
|
|
|
<if test="filter.action != null and filter.action != ''">
|
2025-12-31 12:45:26 +08:00
|
|
|
AND p.action = #{filter.action}
|
2025-12-19 11:11:51 +08:00
|
|
|
</if>
|
|
|
|
|
<if test="filter.processor != null and filter.processor != ''">
|
2025-12-31 12:45:26 +08:00
|
|
|
AND p.processor = #{filter.processor}
|
2025-12-19 11:11:51 +08:00
|
|
|
</if>
|
|
|
|
|
<if test="filter.creator != null and filter.creator != ''">
|
2025-12-31 12:45:26 +08:00
|
|
|
AND p.creator = #{filter.creator}
|
2025-12-19 11:11:51 +08:00
|
|
|
</if>
|
|
|
|
|
</where>
|
2025-12-31 12:45:26 +08:00
|
|
|
ORDER BY p.create_time ASC
|
2025-12-19 11:11:51 +08:00
|
|
|
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>
|