xiangpei
2025-02-14 c5dafd7dba14635643b4340597fb14c563c8dc7e
flowable/src/main/resources/mapper/ProcessLogMapper.xml
@@ -5,10 +5,13 @@
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.ycl.domain.vo.ProcessLogVO">
        <result column="task_id" property="taskId" />
        <result column="event_type" property="eventType" />
        <result column="task_name" property="taskName" />
        <result column="event_type" property="eventType" typeHandler="com.baomidou.mybatisplus.core.handlers.MybatisEnumTypeHandler"/>
        <result column="project_id" property="projectId" />
        <result column="flow_ins_id" property="flowInsId" />
        <result column="process_ins_id" property="processInsId" />
        <result column="user_id" property="userId" />
        <result column="nick_name" property="nickName" />
        <result column="gmt_create" property="gmtCreate" />
        <result column="event_data_json" property="eventDataJson" />
    </resultMap>
@@ -21,9 +24,10 @@
    <select id="getById" resultMap="BaseResultMap">
        SELECT
            TFL.task_id,
            TFL.task_name,
            TFL.event_type,
            TFL.project_id,
            TFL.flow_ins_id,
            TFL.process_ins_id,
            TFL.user_id,
            TFL.event_data_json,
            TFL.id
@@ -37,11 +41,13 @@
    <select id="getPage" resultMap="BaseResultMap">
        SELECT
            TFL.task_id,
            TFL.task_name,
            TFL.event_type,
            TFL.project_id,
            TFL.flow_ins_id,
            TFL.process_ins_id,
            TFL.user_id,
            TFL.event_data_json,
            TFL.gmt_create,
            TFL.id
        FROM
            t_process_log TFL
@@ -49,4 +55,27 @@
            TFL.deleted = 0
    </select>
    <select id="projectProcessLogPage" resultMap="BaseResultMap">
        SELECT
            TFL.task_id,
            TFL.task_name,
            TFL.event_type,
            TFL.project_id,
            TFL.process_ins_id,
            TFL.user_id,
            CONCAT(SU.nick_name, '(',COALESCE(SD.dept_name, '无部门'), ')') as nick_name,
            TFL.event_data_json,
            TFL.gmt_create,
            TFL.id
        FROM
            t_process_log TFL
                LEFT JOIN sys_user SU ON SU.user_id = TFL.user_id
                LEFT JOIN sys_dept SD ON SU.dept_id = SD.dept_id
        WHERE
            TFL.deleted = 0 AND TFL.project_id = #{query.projectId} AND TFL.process_ins_id = #{query.processInsId}
        ORDER BY
            TFL.gmt_create DESC
    </select>
</mapper>